// Create new Node
ItemState state = ItemState.createAddedState(nodeData, false);
NodeImpl node = (NodeImpl)dataManager.update(state, true);
NodeTypeDataManager ntmanager = session.getWorkspace().getNodeTypesHolder();
ItemAutocreator itemAutocreator = new ItemAutocreator(ntmanager, valueFactory, dataManager, true);
PlainChangesLog changes =
itemAutocreator.makeAutoCreatedItems(node.nodeData(), primaryTypeName, dataManager, session.getUserID());
for (ItemState autoCreatedState : changes.getAllStates())
{
dataManager.updateItemState(autoCreatedState);
}
// addAutoCreatedItems(node.nodeData(), primaryTypeName);