0 Replies Latest reply on Jul 3, 2008 11:08 AM by rene harings

    Custom-Portlet-Mode in Jboss-Portletcontainer-2.0.0

    rene harings Newbie

      Hello again,
      does the Jboss-Portletcontainer-2.0.0 support custom-portlet-modes?
      I can't get it to work!

      I tried this:

      portlet.xml:


      <?xml version='1.0' encoding='UTF-8' ?>
      <portlet-app xmlns='http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd' version='2.0'>
       <portlet>
       <description>AuthenticationPortlet</description>
       <portlet-name>AuthenticationPortlet</portlet-name>
       <display-name>AuthenticationPortlet</display-name>
       <portlet-class>fraunhofer.isst.portlets.AuthenticationPortlet</portlet-class>
       <expiration-cache>0</expiration-cache>
       <supports>
       <mime-type>text/html</mime-type>
       <portlet-mode>VIEW</portlet-mode>
       <portlet-mode>HELP</portlet-mode>
       <portlet-mode>UNAUTHENTICATED</portlet-mode>
       </supports>
       <resource-bundle>fraunhofer.isst.portlets.messages</resource-bundle>
       <portlet-info>
       <title>AuthenticationPortlet</title>
       <short-title>AuthenticationPortlet</short-title>
       </portlet-info>
       </portlet>
       <custom-portlet-mode>
       <description xml:lang="en">Authentication failure mode</description>
       <portlet-mode>UNAUTHENTICATED</portlet-mode>
       </custom-portlet-mode>
       </portlet-app>
      


      I'm iterating through all supported modes in doView();

       System.out.println(request.getPortalContext().getPortalInfo());
       Enumeration modeEnum =
       request.getPortalContext().getSupportedPortletModes();
       System.out.println("<p>Modes <br />");
       while (modeEnum.hasMoreElements())
       {
       PortletMode pMode = (PortletMode)
       modeEnum.nextElement();
      
       System.out.println("<li> <a href=\"" + pMode.toString() +
       "\">" + pMode + "</a></li>");
       }
      


      This returns only:


      16:58:07,642 INFO [STDOUT] JBossPortal/1.0
      16:58:07,642 INFO [STDOUT] <p>Modes <br />
      16:58:07,642 INFO [STDOUT] <li> <a href="view">view</a></li>
      16:58:07,642 INFO [STDOUT] <li> <a href="edit">edit</a></li>
      16:58:07,642 INFO [STDOUT] <li> <a href="help">help</a></li>
      


      So, how can I use supported-portlet-mode?
      Best regards,
      rene