ServiceSelector selector = null;
TreeSiteManager siteManager = null;
try {
selector = (ServiceSelector) this.manager.lookup(SiteManager.ROLE + "Selector");
siteManager = (TreeSiteManager) selector.select(this.publication.getSiteManagerHint());
SiteTree siteTree = siteManager.getTree(this.identityMap, this.publication, siteArea);
String label = "";
String isFolder = "";
// FIXME: don't hardcode area label
if (siteArea.equals(Publication.AUTHORING_AREA))
label = "Authoring";
if (siteArea.equals(Publication.ARCHIVE_AREA))
label = "Archive";
if (siteArea.equals(Publication.TRASH_AREA))
label = "Trash";
if (siteArea.equals(Publication.LIVE_AREA))
label = "Live";
if (siteArea.equals(Publication.STAGING_AREA))
label = "Staging";
if (siteTree.getTopNodes().length > 0)
isFolder = "true";
else
isFolder = "false";
this.attributes.clear();
this.attributes.addAttribute("", ATTR_AREA, ATTR_AREA, "CDATA", siteArea);
this.attributes.addAttribute("", ATTR_FOLDER, ATTR_FOLDER, "CDATA", isFolder);
this.attributes.addAttribute("", ATTR_LABEL, ATTR_LABEL, "CDATA", label);
startNode(NODE_SITE);
if (this.area.equals(siteArea)) {
generateFragmentRecursive(siteTree.getTopNodes(), this.documentid);
}
endNode(NODE_SITE);
} catch (ServiceException e) {
throw new ProcessingException(e);