At first glance (and small try) this look like something I can use. So here
is my idea.

I can use this interface "ComponentEventLinkEncoder" to contribute my own
logic that will strip the prefixed path from the link. However I am not
sure what should I return if dont want any transformation. Should I return
null or should I return the link that I received as parameter?

I see that in your class you have inserted the same interface that you are
overriding is that because that way you will get access to all of the other
enocoder and you can make sure that your implementation is part of the
chain?

When those links are process they will be directed to correct place thanks
to the PageRenderLinkTransformer. This interface has two methods. The first
one decodePageRenderRequest will be used to figure out to which folder
should the request go to. where as the second one transformPageRenderLink
can be used to transform one link to the other. However
this transformation will fail if the link doesnt point to the correct place
so I cant use this for my needs.

My question is in javasoc for the decodePageRenderRequest it says *@return
decoded parameters, or null to proceed normally*. Does this also applies
for transformPageRenderLink since javadocs is not cleared. Should I return
null or *defaultLink *for
*
*
*Link transformPageRenderLink(Link defaultLink, PageRenderRequestParameters
parameters);
*

This will allow me to keep the original urls and to forward the request to
the correct folder. I think :)

Also I am confused why I cant do this in PageRenderLinkTransformer, I got
the impression from documentation that this should be possible but my links
dont look correct :)



On Mon, May 27, 2013 at 8:38 PM, Lance Java <lance.j...@googlemail.com>wrote:

> Not sure if this will help but thought it might be of interest. I've
> written a ComponentEventLinkEncoder which looks for "special" URL prefixes.
> If a "special" folder is found on the URL, it is removed from the URL and
> passed on to the normal tapestry component rendering. The "special" folder
> (which I call a Mode) is pushed onto the Environment where it can be used
> by pages and components. This allows pages and components to render in
> different modes based on the URL prefix.
>
>
> https://github.com/uklance/tapestry-sandbox/blob/master/src/main/java/com/github/uklance/services/AppModule.java#L40
>
> https://github.com/uklance/tapestry-sandbox/blob/master/src/main/java/com/github/uklance/mode/ModeComponentEventLinkEncoder.java
>



-- 
Sincerely
*Boris Horvat*

Reply via email to