String labelName,
String language,
String area)
throws SiteTreeException {
DefaultSiteTree tree = null;
Label label = null;
try {
tree = getPublication().getSiteTree(area);
SiteTreeNode node = tree.getNode(documentid);
// if there is only one label left do not delete it.
if (node.getLabels().length > 1) {
// if there are more than one labels in this node
// try to delete the label specified by the labelName.
label = new Label(labelName, language);
tree.removeLabel(documentid, label);
tree.save();
}
} catch (Exception e) {
throw new SiteTreeException(
"Cannot remove label " + label + " from tree " + area,