Sunday, September 16, 2012

Jforum Integartion with existing webapplication

JForum is a powerful and robust discussion board system implemented in Java.

There are various ways to integrate JFourm with a existing web application.
1. Co-Exist as a seprate web application with a existing web application.
2. Embedd Jforum in your web application.

It is suggested to use the approach 1(Jforum Co-Exist as a separate web application), as in this approach the only Change you need to do in your application code is to provide a link to JForum. This is just a view(jsp) level change. You do not make your application clumsy, complex and jforum dependent using this approach.

In this tutorial i will focus on approach 1(Jforum Co-Exist as a separate web application).

JForum Installation
1. Download jforum-2.1.8 zip from Here

2. Rename directory as JFroum and deploy it (copy it to webapp of tomcat) as a separate application

3. It is better to install Jforum tables in seprate database.create desired database in mysql using sql command:

Create database db_name

4. run tomcat and access following url:

http://localhost/JForum/install.jsp

Installation wizard will be shown,The field names are self explanatory. Provide the appropriate details and complete the setup.

It is cleaner approach to keep the JForum Database separate from the application database.
Consider your application name is “myapp”. And the app server used is tomcat.

Integrating myapp with Jforum


Our requirement is to provide Single sign on to between myapp and jforum,that is when a user who has already signed in into myapp clicks on the jforum link, User is successfully logged in into JForum(in back end, without taking any inputs from user) .
JForum uses Cookie for Authentication. Note this binds us to keep both myapp and jforu both in same domain. Best approach is to keep both myapp and jforum web applications collocated in tomcat’s webapps folder
Call flow for integration will be as follows
1. User log in into myapp.
2. User clicks on the jforum link.
3. Myapp sets cookie and opens jforum in a IFrame
4. JForum SSO module checks cookie and authenticates the user
Enough Theory, lets start coding .


No comments:

Post a Comment