2 Replies Latest reply on Mar 12, 2008 10:47 AM by claprun

    Portlet runtime meta data extension

      I would like to avoid to have to extend the Container*Info classes for its usage in 2.7, for several reasons:

      1/ minimize the coupling (would not survive refactors)
      2/ would require to introduce factories (so the builder creates the proper implementation subclass)

      It will be more appropriate to use an extension mechanism based on composition by adding on CorePortletInfo a notion of attachment/payload, basically an hashmap using generics to more convenience.

      public interface PortletInfo
      {
       /**
       * Returns a generic attachment on the portlet info.
       *
       * @param type the parameter type
       * @return the attachment or null
       * @throws IllegalArgumentException if the parameter type is null
       */
       <T> T getAttachment(Class<T> type) throws IllegalArgumentException;
      
       ...
      
      }
      


      There is a setAttachment on the ContainerPortletInfo implementation that allows to attach payload during the phase where the deployer builds the runtime meta data from the descriptor meta data.

      The deployer extension will be able to add payload for the core info extensions.