Selasa, 08 Desember 2009

Building Ext Environtment on Liferay and Apache Tomcat .6.0.18

Building Ext Environment using liferay src and tomcat 6

INITIAL SETUP
Before we starting to build ext environtment for liferay. We need tools for development. The tools we need is :
1. Ant, i’m using ant.1.7.0 for this article
2. Jikes, i use Jikes 1.2.2-windows
3. JDK, i use JDK 1.6
4. Liferay source code, i use liferay 5.2.3
5. Apache tomcat, i use apache tomcat 6.0.18

Ok, let’s get started.
Ok, let say we have install JDK, extract Ant and jikes, extract tomcat and liferay Src.
First thing we need is set environtment variabels on windows, on windows open My Computer and right click open properties. After properties dialog open, choose advance tab and click on Environtment Variabels.
1. Add new variable and name it as JAVA_HOME set value to JDK Instalation Path on your windows.
2. Add new variable and name it as ANT_HOME set value to ANT extracted Path on your windows.
3. Add new variable and name it as JIKES_HOME set value to JIKES extracted Path on your windows.
4. Test your setting by execute command prompt : java –version for JDK, ant –version for Ant and jikes –version for jikes.
Tomcat.
Tomcat is open source server come from apache software foundation. Extract tomcat to our project directory. E.g
E:>\ liferay\tomcatxxx (xxx is version of tomcat)
Liferay
Liferay is largest open source java portal. See liferay wiki site for more info. Extract liferay src to portal directory under workspace directory. E.g
E:>\liferay\workspace\portal

EXT ENVIRONTMENT
Before we create ext environtment, we need to create several properties file. This file will override original properties file in liferay src/portal folder. The properties is app.server.properties and release.properties.
1. Create release.{username}.properties
Username is username on your windows logon, to knows your username at command prompt write “set” and see what is username.
On release.{username}.properties, add this line :

lp.ext.dir E:>/liferay/portal/workspace/ext

this line is show where ext directory which liferay will copy most of file need to development.
Save release.{username}.properties and put into /portal directory

2. Create build.{username}.properties
Build properties is properties for ant to know which version java development we use.
Add this two line into build.{username}.properties

ant.build.javac.source=1.6
ant.build.javac.target=1.6

since we use JDK 1.6 so at the end of line we put 1.6

3. Create app.{username}.properties
This file properties content information about server type we use on development. Add this line into app.{username}.properties

app.server.tomcat.version=6.0
app.server.tomcat.dir=E:/liferay/apache-tomcat-6.0.18
app.server.tomcat.classes.global.dir=${app.server.tomcat.dir}/lib
app.server.tomcat.lib.endorsed.dir = ${app.server.tomcat.dir}/lib/ext
app.server.tomcat.lib.global.dir=${app.server.tomcat.dir}/lib/ext
app.server.tomcat.lib.support.dir=${app.server.tomcat.dir}/lib/ext
app.server.tomcat.support.dir=${app.server.tomcat.dir}/lib/ext

ECLIPSE IDE

for this development we will use eclipse as IDE. In eclipse, direct workspace into forlder workspace that we create before.
Create new java project and choose import existing project into workspace, choose portal and click finish.

To build on eclipse we need ant view, choose windows and show view. Click on Ant then drag build properties from portal project.

Before we can build portal project, we need to configure tomcat server. On eclipse create new project let’s name it as server. Create new folder under server and name it as catalina_home. But when we prompt dialog, click on advance and fill link into file system with tomcat path where we extracted before. Press finish.

Configure tomcat, in /catalina/conf/catalina.properties. edit this file in eclipse and add this line ${catalina.home}/lib/ext/*.jar to end of common.loader.
This is the complete common.loader after edit :

common.loader=${catalina.home}/lib,${catalina.home}/lib/*.jar, ${catalina.home}/lib/ext/*.jar

lets build ext environment. On command prompt direct into portal path and type this command
ant clean build-ext
or on eclipse>ant view. Double click clean then build-ext.

Now your ext environtment has created. To see point to /liferay/workspace/ directory and you will see ext directory.

This is my conclusion after read Liferay 5.2 System Development from http://www.packtpub.com/liferay-portal-5-2-systems-development/book

you can download liferay portal administartion guide here :

http://www.ziddu.com/download/7650185/liferay-quick-start-guide-4.0.pdf.html
http://www.ziddu.com/download/7650186/liferay_4_extension_environment_guide.pdf.html
http://www.ziddu.com/download/7650187/liferay-extension-environment-guide-4.3.pdf.html

Tidak ada komentar:

Posting Komentar