jsp portlet copyright © 2000-2006 liferay, inc. all rights reserved. no material may be reproduced...
TRANSCRIPT
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.
Introduction
Difficulty Level: Easy
The source code for this presentation is located here:source-code-part2
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
Directory Structure
Configuration files are located here:\ext\ext-web\docroot\WEB-INF
Property files are located here:\ext\ext-ejb\classes
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!
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>
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?
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
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
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
Revision HistoryEdward Shin 09/17/06 Updated for Liferay 4.1.2