portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Sean Taylor <d.tay...@onehippo.com>
Subject Re: login portlet extension
Date Wed, 03 Feb 2010 23:03:37 GMT
On Wed, Feb 3, 2010 at 7:44 AM, Dahl, Sandra <SDahl@dvsanalytics.com> wrote:

> Thanks for the information, David. In general, what is the best practice
> for extending an existing Jetspeed portlet so future Jetspeed updates can be
> easily implemented?
> I think there are two approaches you can take:

1. write your own administrative portlet application, and manage all code
2. overlay the j2-admin.war artifact from maven

The first solution doesn't work well for re-use, as much j2-admin's
functionality is hidden down in JSP files. Additionally, we do not
distribute j2-admin as a jar file to reuse java classes. With that in mind,
lets look at how you can approach the second solution.

Many people prefer Ant for this kind of processing. In fairness to Ant, lets
look at how you could do that. I didn't have an example with the j2-admin
war, but here is an similar example using the jetspeed layouts war.

<target name='overlay-layouts'>
<mkdir dir='${installer.target}/unpack/'/>
<copy overwrite='true'
basedir="${installer.target}/unpack/jetspeed-layouts/" update='true'/>

In the target above, the Ant target overlays my customized portlet.xml on
top of the jetspeed-layouts war, and then create the new merged war file.
The downside to this approach, we don't take the jetspeed-layouts.war file
out of a Maven repository.

As a hybrid solution, if you prefer Ant but are required to use Maven, you
can embed ant commands into Maven at the generate-resources phase. There are
examples of this in the jetspeed-installer and enterprise sub-projects

Here is a pure Maven solution, which I would consider a best practice for
Maven builds. In this example I use the Maven War Plugin's overlay feature:


Here is a complete pom.xml example:

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="
  <name>extended-j2admin Maven Webapp</name>
              <!-- empty groupId/artifactId is detected as the current build

I have zipped up the entire project for you to play around with and put it
on my retired server here:


There are two files in the overlay project's webapp source:

1. the web.xml, to show an example of replacing an existing file, where I
simply changed the display-name and description as an example:

  <display-name>Sandra's Jetspeed-2 Portal Administration
  <description>Sandra's Administration Portlets for the Jetspeed-2
Enterprise Portal</description>

2. the index.jsp, to show an example of adding a new file

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message