4 Replies Latest reply on Oct 18, 2007 11:02 AM by dvanwest

    Reference to parent page from portlet.

      Greetings,

      Using portal 2.6.2.

      How does one get a reference to the page on which a portal instance is deployed from the context of the portlet, in this case a JBossPortet?

      thanks.

        • 1. Re: Reference to parent page from portlet.

          Surely this isn't impossible... is it? I haven't been able to navigate the API to find a solution, but there must be a way for a portlet to determine the page it's presented on at runtime. Right?

          • 2. Re: Reference to parent page from portlet.
            theute

            Have a look at the documentation

            • 3. Re: Reference to parent page from portlet.

              Can you be any more specific? I've looked the Portal Reference Guide and the API JavaDocs and it sure didn't jump out!

              Does the solution involve getting the portlet's parent node (window) then the window's parent node (page)? If so, how does one then convert the PortalNode reference into a PortalObject reference? Once I have a page reference I'd like be able to add a new window.

              On a similar topic, is there any documentation on the portal design. For example, what is the relationship between PortalNodes and PortalObjects? They seem to have similar attributes, but are independent. Any references that provide insight?

              thanks.

              • 4. Re: Reference to parent page from portlet.

                Alright, I found a reference to the original question in section 10.8.3 of the Portal Reference Guide. I'd sort of ignored this since I'd been looking for a direct method to the Window object, rather than using the PortalNode.

                As for getting a reference to a PortalObject from a PortalNode, it appears that one can get a reference via the portal.getPage(node.getName()) or page.getWindow(node.getName()) methods. I'm not sure if this is the recommended method, but it seems to work.