r212 - in branches/work_303: . core doc lists output

jls17 at arinside.org jls17 at arinside.org
Sun Jul 3 17:01:27 CDT 2011


Author: jls17
Date: Sun Jul  3 17:01:24 2011
New Revision: 212
URL: http://arinside.org/changeset/212

Log:
- added overlay support for active links
- SVN post build action is only executed if a .svn directory exists
- CAREscalation: constructor to search for an escalation name and Exists method added
- link between base- and overlay-object added
- activelink-overview doesn't show overlaid-objects (object within the base-layer)
- changed generated page-links of CRefItems from "byName" to "byInternalId". This makes sure the link is created to correct page (because now we could have multiple objects with the same name)
- class for activelink-filenaming now checks the overlay-property to generate different filenames for base- and overlay object (both object have the same name)

Modified:
   branches/work_303/ARApi.h
   branches/work_303/ARInside.cpp
   branches/work_303/ARInside.h
   branches/work_303/ARInside.vcproj
   branches/work_303/core/AREscalation.cpp
   branches/work_303/core/AREscalation.h
   branches/work_303/doc/DocAlDetails.cpp
   branches/work_303/doc/DocFieldDetails.cpp
   branches/work_303/doc/DocImageDetails.cpp
   branches/work_303/doc/DocMain.cpp
   branches/work_303/doc/DocValidator.cpp
   branches/work_303/lists/ARActiveLinkList.cpp
   branches/work_303/output/FileNaming.cpp

Modified: branches/work_303/ARApi.h
==============================================================================
--- branches/work_303/ARApi.h	Sun Jul  3 17:00:39 2011	(r211)
+++ branches/work_303/ARApi.h	Sun Jul  3 17:01:24 2011	(r212)
@@ -29,6 +29,21 @@
 #endif
 #endif
 
+// this is just a workarround for a missing definition in ar.h version 7.6.04
+#ifdef AR_SESS_CONTROL_PROP_DESIGN_OVERLAYGROUP
+#undef AR_SESS_CONTROL_PROP_DESIGN_OVERLAYGROUP
+#endif
+#define AR_SESS_CONTROL_PROP_DESIGN_OVERLAYGROUP 1961
+
+#ifdef AR_SESS_CONTROL_PROP_API_OVERLAYGROUP
+#undef AR_SESS_CONTROL_PROP_API_OVERLAYGROUP
+#endif
+#define AR_SESS_CONTROL_PROP_API_OVERLAYGROUP 1962
+
+#ifndef AR_RESERV_OVERLAY_STRING
+#define AR_RESERV_OVERLAY_STRING "__o"
+#endif
+
 // to support our own xml object types used in lists
 #define AR_STRUCT_ITEM_USER    500
 #define AR_STRUCT_ITEM_GROUP   501

Modified: branches/work_303/ARInside.cpp
==============================================================================
--- branches/work_303/ARInside.cpp	Sun Jul  3 17:00:39 2011	(r211)
+++ branches/work_303/ARInside.cpp	Sun Jul  3 17:01:24 2011	(r212)
@@ -1301,9 +1301,9 @@
 	return strmTmp.str();
 }
 
-string CARInside::LinkToAlRef(const string &alName, int rootLevel)
+string CARInside::LinkToAlRef(const CRefItem& refItem, int rootLevel)
 {
-	CARActiveLink al(alName);
+	CARActiveLink al(refItem.GetObjectId());
 	if (!al.Exists())
 		return EmptyValue;
 
@@ -1333,25 +1333,22 @@
 
 string CARInside::LinkToFilterRef(int filterInsideId, int rootLevel)
 {	
-	if (filterInsideId > -1)
+	CARFilter flt(filterInsideId);
+	if (flt.Exists())
 	{
-		CARFilter flt(filterInsideId);
 		return LinkToFilterRef(&flt, rootLevel);
 	}
 	return EmptyValue;
 }
 
-string CARInside::LinkToFilterRef(string fltName, int rootLevel)
+string CARInside::LinkToFilterRef(const CRefItem& refItem, int rootLevel)
 {
-	if (fltName.empty()) return fltName;
-
-	int fltInsideId = filterList.Find(fltName.c_str());
-	if (fltInsideId > -1)
+	CARFilter flt(refItem.GetObjectId());
+	if (flt.Exists())
 	{
-		CARFilter flt(fltInsideId);
 		return LinkToFilterRef(&flt, rootLevel);
 	}
-	return fltName;
+	return EmptyValue;
 }
 
 string CARInside::LinkToFilterRef(CARFilter* filter, int rootLevel)
@@ -1397,18 +1394,37 @@
 	return "<span class=\"fieldNotFound\">" + menuName + "</span>";
 }
 
-string CARInside::LinkToEscalation(string escalationName, int fromRootLevel)
+string CARInside::LinkToMenu(const CRefItem& refItem, int rootLevel)
 {
-	int objInsideId = escalationList.Find(escalationName.c_str());
+	CARCharMenu menu(refItem.GetObjectId());
+	if (menu.Exists())
+	{
+		return menu.GetURL(rootLevel);
+	}
 
-	if (objInsideId > -1)
+	return EmptyValue;
+}
+
+string CARInside::LinkToEscalation(const string& escalationName, int fromRootLevel)
+{
+	CAREscalation escal(escalationName);
+	if (escal.Exists())
 	{
-		CAREscalation escal(objInsideId);
 		return escal.GetURL(fromRootLevel);
 	}
 	return escalationName;
 }
 
+string CARInside::LinkToEscalation(const CRefItem& refItem, int fromRootLevel)
+{
+	CAREscalation escal(refItem.GetObjectId());
+	if (escal.Exists())
+	{
+		return escal.GetURL(fromRootLevel);
+	}
+	return EmptyValue;
+}
+
 string CARInside::LinkToContainer(string containerName, int fromRootLevel)
 {
 	CARContainer cnt(containerName);
@@ -1419,6 +1435,16 @@
 	return containerName;
 }
 
+string CARInside::LinkToContainer(const CRefItem& refItem, int rootLevel)
+{
+	CARContainer cnt(refItem.GetObjectId());
+	if (cnt.Exists())
+	{
+		return cnt.GetURL(rootLevel);
+	}
+	return EmptyValue;
+}
+
 string CARInside::LinkToServerInfo(string srvName, int rootLevel)
 {		
 	string result;
@@ -1440,55 +1466,50 @@
 	return result;
 }
 
-string CARInside::LinkToXmlObjType(int arsStructItemType, const string &objName, int rootLevel)
-{
-	return LinkToXmlObjType(arsStructItemType, objName, -1, rootLevel);
-}
-
-string CARInside::LinkToXmlObjType(int arsStructItemType, const string &objName, int subObjId, int rootLevel)
+string CARInside::LinkToObjByRefItem(const CRefItem& refItem, int rootLevel)
 {
 	string result = EmptyValue;
 
-	switch(arsStructItemType)
+	switch(refItem.GetObjectType())
 	{
 	case AR_STRUCT_ITEM_XML_ACTIVE_LINK: 
 		{
-			result = this->LinkToAlRef(objName, rootLevel);
+			result = this->LinkToAlRef(refItem, rootLevel);
 		}
 		break;
 	case AR_STRUCT_ITEM_XML_FILTER:
 		{
-			result = this->LinkToFilterRef(objName, rootLevel);
+			result = this->LinkToFilterRef(refItem, rootLevel);
 		}
 		break;
 	case AR_STRUCT_ITEM_XML_SCHEMA:
 		{
-			result = this->LinkToSchema(objName, rootLevel);
+			result = this->LinkToSchema(refItem.GetObjectName(), rootLevel);
 		}
 		break;
 	case AR_STRUCT_ITEM_XML_FIELD:
 		{
-			result = this->LinkToField(objName, subObjId, rootLevel);
+			result = this->LinkToField(refItem.GetObjectId(), refItem.GetSubObjectId(), rootLevel);
 		}
 		break;
 	case AR_STRUCT_ITEM_XML_VUI:
 		{
-			result = this->LinkToVui(objName, subObjId, rootLevel);
+			result = this->LinkToVui(refItem.GetObjectId(), refItem.GetSubObjectId(), rootLevel);
 		}
 		break;
 	case AR_STRUCT_ITEM_XML_ESCALATION:
 		{
-			result = this->LinkToEscalation(objName, rootLevel);
+			result = this->LinkToEscalation(refItem, rootLevel);
 		}
 		break;
 	case AR_STRUCT_ITEM_XML_CHAR_MENU:
 		{
-			result = this->LinkToMenu(objName, rootLevel);
+			result = this->LinkToMenu(refItem, rootLevel);
 		}
 		break;		
 	case AR_STRUCT_ITEM_XML_CONTAINER:
 		{
-			result = this->LinkToContainer(objName, rootLevel);
+			result = this->LinkToContainer(refItem, rootLevel);
 		}
 		break;
 //#if AR_CURRENT_API_VERSION >= AR_API_VERSION_750

Modified: branches/work_303/ARInside.h
==============================================================================
--- branches/work_303/ARInside.h	Sun Jul  3 17:00:39 2011	(r211)
+++ branches/work_303/ARInside.h	Sun Jul  3 17:01:24 2011	(r212)
@@ -111,8 +111,7 @@
 #endif
 
 	string LinkToServerInfo(string srvName, int rootLevel);
-	string LinkToXmlObjType(int arsStructItemType, const string &objName, int subObjId, int rootLevel);
-	string LinkToXmlObjType(int arsStructItemType, const string &objName, int rootLevel);
+	string LinkToObjByRefItem(const CRefItem& refItem, int rootLevel);
 	string XmlObjEnabled(int arsStructItemType, string objName);
 	string XmlObjEnabled(CARServerObject *obj);
 
@@ -126,22 +125,25 @@
 	string LinkToMenuField(int schemaInsideId, int fieldInsideId, int fromRootLevel);
 
 	string LinkToContainer(string containerName, int rootLevel);
+	string LinkToContainer(const CRefItem& refItem, int rootLevel);
 	string LinkToAl(const string& alName, int rootLevel);
 	string LinkToAl(int alInsideId, int rootLevel);
-	string LinkToAlRef(const string &alName, int rootLevel);
+	string LinkToAlRef(const CRefItem& refItem, int rootLevel);
 	string LinkToFilter(string filterName, int rootLevel);	
 	string LinkToFilterRef(int filterInsideId, int rootLevel);	
-	string LinkToFilterRef(string fltName, int rootLevel);	
+	string LinkToFilterRef(const CRefItem& refItem, int rootLevel);
 	string LinkToFilterRef(CARFilter* filter, int rootLevel);
 #if AR_CURRENT_API_VERSION >= AR_API_VERSION_750
 	string LinkToImage(unsigned int imageIndex, int rootLevel);
 	string LinkToImage(const string &imageName, int rootLevel);
 #endif
 	string LinkToMenu(string menuName, int rootLevel);
+	string LinkToMenu(const CRefItem& refItem, int rootLevel);
 	string LinkToSchema(const string& schemaName, int fromRootLevel);
 	string LinkToSchema(int insideId, int fromRootLevel);
 	string LinkToSchemaIndex(string indexName, int schemaInsideId, int fromRootLevel);	
-	string LinkToEscalation(string escalationName, int rootLevel);
+	string LinkToEscalation(const string& escalationName, int fromRootLevel);
+	string LinkToEscalation(const CRefItem& refItem, int fromRootLevel);
 	string LinkToUser(string loginName, int rootLevel);	
 	string LinkToSchemaTypeList(int schemaType, int rootLevel);	
 	string LinkToGroup(const string& appRefName, int permissionId, int rootLevel);

Modified: branches/work_303/ARInside.vcproj
==============================================================================
--- branches/work_303/ARInside.vcproj	Sun Jul  3 17:00:39 2011	(r211)
+++ branches/work_303/ARInside.vcproj	Sun Jul  3 17:01:24 2011	(r212)
@@ -28,7 +28,7 @@
 			>
 			<Tool
 				Name="VCPreBuildEventTool"
-				CommandLine="SubWCRev.exe "$(SolutionDir)\." "$(ProjectDir)svnrev_template.h" "$(ProjectDir)svnrev.h""
+				CommandLine="IF EXIST $(InputDir)\.svn\ SubWCRev.exe "$(SolutionDir)\." "$(ProjectDir)svnrev_template.h" "$(ProjectDir)svnrev.h""
 			/>
 			<Tool
 				Name="VCCustomBuildTool"
@@ -45,7 +45,7 @@
 			<Tool
 				Name="VCCLCompilerTool"
 				Optimization="0"
-				AdditionalIncludeDirectories=".\Tclap;..\..\Api750\include;.\;..\..\libs\zlib\include;"
+				AdditionalIncludeDirectories=".\Tclap;..\..\Api763\include;.\;..\..\libs\zlib\include;"
 				PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE;AR_STRICT_ANSI;ARINSIDE_ENABLE_ZLIB_SUPPORT"
 				MinimalRebuild="true"
 				BasicRuntimeChecks="3"
@@ -66,9 +66,9 @@
 			/>
 			<Tool
 				Name="VCLinkerTool"
-				AdditionalDependencies="arapi75.lib arxmlutil75.lib zlibwapi.lib"
+				AdditionalDependencies="arapi7603_build001.lib arxmlutil7603_build001.lib zlibwapi.lib"
 				LinkIncremental="2"
-				AdditionalLibraryDirectories="..\..\Api750\lib;..\..\libs\zlib\lib"
+				AdditionalLibraryDirectories="..\..\Api763\lib;..\..\libs\zlib\lib"
 				GenerateDebugInformation="true"
 				SubSystem="1"
 				LargeAddressAware="2"

Modified: branches/work_303/core/AREscalation.cpp
==============================================================================
--- branches/work_303/core/AREscalation.cpp	Sun Jul  3 17:00:39 2011	(r211)
+++ branches/work_303/core/AREscalation.cpp	Sun Jul  3 17:01:24 2011	(r212)
@@ -24,6 +24,12 @@
 {
 }
 
+CAREscalation::CAREscalation(const string& name)
+: CARServerObject(-1)
+{
+	insideId = CARInside::GetInstance()->escalationList.Find(name.c_str());
+}
+
 CAREscalation::~CAREscalation(void)
 {
 }
@@ -44,6 +50,11 @@
 	return CWebUtil::Link(this->GetName(), file, (showImage ? "escalation.gif" : ""), rootLevel);
 }
 
+bool CAREscalation::Exists()
+{
+	return (insideId >= 0 && (unsigned int)insideId < CARInside::GetInstance()->escalationList.GetCount());
+}
+
 string CAREscalation::GetTimeCriteria()
 {
 	stringstream strm;

Modified: branches/work_303/core/AREscalation.h
==============================================================================
--- branches/work_303/core/AREscalation.h	Sun Jul  3 17:00:39 2011	(r211)
+++ branches/work_303/core/AREscalation.h	Sun Jul  3 17:01:24 2011	(r212)
@@ -22,8 +22,11 @@
 {
 public:
 	CAREscalation(int insideId);
+	CAREscalation(const string& name);
 	~CAREscalation(void);
 
+	bool Exists();
+
 	// implement functions inherited from CARObject
 	string GetName();
 	string GetName() const;

Modified: branches/work_303/doc/DocAlDetails.cpp
==============================================================================
--- branches/work_303/doc/DocAlDetails.cpp	Sun Jul  3 17:00:39 2011	(r211)
+++ branches/work_303/doc/DocAlDetails.cpp	Sun Jul  3 17:01:24 2011	(r212)
@@ -49,6 +49,29 @@
 			props = new CARProplistHelper(&this->al.GetPropList());
 
 			strmHead << CWebUtil::LinkToActiveLinkIndex(this->rootLevel) << MenuSeparator << CWebUtil::ObjName(this->al.GetName());
+
+#if AR_CURRENT_API_VERSION >= AR_API_VERSION_764
+			ARValueStruct* overlayProp = CARProplistHelper::Find(this->al.GetPropList(), AR_SMOPROP_OVERLAY_PROPERTY);
+			if (overlayProp != NULL && overlayProp->dataType == AR_DATA_TYPE_INTEGER)
+			{
+				switch (overlayProp->u.intVal)
+				{
+				case AR_OVERLAID_OBJECT:
+					{
+						CARActiveLink ovAl(this->al.GetName());
+						strmHead << " (Overlaid by " << (ovAl.Exists() ? ovAl.GetURL(rootLevel, false) : "") << ")";
+					}
+					break;
+				case AR_OVERLAY_OBJECT:
+					{
+						CARActiveLink oriAl(this->al.GetName() + AR_RESERV_OVERLAY_STRING);
+						strmHead << " (Overlay of " << (oriAl.Exists() ? oriAl.GetURL(rootLevel, false) : "") << ")";
+					}
+					break;
+				}
+			}
+#endif
+
 			if(!this->al.GetAppRefName().empty())
 				strmHead << MenuSeparator << " Application " << this->pInside->LinkToContainer(this->al.GetAppRefName(), this->rootLevel);
 

Modified: branches/work_303/doc/DocFieldDetails.cpp
==============================================================================
--- branches/work_303/doc/DocFieldDetails.cpp	Sun Jul  3 17:00:39 2011	(r211)
+++ branches/work_303/doc/DocFieldDetails.cpp	Sun Jul  3 17:01:24 2011	(r212)
@@ -176,7 +176,7 @@
 
 			CTableRow row("cssStdRow");
 			row.AddCell(CAREnum::XmlStructItem(iter->GetObjectType()));				
-			row.AddCell(this->pInside->LinkToXmlObjType(iter->GetObjectType(), iter->GetObjectName(), iter->GetSubObjectId(), rootLevel));
+			row.AddCell(this->pInside->LinkToObjByRefItem(*iter, rootLevel));
 
 			bool hasEnabledFlag;
 			unsigned int enabled = iter->GetObjectEnabled(hasEnabledFlag);
@@ -1127,7 +1127,7 @@
 
 			CTableRow row("cssStdRow");
 			row.AddCell(CTableCell(order));
-			row.AddCell(pInside->LinkToXmlObjType(curIt->GetObjectType(), curIt->GetObjectName(), curIt->GetSubObjectId(), rootLevel));
+			row.AddCell(pInside->LinkToObjByRefItem(*curIt, rootLevel));
 			row.AddCell(CTableCell(CAREnum::ObjectEnable(enabled), cssEnabled));
 			row.AddCell(execution);
 			tblRef.AddRow(row);

Modified: branches/work_303/doc/DocImageDetails.cpp
==============================================================================
--- branches/work_303/doc/DocImageDetails.cpp	Sun Jul  3 17:00:39 2011	(r211)
+++ branches/work_303/doc/DocImageDetails.cpp	Sun Jul  3 17:01:24 2011	(r212)
@@ -143,7 +143,7 @@
 		{			
 			CTableRow row("cssStdRow");		
 			row.AddCell(CAREnum::XmlStructItem(curIt->GetObjectType()));				
-			row.AddCell(pInside->LinkToXmlObjType(curIt->GetObjectType(), curIt->GetObjectName(), curIt->GetSubObjectId(), rootLevel));
+			row.AddCell(pInside->LinkToObjByRefItem(*curIt, rootLevel));
 
 			string tmpEnabled = "";
 			string tmpCssEnabled = "";

Modified: branches/work_303/doc/DocMain.cpp
==============================================================================
--- branches/work_303/doc/DocMain.cpp	Sun Jul  3 17:00:39 2011	(r211)
+++ branches/work_303/doc/DocMain.cpp	Sun Jul  3 17:01:24 2011	(r212)
@@ -235,6 +235,18 @@
 					bInsert = true;
 			}
 
+#if AR_CURRENT_API_VERSION >= AR_API_VERSION_764
+			if (bInsert)
+			{
+				ARValueStruct* val = CARProplistHelper::Find(pInside->alList.ActiveLinkGetPropList(alIdx), AR_SMOPROP_OVERLAY_PROPERTY);
+				if (val != NULL && val->dataType == AR_DATA_TYPE_INTEGER && val->u.intVal == AR_OVERLAID_OBJECT)
+				{
+					// if the object is overlaid, dont show it on the list
+					bInsert = false;
+				}
+			}
+#endif
+
 			if(bInsert)
 			{
 				tbl.AddRow(alIdx, rootLevel);

Modified: branches/work_303/doc/DocValidator.cpp
==============================================================================
--- branches/work_303/doc/DocValidator.cpp	Sun Jul  3 17:00:39 2011	(r211)
+++ branches/work_303/doc/DocValidator.cpp	Sun Jul  3 17:01:24 2011	(r212)
@@ -472,7 +472,7 @@
 						{
 							CTableRow row("cssStdRow");		
 							row.AddCell(CTableCell(CAREnum::XmlStructItem(curIt->second.GetObjectType())));
-							row.AddCell(CTableCell(this->pInside->LinkToXmlObjType(curIt->second.GetObjectType(), curIt->second.GetObjectName(), curIt->second.GetSubObjectId(), rootLevel)));
+							row.AddCell(CTableCell(this->pInside->LinkToObjByRefItem(curIt->second, rootLevel)));
 
 							bool supportsEnabled;
 							unsigned int enabled = curIt->second.GetObjectEnabled(supportsEnabled);
@@ -563,7 +563,7 @@
 
 						row.AddCell(curIt->first);
 						row.AddCell(CAREnum::XmlStructItem(arsObjectType));
-						row.AddCell(pInside->LinkToXmlObjType(arsObjectType, curRefIt->GetObjectName(), curRefIt->GetSubObjectId(), rootLevel));
+						row.AddCell(pInside->LinkToObjByRefItem(*curRefIt, rootLevel));
 
 						stringstream strm;
 						strm << curRefIt->GetDescription(rootLevel);

Modified: branches/work_303/lists/ARActiveLinkList.cpp
==============================================================================
--- branches/work_303/lists/ARActiveLinkList.cpp	Sun Jul  3 17:00:39 2011	(r211)
+++ branches/work_303/lists/ARActiveLinkList.cpp	Sun Jul  3 17:01:24 2011	(r212)
@@ -115,6 +115,17 @@
 			cerr << arIn->GetARStatusError(&status);
 	}
 
+#if AR_CURRENT_API_VERSION >= AR_API_VERSION_764
+	if (arIn->CompareServerVersion(7,6,4) >= 0)
+	{
+		ARValueStruct value;
+		value.dataType = AR_DATA_TYPE_CHAR;
+		value.u.charVal = AR_OVERLAY_CLIENT_MODE_FULL;
+		if (ARSetSessionConfiguration(&arIn->arControl, AR_SESS_CONTROL_PROP_API_OVERLAYGROUP, &value, &status) != AR_RETURN_OK)
+			cerr << "SetSessionConfiguration failed: " << arIn->GetARStatusError(&status);
+	}
+#endif
+
 #ifndef ARINSIDE_DISABLE_FAST_LOADING 
 	// ok, now retrieve all informations of the active links we need
 	if (ARGetMultipleActiveLinks(&arIn->arControl,
@@ -420,6 +431,51 @@
 {
 	if (GetCount() > 0)
 	{
+#if AR_CURRENT_API_VERSION >= AR_API_VERSION_764
+		// for overlays we need to rename the object names accordingly
+		for (unsigned int idx = 0; idx < GetCount(); ++idx)
+		{
+			ARValueStruct* val = CARProplistHelper::Find(objProps.propsList[idx], AR_SMOPROP_OVERLAY_PROPERTY);
+
+			if (val != NULL && val->dataType == AR_DATA_TYPE_INTEGER)
+			{
+				switch (val->u.intVal)
+				{
+				case AR_OVERLAID_OBJECT:
+					{
+						// add the AR_RESERVED_OVERLAY_STRING to the end of the name .. this becomes the original object: "__o" ;-)
+						strncat(names.nameList[idx], AR_RESERV_OVERLAY_STRING, AR_MAX_NAME_SIZE);
+						names.nameList[idx][AR_MAX_NAME_SIZE] = 0;
+					}
+					break;
+				case AR_OVERLAY_OBJECT:
+					{
+						// strip the AR_RESERVED_OVERLAY_STRING from end of the name, so it gets the real object name
+						size_t nameLen = strnlen(names.nameList[idx], AR_MAX_NAME_SIZE);
+						if (nameLen > 3)
+						{
+							nameLen -= 3;
+							if (strcmp(&names.nameList[idx][nameLen], AR_RESERV_OVERLAY_STRING) == 0)
+								names.nameList[idx][nameLen] = 0;
+						}
+					}
+				case AR_CUSTOM_OBJECT:
+					{
+						// strip the AR_RESERV_OVERLAY_CUSTOM_STRING from end of the name, so it gets the real object name
+						size_t nameLen = strnlen(names.nameList[idx], AR_MAX_NAME_SIZE);
+						if (nameLen > 3)
+						{
+							nameLen -= 3;
+							if (strcmp(&names.nameList[idx][nameLen], AR_RESERV_OVERLAY_CUSTOM_STRING) == 0)
+								names.nameList[idx][nameLen] = 0;
+						}
+					}
+					break;
+				}
+			}
+		}
+#endif
+
 		GenerateSortableList sortableContent(names);
 		std::sort(sortedList.begin(),sortedList.end(),SortByName(sortableContent));
 	}
@@ -430,6 +486,36 @@
 	{
 		searchList[string(names.nameList[sortedList[i]])] = i;
 	}
+
+#if AR_CURRENT_API_VERSION >= AR_API_VERSION_764
+	if (GetCount() > 0)
+	{
+		// now make sure the real object names are used
+		for (unsigned int idx = 0; idx < GetCount(); ++idx)
+		{
+			ARValueStruct* val = CARProplistHelper::Find(objProps.propsList[idx], AR_SMOPROP_OVERLAY_PROPERTY);
+
+			if (val != NULL && val->dataType == AR_DATA_TYPE_INTEGER)
+			{
+				switch (val->u.intVal)
+				{
+				case AR_OVERLAID_OBJECT:
+					{
+						// strip the AR_RESERVED_OVERLAY_STRING again, so it gets the real object name
+						size_t nameLen = strnlen(names.nameList[idx], AR_MAX_NAME_SIZE);
+						if (nameLen > 3)
+						{
+							nameLen -= 3;
+							if (strcmp(&names.nameList[idx][nameLen], AR_RESERV_OVERLAY_STRING) == 0)
+								names.nameList[idx][nameLen] = 0;
+						}
+					}
+					break;
+				}
+			}
+		}
+	}
+#endif
 }
 
 string CARActiveLinkList::ActiveLinkGetURL(unsigned int index, int rootLevel)

Modified: branches/work_303/output/FileNaming.cpp
==============================================================================
--- branches/work_303/output/FileNaming.cpp	Sun Jul  3 17:00:39 2011	(r211)
+++ branches/work_303/output/FileNaming.cpp	Sun Jul  3 17:01:24 2011	(r212)
@@ -1425,7 +1425,7 @@
 
 ///////////////////////////////////////////////////////////////////////////////
 // object name file name generator
-string GetFileNameOfObjectName(const string &objName)
+string GetFileNameOfObjectName(const string &objName, bool isOverlaid)
 {
 	stringstream strmTmp;
 	strmTmp << hex;
@@ -1442,9 +1442,28 @@
 			strmTmp << '~' << (int)c;
 		}
 	}
+	if (isOverlaid)
+		strmTmp << AR_RESERV_OVERLAY_STRING;
 	return strmTmp.str();
 }
 
+string GetFileNameOfObjectName(const string &objName)
+{
+	return GetFileNameOfObjectName(objName, false);
+}
+
+///////////////////////////////////////////////////////////////////////////////
+// object nameing helper functions
+bool IsObjectOverlaid(const CARActiveLink* obj)
+{
+#if AR_CURRENT_API_VERSION >= AR_API_VERSION_764
+	ARValueStruct* val = CARProplistHelper::Find(obj->GetPropList(), AR_SMOPROP_OVERLAY_PROPERTY);
+	if (val != NULL && val->dataType == AR_DATA_TYPE_INTEGER && val->u.intVal == AR_OVERLAID_OBJECT)
+		return true;
+#endif
+	return false;
+}
+
 ///////////////////////////////////////////////////////////////////////////////
 // object name file naming classes
 class ObjectNameSchemaDetail : public IFileStructure
@@ -1607,7 +1626,7 @@
 {
 public:
 	ObjectNameActiveLinkDetail(const CARActiveLink* al) : obj(al) { }
-	virtual string GetFileName() const { return GetFileNameOfObjectName(obj->GetName()); }
+	virtual string GetFileName() const { return GetFileNameOfObjectName(obj->GetName(), IsObjectOverlaid(obj)); }
 	virtual string GetFullFileName() const { return GetPath() + "/" + CWebUtil::DocName(GetFileName()); }
 	virtual string GetPath() const { return DIR_ACTLINK; }
 	virtual unsigned int GetRootLevel() const { return 1; }


More information about the arinside-src mailing list