Posted by Unknown | 0 comments

How to integrate JasperServer into Liferay

OverviewSteps to install and configure JasperServer CE 3.7.0 into Liferay. Also to install and configure the portlet included to view reports.
The installation of JasperServer Community Edition 3.7.0 was performed over Windows Vista, Liferay 6.0.5 and MySQL 5.1
Alias table
Variable Example Description
${LIFERAY_DIR} /liferay-portal-6.0.5/ Folder where liferay was installed
${MYSQL_HOST} 127.0.0.1 Host where MySQL was installed
${MYSQL_PORT} 3306 Port where MySQL was installed
Steps to follow Download files
1. Download JasperServer 3.7.0 Community Edition from the next address:
* http://sourceforge.net/projects/jasperserver/files/JasperServer/JasperServer%203.7.0/
2. From this address you need to download two files:
* jasperserver-ce-3.7.0-windows-installer.exe
* JasperServerPortlet-3.7.0.war

Check InnoDB engine
1. Execute from command line the mysql console:
C:\Program Files\MySQL\MySQL Server 5.1\bin\mysql -u root -p
The system will ask the password for root user. Suply it.
2. In the mysql console execute the next sql command:
select * from information_schema.engines;
3. The InnoDB engine must be installed, you must see it listed. If not, you need to install it. Reinstall MySQL with this option selected.

Run the wizard installer
1. Execute the file jasperserver-ce-3.7.0-windows-installer.exe.
2. Follow the steps and choose your own MySQL instance. Choose your local instance or another one where you want to install the data for your reports.Fill all the needed data with info from your machine.
3. Choose also your own tomcat. When you need to suply the folder, choose the one where you have installed your liferay.

Configure JDBC sources
1. We need to add some lines from:
* ${LIFERAY_DIR}\tomcat-6.0.26\webapps\jasperserver\META-INF\context.xml
to the file:
* ${LIFERAY_DIR}\tomcat-6.0.26\conf\context.xml
and the lines to add are:
maxActive="100" maxIdle="30" maxWait="10000"
username="jasperdb" password="password" driverClassName="com.mysql.jdbc.Driver"
validationQuery="select 1" testOnBorrow="true"
url="jdbc:mysql://${MYSQL_HOST}:${MYSQL_PORT}/jasperserver?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&autoReconnectForPools=true"/>
maxActive="100" maxIdle="30" maxWait="10000"
username="jasperdb" password="password" driverClassName="com.mysql.jdbc.Driver"
validationQuery="select 1" testOnBorrow="true"
url="jdbc:mysql://${MYSQL_HOST}:${MYSQL_PORT}/sugarcrm?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&autoReconnectForPools=true"/>
maxActive="100" maxIdle="30" maxWait="10000"
username="jasperdb" password="password" driverClassName="com.mysql.jdbc.Driver"
validationQuery="select 1" testOnBorrow="true"
url="jdbc:mysql://${MYSQL_HOST}:${MYSQL_PORT}/foodmart?autoReconnect=true&autoReconnectForPools=true"/>

JasperServer administration Control Panel access
1. Launch liferay portal with the script:
${LIFERAY_DIR}\tomcat-6.0.26\bin\startup.bat
2. When the portal is running, open the next url in your browser:
* http://localhost:8080/jasperserver/
3. When the login screen appears, you can access there with user: jasperadmin and password: jasperadmin

JasperServer Portlet deployment
1. Copy the file JasperServerPortlet-3.7.0.war to the folder ${LIFERAY_DIR}/deploy. Liferay must be running to perform hot deploy.
2. Do login with an administrator role user, for example the Test user.
3. Add the portlet to any page using the Add menu on the top left. Choose "More..." option and select the group JasperSoft. Add the JasperServer Portlet to the page.
4. After that the portlet will have problems to access to the server. In the next steps will configure the server access portlet.

JasperServer Portlet configuration
1. Open the file
* ${LIFERAY_DIR}\tomcat-6.0.26\webapps\JasperServerPortlet-3.7.0\WEB-INF\applicationContext-security.xml
and uncomment the line 226, allowing secure access to the local ip address. (JasperServer requires secure access). Change the ip address if you have installed the server in another machine.
2. Open the file
* ${LIFERAY_DIR}\tomcat-6.0.26\webapps\JasperServerPortlet-3.7.0\WEB-INF\portlet.xml
and change the line 10, changing jasperserver-pro by jasperserver, because it's the community version.
3. Restart Liferay and you will see now the example reports (if you installed them in the wizard).
If you want to see your own reports you need to publish in the server.

Contact us for information regarding Development of Liferay Portal & Liferay Portlet,

0 comments: