Add a portlet to Liferay 5 (deployed in Liferay's Portlet Container)

Posted by eichelgartenweg on 11:34 AM with 4 comments
In this post i will discribe the manual deployment of portlets in WebSphere.
To get some information about the auto deployment of portlets in WebSphere, check out this post.
Manually installation of a portlet in liferays portlet container isnt an easy think but its doable.
I try to explain the procedure with an simple (self created) sample (non-struts) JSP-Portlet.

The portlet just prints out:
Hello - username - how are you?
Download it here

1. Copy the JSP-Files of the portlet to "liferay_folder"/html/portlet/welcome/
("welcome" is the portlet name)
2. Add an <portlet>-entry to WEB-INF/portlet-custom.xml
<display-name>Welcome to Liferay 5</display-name>

3. Add an entry to WEB-INF/liferay-portlet.xml

4. Add an entry to WEB-INF/liferay-display.xml
<category name="category.ownportlets">
<portlet id="welcome" />

5. Add an entry to the (located in WEB-INF/lib/portal-impl.jar)
5.1 Open portal-impl.jar//content/language-"your needed region codes".properties (Hint: use Winrar)
5.2 Add an entry for the portlet title
5.3 Add an entry fot the category name
category.ownportlets=Own portlets
5.4 Save portal-impl.jar

6. Restart server

7. After the restart it's possible to add the welcome-portlet via the "Add Application" menu

If you want to deploy a struts portlet you have to additionally edit the struts-config.xml and the tiles-def.xml.

If you downloaded a portlet form its a bit easier.
Open the downloaded war-file and take a look at the delivered xml-files.
These files just contain the additional entries needed for this portlet.
Copy these entries and paste them in the xmls located in your liferay installation.
Also extract all resources (classes,jars, jsps) to the corresponding folder.
Restart the server and thats it.
Picture (maybe it helps :-) :

Use an ext-enviroment and choose websphere as app-server