NameConstants.JCR_PRIMARYTYPE, PropertyType.NAME, false).getId());
pt.setMultiValued(false);
pt.setType(PropertyType.NAME);
pt.setValues(new InternalValue[]{InternalValue.create(NameConstants.REP_VERSIONSTORAGE)});
root.addPropertyName(pt.getName());
ChangeLog cl = new ChangeLog();
cl.added(root);
cl.added(pt);
pMgr.store(cl);
}
// check for jcr:activities
if (!pMgr.exists(activitiesId)) {
NodeState root = pMgr.createNew(activitiesId);
root.setParentId(storageId);
root.setDefinitionId(ntReg.getEffectiveNodeType(NameConstants.REP_VERSIONSTORAGE).getApplicableChildNodeDef(
NameConstants.JCR_ACTIVITIES, NameConstants.REP_ACTIVITIES, ntReg).getId());
root.setNodeTypeName(NameConstants.REP_ACTIVITIES);
PropertyState pt = pMgr.createNew(new PropertyId(activitiesId, NameConstants.JCR_PRIMARYTYPE));
pt.setDefinitionId(ntReg.getEffectiveNodeType(NameConstants.REP_ACTIVITIES).getApplicablePropertyDef(
NameConstants.JCR_PRIMARYTYPE, PropertyType.NAME, false).getId());
pt.setMultiValued(false);
pt.setType(PropertyType.NAME);
pt.setValues(new InternalValue[]{InternalValue.create(NameConstants.REP_ACTIVITIES)});
root.addPropertyName(pt.getName());
// add activities as child
NodeState historyState = pMgr.load(storageId);
historyState.addChildNodeEntry(NameConstants.JCR_ACTIVITIES, activitiesId);
ChangeLog cl = new ChangeLog();
cl.added(root);
cl.added(pt);
cl.modified(historyState);
pMgr.store(cl);
}
sharedStateMgr = createItemStateManager(pMgr, storageId, ntReg, cacheFactory, ismLocking);