Search code examples
jbossrichfacesipcgatein

Gatein 3.4.0 final Jboss 5.1.0 portlets states and JSR186 interaction, Not able to show multiple portlets when going from one portlet to another


i have a question about a problem we are having right now. As long as i searched the internet i have not found any useful information.

So here is the question.

In our system we are heavly using portlets, there are 10s of 100s of them. In some cases we want to show different portlets together because some portlets require IPC (inter portlet communication to pass parameters to other portlets) so that user are easily going to the next portlet without re-writing the required parameters and otomatically call the webservices to get information/do its jobs etc...

While migrating to gatein-3.4 final, with Jboss 5.1.0 this old style is broken. Currently gatein (eXo gatein) do allow us to have a page which includes all the portlets visible, but what i want is to have them invisible (aka in minimized or maximized states) maximized state means visible otherwise invisible. In JSR186 we have window state, window object and portlet context that allow us to have each portlet NODE, and all the other node (node is a portlet, comes from PortletNode.class in portal-api-lib jar(we do not have this now))

So we do not have this structure anymore and we can only show one portlet at a time.

I wonder if you guys know a better solution, ideas or suggestions that you can give me to pass this problem.

Thanks.

EDIT:

So far i found that using javascript:AjaxGet of GateIn extention and Richfaces do break the functionality. When i use an ajax call such as the following link:

 javascript:ajaxGet('/ProvPortal/classic/UserPortlet?portal:componentId=99b3433a-585c-471e-928b-d8e4b17fcf02&objectId=minimized&portal:action=ChangeWindowState&ajaxRequest=true')

Allow me to use other portlets use. aka the other portlets becomes functional again. Also in Richfaces.panelTabs object the remaining portlets informations are filled with so that we can access the portlets. Could there be a problem with ajaxget and Richfaces that i dont know yet?

Thanks agian.


Solution

  • For those of you working with Jboss version 5.1.0 and GateIn version 3.4 GA.

    Let me explain the some of the highlights of portlet development. First of all a portlet is a standalone application or rather we can say web components as its mentioned in the wiki. Can be build with jsp/jsf, can be packaged as war.

    GateIn however does allow us to show a single portlet on the page at a time, but not two or more, or we did not know that how to do?

    To accomplish this we have to do some workarounds and some improvements in the GateIn's own codes. You can check if you want () section in the xml files and its use. This tag allows a 'portlet' to load when you open that portlet from the navigation section or menu.

    But this tag as its mentioned do not allow another portlet to be loaded in. it just removes the old one and puts the new one. So if i want to see more than two portlets at that time or if i wanna pass a parameter to that portlet and see the change without even closing the previous one that was not possible.

    There are two solutions for this,

    1- In GateIn's codes you can create a multiple pages (or can configure it in xmls), this pages can have multiple tags, but you need to know that there is only one page-body will be functional, that if the page contains another page-body tag, we have to disable other page body tags.

    The page body tags are accessible from the GateIn's codes as list, so in this list if you are going to open another portlet under a parent portlet that means you have to enable that parent portlet page body tag. whenever you navigate to another portlet which is considered as a parent portlet, previous portlet will be removed from the context and this new parent portlet will be loaded in to the context with the default page body tag.

    Example: lets say we have 2 parent portlets -User -Domain

    and lets say we have 2 other portlets that are needed to be opened as a second portlet in the page without closing the User or Domain portlet.

    -a page contains page body{
        user portlet with disabled page body tag{
    
           open sub-portlet-a with data X, (a button or a link)
           open sub-portlet-b with data Y  (a button or a link)
    
        }
    }
    

    whenever you make an action in the user portlet to open a sub portlet with the "PASSED DATA" to the second sub portlets, then we enable the user portlet page-body tag in gatein code that the second portlet, with that "PASSED-DATA", will be opened.

    Switch to Domain portlet-> user portlet will be gone, and same steps will be applied to the Domain portlet as well. Consider that this is only applicable if you have set-up the Domain and User portlets with the same sub-portlets in the xml files.

    <!--portlet definitions-->
        <user>
         <!--some user specific information goes here-->
         <a></a> (optional)
         <b></b> (optional)
        </user>
    
    
    <domain>
     <!--some Domain specific information goes here-->
     <a></a> (optional)
     <b></b> (optional)
    </domain>
    

    as we have mentioned there are two ways to open a second portlet in the page.

    Here is the second one.

    2- The second solution to this problem is not related with the gatein's codes, or you wont have to touch that area.

    It is with the groovy templates that comes with GateIn portlets definitions. .gtmpl templates files. This files have access to their originators. what i mean is that some containers are already accessible from withing these .gtmpl template files.

    For example you have UITableColumnContainer.gtmpl file and UIContainer object in this template file will be available for you. That object will provide you a context based on your portlets. That means that you can get the other portlets in this files.

    So from now on i think we can grap the other portlets in the groovy template files.

    In this case, if i want to open a portlet after i click on a button or make an action to open a second portlet in my Portal structure that i can render it.

    Other portlets are rendered as default(set to false) From now on w can get the information about the portlet we want to open from either URL or some other kind of you own implementation and then we can set that Portlet to be rendered as True

    These are the solution we have found so far.

    and they both working fine as far as we have implemented.

    If this will somehow help you or rather being useful that means we have made some good progress.

    Thanks