Issue Details (XML | Word | Printable)

Key: JS2-260
Type: Improvement Improvement
Status: Resolved Resolved
Resolution: Fixed
Priority: Minor Minor
Assignee: Ate Douma
Reporter: Ate Douma
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Jetspeed 2

Removing dependency on Pluto PortletContainerServices and providing a JetspeedNamespaceMapper

Created: 17/May/05 11:40 PM   Updated: 19/May/05 03:48 AM
Return to search
Component/s: Container
Affects Version/s: 2.0-M2
Fix Version/s: 2.0-M3, 2.0-FINAL

Time Tracking:
Not Specified

Resolution Date: 19/May/05 03:48 AM


 Description  « Hide
In my pursuit of fixing the parallel rendering problem (http://issues.apache.org/jira/browse/JS2-226)
I found out we use PortletContainerServices.prepare("jetspeed") calls several times in the PortletRendererImpl.
This method "prepares" the Pluto PortletContainer by putting the named ("jetspeed") container and its environment in a Stack in a ThreadLocal.
This is required by Pluto before the container and/or its services can be accessed.
For "normal" container interaction this need not be done by the portal as Pluto does so itself.

But, if you want/need to access its services independently *outside* a container invocation this preparation must be done otherwise Pluto will throw an exception.

Because Pluto maintains the current "container" context in a ThreadLocal Stack, after using the services they
should be "released" again.
But, although the services are "prepared" several times, they are never "released", resulting in a useless
filling of the Stack with the same context.

After looking into this more deeply, I discovered the reason why we prepare the PortletContainerServices:
to be able to get to the NamespaceMapper from Pluto (using NamespaceAccessor.getNamespaceMapper()).
As Jetspeed itself provides the NamespaceMapper to use by Pluto I find it odd why we should need to use the
Pluto PortletContainerServices to get back at it.

Furthermore, we currently use the NamespaceMapper of Pluto which itself uses the hardcoded "Pluto_" prefix.
Also, I found we have our own NamespaceMapper (in commons) but that is not used yet (nor does it implement
the NamespaceMapper interface).

As I liked to remove the unneeded (and incomplete) usage of the PortletContainerServices, I decided to
provide a complete and configurable implementation of the NamespaceMapper: the JetspeedNamespaceMapper.
This (interface) extension of the Pluto NamespaceMapper provides the option to specify our own prefix.
Default, this now is "js_", but it can be configured (even back to "Pluto_" if you want) through the spring context.
I moved our old NamespaceMapper from the commons subproject to a new JetspeedNamespaceMapperImpl under the
portal subproject keeping the package org.apache.jetspeed.container.namespace, and also implemented the
Pluto NamespaceMapper interface.

As our own JetspeedNamespaceMapper now is a true spring component, I replaced the
NamespaceAccessor.getNamespaceMapper() calls by getting the JetspeedNamespaceMapperFactory from the spring ComponentManager.
As result, the need to call PortletContainerServices.prepare("jetspeed") is now gone and I subsequently
removed those as well.

This doesn't solve yet the parallel rendering problem but at least the container interactions are cleaner
now.



 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Ate Douma added a comment - 17/May/05 11:48 PM
I've already committed my changes to the M3_preparation branch.
Will do the same to the CVS-HEAD later this evening.

Ate Douma made changes - 19/May/05 03:48 AM
Field Original Value New Value
Resolution Fixed [ 1 ]
Status Open [ 1 ] Resolved [ 5 ]