[PORTLETSPEC3-18] Provide a method in PortletConfig to query the supported portlet modes Created: 03/May/13  Updated: 02/Feb/15  Resolved: 26/Aug/13

Status: Resolved
Project: portletspec3
Component/s: Ideas for JSR 362 Extensions
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Minor
Reporter: msnicklous Assignee: msnicklous
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


It would be good to add a method to the PortletConfig interface that would
provide the portlet modes supported my the portlet.

Comment by Neil Griffin [ 14/May/13 ]

+1 Always seems helpful to expose elements configured in the portlet.xml descriptor to the developer.

Comment by andre.hagemeier [ 31/Jul/13 ]

+1 why not extend this to the whole portlet descriptor? I could imagine that supported languages, portlet name, title etc might be interesting as well

Comment by msnicklous [ 26/Aug/13 ]

I think that most of the other information is available through one method or the other already. Supported languages can be obtained through Portletconfig.getSupportedLocales() and the portlet name through PortletConfig.getPortletName(). The supported processing and publishing events are available along with the supported public render parameters. The portlet title, short title, keywords, display name, etc. are available through the resource bundle (even if no real resource bundle is provided ).

What I find to be missing completely is a way of obtaining the defined and supported portlet modes and window states. You can get that information sort of indirectly through use of PortletRequest.isPortletModeAllowed(PortletMode) and PortletRequest.isWindowStateAllowed(WindowState), but you have to sort of try it out ... it isn't very elegant.

So I think we need a way to get an enumeration of the available portlet modes and window states.

It might be that we need other information in a nice API as well, but so far I haven't found anything else to be missing.

Comment by msnicklous [ 26/Aug/13 ]

Added methods:


Comment by msnicklous [ 02/Feb/15 ]

Implemented methods in Pluto branch V3Prototype. While doing so, I discovered an oversight - both the portlet modes and window states are dependent on the MIME type. I updated the method signatures to reflect the fact. I also added a method to obtain the public render parameter QNames, since that information wasn't available elsewhere. The method signatures are:

Enumeration<PortletMode> PortletConfig.getPortletModes(String) Enumeration<WindowState> PortletConfig.getWindowStates(String)
Map<String, QName> PortletConfig.getPublicRenderParameterDefinitions()

V3.0 javadoc

Generated at Wed Oct 07 01:01:21 UTC 2015 using JIRA 6.2.3#6260-sha1:63ef1d6dac3f4f4d7db4c1effd405ba38ccdc558.