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.1 SP1 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. In this document we will consider that you are using MySQL, you can download it at MySQL.com
If you didn't do so already you will need to create a MySQL database. For testing you will want to create a database called "jbossportal", with a user called "portal" and a password "portalpassword". Here are the explanations to do so. If you are familiar with MySQL, feel free to create this database and user yourself and skip this part.
Get the binaries from http://dev.mysql.com/downloads/mysql/4.1.html, unpack them and install them according to the MySQL documentation
Now you can log on MySQL by typing: C:\mysql\bin> mysql -u root -p (if you didn't set a password just press enter when it asks for one or don't put the -p option)
Create the jbossportal database: (you can change the name if you want)
In the MySQL console type:
mysql> CREATE DATABASE jbossportal;
The output should be:
Query OK, 1 row affected (0.01 sec)
Add a user (pick any name if you don't like portal as username:
mysql> GRANT ALL PRIVILEGES ON jbossportal.* TO 'portal'@'localhost' IDENTIFIED BY 'portalpassword' WITH GRANT OPTION;
The output should be:
Query OK, 0 rows affected (0.00 sec)
JBoss portal leverage the use of Hibernate, so any database supported by Hibernate is also supported by JBoss Portal. DB2, Firebird, FrontBase, Hypersonic, Ingres, Interbase, MySQL, Oracle, PostgreSQL, SAPDB, SQLServer, Sybase are some of them.
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.1sp1.
At this stage you should have the jboss-4.0.1sp1.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:
The first step is to setup the default data for the portal, this is done in 2 steps. First you have to execute the content of the file setup.ddl in the database.
>mysql -u portal -p mysql> use jbossportal Database changed mysql> source setup.ddl Query OK, 0 rows affected, 1 warning (0.06 sec) ... Query OK, 1 row affected (0.00 sec) mysql> exit Bye
Then you should populate the database to create two users, one with login user and password user who is a regular user and one administrator with admin as username and admin as password. To do so type the following command:
root# mysql -u portal -p jbossportal < jboss-portal-2.0\core\output\resources\setup\setup.sql
The second step is to unarchive the content of the file cms-content.zip into the directory $JBOSS_HOME/server/default/data, this setup the default content of the CMS. If this is the first time you use that JBoss instance, the directory data may not exist, in that case you have to create it. You should have the following structure for the CMS:
$JBOSS_HOME/server/default/data +-portal +-webdav +-store +-work
Now we deploy the rest in JBoss. Just copy the files portal-core.sar and portal-ds.xml into the directory $JBOSS_HOME/server/default/deploy
First define which database you want to use by specifying it in $PORTAL_HOME/build/local.properties. By changing the value of portal.database JBoss Portal will be ready to use the specified one. As of today only mySQL and postreSQL are accepted values but to add any Hibernate supported database you just need to add a file into $PORTAL_HOME/build/etc with your database information. (See below)
Check and modify if needed the file corresponding to your database in $PORTAL_HOME/build/etc. Here is what it looks like for mySQL:
hibernate.dialect=net.sf.hibernate.dialect.MySQLDialect portal.datasource.driver=org.gjt.mm.mysql.Driver portal.datasource.url=jdbc:mysql://localhost:3306/jbossportal?useServerPrepStmts=false portal.datasource.username=portal portal.datasource.password=portalpassword
Adding another database would be as easy as adding such a file, specifying the Hibernate dialect, the datasource url, the username and the password. A list of supported Hibernate dialects can be found here.
Now is time to build the sources, go to jboss-portal-2.0/build and type sh build.sh, you should read BUILD SUCCESSFUL at the end of the operation.
Make sure that JBOSS_HOME is still defined in the environment or it will not work.
Now you will need to build the DDL file to be able to create the required tables in your database. To do so go to jboss-portal-2.0/core and type sh build.sh ddl. It will create the file jboss-portal-2.0\core\output\resources\setup\setup.ddl.
To feed your database just type the following line and enter portalpassword as password when asked (or whatever you used while setting up your database):
C:\mysql\bin> mysqladmin -u portal -p jbossportal < jboss-portal-2.0\core\output\resources\setup\setup.ddl
Then you should populate the database to create two users, one with login user and password user who is a regular user and one administrator with admin as username and admin as password. To do so type the following command:
root# mysql -u portal -p jbossportal < jboss-portal-2.0\core\output\resources\setup\setup.sql
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 in that directory the file $PORTAL_HOME\core\output\resources\setup\portal-ds.xml.
You will also need to put the jar file of your database connector in $JBOSS_HOME\server\default\lib.
Finally, you can deploy JBoss Portal by going into the build directory and by typing build deploy. It will deploy JBoss Portal in the default configuration of JBoss.
Now you can start JBoss AS by going into $JBOSS_HOME/bin and typing run.
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.