Transcript Slide 1

Ext Environment
Copyright © 2005 Liferay, LLC
All Rights Reserved.
No material may be reproduced electronically or in print without written
permission from Liferay, LLC.
Objectives
Ext Environment
1. Set the Directory of the Ext Environment
2. Build the Ext Environment
3. Set the Type of Server
4. Set the Directory of the Server
Purpose of the Ext Environment
•
•
It is very difficult to upgrade to new
versions of Liferay if you modify the
source code directly.
The Ext Environment allows you to
extend and modify the source code
without breaking your upgrade path.
Set the Ext Environment Directory
1. Go to C:\Training\liferay\portal
2. Open release.properties with Notepad
The first thing you should note is this:
## DO NOT EDIT THIS FILE.
##
## To update the properties of this file, create a
separate properties file
## named "release.${user.name}.properties" with
the properties to overwrite.
Set the Ext Environment Directory
•
•
•
•
•
Don’t edit release.properties directly. But what is
release.${user.name}.properties?
release.${user.name}.properties is the extension file
for release.properties.
The properties in release.${user.name}.properties will
overwrite the properties in release.properties.
${user.name} represents the user name of your
computer. Do NOT name your file
release.${user.name}.properties.
See the next slides to find out how to determine the
user name of your computer and how to create your
release.${user.name}.properties file.
Find Out Your User Name
1.
2.
3.
4.
Click Start  Run…
Type cmd and press Enter
Type set in the cmd prompt
Write down your user name
In this example,
${user.name} = ed
release.${user.name}.properties
Create your release.${user.name}.properties file.
•
In the previous example, the user name was ed.
${user.name}=ed
•
This user would create a file called
release.ed.properties
Example 1:
If your user name is Administrator, create a file called
release.Administrator.properties
Example 2:
If your user name is compaq.zzzz.13, create a file
called release.compaq.zzzz.13.properties
Set the Ext Environment Directory
Enter the following in
release.${user.name}.properties:
lp.eclipse.dir=C:/Java/eclipse
lp.ext.dir=C:/Training/liferay/ext
lp.eclipse.dir tells Liferay where you installed
Eclipse.
lp.ext.dir tells Liferay where to create the EXT
environment.
Build the EXT Environment
1.
2.
3.
4.
Click Start  Run…
Type cmd and press Enter
Navigate to C:\Training\liferay\portal
Type ant clean start build-ext in the command prompt.
5.
6.
•
At some point, Windows may ask if it should allow
Java to continue. This is a firewall setting. Click yes.
Verify that the EXT Environment is being built in
C:\Training\liferay\ext
Remember, we specified the location of the EXT
environment in release.${user.name}.properties:
lp.ext.dir=C:/Training/liferay/ext
Make sure that C:\Training\liferay\ext was created
and contains the following directory structure
Checkpoint
If you do not have an ext/ext-ejb/src directory, you have
built the EXT environment incorrectly.
If this is the case, you must:
1. Delete the entire ext directory
2. Verify that release.${user.name}.properties is
located in C:\Training\liferay\portal
3. Check to see if your ${user.name} is correct
4. Make sure that lp.ext.dir=C:/Training/liferay/ext
5. Run ant clean start build-ext again
This error can occur if you manually created the ext
directory. Liferay cannot build the Ext Environment
correctly if the ext directory already exists.
app.server.properties
Liferay has custom build scripts for each server.
The server and its location are specified in
app.server.properties.
1. Go to C:\Training\liferay\ext
2. Create app.server.${user.name}.properties
• Replace ${user.name} with the user name of
your computer.
app.server.{user.name}.properties
Enter the following in
app.server.${user.name}.properties:
app.server.type=tomcat
app.server.tomcat.dir=C:/Training/liferay/tomcat
app.server.type tells Liferay which server it will
deploy to
app.server.tomcat.dir tells Liferay the location of
Tomcat
Checkpoint
1.
2.
3.
4.
5.
•
Click Start  Run..
Type cmd
Navigate to C:\Training\liferay\ext
Type ant deploy
Check to console to see if your files are being
deployed to C:\Training\liferay\tomcat
If this is not the case:
1. Verify that app.server.${user.name}.properties is
located in C:\Training\liferay\ext
2. Check to see if your ${user.name} is correct
3. Make sure that app.server.type=tomcat and
app.server.tomcat.dir=C:/Training/liferay/tomcat
Congratulations!
You’ve just built the EXT Environment!
1. Set the location of the EXT Environment by extending
the release.properties file
release.${user.name}.properties
2. Run ant clean start build-ext to create the EXT
environment
3. Configured app.server.{user.name}.properties so that
ant deploy will deploy your files to Tomcat
4. Configured app.server.{user.name}.properties so that
ant deploy will deploy your files to
C:\Training\liferay\tomcat instead of
C:\Training\liferay\ext\servers\tomcat
Revision History
Edward Shin
8/28/2006 Updated for Liferay 4.1.1