String targetPath) throws PublicationException {
SiteNode sourceNode = sourceArea.getSite().getNode(sourcePath);
String[] languages = sourceNode.getLanguages();
for (int i = 0; i < languages.length; i++) {
Link sourceLink = sourceNode.getLink(languages[i]);
String label = sourceLink.getLabel();
Document sourceDoc = sourceLink.getDocument();
sourceLink.delete();
Document targetDoc;
if (sourceArea.getName().equals(targetArea.getName())) {
targetDoc = sourceDoc;
} else {
targetDoc = addVersion(sourceDoc, targetArea.getName(), sourceDoc.getLanguage());
copyRevisions(sourceDoc, targetDoc);
sourceDoc.delete();
}
Link link = targetArea.getSite().add(targetPath, targetDoc);
link.setLabel(label);
Assert.isTrue("label set", targetDoc.getLink().getLabel().equals(label));
}
SiteNode targetNode = targetArea.getSite().getNode(targetPath);
targetNode.setVisible(sourceNode.isVisible());
}