+ }\r
+ }\r
+\r
+ Node target;\r
+ boolean passedStatus = false;\r
+ if (source.hasNode(SlcNames.SLC_AGGREGATED_STATUS))\r
+ passedStatus = source\r
+ .getNode(SlcNames.SLC_AGGREGATED_STATUS)\r
+ .getProperty(SlcNames.SLC_SUCCESS).getBoolean();\r
+\r
+ boolean isActionUnderMyResult = source.getPath()\r
+ .startsWith(\r
+ SlcJcrResultUtils\r
+ .getMyResultsBasePath(session));\r
+\r
+ if (!isActionUnderMyResult) {// Copy\r
+ target = targetParentNode.addNode(source.getName(),\r
+ source.getPrimaryNodeType().getName());\r
+ JcrUtils.copy(source, target);\r
+ } else {// move\r
+ String sourcePath = source.getPath();\r
+ String destPath = targetParentNode.getPath() + "/"\r
+ + name;\r
+ session.move(sourcePath, destPath);\r
+ // Update passed status of the parent source Node\r
+ ResultParentUtils\r
+ .updatePassedStatus(session.getNode(JcrUtils\r
+ .parentPath(sourcePath)), true);\r
+ target = session.getNode(destPath);\r
+\r
+ }\r
+ if (!target.isNodeType(NodeType.MIX_TITLE))\r
+ target.addMixin(NodeType.MIX_TITLE);\r
+ target.setProperty(Property.JCR_TITLE, name);\r
+ ResultParentUtils.updatePassedStatus(target.getParent(),\r
+ passedStatus);\r
+ session.save();\r