Hi Lance,

I hope you see this as I have a question regarding your code (if anyone
else can answer I will be happy with that as well :))

I have created the implementation of the PageRenderLinkTransformer. This is
a simple implementation that checks for a few condition and then adds the
appropriate prefix to the path and returns PageRenderRequestParameters.
However this prevents the processing of other transformers one of which is
in charge of properly parsing the page and the context of that page (build
in tapestry). So when ever I have something like /mypage/context it fails
to transforms it as it think that the context is the name of the page.

Any suggestion how I can inject the other transformers and process the
request?

I have tried to inject ComponentEventLinkEncoder using a constructor but
this failed with StackOverFlowException. What I think happens is
that ComponentEventLinkEncoder gives the request to my transformer which
then gives it back only to receives it again and so on. So I guess just
passing it to the encoder wont force the process to continue.

Any idea how to overcome this problem?

I have looked into your code and I have seen that you are using
ComponentEventLinkEncoder so I have tried to modify my code to match that.
Sadly this didnt really work. What happend is that none of my requests
where properly processed. When I would go to the page I could see the
folder structure with the .tml pages.

Any ideas?

Cheers and Thanks
Boris


On Tue, May 28, 2013 at 12:44 AM, Boris Horvat <horvat.z.bo...@gmail.com>wrote:

> I guess I am a bit tiered as I just manage to move the code from one
> implementation to the other and it worked. So now PageRenderLinkTransformer
> implementation can handle this transformation.
>
> Thanks for the help everyone
>
>
> On Tue, May 28, 2013 at 12:41 AM, Boris Horvat 
> <horvat.z.bo...@gmail.com>wrote:
>
>> 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*
>>
>
>
>
> --
> Sincerely
> *Boris Horvat*
>



-- 
Sincerely
*Boris Horvat*

Reply via email to