* (e.g. those defined by mix:referenceable, mix:versionable,
* mix:lockable, et.al.)
*
* todo FIXME delegate to 'node type instance handler'
*/
EffectiveNodeType ent = itemOps.getEffectiveNodeType(node);
if (ent.includesNodeType(NameConstants.MIX_SIMPLE_VERSIONABLE)) {
/**
* check if there's already a version history for that
* node; this would e.g. be the case if a versionable node
* had been exported, removed and re-imported with either
* IMPORT_UUID_COLLISION_REMOVE_EXISTING or
* IMPORT_UUID_COLLISION_REPLACE_EXISTING;
* otherwise create a new version history
*/
VersionHistoryInfo history =
versionManager.getVersionHistory(session, node, null);
InternalValue historyId = InternalValue.create(
history.getVersionHistoryId());
InternalValue versionId = InternalValue.create(
history.getRootVersionId());
// jcr:isCheckedOut
conditionalAddProperty(
node, NameConstants.JCR_ISCHECKEDOUT,
PropertyType.BOOLEAN, false, InternalValue.create(true));
// set extra properties only for full versionable nodes
if (ent.includesNodeType(NameConstants.MIX_VERSIONABLE)) {
// jcr:versionHistory
conditionalAddProperty(
node, NameConstants.JCR_VERSIONHISTORY,
PropertyType.REFERENCE, false, historyId);