BrixNodeWebPage page = (BrixNodeWebPage) target.getPage();
return encode(page);
} else if (requestTarget instanceof BookmarkableListenerInterfaceRequestHandler) {
BookmarkableListenerInterfaceRequestHandler target = (BookmarkableListenerInterfaceRequestHandler) requestTarget;
BrixNodeWebPage page = (BrixNodeWebPage) target.getPage();
BrixNode node = page.getModelObject();
PageInfo info = new PageInfo(page.getPageId());
String componentPath = target.getComponent().getPageRelativePath();
// remove the page id from component path, we don't really need it
componentPath = componentPath.substring(componentPath.indexOf(':') + 1);
String iface = componentPath; // + ":" + target.getInterfaceName();
return encode(node, page.getBrixPageParameters(), info, iface);
} else if (requestTarget instanceof BookmarkablePageRequestHandler
&& ((BookmarkablePageRequestHandler) requestTarget).getPageClass().equals(
HomePage.class)) {
BrixNode node = ((BrixRequestCycleProcessor) RequestCycle.get().getActiveRequestHandler())
.getNodeForUriPath(Path.ROOT);
return encode(new BrixNodeRequestHandler(new BrixNodeModel(node)));
} else {
return null;
}