-
1. Re: How to configure the portal from code
theute Feb 2, 2007 7:52 AM (in response to lipp1)Yes you can use the roleModule and userModule.
As a less clean process, you could also direclty access the database, it would work as of today. (there are 3 tables, one for users, one for roles and one to set roles to users.)
Information like portal object information (pages, windows...) are stored in the database, you can use related services or check the code of the management portlet to see how it is done. -
2. Re: How to configure the portal from code
antoine_h Feb 2, 2007 9:31 AM (in response to lipp1)question : why can't you use the usual *-object.xml to describe the pages, windows etc... of your portal ?
and put all this in a webapp (.war file) and deploy it like that ?
do you have a specific need ?
seems more simple to use the xml descriptor than programatically write all this setup of your portal.
for the users : see also how it is done the first time the portal launch, for the creation of the two default user (user and admin).
they are set by a file :
\deploy\jboss-portal_2_4_1SP1.sar\conf\hibernate\user\setup.txt
this file is used by hibernate to populate the user and role tables at first launch.
It shows how to populate some user with the UserImpl and RoleImpl classes. You can reuse this to write some better way to do it than just replacing this file.
you could also launch a sql script to populate automatically the tables with your user definition. -
3. Re: How to configure the portal from code
mlipp Feb 5, 2007 5:31 AM (in response to lipp1)Thanks for replying, special thanks to Antoine. I had the wrong question in mind when I was searching for an API. After all, you simply deploy anything in JBoss, don't you, even portal pages ...
- Michael