WikiNode newNode = n.duplicate(true);
newNode.setName(pastedName);
newNode.setWikiname(WikiUtil.convertToWikiName(pastedName));
newNode.setParent(getInstance());
newNode.setAreaNumber(getInstance().getAreaNumber());
UserDAO userDAO = (UserDAO)Component.getInstance(UserDAO.class);
newNode.setCreatedBy(userDAO.findUser(n.getCreatedBy().getId()));
if (n.getLastModifiedBy() != null) {
newNode.setLastModifiedBy(userDAO.findUser(n.getLastModifiedBy().getId()));
}
restrictedEntityManager.persist(newNode);
}
}
log.debug("completed executing of paste batch");