Table of Contents
Any user of JBoss Portal 2.0 Beta should read this document, it explains features of the JBoss portlets and how to configure them.
We would like to thank all developers that participate in the JBoss Portal project effort, Remy for his help and the Nodesk team that gave us that nice theme.
Contribution of any kind is always welcome, you can contribute by providing ideas, filling bug reports, producing some code, designing a theme, writing some documentation... There are various way to help. To report a bug please use our Jira system.
Here is a list of tested versions or reported as working by users, before reporting a problem please make sure that you are using a compatible version.
If you successfully installed JBoss portal on versions not listed here please let us know so we can add it here.
This is really important that you only use one the JBoss version supported, for now we only support JBoss 4.0.0
MySQL is the database used for our testings, 4.0.22 is one version that has been fully tested. There is no reason why any other MySQL database would not work so give it a try.
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 go get 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 http://www.mysql.com
Last but not least, you also need to get the JDBC connector for your database, the MySQL JDBC connector is available at http://dev.mysql.com/downloads/connector/j/3.1.html, the postgreSQL JDBC connector is available at http://jdbc.postgresql.org/download.html.
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.
Create a database and a user with privileges on it
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.1.
At this stage you should have the jboss-4.0.1.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 it is time to 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.
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.
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.
Then copy $JBOSS_HOME\server\all\lib\jboss-remoting.jar, $JBOSS_HOME\server\all\lib\jgroups.jar and $JBOSS_HOME\server\all\lib\jboss-cache.jar into $JBOSS_HOME\server\default\lib
Finally, you can deploy JBoss Portal by going into the core 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 number 80 instead of the default port 8080, to change that you will need to change it at two levels, to change it at the portal 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.
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 to change the context path.
Managing users using the user module consists in:
Here is a list of attributes that you can define in the portlet.xml file:
The user can register and is automatically enabled
The user is disabled till he opens in his web browser a link sent by email to the address he specified.
Email address that will appear in the "From" header when the system will send an email to a user
Default role assigned to new users by default
The role portlet is dedicated to create and edit roles. A role will be used to grant different permission level to different portlets. A user can have several roles (for example he can be an administrator of a category of forum but only a reader on another category)
To create a new role, you just need to define a short name that will be used for reference, and a display name for displaying to the user, for example admin would be a good name for the display name Administrators, changing the display name will not affect the security rules
The CMS Portlet displays content from the file store inside a portlet window, or, in the case of binary content, outside of the portlet window altogether.
As of JBoss Portal Beta 1, the CMSPortlet handles all requests for all content types.
The methodology of serving content within the CMSPortlet, allows for some beneficial features, like:
List of attributes that can be defined in the portlet.xml file:
Remember, the default data for your store is contained in a zip file you should have received with the portal codebase. This should all be present under: JBOSS_HOME\server\standard\data\portal\webdav\store.
The AdminCMS Portlet allows control over the content management system.
Viewing the AdminCMS Portlet is accomplished by navigating to the admin page http://localhost:8080/nukes/index.html?page=admin and clicking on the option labeled AdminCMS within the portlet window. Maximizing the portlet window has the same effect.
You should then be presented by a page that is similar to this:
It is important for a user to note the action icons used throughout the portlet and their meanings. The action options change depending on what type of resource the user is dealing with. All possible actions are listed here:
Additionally, there are icons that help describe the types of resources present on the page:
This section describes common actions a user can perform from within the AdminCMS Portlet.
A user can list directory contents by either clicking on the
icon, or clicking on the directory's "DisplayName".
All actions are possible from this screen.
Clicking on the
icon or the "DisplayName" of a file brings up the File Properties page.
The File Properties window displays all the possible actions available to perform on a file. It displays certain properties of the file: DisplayName, FileSize, Content-Type, Creation Date, and when it was last modified.
Version Information is also contained on this screen. It is important to note that the top-most version in the list is the current version that is "live". Editting an older version of a file and saving it, will auto-create a new version of the file and make it the current "live" version.
Clicking on the
icon displays the copy file/directory dialog window.
The copy resource window allows a user to copy files to any folder on the system, as well as copy whole directory
trees to any directory on the system. A user can select which destination directory to copy the resource to, by using the directory
browser. Clicking the
icon expands the directory tree. Clicking on the name of the directory within the tree, sets it
as the destination directory for the copied resource.
Clicking on the
icon displays the move file/directory dialog window.
The move resource window allows a user to move files to any folder on the system, as well as move whole directory
trees to any directory on the system. A user can select which destination directory to move the resource to, by using the directory
browser. Clicking the
icon expands the directory tree. Clicking on the name of the directory within the tree, sets it
as the destination directory for the moved resource.
Clicking on the
icon displays the delete file/directory confirmation window.
The delete resource confirmation window allows a user to delete a file, or a directory on the system. Note that deleting a directory, will delete the entire tree, so all directories under the deleted one, will also be deleted.
Clicking on the
icon displays the create directory dialog window.
The create directory resource window allows a user to create a directory under the one he originally clicked the icon in. On this window, a user can specify a name for the new empty directory.
Clicking on the
icon displays the create file dialog window with the embedded WYSIWYG editor and directory browser.
The create file window allows a user to create a text or HTML file using the embedded WYSIWYG HTML editor. The
editor is a fully-functional HTML editor with a myriad of HTML functions. It also includes a preview
button
and a source view
button.
An in-depth walk-through of the editor is beyond the scope of this document. However, the editor does contain
help pages within it, that can be accessed by clicking the
icon.
Clicking on the
icon displays the upload file dialog window.
The upload file window allows a user to upload files to any directory on the system. The upload process will work on
files up to 1GB and of all types. A user can select which destination directory to upload the resource to, by using the directory
browser. Clicking the
icon expands the directory tree. Clicking on the name of the directory within the tree, sets it
as the destination directory for the uploaded resource.
Clicking on the
icon displays the edit file dialog window with the embedded WYSIWYG editor and directory browser.
The edit file window allows a user to edit a text or HTML file using the embedded WYSIWYG HTML editor. The
editor is a fully-functional HTML editor with a myriad of HTML functions. It also includes a preview
button
and a source view
button.
The portlet aims at attributing roles to a permission. Below is an example to setup permissions for the forums portlet.
At the very top, a domain can be specified. A domain is defined by the portlet, it can be the name of a portal for example. It gives the scope of the permissions. THe first screen gives you the top level privileges, usually it will show global permissions.
Defined roles gives the list of roles that has been defined for the corresponding permission while implied roles will show all the roles that are implied. For example in the forums, the admin role implies the add permission, defining the role "Admins" on the Admin permission, would show "Admins" in the implied roles of the add permission. Only defined roles can be removed so if a permission need to be restricted, the most permissive permission has to be removed before a less permissive one is added.
Under the global permissions, there is a list of sub-components for a finer grain permission definition. For example, the forums portlet gives the ability to define permissions on a single category. By clicking on the category, the following screen would show up:
The forums security model dictates that the global admin permission implies the category admin permission, and the global add permission implies the category read permission, with that in mind, the implied roles should make sense. If you select a sub-component, you can define an even finer-grain permission and the following screen will show up:
The forums portlet is a port of the phpBB forums as a Java portlet. It is packaged independently of the core, so you can easily use it or not depending on your own needs.
Above is the main window displayed by default to any user. It lists all the forums classified by categories. It is possible to see how many tropics and posts where written for each forum and the date and user of the last post. All those categories and forums can be configured if the user has the correct privileges. The next image show the main administration interface available to users with the correct credentials.
User features:
Admin features:
First you need to create the database structure, go to the forums directory and type sh build.sh ddl it will create a file forums/output/resources/setup/setup.ddl.
Feed your database with this file, you may also want to have some entries for testing if you do feed your database with this other file as well: forums/output/resources/setup/setup.sql. root# mysql -u portal -p jbossportal < forums/output/resources/setup/setup.ddl and root# mysql -u portal -p jbossportal < forums/output/resources/setup/setup.sql are the two commands you need to type if you are using MySQL
To install forums, you need to go to the directory forums and type sh build.sh deploy it will create a file portal-forums.ear and copy it to $JBOSS_HOME/server/default/deploy. If JBoss is already running you have nothing to do but to go to a page where the forums should be displayed (see your configuration).
To have the mail notification working, make sure that you correctly configure the mail service with an existing SMTP account in the file: $PORTAL_HOME/core/src/resources/portal-server-war/WEB-INF/jboss-service.xml
In $FORUMS_HOME/src/resources/portal-forums-war/WEB-INF/portlet.xml you can configure the following options:
You can restrict access to the forums for certain roles, to do so edit the file $FORUMS_HOME/src/resources/portal-forums-war/WEB-INF/jboss-portlet.xml. You should see the existing part:
<scheme> <domain></domain> <item> <path>/</path> <permission> <permission-name>Add</permission-name> <role-name>Users</role-name> </permission> <permission> <permission-name>Admin</permission-name> <role-name>Admins</role-name> </permission> <!-- For non logged users --> <permission> <permission-name>Read</permission-name> <role-name></role-name> </permission> </item> </scheme>
This means that a user with role Users has the permission to add posts in forums, a user with role Admins has the permissions to Admin anything, while an anonymous user (not logged on), can only read.
If you want users to only view a category named "myCategory" to a certain role "myRole", here is an item that you can add:
<item> <path>/myCategory</path> <permission> <permission-name>ReadCategory</permission-name> <role-name>myRole</role-name> </permission> </item>