r213 - in branches/work_303: . doc lists output

jls17 at arinside.org jls17 at arinside.org
Sun Jul 3 17:02:20 CDT 2011


Author: jls17
Date: Sun Jul  3 17:02:19 2011
New Revision: 213
URL: http://arinside.org/changeset/213

Log:
- prepared CARInside for overlay-mode of server
- added overlay-support for filters and escalations
- ALs, FLTs and ESCs take overlay-mode into account
- moved normalization code to ARListHelpers

Modified:
   branches/work_303/ARInside.cpp
   branches/work_303/ARInside.h
   branches/work_303/doc/DocAlDetails.cpp
   branches/work_303/doc/DocEscalationDetails.cpp
   branches/work_303/doc/DocFilterDetails.cpp
   branches/work_303/doc/DocMain.cpp
   branches/work_303/lists/ARActiveLinkList.cpp
   branches/work_303/lists/AREscalationList.cpp
   branches/work_303/lists/ARFilterList.cpp
   branches/work_303/lists/ARListHelpers.cpp
   branches/work_303/lists/ARListHelpers.h
   branches/work_303/output/FileNaming.cpp

Modified: branches/work_303/ARInside.cpp
==============================================================================
--- branches/work_303/ARInside.cpp	Sun Jul  3 17:01:24 2011	(r212)
+++ branches/work_303/ARInside.cpp	Sun Jul  3 17:02:19 2011	(r213)
@@ -79,6 +79,7 @@
 	this->appConfig = appConfig;
 	this->serverInfoList.clear();
 	this->globalFieldList.clear();
+	this->overlayMode = 1; // TODO: this is the default value for ars764. check for later versions
 
 	this->nDurationLoad = 0;
 	this->nDurationDocumentation = 0;
@@ -183,6 +184,9 @@
 			CARServerInfo serverInfo(this->arControl, this->arStatus);
 			this->srvHostName = serverInfo.GetValue(AR_SERVER_INFO_HOSTNAME);
 			this->srvFullHostName = serverInfo.GetValue(AR_SERVER_INFO_FULL_HOSTNAME);
+#if AR_CURRENT_API_VERSION >= AR_API_VERSION_764
+			this->overlayMode = 1; //TODO: serverInfo.GetIntValue(AR_SERVER_INFO_OVERLAY_MODE);
+#endif
 			cout << "User '" << this->arControl.user <<"' connected to server " << srvFullHostName << endl;
 
 			blackList.LoadFromServer(appConfig.blackList);

Modified: branches/work_303/ARInside.h
==============================================================================
--- branches/work_303/ARInside.h	Sun Jul  3 17:01:24 2011	(r212)
+++ branches/work_303/ARInside.h	Sun Jul  3 17:02:19 2011	(r213)
@@ -92,6 +92,7 @@
 
 	string srvHostName;
 	string srvFullHostName;
+	int overlayMode;
 	CARSchemaList schemaList;
 	CARFilterList filterList;
 	CAREscalationList escalationList;

Modified: branches/work_303/doc/DocAlDetails.cpp
==============================================================================
--- branches/work_303/doc/DocAlDetails.cpp	Sun Jul  3 17:01:24 2011	(r212)
+++ branches/work_303/doc/DocAlDetails.cpp	Sun Jul  3 17:02:19 2011	(r213)
@@ -58,13 +58,13 @@
 				{
 				case AR_OVERLAID_OBJECT:
 					{
-						CARActiveLink ovAl(this->al.GetName());
+						CARActiveLink ovAl(this->al.GetName() + (this->pInside->overlayMode == 0 ? AR_RESERV_OVERLAY_STRING : ""));
 						strmHead << " (Overlaid by " << (ovAl.Exists() ? ovAl.GetURL(rootLevel, false) : "") << ")";
 					}
 					break;
 				case AR_OVERLAY_OBJECT:
 					{
-						CARActiveLink oriAl(this->al.GetName() + AR_RESERV_OVERLAY_STRING);
+						CARActiveLink oriAl(this->al.GetName() + (this->pInside->overlayMode == 1 ? AR_RESERV_OVERLAY_STRING : ""));
 						strmHead << " (Overlay of " << (oriAl.Exists() ? oriAl.GetURL(rootLevel, false) : "") << ")";
 					}
 					break;

Modified: branches/work_303/doc/DocEscalationDetails.cpp
==============================================================================
--- branches/work_303/doc/DocEscalationDetails.cpp	Sun Jul  3 17:01:24 2011	(r212)
+++ branches/work_303/doc/DocEscalationDetails.cpp	Sun Jul  3 17:02:19 2011	(r213)
@@ -46,6 +46,29 @@
 			strmHead.str("");
 
 			strmHead << CWebUtil::LinkToEscalationIndex(this->rootLevel) << MenuSeparator << CWebUtil::ObjName(this->escalation.GetName());
+
+#if AR_CURRENT_API_VERSION >= AR_API_VERSION_764
+			ARValueStruct* overlayProp = CARProplistHelper::Find(this->escalation.GetPropList(), AR_SMOPROP_OVERLAY_PROPERTY);
+			if (overlayProp != NULL && overlayProp->dataType == AR_DATA_TYPE_INTEGER)
+			{
+				switch (overlayProp->u.intVal)
+				{
+				case AR_OVERLAID_OBJECT:
+					{
+						CAREscalation ovEsc(this->escalation.GetName() + (this->pInside->overlayMode == 0 ? AR_RESERV_OVERLAY_STRING : ""));
+						strmHead << " (Overlaid by " << (ovEsc.Exists() ? ovEsc.GetURL(rootLevel, false) : "") << ")";
+					}
+					break;
+				case AR_OVERLAY_OBJECT:
+					{
+						CAREscalation oriEsc(this->escalation.GetName() + (this->pInside->overlayMode == 1 ? AR_RESERV_OVERLAY_STRING : ""));
+						strmHead << " (Overlay of " << (oriEsc.Exists() ? oriEsc.GetURL(rootLevel, false) : "") << ")";
+					}
+					break;
+				}
+			}
+#endif
+
 			if(!this->escalation.GetAppRefName().empty())
 				strmHead << MenuSeparator << " Application " << this->pInside->LinkToContainer(this->escalation.GetAppRefName(), this->rootLevel);
 

Modified: branches/work_303/doc/DocFilterDetails.cpp
==============================================================================
--- branches/work_303/doc/DocFilterDetails.cpp	Sun Jul  3 17:01:24 2011	(r212)
+++ branches/work_303/doc/DocFilterDetails.cpp	Sun Jul  3 17:02:19 2011	(r213)
@@ -45,6 +45,29 @@
 			strmHead.str("");
 
 			strmHead << CWebUtil::LinkToFilterIndex(this->rootLevel) << MenuSeparator << CWebUtil::ObjName(filter.GetName());
+
+#if AR_CURRENT_API_VERSION >= AR_API_VERSION_764
+			ARValueStruct* overlayProp = CARProplistHelper::Find(this->filter.GetPropList(), AR_SMOPROP_OVERLAY_PROPERTY);
+			if (overlayProp != NULL && overlayProp->dataType == AR_DATA_TYPE_INTEGER)
+			{
+				switch (overlayProp->u.intVal)
+				{
+				case AR_OVERLAID_OBJECT:
+					{
+						CARFilter ovFlt(this->filter.GetName() + (this->pInside->overlayMode == 0 ? AR_RESERV_OVERLAY_STRING : ""));
+						strmHead << " (Overlaid by " << (ovFlt.Exists() ? ovFlt.GetURL(rootLevel, false) : "") << ")";
+					}
+					break;
+				case AR_OVERLAY_OBJECT:
+					{
+						CARFilter oriFlt(this->filter.GetName() + (this->pInside->overlayMode == 1 ? AR_RESERV_OVERLAY_STRING : ""));
+						strmHead << " (Overlay of " << (oriFlt.Exists() ? oriFlt.GetURL(rootLevel, false) : "") << ")";
+					}
+					break;
+				}
+			}
+#endif
+
 			if(!filter.GetAppRefName().empty())
 				strmHead << MenuSeparator << " Application " << this->pInside->LinkToContainer(filter.GetAppRefName(), this->rootLevel);
 

Modified: branches/work_303/doc/DocMain.cpp
==============================================================================
--- branches/work_303/doc/DocMain.cpp	Sun Jul  3 17:01:24 2011	(r212)
+++ branches/work_303/doc/DocMain.cpp	Sun Jul  3 17:02:19 2011	(r213)
@@ -239,10 +239,15 @@
 			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 (val != NULL && val->dataType == AR_DATA_TYPE_INTEGER)
 				{
-					// if the object is overlaid, dont show it on the list
-					bInsert = false;
+					if (this->pInside->overlayMode == 1 && val->u.intVal == AR_OVERLAID_OBJECT)
+						// if the server has overlayMode enabled and the current object is overlaid, dont show it on the list
+						bInsert = false;
+
+					if (this->pInside->overlayMode == 0 && (val->u.intVal == AR_OVERLAY_OBJECT || val->u.intVal == AR_CUSTOM_OBJECT))
+						// if the serve has overlayMode disabled and the current object is a overlay or custom, hide it.
+						bInsert = false;
 				}
 			}
 #endif
@@ -418,6 +423,23 @@
 					bInsert = true;
 			}
 
+#if AR_CURRENT_API_VERSION >= AR_API_VERSION_764
+			if (bInsert)
+			{
+				ARValueStruct* val = CARProplistHelper::Find(pInside->filterList.FilterGetPropList(filterIndex), AR_SMOPROP_OVERLAY_PROPERTY);
+				if (val != NULL && val->dataType == AR_DATA_TYPE_INTEGER)
+				{
+					if (this->pInside->overlayMode == 1 && val->u.intVal == AR_OVERLAID_OBJECT)
+						// if the server has overlayMode enabled and the current object is overlaid, dont show it on the list
+						bInsert = false;
+
+					if (this->pInside->overlayMode == 0 && (val->u.intVal == AR_OVERLAY_OBJECT || val->u.intVal == AR_CUSTOM_OBJECT))
+						// if the serve has overlayMode disabled and the current object is a overlay or custom, hide it.
+						bInsert = false;
+				}
+			}
+#endif
+
 			if(bInsert)
 			{
 				tbl.AddRow(filterIndex, rootLevel);
@@ -625,6 +647,23 @@
 					bInsert = true;
 			}
 
+#if AR_CURRENT_API_VERSION >= AR_API_VERSION_764
+			if (bInsert)
+			{
+				ARValueStruct* val = CARProplistHelper::Find(pInside->escalationList.EscalationGetPropList(escalIndex), AR_SMOPROP_OVERLAY_PROPERTY);
+				if (val != NULL && val->dataType == AR_DATA_TYPE_INTEGER)
+				{
+					if (this->pInside->overlayMode == 1 && val->u.intVal == AR_OVERLAID_OBJECT)
+						// if the server has overlayMode enabled and the current object is overlaid, dont show it on the list
+						bInsert = false;
+
+					if (this->pInside->overlayMode == 0 && (val->u.intVal == AR_OVERLAY_OBJECT || val->u.intVal == AR_CUSTOM_OBJECT))
+						// if the serve has overlayMode disabled and the current object is a overlay or custom, hide it.
+						bInsert = false;
+				}
+			}
+#endif
+
 			if(bInsert)
 			{
 				tbl.AddRow(escalIndex, rootLevel);

Modified: branches/work_303/lists/ARActiveLinkList.cpp
==============================================================================
--- branches/work_303/lists/ARActiveLinkList.cpp	Sun Jul  3 17:01:24 2011	(r212)
+++ branches/work_303/lists/ARActiveLinkList.cpp	Sun Jul  3 17:02:19 2011	(r213)
@@ -432,48 +432,7 @@
 	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;
-				}
-			}
-		}
+		NormalizeNameListForSorting(names, objProps);
 #endif
 
 		GenerateSortableList sortableContent(names);
@@ -488,33 +447,7 @@
 	}
 
 #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;
-				}
-			}
-		}
-	}
+	NormalizeNameListToRealNames(names, objProps);
 #endif
 }
 

Modified: branches/work_303/lists/AREscalationList.cpp
==============================================================================
--- branches/work_303/lists/AREscalationList.cpp	Sun Jul  3 17:01:24 2011	(r212)
+++ branches/work_303/lists/AREscalationList.cpp	Sun Jul  3 17:02:19 2011	(r213)
@@ -106,6 +106,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
+
 	// ok, now retrieve all informations of the escalations we need
 	if (ARGetMultipleEscalations(&arIn->arControl,
 		0,
@@ -276,6 +287,10 @@
 {
 	if (GetCount() > 0)
 	{
+#if AR_CURRENT_API_VERSION >= AR_API_VERSION_764
+		NormalizeNameListForSorting(names, objProps);
+#endif
+
 		GenerateSortableList sortableContent(names);
 		std::sort(sortedList.begin(),sortedList.end(),SortByName(sortableContent));
 	}
@@ -286,4 +301,8 @@
 	{
 		searchList[string(names.nameList[sortedList[i]])] = i;
 	}
+
+#if AR_CURRENT_API_VERSION >= AR_API_VERSION_764
+	NormalizeNameListToRealNames(names, objProps);
+#endif
 }

Modified: branches/work_303/lists/ARFilterList.cpp
==============================================================================
--- branches/work_303/lists/ARFilterList.cpp	Sun Jul  3 17:01:24 2011	(r212)
+++ branches/work_303/lists/ARFilterList.cpp	Sun Jul  3 17:02:19 2011	(r213)
@@ -112,6 +112,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 filters we need
 	if (ARGetMultipleFilters(&arIn->arControl,
@@ -400,6 +411,10 @@
 {
 	if (GetCount() > 0)
 	{
+#if AR_CURRENT_API_VERSION >= AR_API_VERSION_764
+		NormalizeNameListForSorting(names, objProps);
+#endif
+
 		GenerateSortableList sortableContent(names);
 		std::sort(sortedList.begin(),sortedList.end(),SortByName(sortableContent));
 	}
@@ -410,6 +425,10 @@
 	{
 		searchList[string(names.nameList[sortedList[i]])] = i;
 	}
+
+#if AR_CURRENT_API_VERSION >= AR_API_VERSION_764
+	NormalizeNameListToRealNames(names, objProps);
+#endif
 }
 
 string CARFilterList::FilterGetURL(unsigned int index, int rootLevel)

Modified: branches/work_303/lists/ARListHelpers.cpp
==============================================================================
--- branches/work_303/lists/ARListHelpers.cpp	Sun Jul  3 17:01:24 2011	(r212)
+++ branches/work_303/lists/ARListHelpers.cpp	Sun Jul  3 17:02:19 2011	(r213)
@@ -16,6 +16,7 @@
 
 #include "stdafx.h"
 #include "ARListHelpers.h"
+#include "../ARInside.h"
 
 GenerateSortableList::GenerateSortableList(ARNameList &list)
 {
@@ -99,4 +100,100 @@
 ARNameList* GenerateSortableList::GetList()
 {
 	return theList;
+}
+
+/////// additional functions ///////
+void NormalizeNameListForSorting(ARNameList &names, ARPropListList &objProps)
+{
+	// Since ARS 7.6.4 we have two workflow layers, like an object inherited from another. It
+	// uses layer-numbering, where 0 is the base layer mostly used for out-of-the-box stuff and
+	// 1 is the custom layer. You can switch the active layer on the server. If layer 0 is
+	// active only out of the box workflow is executed and visible to clients (WUT/midtier).
+	// If layer 1 is active (this is the default) all workflow is inherited from layer 0 and
+	// extended by custom workflow or overlaid ones contained in layer 1. ARInside should
+	// always document the current workflow execution model, so we have to take the Overlay-
+	// Mode into account.
+	// overlayMode 0 = only origin workflow should be visible (no custom, no overlay)
+	// overlayMode 1 = origin, custom and overlaid workflow should be visible
+	// In later version of ARSystem there might be more layers available.
+
+	// for overlays we need to rename the object names accordingly
+	unsigned int count = min(names.numItems, objProps.numItems);
+	for (unsigned int idx = 0; idx < count; ++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:
+				{
+					if (CARInside::GetInstance()->overlayMode == 1)
+					{
+						// 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:
+				{
+					if (CARInside::GetInstance()->overlayMode == 1)
+					{
+						// 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;
+			}
+		}
+	}
+}
+
+void NormalizeNameListToRealNames(ARNameList &names, ARPropListList &objProps)
+{
+	// now make sure the real object names are used
+	unsigned int count = min(names.numItems, objProps.numItems);
+	for (unsigned int idx = 0; idx < count; ++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:  // this occurs if overlayMode = 1
+			case AR_OVERLAY_OBJECT:   // this occurs if overlayMode = 0
+				{
+					// 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;
+			}
+		}
+	}
 }
\ No newline at end of file

Modified: branches/work_303/lists/ARListHelpers.h
==============================================================================
--- branches/work_303/lists/ARListHelpers.h	Sun Jul  3 17:01:24 2011	(r212)
+++ branches/work_303/lists/ARListHelpers.h	Sun Jul  3 17:02:19 2011	(r213)
@@ -45,3 +45,6 @@
 {
 	void operator()(C* p) { delete p; }
 };
+
+void NormalizeNameListForSorting(ARNameList &names, ARPropListList &objProps);
+void NormalizeNameListToRealNames(ARNameList &names, ARPropListList &objProps);

Modified: branches/work_303/output/FileNaming.cpp
==============================================================================
--- branches/work_303/output/FileNaming.cpp	Sun Jul  3 17:01:24 2011	(r212)
+++ branches/work_303/output/FileNaming.cpp	Sun Jul  3 17:02:19 2011	(r213)
@@ -1454,15 +1454,38 @@
 
 ///////////////////////////////////////////////////////////////////////////////
 // object nameing helper functions
-bool IsObjectOverlaid(const CARActiveLink* obj)
+bool IsObjectOverlaid(ARValueStruct* val)
 {
+	// the goal is to give the executed worklow object the real filename. By default the
+	// overlay uses the real object name. If the Overlay-Mode is set to 0, only origin
+	// objects are executed. Those objects should get the real names as file name, not
+	// the overlays.
+
+	if (val != NULL && val->dataType == AR_DATA_TYPE_INTEGER)
+	{
 #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;
+		CARInside* pInside = CARInside::GetInstance();
+		// if overlayMode is 1 the name of the overlaid-object (origin object) is extended with "__o"
+		if (pInside->overlayMode == 1 && val->u.intVal == AR_OVERLAID_OBJECT)
+			return true;
+
+		// if overlayMode is 0 the name of the overlay-object is extended with "__o"
+		if (pInside->overlayMode == 0 && val->u.intVal == AR_OVERLAY_OBJECT)
+			return true;
 #endif
+	}
+	
 	return false;
 }
+template<class T>
+bool IsObjectOverlaid(const T* obj)
+{
+	ARValueStruct* val = NULL;
+#if AR_CURRENT_API_VERSION >= AR_API_VERSION_764
+	val = CARProplistHelper::Find(obj->GetPropList(), AR_SMOPROP_OVERLAY_PROPERTY);
+#endif
+	return IsObjectOverlaid(val);
+}
 
 ///////////////////////////////////////////////////////////////////////////////
 // object name file naming classes
@@ -1662,7 +1685,7 @@
 {
 public:
 	ObjectNameFilterDetail(const CARFilter* flt) : obj(flt) { }
-	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_FILTER; }
 	virtual unsigned int GetRootLevel() const { return 1; }
@@ -1674,7 +1697,7 @@
 {
 public:
 	ObjectNameEscalationDetail(const CAREscalation* esc) : obj(esc) { }
-	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_ESCALATION; }
 	virtual unsigned int GetRootLevel() const { return 1; }


More information about the arinside-src mailing list