3 Replies Latest reply on Jan 2, 2007 5:19 AM by Stefan Seidel

    bookmarkable portlet urls

    John Gilbert Apprentice

      I have a JSF portlet and I would like to make some of the views bookmarkable. any ideas on how to do this or if it is possible.

      for exxample, i have a portlet that tracks Orders. It can filter and list Orders. Then it can navigate to a selected Order.

      I would like to create a URL that can be used later to go directly to the specific Order view.

      Maybe something like /portal/default/orderPage?id=1234

        • 1. Re: bookmarkable portlet urls
          Viet Master

          I think it is an implementation detail of the JSF bridge you are using. I don't know if it is possible to map the portlet render parameters to JSF parameters.

          JBoss Portal since 2.4 tries to shove the render parameters in the URL in clear format as much as it is possible

          • 2. Re: bookmarkable portlet urls
            Viet Master

            Probably that Santa Stan can tell us more about the myfaces bridge.

            • 3. Re: bookmarkable portlet urls
              Stefan Seidel Newbie

              With the MyFaces bridge it's quite easy
              Links look like

              /portal/index.html?ctrl:cmd=render&ctrl:window=default.order.OrderPortletWindow&org.apache.myfaces.portlet.MyFacesGenericPortlet.VIEW_ID=/showOrder.jsp&orderNr=1234

              an they can be rendered through
              JBoss[Render|Action]Request.getPortalNode();
              // navigate to the Node you need using PortalNode.getParent()/.resolve()
              JBoss[Render|Action]Response.create[Render|Action]Url(PortalNode);

              It is important to render Window links, not page links, because only Window Links will pass the additional parameters on to the portlet. Within your app there are two ways to access the params:
              In the Bean:
              FacesContext.getCurrentInstance().getExternalContext().getRequestParameterMap().get("orderNr");

              In the JSP:
              <h:outputText value="#{param.orderNr}"/>

              or
              <h:outputText value="#{param['orderNr']}"/>


              Have fun ;)

              Stefan