public Object getAttribute(String name, Configuration modeConf, Map objectModel)
throws ConfigurationException {
Object value = null;
ServiceSelector selector = null;
TreeSiteManager _manager = null;
try {
PageEnvelope envelope = getEnvelope(objectModel, name);
Publication publication = envelope.getPublication();
selector = (ServiceSelector) this.manager.lookup(SiteManager.ROLE + "Selector");
_manager = (TreeSiteManager) selector.select(publication.getSiteManagerHint());
Request request = ObjectModelHelper.getRequest(objectModel);
Session session = RepositoryUtil.getSession(this.manager, request);
DocumentFactory map = DocumentUtil.createDocumentFactory(this.manager, session);
if (name.equals(AUTHORING_NODE)) {
SiteTree authoringTree = _manager.getTree(map,
publication,
Publication.AUTHORING_AREA);
value = authoringTree.getNode(envelope.getDocument().getPath());
}
if (name.equals(LIVE_NODE)) {
SiteTree liveTree = _manager.getTree(map, publication, Publication.LIVE_AREA);
value = liveTree.getNode(envelope.getDocument().getPath());
}
if (name.equals(TRASH_NODE)) {
SiteTree trashTree = _manager.getTree(map, publication, Publication.TRASH_AREA);
value = trashTree.getNode(envelope.getDocument().getPath());
}
if (name.equals(ARCHIVE_NODE)) {
SiteTree archiveTree = _manager.getTree(map, publication, Publication.ARCHIVE_AREA);
value = archiveTree.getNode(envelope.getDocument().getPath());
}
} catch (Exception e) {
throw new ConfigurationException("Obtaining value for [" + name + "] failed: ", e);
}