Fixed test script to handle the extra isNewNode flag for onCreateChildAssociation

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@6005 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Derek Hulley
2007-06-18 15:29:24 +00:00
parent 494202c860
commit a1d890be94

View File

@@ -26,15 +26,17 @@ if (behaviour.args == null)
}
else
{
if (behaviour.args.length == 1)
if (behaviour.args.length == 2)
{
var childAssoc = behaviour.args[0];
var isNewNode = behaviour.args[1];
logger.log("Assoc type: " + childAssoc.type);
logger.log("Assoc name: " + childAssoc.name);
logger.log("Parent node: " + childAssoc.parent.id);
logger.log("Child node: " + childAssoc.child.id);
logger.log("Is primary: " + childAssoc.isPrimary());
logger.log("Nth sibling: " + childAssoc.nthSibling);
logger.log("Is new node: " + isNewNode);
}
else
{
@@ -45,7 +47,10 @@ else
if (scriptFailed == false)
{
childAssoc.child.addAspect("cm:versionable");
childAssoc.child.save();
if (isNewNode == true)
{
childAssoc.child.addAspect("cm:versionable");
childAssoc.child.save();
}
}