7 Replies Latest reply on Oct 20, 2006 5:20 PM by Peter Johnson

    Where is my portal Instance?

    mmontoni Newbie


      I created just for fun a portal instance by going to Admin, adding a new Portal called My Portal. I added some pages and portlets to it. Now, I wanted to look at the code of what I've done. I can't find it. I looked everywhere under jboss-portal.sar but I can't find a myportal.war file.

      Before I was creating new portals by hard coding the newportal.war and hot deploying it in JBoss AS.

      Using: JBoss AS 4.0.4, JBoss portal 2.4 and MySQL 5



        • 1. Re: Where is my portal Instance?
          Peter Johnson Master

          It is in the database. The xml descriptor files in the portal sar file, or your portlet's war file, are only used for the initial load of the information into the database. Though if you change the descriptors, they could overwrite the database info (hence the < if-exists > entry in the descriptors)

          • 2. Re: Where is my portal Instance?
            mmontoni Newbie

            Hi Peter,

            I understand...but what if you want to have 2 instance hitting 2 different databases?


            • 3. Re: Where is my portal Instance?
              Peter Johnson Master

              Let me see if I understand correctly. You want two different portals, each running in it own application server and using its own database. But you want to define the portal only once.

              If that is the case. you can do one of the following:

              1) Define the portal entirely using a *-object.xml file and deploy that to both portals.

              2) Use the Management Portlet to define the new portal and clone the database (for example, in MySQL you could export the database data and load it into a new database)

              • 4. Re: Where is my portal Instance?
                mmontoni Newbie

                No, not really. I have a portal named MyPortal.war and another one named POCPortal.war. I hard code them and hot deploy them by dropping them under myServer/deploy directory in JBoss AS 4.0.4.

                They are currently using the JBoss portal database which is MySQL 5.1.

                Now...in the future, I will need to build several portals for my organization and they will be in the same production server under the same application server but pointing to diferent databases which by the way will be Oracle9i.

                I wonder if this is possible.... I suspect it is by only changing the jboss-web.xml and the web.xml files...

                • 5. Re: Where is my portal Instance?
                  Peter Johnson Master

                  I don't think you can do what you want. The portal database is maintained for the jboss-portal.sar service that you deployed to the application server. All individual portals and portlets deployed to that application server are maintained by that same jboss-portal.sar service, and thus will be in the database used by that service.

                  If you really want individual portals to be in separate databases, you will need two application servers running, each with jboss-portal.sar deployed to it. And each one configured to use a different database.

                  However, portlet instances could be set up such that each uses a different database to access business data (not portal data). For example, give each portlet instance a different datasource preference and have the portlet use that preference to access the business data.

                  • 6. Re: Where is my portal Instance?
                    mmontoni Newbie

                    Hi Peter,

                    Yes I could do that. Thanks for the explanation!

                    Do you know which topic of the documentation explains how to set up different databases for different portlets?

                    Thanks again!


                    • 7. Re: Where is my portal Instance?
                      Peter Johnson Master

                      I haven't seen any documentation on setting up databases for portlets, but I have done it for servlets and image it is not much different. Something like this:

                      1) Get the datasource name from the preferences
                      2) Use JNDI to lookup the datasource
                      3) Get the connection and do database work
                      4) Close the datasource (which releases is back to the pool)