protected void copyInSiteStructure(Document sourceDoc, Document destDoc, String destPath)
throws PublicationException, DocumentException, SiteException {
String destArea = destDoc.getArea();
SiteStructure destSite = sourceDoc.getPublication().getArea(destArea).getSite();
if (sourceDoc.hasLink()) {
if (destDoc.hasLink()) {
Link srcLink = sourceDoc.getLink();
Link destLink = destDoc.getLink();
destLink.setLabel(srcLink.getLabel());
destLink.getNode().setVisible(srcLink.getNode().isVisible());
} else {
String label = sourceDoc.getLink().getLabel();
boolean visible = sourceDoc.getLink().getNode().isVisible();
if (destSite.contains(sourceDoc.getLink().getNode().getPath())) {
addToSiteManager(destPath, destDoc, label, visible);
} else {
String followingSiblingPath = null;
if (sourceDoc.getPath().equals(destPath)) {
SiteStructure sourceSite = sourceDoc.area().getSite();
SiteNode[] sourceSiblings;
SiteNode sourceNode = sourceDoc.getLink().getNode();
if (sourceNode.isTopLevel()) {
sourceSiblings = sourceSite.getTopLevelNodes();
} else if (sourceNode.getParent() != null) {
sourceSiblings = sourceNode.getParent().getChildren();
} else {
sourceSiblings = new SiteNode[1];
sourceSiblings[0] = sourceNode;