You are viewing a plain text version of this content. The canonical link for it is here.
Posted to pluto-dev@portals.apache.org by "Ate Douma (JIRA)" <ji...@apache.org> on 2008/10/15 01:52:44 UTC

[jira] Commented: (PLUTO-509) JAXB portlet descriptor model handling broken with respect to the different namespace handling for portlet API 1.0 and 2.0

    [ https://issues.apache.org/jira/browse/PLUTO-509?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12639649#action_12639649 ] 

Ate Douma commented on PLUTO-509:
---------------------------------

I'd like to mention an important observation I made while refactoring the JAXB implementation classes properly:

The current implementation is *not* portlet 2.0 spec compliant, and based upon an outdated draft version...

For one, multi-langual support for Descriptor, DisplayName, etc. elements is not present, only a single description/displayName etc. is possible.
Portlet expirationCache definition was simplified near the end of specification period, but the current Pluto model still is based on the no longer valid old construct. 
CustomPortalMode still has a decorationName field while that is no longer present in the final model.
EventDefinition model really is out-of-sync with the final xsd.
...

All the above issues are resolved by generation clean set of JAXB implementation classes based upon the final portlet-app_2_0.xsd


> JAXB portlet descriptor model handling broken with respect to the different namespace handling for portlet API 1.0 and 2.0
> --------------------------------------------------------------------------------------------------------------------------
>
>                 Key: PLUTO-509
>                 URL: https://issues.apache.org/jira/browse/PLUTO-509
>             Project: Pluto
>          Issue Type: Bug
>          Components: descriptor
>    Affects Versions: 2.0.0, 2.0-refactoring
>            Reporter: Ate Douma
>            Assignee: Ate Douma
>            Priority: Critical
>             Fix For: 2.0.0, 2.0-refactoring
>
>
> The current Portlet 1.0 and Portlet 2.0 JAXB descriptor api is an ackward merge of both namespaces in one object model.
> While this did seem to "work" more or less correct, when testing it more thoroughly it complete blew to pieces ...
> JAXB really cannot properly handle two namespaces blended on top of a single object model, it uses java packaging to map namespaces.
> And while you can have multiple fields mapped to multiple namespaces in one bean, one cannot do the same with one class: you really need to duplicate the classes to support multiple namespaces.
> This really becomes clear as soon as you try to actually write out an JAXB managed object tree.
> Using the current Pluto descriptor mapping this simply isn't possible to do without a corrupting the output or just exceptions thrown all over the place.
> So, as we do need to have this managed properly, I have started out *rewriting* the whole JAXB mapping mostly from scratch again, now properly using two implementation packages for the two namespaces (portlet10 and portlet20).
> As we already had extracted the descriptor api interfaces, the two new implementation packages both implement the *most* common denominator (e.g. portlet20) interface, where the portlet10 implementations throw an UnsupportedOperationException when trying to use portlet20 specific features (write *and* read methods).
> As the JAXB jxc compiler generates classes based on the xsd type definitions, all *DD classes ended up to be called *Type now. I've kept it that way as the *DD classes are no longer directly used anyway (or at least shouldn't).
> Finally, to be able to modify an JAXB loaded portlet10 or portlet20 descriptor model, while only dealing with the interfaces, a solution is needed for creating new instances of objects managed through lists, e.g. portletApp.getPortlets().add(Portlet).
> For this purpose, I've created a new ElementFactoryList<E> extending ArrayList<E> which provides a factory method for creating new elements for itself: E ElementFactoryList<E>.newElement().
> So, like for a org.apache.pluto.om.portlet.Portlet interface, you have to use: portletApp.getPortlets().add(portletApp.getPortlets().newElement()).
>  
>     

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.