2 Replies Latest reply on May 29, 2007 3:19 AM by Ricardo Harari

    portal help urgent

    shailesh kulkarni Newbie

      Hi friends,

      I am new to the portal & i want to develop a portal page that contains one portlet.

      This portlet is supposed to contain some links and depending on the link choosen, the corresponding portlet window should apper in the portal page.

      Would any one please give some hints/resources to do this ?

      Thanks in Advance.
      Shailesh

        • 1. Re: portal help urgent
          Thomas Heute Master

          If you have urgent needs , please consider our professional support. This forum has no guarantee of answers

          https://www.redhat.com/apps/store/jboss/portal.html

          • 2. Re: portal help urgent
            Ricardo Harari Newbie

            Hi Shailesh,

            You can harcode a link to "/portal/yourpage" or walk into the portal hierarchy to find your pages.
            Follows an example how to do that:

            import org.jboss.portal.api.node.PortalNode;
            import org.jboss.portal.api.node.PortalNodeURL;
            import org.jboss.portlet.JBossRenderRequest;
            import org.jboss.portlet.JBossRenderResponse;
            import org.jboss.portal.core.impl.api.node.PortalNodeImpl;
            
            ....
            
            protected void doView(RenderRequest request, RenderResponse response) throws PortletException, UnavailableException {
            ....
            
             String myPageName = "MyPageName"; // this is your page name that you´re looking for
             JBossRenderRequest req = (JBossRenderRequest) request;
             PortalNode currentNode = req.getPortalNode();
             while (currentNode.getType() != PortalNode.TYPE_PORTAL) {
             currentNode = currentNode.getParent();
             }
             for (Iterator i = currentNode.getChildren().iterator(); i.hasNext();) {
             PortalNode child = (PortalNode)i.next();
             if (child.getType() == PortalNode.TYPE_PAGE) {
             if (child instanceof PortalNodeImpl) {
             if (child.getName().equals(myPageName)) {
             PortalNodeURL childURL = ((JBossRenderResponse)response).createRenderURL(child);
             System.out.println("url to mypage = " + childURL.toString());
             break;
             }
             }
             }
             }
            
            


            There is a good example with the source code.
            Check out this portlet:
            core\src\main\org\jboss\portal\core\portlet\catalog\CatalogPortlet.java

            You can also verify if the user is allowed to access it before redirect.

            Hope this help.

            regards,

            R.Harari