-
1. Re: Where is my portal Instance?
peterj Oct 19, 2006 5:53 PM (in response to mmontoni)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 Oct 20, 2006 11:37 AM (in response to mmontoni)Hi Peter,
I understand...but what if you want to have 2 instance hitting 2 different databases?
Thanks,
Mariella. -
3. Re: Where is my portal Instance?
peterj Oct 20, 2006 1:19 PM (in response to mmontoni)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 Oct 20, 2006 3:05 PM (in response to mmontoni)
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?
peterj Oct 20, 2006 4:29 PM (in response to mmontoni)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 Oct 20, 2006 5:09 PM (in response to mmontoni)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!
Mariella. -
7. Re: Where is my portal Instance?
peterj Oct 20, 2006 5:20 PM (in response to mmontoni)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)