Le 11/05/2010 18:48, Steve Eynon a écrit :
Hello,
Following a suggestion from a fellow T5 user (cheers Nicolas!) I've
changed my page name injecting strategy. I now have a
ComponentClassTransformWorker which adds a Mixin to every Page
component. This Page Mixin (in the afterRender() method) then injects
the page name as a comment in the Document model.
I'm glad that my suggestion works ;-)
Btw, i responded by mistake directly to you instead of responding to the
list.
For the record, i was suggestesting to try to apply
http://wiki.apache.org/tapestry/Tapestry5HowToVisualizeComponentHierarchy
to pages instead of components.
if (!transformation.getClassName().contains(".pages."))
// not a page... goodbye!
return;
I may use this one, but changing "contains" by
startWith("full.name.of.package.pages.");
But the tradeoff is that you will not transform pages outside the scope
of your project (such as ExceptionReport)
Any ideas?
Cheers,
Steve.
On 7 May 2010 12:00, Steve Eynon<steve.ey...@googlemail.com> wrote:
Thanks for the help and a quick response! The following gives me what
I need inside a MarkupRendererFilter:
@Inject
private Request request;
@Inject
private ComponentEventLinkEncoder linkEncoder;
@Inject
private ComponentClassResolver classResolver;
String logicalPageName =
linkEncoder.decodePageRenderRequest(request).getLogicalPageName();
String actualPageName = classResolver.canonicalizePageName(logicalPageName);
Cheers,
Steve.
--
Steve Eynon
mobie: (+592) 678 4236
On 7 May 2010 10:25, Thiago H. de Paula Figueiredo<thiag...@gmail.com> wrote:
On Fri, 07 May 2010 11:05:56 -0300, Dmitry Gusev<dmitry.gu...@gmail.com>
wrote:
public void
contributeMarkupRenderer(OrderedConfiguration<MarkupRendererFilter>
configuration,
final MetaDataLocator
metaDataLocator,
final ComponentEventLinkEncoder
linkEncoder,
final RequestGlobals globals)
{
configuration.add(NO_MARKUP_SYMBOL,
new MarkupRendererFilter()
{
@Override
public void renderMarkup(MarkupWriter writer,
MarkupRenderer
renderer) {
PageRenderRequestParameters parameters =
linkEncoder.decodePageRenderRequest(globals.getRequest());
Instead of injecting RequestGlobals, you can inject Request directly.
Not sure if this available in T5.1, but you can try this. I believe
"parameters.getLogicalPageName()" is what you need.
It is.
--
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer, and
instructor
Owner, Ars Machina Tecnologia da Informação Ltda.
http://www.arsmachina.com.br
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org