Hey Craig,
Thanks for the feedback.
I've had to scrap part of my original idea though :(
1. Exposes the supported modes of the portlet by modifying the
PortletWindowConfig class, adding getModes(String mimeType) and
setModes(Map) methods.
This part stays the same.
2. Modifies the PortletRegistryServiceImpl to populate the registry on
initialization.
3. Modifed the PortletRegistryServiceImpl to add the supported modes to
the PortletWindowConfig (which occurs during initialization)
The PortletRegistryService can't populate the registry on
initialization, because the servlet contexts of other portlet web
applications are not available yet (Tomcat hasn't finished starting up
all of the webapps). So I don't think I can use the Portlet Registry
Service to accomplish this.
So, I'm going to try to do this in a servlet filter which decorates the
PortletWindowConfig with the necessary information.
I have a messy prototype now - I'm now back where I was a few hours ago
with the Portlet Registry with my filter. I want to get this done for
the beta2 release.
Elliot
[EMAIL PROTECTED] wrote:
Hi Elliot,
This one is probably the biggest Pluto 1.1 issue, so thanks for taking
it on.
I haven't looked into all the details, but I'd say your changes look OK,
so go for it.
/Craig
-----Elliot Metsger <[EMAIL PROTECTED]> wrote: -----
To: [email protected]
From: Elliot Metsger <[EMAIL PROTECTED]>
Date: 09/03/2006 05:58PM
Subject: Portlet modes and buttons in the 1.1 portal driver
Hi all,
I'd like the portal to only display the buttons for the modes supported
by the portlet. It appears this is in Jira as PLUTO-233 and PLUTO-252.
I'm wondering if the list can comment on my approach.
In order to do this I have a patch in my working copy which does the
following:
1. Exposes the supported modes of the portlet by modifying the
PortletWindowConfig class, adding getModes(String mimeType) and
setModes(Map) methods.
2. Modifies the PortletRegistryServiceImpl to populate the registry on
initialization.
3. Modifed the PortletRegistryServiceImpl to add the supported modes to
the PortletWindowConfig (which occurs during initialization)
That's as far as I've gotten. I have debugging inside of PortletTag
which confirms that what I've done so far works:
[DEBUG] PortletInvoker - Performing Render Invocation
[DEBUG] PortletInvoker - Dispatching to portlet servlet at:
/PlutoInvoker/TestPortlet1
<...snip...>
[DEBUG] PortletTag - Evaluated portletId [${portlet}] to
[/testsuite.TestPortlet2]
[DEBUG] PortletTag - Rendering Portlet Window:
[EMAIL PROTECTED]
[DEBUG] PortletTag - Unable to determine content type from request.
[DEBUG] PortletTag - Portlet Window supports the following modes for
content type [text/html]: [VIEW], [EDIT], [HELP]
<...snip...>
If this approach is acceptable, I'll move forward with updating the
view
side of things so that the portlet mode buttons are displayed properly.
If I've missed anything or if this approach is off base, please do let
me know.
Thanks a lot,
Elliot
Elliot Metsger (JIRA) wrote:
> [ http://issues.apache.org/jira/browse/PLUTO-233?page=all]
>
> Elliot Metsger reassigned PLUTO-233:
> ------------------------------------
>
> Assignee: Elliot Metsger
>
>> Exception thrown if edit or help mode is not supported by portlet
>> -----------------------------------------------------------------
>>
>> Key: PLUTO-233
>> URL: http://issues.apache.org/jira/browse/PLUTO-233
>> Project: Pluto
>> Issue Type: Bug
>> Components: portlet container, portal driver
>> Affects Versions: 1.1.0, 1.1.0-beta1
>> Reporter: Craig Doremus
>> Assigned To: Elliot Metsger
>> Fix For: 1.1.0
>>
>>
>> If a portlet does not support edit or help mode an exception is
thrown if the window control for edit or help mode is selected.
>> Here is the top part of the stack trace produced if the Help
mode is selected:
>> javax.portlet.PortletException: doHelp method not implemented
>> at javax.portlet.GenericPortlet.doHelp(GenericPortlet.java:343)
>> at
javax.portlet.GenericPortlet.doDispatch(GenericPortlet.java:258)
>> at javax.portlet.GenericPortlet.render(GenericPortlet.java:175)
>> at
org.apache.pluto.core.PortletServlet.dispatch(PortletServlet.java:208)
>> at
org.apache.pluto.core.PortletServlet.doGet(PortletServlet.java:143)
>> at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
>> at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
>> at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
>> at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
>> at
org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:672)
>> at
org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:574)
>> at
org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:499)
>> at
org.apache.pluto.core.PortletInvoker.invoke(PortletInvoker.java:169)
>> at
org.apache.pluto.core.PortletInvoker.render(PortletInvoker.java:111)
>> at
org.apache.pluto.core.PortletContainerImpl.doRender(PortletContainerImpl.java:158)
>> at
org.apache.pluto.driver.tags.PortletTag.doStartTag(PortletTag.java:138)
>> at
org.apache.jsp.WEB_002dINF.themes.portlet_002dskin_jsp._jspx_meth_pluto_portlet_0(org.apache.jsp.WEB_002dINF.themes.portlet_002dskin_jsp:97)
>> at
org.apache.jsp.WEB_002dINF.themes.portlet_002dskin_jsp._jspService(org.apache.jsp.WEB_002dINF.themes.portlet_002dskin_jsp:72)
>> at
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
>> at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
>> at
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:322)
>> at
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:291)
>> at
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
>> at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
>