code: @Override
     protected void entering(NodeData node, int level) throws RepositoryException
     {
  
        if (ancestorToSave == null)
        {
           ancestorToSave = curParent().getQPath();
        }
  
        NodeData parent = curParent();
        QPath qpath = calculateNewNodePath(node, level);
        // Calc order number if parent supports orderable nodes...
        // If ordering is supported by the node type of the parent node of the new
        // location, then the newly moved node is appended to the end of the child node list.
        int orderNum = 0;
        if (level == 0
           && ntManager.isOrderableChildNodesSupported(parent.getPrimaryTypeName(), parent.getMixinTypeNames()))
        {
           orderNum = calculateNewNodeOrderNumber();
        }
        else
        {
           orderNum = node.getOrderNumber(); // has no matter
        }
        String id = keepIdentifiers ? node.getIdentifier() : IdGenerator.generate();
  
        AccessControlList acl = parent.getACL();
  
        boolean isPrivilegeable =
           ntManager.isNodeType(Constants.EXO_PRIVILEGEABLE, node.getPrimaryTypeName(), node.getMixinTypeNames());
  
        boolean isOwneable =
           ntManager.isNodeType(Constants.EXO_OWNEABLE, node.getPrimaryTypeName(), node.getMixinTypeNames());
  
        if (isPrivilegeable || isOwneable)
        {
           List<AccessControlEntry> permissionEntries = new ArrayList<AccessControlEntry>();
           permissionEntries.addAll((isPrivilegeable ? node.getACL() : parent.getACL()).getPermissionEntries());
  
           String owner = isOwneable ? node.getACL().getOwner() : parent.getACL().getOwner();
  
           acl = new AccessControlList(owner, permissionEntries);
        }
  
        TransientNodeData newNode =
           new TransientNodeData(qpath, id, -1, node.getPrimaryTypeName(), node.getMixinTypeNames(), orderNum,
              parent.getIdentifier(), acl);
  
        parents.push(newNode);
  
        // ancestorToSave is a parent node
        // if level == 0 set internal createt as false for validating on save
        itemAddStates.add(new ItemState(newNode, ItemState.ADDED, true, ancestorToSave, level != 0));
     }
docs: {@inheritDoc}