Re: hook into T4's page creation process

2006-12-27 Thread karthik G
oh sorry. the code snippet is wrong. I was using @Persist("session") and it didn't reflect in the StateObjectManager. But once i switched to @InjectState , everything worked as expected. I think the difference is that @Persist pushes the object to session. But that object is not being managed by h

Re: hook into T4's page creation process

2006-12-27 Thread Raul Raja Martinez
@Persist("client") ? wouldn´t that use cookies? karthik G wrote: thanks Robert! This is what I have in my code - public boolean isSecureAccess(){ StateObjectManager userManager = soReg.get("user"); if(userManager != null){ System.out.println("\n\n\n+++LoginStatusDeterminer --> "

Re: hook into T4's page creation process

2006-12-27 Thread karthik G
Uhhm found the problem - @Persist("session") is not same as @InjectState("user") ? When i switched over to @InjectState("user") it worked as expected. On 12/27/06, karthik G <[EMAIL PROTECTED]> wrote: thanks Robert! This is what I have in my code - public boolean isSecureAccess(){ Stat

Re: hook into T4's page creation process

2006-12-27 Thread karthik G
thanks Robert! This is what I have in my code - public boolean isSecureAccess(){ StateObjectManager userManager = soReg.get("user"); if(userManager != null){ System.out.println("\n\n\n+++LoginStatusDeterminer --> " + userManager.exists()); //this returns

Re: hook into T4's page creation process

2006-12-27 Thread Robert Binna
You could use the StateObjectManagerRegistry inject it into your service and can then call: StateObjectManager manager = (StateObjectManager) registry.get(); on the manager you can obtain your State Object by manager.get() I think this should work Kind regards, Robert karthik

Re: hook into T4's page creation process

2006-12-27 Thread karthik G
WoW!, i downloaded tapestry-acegi code. Used some ideas from there for implementing my stuff..and it works like a charm. But can someone tell me how can I programmatically look up hivemind and query if a bean by the name"user" has been instantiated in the specified scope?

Re: hook into T4's page creation process

2006-12-27 Thread karthik G
Thanks james/ron, I finally gathered some courage to look at the source code :) Ok I just want to check for the presence of the User object in the session in my ClassAnnotationEnhancementWorker. I basically need a InjectStateFlag kind of functionality in my Worker (not the page) where i can check

Re: hook into T4's page creation process

2006-12-23 Thread James Carman
The tapestry-acegi library does exactly this. When it sees an Acegi @Secured annotation on a class/method, it uses a worker to enhance the class. So, you can either use what I've already created or refer to the source to see how to do what you want. If you have any questions about the code, don

Re: hook into T4's page creation process

2006-12-22 Thread RonPiterman
yes, workers are part of 4.0.2 - and the code is very clear, and one can learn alot from it - howard has a *very* nice programming style, so its worth taking a look. I would look at the wiki, but I don't know if there are any tutorials/docu around for this. It is quite advanced staff, but its

Re: hook into T4's page creation process

2006-12-22 Thread karthik G
thanks Ron. Currently am with going the way (subclassing a securedpage) as suggested by Dennis. Its simple and works. But am interested in the workers that you mention. Is looking at the source code the only option at this point to write some workers?. Are there any docs somewhere? Btw are workers

Re: hook into T4's page creation process

2006-12-21 Thread Ron Piterman
yes, there is a configurable annotation workers, so you can create/extend/override page methods when tapestry is preparing the page/component class. You can create your own class worker which will add the needed logic to the mentioned attach event. Take a look at the annotations module code and h

Re: hook into T4's page creation process

2006-12-20 Thread Dennis Sinelnikov
That would be neat. Another option would be to create a parent page and have other pages extend it. For example: public abstract class SecurePage extends BasePage implements SomePageListener { ... } public abstract class MyPage extends SecurePage { .. } Every time MyPage gets rendered, the