portletspec3
  1. portletspec3
  2. PORTLETSPEC3-30

Add createActionURL & createRenderURL methods that allow for automatically copying parameters

    Details

      Description

      There should be two new methods in MimeResponse for creating action URLs and render URLs that conditionally allow for copying the current render parameters when the URL is created. The current createActionURL() and createRenderURL() methods would remain unchanged.

      The proposal would add the following fields and methods to MimeResponse:

      COPY_NO_PARAMETERS
      Specifies that no parameters are to be copied when a URL is created.
      COPY_RENDER_PARAMETERS
      Specifies that the render parameters set for the current request be copied to the URL when it is created.

      PortletURL createActionURL(int copyFlag)

      Creates a portlet URL targeting the portlet. If no portlet mode, window state or security modifier is set in the PortletURL the current values are preserved. If a request is triggered by the PortletURL, it results in an action request.

      The new action URL will contain private render parameters from the current request as specified by the copyFlag parameter.

      The returned URL can be further extended by adding portlet-specific action parameters and portlet modes and window states. Any parameter added to the action URL is automatically an action parameter.

      Public render parameters do not need to be explicitly added to the new action URL. Any public render parameters associated with the portlet will automatically be available during action request processing resulting from activation of the URL.

      If an action parameter has the same name as a public render parameter, then both the action parameter value(s) and the render parameter value(s) will be available when the action request is triggered. The action parameter value(s) will appear before the render parameter value(s) in the parameter values array.

      Parameters:
      copyFlag - Specifies how current parameters are to be copied to the URL
      Returns:
      a portlet action URL
      Since:
      3.0
      See Also:
      COPY_NO_PARAMETERS, COPY_RENDER_PARAMETERS

      PortletURL createRenderURL(int copyFlag)

      Creates a portlet URL targeting the portlet. If no portlet mode, window state or security modifier is set in the PortletURL the current values are preserved. If a request is triggered by the PortletURL, it results in a render request.

      The new render URL will contain private render parameters from the current request as specified by the copyFlag parameter.

      The returned URL can be further extended by adding portlet-specific render parameters and portlet modes and window states. Any parameter added to the render URL is automatically a render parameter.

      Public render parameters do not need to be explicitly added to the new render URL, unless the public render parameter value is to be changed. Any public render parameters associated with the portlet will automatically be available during render request processing resulting from activation of the URL.

      If a public render parameter value is changed on a render URL, then the public render parameter will be set to the new value when the URL is activated.

      Parameters:
      copyFlag - Specifies how current parameters are to be copied to the URL
      Returns:
      a portlet render URL
      Since:
      3.0
      See Also:
      COPY_NO_PARAMETERS, COPY_RENDER_PARAMETERS

        Activity

        Hide
        andre.hagemeier added a comment -

        Very helpful idea. Still, the default must remain COPY_NO_PARAMETERS to verify existing implementations still work

        Show
        andre.hagemeier added a comment - Very helpful idea. Still, the default must remain COPY_NO_PARAMETERS to verify existing implementations still work
        Hide
        msnicklous added a comment -

        The idea is to add two new methods and leave the current ones in place. People using the JSR 286 methods will get the same behavior that they are used to. People using the new JSR 362 methods with the parameter set appropriately will get the new behavior.

        So I think it should be pretty safe - developers will have to make a conscious effort in order to get the new functionality.

        Show
        msnicklous added a comment - The idea is to add two new methods and leave the current ones in place. People using the JSR 286 methods will get the same behavior that they are used to. People using the new JSR 362 methods with the parameter set appropriately will get the new behavior. So I think it should be pretty safe - developers will have to make a conscious effort in order to get the new functionality.
        Hide
        Neil Griffin added a comment -

        +1 from Liferay, but since there are only two possible values for copyFlag, recommend renaming it to copyRenderParameters as a boolean (default false).

        Show
        Neil Griffin added a comment - +1 from Liferay, but since there are only two possible values for copyFlag , recommend renaming it to copyRenderParameters as a boolean (default false).
        Hide
        msnicklous added a comment -

        Resolved by adding the proposed methods. See:

        MimeResponse.createRenderURL(UrlFlag)
        MimeResponse.createActionURL(UrlFlag)

        No spec update was necessary for this issue.

        Show
        msnicklous added a comment - Resolved by adding the proposed methods. See: MimeResponse.createRenderURL(UrlFlag) MimeResponse.createActionURL(UrlFlag) No spec update was necessary for this issue.

          People

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

            Dates

            • Created:
              Updated:
              Resolved: