portletspec3
  1. portletspec3
  2. PORTLETSPEC3-5

Errata: Clarification about Private Render Parameters

    Details

      Description

      I'm struggling a little bit about exactly how to anchor the following clarification - whether we need a
      change in the javadoc, or a paragraph in the spec.

      First some background:
      ---------------------------
      > The spec/javadoc never clearly states the specific meaning/semantic of
      > getPrivateParameterMap().  Because of this there seem to be varying
      > released interpretations/implementations.  Can you clarify?  Which is
      > correct:
      >
      >    1. getPrivateParameterMap returns a Map of the non-public render
      >       parameters whose existence stems from the use on one of the
      >       setParameter APIs in a render or resource URL or on an action or
      >       event response.  I.e. getPrivateParameterMap returns the requests
      >       private render parameters and since during an action there is no
      >       such thing one expects an empty Map to always be returned in this
      >       lifcycle (phase). Or put another way merging this Map with the
      >       public render parameter Map doesn't (always) yield the contents of
      >       getParameterMap() -- when a resource request receives postback
      >       data as well as public/private render params.
      >    2. getPrivateParameterMap returns a Map of the non-public parameters
      >       in this request.  I.e. in an action request, this api returns the
      >       same/equivalent Map as getParameterMap -- and in a resource
      >       request one gets both the private render parameters and postback
      >       data in this Map.
      >    3. something else?
      >
      >  >From a programming perspective I find (2) more interesting/valuable as
      > I can see uses for code that uses getPublicParameterMap() to process the
      > PRPs and then turns around and continue working with the rest of the
      > parameters it hasn't yet processed.
      >     -Mike-
      
      Hi Mike,
      
      To me (2) is what both the spec and javadoc do describe as the intended behavior.
      
      The spec says in PLT.11.1.2 "Portlets can access a merged set of public and private 
      parameters via the getParameter methods on the PortletRequest or separated as maps 
      of private parameters via the method and public parameters via the 
      getPrivateParameterMap. (lxxxvi)"
      
      That alone I would think already disqualifies interpretation (1) above as it clearly 
      states that getParameterMap() always represents a union of the private and public 
      parameters accessible through getPrivateParameterMap() and getPublicParameterMap().
      
      Furthermore, the PortletRequest.getPrivateParameterMap() javadoc also states 
      "Returns a Map of the private parameters of this request." As this method is 
      (fully) inherited by ActionRequest, it also applies to action requests. As 
      nothing is said anywhere to exclude postback data from this Map, and the 
      getParameterMap() method (which must also represent the portlet private 
      parameters) also doesn't distinguish between posted or non-posted parameters, 
      I think interpretation (2) is correct.
      
      Both Apache Pluto container and Jetspeed-2 Portal have been implemented 
      according to (2).
      ---------------------------
      
      My take would be that we might need some clarification in the javadoc for 
      PortletRequest, as follows:
      
      
      Original:
      -------------------------
      getParameterMap
      
      java.util.Map<java.lang.String,java.lang.String[]> getParameterMap()
      
          Returns a Map of the parameters of this request. 
          Request parameters are extra information sent with  the request. 
          The returned parameters are "x-www-form-urlencoded" decoded.
      
          The values in the returned Map are from type String array (String[]).
      
          If no parameters exist this method returns an empty Map.
      
          Returns:
              an immutable Map containing parameter names as keys and parameter 
              values as map values, or an empty Map if no parameters exist. The 
              keys in the parameter map are of type String. The values in the 
              parameter map are of type String array (String[]).
      
      
              
      getPrivateParameterMap
      
      java.util.Map<java.lang.String,java.lang.String[]> getPrivateParameterMap()
      
          Returns a Map of the private parameters of this request. 
          Private parameters are not shared with other portlets or components. 
          The returned parameters are "x-www-form-urlencoded" decoded.
      
          The values in the returned Map are from type String array (String[]).
      
          If no private parameters exist this method returns an empty Map.
      
          Returns:
              an immutable Map containing private parameter names as keys and 
              private parameter values as map values, or an empty Map if no 
              private parameters exist. The keys in the parameter map are of 
              type String. The values in the parameter map are of type String 
              array (String[]).
          Since:
              2.0
      -------------------------
      
      Corrected:
      -------------------------
      getParameterMap
      
      java.util.Map<java.lang.String,java.lang.String[]> getParameterMap()
      
      MSN UPDATE==>    Returns a Map of all public and private parameters of this request. 
          Request parameters are extra information sent with  the request. 
          The returned parameters are "x-www-form-urlencoded" decoded.
      
          The values in the returned Map are from type String array (String[]).
      
          If no parameters exist this method returns an empty Map.
      
          Returns:
              an immutable Map containing parameter names as keys and parameter values 
              as map values, or an empty Map if no parameters exist. The keys in the 
              parameter map are of type String. The values in the parameter map are 
              of type String array (String[]).
      
      
              
      getPrivateParameterMap
      
      java.util.Map<java.lang.String,java.lang.String[]> getPrivateParameterMap()
      
          Returns a Map of the private parameters of this request. 
      MSN UPDATE==>    Private parameters are all those not declared to be public parameters 
      MSN UPDATE==>    in the portlet deployment descriptor. 
          The returned parameters are "x-www-form-urlencoded" decoded.
      
          The values in the returned Map are from type String array (String[]).
      
          If no private parameters exist this method returns an empty Map.
      
          Returns:
              an immutable Map containing private parameter names as keys and 
              private parameter values as map values, or an empty Map if no 
              private parameters exist. The keys in the parameter map are of 
              type String. The values in the parameter map are of type 
              String array (String[]).
          Since:
              2.0
      -------------------------
      

        Activity

        No work has yet been logged on this issue.

          People

          • Assignee:
            msnicklous
            Reporter:
            msnicklous
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: