You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Sebastian Hennebrueder <us...@laliluna.de> on 2009/08/19 20:56:08 UTC

Alias names for components and pages

Hello,

I couldn't find a way to define an alias name for components or pages. 
Is this just not possible?

I frequently have domain Foo, page class Foo. This requires to read the 
package every time. I would like to have a FooPage instead
or MessagesComponent instead of Messages to distinguish the class from 
other Messages classes.

-- 
Best Regards / Viele Grüße

Sebastian Hennebrueder
-----
Software Developer and Trainer for Hibernate / Java Persistence
http://www.laliluna.de




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


Re: Alias names for components and pages (solved thanks)

Posted by Sebastian Hennebrueder <us...@laliluna.de>.
Thiago H. de Paula Figueiredo schrieb:
> Em Wed, 19 Aug 2009 15:56:08 -0300, Sebastian Hennebrueder 
> <us...@laliluna.de> escreveu:
> 
>> Hello,
> 
> Hi!
> 
>> I couldn't find a way to define an alias name for components or pages. 
>> Is this just not possible?
> 
> Tapestry doesn't support this out-of-the-box, but its architecture has 
> some points that can help you:
> 
> 1) Regarding page names, you can use URL rewriting. It can be used to 
> more than just deal with page names: I have a website (to be released 
> soon) that rewrites login.domain.com to domain.com/page/login.
> 2) Regarding component names, you can advise or alias 
> ComponentClassResolver. This is the service that maps page, component 
> and mixin names into their classes.
> 
> I would implement what you want by advising ComponentClassResolver 
> methods and changing their parameters (FooComponent into Foo, etc) 
> before invoking the real implementation..
> 

Thank you

-- 
Best Regards / Viele Grüße

Sebastian Hennebrueder
-----
Software Developer and Trainer for Hibernate / Java Persistence
http://www.laliluna.de



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


Re: Alias names for components and pages

Posted by "Thiago H. de Paula Figueiredo" <th...@gmail.com>.
Em Wed, 19 Aug 2009 15:56:08 -0300, Sebastian Hennebrueder  
<us...@laliluna.de> escreveu:

> Hello,

Hi!

> I couldn't find a way to define an alias name for components or pages.  
> Is this just not possible?

Tapestry doesn't support this out-of-the-box, but its architecture has  
some points that can help you:

1) Regarding page names, you can use URL rewriting. It can be used to more  
than just deal with page names: I have a website (to be released soon)  
that rewrites login.domain.com to domain.com/page/login.
2) Regarding component names, you can advise or alias  
ComponentClassResolver. This is the service that maps page, component and  
mixin names into their classes.

I would implement what you want by advising ComponentClassResolver methods  
and changing their parameters (FooComponent into Foo, etc) before invoking  
the real implementation..

-- 
Thiago H. de Paula Figueiredo
Independent Java consultant, developer, and instructor
http://www.arsmachina.com.br/thiago

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