Sure:
I have been working on enhancing Pluto in order to provide
auto-publishing capabilities. I've just completed the first step.
Progress So Far:
------------------------
Pluto has been enhanced so that upon startup of any portlet application
the application automatically registers itself with the portlet container.
This functionality can be seen in Pluto by deploying the Pluto Portal
(driver) and looking at the "Page Admin" portlet on the Administration
screen. This page shows each of the portlets that has been autodeployed.
Next Steps:
------------------------
Pluto needs to be modified to utilize both the contextPath (current
approach) OR the applicationId (new approach; pluto assigned) for
dispatching to portlets.
Implementation:
------------------------
Pluto requires portlet applications to define a servlet that is mapped
to a special PlutoInvoker url in order to perform cross-context
dispatching. This servlet has been modified so that it automatically
registers itself with the container.
Unfortunately, it is not until servlet 2.5 (not widely deployed) that
the ServletContext is provided a contextPath property. Because of this,
and the fact that we need to register the portlet application based upon
a unique id, we attempt to derive an application id based off of the
following algorithm:
1) if a getContextPath() method exists on the ServletContext, invoke it
using reflection (so as to not fail in <= 2.4 environments) and use the
return value as the applicationId
2) if not, check to see if a init parameter or context attribute named
org.apache.pluto.CONTEXT_PATH has been set. If so, use it's value as
the applicationId
3) if not, check to see if the web app has been given a name
(ServletContext.getServletContextName()). If so, retrieve it's value
and use a hex string version of it for the applicationId.
4) if not, generate a random string and us it. This final fallback
allows the portlet to only be used temporarily. (If anyone has any
better ideas on what else we can use, please let me know - perhaps a
unique string derived off of the portlets available within the app).
The bottom line, is that after this work is complete (1 week?) there
will not longer be a need to "publish" portlets to the container.
Instead, once the portlet app war is deployed by the app server, it will
automatically take care of the rest.
Hope that's insightful, let me know if there are any questions. . .
David
Craig Doremus wrote:
Hi David,
I'm getting ready to commit work I've been doing on an admin portlet to
deploy other portlets in support of PLUTO-215, but I noticed you just
committed some stuff on autoregistration of portlets. Can you explain
how this 'autoregistration' is going to work? I just want to make sure
we aren't stepping on each other's toes.
TIA
/Craig