Transcript
Page 1: JSP Portlet Copyright © 2000-2006 Liferay, Inc. All Rights Reserved. No material may be reproduced electronically or in print without written permission

JSP Portlet

Copyright © 2000-2006 Liferay, Inc.

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

permission from Liferay, LLC.

Page 2: JSP Portlet Copyright © 2000-2006 Liferay, Inc. All Rights Reserved. No material may be reproduced electronically or in print without written permission

Introduction

Difficulty Level: Easy

The source code for this presentation is located here:source-code-part2

Page 3: JSP Portlet Copyright © 2000-2006 Liferay, Inc. All Rights Reserved. No material may be reproduced electronically or in print without written permission

Objectives

The goal of this tutorial is to change the Title of our portlet and add it to a Category

1. Set the TitleLanguage-ext.properties

2. Add the portlet to a Categoryliferay-display.xml

Page 4: JSP Portlet Copyright © 2000-2006 Liferay, Inc. All Rights Reserved. No material may be reproduced electronically or in print without written permission

Directory Structure

Configuration files are located here:\ext\ext-web\docroot\WEB-INF

Property files are located here:\ext\ext-ejb\classes

Page 5: JSP Portlet Copyright © 2000-2006 Liferay, Inc. All Rights Reserved. No material may be reproduced electronically or in print without written permission

Language-ext.properties

The first step is to change the Title from javax.portlet.title.EXT_2 to JSP Portlet!

1. Go to ext\ext-ejb\classes\content\Language-ext.properties

2. Enter the following in Language-ext.properties:javax.portlet.title.EXT_2=JSP Portlet!

Page 6: JSP Portlet Copyright © 2000-2006 Liferay, Inc. All Rights Reserved. No material may be reproduced electronically or in print without written permission

liferay-display.xml

Next, let’s add our portlet to the Test Category

1. Go to ext\ext-web\docroot\WEB-INF\liferay-display.xml

2. Enter the following in liferay-display.xml:<category name="category.test">

<portlet id=“47” />…<portlet id="EXT_1" /><portlet id="EXT_2" />

</category>

Page 7: JSP Portlet Copyright © 2000-2006 Liferay, Inc. All Rights Reserved. No material may be reproduced electronically or in print without written permission

Checkpoint

1. What is happening in the following line?javax.portlet.title.EXT_2=JSP Portlet!

2. What do you think category.test represents?

3. Where are configuration files like liferay-display.xml located?

4. Where are properties files located?

Page 8: JSP Portlet Copyright © 2000-2006 Liferay, Inc. All Rights Reserved. No material may be reproduced electronically or in print without written permission

Deploy the Files to Tomcat

1. Click Start Run…

2. Type cmd and press Enter

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

4. Type ant deploy

Page 9: JSP Portlet Copyright © 2000-2006 Liferay, Inc. All Rights Reserved. No material may be reproduced electronically or in print without written permission

Final Steps

1. Restart Tomcat:Click on the Tomcat WindowPress Ctrl-CDouble click startup.bat

2. Open up a new browser and type http://localhost:8080Login: [email protected]: test

Page 10: JSP Portlet Copyright © 2000-2006 Liferay, Inc. All Rights Reserved. No material may be reproduced electronically or in print without written permission

Congratulations!

You’ve created your first JSP Portlet!

1. Mapped the title from javax.portlet.title.EXT_2 to JSP Portlet!Language-ext.properties

2. Added our portlet to the Test category liferay-display.xml

Page 11: JSP Portlet Copyright © 2000-2006 Liferay, Inc. All Rights Reserved. No material may be reproduced electronically or in print without written permission

Revision HistoryEdward Shin 09/17/06 Updated for Liferay 4.1.2


Top Related