Liferay Development Environment

MPDL,GAVO

Please Note: Page under development

AWOB Subversion Repository structure

 * https://subversion.mpdl.mpg.de/repos/awob/ - AWOB subversion root
 * https://subversion.mpdl.mpg.de/repos/awob/documentation/ - AWOB documentation files
 * https://subversion.mpdl.mpg.de/repos/awob/data/ - AWOB data container (LR instance starter data, DB backups, property files, etc. )
 * https://subversion.mpdl.mpg.de/repos/awob/branches/ - AWOB source code branches
 * https://subversion.mpdl.mpg.de/repos/awob/tags/ - AWOB release/snapshot tags

AWOB plugins directories:
 * https://subversion.mpdl.mpg.de/repos/awob/trunk/sdk/ext/ - exts
 * https://subversion.mpdl.mpg.de/repos/awob/trunk/sdk/hooks/ - hooks
 * https://subversion.mpdl.mpg.de/repos/awob/trunk/sdk/layouttpl/ - layout templates
 * https://subversion.mpdl.mpg.de/repos/awob/trunk/sdk/portlets/ - portlets
 * https://subversion.mpdl.mpg.de/repos/awob/trunk/sdk/templates/ - templates
 * https://subversion.mpdl.mpg.de/repos/awob/trunk/sdk/themes/ - themes
 * https://subversion.mpdl.mpg.de/repos/awob/trunk/sdk/tools/ - tools
 * https://subversion.mpdl.mpg.de/repos/awob/trunk/sdk/webs/ - contains webapps to be deployed in the same tomcat context as liferay

AWOB liferay plugins 6.1.0 branch, contains all plugin directories as in item above:
 * https://subversion.mpdl.mpg.de/repos/awob/branches/liferay-plugins-sdk-6.1.0/

Prerequisites

 * Hardware - 1GB RAM
 * Sun Java 6 or later
 * Windows
 * Ubuntu: sudo apt-get install sun-java6-jdk
 * Mac OSX: Apple Computer supplies their own version of Java. Use the Software Update feature (available on the Apple menu) to check that you have the most up-to-date version of Java for your Mac
 * latest Ant
 * latest PostgreSQL DB

System variables to be correctly setup

 * $JAVA_HOME should point to the correct jdk (check with  )
 * $ANT_HOME should point to the ant installation (check with )
 * $LIFERAY_PORTAL should point to liferay-portal source code dir
 * $CATALINA_HOME should point to the tomcat dir (see later)

Download and install Liferay sources and bundles
All downloads and installations you will provide in this newly created directory named liferay-dev-6.1.0
 * create liferay development directory (further liferay-dev-6.1.0) in your home directory i.e.
 * for Linux: /home//liferay-dev-6.1.0
 * for Windows: e.g. C:\Users\ \liferay-dev-6.1.0
 * download liferay-app-server-6.1.0-bundle_awob-0.5.zip distribution bundle and unzip into the liferay-dev-6.1.0 directory
 * rename  to    (this will be your )
 * get Liferay 6.1.0 source code and unzip it into liferay-dev-6.1.0 directory
 * get Liferay 6.1.0 plugins SDKplugins SDK and unzip it into liferay-dev-6.1.0 i.e.   (create the liferay-plugins-sdk-6.1.0 if it does not exist)
 * rename the file app.server.natasab.properties to app.server..properties (or create file app.server..properties in the  directory). This file shall contain the following lines into it (as is):

app.server.type=tomcat app.server.parent.dir=${project.dir}/../app-server


 * create file build..properties in the  directory and paste following lines into it (as is)

app.server.parent.dir=${project.dir}/../app-server app.server.dir=${app.server.parent.dir}/tomcat-7.0.23 app.server.zip.name = ${app.server.dir}/../liferay-portal-src-6.1.0.zip ext.work.dir = ${app.server.dir}/..

Setup PostgreSQL DB

 * create a database user (default username:lruser, default password:postgres)

CREATE ROLE lruser LOGIN ENCRYPTED PASSWORD 'md535b6b1c5cf78d82505d75ef4fa0f40b8' SUPERUSER INHERIT CREATEDB NOCREATEROLE;


 * create a liferay database with the previously created user as an owner

CREATE DATABASE lrlocal WITH OWNER = lruser ENCODING = 'UTF8' CONNECTION LIMIT = -1;

jdbc.default.driverClassName=org.postgresql.Driver jdbc.default.url=jdbc:postgresql://localhost:5432/lrlocal jdbc.default.username=lruser jdbc.default.password=postgres
 * create a file portal-ext.properties in the  directory and paste following lines into it

Note: if you change the database or user name, please make sure the values are also changed in the portal-ext.properties file

Starting local Liferay instance
After you have finished Bundle installation and Postgresql Set-up, you may start your local Liferay AWOB Bundle instance in the following manner:


 * start the application server(Tomcat)

/bin/startup.sh (linux) or /bin/startup.bat (windows)


 * Note: server execution log can be found here:

/logs/catalina.out

During Startup, a browser window will be automatically invoked. Your instance shall be available at the following URL:

http://localhost:8080

Follow the basic configuration instructions (they appear in case your database is empty and well defined as described above). The Liferay instance is created with default user

test@liferay.com

Liferay requires a change of the password during the first log-in and acceptance of the License agreement. After you finalize these changes, your local instance is running and is ready for testing.

Checkout and build code from SVN Repository
NOTE: at present SVN plugins are not yet migrated from 6.0.6 to 6.1.0, and should be revised later. Please skip the next step and the checkout of SVN- as long as you see this note '''and use the second step instead. Afterwards, continue as described.'''


 * go to  and run following commands:

svn co https://subversion.mpdl.mpg.de/repos/awob/branches/liferay-plugins-sdk-6.1.0/ext svn co https://subversion.mpdl.mpg.de/repos/awob/branches/liferay-plugins-sdk-6.1.0/hooks svn co https://subversion.mpdl.mpg.de/repos/awob/branches/liferay-plugins-sdk-6.1.0/layouttpl svn co https://subversion.mpdl.mpg.de/repos/awob/branches/liferay-plugins-sdk-6.1.0/portlets svn co https://subversion.mpdl.mpg.de/repos/awob/branches/liferay-plugins-sdk-6.1.0/templates svn co https://subversion.mpdl.mpg.de/repos/awob/branches/liferay-plugins-sdk-6.1.0/themes svn co https://subversion.mpdl.mpg.de/repos/awob/branches/liferay-plugins-sdk-6.1.0/webs


 * (SECOND STEP Alternative to SVN) go to

http://awob.mpg.de/dev-bundles/liferay-6.1.0/liferay-all-plugins-src-6.1.0_awob-0.5.zip

download the zip bundle and extract it to      For example, from

to (END SECOND STEP Alternative to SVN)


 * go to the appropriate plugin directory to be deployed (see directories  in previous item) and run

ant deploy

in each plugin directory, or

ant direct-deploy

for all ext directories in addition


 * (optionally, if your application server is not started) start the application server(Tomcat)

/bin/startup.sh (linux) or /bin/startup.bat (windows)

Note: server execution log can be found here:

/logs/catalina.out

Setting your Eclipse IDE

 * for Eclipse Liferay IDE, see installation guidelines here and here.
 * Note: Liferay SDK location should point to the

/home//liferay-dev-6.1.0/liferay-plugins-sdk-6.1.0  (linux)

or

C:/Users//liferay-dev-6.1.0/liferay-plugins-sdk-6.1.0  (windows)


 * recommended is latest service release from Eclipse Indigo Java EE for Web Developers version

Setting JRebel plugin
You can change .java and .jsp classes in eclipse, they will be automatically deployed on the LR one-by-one.
 * Eclipse Help->Eclipse Marketplace...
 * search for plugin "JRebel for Eclipse",install it and restart Eclipse
 * click pink pop-up window with license registration suggestion
 * launch suggested JRebel agent
 * after Get License interface is popped up, search for MPDL JRebel License file javarebel.lic‎ in MPDL mailing list sent by Markus at 22. August 2012 09:46 :) and add it with "Save your license file in your user home directory" input field
 * go to Servers View, click on "Liferay v6.1 CE Server (Tomcat 7) at localhost", go to "Open launch configuration", then JRebel Tab, check option "Enable JRebel agent" and optional "Enable debug logging" (brings more debug info but slows down deployment)
 * Goto to Package Explorer-> Right mouse click on the plugin (i.e. so-portlet)->JRebel
 * check "Add JRebel Nature" in context menu
 * check "Automatically generate rebel.xml" (the JRebel config should appear in docroot/WEB-INF/src/rebel.xml file)
 * Restart LR Server in Eclipse

Note: You should refresh browser to have the changes deployed by JRebel, check eclipse console for deployment info.

LR forum thread for JRebel usage for SDK development is here: http://www.liferay.com/web/neil.griffin/blog/-/blogs/lightning-fast-portlet-development-with-jrebel

Current properties 6.1.X
Note: properties are important for reference, all properties customized for AWOB will be in AWOB source code Bundle
 * Coming from actual code here https://github.com/liferay/liferay-portal/blob/master/portal-impl/src/portal.properties

Building the AWOB bundle

 * Hook Plugins
 * awob-hook awob svn
 * so-hook awob svn
 * Portlets
 * chat-portlet awob svn
 * contacts-portlet
 * events-display-portlet
 * knowledge-base-portlet
 * microblogs-portlet
 * private-messaging-portlet awob svn
 * social-networking-portlet
 * so-portlet awob svn
 * tasks-portlet awob svn
 * weather-portlet
 * web-form-portlet
 * wysiwyg-portlet
 * lista-correompdl-portlet link awob svn
 * Exts
 * awob-ext awob svn
 * Theme
 * astro-office-theme awob svn
 * Webs
 * resources awob svn

Dev-Server (8086) deployment
UNDER CONSTRUCTION

dev svn up rcawob_dev stop ant deploy direct-deploy rcawob_dev start ant deploy
 * ssh login into
 * go into  or use following command (cd alias):
 * go into the  directory (up to the plugin type to be deployed), then
 * deployment for exts
 * deployment for any other plugins
 * NOTE:  usage:

rcawob_dev {start|stop|restart|log|status}

Liferay 6.1.0 from SVN trunk (skip this)
NOTE: Use only during migration to new version, otherwise use provided sources at 

Liferay 6.1.0 from git
git clone https://github.com/liferay/liferay-portal.git git clone https://github.com/liferay/liferay-plugins.git git tag -l git checkout -b git checkout -b 
 * get portal sources
 * get plugins sources
 * list of tags
 * create branch for a tag
 * create branch for a commit

Sources from SVN and Maven Builds

 * create directory for liferay sources e.g  and go into the directory
 * checkout liferay portal-trunk svn --username guest co http://svn.liferay.com/repos/public/portal/trunk portal-trunk
 * checkout liferay plugins-trunk svn --username guest co http://svn.liferay.com/repos/public/plugins/trunk plugins-trunk

Configuring Maven Settings
NOTE: Work in progress, Maven not yet enabled

... <id>liferay</id> your_nexus_username your_nexus_password ... ... <mirrorOf>*,!liferay-ce-releases,!liferay-ce-snapshots</mirrorOf> ...
 * Open your . Add the servers segment to your
 * Update  element with the following string

Tomcat

 * download tomcat zip from http://tomcat.apache.org into  dir and unzip it

Eclipse

 * install Eclipse IDE for your OS (Eclipse Classic is enough) into $LIFERAY_PORTAL/eclipse dir
 * set $ECLIPSE_IDE_HOME to $LIFERAY_PORTAL/eclipse
 * set  with 256M or higher in $ECLIPSE_IDE_HOME/eclipse.ini
 * create dir  and provide the path by eclipse start up
 * install subclipse eclipse plugin, refer Download and Install at http://subclipse.tigris.org/
 * eclipse: Window->Open Perspectives.
 * Click on Other...
 * Select SVN Repository Exploring, and then click on the button OK.
 * Right-click on the SVN Repositories view.
 * Select New and the Repository Location...
 * Provide input as  and click on Finish.
 * Install Tomcat plugin "Sysdeo Eclipse Tomcat Launcher"
 * get from here
 * put into $ECLIPSE_IDE_HOME/dropins folder and unzip
 * restart eclipse
 * in eclipse menu go to the Window->Preferences->Tomcat and set
 * Tomcat version to 6.x
 * Tomcat home to
 * Window->Preferences->Java->Installed JREs, set a JDK as default JRE for eclipse
 * in Window->Preferences->Tomcat->JVM Settings set JVM parameters as  (minimal settings)

Building Ext

 * go to perspective SVN Repository Exploring
 * select and expand root
 * expand  (by the   usage we can always get the latest source code of liferay)
 * checkout  into the current
 * view Ant targets:
 * switch to Java perpective, add new view Navigator
 * expand project portal
 * go to Windows->Show View->Ant, drop  under   in the Ant view
 * Update Tomcat to support Ext development ......
 * TODO

PostgreSQL
# # PostgreSQL # jdbc.default.driverClassName=org.postgresql.Driver jdbc.default.url=jdbc:postgresql://localhost:5432/lportal jdbc.default.username=YOUR_USER_NAME jdbc.default.password=YOUR_PASSWORD
 * install PostgreSQL
 * Create a new database called lportal' (e.g with PG Admin)
 * Go to your $LIFERAY_HOME and create a file called portal-ext.properties
 * Copy the below block of code and paste it into your file (portal-ext.properties)
 * Restart your Liferay instance

MPDL Development Environment Installation (TODO)
To install JBoss Tools, start up Eclipse 3.6.2 then: Help > Install New Software... > and add this URL: http://download.jboss.org/jbosstools/updates/stable/helios/
 * Development in the svn/ant/maven landscape. See source code deployment guidelines here.
 * Problems: gpg support, switched off directly in
 * Eclipse IDE for Java EE Developers, plugins:
 * Subclipse
 * Maven 2.0 integration for Eclipse
 * Liferay IDE, see installation guidelines here. Further Liferay IDE readings are here.
 * JBoss Tools

Related links

 * Liferay Development Strategies
 * http://jira.mpdl.mpg.de/browse/AWOB-22
 * Liferay Portal 5.2 Systems Development. read (only from MPDL IPs)
 * How to build Ext
 * Plugins SDK