*/
VersionHistory history = versionManager.getVersionHistory(session, node);
if (history == null) {
history = versionManager.createVersionHistory(session, node);
}
Version rootVersion = history.getRootVersion();
// jcr:versionHistory
conditionalAddProperty(
node, QName.JCR_VERSIONHISTORY, PropertyType.REFERENCE, false,
InternalValue.create(new UUID(history.getUUID())));
// jcr:baseVersion
conditionalAddProperty(
node, QName.JCR_BASEVERSION, PropertyType.REFERENCE, false,
InternalValue.create(new UUID(rootVersion.getUUID())));
// jcr:predecessors
conditionalAddProperty(
node, QName.JCR_PREDECESSORS, PropertyType.REFERENCE, true,
InternalValue.create(new UUID(rootVersion.getUUID())));
// jcr:isCheckedOut
conditionalAddProperty(
node, QName.JCR_ISCHECKEDOUT, PropertyType.BOOLEAN, false,
InternalValue.create(true));