private void moveOrClonePage(ResourceResolver rr, PageManager manager, String contentPath, String destinationParent, ResourceResolver res) throws WCMException, PersistenceException { Resource source = rr.getResource(getSourcePath()); if (resourceExists(res, contentPath)) { manager.move(source, getDestinationPath(), getPreviousSibling(), true, true, listToStringArray(getAllReferences()), listToStringArray(getPublishedReferences())); } else if (!resourceExists(res, getDestinationPath())) { Resource parent = res.getResource(destinationParent); res.create(parent, source.getName(), getClonedProperties(source)); } res.commit(); res.refresh(); }