// the node that we're trying to publish
// doesn't have this language
throw new SiteException("The node " + sourceDocument.getPath()
+ " doesn't contain a label for language " + sourceDocument.getLanguage());
}
Link link = sourceNode.getLink(sourceDocument.getLanguage());
SiteTreeNode destinationNode = (SiteTreeNode) destinationTree.getNode(destinationDocument.getPath());
if (destinationNode == null) {
if (siblingPath == null) {
destinationTree.addNode(destinationDocument.getPath(),
destinationDocument.getUUID(),
sourceNode.isVisible(),
sourceNode.getHref(),
sourceNode.getSuffix(),
sourceNode.hasLink());
destinationTree.addLabel(destinationDocument.getPath(),
destinationDocument.getLanguage(),
link.getLabel());
} else {
destinationTree.addNode(destinationDocument.getPath(),
destinationDocument.getUUID(),
sourceNode.isVisible(),
sourceNode.getHref(),
sourceNode.getSuffix(),
sourceNode.hasLink(),
siblingPath);
destinationTree.addLabel(destinationDocument.getPath(),
destinationDocument.getLanguage(),
link.getLabel());
}
} else {
// if the node already exists in the live
// tree simply insert the label in the
// live tree
destinationDocument.getLink().setLabel(link.getLabel());
}
} catch (DocumentException e) {
throw new SiteException(e);
}