attune infocom

Saturday, June 25, 2011

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.


For information regarding Development of Liferay Portal & Liferay Portlet, please contact us @ info@attuneinfocom.com

Monday, June 20, 2011

Liferay Portlet & Portal Tips

Liferay Tips and Tricks


Background and purpose :

The purpose of this article is to share experiences of using the toolkit Liferay portlet in the portal. One can list here e.g. the tips how to speed up the portal. Please, feel free to edit this article!


How to speed up the portal?

1. Edit the portal-ext.properties file. If you cannot find the file from [portal-root]/webapps/ROOT/WEB-INF/classes, you could should copy (and rename) it there from the [portal-root]/webapps/ROOT/WEB-INF/lib/portal-impl.jar.

The most common modification are listed below.

· theme.css.fast.load=true

· theme.portlet.decorate.default=false

· javascript.barebone.enabled=true

· javascript.fast.load=true

· javascript.log.enabled=false

· look.and.feel.modifiable=false

· session.timeout=5

· session.timeout.auto.extend=true

· session.timeout.warning=0

· layout.parallel.render.enable=true

· layout.template.cache.enabled=true

· last.modified.check=false

· velocity.engine.resource.manager.cache.enabled=true

· com.liferay.portal.servlet.filters.compression.CompressionFilter=true

· com.liferay.portal.servlet.filters.strip.StripFilter=true

· com.liferay.portal.servlet.filters.layoutcache.LayoutCacheFilter=true

· portlet.css.enabled=false

· tags.compiler.enabled=false


2. Put Apache2 server in front of Tomcat (or what ever application server you use) to serve all static content

· Tutorial for Debian

· see the attachments for the example workers.properties, jk.conf, and jk.load files

· configure apache2.conf such that there is sufficient amount of worker threads

· enable gzipping

· remember to enable correct ports from portal-ext.properties file (e.g. web.server.http.port=80 and web.server.https.port=443)


3. Compile/install native apr libs for the Tomcat

· enable the apr adding the lines:

LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/apr/lib

export LD_LIBRARY_PATH

into [portal-root]/bin/setenv.sh srcipt


* if the Tomcat has very slow startup with apr try to recompile apr with --with-devrandom=/dev/urandom option OR set the environment variable RANDFILE to point /dev/urandom OR use tcnative 1.1.10

Friday, June 17, 2011

Liferay Portlet Development

Liferay portlets in general are great for a very specific class of applications. If you are working for an IT department and need to combine applications for or by several departments then portlets would be the way to go. In theory you can drop in portlets from different venders and they will all live in harmony inside of the same environment.

Benefits of Liferay portlet Development :
  • Since the software is open source, it reduces the costs significantly over other more expensive paid solutions - and what's more, it does virtually everything the more expensive options do anyway!
  • It already comes with virtually everything you need to run an effective corporate Intranet for collaboration and communication. The wide array of pre-built portlets let you choose the exact functionality you want to add.
  • It's very easy for your staff to learn. The UI has already won usability awards and innovative features cut down on the number of steps or clicks your staff have to take to perform certain operations.
  • Upfront costs are zero, so you can literally deploy LifeRay for free before committing to any customization work
  • Over 60 add on modules and 20 free themes available for LifeRay - it's literally possible to set up your system for zero cost
  • The open source nature of the software means that even if the company changes direction or closes, the software lives on in the open source community
Liferay is very modular in design and just like Wordpress, a number of add-ons can be created, the terminology for which is “Portlets”, little snippets of code that query the database to display some information. Mostly the portlets add a small amount of functionality, and since Liferay is completely free to use the development costs for deploying an Enterprise social network script can be significantly lower than a commercial option.

Attune Infocome’s liferay developer to develop social networking software for client, including Intranet and collaboration platforms, we have a unique insight in to what kind of functionality you might require from a Liferay powered website. We’ve developed numerous Liferay portlets in the past for companies with

Liferay Portlet Development and even Liferay Theme Development.

Liferay portlets should be considered as akin to a shared infrastructure. They provide a common way to access applications, shared services and a standard way of deployment, but at the cost of performance.

Liferay portlet is a extremely powerful system, there are many services and applications