On Jan 31, 2012, at 2:39 AM, Thiago H. de Paula Figueiredo wrote:

> On Tue, 31 Jan 2012 03:50:49 -0200, Jochen Frey <joc...@jochenfrey.com> wrote:
> 
>> Hi!
> 
> Hi!
> 
>> I am looking for a clean way to generically rewrite URLs as follows:
>> 
>> Publicly we want to have an account name to be the first part of the path in 
>> URLs like so:  /SomeAccount/settings/page1.  Since (I believe) that in 
>> Tapestry I can't bind the first part of the path to a variable,  I would 
>> like to rewrite it to something like this: 
>> /settings/page1?account=SomeAccount
> 
> Why not as the first page activation context value?

Activation context sounds fine.  However, I will want to have flexibility to 
add other Activation Contexts values for some of the pages (and not for 
others).  Currently the code in LinkTransformer does something like this (based 
on :

    public PageRenderRequestParameters decodePageRenderRequest(Request request)
    {

        String path = request.getPath();
        // do some path munging here
        String newPath = someMagic(path);
        String pageName = componentClassResolver.canonicalizePageName(newPath);
        
        PageRenderRequestParameters ret = new PageRenderRequestParameters(
                pageName, new EmptyEventContext(), false
        );
        return ret;
    }

Let's say there's a page /SomeAccount/profile/SomeOtherVar, where 
"SomeOtherVar" is supposed to go into the activation context as well ... how 
would I handle that?  Do I have the shot of augmenting the activation context 
somewhere on a per-page basis, or do I need to handle all possible Activate 
Context variations in the LinkTransformer?  In other words, is there some chain 
where more processing of the URL is done?

Thanks so much!
Jochen

---
  joc...@jochenfrey.com
  +1.415.366.0450
  @jochen_frey


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org

Reply via email to