I am in my portal and trying to decide whether or not to put out a Help icon and/or an Edit icon.

I would like to only do so if the Portlet supports the HELP or Edit modes.

I am in the render code about to call

         portletContainer.doRender(window, req, bufferedResponse);

and have access to all of the following structures:

PortletContainer portletContainer = getPortletContainer(context);
RequiredContainerServices rs = portletContainer.getRequiredContainerServices();
PortalCallbackService pcs = rs.getPortalCallbackService();
PortletURLProvider pup = pcs.getPortletURLProvider(request, window);
pup.setPortletMode(new PortletMode("edit"));
String editUrl = pup.toString();
pup = pcs.getPortletURLProvider(request, window);
pup.setPortletMode(new PortletMode("help"));
String helpUrl = pup.toString();

So I can derive what the right URLs are - but cannot figure out whether I should emit these URLs.

I could figure this out if I could get my hands in the InternalPortletWindow or the PortletDD. But it seems that I cannot access these things until the Container has built the PortletRequest structures - at which point it is trivial because I can call isPortletModeAllowed() if I had those structures.

It would seem to me that I should be able to lookup a PortletDD somehow...

/Chuck

Reply via email to