PageService#getLink() overriding
--------------------------------
Key: TAPESTRY-689
URL: http://issues.apache.org/jira/browse/TAPESTRY-689
Project: Tapestry
Type: Wish
Components: Framework
Versions: 4.0
Reporter: Alexander Kundirenko
getLink method cannot be overidden now because:
1) _linkFactory is private
2) parameters map is local to this method
Could you use TemplateMethod pattern to allow users to add their custom
parameters (or modify existing).
F.e. I want to restrict caching by adding timestamp to path:
public ILink getLink(IRequestCycle cycle, boolean post, Object parameter)
{
Defense.isAssignable(parameter, String.class, "parameter");
Map parameters = new HashMap();
parameters.put(ServiceConstants.SERVICE, getName());
parameters.put(ServiceConstants.PAGE, parameter);
addParameters(parameters); //ADDED METHOD CALL
return _linkFactory.constructLink(cycle, post, parameters, true);
}
//ADDED METHOD
protected void addParameters(Map parameters)
{
parameters.put("nocache", String.valueOf(System.currentTimeMillis()));
}
Thank you
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]