12 Replies Latest reply on May 29, 2008 4:51 PM by rohit000

    Placing portlet_instances.xml in a central place ...

      Hi,

      Seems like creating portlet instances from a central place (like portal-object.xml) is not supported.

      Can anyone please confirm this ?

      However, this looks to be a required feature which can provide proper separation of concern between portlet developer and deployer, especially if you don't want to use admin console (say you want to deploy the portal in 5 different boxes and doing the configuration job through admin console is not a choice) for creating portlet instances.

      Allowing portlet_instances.xml only in the same .war file which has the portlet.xml does not give enough separation where the portal deployer can decide how many portlet instances (for a given portlet) he needs to create and how he would like to set different preferences for them. In the current version of jboss portal (2.6.4) the deployer needs to change the same only by going into respective .war files of the portlets.

      Any takers ?


        • 1. Re: Placing portlet_instances.xml in a central place ...
          peterj

          An entire portal layout can be defined in the conf/data/default-object.xml file, but only if all portlet war files are deployed within jboss-portal.sar (like the example portlets in the "samples" directory).

          I have been able to add CMS portlet instances to a portlet-specific portlet-instances.xml file by adding this to the WEB-INF/jbossportlet.xml file:

          <portlet-app>
           <service>
           <service-name>CMS</service-name>
           <service-class>org.jboss.portal.cms.CMS</service-class>
           <service-ref>:service=CMS</service-ref>
           </service>
          
          </portlet-app>


          But the existing portlet-instances.xml files are not sacrosanct - the ones provided are only examples (just as the default portal is only an example). It is expected that you change them.

          I would at this point give you a URL to my JBossWorld presentation on that topic, but the JBossWorld web site still does not contain a link to my presentation (despite the fact that they have my presentation and the signed letter of agreement to permit publishing it).

          • 2. Re: Placing portlet_instances.xml in a central place ...
            theute

             

            "PeterJ" wrote:

            I would at this point give you a URL to my JBossWorld presentation on that topic, but the JBossWorld web site still does not contain a link to my presentation (despite the fact that they have my presentation and the signed letter of agreement to permit publishing it).


            I'll investigate this issue

            • 3. Re: Placing portlet_instances.xml in a central place ...

              Peter,

              Thanks for the response.

              The problem with keeping a custom portal application in jboss-portal.sar is that any change in the custom portal application will need the restart of the portal server.

              However, I think this is a needed feature. If a deployer needs to put his hand in the Portlet package (.war file) to create the instances, that surely breaks the abstraction of a Portlet package which is developed by the Portlet developer.

              Also the same is achievable through admin portal. But doing it through admin console is not a scalable option if you need to deploy large number of instances of the portal in different boxes.


              • 4. Re: Placing portlet_instances.xml in a central place ...
                peterj

                Actually, the problem is really with the class scoping required for war file.

                Example. X.war contains portletX and its portlet-instance.xml file declares one instance with the *-object.xml placing that instance somewhere.

                Now in Y.war, you would like to create another instance of portletX. But you cannot because Y.war does not have visibility to portletX. You could cheat - copy the class files for portletX into Y.war and then create an instance in the portlet-instances.xml file in Y.war.

                So the issue is with creating the instances. I think that once the instances are created, any *-object.xml file in any war file can use those instances to place them on a portal page (its been a while since I did this, I think in 2.4.x, so I am not sure if this still works, I'd give it a try just to verify it but don't have the time today).

                So if I understand your use case correctly, you have several jbossas instances with jboss portal deployed, and custom portlat (maybe the same, maybe different) defined in each one. Then at some later time you decide to add/modify a page by adding or dropping portlet objects. And you need to do this for some/all of the portals.

                • 5. Re: Placing portlet_instances.xml in a central place ...

                  Peter,

                  I think you have got most of my requirements.

                  The points I would like to additionally highlight are -

                  1) The Portal deployer should be able to create new instances of the available portlets without touching the .war file(s) of the Portlet(s)

                  2) This is along with the support of hot deplyment

                  • 6. Re: Placing portlet_instances.xml in a central place ...
                    peterj

                    The JBossWorld presentation is now at http://www.jbossworld.com/downloads/presentations/. Scroll down to Friday, look for JBoss Portal How To Guide.

                    • 7. Re: Placing portlet_instances.xml in a central place ...

                      Hi Peter,

                      Tried to access the same.

                      Once I click the link I get a zip file which has set of folders for configurations, pictures etc. Not the pdf.

                      Seems like right file is not uploaded

                      • 8. Re: Placing portlet_instances.xml in a central place ...
                        peterj

                        Looks like they posted the ODP (Open Document Presentation) file. You will need OpenOffice.org to read that. And yes, all of the Open Document files are really just zip files with various xml file and other content.

                        • 9. Re: Placing portlet_instances.xml in a central place ...

                          It is not really possible to put a instance file centrally because it relies on the portlet to be deployed before instance are created (in order to properly clone state if needed), that's why an instance file is packaged with a portlet application.

                          • 10. Re: Placing portlet_instances.xml in a central place ...

                            Hi Julien,

                            Thanks for the explanation. I can see the point.

                            • 11. Re: Placing portlet_instances.xml in a central place ...

                              May be you mean that it is not really possible as it is architectured today.

                              A clear separation of portlets and page/window deployment is a feature that should be on the list. This is especially useful when deployment includes parametrization of portlets. That way you can have a clear and clean separation between portlet packages and parametrized deployment packages.



                              • 12. Re: Placing portlet_instances.xml in a central place ...

                                I do agree with PMN on this. This feature should be in the roadmap.