portletspec3
  1. portletspec3
  2. PORTLETSPEC3-7

Errata: Clarify Inconsistency about Removing Shared Render Parameters

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Component/s: None
    • Labels:
      None

      Description

      Referring to Working Document 3, Section "PLT 11.1.2 Public Render Paramaters" states on
      page 77, beginning on line 22 the following:

      "If a portlet wants to delete a public render parameter it needs to use the
      removePublicRenderParameter method on the StateAwareResponse or the
      PortletURL."

      Judging from this section, it would seem like public render parameters can only
      be removed using this method.

      However, in the javadoc for StateAwareResponse.setRenderParameters it is stated:

      -------------------------
      setRenderParameters
      
      void setRenderParameters(java.util.Map<java.lang.String,java.lang.String[]> parameters)
      
          Sets a parameter map for the render request.
      
          All previously set render parameters are cleared.
      
          These parameters will be accessible in all sub-sequent render calls via the PortletRequest.getParameter call 
          until a new request is targeted to the portlet.
      
          The given parameters do not need to be encoded prior to calling this method.
      
          The portlet should not modify the map any further after calling this method.
      
          Parameters:
              parameters - Map containing parameter names for the render phase as keys and parameter values as map values. 
              The keys in the parameter map must be of type String. The values in the parameter map must be of type String array (String[]). 
          Throws:
              java.lang.IllegalArgumentException - if parameters is null, if any of the keys in the Map are null, 
              if any of the keys is not a String, or if any of the values is not a String array. 
              java.lang.IllegalStateException - if the method is invoked after sendRedirect has been called.
      -------------------------
      

      In particular, it states that "All previously set render parameters are cleared." without
      explicitly taking public and private parameters into account.

      What happens when the new map provided to setRenderParameters changes or maybe even does not contain
      a public render parameter that was set on the corresponding request? Should that public render parameter
      be changed or removed?

      Also, can individual entries in the value string[] be null? if so, what would that mean?
      In general, can parameters have a value of null?

      We need to decide how it should behave. My take would be to update the javadoc for
      StateAwareResponse.setParameters as follows:

      Corrected:

      -------------------------
      setRenderParameters
      
      void setRenderParameters(java.util.Map<java.lang.String,java.lang.String[]> parameters)
      
          Sets a parameter map for the render request.
      MSN UPDATE==>    The new paramater map applies to public as well as to private render parameters.
      
          All previously set render parameters are cleared.
      
          These parameters will be accessible in all sub-sequent render calls via the PortletRequest.getParameter call 
          until a new request is targeted to the portlet.
      
          The given parameters do not need to be encoded prior to calling this method.
      
          The portlet should not modify the map any further after calling this method.
      
          Parameters:
              parameters - Map containing parameter names for the render phase as keys and parameter values as map values. 
              The keys in the parameter map must be of type String. The values in the parameter map must be of type String array (String[]). 
          Throws:
              java.lang.IllegalArgumentException - if parameters is null, if any of the keys in the Map are null, 
              if any of the keys is not a String, or if any of the values is not a String array
      MSN UPDATE==>        , or and entries in the values String array are null. 
              java.lang.IllegalStateException - if the method is invoked after sendRedirect has been called.
      -------------------------
      

      And the above-mentioned section in the spec needs to be changed as follows:

      Corrected:
      -------------------------
      If a portlet wants to delete a public render parameter it needs to use the
      removePublicRenderParameter method or the setRenderParameters method on the StateAwareResponse or the
      PortletURL.
      -------------------------

      However, I'm not sure that this meets the original intent and I am not convinced
      these changes alone would make for a consistent description.

      More work needs to be done in this area.

        Activity

        msnicklous created issue -
        msnicklous made changes -
        Field Original Value New Value
        Assignee msnicklous [ msnicklous ]
        msnicklous made changes -
        Description Referring to Working Document 3, Section "PLT 11.1.2 Public Render Paramaters" states on
        page 77, beginning on line 22 the following:

        "If a portlet wants to delete a public render parameter it needs to use the
        removePublicRenderParameter method on the StateAwareResponse or the
        PortletURL."

        Judging from this section, it would seem like public render parameters can only
        be removed using this method.

        However, in the javadoc for StateAwareResponse.setRenderParameters it is stated:

        -------------------------
        setRenderParameters

        void setRenderParameters(java.util.Map<java.lang.String,java.lang.String[]> parameters)

            Sets a parameter map for the render request.

            All previously set render parameters are cleared.

            These parameters will be accessible in all sub-sequent render calls via the PortletRequest.getParameter call
            until a new request is targeted to the portlet.

            The given parameters do not need to be encoded prior to calling this method.

            The portlet should not modify the map any further after calling this method.

            Parameters:
                parameters - Map containing parameter names for the render phase as keys and parameter values as map values.
                The keys in the parameter map must be of type String. The values in the parameter map must be of type String array (String[]).
            Throws:
                java.lang.IllegalArgumentException - if parameters is null, if any of the keys in the Map are null,
                if any of the keys is not a String, or if any of the values is not a String array.
                java.lang.IllegalStateException - if the method is invoked after sendRedirect has been called.
        -------------------------

        In particular, it states that "All previously set render parameters are cleared." without
        explicitly taking public and private parameters into account.

        What happens when the new map provided to setRenderParameters changes or maybe even does not contain
        a public render parameter that was set on the corresponding request? Should that public render parameter
        be changed or removed?

        Also, can individual entries in the value string[] be null? if so, what would that mean?
        In general, can parameters have a value of null?

        We need to decide how it should behave. My take would be to update the javadoc for
        StateAwareResponse.setParameters as follows:

        Corrected:
        -------------------------
        setRenderParameters

        void setRenderParameters(java.util.Map<java.lang.String,java.lang.String[]> parameters)

            Sets a parameter map for the render request.
        MSN UPDATE==> The new paramater map applies to public as well as to private render parameters.

            All previously set render parameters are cleared.

            These parameters will be accessible in all sub-sequent render calls via the PortletRequest.getParameter call
            until a new request is targeted to the portlet.

            The given parameters do not need to be encoded prior to calling this method.

            The portlet should not modify the map any further after calling this method.

            Parameters:
                parameters - Map containing parameter names for the render phase as keys and parameter values as map values.
                The keys in the parameter map must be of type String. The values in the parameter map must be of type String array (String[]).
            Throws:
                java.lang.IllegalArgumentException - if parameters is null, if any of the keys in the Map are null,
                if any of the keys is not a String, or if any of the values is not a String array
        MSN UPDATE==> , or and entries in the values String array are null.
                java.lang.IllegalStateException - if the method is invoked after sendRedirect has been called.
        -------------------------

        And the above-mentioned section in the spec needs to be changed as follows:

        Corrected:
        -------------------------
        If a portlet wants to delete a public render parameter it needs to use the
        removePublicRenderParameter method or the setRenderParameters method on the StateAwareResponse or the
        PortletURL.
        -------------------------

        However, I'm not sure that this meets the original intent and I am not convinced
        these changes alone would make for a consistent description.

        More work needs to be done in this area.
        Referring to Working Document 3, Section "PLT 11.1.2 Public Render Paramaters" states on
        page 77, beginning on line 22 the following:

        "If a portlet wants to delete a public render parameter it needs to use the
        removePublicRenderParameter method on the StateAwareResponse or the
        PortletURL."

        Judging from this section, it would seem like public render parameters can only
        be removed using this method.

        However, in the javadoc for StateAwareResponse.setRenderParameters it is stated:

        {noformat}
        -------------------------
        setRenderParameters

        void setRenderParameters(java.util.Map<java.lang.String,java.lang.String[]> parameters)

            Sets a parameter map for the render request.

            All previously set render parameters are cleared.

            These parameters will be accessible in all sub-sequent render calls via the PortletRequest.getParameter call
            until a new request is targeted to the portlet.

            The given parameters do not need to be encoded prior to calling this method.

            The portlet should not modify the map any further after calling this method.

            Parameters:
                parameters - Map containing parameter names for the render phase as keys and parameter values as map values.
                The keys in the parameter map must be of type String. The values in the parameter map must be of type String array (String[]).
            Throws:
                java.lang.IllegalArgumentException - if parameters is null, if any of the keys in the Map are null,
                if any of the keys is not a String, or if any of the values is not a String array.
                java.lang.IllegalStateException - if the method is invoked after sendRedirect has been called.
        -------------------------
        {noformat}

        In particular, it states that "All previously set render parameters are cleared." without
        explicitly taking public and private parameters into account.

        What happens when the new map provided to setRenderParameters changes or maybe even does not contain
        a public render parameter that was set on the corresponding request? Should that public render parameter
        be changed or removed?

        Also, can individual entries in the value string[] be null? if so, what would that mean?
        In general, can parameters have a value of null?

        We need to decide how it should behave. My take would be to update the javadoc for
        StateAwareResponse.setParameters as follows:

        Corrected:
        {noformat}
        -------------------------
        setRenderParameters

        void setRenderParameters(java.util.Map<java.lang.String,java.lang.String[]> parameters)

            Sets a parameter map for the render request.
        MSN UPDATE==> The new paramater map applies to public as well as to private render parameters.

            All previously set render parameters are cleared.

            These parameters will be accessible in all sub-sequent render calls via the PortletRequest.getParameter call
            until a new request is targeted to the portlet.

            The given parameters do not need to be encoded prior to calling this method.

            The portlet should not modify the map any further after calling this method.

            Parameters:
                parameters - Map containing parameter names for the render phase as keys and parameter values as map values.
                The keys in the parameter map must be of type String. The values in the parameter map must be of type String array (String[]).
            Throws:
                java.lang.IllegalArgumentException - if parameters is null, if any of the keys in the Map are null,
                if any of the keys is not a String, or if any of the values is not a String array
        MSN UPDATE==> , or and entries in the values String array are null.
                java.lang.IllegalStateException - if the method is invoked after sendRedirect has been called.
        -------------------------
        {noformat}

        And the above-mentioned section in the spec needs to be changed as follows:

        Corrected:
        -------------------------
        If a portlet wants to delete a public render parameter it needs to use the
        removePublicRenderParameter method or the setRenderParameters method on the StateAwareResponse or the
        PortletURL.
        -------------------------

        However, I'm not sure that this meets the original intent and I am not convinced
        these changes alone would make for a consistent description.

        More work needs to be done in this area.
        msnicklous made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        msnicklous made changes -
        Status Resolved [ 5 ] Closed [ 6 ]

          People

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

            Dates

            • Created:
              Updated:
              Resolved: