Merged HEAD-BUG-FIX to HEAD (4.2)

55492: MNT-9647: Merged V4.1-BUG-FIX (4.1.7) to HEAD-BUG-FIX (4.2)
      55055: MNT-9446 : Share working copy nodes assume cm:original association is present
         - Using "cm:workingcopylink" association instead of "cm:original"


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@55794 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Alan Davis
2013-09-21 16:08:19 +00:00
parent c72553b725
commit 3587426e42

View File

@@ -59,19 +59,28 @@ var Evaluator =
// Working Copy? // Working Copy?
if (node.hasAspect("{http://www.alfresco.org/model/content/1.0}workingcopy")) if (node.hasAspect("{http://www.alfresco.org/model/content/1.0}workingcopy"))
{ {
var wcNode = node.assocs["cm:original"][0]; var wcLink = node.sourceAssocs["cm:workingcopylink"];
workingCopy["isWorkingCopy"] = true; var isWorkingCopy = wcLink != null;
workingCopy["sourceNodeRef"] = wcNode.nodeRef; if (isWorkingCopy)
if (wcNode.hasAspect("{http://www.alfresco.org/model/content/1.0}versionable"))
{ {
workingCopy["workingCopyVersion"] = wcNode.properties["cm:versionLabel"]; var wcNode = wcLink[0];
} workingCopy["isWorkingCopy"] = true;
workingCopy["sourceNodeRef"] = wcNode.nodeRef;
if (wcNode.hasAspect("{http://www.alfresco.org/model/content/1.0}versionable"))
{
workingCopy["workingCopyVersion"] = wcNode.properties["cm:versionLabel"];
}
// Google Doc? // Google Doc?
if (node.hasAspect("{http://www.alfresco.org/model/googledocs/1.0}googleResource")) if (node.hasAspect("{http://www.alfresco.org/model/googledocs/1.0}googleResource"))
{
// Property is duplicated here for convenience
workingCopy["googleDocUrl"] = node.properties["gd:url"];
}
}
else
{ {
// Property is duplicated here for convenience logger.error("Node: " + node.nodeRef +" hasn't \"cm:workingcopylink\" association");
workingCopy["googleDocUrl"] = node.properties["gd:url"];
} }
} }
// Locked? // Locked?