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)
I understand...but what if you want to have 2 instance hitting 2 different databases?
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)
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...
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.
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?
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)