I was a little confused, but I was able to resolve everything without issue.

On Mon, Jan 5, 2015 at 6:27 AM, Thiago H de Paula Figueiredo
<thiag...@gmail.com> wrote:
> On Mon, 29 Dec 2014 12:47:07 -0200, George Christman
> <gchrist...@cardaddy.com> wrote:
>
>> Hi Thiago, The following approach does indeed work, but I'd like to
>> verify it to be the correct approach for handling
>> ComponentEventLinkTransformer.
>
>
> Looks good to me. :)
>
>> SimpleLink is basically the class you
>> wrote, I'm just not sure if I should be using simplelink with
>> transformComponentEventLink.
>
>
> I'm not sure why

I ended up finding an alternative to your simplelink approach that I
seem to like much better. I'd be curious as to your thoughts.

private Link buildLink(String basePath, PageRenderRequestParameters
parameters, String target, String replacement, String concat) {
    Link link = componentEventLinkEncoder.createPageRenderLink(parameters);
    return link.copyWithBasePath(basePath.replace(target, replacement));
}

>
>> Also, is there a more efficient way of doing this?
>
>
> What do you mean by efficient?
>
>> One last thing, I see a Mapper service is being used in the nabble
>> example below. What does that service do?
>
>
> The example below doesn't have any signs of Mapper.

This was the example found of mapper at the bottom of this nabble
link. I'm not sure what mapper is used for.

PageRenderLinkTransformer {
    private List<Mapper> _mappers;
    private ComponentEventLinkEncoder _encoder;

    public StringMapperPageRenderLinkTransformer(List<Mapper> mappers,
ComponentEventLinkEncoder encoder) {
        _mappers = mappers;
        _encoder = encoder;
    }

    public Link transformPageRenderLink(Link defaultLink,
PageRenderRequestParameters parameters) {
        for (Mapper mapper : _mappers) {
            if (defaultLink.getBasePath().contains(mapper.getFrom())) {
                return
defaultLink.copyWithBasePath(defaultLink.getBasePath().replace(mapper.getFrom(),
mapper.getTo()));
            }
        }
        return null;
    }

    public PageRenderRequestParameters decodePageRenderRequest(Request
request) {
        for (Mapper mapper : _mappers) {
            if (request.getPath().contains(mapper.getTo())) {
                final String mapped =
request.getPath().replace(mapper.getTo(), mapper.getFrom());
                return _encoder.decodePageRenderRequest(
                        new DelegatingRequest(request) {
                            @Override
                            public String getPath() {
                                return mapped;
                            }
                        });
            }
        }
        return null;
    }
>
>
> --
> Thiago H. de Paula Figueiredo
> Tapestry, Java and Hibernate consultant and developer
> http://machina.com.br
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>

Thanks Thiago, happy new years.

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

Reply via email to