What I do is add the SetupRender phase in my ComponentClassTransformWorker. For 
I don't used T-S-S and don't know its source code at all, I am not sure whether 
it is like my solution.

My complete transform worker is below:

public class SecurityWorker implements ComponentClassTransformWorker{

 private SecurityChecker checker;
 public SecurityWorker(SecurityChecker checker){
  this.checker= checker;
 }

 public void transform(ClassTransformation transformation, 
MutableComponentModel model) {

  Secured annotation = transformation.getAnnotation(Secured.class);
        if (annotation == null)
            return;
        String checker=transformation.addInjectedField(SecurityChecker.class, 
"_$checker", checker);
        String pageSecurity=transformation.addInjectedField(Secured.class, 
"_$page_security", annotation);
        transformation.extendMethod(
                
TransformConstants.SETUP_RENDER_SIGNATURE,String.format("%s.check(%s);",checker,pageSecurity));

       model.addRenderPhase(SetupRender.class); 
 }
}

'model.addRenderPhase(SetupRender.class);' is the one that I added after 
upgrading to 5.1.

Hope it helps.

Thanks,
DH

----- Original Message ----- 
From: "Thiago H. de Paula Figueiredo"
To: "Tapestry users" <users@tapestry.apache.org>
Sent: Thursday, March 26, 2009 9:55 PM
Subject: Re: Tapestry-Spring-Security and Tapestry 5.1.0.x


> On Wed, Mar 25, 2009 at 4:18 AM, DH wrote:
>> Maybe caused by MutableComponentModel#addRenderPhase?
>> I don't use T-S-S, but have another role annotation based solution. I can 
>> work before 5.0.18 too but fail when upgrade to 5.1.0.0.
>> I need call MutableComponentModel#addRenderPhase to make it work at the end 
>> of the security transformerworker.
> 
> Could you give an example? I tried it, adding both @SetupRender and
> @PageAttached, but they didn't work.
> 
> -- 
> Thiago
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
> 
>

Reply via email to