else if (requestHandler instanceof RenderPageRequestHandler)
{
// possibly hybrid URL - bookmarkable URL with page instance information
// but only allowed if the page was created by bookmarkable URL
RenderPageRequestHandler handler = (RenderPageRequestHandler)requestHandler;
if (!checkPageClass(handler.getPageClass()))
{
return null;
}
if (handler.getPageProvider().isNewPageInstance())
{
// no existing page instance available, don't bother creating new page instance
PageInfo info = new PageInfo();
UrlInfo urlInfo = new UrlInfo(new PageComponentInfo(info, null),
handler.getPageClass(), handler.getPageParameters());
return buildUrl(urlInfo);
}
IRequestablePage page = handler.getPage();
if (!pageMustHaveBeenCreatedBookmarkable() || page.wasCreatedBookmarkable())
{
PageInfo info = null;
if (!page.isPageStateless())
{
info = new PageInfo(page.getPageId());
}
PageComponentInfo pageComponentInfo = info != null ? new PageComponentInfo(info,
null) : null;
UrlInfo urlInfo = new UrlInfo(pageComponentInfo, page.getClass(),
handler.getPageParameters());
return buildUrl(urlInfo);
}
else
{
return null;
}
}
else if (requestHandler instanceof BookmarkableListenerInterfaceRequestHandler)
{
// listener interface URL with page class information
BookmarkableListenerInterfaceRequestHandler handler = (BookmarkableListenerInterfaceRequestHandler)requestHandler;
Class<? extends IRequestablePage> pageClass = handler.getPageClass();
if (!checkPageClass(pageClass))
{
return null;
}
Integer renderCount = null;
if (handler.getListenerInterface().isIncludeRenderCount())
{
renderCount = handler.getRenderCount();
}
PageInfo pageInfo = new PageInfo(handler.getPageId());
ComponentInfo componentInfo = new ComponentInfo(renderCount,
requestListenerInterfaceToString(handler.getListenerInterface()),
handler.getComponentPath(), handler.getBehaviorIndex());
UrlInfo urlInfo = new UrlInfo(new PageComponentInfo(pageInfo, componentInfo),
pageClass, handler.getPageParameters());
return buildUrl(urlInfo);
}
return null;
}