17
Ext Environment Copyright © 2005 Liferay, LLC All Rights Reserved. No material may be reproduced electronically or in print without written permission from Liferay, LLC.

Ext Environment Copyright © 2005 Liferay, LLC All Rights Reserved. No material may be reproduced electronically or in print without written permission

Embed Size (px)

Citation preview

Page 1: Ext Environment Copyright © 2005 Liferay, LLC All Rights Reserved. No material may be reproduced electronically or in print without written permission

Ext Environment

Copyright © 2005 Liferay, LLC

All Rights Reserved.No material may be reproduced electronically or in print without written

permission from Liferay, LLC.

Page 2: Ext Environment Copyright © 2005 Liferay, LLC All Rights Reserved. No material may be reproduced electronically or in print without written permission

Objectives

Ext Environment

1. Set the Location of the Ext Environment

2. Build the Ext Environment

3. Set the Server Type

4. Set the Location of the Server

Page 3: Ext Environment Copyright © 2005 Liferay, LLC All Rights Reserved. No material may be reproduced electronically or in print without written permission

Purpose of the Ext Environment

It is 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

Page 4: Ext Environment Copyright © 2005 Liferay, LLC All Rights Reserved. No material may be reproduced electronically or in print without written permission

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.

Page 5: Ext Environment Copyright © 2005 Liferay, LLC All Rights Reserved. No material may be reproduced electronically or in print without written permission

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

Page 6: Ext Environment Copyright © 2005 Liferay, LLC All Rights Reserved. No material may be reproduced electronically or in print without written permission

Find Out Your User Name

1. Click Start Run…

2. Type cmd and press Enter

3. Type set in the cmd prompt

4. Write down your user name

In this example,

${user.name} = ed

Page 7: Ext Environment Copyright © 2005 Liferay, LLC All Rights Reserved. No material may be reproduced electronically or in print without written permission

release.${user.name}.properties

Create your release.${user.name}.properties file.• In the previous example, the user name was “ed” $

{user.name}=ed• To override release.properties, 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

Page 8: Ext Environment Copyright © 2005 Liferay, LLC All Rights Reserved. No material may be reproduced electronically or in print without written permission

Enter the following in release.${user.name}.properties:lp.eclipse.dir=C:/Java/eclipselp.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.

Set the Ext Environment Directory

Page 9: Ext Environment Copyright © 2005 Liferay, LLC All Rights Reserved. No material may be reproduced electronically or in print without written permission

Build the EXT Environment

1. Click Start Run…

2. Type cmd and press Enter

3. Navigate to C:\Training\liferay\portal

4. Type ant clean start build-ext in the command prompt.

Page 10: Ext Environment Copyright © 2005 Liferay, LLC All Rights Reserved. No material may be reproduced electronically or in print without written permission

5. At some point, Windows may ask if it should allow Java to continue. This is a firewall setting. Click yes.

6. Verify that the EXT Environment is being built in C:\Training\liferay\ext

Note: The location of the EXT environment is specified in release.${user.name}.properties:

lp.ext.dir=C:/Training/liferay/ext

Page 11: Ext Environment Copyright © 2005 Liferay, LLC All Rights Reserved. No material may be reproduced electronically or in print without written permission

Make sure that C:\Training\liferay\ext was created and contains the following directory structure

Page 12: Ext Environment Copyright © 2005 Liferay, LLC All Rights Reserved. No material may be reproduced electronically or in print without written permission

Checkpoint

If you do not have the 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.(See slide 6, “Find Out Your User Name”.)

4. Make sure that lp.ext.dir=C:/Training/liferay/ext Finally, 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.

Page 13: Ext Environment Copyright © 2005 Liferay, LLC All Rights Reserved. No material may be reproduced electronically or in print without written permission

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

Page 14: Ext Environment Copyright © 2005 Liferay, LLC All Rights Reserved. No material may be reproduced electronically or in print without written permission

Enter the following in app.server.${user.name}.properties:app.server.type=tomcatapp.server.tomcat.dir=C:/Training/liferay/tomcat

app.server.type tells Liferay the server type. Liferay has custom build scripts for each server.

app.server.tomcat.dir tells Liferay the location of the server.

app.server.{user.name}.properties

Page 15: Ext Environment Copyright © 2005 Liferay, LLC All Rights Reserved. No material may be reproduced electronically or in print without written permission

Checkpoint

1. Click Start Run..

2. Type cmd

3. Navigate to C:\Training\liferay\ext

4. Type ant deploy

5. 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\extIf your app.server.${user.name}.properties is located in C:\Training\liferay\portal it is incorrect

2. Check to see if your ${user.name} is correct(See slide 6, “Find Out Your User Name”)

3. Make sure that app.server.type=tomcat andapp.server.tomcat.dir=C:/Training/liferay/tomcat

Page 16: Ext Environment Copyright © 2005 Liferay, LLC All Rights Reserved. No material may be reproduced electronically or in print without written permission

Congratulations!

You’ve just built the EXT Environment!

1. Set the location of the EXT Environment by extending the release.properties filerelease.${user.name}.properties

2. Run ant clean start build-ext to create the EXT environment

3. Set the server type to Tomcat by extending app.server.propertiesapp.server.${user.name}.properties

4. Configured app.server.{user.name}.properties so that ant deploy will deploy your files to C:\Training\liferay\tomcat

Page 17: Ext Environment Copyright © 2005 Liferay, LLC All Rights Reserved. No material may be reproduced electronically or in print without written permission

Revision History08/28/06 Edward Shin Author

11/13/06 Edward Shin Updated slides 2, 3, 4, 5, 7, 10, 12, 14, 15 and 16