Liferay Development Environment 6 1 1 GA

MPDL,GAVO

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

 * http://awob.mpg.de/dev-bundles/awob/0.8.1/

DO NOT USE THIS YET


 * Download from awob.mpg.de [13.06.2013- not yet put there]
 * create liferay development directory (name it as you wish, in this documentation further named liferay-dev-6.1.1) in your home directory i.e.
 * for Linux: /home//liferay-dev-6.1.1
 * for Windows: e.g. C:\Users\ \liferay-dev-6.1.1
 * create a subdirectory in liferay-dev-6.1.1 named dev-bundles
 * download app-server-6.1.1-ga2-patched-with-awob-plugins.zip distribution bundle and unzip it into the liferay-dev-6.1.1 directory
 * get Liferay 6.1.1 GA2 CE source code and unzip it into liferay-dev-6.1.1/dev-bundles directory
 * get AWOB plugins SDK and unzip it into liferay-dev-6.1.1
 * get Liferay plugins SDK and unzip it into liferay-dev-6.1.1 (***Note: this is alternative to sdk-trunk. Usually these are available plugins applicable for Liferay 6.1.1 GA2 CE. If you wish to use this, then copy the build.yourusernamehere.properties file,  see below, in this directory and change it accordingly. )
 * get Ant installation and unzip it where you want to have your ant installation and follow further instructions for the ant set-up
 * get database-schema-initial-data and follow further the instrcutions for the database set-up


 * Download from MPDL Share
 * go to \\FileSvr01\Share\escidoc\AWOB\
 * copy the liferay-dev-6.1.1 directory to a location here
 * for Linux: /home/
 * for Windows: e.g. C:\Users\
 * unzip app-server-6.1.1-ga2-patched-with-awob-plugins.zip in the same directory where it is
 * unzip sdk-trunk.zip in the same directory where it is
 * (Only if you need additional portlets to install) unzip liferay-plugins-6.1.1-ga2-all-not-awob.zip in the same directory (liferay-dev-6.1.1)


 * Ant Setup
 * go to liferay-dev-6.1.1\dev-bundles directory
 * unzip apache-ant-1.9.1.zip to the directory where you want to have your ant installation. (contains ANT options settings needed)
 * Set-up ant environment variables:
 * $ANT_HOME should point to the ant installation (check with ant -version)
 * $PATH should contain $ANT_HOME as well


 * rename the file /liferay-dev-6.1.1/sdk-trunk/build.yourusernamehere.properties to /liferay-dev-6.1.1/sdk-trunk/app.server..properties. This file shall contain the following lines into it (as is for Windows, for Linux please change "\\" and "C:\Users" accordingly):

app.server.lib.global.dir = C:\\Users\\ \\liferay-dev-6.1.1\\app-server\\tomcat-7.0.40\\lib\\ext app.server.type = tomcat app.server.deploy.dir = C:\\Users\\ \\liferay-dev-6.1.1\\app-server\\tomcat-7.0.40\\webapps app.server.dir = C:\\Users\\ \\liferay-dev-6.1.1\\app-server\\tomcat-7.0.40 app.server.portal.dir = C:\\Users\\ \\liferay-dev-6.1.1\\app-server\\tomcat-7.0.40\\webapps\\ROOT app.server.zip.name = ${app.server.dir}\\..\\..\\dev-bundles\\app-server-6.1.1-ga2-patched-pure.zip ext.work.dir = ${app.server.dir}\\.. app.server.parent.dir = C:\\Users\\ \\liferay-dev-6.1.1\\app-server


 * rename all occurences of with your system account name i.e. to fit the path of the liferay-dev-6.1.1 directory

Setup PostgreSQL DB

 * Step1: create a database user (default username:lruser, default password:postgres)  (skip if already done)

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


 * Step2: create a liferay database with the previously created user as an owner (if you already have database with same name, rename it to e.g. lrlocal_old)

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


 * Step3: SKIP THIS STEP IF you use the awob tomcat bundle from app-server-6.1.1-ga2-patched-with-awob-plugins.zip ) create a file portal-ext.properties in the  directory and paste following lines into it

jdbc.default.driverClassName=org.postgresql.Driver jdbc.default.url=jdbc:postgresql://localhost:5432/lrlocal jdbc.default.username=lruser jdbc.default.password=postgres

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


 * Step4: as postgres user in your local database restore the "lrlocal" database from the file /liferay-dev-6.1.1/dev-bundles/lrlocaldump_schema_6.1.1.backup with pg_dump or PgAdmin

auto.deploy.deploy.dir _dump_server_auto.deploy.deploy.dir_value_ and replace  with your local deployment dir value (like  )
 * Step5: update table
 * find row contained string:

Starting local AWOB instance
To start a local AWOB liferay instance only, there are two prerequisites needed:

*unzipped app-server-6.1.1-ga2-patched-with-awob-plugins.zip somewhere *set-up postgreSql database and import the initial data


 * Step1: For the first time before you start the instance, make sure you have the following setting in the file /bin/setenv.sh (setenv.bat for Windows)

-Duser.timezone=Europe/Budapest -Xms512m -Xmx512m -XX:PermSize=256m -XX:MaxPermSize=256m

Note: you may change these values depending on your machine accordingly, they are already set-up to a higher value in the provided bundle, so please modify accordingly


 * Step2:start the application server

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


 * Step3: monitor server execution log can be found here /logs/catalina.out


 * Step4: During Startup, a browser window will be automatically invoked. Your instance shall be available at the following URL: http://localhost:8080


 * Step5: Login to your local AWOB instance as Administrator i.e. admin@awob.mpg.de (password known to AWOB-Developers)

Checkout and build code from SVN Repository

 * go to  and checkout latest versions of the AWOB code respectively:

svn co https://subversion.mpdl.mpg.de/repos/awob/trunk/sdk/ext svn co https://subversion.mpdl.mpg.de/repos/awob/trunk/sdk/hooks svn co https://subversion.mpdl.mpg.de/repos/awob/trunk/sdk/portlets svn co https://subversion.mpdl.mpg.de/repos/awob/trunk/sdk/themes svn co https://subversion.mpdl.mpg.de/repos/awob/trunk/sdk/webs


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

ext/awob-ext: ant build-service deploy direct-deploy portlets/tasks-portlet: ant build-service deploy portlets/so-portlet: ant build-service deploy portlets/chat-portlet: ant build-service deploy portlets/contacts-portlet: ant deploy portlets/FormulaBlackboard-portlet: ant deploy portlets/lista-correompdl-portlet: ant deploy portlets/private-messaging-portlet: ant build-service deploy portlets/web-form-portlet: ant deploy hooks/so-hook: ant deploy hooks/awob-hook: ant deploy themes/so-theme: ant deploy themes/astro-office-theme: ant deploy webs: ant deploy

Please follow the plugin deployment sequence above!

OR instead of two previous actions do:
 * go to


 * (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.1/sdk-trunk  (linux)

or

C:/Users//liferay-dev-6.1.1/sdk-trunk  (windows)

**subclipse
 * SVN client in use:

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.1
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

AWOB SVN Repository structure
General 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:


 * 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

Liferay 6.1.1 CE GA2 sources

 * we use a patched version of 6.1.1 CE GA2 which is at /dev-bundles (see liferay-portal-src-6.1.1-ga2-patched.zip)
 * these sources contain compiled community patches and additional local MPDL fix for hot-deploy

https://www.lcepatchers.org/
 * originally patched version and if available other patches can be found at
 * building of sources not needed for now, but if indeed - then check out Liferay community forums for support

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