// jcr:versionableUuid
TransientPropertyData vhVersionableUuid = TransientPropertyData
// [PN] 10.04.07 VERSIONABLEUUID isn't referenceable!!!
.createPropertyData(versionHistory, Constants.JCR_VERSIONABLEUUID, PropertyType.STRING, false);
vhVersionableUuid.setValue(new TransientValueData(new Identifier(versionable.getIdentifier())));
// ------ jcr:versionLabels ------
NodeData vhVersionLabels =
TransientNodeData
.createNodeData(versionHistory, Constants.JCR_VERSIONLABELS, Constants.NT_VERSIONLABELS);
// jcr:primaryType
TransientPropertyData vlPrimaryType =
TransientPropertyData.createPropertyData(vhVersionLabels, Constants.JCR_PRIMARYTYPE, PropertyType.NAME,
false);
vlPrimaryType.setValue(new TransientValueData(vhVersionLabels.getPrimaryTypeName()));
// ------ jcr:rootVersion ------
NodeData rootVersionData =
TransientNodeData.createNodeData(versionHistory, Constants.JCR_ROOTVERSION, Constants.NT_VERSION,
baseVersionIdentifier);
// jcr:primaryType
TransientPropertyData rvPrimaryType =
TransientPropertyData.createPropertyData(rootVersionData, Constants.JCR_PRIMARYTYPE, PropertyType.NAME,
false);
rvPrimaryType.setValue(new TransientValueData(rootVersionData.getPrimaryTypeName()));
// jcr:uuid
TransientPropertyData rvUuid =
TransientPropertyData
.createPropertyData(rootVersionData, Constants.JCR_UUID, PropertyType.STRING, false);
rvUuid.setValue(new TransientValueData(baseVersionIdentifier));
// jcr:mixinTypes
TransientPropertyData rvMixinTypes =
TransientPropertyData.createPropertyData(rootVersionData, Constants.JCR_MIXINTYPES, PropertyType.NAME,
true);
rvMixinTypes.setValue(new TransientValueData(Constants.MIX_REFERENCEABLE));
// jcr:created
TransientPropertyData rvCreated =
TransientPropertyData.createPropertyData(rootVersionData, Constants.JCR_CREATED, PropertyType.DATE,
false);
// TODO Current time source was
// rvCreated.setValue(new
// TransientValueData(dataManager.getTransactManager().getStorageDataManager
// ().getCurrentTime()));
rvCreated.setValue(new TransientValueData(Calendar.getInstance()));
// ----- VERSIONABLE properties -----
// jcr:versionHistory
TransientPropertyData vh =
TransientPropertyData.createPropertyData(versionable, Constants.JCR_VERSIONHISTORY,
PropertyType.REFERENCE, false);
vh.setValue(new TransientValueData(new Identifier(versionHistoryIdentifier)));
// jcr:baseVersion
TransientPropertyData bv =
TransientPropertyData.createPropertyData(versionable, Constants.JCR_BASEVERSION, PropertyType.REFERENCE,
false);
bv.setValue(new TransientValueData(new Identifier(baseVersionIdentifier)));
// jcr:predecessors
TransientPropertyData pd =
TransientPropertyData.createPropertyData(versionable, Constants.JCR_PREDECESSORS,
PropertyType.REFERENCE, true);
pd.setValue(new TransientValueData(new Identifier(baseVersionIdentifier)));
// update all
QPath vpath = versionable.getQPath();
changes.add(new ItemState(versionHistory, ItemState.ADDED, true, vpath));
changes.add(new ItemState(vhPrimaryType, ItemState.ADDED, true, vpath));