tapestry-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alexander Kundirenko (JIRA)" <tapestry-...@jakarta.apache.org>
Subject [jira] Created: (TAPESTRY-689) PageService#getLink() overriding
Date Tue, 04 Oct 2005 09:06:47 GMT
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
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);
    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:
For more information on JIRA, see:

To unsubscribe, e-mail: tapestry-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-dev-help@jakarta.apache.org

View raw message