2 Replies Latest reply on Oct 25, 2006 3:23 AM by theute

    custom portlet modes

    bwessel

      Hi,

      Does JBoss support custom portlet modes and if not, what is the correct way to make a multi-page portlet? I would like to make a portlet that has four different page views.

      I found the JSR spec information on Custom Portlet modes, but I keep getting the error:
      javax.portlet.PortletModeException: Not supported
      at org.jboss.portal.portlet.impl.PortletURLImpl.setPortletMode(PortletURLImpl.java:93)

      I have set <portlet-mode>login</portlet-mode> inside portlet/supports tags
      and
      <custom-portlet-mode>
      <portlet-mode>login</portlet-mode>
      </custom-portlet-mode> inside the <portlet-app> tag of the portlet.xml. (Note: the JSR docs use different tags in the <custom-portlet-mode> tag, but I got an error saying the <custom-portlet-mode> tag needed the <portlet-mode> child.

      In my portlet class I added the line:
      final private static PortletMode login = new PortletMode("login");

      Everything works until I add the lines:
      PortletURL loginurl = response.createRenderURL();
      loginurl.setPortletMode(login);
      At which point I get the error above.

      Has anyone been able to get custom portlet modes working?

        • 1. Re: custom portlet modes
          bwessel

          I wanted to try bumping this up again. I'm really having trouble with this and I can't find any good JBoss Portal docs on how to create Custom Portlet Modes.

          I've tried calling request.getPortalContext().getSupportedPortletModes(), but it only returns View, Edit and Help even though I should have a couple more modes set up in the portlet.xml and the Portlet class.

          • 2. Re: custom portlet modes
            theute

            As per the spec, porlet modes can only be defined by the portal vendor.

            JBoss Portal could decide to add a specific porlet mode (And all portlets using that special mode would not work in any other portal) but so far we don't. We only support the modes that are part of the specification VIEW, EDIT, HELP

            Whatever you specified in portlet.xml are custom modes that you want to use, but since those modes don't exist, they are not used and JBoss Portal as it follows the spec ignores them.

            See section 8.4 of the spec.