Liferay

“Liferay Portal is the world’s leading open source enterprise portal solution using the latest in Java, J2EE, and Web 2.0 technologies.”

Overview

Products

  • Liferay Portal – Enterprise web portal –
  • Liferay Journal – Content Management System
  • Liferay Collaboration Suite – Web publishing, Calendar, Email, Blogs, Boards, etc

Aims to run with common Java technologies: Containers/Servers such as JBoss/Tomcat/JBoss/etc; many web presentation frameworks; etc. See: Deployment Matrix

Open source licence: MIT

Developer Installation

Liferay server

See: http://content.liferay.com/4.3/doc/installation/liferay_4_installation_guide/onepage/

  • Starting development on a Windows box
  • Download all-in-one: http://www.liferay.com/web/guest/downloads/portal
  • Unzip
  • Ensure Java 1.5 installed and available from the command line, including JAVA_HOME
  • Start with bin/startup.bat
  • http://127.0.0.1:8080
    • Should see the liferay front page served locally
  • Login with:
    • User: test@liferay.com
    • Password: test

Development Environment

Developing Portlets for liferay requires setting up an “extension” environment. This is built from the full source of the server. This is accomplished with a set of Ant scripts, also used for deployment.

The instructions are quite extensive, so follow:
http://content.liferay.com/4.3/doc/devel/liferay_4_extension_environment_guide/onepage/

I hit an OutOfMemory with “ant start” in the build-common-java.compile: javac. Try the following environment setting

  • set ANT_OPTS=-Xmx1000m

Eclipse Plugin

Liferay have an Eclipse Plugin: http://wiki.liferay.com/index.php?title=Eclipse_Plugin&redirect=no

Using Liferay Portal with MySQL

  • Assumption (Liferay boundled with Tomcat 5.5 is already installed)
  • Add TOMCAT_DIR to your system environment variable – “C:liferay-portal-5.2.3tomcat-6.0.18”
  • Install MySQL
  • Get access through DbVisualizer and open a connection to MySQL
  • Create a database – by selcting SQL Commander tab: create database liferay
  • Grant all options: grant all on liferay.* to ‘liferay’@’localhost’ identified by ‘liferay’ with grant option
  • Grant all options to localdomain: grant all on liferay.* to ‘liferay’@’localhost.localdomain’ identified by ‘liferay’ with grant option
  • Copy mysql.jar to $TOMCAT_DIR/lib/ext
  • Open $TOMCAT_DIR/conf/Catelina/localhost/ROOT.xml – comment the Hypersonic data source (HSQL) conf and uncomment MySQL conf or you may have to add the following resource in the file
<Resource name="jdbc/LiferayPool" auth="Container"
		type="javax.sql.DataSource"
		driverClassName="com.mysql.jdbc.Driver"
		url="jdbc:mysql://localhost/liferay?useUnicode=true&characterEncoding=UTF-8&useFastDateParsing=false"
		username="root"
		password="password"
		maxActive="20"
/>
  • Run $TOMCAT_DIR/bin/startup.bat
  • Open browser and go to http://localhost:8080
  • Login as an admin – user: test@liferay.com with test password

Portal Development

FAQ/Magic

Server out of memory problems

  • Update SERVER/bin/catalina.bat
    • Xms1024m -Xmx1024m -XX:MaxPermSize=128m

Portlet Development

Other Customization

It's only fair to share...
Share on FacebookGoogle+Tweet about this on TwitterShare on LinkedIn

Leave a Reply