Announcing: Add New User Wizard

I’ve just completed the Add New User Wizard portlet which takes Liferay’s Enterprise Admin Add User function and makes it a user-friendly expeirience.  It demonstrates using another Spring feature: the AbstractWizardFormController. Go to the downloads area to get a free copy.

This portlet also demonstrates using some of the Liferay kernel and service utilites within both the JSP and the Java classes.  This wizard only has about 8 steps and doesn’t include adding all of the new user fields.  I’ll leave that for the next version.

Tags:
Posted in Annoucements by Jeff Robinson. Comments Off

Building SDK Portlets

When using the Liferay Plugin SDK to build portlets, I’ve discovered that:

  1. Your portlet lib folder should contain only jars that are NOT in the Liferay portal ROOT lib folder.
  2. If your portlet needs access to jars already in Liferay, edit the WEB-INFliferay-plugin-package.properties file and add those jars to the portal-dependency.jars area.

During the build, those jars are temporarily copied to the porlet lib area and deleted afterwards.  During deployment, those jars are copied from Liferay’s lib folder to the deployed portlet lib folder.

Problem:  if you’ve already copied the jars yourself, Liferay won’t do the copy.  This could lead to version headaches and all kinds of strange Exception errors within Liferay.

Posted in General by Jeff Robinson. 2 Comments

Accessing Current URL

Although JSR 168 specifies that portlets do NOT have access to the client request of the portal (JSR 168, p. 16),  Liferay developers will find that they do have access to this URL.  If using the extension environment, take a peek at the JSP source in:

[liferay]portal\portal-web\docroot\html\portlet\init.jsp

Once there, youl’ll find the following code:

String currentURL = PortalUtil.getCurrentURL(request);

This means that each portlet JSP has immediate access to the original URL without any special tokens or encoding.  And since this file is included in the downstream JSP, you only need to access “currentURL” within your JSP to have access. You never know when this might come in handy!

Tags:
Posted in General by Jeff Robinson. Comments Off