You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Markus Feindler <Ma...@gmx.de> on 2010/09/05 15:24:31 UTC

Retrieve ActivationRequestParameters in custom PageResponseRenderer

  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-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: Retrieve ActivationRequestParameters in custom PageResponseRenderer

Posted by Christophe Cordenier <ch...@gmail.com>.
I don't know if it suits to your case, but you could use
ComponentEventLinkEncoder to decode the request path... This will return you
an object from which you can extract activation context values.

Hope that helps

2010/9/5 Markus Feindler <Ma...@gmx.de>

>  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<Ma...@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-unsubscribe@tapestry.apache.org
>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>
>>>
>>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>


-- 
Regards,
Christophe Cordenier.

Committer on Apache Tapestry 5
Co-creator of wooki @wookicentral.com

Re: Retrieve ActivationRequestParameters in custom PageResponseRenderer

Posted by "Thiago H. de Paula Figueiredo" <th...@gmail.com>.
On Mon, 06 Sep 2010 15:21:37 -0300, Christophe Cordenier  
<ch...@gmail.com> wrote:

> Actually, not exactly, it uses an event handler to read values and add  
> them in the current link.

Thanks for the correction. :)

-- 
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-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: Retrieve ActivationRequestParameters in custom PageResponseRenderer

Posted by Christophe Cordenier <ch...@gmail.com>.
Actually, not exactly, it uses an event handler to read values and add them
in the current link.

2010/9/6 Thiago H. de Paula Figueiredo <th...@gmail.com>

> On Mon, 06 Sep 2010 15:01:09 -0300, Christophe Cordenier <
> christophe.cordenier@gmail.com> wrote:
>
>  Hi
>>
>
> 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.
>>
>
> Why not just @Inject'ing the Request and using the TypeCoercer to do the
> needed conversions? I haven't read the ActivationRequestParameterWorker
> source yet, but I guess that's exactly what it does.
>
> --
> 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-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>


-- 
Regards,
Christophe Cordenier.

Committer on Apache Tapestry 5
Co-creator of wooki @wookicentral.com

Re: Retrieve ActivationRequestParameters in custom PageResponseRenderer

Posted by "Thiago H. de Paula Figueiredo" <th...@gmail.com>.
On Mon, 06 Sep 2010 15:01:09 -0300, Christophe Cordenier  
<ch...@gmail.com> wrote:

> Hi

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.

Why not just @Inject'ing the Request and using the TypeCoercer to do the  
needed conversions? I haven't read the ActivationRequestParameterWorker  
source yet, but I guess that's exactly what it does.

-- 
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-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: Retrieve ActivationRequestParameters in custom PageResponseRenderer

Posted by Markus Feindler <Ma...@gmx.de>.
  Any ideas? Howard?
> No, I get the exception for all pages, also the ExpcetionReportPage for
> example.
>
>>
>> -------- Original-Nachricht --------
>> Datum: Thu, 9 Sep 2010 08:26:05 +0200
>> Von: Christophe Cordenier<ch...@gmail.com>
>> An: Tapestry users<us...@tapestry.apache.org>
>> Betreff: Re: Retrieve ActivationRequestParameters in custom
>> PageResponseRenderer
>>
>>              Weird, does you Index page extends a base class ?
>>
>> 2010/9/8 Markus Feindler<Ma...@gmx.de>
>>
>>>   Sorry to bother you, but Im stuck with a DuplicateMemberException:
>>> Caused by: java.lang.RuntimeException:
>>> javassist.bytecode.DuplicateMemberException: duplicate method:
>>> extractRequestParameters in de.wiv.tapestryportlet2.pages.Index
>>>     at
>>>
>> org.apache.tapestry5.internal.services.InternalClassTransformationImpl.addOverrideOfSuperclassMethod(InternalClassTransformationImpl.java:1458)
>>>     at
>>>
>> org.apache.tapestry5.internal.services.InternalClassTransformationImpl.findOrOverrideMethod(InternalClassTransformationImpl.java:1412)
>>>     at
>>>
>> org.apache.tapestry5.internal.services.InternalClassTransformationImpl.findOverrideOrCreateMethod(InternalClassTransformationImpl.java:1397)
>>>     at
>>>
>> org.apache.tapestry5.internal.services.InternalClassTransformationImpl.getOrCreateMethod(InternalClassTransformationImpl.java:1392)
>>>     at
>>>
>> org.apache.tapestry5.portlet.services.PortletRequestParameterWorker.transform(PortletRequestParameterWorker.java:48)
>>>     at
>>>
>> $ComponentClassTransformWorker_12af2cfc4c4.transform($ComponentClassTransformWorker_12af2cfc4c4.java)
>>>     at
>>>
>> $ComponentClassTransformWorker_12af2cfc4c5.transform($ComponentClassTransformWorker_12af2cfc4c5.java)
>>>     at
>>>
>> $ComponentClassTransformWorker_12af2cfc4b6.transform($ComponentClassTransformWorker_12af2cfc4b6.java)
>>>     at
>>>
>> org.apache.tapestry5.internal.services.ComponentClassTransformerImpl$1.run(ComponentClassTransformerImpl.java:194)
>>>     ... 250 more
>>> Caused by: javassist.bytecode.DuplicateMemberException: duplicate
>> method:
>>> extractRequestParameters in de.wiv.tapestryportlet2.pages.Index
>>>     at
>> javassist.bytecode.ClassFile.testExistingMethod(ClassFile.java:637)
>>>     at javassist.bytecode.ClassFile.addMethod(ClassFile.java:613)
>>>     at javassist.CtClassType.addMethod(CtClassType.java:1320)
>>>     at
>>>
>> org.apache.tapestry5.internal.services.InternalClassTransformationImpl.addOverrideOfSuperclassMethod(InternalClassTransformationImpl.java:1444)
>>>     ... 258 more
>>>
>>> This is my worker:
>>>
>>> public class PortletRequestParameterWorker implements
>>> ComponentClassTransformWorker {
>>>
>>>     private final ValueEncoderSource valueEncoderSource;
>>>     private final ComponentClassCache classCache;
>>>     private final RequestParameterContext requestParameterContext;
>>>     private final ComponentSource componentSource;
>>>
>>>     public PortletRequestParameterWorker(ValueEncoderSource
>>> valueEncoderSource,
>>>             ComponentClassCache classCache, RequestParameterContext
>>> requestParameterContext,
>>>             ComponentSource componentSource) {
>>>         this.valueEncoderSource = valueEncoderSource;
>>>         this.classCache = classCache;
>>>         this.requestParameterContext = requestParameterContext;
>>>         this.componentSource = componentSource;
>>>     }
>>>
>>>     public void transform(final ClassTransformation transformation,
>>>             MutableComponentModel model) {
>>>
>>>
>>>
>> transformation.addImplementedInterface(RequestParameterExtractor.class);
>>>             TransformMethodSignature extractMethod = new
>>> TransformMethodSignature(Modifier.PUBLIC,
>>>                     "Map<String, String>", "extractRequestParameters",
>> null,
>>> null);
>>> //            if (transformation.isDeclaredMethod(extractMethod)) {
>>> //                return;
>>> //            }
>>>
>> transformation.getOrCreateMethod(extractMethod).addAdvice(new
>>> ComponentMethodAdvice(){
>>>
>>>                 public void advise(ComponentMethodInvocation invocation)
>> {
>>>                     Map<String, String>  requestParameters = new
>>> HashMap<String, String>();
>>>                     for (TransformField field :
>>>
>> transformation.matchFieldsWithAnnotation(ActivationRequestParameter.class))
>>> {
>>>                         String parameterName = getParameterName(field,
>>> field.getAnnotation(ActivationRequestParameter.class));
>>>                         Class fieldType =
>>> classCache.forName(field.getType());
>>>                         FieldAccess access = field.getAccess();
>>>                         ValueEncoder encoder =
>>> valueEncoderSource.getValueEncoder(fieldType);
>>>                         Object value =
>>> access.read(invocation.getInstance());
>>>                         if (value == null)
>>>                             continue;
>>>                         String clientValue = encoder.toClient(value);
>>>                         requestParameters.put(parameterName,
>> clientValue);
>>>                     }
>>>                     invocation.overrideResult(requestParameters);
>>>                 }
>>>
>>>             });
>>>     }
>>>
>>>     private String getParameterName(TransformField field,
>>> ActivationRequestParameter annotation)
>>>     {
>>>         if (annotation.value().equals(""))
>>>             return field.getName();
>>>
>>>         return annotation.value();
>>>     }
>>>
>>> }
>>>
>>> Any ideas?
>>>
>>>   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<Ma...@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<Ma...@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<Ma...@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<Ma...@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<Ma...@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.Feindler@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<Ma...@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-unsubscribe@tapestry.apache.org
>>>>>>>>>>>>>>>>> For additional commands, e-mail:
>>>>>>>>>>>>>>>>> users-help@tapestry.apache.org
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>
>> ---------------------------------------------------------------------
>>>>>>>>>>>>>>>>>    To unsubscribe, e-mail:
>>>>>>>>>>>>>>>> users-unsubscribe@tapestry.apache.org
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>   For additional commands, e-mail:
>>>>>>>>>>>>>>> users-help@tapestry.apache.org
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>> ---------------------------------------------------------------------
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>   To unsubscribe, e-mail:
>> users-unsubscribe@tapestry.apache.org
>>>>>>>>>>>>>>>   For additional commands, e-mail:
>>>>>>>>>>>>>> users-help@tapestry.apache.org
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>> ---------------------------------------------------------------------
>>>>>>>>>>>>>>   To unsubscribe, e-mail:
>> users-unsubscribe@tapestry.apache.org
>>>>>>>>>>>>> For additional commands, e-mail:
>> users-help@tapestry.apache.org
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>> ---------------------------------------------------------------------
>>>>>>>>>>>>   To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>>>>>>>>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>> ---------------------------------------------------------------------
>>>>>>>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>>>>>>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>> ---------------------------------------------------------------------
>>>>>>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>>>>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>>>
>>>>>
>>>>>
>>
>> -- 
>> Regards,
>> Christophe Cordenier.
>>
>> Committer on Apache Tapestry 5
>> Co-creator of wooki @wookicentral.com
>>
>


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


Re: Retrieve ActivationRequestParameters in custom PageResponseRenderer

Posted by Josh Canfield <jo...@gmail.com>.
Yes, the problem is that you are advising every advisable
page/component/service in the system. This includes base classes; when
you've already advised the base class then the interface won't be
added and therefore the method won't exist in the transformation.

Try only adding the interface to classes that have fields with the
annotation you are looking for.

Josh

On Tue, Sep 14, 2010 at 12:07 PM, Markus Feindler
<Ma...@gmx.de> wrote:
>  I always get IndexOutofBounds (methods.size == 0), though name is equal (I
> logged that). Is there a bug in the matchMethods Impl?
>>
>> Right... coding in email so I missed the different type signature.
>>
>> Apparently findMethods has been deprecated in favor of
>> List<TransformMethod>  matchMethods(Predicate<TransformMethod>  predicate)
>> Finds all methods matched by the provided predicate.
>>
>> Which returns the TransformMethod which you want to add advice. Your
>> predicate would be by name and hopefully only find one method!
>>
>> So you want something like:
>>
>> List<TransformMethod>  methods = transformation.matchMethods(new
>> Predicate<TransformMethod>()
>>             {
>>                 public boolean accept(TransformMethod object)
>>                 {
>>                     return
>> method.getName().equals("extractRequestParameters");
>>                 }
>>             });
>>
>> if ( methods.size() != 1 ) throw new RuntimeException("Expected 1
>> extractRequestParameters method, found " + methods.size();
>>
>> methods.get(0).addAdvice(...)
>>
>> Again, I'm doing this from email with no compiler/ide so I could be
>> off. There might be a smarter way to do it, but it seems like if you
>> know the method exists you should just find it instead of
>> getOrCreate'ing it.
>>
>>
>> Josh
>>
>> On Tue, Sep 14, 2010 at 11:05 AM, Markus Feindler
>> <Ma...@gmx.de>  wrote:
>>>
>>>  Sounds plausible, but how would a MethodFilter help? It can retrieve the
>>> TransformMethodSignature, but how to use that to create an advise?
>>>>
>>>> Hmm... just took a look at the code again and I think I see the problem.
>>>>
>>>> ///// This creates the method body if your class doesn't already
>>>> implement
>>>> it:
>>>> transformation.addImplementedInterface(RequestParameterExtractor.class);
>>>>
>>>> TransformMethodSignature extractMethod = new
>>>> TransformMethodSignature(Modifier.PUBLIC,
>>>>     "Map<String, String>", "extractRequestParameters", null, null);
>>>>
>>>> /////  This is probably commented out because it always returns.
>>>> // if (transformation.isDeclaredMethod(extractMethod)) {
>>>> //    return;
>>>> // }
>>>>
>>>> ///// This is apparently trying to re-create the method.
>>>> transformation.getOrCreateMethod(extractMethod).addAdvice(new
>>>> ComponentMethodAdvice(){
>>>>
>>>> You should call transformation.findMethods(filter); instead of
>>>> getOrCreateMethod. I'm not sure why the getOrCreate is trying to
>>>> implement the method if it's already there, but I'd guess it has
>>>> something to do with your new TransformMethodSignature.
>>>>
>>>> Josh
>>>>
>>>> On Tue, Sep 14, 2010 at 10:20 AM, Markus Feindler
>>>> <Ma...@gmx.de>    wrote:
>>>>>
>>>>>  @Christoph:
>>>>> Same Error
>>>>>
>>>>> @Josh
>>>>> Yes, I also removed the Generic Map from the Interface.
>>>>>
>>>>> Just checked in debug method: the method indeed already exists
>>>>> (breakpoint:
>>>>> line 1443 InternalClassTransformationImpl). But how come? Its never
>>>>> added
>>>>> through my code.
>>>>>>
>>>>>> Did you take the type parameters off of the interface too (return a
>>>>>> raw map)? Have you looked at with a debugger? Stick a breakpoint right
>>>>>> before the exception and take a look at the methods in the ctclass.
>>>>>>
>>>>>> I can't look at it now but I'll try to reproduce the problem tonight.
>>>>>>
>>>>>> Josh
>>>>>>
>>>>>>
>>>>>> On Tue, Sep 14, 2010 at 9:47 AM, Markus
>>>>>> Feindler<Ma...@gmx.de>
>>>>>>  wrote:
>>>>>>>
>>>>>>>  Just tried, does not work :(.
>>>>>>>>
>>>>>>>> Have you tried without specify Generic types ?
>>>>>>>>
>>>>>>>> 2010/9/13 Christophe Cordenier<ch...@gmail.com>
>>>>>>>>
>>>>>>>>> Oh, this is maybe due to generics...
>>>>>>>>>
>>>>>>>>> 2010/9/13 Markus Feindler<Ma...@gmx.de>
>>>>>>>>>
>>>>>>>>>> public interface RequestParameterExtractor {
>>>>>>>>>>    Map<String, String>        extractRequestParameters();
>>>>>>>>>> }
>>>>>>>>>>
>>>>>>>>>> is not equal to:
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>     TransformMethodSignature extractMethod = new
>>>>>>>>>> TransformMethodSignature(Modifier.PUBLIC,
>>>>>>>>>>            "Map<String, String>", "extractRequestParameters",
>>>>>>>>>> null,
>>>>>>>>>> null);
>>>>>>>>>>
>>>>>>>>>> ?
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>  Everything looks good ... The only thing i see is that the method
>>>>>>>>>>>
>>>>>>>>>>> signature
>>>>>>>>>>> is not exactly the same as the one declared in the interface.
>>>>>>>>>>>
>>>>>>>>>>> 2010/9/13 Markus Feindler<Ma...@gmx.de>
>>>>>>>>>>>
>>>>>>>>>>>   Am 13.09.2010 22:18, schrieb Thiago H. de Paula Figueiredo:
>>>>>>>>>>>>
>>>>>>>>>>>>  On Mon, 13 Sep 2010 17:02:02 -0300, Christophe Cordenier<
>>>>>>>>>>>>
>>>>>>>>>>>>> christophe.cordenier@gmail.com>         wrote:
>>>>>>>>>>>>>
>>>>>>>>>>>>>  Please, Can you provide your Tapestry Module class that
>>>>>>>>>>>>> contributes
>>>>>>>>>>>>> your
>>>>>>>>>>>>>
>>>>>>>>>>>>>> worker ?
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>  And the worker itself? It seems two different worker
>>>>>>>>>>>>>> instances
>>>>>>>>>>>>>> are
>>>>>>>>>>>>>
>>>>>>>>>>>>> trying
>>>>>>>>>>>>> to add the same method to the same page class.
>>>>>>>>>>>>>
>>>>>>>>>>>>>  files attached! appreciate your help.
>>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> ---------------------------------------------------------------------
>>>>>>>>>>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>>>>>>>>>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> ---------------------------------------------------------------------
>>>>>>>>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>>>>>>>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>> --
>>>>>>>>> Regards,
>>>>>>>>> Christophe Cordenier.
>>>>>>>>>
>>>>>>>>> Committer on Apache Tapestry 5
>>>>>>>>> Co-creator of wooki @wookicentral.com
>>>>>>>>>
>>>>>>> ---------------------------------------------------------------------
>>>>>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>>>>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>>>>>
>>>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>>>
>>>>>
>>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>
>>>
>>
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>



-- 
--
http://www.bodylabgym.com - a private, by appointment only, one-on-one
health and fitness facility.
--
http://www.ectransition.com - Quality Electronic Cigarettes at a
reasonable price!
--
TheDailyTube.com. Sign up and get the best new videos on the internet
delivered fresh to your inbox.

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


Re: Retrieve ActivationRequestParameters in custom PageResponseRenderer

Posted by Markus Feindler <Ma...@gmx.de>.
  I always get IndexOutofBounds (methods.size == 0), though name is 
equal (I logged that). Is there a bug in the matchMethods Impl?
> Right... coding in email so I missed the different type signature.
>
> Apparently findMethods has been deprecated in favor of
> List<TransformMethod>  matchMethods(Predicate<TransformMethod>  predicate)
> Finds all methods matched by the provided predicate.
>
> Which returns the TransformMethod which you want to add advice. Your
> predicate would be by name and hopefully only find one method!
>
> So you want something like:
>
> List<TransformMethod>  methods = transformation.matchMethods(new
> Predicate<TransformMethod>()
>              {
>                  public boolean accept(TransformMethod object)
>                  {
>                      return method.getName().equals("extractRequestParameters");
>                  }
>              });
>
> if ( methods.size() != 1 ) throw new RuntimeException("Expected 1
> extractRequestParameters method, found " + methods.size();
>
> methods.get(0).addAdvice(...)
>
> Again, I'm doing this from email with no compiler/ide so I could be
> off. There might be a smarter way to do it, but it seems like if you
> know the method exists you should just find it instead of
> getOrCreate'ing it.
>
>
> Josh
>
> On Tue, Sep 14, 2010 at 11:05 AM, Markus Feindler
> <Ma...@gmx.de>  wrote:
>>   Sounds plausible, but how would a MethodFilter help? It can retrieve the
>> TransformMethodSignature, but how to use that to create an advise?
>>> Hmm... just took a look at the code again and I think I see the problem.
>>>
>>> ///// This creates the method body if your class doesn't already implement
>>> it:
>>> transformation.addImplementedInterface(RequestParameterExtractor.class);
>>>
>>> TransformMethodSignature extractMethod = new
>>> TransformMethodSignature(Modifier.PUBLIC,
>>>      "Map<String, String>", "extractRequestParameters", null, null);
>>>
>>> /////  This is probably commented out because it always returns.
>>> // if (transformation.isDeclaredMethod(extractMethod)) {
>>> //    return;
>>> // }
>>>
>>> ///// This is apparently trying to re-create the method.
>>> transformation.getOrCreateMethod(extractMethod).addAdvice(new
>>> ComponentMethodAdvice(){
>>>
>>> You should call transformation.findMethods(filter); instead of
>>> getOrCreateMethod. I'm not sure why the getOrCreate is trying to
>>> implement the method if it's already there, but I'd guess it has
>>> something to do with your new TransformMethodSignature.
>>>
>>> Josh
>>>
>>> On Tue, Sep 14, 2010 at 10:20 AM, Markus Feindler
>>> <Ma...@gmx.de>    wrote:
>>>>   @Christoph:
>>>> Same Error
>>>>
>>>> @Josh
>>>> Yes, I also removed the Generic Map from the Interface.
>>>>
>>>> Just checked in debug method: the method indeed already exists
>>>> (breakpoint:
>>>> line 1443 InternalClassTransformationImpl). But how come? Its never added
>>>> through my code.
>>>>> Did you take the type parameters off of the interface too (return a
>>>>> raw map)? Have you looked at with a debugger? Stick a breakpoint right
>>>>> before the exception and take a look at the methods in the ctclass.
>>>>>
>>>>> I can't look at it now but I'll try to reproduce the problem tonight.
>>>>>
>>>>> Josh
>>>>>
>>>>>
>>>>> On Tue, Sep 14, 2010 at 9:47 AM, Markus Feindler<Ma...@gmx.de>
>>>>>   wrote:
>>>>>>   Just tried, does not work :(.
>>>>>>> Have you tried without specify Generic types ?
>>>>>>>
>>>>>>> 2010/9/13 Christophe Cordenier<ch...@gmail.com>
>>>>>>>
>>>>>>>> Oh, this is maybe due to generics...
>>>>>>>>
>>>>>>>> 2010/9/13 Markus Feindler<Ma...@gmx.de>
>>>>>>>>
>>>>>>>>> public interface RequestParameterExtractor {
>>>>>>>>>     Map<String, String>        extractRequestParameters();
>>>>>>>>> }
>>>>>>>>>
>>>>>>>>> is not equal to:
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>      TransformMethodSignature extractMethod = new
>>>>>>>>> TransformMethodSignature(Modifier.PUBLIC,
>>>>>>>>>             "Map<String, String>", "extractRequestParameters", null,
>>>>>>>>> null);
>>>>>>>>>
>>>>>>>>> ?
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>   Everything looks good ... The only thing i see is that the method
>>>>>>>>>> signature
>>>>>>>>>> is not exactly the same as the one declared in the interface.
>>>>>>>>>>
>>>>>>>>>> 2010/9/13 Markus Feindler<Ma...@gmx.de>
>>>>>>>>>>
>>>>>>>>>>    Am 13.09.2010 22:18, schrieb Thiago H. de Paula Figueiredo:
>>>>>>>>>>>   On Mon, 13 Sep 2010 17:02:02 -0300, Christophe Cordenier<
>>>>>>>>>>>
>>>>>>>>>>>> christophe.cordenier@gmail.com>         wrote:
>>>>>>>>>>>>
>>>>>>>>>>>>   Please, Can you provide your Tapestry Module class that
>>>>>>>>>>>> contributes
>>>>>>>>>>>> your
>>>>>>>>>>>>
>>>>>>>>>>>>> worker ?
>>>>>>>>>>>>>
>>>>>>>>>>>>>   And the worker itself? It seems two different worker instances
>>>>>>>>>>>>> are
>>>>>>>>>>>> trying
>>>>>>>>>>>> to add the same method to the same page class.
>>>>>>>>>>>>
>>>>>>>>>>>>   files attached! appreciate your help.
>>>>>>>>>>>>
>>>>>>>>>>> ---------------------------------------------------------------------
>>>>>>>>>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>>>>>>>>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>> ---------------------------------------------------------------------
>>>>>>>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>>>>>>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>>>>>>>
>>>>>>>>>
>>>>>>>> --
>>>>>>>> Regards,
>>>>>>>> Christophe Cordenier.
>>>>>>>>
>>>>>>>> Committer on Apache Tapestry 5
>>>>>>>> Co-creator of wooki @wookicentral.com
>>>>>>>>
>>>>>> ---------------------------------------------------------------------
>>>>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>>>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>>>>
>>>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>>
>>>>
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: users-help@tapestry.apache.org
>>
>>
>
>


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


Re: Retrieve ActivationRequestParameters in custom PageResponseRenderer

Posted by Josh Canfield <jo...@gmail.com>.
Right... coding in email so I missed the different type signature.

Apparently findMethods has been deprecated in favor of
List<TransformMethod> matchMethods(Predicate<TransformMethod> predicate)
Finds all methods matched by the provided predicate.

Which returns the TransformMethod which you want to add advice. Your
predicate would be by name and hopefully only find one method!

So you want something like:

List<TransformMethod> methods = transformation.matchMethods(new
Predicate<TransformMethod>()
            {
                public boolean accept(TransformMethod object)
                {
                    return method.getName().equals("extractRequestParameters");
                }
            });

if ( methods.size() != 1 ) throw new RuntimeException("Expected 1
extractRequestParameters method, found " + methods.size();

methods.get(0).addAdvice(...)

Again, I'm doing this from email with no compiler/ide so I could be
off. There might be a smarter way to do it, but it seems like if you
know the method exists you should just find it instead of
getOrCreate'ing it.


Josh

On Tue, Sep 14, 2010 at 11:05 AM, Markus Feindler
<Ma...@gmx.de> wrote:
>  Sounds plausible, but how would a MethodFilter help? It can retrieve the
> TransformMethodSignature, but how to use that to create an advise?
>>
>> Hmm... just took a look at the code again and I think I see the problem.
>>
>> ///// This creates the method body if your class doesn't already implement
>> it:
>> transformation.addImplementedInterface(RequestParameterExtractor.class);
>>
>> TransformMethodSignature extractMethod = new
>> TransformMethodSignature(Modifier.PUBLIC,
>>     "Map<String, String>", "extractRequestParameters", null, null);
>>
>> /////  This is probably commented out because it always returns.
>> // if (transformation.isDeclaredMethod(extractMethod)) {
>> //    return;
>> // }
>>
>> ///// This is apparently trying to re-create the method.
>> transformation.getOrCreateMethod(extractMethod).addAdvice(new
>> ComponentMethodAdvice(){
>>
>> You should call transformation.findMethods(filter); instead of
>> getOrCreateMethod. I'm not sure why the getOrCreate is trying to
>> implement the method if it's already there, but I'd guess it has
>> something to do with your new TransformMethodSignature.
>>
>> Josh
>>
>> On Tue, Sep 14, 2010 at 10:20 AM, Markus Feindler
>> <Ma...@gmx.de>  wrote:
>>>
>>>  @Christoph:
>>> Same Error
>>>
>>> @Josh
>>> Yes, I also removed the Generic Map from the Interface.
>>>
>>> Just checked in debug method: the method indeed already exists
>>> (breakpoint:
>>> line 1443 InternalClassTransformationImpl). But how come? Its never added
>>> through my code.
>>>>
>>>> Did you take the type parameters off of the interface too (return a
>>>> raw map)? Have you looked at with a debugger? Stick a breakpoint right
>>>> before the exception and take a look at the methods in the ctclass.
>>>>
>>>> I can't look at it now but I'll try to reproduce the problem tonight.
>>>>
>>>> Josh
>>>>
>>>>
>>>> On Tue, Sep 14, 2010 at 9:47 AM, Markus Feindler<Ma...@gmx.de>
>>>>  wrote:
>>>>>
>>>>>  Just tried, does not work :(.
>>>>>>
>>>>>> Have you tried without specify Generic types ?
>>>>>>
>>>>>> 2010/9/13 Christophe Cordenier<ch...@gmail.com>
>>>>>>
>>>>>>> Oh, this is maybe due to generics...
>>>>>>>
>>>>>>> 2010/9/13 Markus Feindler<Ma...@gmx.de>
>>>>>>>
>>>>>>>> public interface RequestParameterExtractor {
>>>>>>>>    Map<String, String>      extractRequestParameters();
>>>>>>>> }
>>>>>>>>
>>>>>>>> is not equal to:
>>>>>>>>
>>>>>>>>
>>>>>>>>     TransformMethodSignature extractMethod = new
>>>>>>>> TransformMethodSignature(Modifier.PUBLIC,
>>>>>>>>            "Map<String, String>", "extractRequestParameters", null,
>>>>>>>> null);
>>>>>>>>
>>>>>>>> ?
>>>>>>>>
>>>>>>>>
>>>>>>>>  Everything looks good ... The only thing i see is that the method
>>>>>>>>>
>>>>>>>>> signature
>>>>>>>>> is not exactly the same as the one declared in the interface.
>>>>>>>>>
>>>>>>>>> 2010/9/13 Markus Feindler<Ma...@gmx.de>
>>>>>>>>>
>>>>>>>>>   Am 13.09.2010 22:18, schrieb Thiago H. de Paula Figueiredo:
>>>>>>>>>>
>>>>>>>>>>  On Mon, 13 Sep 2010 17:02:02 -0300, Christophe Cordenier<
>>>>>>>>>>
>>>>>>>>>>> christophe.cordenier@gmail.com>       wrote:
>>>>>>>>>>>
>>>>>>>>>>>  Please, Can you provide your Tapestry Module class that
>>>>>>>>>>> contributes
>>>>>>>>>>> your
>>>>>>>>>>>
>>>>>>>>>>>> worker ?
>>>>>>>>>>>>
>>>>>>>>>>>>  And the worker itself? It seems two different worker instances
>>>>>>>>>>>> are
>>>>>>>>>>>
>>>>>>>>>>> trying
>>>>>>>>>>> to add the same method to the same page class.
>>>>>>>>>>>
>>>>>>>>>>>  files attached! appreciate your help.
>>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> ---------------------------------------------------------------------
>>>>>>>>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>>>>>>>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>
>>>>>>>> ---------------------------------------------------------------------
>>>>>>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>>>>>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>>>>>>
>>>>>>>>
>>>>>>> --
>>>>>>> Regards,
>>>>>>> Christophe Cordenier.
>>>>>>>
>>>>>>> Committer on Apache Tapestry 5
>>>>>>> Co-creator of wooki @wookicentral.com
>>>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>>>
>>>>>
>>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>
>>>
>>
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>



-- 
--
http://www.bodylabgym.com - a private, by appointment only, one-on-one
health and fitness facility.
--
http://www.ectransition.com - Quality Electronic Cigarettes at a
reasonable price!
--
TheDailyTube.com. Sign up and get the best new videos on the internet
delivered fresh to your inbox.

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


Re: Retrieve ActivationRequestParameters in custom PageResponseRenderer

Posted by Markus Feindler <Ma...@gmx.de>.
  Sounds plausible, but how would a MethodFilter help? It can retrieve 
the TransformMethodSignature, but how to use that to create an advise?
> Hmm... just took a look at the code again and I think I see the problem.
>
> ///// This creates the method body if your class doesn't already implement it:
> transformation.addImplementedInterface(RequestParameterExtractor.class);
>
> TransformMethodSignature extractMethod = new
> TransformMethodSignature(Modifier.PUBLIC,
>      "Map<String, String>", "extractRequestParameters", null, null);
>
> /////  This is probably commented out because it always returns.
> // if (transformation.isDeclaredMethod(extractMethod)) {
> //    return;
> // }
>
> ///// This is apparently trying to re-create the method.
> transformation.getOrCreateMethod(extractMethod).addAdvice(new
> ComponentMethodAdvice(){
>
> You should call transformation.findMethods(filter); instead of
> getOrCreateMethod. I'm not sure why the getOrCreate is trying to
> implement the method if it's already there, but I'd guess it has
> something to do with your new TransformMethodSignature.
>
> Josh
>
> On Tue, Sep 14, 2010 at 10:20 AM, Markus Feindler
> <Ma...@gmx.de>  wrote:
>>   @Christoph:
>> Same Error
>>
>> @Josh
>> Yes, I also removed the Generic Map from the Interface.
>>
>> Just checked in debug method: the method indeed already exists (breakpoint:
>> line 1443 InternalClassTransformationImpl). But how come? Its never added
>> through my code.
>>> Did you take the type parameters off of the interface too (return a
>>> raw map)? Have you looked at with a debugger? Stick a breakpoint right
>>> before the exception and take a look at the methods in the ctclass.
>>>
>>> I can't look at it now but I'll try to reproduce the problem tonight.
>>>
>>> Josh
>>>
>>>
>>> On Tue, Sep 14, 2010 at 9:47 AM, Markus Feindler<Ma...@gmx.de>
>>>   wrote:
>>>>   Just tried, does not work :(.
>>>>> Have you tried without specify Generic types ?
>>>>>
>>>>> 2010/9/13 Christophe Cordenier<ch...@gmail.com>
>>>>>
>>>>>> Oh, this is maybe due to generics...
>>>>>>
>>>>>> 2010/9/13 Markus Feindler<Ma...@gmx.de>
>>>>>>
>>>>>>> public interface RequestParameterExtractor {
>>>>>>>     Map<String, String>      extractRequestParameters();
>>>>>>> }
>>>>>>>
>>>>>>> is not equal to:
>>>>>>>
>>>>>>>
>>>>>>>      TransformMethodSignature extractMethod = new
>>>>>>> TransformMethodSignature(Modifier.PUBLIC,
>>>>>>>             "Map<String, String>", "extractRequestParameters", null,
>>>>>>> null);
>>>>>>>
>>>>>>> ?
>>>>>>>
>>>>>>>
>>>>>>>   Everything looks good ... The only thing i see is that the method
>>>>>>>> signature
>>>>>>>> is not exactly the same as the one declared in the interface.
>>>>>>>>
>>>>>>>> 2010/9/13 Markus Feindler<Ma...@gmx.de>
>>>>>>>>
>>>>>>>>    Am 13.09.2010 22:18, schrieb Thiago H. de Paula Figueiredo:
>>>>>>>>>   On Mon, 13 Sep 2010 17:02:02 -0300, Christophe Cordenier<
>>>>>>>>>
>>>>>>>>>> christophe.cordenier@gmail.com>       wrote:
>>>>>>>>>>
>>>>>>>>>>   Please, Can you provide your Tapestry Module class that
>>>>>>>>>> contributes
>>>>>>>>>> your
>>>>>>>>>>
>>>>>>>>>>> worker ?
>>>>>>>>>>>
>>>>>>>>>>>   And the worker itself? It seems two different worker instances
>>>>>>>>>>> are
>>>>>>>>>> trying
>>>>>>>>>> to add the same method to the same page class.
>>>>>>>>>>
>>>>>>>>>>   files attached! appreciate your help.
>>>>>>>>>>
>>>>>>>>> ---------------------------------------------------------------------
>>>>>>>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>>>>>>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>>>>>>>
>>>>>>>>>
>>>>>>> ---------------------------------------------------------------------
>>>>>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>>>>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>>>>>
>>>>>>>
>>>>>> --
>>>>>> Regards,
>>>>>> Christophe Cordenier.
>>>>>>
>>>>>> Committer on Apache Tapestry 5
>>>>>> Co-creator of wooki @wookicentral.com
>>>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>>
>>>>
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: users-help@tapestry.apache.org
>>
>>
>
>


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


Re: Retrieve ActivationRequestParameters in custom PageResponseRenderer

Posted by Josh Canfield <jo...@gmail.com>.
Hmm... just took a look at the code again and I think I see the problem.

///// This creates the method body if your class doesn't already implement it:
transformation.addImplementedInterface(RequestParameterExtractor.class);

TransformMethodSignature extractMethod = new
TransformMethodSignature(Modifier.PUBLIC,
    "Map<String, String>", "extractRequestParameters", null, null);

/////  This is probably commented out because it always returns.
// if (transformation.isDeclaredMethod(extractMethod)) {
//    return;
// }

///// This is apparently trying to re-create the method.
transformation.getOrCreateMethod(extractMethod).addAdvice(new
ComponentMethodAdvice(){

You should call transformation.findMethods(filter); instead of
getOrCreateMethod. I'm not sure why the getOrCreate is trying to
implement the method if it's already there, but I'd guess it has
something to do with your new TransformMethodSignature.

Josh

On Tue, Sep 14, 2010 at 10:20 AM, Markus Feindler
<Ma...@gmx.de> wrote:
>  @Christoph:
> Same Error
>
> @Josh
> Yes, I also removed the Generic Map from the Interface.
>
> Just checked in debug method: the method indeed already exists (breakpoint:
> line 1443 InternalClassTransformationImpl). But how come? Its never added
> through my code.
>>
>> Did you take the type parameters off of the interface too (return a
>> raw map)? Have you looked at with a debugger? Stick a breakpoint right
>> before the exception and take a look at the methods in the ctclass.
>>
>> I can't look at it now but I'll try to reproduce the problem tonight.
>>
>> Josh
>>
>>
>> On Tue, Sep 14, 2010 at 9:47 AM, Markus Feindler<Ma...@gmx.de>
>>  wrote:
>>>
>>>  Just tried, does not work :(.
>>>>
>>>> Have you tried without specify Generic types ?
>>>>
>>>> 2010/9/13 Christophe Cordenier<ch...@gmail.com>
>>>>
>>>>> Oh, this is maybe due to generics...
>>>>>
>>>>> 2010/9/13 Markus Feindler<Ma...@gmx.de>
>>>>>
>>>>>> public interface RequestParameterExtractor {
>>>>>>    Map<String, String>    extractRequestParameters();
>>>>>> }
>>>>>>
>>>>>> is not equal to:
>>>>>>
>>>>>>
>>>>>>     TransformMethodSignature extractMethod = new
>>>>>> TransformMethodSignature(Modifier.PUBLIC,
>>>>>>            "Map<String, String>", "extractRequestParameters", null,
>>>>>> null);
>>>>>>
>>>>>> ?
>>>>>>
>>>>>>
>>>>>>  Everything looks good ... The only thing i see is that the method
>>>>>>>
>>>>>>> signature
>>>>>>> is not exactly the same as the one declared in the interface.
>>>>>>>
>>>>>>> 2010/9/13 Markus Feindler<Ma...@gmx.de>
>>>>>>>
>>>>>>>   Am 13.09.2010 22:18, schrieb Thiago H. de Paula Figueiredo:
>>>>>>>>
>>>>>>>>  On Mon, 13 Sep 2010 17:02:02 -0300, Christophe Cordenier<
>>>>>>>>
>>>>>>>>> christophe.cordenier@gmail.com>     wrote:
>>>>>>>>>
>>>>>>>>>  Please, Can you provide your Tapestry Module class that
>>>>>>>>> contributes
>>>>>>>>> your
>>>>>>>>>
>>>>>>>>>> worker ?
>>>>>>>>>>
>>>>>>>>>>  And the worker itself? It seems two different worker instances
>>>>>>>>>> are
>>>>>>>>>
>>>>>>>>> trying
>>>>>>>>> to add the same method to the same page class.
>>>>>>>>>
>>>>>>>>>  files attached! appreciate your help.
>>>>>>>>>
>>>>>>>>
>>>>>>>> ---------------------------------------------------------------------
>>>>>>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>>>>>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>>>>>>
>>>>>>>>
>>>>>> ---------------------------------------------------------------------
>>>>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>>>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>>>>
>>>>>>
>>>>> --
>>>>> Regards,
>>>>> Christophe Cordenier.
>>>>>
>>>>> Committer on Apache Tapestry 5
>>>>> Co-creator of wooki @wookicentral.com
>>>>>
>>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>
>>>
>>
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>



-- 
--
http://www.bodylabgym.com - a private, by appointment only, one-on-one
health and fitness facility.
--
http://www.ectransition.com - Quality Electronic Cigarettes at a
reasonable price!
--
TheDailyTube.com. Sign up and get the best new videos on the internet
delivered fresh to your inbox.

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


Re: Retrieve ActivationRequestParameters in custom PageResponseRenderer

Posted by Markus Feindler <Ma...@gmx.de>.
  @Christoph:
Same Error

@Josh
Yes, I also removed the Generic Map from the Interface.

Just checked in debug method: the method indeed already exists 
(breakpoint: line 1443 InternalClassTransformationImpl). But how come? 
Its never added through my code.
> Did you take the type parameters off of the interface too (return a
> raw map)? Have you looked at with a debugger? Stick a breakpoint right
> before the exception and take a look at the methods in the ctclass.
>
> I can't look at it now but I'll try to reproduce the problem tonight.
>
> Josh
>
>
> On Tue, Sep 14, 2010 at 9:47 AM, Markus Feindler<Ma...@gmx.de>  wrote:
>>   Just tried, does not work :(.
>>> Have you tried without specify Generic types ?
>>>
>>> 2010/9/13 Christophe Cordenier<ch...@gmail.com>
>>>
>>>> Oh, this is maybe due to generics...
>>>>
>>>> 2010/9/13 Markus Feindler<Ma...@gmx.de>
>>>>
>>>>> public interface RequestParameterExtractor {
>>>>>     Map<String, String>    extractRequestParameters();
>>>>> }
>>>>>
>>>>> is not equal to:
>>>>>
>>>>>
>>>>>      TransformMethodSignature extractMethod = new
>>>>> TransformMethodSignature(Modifier.PUBLIC,
>>>>>             "Map<String, String>", "extractRequestParameters", null,
>>>>> null);
>>>>>
>>>>> ?
>>>>>
>>>>>
>>>>>   Everything looks good ... The only thing i see is that the method
>>>>>> signature
>>>>>> is not exactly the same as the one declared in the interface.
>>>>>>
>>>>>> 2010/9/13 Markus Feindler<Ma...@gmx.de>
>>>>>>
>>>>>>    Am 13.09.2010 22:18, schrieb Thiago H. de Paula Figueiredo:
>>>>>>>   On Mon, 13 Sep 2010 17:02:02 -0300, Christophe Cordenier<
>>>>>>>
>>>>>>>> christophe.cordenier@gmail.com>     wrote:
>>>>>>>>
>>>>>>>>   Please, Can you provide your Tapestry Module class that contributes
>>>>>>>> your
>>>>>>>>
>>>>>>>>> worker ?
>>>>>>>>>
>>>>>>>>>   And the worker itself? It seems two different worker instances are
>>>>>>>> trying
>>>>>>>> to add the same method to the same page class.
>>>>>>>>
>>>>>>>>   files attached! appreciate your help.
>>>>>>>>
>>>>>>> ---------------------------------------------------------------------
>>>>>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>>>>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>>>>>
>>>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>>>
>>>>>
>>>> --
>>>> Regards,
>>>> Christophe Cordenier.
>>>>
>>>> Committer on Apache Tapestry 5
>>>> Co-creator of wooki @wookicentral.com
>>>>
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: users-help@tapestry.apache.org
>>
>>
>
>


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


Re: Retrieve ActivationRequestParameters in custom PageResponseRenderer

Posted by Josh Canfield <jo...@gmail.com>.
Did you take the type parameters off of the interface too (return a
raw map)? Have you looked at with a debugger? Stick a breakpoint right
before the exception and take a look at the methods in the ctclass.

I can't look at it now but I'll try to reproduce the problem tonight.

Josh


On Tue, Sep 14, 2010 at 9:47 AM, Markus Feindler <Ma...@gmx.de> wrote:
>  Just tried, does not work :(.
>>
>> Have you tried without specify Generic types ?
>>
>> 2010/9/13 Christophe Cordenier<ch...@gmail.com>
>>
>>> Oh, this is maybe due to generics...
>>>
>>> 2010/9/13 Markus Feindler<Ma...@gmx.de>
>>>
>>>>
>>>> public interface RequestParameterExtractor {
>>>>    Map<String, String>  extractRequestParameters();
>>>> }
>>>>
>>>> is not equal to:
>>>>
>>>>
>>>>     TransformMethodSignature extractMethod = new
>>>> TransformMethodSignature(Modifier.PUBLIC,
>>>>            "Map<String, String>", "extractRequestParameters", null,
>>>> null);
>>>>
>>>> ?
>>>>
>>>>
>>>>  Everything looks good ... The only thing i see is that the method
>>>>>
>>>>> signature
>>>>> is not exactly the same as the one declared in the interface.
>>>>>
>>>>> 2010/9/13 Markus Feindler<Ma...@gmx.de>
>>>>>
>>>>>   Am 13.09.2010 22:18, schrieb Thiago H. de Paula Figueiredo:
>>>>>>
>>>>>>  On Mon, 13 Sep 2010 17:02:02 -0300, Christophe Cordenier<
>>>>>>
>>>>>>> christophe.cordenier@gmail.com>   wrote:
>>>>>>>
>>>>>>>  Please, Can you provide your Tapestry Module class that contributes
>>>>>>> your
>>>>>>>
>>>>>>>> worker ?
>>>>>>>>
>>>>>>>>  And the worker itself? It seems two different worker instances are
>>>>>>>
>>>>>>> trying
>>>>>>> to add the same method to the same page class.
>>>>>>>
>>>>>>>  files attached! appreciate your help.
>>>>>>>
>>>>>> ---------------------------------------------------------------------
>>>>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>>>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>>>>
>>>>>>
>>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>>
>>>>
>>>
>>> --
>>> Regards,
>>> Christophe Cordenier.
>>>
>>> Committer on Apache Tapestry 5
>>> Co-creator of wooki @wookicentral.com
>>>
>>
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>



-- 
--
http://www.bodylabgym.com - a private, by appointment only, one-on-one
health and fitness facility.
--
http://www.ectransition.com - Quality Electronic Cigarettes at a
reasonable price!
--
TheDailyTube.com. Sign up and get the best new videos on the internet
delivered fresh to your inbox.

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


Re: Retrieve ActivationRequestParameters in custom PageResponseRenderer

Posted by Christophe Cordenier <ch...@gmail.com>.
Same error ?

2010/9/14 Markus Feindler <Ma...@gmx.de>

>  Just tried, does not work :(.
>
>  Have you tried without specify Generic types ?
>>
>> 2010/9/13 Christophe Cordenier<ch...@gmail.com>
>>
>>  Oh, this is maybe due to generics...
>>>
>>> 2010/9/13 Markus Feindler<Ma...@gmx.de>
>>>
>>>
>>>> public interface RequestParameterExtractor {
>>>>    Map<String, String>  extractRequestParameters();
>>>> }
>>>>
>>>> is not equal to:
>>>>
>>>>
>>>>     TransformMethodSignature extractMethod = new
>>>> TransformMethodSignature(Modifier.PUBLIC,
>>>>            "Map<String, String>", "extractRequestParameters", null,
>>>> null);
>>>>
>>>> ?
>>>>
>>>>
>>>>  Everything looks good ... The only thing i see is that the method
>>>>
>>>>> signature
>>>>> is not exactly the same as the one declared in the interface.
>>>>>
>>>>> 2010/9/13 Markus Feindler<Ma...@gmx.de>
>>>>>
>>>>>   Am 13.09.2010 22:18, schrieb Thiago H. de Paula Figueiredo:
>>>>>
>>>>>>  On Mon, 13 Sep 2010 17:02:02 -0300, Christophe Cordenier<
>>>>>>
>>>>>>  christophe.cordenier@gmail.com>   wrote:
>>>>>>>
>>>>>>>  Please, Can you provide your Tapestry Module class that contributes
>>>>>>> your
>>>>>>>
>>>>>>>  worker ?
>>>>>>>>
>>>>>>>>  And the worker itself? It seems two different worker instances are
>>>>>>>>
>>>>>>> trying
>>>>>>> to add the same method to the same page class.
>>>>>>>
>>>>>>>  files attached! appreciate your help.
>>>>>>>
>>>>>>> ---------------------------------------------------------------------
>>>>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>>>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>>>>
>>>>>>
>>>>>>
>>>>>  ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>>
>>>>
>>>>
>>> --
>>> Regards,
>>> Christophe Cordenier.
>>>
>>> Committer on Apache Tapestry 5
>>> Co-creator of wooki @wookicentral.com
>>>
>>>
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>


-- 
Regards,
Christophe Cordenier.

Committer on Apache Tapestry 5
Co-creator of wooki @wookicentral.com

Re: Retrieve ActivationRequestParameters in custom PageResponseRenderer

Posted by Markus Feindler <Ma...@gmx.de>.
  Just tried, does not work :(.
> Have you tried without specify Generic types ?
>
> 2010/9/13 Christophe Cordenier<ch...@gmail.com>
>
>> Oh, this is maybe due to generics...
>>
>> 2010/9/13 Markus Feindler<Ma...@gmx.de>
>>
>>>
>>> public interface RequestParameterExtractor {
>>>     Map<String, String>  extractRequestParameters();
>>> }
>>>
>>> is not equal to:
>>>
>>>
>>>      TransformMethodSignature extractMethod = new
>>> TransformMethodSignature(Modifier.PUBLIC,
>>>             "Map<String, String>", "extractRequestParameters", null, null);
>>>
>>> ?
>>>
>>>
>>>   Everything looks good ... The only thing i see is that the method
>>>> signature
>>>> is not exactly the same as the one declared in the interface.
>>>>
>>>> 2010/9/13 Markus Feindler<Ma...@gmx.de>
>>>>
>>>>    Am 13.09.2010 22:18, schrieb Thiago H. de Paula Figueiredo:
>>>>>   On Mon, 13 Sep 2010 17:02:02 -0300, Christophe Cordenier<
>>>>>
>>>>>> christophe.cordenier@gmail.com>   wrote:
>>>>>>
>>>>>>   Please, Can you provide your Tapestry Module class that contributes
>>>>>> your
>>>>>>
>>>>>>> worker ?
>>>>>>>
>>>>>>>   And the worker itself? It seems two different worker instances are
>>>>>> trying
>>>>>> to add the same method to the same page class.
>>>>>>
>>>>>>   files attached! appreciate your help.
>>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>>>
>>>>>
>>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>
>>>
>>
>> --
>> Regards,
>> Christophe Cordenier.
>>
>> Committer on Apache Tapestry 5
>> Co-creator of wooki @wookicentral.com
>>
>
>


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


Re: Retrieve ActivationRequestParameters in custom PageResponseRenderer

Posted by Markus Feindler <Ma...@gmx.de>.
Will try that later and inform you.

>             
> -------- Original-Nachricht --------
> Datum: Tue, 14 Sep 2010 08:17:57 +0200
> Von: Christophe Cordenier <ch...@gmail.com>
> An: Tapestry users <us...@tapestry.apache.org>
> Betreff: Re: Retrieve ActivationRequestParameters in custom 
> PageResponseRenderer
> 
>             Have you tried without specify Generic types ?
> 
> 2010/9/13 Christophe Cordenier <ch...@gmail.com>
> 
> > Oh, this is maybe due to generics...
> >
> > 2010/9/13 Markus Feindler <Ma...@gmx.de>
> >
> >>
> >>
> >> public interface RequestParameterExtractor {
> >>    Map<String, String> extractRequestParameters();
> >> }
> >>
> >> is not equal to:
> >>
> >>
> >>     TransformMethodSignature extractMethod = new
> >> TransformMethodSignature(Modifier.PUBLIC,
> >>            "Map<String, String>", "extractRequestParameters", null, 
> null);
> >>
> >> ?
> >>
> >>
> >>  Everything looks good ... The only thing i see is that the method
> >>> signature
> >>> is not exactly the same as the one declared in the interface.
> >>>
> >>> 2010/9/13 Markus Feindler<Ma...@gmx.de>
> >>>
> >>>   Am 13.09.2010 22:18, schrieb Thiago H. de Paula Figueiredo:
> >>>>
> >>>>  On Mon, 13 Sep 2010 17:02:02 -0300, Christophe Cordenier<
> >>>>
> >>>>> christophe.cordenier@gmail.com>  wrote:
> >>>>>
> >>>>>  Please, Can you provide your Tapestry Module class that 
> contributes
> >>>>> your
> >>>>>
> >>>>>> worker ?
> >>>>>>
> >>>>>>  And the worker itself? It seems two different worker instances 
> are
> >>>>> trying
> >>>>> to add the same method to the same page class.
> >>>>>
> >>>>>  files attached! appreciate your help.
> >>>>>
> >>>>
> >>>> 
> ---------------------------------------------------------------------
> >>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> >>>> For additional commands, e-mail: users-help@tapestry.apache.org
> >>>>
> >>>>
> >>>
> >>>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> >> For additional commands, e-mail: users-help@tapestry.apache.org
> >>
> >>
> >
> >
> > --
> > Regards,
> > Christophe Cordenier.
> >
> > Committer on Apache Tapestry 5
> > Co-creator of wooki @wookicentral.com
> >
> 
> 
> 
> -- 
> Regards,
> Christophe Cordenier.
> 
> Committer on Apache Tapestry 5
> Co-creator of wooki @wookicentral.com
> 
        
-- 
GMX DSL SOMMER-SPECIAL: Surf & Phone Flat 16.000 für nur 19,99 Euro/mtl.!*
http://portal.gmx.net/de/go/dsl

Re: Retrieve ActivationRequestParameters in custom PageResponseRenderer

Posted by Christophe Cordenier <ch...@gmail.com>.
Have you tried without specify Generic types ?

2010/9/13 Christophe Cordenier <ch...@gmail.com>

> Oh, this is maybe due to generics...
>
> 2010/9/13 Markus Feindler <Ma...@gmx.de>
>
>>
>>
>> public interface RequestParameterExtractor {
>>    Map<String, String> extractRequestParameters();
>> }
>>
>> is not equal to:
>>
>>
>>     TransformMethodSignature extractMethod = new
>> TransformMethodSignature(Modifier.PUBLIC,
>>            "Map<String, String>", "extractRequestParameters", null, null);
>>
>> ?
>>
>>
>>  Everything looks good ... The only thing i see is that the method
>>> signature
>>> is not exactly the same as the one declared in the interface.
>>>
>>> 2010/9/13 Markus Feindler<Ma...@gmx.de>
>>>
>>>   Am 13.09.2010 22:18, schrieb Thiago H. de Paula Figueiredo:
>>>>
>>>>  On Mon, 13 Sep 2010 17:02:02 -0300, Christophe Cordenier<
>>>>
>>>>> christophe.cordenier@gmail.com>  wrote:
>>>>>
>>>>>  Please, Can you provide your Tapestry Module class that contributes
>>>>> your
>>>>>
>>>>>> worker ?
>>>>>>
>>>>>>  And the worker itself? It seems two different worker instances are
>>>>> trying
>>>>> to add the same method to the same page class.
>>>>>
>>>>>  files attached! appreciate your help.
>>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>>
>>>>
>>>
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: users-help@tapestry.apache.org
>>
>>
>
>
> --
> Regards,
> Christophe Cordenier.
>
> Committer on Apache Tapestry 5
> Co-creator of wooki @wookicentral.com
>



-- 
Regards,
Christophe Cordenier.

Committer on Apache Tapestry 5
Co-creator of wooki @wookicentral.com

Re: Retrieve ActivationRequestParameters in custom PageResponseRenderer

Posted by Christophe Cordenier <ch...@gmail.com>.
Oh, this is maybe due to generics...

2010/9/13 Markus Feindler <Ma...@gmx.de>

>
>
> public interface RequestParameterExtractor {
>    Map<String, String> extractRequestParameters();
> }
>
> is not equal to:
>
>
>     TransformMethodSignature extractMethod = new
> TransformMethodSignature(Modifier.PUBLIC,
>            "Map<String, String>", "extractRequestParameters", null, null);
>
> ?
>
>
>  Everything looks good ... The only thing i see is that the method
>> signature
>> is not exactly the same as the one declared in the interface.
>>
>> 2010/9/13 Markus Feindler<Ma...@gmx.de>
>>
>>   Am 13.09.2010 22:18, schrieb Thiago H. de Paula Figueiredo:
>>>
>>>  On Mon, 13 Sep 2010 17:02:02 -0300, Christophe Cordenier<
>>>
>>>> christophe.cordenier@gmail.com>  wrote:
>>>>
>>>>  Please, Can you provide your Tapestry Module class that contributes
>>>> your
>>>>
>>>>> worker ?
>>>>>
>>>>>  And the worker itself? It seems two different worker instances are
>>>> trying
>>>> to add the same method to the same page class.
>>>>
>>>>  files attached! appreciate your help.
>>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>
>>>
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>


-- 
Regards,
Christophe Cordenier.

Committer on Apache Tapestry 5
Co-creator of wooki @wookicentral.com

Re: Retrieve ActivationRequestParameters in custom PageResponseRenderer

Posted by Markus Feindler <Ma...@gmx.de>.

public interface RequestParameterExtractor {
     Map<String, String> extractRequestParameters();
}

is not equal to:

      TransformMethodSignature extractMethod = new 
TransformMethodSignature(Modifier.PUBLIC,
             "Map<String, String>", "extractRequestParameters", null, null);

?

> Everything looks good ... The only thing i see is that the method signature
> is not exactly the same as the one declared in the interface.
>
> 2010/9/13 Markus Feindler<Ma...@gmx.de>
>
>>   Am 13.09.2010 22:18, schrieb Thiago H. de Paula Figueiredo:
>>
>>   On Mon, 13 Sep 2010 17:02:02 -0300, Christophe Cordenier<
>>> christophe.cordenier@gmail.com>  wrote:
>>>
>>>   Please, Can you provide your Tapestry Module class that contributes your
>>>> worker ?
>>>>
>>> And the worker itself? It seems two different worker instances are trying
>>> to add the same method to the same page class.
>>>
>>>   files attached! appreciate your help.
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: users-help@tapestry.apache.org
>>
>
>


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


Re: Retrieve ActivationRequestParameters in custom PageResponseRenderer

Posted by Christophe Cordenier <ch...@gmail.com>.
Everything looks good ... The only thing i see is that the method signature
is not exactly the same as the one declared in the interface.

2010/9/13 Markus Feindler <Ma...@gmx.de>

>  Am 13.09.2010 22:18, schrieb Thiago H. de Paula Figueiredo:
>
>  On Mon, 13 Sep 2010 17:02:02 -0300, Christophe Cordenier <
>> christophe.cordenier@gmail.com> wrote:
>>
>>  Please, Can you provide your Tapestry Module class that contributes your
>>> worker ?
>>>
>>
>> And the worker itself? It seems two different worker instances are trying
>> to add the same method to the same page class.
>>
>>  files attached! appreciate your help.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>



-- 
Regards,
Christophe Cordenier.

Committer on Apache Tapestry 5
Co-creator of wooki @wookicentral.com

Re: Retrieve ActivationRequestParameters in custom PageResponseRenderer

Posted by Markus Feindler <Ma...@gmx.de>.
  Am 13.09.2010 22:18, schrieb Thiago H. de Paula Figueiredo:
> On Mon, 13 Sep 2010 17:02:02 -0300, Christophe Cordenier 
> <ch...@gmail.com> wrote:
>
>> Please, Can you provide your Tapestry Module class that contributes your
>> worker ?
>
> And the worker itself? It seems two different worker instances are 
> trying to add the same method to the same page class.
>
files attached! appreciate your help.

Re: Retrieve ActivationRequestParameters in custom PageResponseRenderer

Posted by "Thiago H. de Paula Figueiredo" <th...@gmail.com>.
On Mon, 13 Sep 2010 17:02:02 -0300, Christophe Cordenier  
<ch...@gmail.com> wrote:

> Please, Can you provide your Tapestry Module class that contributes your
> worker ?

And the worker itself? It seems two different worker instances are trying  
to add the same method to the same page class.

-- 
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-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: Retrieve ActivationRequestParameters in custom PageResponseRenderer

Posted by Christophe Cordenier <ch...@gmail.com>.
Please, Can you provide your Tapestry Module class that contributes your
worker ?

2010/9/9 Markus Feindler <Ma...@gmx.de>

> No, I get the exception for all pages, also the ExpcetionReportPage for
> example.
>
> >
> > -------- Original-Nachricht --------
> > Datum: Thu, 9 Sep 2010 08:26:05 +0200
> > Von: Christophe Cordenier <ch...@gmail.com>
> > An: Tapestry users <us...@tapestry.apache.org>
> > Betreff: Re: Retrieve ActivationRequestParameters in custom
> > PageResponseRenderer
> >
> >             Weird, does you Index page extends a base class ?
> >
> > 2010/9/8 Markus Feindler <Ma...@gmx.de>
> >
> > >  Sorry to bother you, but Im stuck with a DuplicateMemberException:
> > > Caused by: java.lang.RuntimeException:
> > > javassist.bytecode.DuplicateMemberException: duplicate method:
> > > extractRequestParameters in de.wiv.tapestryportlet2.pages.Index
> > >    at
> > >
> >
> org.apache.tapestry5.internal.services.InternalClassTransformationImpl.addOverrideOfSuperclassMethod(InternalClassTransformationImpl.java:1458)
> > >    at
> > >
> >
> org.apache.tapestry5.internal.services.InternalClassTransformationImpl.findOrOverrideMethod(InternalClassTransformationImpl.java:1412)
> > >    at
> > >
> >
> org.apache.tapestry5.internal.services.InternalClassTransformationImpl.findOverrideOrCreateMethod(InternalClassTransformationImpl.java:1397)
> > >    at
> > >
> >
> org.apache.tapestry5.internal.services.InternalClassTransformationImpl.getOrCreateMethod(InternalClassTransformationImpl.java:1392)
> > >    at
> > >
> >
> org.apache.tapestry5.portlet.services.PortletRequestParameterWorker.transform(PortletRequestParameterWorker.java:48)
> > >    at
> > >
> >
> $ComponentClassTransformWorker_12af2cfc4c4.transform($ComponentClassTransformWorker_12af2cfc4c4.java)
> > >    at
> > >
> >
> $ComponentClassTransformWorker_12af2cfc4c5.transform($ComponentClassTransformWorker_12af2cfc4c5.java)
> > >    at
> > >
> >
> $ComponentClassTransformWorker_12af2cfc4b6.transform($ComponentClassTransformWorker_12af2cfc4b6.java)
> > >    at
> > >
> >
> org.apache.tapestry5.internal.services.ComponentClassTransformerImpl$1.run(ComponentClassTransformerImpl.java:194)
> > >    ... 250 more
> > > Caused by: javassist.bytecode.DuplicateMemberException: duplicate
> > method:
> > > extractRequestParameters in de.wiv.tapestryportlet2.pages.Index
> > >    at
> > javassist.bytecode.ClassFile.testExistingMethod(ClassFile.java:637)
> > >    at javassist.bytecode.ClassFile.addMethod(ClassFile.java:613)
> > >    at javassist.CtClassType.addMethod(CtClassType.java:1320)
> > >    at
> > >
> >
> org.apache.tapestry5.internal.services.InternalClassTransformationImpl.addOverrideOfSuperclassMethod(InternalClassTransformationImpl.java:1444)
> > >    ... 258 more
> > >
> > > This is my worker:
> > >
> > > public class PortletRequestParameterWorker implements
> > > ComponentClassTransformWorker {
> > >
> > >    private final ValueEncoderSource valueEncoderSource;
> > >    private final ComponentClassCache classCache;
> > >    private final RequestParameterContext requestParameterContext;
> > >    private final ComponentSource componentSource;
> > >
> > >    public PortletRequestParameterWorker(ValueEncoderSource
> > > valueEncoderSource,
> > >            ComponentClassCache classCache, RequestParameterContext
> > > requestParameterContext,
> > >            ComponentSource componentSource) {
> > >        this.valueEncoderSource = valueEncoderSource;
> > >        this.classCache = classCache;
> > >        this.requestParameterContext = requestParameterContext;
> > >        this.componentSource = componentSource;
> > >    }
> > >
> > >    public void transform(final ClassTransformation transformation,
> > >            MutableComponentModel model) {
> > >
> > >
> > >
> > transformation.addImplementedInterface(RequestParameterExtractor.class);
> > >            TransformMethodSignature extractMethod = new
> > > TransformMethodSignature(Modifier.PUBLIC,
> > >                    "Map<String, String>", "extractRequestParameters",
> > null,
> > > null);
> > > //            if (transformation.isDeclaredMethod(extractMethod)) {
> > > //                return;
> > > //            }
> > >
> > transformation.getOrCreateMethod(extractMethod).addAdvice(new
> > > ComponentMethodAdvice(){
> > >
> > >                public void advise(ComponentMethodInvocation invocation)
> > {
> > >                    Map<String, String> requestParameters = new
> > > HashMap<String, String>();
> > >                    for (TransformField field :
> > >
> >
> transformation.matchFieldsWithAnnotation(ActivationRequestParameter.class))
> > > {
> > >                        String parameterName = getParameterName(field,
> > > field.getAnnotation(ActivationRequestParameter.class));
> > >                        Class fieldType =
> > > classCache.forName(field.getType());
> > >                        FieldAccess access = field.getAccess();
> > >                        ValueEncoder encoder =
> > > valueEncoderSource.getValueEncoder(fieldType);
> > >                        Object value =
> > > access.read(invocation.getInstance());
> > >                        if (value == null)
> > >                            continue;
> > >                        String clientValue = encoder.toClient(value);
> > >                        requestParameters.put(parameterName,
> > clientValue);
> > >                    }
> > >                    invocation.overrideResult(requestParameters);
> > >                }
> > >
> > >            });
> > >    }
> > >
> > >    private String getParameterName(TransformField field,
> > > ActivationRequestParameter annotation)
> > >    {
> > >        if (annotation.value().equals(""))
> > >            return field.getName();
> > >
> > >        return annotation.value();
> > >    }
> > >
> > > }
> > >
> > > Any ideas?
> > >
> > >  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<Ma...@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<Ma...@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<Ma...@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<Ma...@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<Ma...@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.Feindler@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<Ma...@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-unsubscribe@tapestry.apache.org
> > >>>>>>>>>>>>>>> For additional commands, e-mail:
> > >>>>>>>>>>>>>>> users-help@tapestry.apache.org
> > >>>>>>>>>>>>>>>
> > >>>>>>>>>>>>>>>
> > >>>>>>>>>>>>>>>
> > >>>>>>>>>>>>>>>
> > >>>>>>>>>>>>>>>
> > >>>>>>>>>>>>>>>
> > >>>>>>>>>>>>>>>
> > >>>>>>>>>>>>>>>
> > >>>>>>>>>>>>>>>
> > >>>>>>>>>>>>>>>
> > ---------------------------------------------------------------------
> > >>>>>>>>>>>>>>>
> > >>>>>>>>>>>>>>>   To unsubscribe, e-mail:
> > >>>>>>>>>>>>>> users-unsubscribe@tapestry.apache.org
> > >>>>>>>>>>>>>>
> > >>>>>>>>>>>>>>  For additional commands, e-mail:
> > >>>>>>>>>>>>> users-help@tapestry.apache.org
> > >>>>>>>>>>>>>
> > >>>>>>>>>>>>>
> > >>>>>>>>>>>>>
> > >>>>>>>>>>>>>
> > >>>>>>>>>>>>>
> > >>>>>>>>>>>>>
> > ---------------------------------------------------------------------
> > >>>>>>>>>>>>>
> > >>>>>>>>>>>>>
> > >>>>>>>>>>>>>
> > >>>>>>>>>>>>>
> > >>>>>>>>>>>>>  To unsubscribe, e-mail:
> > users-unsubscribe@tapestry.apache.org
> > >>>>>>>>>>>>>
> > >>>>>>>>>>>>>  For additional commands, e-mail:
> > >>>>>>>>>>>> users-help@tapestry.apache.org
> > >>>>>>>>>>>>
> > >>>>>>>>>>>>
> > >>>>>>>>>>>>
> > >>>>>>>>>>>>
> > >>>>>>>>>>>>
> > >>>>>>>>>>>>
> > >>>>>>>>>>>>
> > >>>>>>>>>>>>
> > >>>>>>>>>>>>
> > >>>>>>>>>>>>
> > ---------------------------------------------------------------------
> > >>>>>>>>>>>>
> > >>>>>>>>>>>>  To unsubscribe, e-mail:
> > users-unsubscribe@tapestry.apache.org
> > >>>>>>>>>>> For additional commands, e-mail:
> > users-help@tapestry.apache.org
> > >>>>>>>>>>>
> > >>>>>>>>>>>
> > >>>>>>>>>>>
> > >>>>>>>>>>>
> > >>>>>>>>>>>
> > >>>>>>>>>>>
> > >>>>>>>>>>>
> > >>>>>>>>>>>
> > >>>>>>>>>>>
> > ---------------------------------------------------------------------
> > >>>>>>>>>>
> > >>>>>>>>>>  To unsubscribe, e-mail:
> users-unsubscribe@tapestry.apache.org
> > >>>>>>>>> For additional commands, e-mail:
> users-help@tapestry.apache.org
> > >>>>>>>>>
> > >>>>>>>>>
> > >>>>>>>>>
> > >>>>>>>>>
> > >>>>>>>>>
> > >>>>>>>>>
> > >>>>>>>>>
> > ---------------------------------------------------------------------
> > >>>>>>>>
> > >>>>>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> > >>>>>>> For additional commands, e-mail: users-help@tapestry.apache.org
> > >>>>>>>
> > >>>>>>>
> > >>>>>>>
> > >>>>>>>
> > >>>>>>>
> > ---------------------------------------------------------------------
> > >>>>>>>
> > >>>>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> > >>>>> For additional commands, e-mail: users-help@tapestry.apache.org
> > >>>>>
> > >>>>>
> > >>>>>
> > >>>>>
> > ---------------------------------------------------------------------
> > >>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> > >>> For additional commands, e-mail: users-help@tapestry.apache.org
> > >>>
> > >>>
> > >>>
> > >>
> > >
> >
> >
> > --
> > Regards,
> > Christophe Cordenier.
> >
> > Committer on Apache Tapestry 5
> > Co-creator of wooki @wookicentral.com
> >
>
> --
> GMX DSL SOMMER-SPECIAL: Surf & Phone Flat 16.000 für nur 19,99 Euro/mtl.!*
> http://portal.gmx.net/de/go/dsl
>



-- 
Regards,
Christophe Cordenier.

Committer on Apache Tapestry 5
Co-creator of wooki @wookicentral.com

Re: Retrieve ActivationRequestParameters in custom PageResponseRenderer

Posted by Markus Feindler <Ma...@gmx.de>.
No, I get the exception for all pages, also the ExpcetionReportPage for 
example.

>             
> -------- Original-Nachricht --------
> Datum: Thu, 9 Sep 2010 08:26:05 +0200
> Von: Christophe Cordenier <ch...@gmail.com>
> An: Tapestry users <us...@tapestry.apache.org>
> Betreff: Re: Retrieve ActivationRequestParameters in custom 
> PageResponseRenderer
> 
>             Weird, does you Index page extends a base class ?
> 
> 2010/9/8 Markus Feindler <Ma...@gmx.de>
> 
> >  Sorry to bother you, but Im stuck with a DuplicateMemberException:
> > Caused by: java.lang.RuntimeException:
> > javassist.bytecode.DuplicateMemberException: duplicate method:
> > extractRequestParameters in de.wiv.tapestryportlet2.pages.Index
> >    at
> > 
> org.apache.tapestry5.internal.services.InternalClassTransformationImpl.addOverrideOfSuperclassMethod(InternalClassTransformationImpl.java:1458)
> >    at
> > 
> org.apache.tapestry5.internal.services.InternalClassTransformationImpl.findOrOverrideMethod(InternalClassTransformationImpl.java:1412)
> >    at
> > 
> org.apache.tapestry5.internal.services.InternalClassTransformationImpl.findOverrideOrCreateMethod(InternalClassTransformationImpl.java:1397)
> >    at
> > 
> org.apache.tapestry5.internal.services.InternalClassTransformationImpl.getOrCreateMethod(InternalClassTransformationImpl.java:1392)
> >    at
> > 
> org.apache.tapestry5.portlet.services.PortletRequestParameterWorker.transform(PortletRequestParameterWorker.java:48)
> >    at
> > 
> $ComponentClassTransformWorker_12af2cfc4c4.transform($ComponentClassTransformWorker_12af2cfc4c4.java)
> >    at
> > 
> $ComponentClassTransformWorker_12af2cfc4c5.transform($ComponentClassTransformWorker_12af2cfc4c5.java)
> >    at
> > 
> $ComponentClassTransformWorker_12af2cfc4b6.transform($ComponentClassTransformWorker_12af2cfc4b6.java)
> >    at
> > 
> org.apache.tapestry5.internal.services.ComponentClassTransformerImpl$1.run(ComponentClassTransformerImpl.java:194)
> >    ... 250 more
> > Caused by: javassist.bytecode.DuplicateMemberException: duplicate 
> method:
> > extractRequestParameters in de.wiv.tapestryportlet2.pages.Index
> >    at 
> javassist.bytecode.ClassFile.testExistingMethod(ClassFile.java:637)
> >    at javassist.bytecode.ClassFile.addMethod(ClassFile.java:613)
> >    at javassist.CtClassType.addMethod(CtClassType.java:1320)
> >    at
> > 
> org.apache.tapestry5.internal.services.InternalClassTransformationImpl.addOverrideOfSuperclassMethod(InternalClassTransformationImpl.java:1444)
> >    ... 258 more
> >
> > This is my worker:
> >
> > public class PortletRequestParameterWorker implements
> > ComponentClassTransformWorker {
> >
> >    private final ValueEncoderSource valueEncoderSource;
> >    private final ComponentClassCache classCache;
> >    private final RequestParameterContext requestParameterContext;
> >    private final ComponentSource componentSource;
> >
> >    public PortletRequestParameterWorker(ValueEncoderSource
> > valueEncoderSource,
> >            ComponentClassCache classCache, RequestParameterContext
> > requestParameterContext,
> >            ComponentSource componentSource) {
> >        this.valueEncoderSource = valueEncoderSource;
> >        this.classCache = classCache;
> >        this.requestParameterContext = requestParameterContext;
> >        this.componentSource = componentSource;
> >    }
> >
> >    public void transform(final ClassTransformation transformation,
> >            MutableComponentModel model) {
> >
> >
> >  
> transformation.addImplementedInterface(RequestParameterExtractor.class);
> >            TransformMethodSignature extractMethod = new
> > TransformMethodSignature(Modifier.PUBLIC,
> >                    "Map<String, String>", "extractRequestParameters", 
> null,
> > null);
> > //            if (transformation.isDeclaredMethod(extractMethod)) {
> > //                return;
> > //            }
> >            
> transformation.getOrCreateMethod(extractMethod).addAdvice(new
> > ComponentMethodAdvice(){
> >
> >                public void advise(ComponentMethodInvocation invocation) 
> {
> >                    Map<String, String> requestParameters = new
> > HashMap<String, String>();
> >                    for (TransformField field :
> > 
> transformation.matchFieldsWithAnnotation(ActivationRequestParameter.class))
> > {
> >                        String parameterName = getParameterName(field,
> > field.getAnnotation(ActivationRequestParameter.class));
> >                        Class fieldType =
> > classCache.forName(field.getType());
> >                        FieldAccess access = field.getAccess();
> >                        ValueEncoder encoder =
> > valueEncoderSource.getValueEncoder(fieldType);
> >                        Object value =
> > access.read(invocation.getInstance());
> >                        if (value == null)
> >                            continue;
> >                        String clientValue = encoder.toClient(value);
> >                        requestParameters.put(parameterName, 
> clientValue);
> >                    }
> >                    invocation.overrideResult(requestParameters);
> >                }
> >
> >            });
> >    }
> >
> >    private String getParameterName(TransformField field,
> > ActivationRequestParameter annotation)
> >    {
> >        if (annotation.value().equals(""))
> >            return field.getName();
> >
> >        return annotation.value();
> >    }
> >
> > }
> >
> > Any ideas?
> >
> >  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<Ma...@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<Ma...@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<Ma...@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<Ma...@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<Ma...@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.Feindler@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<Ma...@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-unsubscribe@tapestry.apache.org
> >>>>>>>>>>>>>>> For additional commands, e-mail:
> >>>>>>>>>>>>>>> users-help@tapestry.apache.org
> >>>>>>>>>>>>>>>
> >>>>>>>>>>>>>>>
> >>>>>>>>>>>>>>>
> >>>>>>>>>>>>>>>
> >>>>>>>>>>>>>>>
> >>>>>>>>>>>>>>>
> >>>>>>>>>>>>>>>
> >>>>>>>>>>>>>>>
> >>>>>>>>>>>>>>>
> >>>>>>>>>>>>>>> 
> ---------------------------------------------------------------------
> >>>>>>>>>>>>>>>
> >>>>>>>>>>>>>>>   To unsubscribe, e-mail:
> >>>>>>>>>>>>>> users-unsubscribe@tapestry.apache.org
> >>>>>>>>>>>>>>
> >>>>>>>>>>>>>>  For additional commands, e-mail:
> >>>>>>>>>>>>> users-help@tapestry.apache.org
> >>>>>>>>>>>>>
> >>>>>>>>>>>>>
> >>>>>>>>>>>>>
> >>>>>>>>>>>>>
> >>>>>>>>>>>>>
> >>>>>>>>>>>>>  
> ---------------------------------------------------------------------
> >>>>>>>>>>>>>
> >>>>>>>>>>>>>
> >>>>>>>>>>>>>
> >>>>>>>>>>>>>
> >>>>>>>>>>>>>  To unsubscribe, e-mail: 
> users-unsubscribe@tapestry.apache.org
> >>>>>>>>>>>>>
> >>>>>>>>>>>>>  For additional commands, e-mail:
> >>>>>>>>>>>> users-help@tapestry.apache.org
> >>>>>>>>>>>>
> >>>>>>>>>>>>
> >>>>>>>>>>>>
> >>>>>>>>>>>>
> >>>>>>>>>>>>
> >>>>>>>>>>>>
> >>>>>>>>>>>>
> >>>>>>>>>>>>
> >>>>>>>>>>>>
> >>>>>>>>>>>> 
> ---------------------------------------------------------------------
> >>>>>>>>>>>>
> >>>>>>>>>>>>  To unsubscribe, e-mail: 
> users-unsubscribe@tapestry.apache.org
> >>>>>>>>>>> For additional commands, e-mail: 
> users-help@tapestry.apache.org
> >>>>>>>>>>>
> >>>>>>>>>>>
> >>>>>>>>>>>
> >>>>>>>>>>>
> >>>>>>>>>>>
> >>>>>>>>>>>
> >>>>>>>>>>>
> >>>>>>>>>>>
> >>>>>>>>>>>  
> ---------------------------------------------------------------------
> >>>>>>>>>>
> >>>>>>>>>>  To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> >>>>>>>>> For additional commands, e-mail: users-help@tapestry.apache.org
> >>>>>>>>>
> >>>>>>>>>
> >>>>>>>>>
> >>>>>>>>>
> >>>>>>>>>
> >>>>>>>>>
> >>>>>>>>>  
> ---------------------------------------------------------------------
> >>>>>>>>
> >>>>>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> >>>>>>> For additional commands, e-mail: users-help@tapestry.apache.org
> >>>>>>>
> >>>>>>>
> >>>>>>>
> >>>>>>>
> >>>>>>>  
> ---------------------------------------------------------------------
> >>>>>>>
> >>>>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> >>>>> For additional commands, e-mail: users-help@tapestry.apache.org
> >>>>>
> >>>>>
> >>>>>
> >>>>>  
> ---------------------------------------------------------------------
> >>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> >>> For additional commands, e-mail: users-help@tapestry.apache.org
> >>>
> >>>
> >>>
> >>
> >
> 
> 
> -- 
> Regards,
> Christophe Cordenier.
> 
> Committer on Apache Tapestry 5
> Co-creator of wooki @wookicentral.com
> 
        
-- 
GMX DSL SOMMER-SPECIAL: Surf & Phone Flat 16.000 für nur 19,99 Euro/mtl.!*
http://portal.gmx.net/de/go/dsl

Re: Retrieve ActivationRequestParameters in custom PageResponseRenderer

Posted by Christophe Cordenier <ch...@gmail.com>.
Weird, does you Index page extends a base class ?

2010/9/8 Markus Feindler <Ma...@gmx.de>

>  Sorry to bother you, but Im stuck with a DuplicateMemberException:
> Caused by: java.lang.RuntimeException:
> javassist.bytecode.DuplicateMemberException: duplicate method:
> extractRequestParameters in de.wiv.tapestryportlet2.pages.Index
>    at
> org.apache.tapestry5.internal.services.InternalClassTransformationImpl.addOverrideOfSuperclassMethod(InternalClassTransformationImpl.java:1458)
>    at
> org.apache.tapestry5.internal.services.InternalClassTransformationImpl.findOrOverrideMethod(InternalClassTransformationImpl.java:1412)
>    at
> org.apache.tapestry5.internal.services.InternalClassTransformationImpl.findOverrideOrCreateMethod(InternalClassTransformationImpl.java:1397)
>    at
> org.apache.tapestry5.internal.services.InternalClassTransformationImpl.getOrCreateMethod(InternalClassTransformationImpl.java:1392)
>    at
> org.apache.tapestry5.portlet.services.PortletRequestParameterWorker.transform(PortletRequestParameterWorker.java:48)
>    at
> $ComponentClassTransformWorker_12af2cfc4c4.transform($ComponentClassTransformWorker_12af2cfc4c4.java)
>    at
> $ComponentClassTransformWorker_12af2cfc4c5.transform($ComponentClassTransformWorker_12af2cfc4c5.java)
>    at
> $ComponentClassTransformWorker_12af2cfc4b6.transform($ComponentClassTransformWorker_12af2cfc4b6.java)
>    at
> org.apache.tapestry5.internal.services.ComponentClassTransformerImpl$1.run(ComponentClassTransformerImpl.java:194)
>    ... 250 more
> Caused by: javassist.bytecode.DuplicateMemberException: duplicate method:
> extractRequestParameters in de.wiv.tapestryportlet2.pages.Index
>    at javassist.bytecode.ClassFile.testExistingMethod(ClassFile.java:637)
>    at javassist.bytecode.ClassFile.addMethod(ClassFile.java:613)
>    at javassist.CtClassType.addMethod(CtClassType.java:1320)
>    at
> org.apache.tapestry5.internal.services.InternalClassTransformationImpl.addOverrideOfSuperclassMethod(InternalClassTransformationImpl.java:1444)
>    ... 258 more
>
> This is my worker:
>
> public class PortletRequestParameterWorker implements
> ComponentClassTransformWorker {
>
>    private final ValueEncoderSource valueEncoderSource;
>    private final ComponentClassCache classCache;
>    private final RequestParameterContext requestParameterContext;
>    private final ComponentSource componentSource;
>
>    public PortletRequestParameterWorker(ValueEncoderSource
> valueEncoderSource,
>            ComponentClassCache classCache, RequestParameterContext
> requestParameterContext,
>            ComponentSource componentSource) {
>        this.valueEncoderSource = valueEncoderSource;
>        this.classCache = classCache;
>        this.requestParameterContext = requestParameterContext;
>        this.componentSource = componentSource;
>    }
>
>    public void transform(final ClassTransformation transformation,
>            MutableComponentModel model) {
>
>
>  transformation.addImplementedInterface(RequestParameterExtractor.class);
>            TransformMethodSignature extractMethod = new
> TransformMethodSignature(Modifier.PUBLIC,
>                    "Map<String, String>", "extractRequestParameters", null,
> null);
> //            if (transformation.isDeclaredMethod(extractMethod)) {
> //                return;
> //            }
>            transformation.getOrCreateMethod(extractMethod).addAdvice(new
> ComponentMethodAdvice(){
>
>                public void advise(ComponentMethodInvocation invocation) {
>                    Map<String, String> requestParameters = new
> HashMap<String, String>();
>                    for (TransformField field :
> transformation.matchFieldsWithAnnotation(ActivationRequestParameter.class))
> {
>                        String parameterName = getParameterName(field,
> field.getAnnotation(ActivationRequestParameter.class));
>                        Class fieldType =
> classCache.forName(field.getType());
>                        FieldAccess access = field.getAccess();
>                        ValueEncoder encoder =
> valueEncoderSource.getValueEncoder(fieldType);
>                        Object value =
> access.read(invocation.getInstance());
>                        if (value == null)
>                            continue;
>                        String clientValue = encoder.toClient(value);
>                        requestParameters.put(parameterName, clientValue);
>                    }
>                    invocation.overrideResult(requestParameters);
>                }
>
>            });
>    }
>
>    private String getParameterName(TransformField field,
> ActivationRequestParameter annotation)
>    {
>        if (annotation.value().equals(""))
>            return field.getName();
>
>        return annotation.value();
>    }
>
> }
>
> Any ideas?
>
>  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<Ma...@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<Ma...@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<Ma...@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<Ma...@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<Ma...@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.Feindler@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<Ma...@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-unsubscribe@tapestry.apache.org
>>>>>>>>>>>>>>> For additional commands, e-mail:
>>>>>>>>>>>>>>> users-help@tapestry.apache.org
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> ---------------------------------------------------------------------
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>   To unsubscribe, e-mail:
>>>>>>>>>>>>>> users-unsubscribe@tapestry.apache.org
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>  For additional commands, e-mail:
>>>>>>>>>>>>> users-help@tapestry.apache.org
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>  ---------------------------------------------------------------------
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>  To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>>>>>>>>>>>>
>>>>>>>>>>>>>  For additional commands, e-mail:
>>>>>>>>>>>> users-help@tapestry.apache.org
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> ---------------------------------------------------------------------
>>>>>>>>>>>>
>>>>>>>>>>>>  To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>>>>>>>>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>  ---------------------------------------------------------------------
>>>>>>>>>>
>>>>>>>>>>  To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>>>>>>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>  ---------------------------------------------------------------------
>>>>>>>>
>>>>>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>>>>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>  ---------------------------------------------------------------------
>>>>>>>
>>>>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>>>
>>>>>
>>>>>
>>>>>  ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>
>>>
>>>
>>
>


-- 
Regards,
Christophe Cordenier.

Committer on Apache Tapestry 5
Co-creator of wooki @wookicentral.com

Re: Retrieve ActivationRequestParameters in custom PageResponseRenderer

Posted by Markus Feindler <Ma...@gmx.de>.
  Sorry to bother you, but Im stuck with a DuplicateMemberException:
Caused by: java.lang.RuntimeException: 
javassist.bytecode.DuplicateMemberException: duplicate method: 
extractRequestParameters in de.wiv.tapestryportlet2.pages.Index
     at 
org.apache.tapestry5.internal.services.InternalClassTransformationImpl.addOverrideOfSuperclassMethod(InternalClassTransformationImpl.java:1458)
     at 
org.apache.tapestry5.internal.services.InternalClassTransformationImpl.findOrOverrideMethod(InternalClassTransformationImpl.java:1412)
     at 
org.apache.tapestry5.internal.services.InternalClassTransformationImpl.findOverrideOrCreateMethod(InternalClassTransformationImpl.java:1397)
     at 
org.apache.tapestry5.internal.services.InternalClassTransformationImpl.getOrCreateMethod(InternalClassTransformationImpl.java:1392)
     at 
org.apache.tapestry5.portlet.services.PortletRequestParameterWorker.transform(PortletRequestParameterWorker.java:48)
     at 
$ComponentClassTransformWorker_12af2cfc4c4.transform($ComponentClassTransformWorker_12af2cfc4c4.java)
     at 
$ComponentClassTransformWorker_12af2cfc4c5.transform($ComponentClassTransformWorker_12af2cfc4c5.java)
     at 
$ComponentClassTransformWorker_12af2cfc4b6.transform($ComponentClassTransformWorker_12af2cfc4b6.java)
     at 
org.apache.tapestry5.internal.services.ComponentClassTransformerImpl$1.run(ComponentClassTransformerImpl.java:194)
     ... 250 more
Caused by: javassist.bytecode.DuplicateMemberException: duplicate 
method: extractRequestParameters in de.wiv.tapestryportlet2.pages.Index
     at javassist.bytecode.ClassFile.testExistingMethod(ClassFile.java:637)
     at javassist.bytecode.ClassFile.addMethod(ClassFile.java:613)
     at javassist.CtClassType.addMethod(CtClassType.java:1320)
     at 
org.apache.tapestry5.internal.services.InternalClassTransformationImpl.addOverrideOfSuperclassMethod(InternalClassTransformationImpl.java:1444)
     ... 258 more

This is my worker:

public class PortletRequestParameterWorker implements 
ComponentClassTransformWorker {

     private final ValueEncoderSource valueEncoderSource;
     private final ComponentClassCache classCache;
     private final RequestParameterContext requestParameterContext;
     private final ComponentSource componentSource;

     public PortletRequestParameterWorker(ValueEncoderSource 
valueEncoderSource,
             ComponentClassCache classCache, RequestParameterContext 
requestParameterContext,
             ComponentSource componentSource) {
         this.valueEncoderSource = valueEncoderSource;
         this.classCache = classCache;
         this.requestParameterContext = requestParameterContext;
         this.componentSource = componentSource;
     }

     public void transform(final ClassTransformation transformation,
             MutableComponentModel model) {

             
transformation.addImplementedInterface(RequestParameterExtractor.class);
             TransformMethodSignature extractMethod = new 
TransformMethodSignature(Modifier.PUBLIC,
                     "Map<String, String>", "extractRequestParameters", 
null, null);
//            if (transformation.isDeclaredMethod(extractMethod)) {
//                return;
//            }
             
transformation.getOrCreateMethod(extractMethod).addAdvice(new 
ComponentMethodAdvice(){

                 public void advise(ComponentMethodInvocation invocation) {
                     Map<String, String> requestParameters = new 
HashMap<String, String>();
                     for (TransformField field : 
transformation.matchFieldsWithAnnotation(ActivationRequestParameter.class)) 
{
                         String parameterName = getParameterName(field, 
field.getAnnotation(ActivationRequestParameter.class));
                         Class fieldType = 
classCache.forName(field.getType());
                         FieldAccess access = field.getAccess();
                         ValueEncoder encoder = 
valueEncoderSource.getValueEncoder(fieldType);
                         Object value = 
access.read(invocation.getInstance());
                         if (value == null)
                             continue;
                         String clientValue = encoder.toClient(value);
                         requestParameters.put(parameterName, clientValue);
                     }
                     invocation.overrideResult(requestParameters);
                 }

             });
     }

     private String getParameterName(TransformField field, 
ActivationRequestParameter annotation)
     {
         if (annotation.value().equals(""))
             return field.getName();

         return annotation.value();
     }

}

Any ideas?
> 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<Ma...@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<Ma...@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<Ma...@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<Ma...@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<Ma...@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.Feindler@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<Ma...@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-unsubscribe@tapestry.apache.org
>>>>>>>>>>>>>> For additional commands, e-mail:
>>>>>>>>>>>>>> users-help@tapestry.apache.org
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> ---------------------------------------------------------------------
>>>>>>>>>>>>>>
>>>>>>>>>>>>>   To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>>>>>>>>>>>>
>>>>>>>>>>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>   ---------------------------------------------------------------------
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>   To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>>>>>>>>>>>
>>>>>>>>>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> ---------------------------------------------------------------------
>>>>>>>>>>>
>>>>>>>>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>>>>>>>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>   ---------------------------------------------------------------------
>>>>>>>>>
>>>>>>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>>>>>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>   ---------------------------------------------------------------------
>>>>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>>>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>>>>
>>>>>>
>>>>>>
>>>>>>   ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>>
>>>>
>>>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: users-help@tapestry.apache.org
>>
>>
>


Re: Retrieve ActivationRequestParameters in custom PageResponseRenderer

Posted by Christophe Cordenier <ch...@gmail.com>.
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 <Ma...@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<Ma...@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<Ma...@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<Ma...@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<Ma...@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.Feindler@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<Ma...@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-unsubscribe@tapestry.apache.org
>>>>>>>>>>>>> For additional commands, e-mail:
>>>>>>>>>>>>> users-help@tapestry.apache.org
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>> ---------------------------------------------------------------------
>>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>  To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>>>>>>>>>>>
>>>>>>>>>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>  ---------------------------------------------------------------------
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>  To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>>>>>>>>>>
>>>>>>>>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> ---------------------------------------------------------------------
>>>>>>>>>>
>>>>>>>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>>>>>>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>
>>>>>>>>  ---------------------------------------------------------------------
>>>>>>>>
>>>>>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>>>>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>  ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>>>
>>>>>
>>>>>
>>>>>  ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>
>>>
>>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>


-- 
Regards,
Christophe Cordenier.

Committer on Apache Tapestry 5
Co-creator of wooki @wookicentral.com

Re: Retrieve ActivationRequestParameters in custom PageResponseRenderer

Posted by Markus Feindler <Ma...@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<Ma...@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<Ma...@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<Ma...@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<Ma...@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<Ma...@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<Ma...@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-unsubscribe@tapestry.apache.org
>>>>>>>>>>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> ---------------------------------------------------------------------
>>>>>>>>>>>
>>>>>>>>>>>   To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>>>>>>>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>   ---------------------------------------------------------------------
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>   To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>>>>>>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> ---------------------------------------------------------------------
>>>>>>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>>>>>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>
>>>>>>>   ---------------------------------------------------------------------
>>>>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>>>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>>
>>>>
>>>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: users-help@tapestry.apache.org
>>
>>
>


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


Re: Retrieve ActivationRequestParameters in custom PageResponseRenderer

Posted by Christophe Cordenier <ch...@gmail.com>.
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 <Ma...@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<Ma...@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<Ma...@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<Ma...@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<Ma...@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<Ma...@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-unsubscribe@tapestry.apache.org
>>>>>>>>>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> ---------------------------------------------------------------------
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>  To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>>>>>>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>  ---------------------------------------------------------------------
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>  To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>>>>>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> ---------------------------------------------------------------------
>>>>>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>>>>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>
>>>>>>
>>>>>>  ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>
>>>
>>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>


-- 
Regards,
Christophe Cordenier.

Committer on Apache Tapestry 5
Co-creator of wooki @wookicentral.com

Re: Retrieve ActivationRequestParameters in custom PageResponseRenderer

Posted by Markus Feindler <Ma...@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<Ma...@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<Ma...@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<Ma...@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<Ma...@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<Ma...@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-unsubscribe@tapestry.apache.org
>>>>>>>>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>> ---------------------------------------------------------------------
>>>>>>>>>
>>>>>>>>>
>>>>>>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>>>>>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>>>>>>
>>>>>>>>
>>>>>>>>   ---------------------------------------------------------------------
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>>>>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>> ---------------------------------------------------------------------
>>>>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>>>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>>
>>>>
>>>>
>>>>
>>>
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: users-help@tapestry.apache.org
>>
>>
>


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


Re: Retrieve ActivationRequestParameters in custom PageResponseRenderer

Posted by Christophe Cordenier <ch...@gmail.com>.
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 <Ma...@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<Ma...@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<Ma...@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<Ma...@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<Ma...@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-unsubscribe@tapestry.apache.org
>>>>>>>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>
>>>>>>>> ---------------------------------------------------------------------
>>>>>>>>
>>>>>>>>
>>>>>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>>>>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>>>>>
>>>>>>>
>>>>>>>  ---------------------------------------------------------------------
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>>>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>>
>>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>
>>>
>>>
>>>
>>
>>
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>


-- 
Regards,
Christophe Cordenier.

Committer on Apache Tapestry 5
Co-creator of wooki @wookicentral.com

Re: Retrieve ActivationRequestParameters in custom PageResponseRenderer

Posted by Markus Feindler <Ma...@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<Ma...@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<Ma...@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<Ma...@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<Ma...@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-unsubscribe@tapestry.apache.org
>>>>>>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>                  
>>>>>>> ---------------------------------------------------------------------
>>>>>>>                
>>>>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>>>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>>>>
>>>>>>   ---------------------------------------------------------------------
>>>>>>
>>>>>>
>>>>>>              
>>>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>            
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>>
>>>>
>>>>
>>>>
>>>>          
>>>
>>>
>>>        
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: users-help@tapestry.apache.org
>>
>>
>>      
>
>    


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


Re: Retrieve ActivationRequestParameters in custom PageResponseRenderer

Posted by Christophe Cordenier <ch...@gmail.com>.
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 <Ma...@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<Ma...@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<Ma...@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<Ma...@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-unsubscribe@tapestry.apache.org
>>>>>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>>>
>>>>>  ---------------------------------------------------------------------
>>>>>
>>>>>
>>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>>
>>>>
>>>>
>>>>
>>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>
>>>
>>>
>>>
>>
>>
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>


-- 
Regards,
Christophe Cordenier.

Committer on Apache Tapestry 5
Co-creator of wooki @wookicentral.com

Re: Retrieve ActivationRequestParameters in custom PageResponseRenderer

Posted by Markus Feindler <Ma...@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<Ma...@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<Ma...@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<Ma...@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-unsubscribe@tapestry.apache.org
>>>>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>>>>
>>>>>>
>>>>>>
>>>>>>              
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>>
>>>>   ---------------------------------------------------------------------
>>>>          
>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>
>>>
>>>
>>>        
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: users-help@tapestry.apache.org
>>
>>
>>      
>
>    


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


Re: Retrieve ActivationRequestParameters in custom PageResponseRenderer

Posted by Christophe Cordenier <ch...@gmail.com>.
Hi

So why not passivate the page, see PageActivationContextCollector ? This is
how it works to create links.

2010/9/5 Markus Feindler <Ma...@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<Ma...@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<Ma...@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-unsubscribe@tapestry.apache.org
>>>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>>>
>>>>>
>>>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>
>>>  ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: users-help@tapestry.apache.org
>>
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>


-- 
Regards,
Christophe Cordenier.

Committer on Apache Tapestry 5
Co-creator of wooki @wookicentral.com

Re: Retrieve ActivationRequestParameters in custom PageResponseRenderer

Posted by Markus Feindler <Ma...@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<Ma...@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<Ma...@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-unsubscribe@tapestry.apache.org
>>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>>
>>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: users-help@tapestry.apache.org
>>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>


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


Re: Retrieve ActivationRequestParameters in custom PageResponseRenderer

Posted by Josh Canfield <jo...@gmail.com>.
That's not enough details. 

-- Josh

On Sep 5, 2010, at 9:51 AM, Markus Feindler <Ma...@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<Ma...@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-unsubscribe@tapestry.apache.org
>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>> 
>>> 
>> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
> 

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


Re: Retrieve ActivationRequestParameters in custom PageResponseRenderer

Posted by Christophe Cordenier <ch...@gmail.com>.
Just curious, you try to include a portlet in a Tapestry page ?

2010/9/5 Markus Feindler <Ma...@gmx.de>

>  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<Ma...@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-unsubscribe@tapestry.apache.org
>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>
>>>
>>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>


-- 
Regards,
Christophe Cordenier.

Committer on Apache Tapestry 5
Co-creator of wooki @wookicentral.com

Re: Retrieve ActivationRequestParameters in custom PageResponseRenderer

Posted by Markus Feindler <Ma...@gmx.de>.
  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<Ma...@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-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: users-help@tapestry.apache.org
>>
>>
>


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


Re: Retrieve ActivationRequestParameters in custom PageResponseRenderer

Posted by Christophe Cordenier <ch...@gmail.com>.
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 <Ma...@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-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>


-- 
Regards,
Christophe Cordenier.

Committer on Apache Tapestry 5
Co-creator of wooki @wookicentral.com