Hi ! Tapestry 5.2 has a brand new API for class manipulation in worker, you have to provide the method signature and implement the logic in a ComponentMethodAdvice (see PropertyWorker sources to have a simple example)
HTH 2010/9/7 Markus Feindler <markus.feind...@gmx.de> > So, I tried to follow your advice, but I don't see how to add a new method > after calling "transformation.addImplementedInterface(MyInterface.class)". > The documentation states to use transformation.getOrCreateMethod, but where > to define the message body? > > Actually, >> >> I would implement a ClassTransformation and add it to >> contributeComponentClassTransformWorker (see Tapestry Module), This worker >> should add and implement an interface that contains the method to extract >> useful information from the page >> >> Then in your PageResponseRenderer, you can use ComponentSource to get the >> page instance, cast it to your interface and call the method. >> >> 2010/9/6 Markus Feindler<markus.feind...@gmx.de> >> >> Thats the class I discovered earlier at work. >>> >>> Now my question is how to get ClassTransformation and >>> MutableComponentModel >>> from the Page Object in the PageResponseRenderer? >>> >>> Thanks for you help/hints. >>> >>> Regards markus >>> >>> Hi >>> >>>> Logic is enclosed in ActivationRequestParameterWorker, i think you can >>>> adapt >>>> this to your needs and extract values. At the moment, I don't see any >>>> other >>>> way to identify ActivationRequestParameters during link creation. >>>> >>>> 2010/9/6 Markus Feindler<markus.feind...@gmx.de> >>>> >>>> i would say you can get them from >>>> >>>>> Request directly >>>>>> >>>>>> This only works for the current request. I need to get the >>>>>> parameters, >>>>>> >>>>> which will be set for the next request/redirect. It would be possible >>>>> to >>>>> write get methods for the ActivationRequestParameters, but that would >>>>> not >>>>> be >>>>> the right way. I need to find out how that is solved internally. >>>>> >>>>> >>>>> Oh sorry, i had mis-read your first message. I didn't get deep into >>>>> this >>>>> >>>>> new >>>>>> feature at the time, but at first glance, i would say you can get them >>>>>> from >>>>>> Request directly. Maybe, you can implement a worker that will be in >>>>>> charge >>>>>> of implementing an interface that will contain the method that return >>>>>> the >>>>>> values. >>>>>> >>>>>> I will go deeper to see if there is not a more simple way of doing >>>>>> this. >>>>>> >>>>>> 2010/9/6 Markus Feindler<markus.feind...@gmx.de> >>>>>> >>>>>> >>>>>> >>>>>> Thats what Im doing right now for the PageActivationContext, but I >>>>>> also >>>>>> >>>>>>> need the values for the ActivationRequestParameters (introduced in >>>>>>> 5.2: >>>>>>> >>>>>>> >>>>>>> >>>>>>> http://tapestry.apache.org/tapestry5.2-dev/apidocs/org/apache/tapestry5/annotations/ActivationRequestParameter.html >>>>>>> ). >>>>>>> >>>>>>> Hi >>>>>>> >>>>>>> >>>>>>> So why not passivate the page, see PageActivationContextCollector ? >>>>>>> >>>>>>>> This >>>>>>>> is >>>>>>>> how it works to create links. >>>>>>>> >>>>>>>> 2010/9/5 Markus Feindler<markus.feind...@gmx.de> >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> No, Im trying to upgrade "my" portlet implementation from 5.1 to >>>>>>>> 5.2 >>>>>>>> >>>>>>>>> and >>>>>>>>> up to now the activationrequestparameters aren't put in the url, >>>>>>>>> cause >>>>>>>>> I >>>>>>>>> have to adjust my former 5.1 custom response renderer. If the >>>>>>>>> Request >>>>>>>>> is >>>>>>>>> an >>>>>>>>> ActionRequest (see Portlet lifecycle) you can't write output into a >>>>>>>>> stream >>>>>>>>> instead a redirect is done internally in the portlet container. >>>>>>>>> Therefore >>>>>>>>> I >>>>>>>>> have to add the parameters to the ActionReponse >>>>>>>>> (_actionResponse.setRenderParameter). In order to do so I need to >>>>>>>>> get >>>>>>>>> the >>>>>>>>> parameters. >>>>>>>>> >>>>>>>>> That's not enough details. >>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>>> -- Josh >>>>>>>>> >>>>>>>>>> On Sep 5, 2010, at 9:51 AM, Markus Feindler< >>>>>>>>>> markus.feind...@gmx.de> >>>>>>>>>> wrote: >>>>>>>>>> >>>>>>>>>> Need it for portlet implementation. >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> Hi >>>>>>>>>>> >>>>>>>>>>>> What is the purpose ? I guess you are dealing with some kind of >>>>>>>>>>>> dynamic >>>>>>>>>>>> stuff, please can you give more details ? >>>>>>>>>>>> >>>>>>>>>>>> 2010/9/5 Markus Feindler<markus.feind...@gmx.de> >>>>>>>>>>>> >>>>>>>>>>>> Hey folks, >>>>>>>>>>>> >>>>>>>>>>>> >>>>>>>>>>>> >>>>>>>>>>>> >>>>>>>>>>>> I need to access page field values annotated with >>>>>>>>>>>> >>>>>>>>>>>>> ActivationRequestParameters in order to retrieve the values. >>>>>>>>>>>>> Reflection >>>>>>>>>>>>> doesnt work, because the fields are private and a >>>>>>>>>>>>> java.lang.IllegalAccessException is thrown. Whats the right way >>>>>>>>>>>>> to >>>>>>>>>>>>> retrieve >>>>>>>>>>>>> the values / activation request parameters? >>>>>>>>>>>>> >>>>>>>>>>>>> Regards >>>>>>>>>>>>> Markus >>>>>>>>>>>>> >>>>>>>>>>>>> >>>>>>>>>>>>> >>>>>>>>>>>>> >>>>>>>>>>>>> --------------------------------------------------------------------- >>>>>>>>>>>>> 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 >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> --------------------------------------------------------------------- >>>>>>>>>> >>>>>>>>> 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 >>>>> >>>>> >>>>> >>>>> --------------------------------------------------------------------- >>> 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 > > -- Regards, Christophe Cordenier. Committer on Apache Tapestry 5 Co-creator of wooki @wookicentral.com