[PORTLETSPEC3-30] Add createActionURL & createRenderURL methods that allow for automatically copying parameters Created: 31/Jul/13  Updated: 22/Jan/16  Resolved: 29/Aug/13

Status: Closed
Project: portletspec3
Component/s: Ideas for JSR 362 Extensions
Affects Version/s: None
Fix Version/s: None

Type: New Feature Priority: Major
Reporter: msnicklous Assignee: msnicklous
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 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



 Comments   
Comment by andre.hagemeier [ 31/Jul/13 ]

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

Comment by msnicklous [ 01/Aug/13 ]

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.

Comment by Neil Griffin [ 06/Aug/13 ]

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

Comment by msnicklous [ 29/Aug/13 ]

Resolved by adding the proposed methods. See:

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

No spec update was necessary for this issue.

Comment by msnicklous [ 22/Jan/16 ]

done.

Generated at Fri Sep 30 16:28:08 UTC 2016 using JIRA 6.2.3#6260-sha1:63ef1d6dac3f4f4d7db4c1effd405ba38ccdc558.