8 Replies Latest reply on May 29, 2013 3:16 PM by eduardo.mello.cantu

    Creating multiple instances of same portlet

    nandhana03

      hiii all...... I've upgraded my portal from JBoss to GateIn. In JBoss, I was able to create multiple instances of a portlet & able to use those instances in multiple windows. Can I do the same procedure in GateIn ????? If so, how can I ?????

        • 1. Creating multiple instances of same portlet
          hoang_to

          What do you mean by multiple instances?

           

          In the scope of GateIn Portlet Container, there is one and only one portlet object corresponding to one portlet definition ( the element <portlet> in portlet.xml)

          • 2. Creating multiple instances of same portlet
            nandhana03

            Hi Minh,

             

                        In earlier version of jboss portlet, we have a configuration file "portlet-instances.xml", where we define the instances(multiple if needed) of a

             

            portlet. Its those instances, we map on different windows in our application. So if its the same portlet we want to define in two windows, we will be

             

            mapping seperate instances to those windows.

             

             

                      But in gatein , cnt find any file where we can define the portlet-instances. So if the same situation arises here, hws it possible without creating a

             

            new portlet?

            • 3. Creating multiple instances of same portlet
              rraposa

              Dhanya,

               

              There is no portlet-instances file in GateIn - that was a JBoss-specific file. In GateIn, you can configure your navigation and pages by configuring the files navigation.xml, pages.xml and portal.xml.

               

              If you look in the following folder:

               

              jboss-as/server/default/deploy/gatein.ear/02portal.war/WEB-INF/conf/portal/portal/classic

               

              you will see examples of these files and how they are used to create the default portal that you see when GateIn starts up initially. The GateIn User's Guide and Reference Guide has some information on these three files as well.

               

              Is that maybe what you're looking for? You can put the same portlet on a page multiple times in GateIn - that should be no problem.

               

              Rich

              • 4. Creating multiple instances of same portlet
                nandhana03

                hi Rich,

                 

                            Thnx for ur reply. We've tried putting same portlet in a page multiple times. But on doing so, the changes made in one portlet gets reflected on others too. Tatz y we asked the que whether we can create multiple instances of the same portlet so that we can use all portlets independently.

                • 5. Creating multiple instances of same portlet
                  hoang_to

                  @Dhanya:

                   

                  1 Portlet Window (the window you drag/drop on page) = 1 Portlet Object (which is 1: 1 with portlet definition) + Portlet Preferences

                   

                  So the Portlet Window-dependent data should wrapped in Portlet Preferences.

                  • 6. Creating multiple instances of same portlet
                    nandhana03

                    hii Minh,  Our requirement is : we r having 3 portlets in 3 different pages, each using same jsf & same backend bean. Depending upon the portlet selected , the content displayed should vary. Suppose, we open all the 3 portlets in different tabs in the browser. In that case, the values in the most recent tab r displayed in the other two. How can we handle this situation ???

                    • 7. Creating multiple instances of same portlet
                      rraposa

                      I think we need some more details about your code. How is the backing bean storing this portlet-specific data? Is it in the Session object, or are you using the PortletPreferences object, or some other mechanism?

                      • 8. Re: Creating multiple instances of same portlet
                        eduardo.mello.cantu

                        I know its been a long time, but Im facing the same problem down here.