There are a couple of archives that you will need to download in order to install JBoss Portal.
Of course you will need to install JBoss Application Server prior to install JBoss portal, if you didn't do so yet, please install JBoss 4.0.2 from Sourceforge.
You can download JBoss portal in different ways, packaged in binaries, sources or from the CVS.
You will need a database to store the data of the system, you can use any database supported by Hibernate. We have tested JBoss Portal on the following, but other should work just the same:
MySQLDB
Hypersonic DB
PostGreSQL
Oracle 10g
All databases supported by hibernate are support by JBoss Portal. Below is a generic ordered list of steps that should be followed on any DB:
Create a new Database. For MySQL we name it jbossportal.
Give access rights to whatever user with whatever password to this new database. For MySQL we create a user "portal" and give him a password "portalpassword", and grant him rights to the jbossportal DB.
As of JBoss Portal RC2, all database tables will be created for you at runtime. The only thing you need to make certain is that there is a database created, a working JDBC connector, and that the user/password combination works.
If you need a custom setup of JBoss AS, you should read the documentation about JBoss application server. In our case, we will use the default configuration shipped with JBoss AS 4.0.2.
At this stage you should have the jboss-4.0.2.zip or any other archive of the same version. First you need to setup JBOSS_HOME environment variable otherwise you won't be able to compile JBoss Portal. To do so go to Start > Settings > Control Panel > System > Advanced > Environment Variables, and add the JBOSS_HOME environment variable. Or do export JBOSS_HOME=/path/to/your/jboss/directory on a Unix-like system.
The downloaded archive contains the following files:
It is important that you configure the correct datasource file under /setup. There are a few already created for support of popular databases. You can also create your own. Please verify that the username, password, url, and driver-class are correct for your flavor of DB. You can deploy the datsource file by itself to test, in advance.
Copy/Move jboss-portal.sar, portal-forums.ear, and your configured portal datasource file to $JBOSS_HOME/server/default/deploy
First, build the sources and deploy them, go to jboss-portal-2.0/build and type sh build.sh deploy, you should read BUILD SUCCESSFUL at the end of the operation. This operation should have copired the jboss-portal.sar to your $JBOSS_HOME/server/default/deploy directory.
Make sure that JBOSS_HOME is still defined in the environment or it will not work.
Now you will need to build the datasource files for DB access. To do so go to jboss-portal-2.0/core and type sh build.sh datasource. It will create all the files under jboss-portal-2.0\core\output\resources\setup.
It is important that you configure the correct datasource file jboss-portal-2.0\core\output\resources\setup. There are a few already created for support of popular databases. You can also create your own. Please verify that the username, password, url, and driver-class are correct for your flavor of DB. You can deploy the datsource file by itself to test, in advance.
Before you deploy the application by itself, you will need to have the database deployment descriptor (portal-*-ds.xml) in the $JBOSS_HOME\server\default\deploy directory. To do so copy the correct portal-*-ds.xml file in to the /deploy directory.
You will also need to put the jar file of your database connector in $JBOSS_HOME\server\default\lib, if you have not already done so.
Now you can start JBoss AS by going into $JBOSS_HOME/bin and typing run. All database tables, cms directories, and initial content for each will be created/inserted during the startup process, if it does not exist.
Using your browser, navigate to http://localhost:8080/portal and you should see the portal.
It is common to have a server running on the port 80 instead of the default port 8080, to change that you will need to change it at two levels:
To change it at the server level, you need to edit the file $JBOSS_HOME/server/default/deploy/jbossweb-tomcat50.sar/server.xml and change the port value of the HTTP Connector to the same value as you defined in the portal.
Next, you will need to modify the web.xml descriptor in the CMSPortlet for it to be able to find the webDAV server. You can find more information about how to do this here.
Now you can restart JBoss and use the new port that you defined. On systems like Linux, you need privileges to be able to run a server on a port lower than 1000, starting JBoss on the port 80 as a regular user will not work, for testing you can log as root but is not recommended if the server is public as it could be a security breach in your system.
By default, the "main" page of JBoss portal will be accessible at http://localhost:8080/portal/index.html. You may want to change that either to a different name or to http://localhost:8080/index.html.
Now you can rebuild JBoss portal and redeploy it tfor the context path changes to take effect.
If you would like to re-create the initial database tables, ie. start with a blank install, you can do it by following these steps:
Log in to the JMX-Console: http://localhost:8080/jmx-console/
Locate the portal hibernate mbean. From this screen, you can execute operations.
To drop the database tables and recreate them, first execute destroySchema(). Then execute, createSchema(). Finally execute createContent().
The database should now be restored to how it was on initial install and deployment.
If you encounter that the Hibernate dialect is not working properly and would like to override the default behaviour, you simply need to modify jboss-portal.sar/conf/hibernate/hibernate.cfg.xml. A list of supported dialects for Hibernate3, can be found here.
<?xml version='1.0' encoding='utf-8'?> <!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD//EN" "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd"> <hibernate-configuration> <session-factory name="java:portal/SessionFactory"> <property name="connection.datasource">java:@portal.datasource.name@</property> <property name="show_sql">false</property> <!-- Force the dialect instead of using autodetection --> <!-- <property name="dialect">org.hibernate.dialect.PostgreSQLDialect</property> --> <!-- Mapping files --> <mapping resource="org/jboss/portal/core/impl/role/RoleImpl.hbm.xml"/> <mapping resource="org/jboss/portal/core/impl/user/UserImpl.hbm.xml"/> <mapping resource="org/jboss/portal/core/impl/user/UserPref.hbm.xml"/> <mapping resource="org/jboss/portal/core/impl/user/UserPrefSet.hbm.xml"/> </session-factory> </hibernate-configuration>