{
throw new VersionException("Node is aborted " + node.getQPath().getAsString());
}
else if (action == OnParentVersionAction.COPY)
{
AccessControlList acl =
ntManager.isNodeType(Constants.EXO_PRIVILEGEABLE, node.getPrimaryTypeName(), node.getMixinTypeNames())
? node.getACL() : currentNode().getACL();
QPath frozenPath = QPath.makeChildPath(currentNode().getQPath(), qname, node.getQPath().getIndex());
frozenNode =
new TransientNodeData(frozenPath, IdGenerator.generate(), node.getPersistedVersion(), node
.getPrimaryTypeName(), node.getMixinTypeNames(), node.getOrderNumber(), currentNode().getIdentifier(), // parent
acl);
contextNodes.push(frozenNode);
changesLog.add(ItemState.createAddedState(frozenNode));
}
else if (action == OnParentVersionAction.VERSION)
{
if (ntManager.isNodeType(Constants.MIX_VERSIONABLE, node.getPrimaryTypeName(), node.getMixinTypeNames()))
{
frozenNode =
TransientNodeData.createNodeData(currentNode(), qname, Constants.NT_VERSIONEDCHILD, node.getQPath()
.getIndex());
PropertyData pt =
TransientPropertyData.createPropertyData(frozenNode, Constants.JCR_PRIMARYTYPE, PropertyType.NAME,
false, new TransientValueData(Constants.NT_VERSIONEDCHILD));
ValueData vh =
((PropertyData)dataManager.getItemData(node, new QPathEntry(Constants.JCR_VERSIONHISTORY, 0),
ItemType.PROPERTY)).getValues().get(0);
PropertyData pd =
TransientPropertyData.createPropertyData(frozenNode, Constants.JCR_CHILDVERSIONHISTORY,
PropertyType.REFERENCE, false, vh);
contextNodes.push(null);
changesLog.add(ItemState.createAddedState(frozenNode));
changesLog.add(ItemState.createAddedState(pt));
changesLog.add(ItemState.createAddedState(pd));
}
else
{ // behaviour of COPY
AccessControlList acl =
ntManager.isNodeType(Constants.EXO_PRIVILEGEABLE, node.getPrimaryTypeName(), node.getMixinTypeNames())
? node.getACL() : currentNode().getACL();
QPath frozenPath = QPath.makeChildPath(currentNode().getQPath(), qname, node.getQPath().getIndex());
frozenNode =