Pages

Sunday, November 8, 2009

Liferay Extension Environment

1) Download the liferay source from liferay.com
2) Now you need to create two property files those are
release.< computerName > .proerties
app.server.< computeName > .properties
3) Add following content to newly created relese. < computeName > .property file

lp.ext.dir= -- location where to create extension folder--

Eg: lp.ext.dir=D:/hytv/source/ext-env
(Note: Remember this ext-env directory should not be existed physically in specified location)

Now add the below content to newly created file app.server. < computerName > . property file.

app.server.tomcat.dir= < Specify the Tomcat location >

Eg:

##
## Server Type
##

app.server.type=tomcat
app.server.tomcat.version=5.5
app.server.tomcat.dir=D:/hytv/source/apache-tomcat-5.5.27
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.zip.name=liferay-portal-tomcat-5.5-${downloads.version}.zip


Note: this file is useful to creates the total tomcat environment of Tomcat and replaces those in specified tomcat server files.


4) Now create a project in Netbeans
NewProject --> Java --> Java-freeform-Project.



5) Now specify the location of liferay source code folder, and build.xml location.




6) Here you can customize the ant build as per your requirement.



7) Now you can choose jdk source levels, and encoding technique.



8) Now click on finish button to get the src project. Here you can see the created project will be shown on netbeans IDE.



9) Ignore the errors if you got in Net beans project. Now expand the build.xml file by clicking on + button.

10) Right click on deploy option and then click on Run target.
11) Now Right click on build-ext option then click on Run target.
12) You have successfully created the liferay extension environment.
13) Now you can open the ext-env folder as netbeans project.
14) Here you need to copy the app.server. < computerName > . properties
and release. < computerName > . properties files from liferay source to ext-env folders.

15) Now if you want to change database, or any other related things then you can just add the necessary changes in portal-ext.properties file of ext-env file.

Eg: Adding new database specification.

# MySQL
#
jdbc.default.driverClassName=com.mysql.jdbc.Driver
jdbc.default.url=jdbc:mysql://localhost/lportal234?useUnicode=true&characterEncoding=UTF-8&useFastDateParsing=false
jdbc.default.username=root
jdbc.default.password=kmipl


16) Click on build.xml, run the deploy option for every modification.
17) Now Start the tomcat server. (which is specified in app.server. < computerName > . properties file).

Monday, November 2, 2009

Modes available on liferay portlet

Portlet will contains the following modes

PortletMode
VIEW
EDIT
HELP

Third party services can implements their own modes including the above portlet modes. for example liferay provides the following modes.

LiferayPortletMode
ABOUT
CONFIG
EDIT_DEFAULTS
EDIT_GUEST
PREVIEW
PRINT