* @throws ProcessingException
*/
protected void generateFragmentInitial(String siteArea) throws SiteException, SAXException,
ProcessingException {
ServiceSelector selector = null;
SiteManager siteManager = null;
try {
selector = (ServiceSelector) this.manager.lookup(SiteManager.ROLE + "Selector");
siteManager = (SiteManager) selector.select(this.publication.getSiteManagerHint());
SiteStructure siteTree = this.publication.getArea(siteArea).getSite();
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.getTopLevelNodes().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.getTopLevelNodes(), this.path);
}
endNode(NODE_SITE);
} catch (Exception e) {
throw new ProcessingException(e);
} finally {
if (selector != null) {
if (siteManager != null) {
selector.release(siteManager);
}
this.manager.release(selector);
}
}
}