[jboss-user] [JBoss Portal] - Re: Custom navigation region
JohnnyTheHun
do-not-reply at jboss.com
Thu Dec 4 05:25:00 EST 2008
Ok, I don't get where the portlet markup get's created.
I see that the WindowContext already get's the markup via its String content parameter, so I need to create the portlet markup BEFORE instanciating a WindowContext
But how do I create the markup for a specific portlet instance?
What is the class that I can instanciate or the utility I can call to create the markup?
I looked at DivPortletRenderer which calls PortletRendererContext.getMarkup() to get the markup.
PortletRendererContext is implemented via PortletRendererContextImpl.
The getMarkup() function of PortletRendererContextImpl gets the markup from the WindowContext.
So now I'm in a circle - I have to create the markup before any XYContext comes into the picture. But I don't know what creates the markup for a Portlet instance.
The best would be to have some Class or Function like:
new PortletMarkupGenerator(String portletInstanceName).getMarkup();
I found some code in the injectTabbedNav of PageCustomizerInterceptor class:
| public String injectTabbedNav(PageCommand rpc)
| {
| ControllerContext controllerCtx = rpc.getControllerContext();
| ControllerRequestDispatcher rd = controllerCtx.getRequestDispatcher(targetContextPath, tabsPath);
|
| //
| if (rd != null)
| {
| Page page = rpc.getPage();
| PortalAuthorizationManager pam = portalAuthorizationManagerFactory.getManager();
| PortalNodeImpl node = new PortalNodeImpl(pam, page);
|
| //
| rd.setAttribute("org.jboss.portal.api.PORTAL_NODE", node);
| rd.setAttribute("org.jboss.portal.api.PORTAL_RUNTIME_CONTEXT", Navigation.getPortalRuntimeContext());
|
| //
| rd.include();
| return rd.getMarkup();
| }
| return null;
| }
|
The following lines are used to access the jsp to create the tabs:
| ControllerContext controllerCtx = rpc.getControllerContext();
| ControllerRequestDispatcher rd = controllerCtx.getRequestDispatcher(targetContextPath, tabsPath);
|
1. This function renders a jsp file, it doesn't render a Portlet.
2. This function uses a PageCommand instance to create the markup. But I don't see that a RegionRenderer gets a PageCommand parameter
So the best would still be to have some Class or Function like:
new PortletMarkupGenerator(String portletInstanceName).getMarkup();
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4194284#4194284
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4194284
More information about the jboss-user
mailing list