Re: Question on Tapesry Services IoC

2011-01-26 Thread Nicolas Barrera
Well, thanks again Alex so now I know which key to contribute to...

cheers!

Nicolás.-


On Wed, Jan 26, 2011 at 12:59 AM, Alex Kotchnev  wrote:

> And again - it looks like this documentation is properly populated in
> trunk;
> however, it was not reflected in the documentation on the website.
>
> Cheers,
>
> Alex K
>
> On Tue, Jan 25, 2011 at 10:54 PM, Alex Kotchnev 
> wrote:
>
> > Nicolas,
> >it turns out that TSS was already handling this as you need it to;
> > however it wasn't properly reflected in the documentation. The symbol
> that
> > you want to provide is "spring-security.always.use.target.url" . I'll see
> > about add this to the documentation.
> >
> > Regards,
> >
> > Alex K
> >
> >
> > On Tue, Jan 25, 2011 at 1:11 PM, Alex Kotchnev 
> wrote:
> >
> >> Nicolas,
> >>I might actually have a bit of time to implement this enhancement. It
> >> should be an easy enhancement that should have zero impact on the
> current
> >> users.
> >>
> >>I'll respond in this thread when the changes are in.
> >>
> >> Regards,
> >>
> >> Alex k
> >>
> >>
> >> On Tue, Jan 25, 2011 at 9:16 AM, Nicolas Barrera  >wrote:
> >>
> >>> Alex,
> >>>
> >>> Yes, adding support to configure that property would be the cleanest
> >>> solution of course :)
> >>>
> >>> thanks for your interest on supporting it.., I 'm currently facing this
> >>> problem while developing a production application.. but as you read,
> >>> there 're other workarounds so if you can't add this support I could
> deal
> >>> with it and I 'm not in an hurry.
> >>>
> >>> If you add the enhancement then it's welcome, if you need me to file an
> >>> issue just tell me.
> >>>
> >>> thanks again and thanks to all who 've answered this thread as I 've
> also
> >>> learned quite a bit about IoC on T5 with your replies.
> >>>
> >>> cheers!
> >>>
> >>> Nicolás.-
> >>>
> >>>
> >>> On Tue, Jan 25, 2011 at 10:45 AM, Alex Kotchnev 
> >>> wrote:
> >>>
> >>> > Nicolas,
> >>> >   it seems like the proper solution for your problem is to have an
> >>> > enhancement to TSS to receive a value and use the value when
> >>> configuring
> >>> > the
> >>> > service, e.g. :
> >>> >
> >>> > buildRealAuthenticationProcessingFilter(
> >>> > @SpringSecurityServices
> >>> > final AuthenticationManager manager,
> >>> @SpringSecurityServices
> >>> > final RememberMeServices rememberMeServices,
> >>> > @Inject  @Value("${spring-security.check.url}" final
> String
> >>> > authUrl,
> >>> > @Inject @Value("${spring-security.target.url}")  final
> >>> String
> >>> > targetUrl,
> >>> > @Inject @Value("${spring-security.failure.url}") final
> >>> String
> >>> > failureUrl,
> >>> > @Inject
> >>> @Value("${spring-security.target.alwaysUseDefault}")
> >>> > final
> >>> > Boolean alwaysUseDefaultTarget) {
> >>> >
> >>> > ..
> >>> >
> filter.setAlwaysUseDefaultTargetUrl(alwaysUseDefaultTarget)
> >>> > 
> >>> >
> >>> > }
> >>> >
> >>> > Then in your configuration, you can contribute to to the defaults to
> >>> > provide
> >>> > your own value for the "spring-security.target.alwaysUseDefault".
> Would
> >>> > that
> >>> > work for you ? This certainly seems like a capability that would be
> >>> useful
> >>> > to be able to configure T-S-S with.
> >>> >
> >>> > Anyway, let me know if you want this, or if this was just an academic
> >>> > exercise on learning how to use T5 IOC - I can make the change in TSS
> >>> in
> >>> > the
> >>> > next few days.
> >>> >
> >>> > Regards,
> >>> >
> >>> > Alex K
> >>> > On Tue, Jan 25, 2011 at 8:33 AM, Nicolas Barrera  >>> > .com> wrote:
> >>> >
> >>> > > Hi Thiago,
> >>> > >
> >>> > > Ok, so as the 3rd party library's Service isn't implemented
> receiving
> >>> > some
> >>> > > Configuration, then I can't Contribute to it... and the only way
> >>> would be
> >>> > > to
> >>> > > override the service as a whole (reinstantiating it and setting it
> up
> >>> > all).
> >>> > > :(
> >>> > >
> >>> > > would it smell a lot if I ask tapestry for the instance of that
> >>> service
> >>> > in
> >>> > > some "startup" point of my AppModule and set that property to my
> >>> required
> >>> > > value?
> >>> > >
> >>> > > I 'm just trying not to reimplement the instantiation code of that
> >>> > service.
> >>> > >
> >>> > > thanks again,
> >>> > >
> >>> > > Nicolás.-
> >>> > >
> >>> > >
> >>> > > On Tue, Jan 25, 2011 at 10:26 AM, Thiago H. de Paula Figueiredo <
> >>> > > thiag...@gmail.com> wrote:
> >>> > >
> >>> > > > On Tue, 25 Jan 2011 11:24:00 -0200, Nicolas Barrera <
> >>> > nbarr...@gmail.com>
> >>> > > > wrote:
> >>> > > >
> >>> > > >  Concisely what I want is to get a Service from a 3rd party
> module
> >>> and
> >>> > > >> change one of it's properties, any ideas on the simplest way to
> do
> >>> it
> >>> > > >> without
> >>> > > >> instantiating the whole object again?
> >>> > > >>
> >>> > > >
> >>> > > > Tapestry-IoC doesn't provide any way of setti

Re: Question on Tapesry Services IoC

2011-01-25 Thread Alex Kotchnev
And again - it looks like this documentation is properly populated in trunk;
however, it was not reflected in the documentation on the website.

Cheers,

Alex K

On Tue, Jan 25, 2011 at 10:54 PM, Alex Kotchnev  wrote:

> Nicolas,
>it turns out that TSS was already handling this as you need it to;
> however it wasn't properly reflected in the documentation. The symbol that
> you want to provide is "spring-security.always.use.target.url" . I'll see
> about add this to the documentation.
>
> Regards,
>
> Alex K
>
>
> On Tue, Jan 25, 2011 at 1:11 PM, Alex Kotchnev  wrote:
>
>> Nicolas,
>>I might actually have a bit of time to implement this enhancement. It
>> should be an easy enhancement that should have zero impact on the current
>> users.
>>
>>I'll respond in this thread when the changes are in.
>>
>> Regards,
>>
>> Alex k
>>
>>
>> On Tue, Jan 25, 2011 at 9:16 AM, Nicolas Barrera wrote:
>>
>>> Alex,
>>>
>>> Yes, adding support to configure that property would be the cleanest
>>> solution of course :)
>>>
>>> thanks for your interest on supporting it.., I 'm currently facing this
>>> problem while developing a production application.. but as you read,
>>> there 're other workarounds so if you can't add this support I could deal
>>> with it and I 'm not in an hurry.
>>>
>>> If you add the enhancement then it's welcome, if you need me to file an
>>> issue just tell me.
>>>
>>> thanks again and thanks to all who 've answered this thread as I 've also
>>> learned quite a bit about IoC on T5 with your replies.
>>>
>>> cheers!
>>>
>>> Nicolás.-
>>>
>>>
>>> On Tue, Jan 25, 2011 at 10:45 AM, Alex Kotchnev 
>>> wrote:
>>>
>>> > Nicolas,
>>> >   it seems like the proper solution for your problem is to have an
>>> > enhancement to TSS to receive a value and use the value when
>>> configuring
>>> > the
>>> > service, e.g. :
>>> >
>>> > buildRealAuthenticationProcessingFilter(
>>> > @SpringSecurityServices
>>> > final AuthenticationManager manager,
>>> @SpringSecurityServices
>>> > final RememberMeServices rememberMeServices,
>>> > @Inject  @Value("${spring-security.check.url}" final String
>>> > authUrl,
>>> > @Inject @Value("${spring-security.target.url}")  final
>>> String
>>> > targetUrl,
>>> > @Inject @Value("${spring-security.failure.url}") final
>>> String
>>> > failureUrl,
>>> > @Inject
>>> @Value("${spring-security.target.alwaysUseDefault}")
>>> > final
>>> > Boolean alwaysUseDefaultTarget) {
>>> >
>>> > ..
>>> > filter.setAlwaysUseDefaultTargetUrl(alwaysUseDefaultTarget)
>>> > 
>>> >
>>> > }
>>> >
>>> > Then in your configuration, you can contribute to to the defaults to
>>> > provide
>>> > your own value for the "spring-security.target.alwaysUseDefault". Would
>>> > that
>>> > work for you ? This certainly seems like a capability that would be
>>> useful
>>> > to be able to configure T-S-S with.
>>> >
>>> > Anyway, let me know if you want this, or if this was just an academic
>>> > exercise on learning how to use T5 IOC - I can make the change in TSS
>>> in
>>> > the
>>> > next few days.
>>> >
>>> > Regards,
>>> >
>>> > Alex K
>>> > On Tue, Jan 25, 2011 at 8:33 AM, Nicolas Barrera >> > .com> wrote:
>>> >
>>> > > Hi Thiago,
>>> > >
>>> > > Ok, so as the 3rd party library's Service isn't implemented receiving
>>> > some
>>> > > Configuration, then I can't Contribute to it... and the only way
>>> would be
>>> > > to
>>> > > override the service as a whole (reinstantiating it and setting it up
>>> > all).
>>> > > :(
>>> > >
>>> > > would it smell a lot if I ask tapestry for the instance of that
>>> service
>>> > in
>>> > > some "startup" point of my AppModule and set that property to my
>>> required
>>> > > value?
>>> > >
>>> > > I 'm just trying not to reimplement the instantiation code of that
>>> > service.
>>> > >
>>> > > thanks again,
>>> > >
>>> > > Nicolás.-
>>> > >
>>> > >
>>> > > On Tue, Jan 25, 2011 at 10:26 AM, Thiago H. de Paula Figueiredo <
>>> > > thiag...@gmail.com> wrote:
>>> > >
>>> > > > On Tue, 25 Jan 2011 11:24:00 -0200, Nicolas Barrera <
>>> > nbarr...@gmail.com>
>>> > > > wrote:
>>> > > >
>>> > > >  Concisely what I want is to get a Service from a 3rd party module
>>> and
>>> > > >> change one of it's properties, any ideas on the simplest way to do
>>> it
>>> > > >> without
>>> > > >> instantiating the whole object again?
>>> > > >>
>>> > > >
>>> > > > Tapestry-IoC doesn't provide any way of setting a service
>>> > implementation
>>> > > > property. It does provide a way for you to override services'
>>> > > > configurations.
>>> > > >
>>> > > > --
>>> > > > 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
>>> > > >
>>> > > >
>>> > > >
>>> -

Re: Question on Tapesry Services IoC

2011-01-25 Thread Alex Kotchnev
Nicolas,
   it turns out that TSS was already handling this as you need it to;
however it wasn't properly reflected in the documentation. The symbol that
you want to provide is "spring-security.always.use.target.url" . I'll see
about add this to the documentation.

Regards,

Alex K

On Tue, Jan 25, 2011 at 1:11 PM, Alex Kotchnev  wrote:

> Nicolas,
>I might actually have a bit of time to implement this enhancement. It
> should be an easy enhancement that should have zero impact on the current
> users.
>
>I'll respond in this thread when the changes are in.
>
> Regards,
>
> Alex k
>
>
> On Tue, Jan 25, 2011 at 9:16 AM, Nicolas Barrera wrote:
>
>> Alex,
>>
>> Yes, adding support to configure that property would be the cleanest
>> solution of course :)
>>
>> thanks for your interest on supporting it.., I 'm currently facing this
>> problem while developing a production application.. but as you read,
>> there 're other workarounds so if you can't add this support I could deal
>> with it and I 'm not in an hurry.
>>
>> If you add the enhancement then it's welcome, if you need me to file an
>> issue just tell me.
>>
>> thanks again and thanks to all who 've answered this thread as I 've also
>> learned quite a bit about IoC on T5 with your replies.
>>
>> cheers!
>>
>> Nicolás.-
>>
>>
>> On Tue, Jan 25, 2011 at 10:45 AM, Alex Kotchnev 
>> wrote:
>>
>> > Nicolas,
>> >   it seems like the proper solution for your problem is to have an
>> > enhancement to TSS to receive a value and use the value when configuring
>> > the
>> > service, e.g. :
>> >
>> > buildRealAuthenticationProcessingFilter(
>> > @SpringSecurityServices
>> > final AuthenticationManager manager, @SpringSecurityServices
>> > final RememberMeServices rememberMeServices,
>> > @Inject  @Value("${spring-security.check.url}" final String
>> > authUrl,
>> > @Inject @Value("${spring-security.target.url}")  final
>> String
>> > targetUrl,
>> > @Inject @Value("${spring-security.failure.url}") final
>> String
>> > failureUrl,
>> > @Inject @Value("${spring-security.target.alwaysUseDefault}")
>> > final
>> > Boolean alwaysUseDefaultTarget) {
>> >
>> > ..
>> > filter.setAlwaysUseDefaultTargetUrl(alwaysUseDefaultTarget)
>> > 
>> >
>> > }
>> >
>> > Then in your configuration, you can contribute to to the defaults to
>> > provide
>> > your own value for the "spring-security.target.alwaysUseDefault". Would
>> > that
>> > work for you ? This certainly seems like a capability that would be
>> useful
>> > to be able to configure T-S-S with.
>> >
>> > Anyway, let me know if you want this, or if this was just an academic
>> > exercise on learning how to use T5 IOC - I can make the change in TSS in
>> > the
>> > next few days.
>> >
>> > Regards,
>> >
>> > Alex K
>> > On Tue, Jan 25, 2011 at 8:33 AM, Nicolas Barrera > > .com> wrote:
>> >
>> > > Hi Thiago,
>> > >
>> > > Ok, so as the 3rd party library's Service isn't implemented receiving
>> > some
>> > > Configuration, then I can't Contribute to it... and the only way would
>> be
>> > > to
>> > > override the service as a whole (reinstantiating it and setting it up
>> > all).
>> > > :(
>> > >
>> > > would it smell a lot if I ask tapestry for the instance of that
>> service
>> > in
>> > > some "startup" point of my AppModule and set that property to my
>> required
>> > > value?
>> > >
>> > > I 'm just trying not to reimplement the instantiation code of that
>> > service.
>> > >
>> > > thanks again,
>> > >
>> > > Nicolás.-
>> > >
>> > >
>> > > On Tue, Jan 25, 2011 at 10:26 AM, Thiago H. de Paula Figueiredo <
>> > > thiag...@gmail.com> wrote:
>> > >
>> > > > On Tue, 25 Jan 2011 11:24:00 -0200, Nicolas Barrera <
>> > nbarr...@gmail.com>
>> > > > wrote:
>> > > >
>> > > >  Concisely what I want is to get a Service from a 3rd party module
>> and
>> > > >> change one of it's properties, any ideas on the simplest way to do
>> it
>> > > >> without
>> > > >> instantiating the whole object again?
>> > > >>
>> > > >
>> > > > Tapestry-IoC doesn't provide any way of setting a service
>> > implementation
>> > > > property. It does provide a way for you to override services'
>> > > > configurations.
>> > > >
>> > > > --
>> > > > Thiago H. de Paula Figueiredo
>> > > > Independent Java, Apache Tapestry 5 and Hibernate consultant,
>> > developer,
>> > > > and instructor
>> > > > Owner, Ars Machina Tecnologia da Informação Ltda.
>> > > > http://www.arsmachina.com.br
>> > > >
>> > > >
>> > > >
>> -
>> > > > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
>> > > > For additional commands, e-mail: users-h...@tapestry.apache.org
>> > > >
>> > > >
>> > >
>> >
>>
>
>


Re: Question on Tapesry Services IoC

2011-01-25 Thread Alex Kotchnev
Nicolas,
   I might actually have a bit of time to implement this enhancement. It
should be an easy enhancement that should have zero impact on the current
users.

   I'll respond in this thread when the changes are in.

Regards,

Alex k

On Tue, Jan 25, 2011 at 9:16 AM, Nicolas Barrera  wrote:

> Alex,
>
> Yes, adding support to configure that property would be the cleanest
> solution of course :)
>
> thanks for your interest on supporting it.., I 'm currently facing this
> problem while developing a production application.. but as you read,
> there 're other workarounds so if you can't add this support I could deal
> with it and I 'm not in an hurry.
>
> If you add the enhancement then it's welcome, if you need me to file an
> issue just tell me.
>
> thanks again and thanks to all who 've answered this thread as I 've also
> learned quite a bit about IoC on T5 with your replies.
>
> cheers!
>
> Nicolás.-
>
>
> On Tue, Jan 25, 2011 at 10:45 AM, Alex Kotchnev 
> wrote:
>
> > Nicolas,
> >   it seems like the proper solution for your problem is to have an
> > enhancement to TSS to receive a value and use the value when configuring
> > the
> > service, e.g. :
> >
> > buildRealAuthenticationProcessingFilter(
> > @SpringSecurityServices
> > final AuthenticationManager manager, @SpringSecurityServices
> > final RememberMeServices rememberMeServices,
> > @Inject  @Value("${spring-security.check.url}" final String
> > authUrl,
> > @Inject @Value("${spring-security.target.url}")  final String
> > targetUrl,
> > @Inject @Value("${spring-security.failure.url}") final String
> > failureUrl,
> > @Inject @Value("${spring-security.target.alwaysUseDefault}")
> > final
> > Boolean alwaysUseDefaultTarget) {
> >
> > ..
> > filter.setAlwaysUseDefaultTargetUrl(alwaysUseDefaultTarget)
> > 
> >
> > }
> >
> > Then in your configuration, you can contribute to to the defaults to
> > provide
> > your own value for the "spring-security.target.alwaysUseDefault". Would
> > that
> > work for you ? This certainly seems like a capability that would be
> useful
> > to be able to configure T-S-S with.
> >
> > Anyway, let me know if you want this, or if this was just an academic
> > exercise on learning how to use T5 IOC - I can make the change in TSS in
> > the
> > next few days.
> >
> > Regards,
> >
> > Alex K
> > On Tue, Jan 25, 2011 at 8:33 AM, Nicolas Barrera  > .com> wrote:
> >
> > > Hi Thiago,
> > >
> > > Ok, so as the 3rd party library's Service isn't implemented receiving
> > some
> > > Configuration, then I can't Contribute to it... and the only way would
> be
> > > to
> > > override the service as a whole (reinstantiating it and setting it up
> > all).
> > > :(
> > >
> > > would it smell a lot if I ask tapestry for the instance of that service
> > in
> > > some "startup" point of my AppModule and set that property to my
> required
> > > value?
> > >
> > > I 'm just trying not to reimplement the instantiation code of that
> > service.
> > >
> > > thanks again,
> > >
> > > Nicolás.-
> > >
> > >
> > > On Tue, Jan 25, 2011 at 10:26 AM, Thiago H. de Paula Figueiredo <
> > > thiag...@gmail.com> wrote:
> > >
> > > > On Tue, 25 Jan 2011 11:24:00 -0200, Nicolas Barrera <
> > nbarr...@gmail.com>
> > > > wrote:
> > > >
> > > >  Concisely what I want is to get a Service from a 3rd party module
> and
> > > >> change one of it's properties, any ideas on the simplest way to do
> it
> > > >> without
> > > >> instantiating the whole object again?
> > > >>
> > > >
> > > > Tapestry-IoC doesn't provide any way of setting a service
> > implementation
> > > > property. It does provide a way for you to override services'
> > > > configurations.
> > > >
> > > > --
> > > > Thiago H. de Paula Figueiredo
> > > > Independent Java, Apache Tapestry 5 and Hibernate consultant,
> > developer,
> > > > and instructor
> > > > Owner, Ars Machina Tecnologia da Informação Ltda.
> > > > http://www.arsmachina.com.br
> > > >
> > > >
> > > > -
> > > > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> > > > For additional commands, e-mail: users-h...@tapestry.apache.org
> > > >
> > > >
> > >
> >
>


Re: Question on Tapesry Services IoC

2011-01-25 Thread Nicolas Barrera
Alex,

Yes, adding support to configure that property would be the cleanest
solution of course :)

thanks for your interest on supporting it.., I 'm currently facing this
problem while developing a production application.. but as you read,
there 're other workarounds so if you can't add this support I could deal
with it and I 'm not in an hurry.

If you add the enhancement then it's welcome, if you need me to file an
issue just tell me.

thanks again and thanks to all who 've answered this thread as I 've also
learned quite a bit about IoC on T5 with your replies.

cheers!

Nicolás.-


On Tue, Jan 25, 2011 at 10:45 AM, Alex Kotchnev  wrote:

> Nicolas,
>   it seems like the proper solution for your problem is to have an
> enhancement to TSS to receive a value and use the value when configuring
> the
> service, e.g. :
>
> buildRealAuthenticationProcessingFilter(
> @SpringSecurityServices
> final AuthenticationManager manager, @SpringSecurityServices
> final RememberMeServices rememberMeServices,
> @Inject  @Value("${spring-security.check.url}" final String
> authUrl,
> @Inject @Value("${spring-security.target.url}")  final String
> targetUrl,
> @Inject @Value("${spring-security.failure.url}") final String
> failureUrl,
> @Inject @Value("${spring-security.target.alwaysUseDefault}")
> final
> Boolean alwaysUseDefaultTarget) {
>
> ..
> filter.setAlwaysUseDefaultTargetUrl(alwaysUseDefaultTarget)
> 
>
> }
>
> Then in your configuration, you can contribute to to the defaults to
> provide
> your own value for the "spring-security.target.alwaysUseDefault". Would
> that
> work for you ? This certainly seems like a capability that would be useful
> to be able to configure T-S-S with.
>
> Anyway, let me know if you want this, or if this was just an academic
> exercise on learning how to use T5 IOC - I can make the change in TSS in
> the
> next few days.
>
> Regards,
>
> Alex K
> On Tue, Jan 25, 2011 at 8:33 AM, Nicolas Barrera  .com> wrote:
>
> > Hi Thiago,
> >
> > Ok, so as the 3rd party library's Service isn't implemented receiving
> some
> > Configuration, then I can't Contribute to it... and the only way would be
> > to
> > override the service as a whole (reinstantiating it and setting it up
> all).
> > :(
> >
> > would it smell a lot if I ask tapestry for the instance of that service
> in
> > some "startup" point of my AppModule and set that property to my required
> > value?
> >
> > I 'm just trying not to reimplement the instantiation code of that
> service.
> >
> > thanks again,
> >
> > Nicolás.-
> >
> >
> > On Tue, Jan 25, 2011 at 10:26 AM, Thiago H. de Paula Figueiredo <
> > thiag...@gmail.com> wrote:
> >
> > > On Tue, 25 Jan 2011 11:24:00 -0200, Nicolas Barrera <
> nbarr...@gmail.com>
> > > wrote:
> > >
> > >  Concisely what I want is to get a Service from a 3rd party module and
> > >> change one of it's properties, any ideas on the simplest way to do it
> > >> without
> > >> instantiating the whole object again?
> > >>
> > >
> > > Tapestry-IoC doesn't provide any way of setting a service
> implementation
> > > property. It does provide a way for you to override services'
> > > configurations.
> > >
> > > --
> > > Thiago H. de Paula Figueiredo
> > > Independent Java, Apache Tapestry 5 and Hibernate consultant,
> developer,
> > > and instructor
> > > Owner, Ars Machina Tecnologia da Informação Ltda.
> > > http://www.arsmachina.com.br
> > >
> > >
> > > -
> > > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> > > For additional commands, e-mail: users-h...@tapestry.apache.org
> > >
> > >
> >
>


Re: Question on Tapesry Services IoC

2011-01-25 Thread Nicolas Barrera
Thiago,


and the only way would be to override the service as a whole
>> (reinstantiating it and setting it up all). :(
>>
>
> You can decorate or advise it instead.
>

I thought that decorating and/or advising the service just to change a
property was a bit of over-design, but I guess it would work, sure.



 would it smell a lot if I ask tapestry for the instance of that service in
>> some "startup" point of my AppModule and set that property to my required
>> value?
>>
>
Tapestry-IoC doesn't provide any way to get the original, non-proxied
> service implementation.
> You can contribute a Runnable implementation to the RegistryStartup service
> to do anything you want just after the registry was started.
>

Thanks, I think that would be the place to put the property change on
startup.. didn't knew about that!
http://tapestry.apache.org/tapestry5/tapestry-ioc/startup.html



Nicolás.-


On Tue, Jan 25, 2011 at 10:44 AM, Thiago H. de Paula Figueiredo <
thiag...@gmail.com> wrote:

> On Tue, 25 Jan 2011 11:33:16 -0200, Nicolas Barrera 
> wrote:
>
>  Hi Thiago,
>>
>
> Hi, Nicolas!
>
>
>  Ok, so as the 3rd party library's Service isn't implemented receiving some
>> Configuration, then I can't Contribute to it...
>>
>
> Can't you ask the author to add this as a configuration?
>
>
>  and the only way would be to override the service as a whole
>> (reinstantiating it and setting it up all). :(
>>
>
> You can decorate or advise it instead.
>
>
>  would it smell a lot if I ask tapestry for the instance of that service in
>> some "startup" point of my AppModule and set that property to my required
>> value?
>>
>
> Tapestry-IoC doesn't provide any way to get the original, non-proxied
> service implementation.
> You can contribute a Runnable implementation to the RegistryStartup service
> to do anything you want just after the registry was started.
>
> --
> Thiago H. de Paula Figueiredo
> Consultor, desenvolvedor e instrutor em Java, Tapestry e Hibernate
> Coordenador e professor da Especialização em Engenharia de Software com
> Ênfase em Java da Faculdade Pitágoras
>
> http://www.arsmachina.com.br
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>


Re: Question on Tapesry Services IoC

2011-01-25 Thread Alex Kotchnev
Nicolas,
   it seems like the proper solution for your problem is to have an
enhancement to TSS to receive a value and use the value when configuring the
service, e.g. :

buildRealAuthenticationProcessingFilter(
 @SpringSecurityServices
 final AuthenticationManager manager, @SpringSecurityServices
 final RememberMeServices rememberMeServices,
 @Inject  @Value("${spring-security.check.url}" final String
authUrl,
 @Inject @Value("${spring-security.target.url}")  final String
targetUrl,
 @Inject @Value("${spring-security.failure.url}") final String
failureUrl,
 @Inject @Value("${spring-security.target.alwaysUseDefault}") final
Boolean alwaysUseDefaultTarget) {

 ..
 filter.setAlwaysUseDefaultTargetUrl(alwaysUseDefaultTarget)
 

}

Then in your configuration, you can contribute to to the defaults to provide
your own value for the "spring-security.target.alwaysUseDefault". Would that
work for you ? This certainly seems like a capability that would be useful
to be able to configure T-S-S with.

Anyway, let me know if you want this, or if this was just an academic
exercise on learning how to use T5 IOC - I can make the change in TSS in the
next few days.

Regards,

Alex K
On Tue, Jan 25, 2011 at 8:33 AM, Nicolas Barrera  wrote:

> Hi Thiago,
>
> Ok, so as the 3rd party library's Service isn't implemented receiving some
> Configuration, then I can't Contribute to it... and the only way would be
> to
> override the service as a whole (reinstantiating it and setting it up all).
> :(
>
> would it smell a lot if I ask tapestry for the instance of that service in
> some "startup" point of my AppModule and set that property to my required
> value?
>
> I 'm just trying not to reimplement the instantiation code of that service.
>
> thanks again,
>
> Nicolás.-
>
>
> On Tue, Jan 25, 2011 at 10:26 AM, Thiago H. de Paula Figueiredo <
> thiag...@gmail.com> wrote:
>
> > On Tue, 25 Jan 2011 11:24:00 -0200, Nicolas Barrera 
> > wrote:
> >
> >  Concisely what I want is to get a Service from a 3rd party module and
> >> change one of it's properties, any ideas on the simplest way to do it
> >> without
> >> instantiating the whole object again?
> >>
> >
> > Tapestry-IoC doesn't provide any way of setting a service implementation
> > property. It does provide a way for you to override services'
> > configurations.
> >
> > --
> > Thiago H. de Paula Figueiredo
> > Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,
> > and instructor
> > Owner, Ars Machina Tecnologia da Informação Ltda.
> > http://www.arsmachina.com.br
> >
> >
> > -
> > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> > For additional commands, e-mail: users-h...@tapestry.apache.org
> >
> >
>


Re: Question on Tapesry Services IoC

2011-01-25 Thread Thiago H. de Paula Figueiredo
On Tue, 25 Jan 2011 11:33:16 -0200, Nicolas Barrera   
wrote:



Hi Thiago,


Hi, Nicolas!

Ok, so as the 3rd party library's Service isn't implemented receiving  
some Configuration, then I can't Contribute to it...


Can't you ask the author to add this as a configuration?

and the only way would be to override the service as a whole  
(reinstantiating it and setting it up all). :(


You can decorate or advise it instead.

would it smell a lot if I ask tapestry for the instance of that service  
in some "startup" point of my AppModule and set that property to my  
required

value?


Tapestry-IoC doesn't provide any way to get the original, non-proxied  
service implementation.
You can contribute a Runnable implementation to the RegistryStartup  
service to do anything you want just after the registry was started.


--
Thiago H. de Paula Figueiredo
Consultor, desenvolvedor e instrutor em Java, Tapestry e Hibernate
Coordenador e professor da Especialização em Engenharia de Software com  
Ênfase em Java da Faculdade Pitágoras

http://www.arsmachina.com.br

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



Re: Question on Tapesry Services IoC

2011-01-25 Thread Nicolas Barrera
Hi Thiago,

Ok, so as the 3rd party library's Service isn't implemented receiving some
Configuration, then I can't Contribute to it... and the only way would be to
override the service as a whole (reinstantiating it and setting it up all).
:(

would it smell a lot if I ask tapestry for the instance of that service in
some "startup" point of my AppModule and set that property to my required
value?

I 'm just trying not to reimplement the instantiation code of that service.

thanks again,

Nicolás.-


On Tue, Jan 25, 2011 at 10:26 AM, Thiago H. de Paula Figueiredo <
thiag...@gmail.com> wrote:

> On Tue, 25 Jan 2011 11:24:00 -0200, Nicolas Barrera 
> wrote:
>
>  Concisely what I want is to get a Service from a 3rd party module and
>> change one of it's properties, any ideas on the simplest way to do it
>> without
>> instantiating the whole object again?
>>
>
> Tapestry-IoC doesn't provide any way of setting a service implementation
> property. It does provide a way for you to override services'
> configurations.
>
> --
> Thiago H. de Paula Figueiredo
> Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,
> and instructor
> Owner, Ars Machina Tecnologia da Informação Ltda.
> http://www.arsmachina.com.br
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>


Re: Question on Tapesry Services IoC

2011-01-25 Thread Thiago H. de Paula Figueiredo
On Tue, 25 Jan 2011 11:24:00 -0200, Nicolas Barrera   
wrote:


Concisely what I want is to get a Service from a 3rd party module and  
change one of it's properties, any ideas on the simplest way to do it  
without

instantiating the whole object again?


Tapestry-IoC doesn't provide any way of setting a service implementation  
property. It does provide a way for you to override services'  
configurations.


--
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,  
and instructor

Owner, Ars Machina Tecnologia da Informação Ltda.
http://www.arsmachina.com.br

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



Re: Question on Tapesry Services IoC

2011-01-25 Thread Nicolas Barrera
Thanks a lot Kristian,

for the archives t5 doc on ServiceOverride is currently here:

 http://tapestry.apache.org/ioc-cookbook-overriding-ioc-services.html


I 've read it and learned about overriding, but I think that although they
're useful to achieve what I need..., I think as if they were thought to
solve more complicated problems.

Concisely what I want is to get a Service from a 3rd party module and change
one of it's properties, any ideas on the simplest way to do it without
instantiating the whole object again?

Nicolás.-


On Tue, Jan 25, 2011 at 8:41 AM, Kristian Marinkovic <
kristian.marinko...@porscheinformatik.at> wrote:

> Hi Nicolas,
>
> you can't contribute if you only have a string or no parameter. it has to
> be either a map, a list or a collection.
>
> you can contribute a ServiceOverride to replace a service with another
> implementation (see documentation)
>
> g,
> kris
>
>
>
>
>
> Von:Nicolas Barrera 
> An:     Tapestry users 
> Datum:  21.01.2011 17:27
> Betreff:Re: Question on Tapesry Services IoC
>
>
>
> Thanks Kristian,
>
> first I want to ask a conceptual question:
>
> if a build method receives for example a String value not a map,... can I
> contribute to that build method using Configuration/OrderedConfiguration?
>
> what if the build method has no parameters?, is it possible to contribute?
>
>
> in practice...,
> now I 'm facing this problem:
>
> I need to override a property from the service
> AuthenticationProcessingFilter, (this is from tapestry-spring-security.. I
> can't modify that code):
>
> here's it's build method
>
>@Marker(SpringSecurityServices.class)
> > public static AuthenticationProcessingFilter
> > buildRealAuthenticationProcessingFilter(
> > @SpringSecurityServices
> > final AuthenticationManager manager, @SpringSecurityServices
> > final RememberMeServices rememberMeServices, @Inject
> > @Value("${spring-security.check.url}")
> > final String authUrl, @Inject
> > @Value("${spring-security.target.url}")
> > final String targetUrl, @Inject
> > @Value("${spring-security.failure.url}")
> > final String failureUrl) throws Exception {
> > AuthenticationProcessingFilter filter = new
> > AuthenticationProcessingFilter();
> > filter.setAuthenticationManager(manager);
> > filter.setAuthenticationFailureUrl(failureUrl);
> > filter.setDefaultTargetUrl(targetUrl);
> > filter.setFilterProcessesUrl(authUrl);
> > filter.setRememberMeServices(rememberMeServices);
> > filter.afterPropertiesSet();
> > return filter;
> > }
> >
> What I 'd like to do is to have something like filter.set
> AlwaysUseDefaultTargetUrl(true) in my own AppModule as a contribution
>
>
> Here, for example is another build method from the same library module,
> which uses that object:
>
>@Marker(SpringSecurityServices.class)
> > public static HttpServletRequestFilter
> > buildAuthenticationProcessingFilter(
> > final AuthenticationProcessingFilter filter) throws
> Exception {
> > return new HttpServletRequestFilterWrapper(filter);
> > }
> >
>
>
> I 'd need some advice on how to "contribute" and set that property to the
> required value in my AppModule, I guess that in the
> tapestry-spring-security
> site they say something about overriding values using contributeAlias, but
> as I 'ver read that this type of contribution is going to be deprecated on
> 5.3 I didn't try that way yet.
>
> hope I was clear,
>
> thanks as usual...
>
> Nicolás.-
>
>
> On Thu, Jan 20, 2011 at 9:01 AM, Kristian Marinkovic <
> kristian.marinko...@porscheinformatik.at> wrote:
>
> > hi nicloas,
> >
> > you could use a builder method to decouple tapestry ioc from 3rd party
> > libraries/constructors
> >
> > public SomethingManager buildSomethinManager(Map<> map, ...)
> > {
> > return new SomethingManger(map, ... );
> > }
> >
> > public void contributeSomethingManager(MappedConfiguration<> map)
> > {}
> >
> > g,
> > kris
> >
> >
> > Von:Nicolas Barrera 
> > An: Tapestry users 
> > Datum:  20.01.2011 12:55
> > Betreff:Re: Question on Tapesry Services IoC
> >
> >
> >
> > Thanks Josh,
> >
> > sorry for my verbosity
> >
> > 

Re: Question on Tapesry Services IoC

2011-01-25 Thread Kristian Marinkovic
Hi Nicolas,

you can't contribute if you only have a string or no parameter. it has to 
be either a map, a list or a collection. 

you can contribute a ServiceOverride to replace a service with another 
implementation (see documentation)

g,
kris





Von:Nicolas Barrera 
An: Tapestry users 
Datum:  21.01.2011 17:27
Betreff:        Re: Question on Tapesry Services IoC



Thanks Kristian,

first I want to ask a conceptual question:

if a build method receives for example a String value not a map,... can I
contribute to that build method using Configuration/OrderedConfiguration?

what if the build method has no parameters?, is it possible to contribute?


in practice...,
now I 'm facing this problem:

I need to override a property from the service
AuthenticationProcessingFilter, (this is from tapestry-spring-security.. I
can't modify that code):

here's it's build method

@Marker(SpringSecurityServices.class)
> public static AuthenticationProcessingFilter
> buildRealAuthenticationProcessingFilter(
> @SpringSecurityServices
> final AuthenticationManager manager, @SpringSecurityServices
> final RememberMeServices rememberMeServices, @Inject
> @Value("${spring-security.check.url}")
> final String authUrl, @Inject
> @Value("${spring-security.target.url}")
> final String targetUrl, @Inject
> @Value("${spring-security.failure.url}")
> final String failureUrl) throws Exception {
> AuthenticationProcessingFilter filter = new
> AuthenticationProcessingFilter();
> filter.setAuthenticationManager(manager);
> filter.setAuthenticationFailureUrl(failureUrl);
> filter.setDefaultTargetUrl(targetUrl);
> filter.setFilterProcessesUrl(authUrl);
> filter.setRememberMeServices(rememberMeServices);
> filter.afterPropertiesSet();
> return filter;
> }
>
What I 'd like to do is to have something like filter.set
AlwaysUseDefaultTargetUrl(true) in my own AppModule as a contribution


Here, for example is another build method from the same library module,
which uses that object:

@Marker(SpringSecurityServices.class)
> public static HttpServletRequestFilter
> buildAuthenticationProcessingFilter(
> final AuthenticationProcessingFilter filter) throws 
Exception {
> return new HttpServletRequestFilterWrapper(filter);
> }
>


I 'd need some advice on how to "contribute" and set that property to the
required value in my AppModule, I guess that in the 
tapestry-spring-security
site they say something about overriding values using contributeAlias, but
as I 'ver read that this type of contribution is going to be deprecated on
5.3 I didn't try that way yet.

hope I was clear,

thanks as usual...

Nicolás.-


On Thu, Jan 20, 2011 at 9:01 AM, Kristian Marinkovic <
kristian.marinko...@porscheinformatik.at> wrote:

> hi nicloas,
>
> you could use a builder method to decouple tapestry ioc from 3rd party
> libraries/constructors
>
> public SomethingManager buildSomethinManager(Map<> map, ...)
> {
> return new SomethingManger(map, ... );
> }
>
> public void contributeSomethingManager(MappedConfiguration<> map)
> {}
>
> g,
> kris
>
>
> Von:Nicolas Barrera 
> An: Tapestry users 
> Datum:  20.01.2011 12:55
> Betreff:Re: Question on Tapesry Services IoC
>
>
>
> Thanks Josh,
>
> sorry for my verbosity
>
> So in order to use contributions to a Service (SomethingManager) through 
a
> MappedConfiguration,
>
> this SomethingManager should have a constructor that receives the
> corresponding Map, and tapestry will inject the contributed
> MappedConfiguration into it?
>
> ok i got it..., tomorrow  I m going to test it on code.., the thing is
> that
> in my case SomethingManager is a 3rd party class
> (tapestry-spring-security)
> but i think i can handle it with this information.
>
> thanks for the concept.
>
> Do you know why will Alias Contributions be deprecated? I guess that 
what
> you explained me will be the defacto way of contributing and overriding
> contributions?
>
> thanks again and cheers
>
> Nicolás.-
>
>
> On Wed, Jan 19, 2011 at 8:04 PM, Josh Canfield
> wrote:
>
> > You had me all the way up until you started talking about what you
> > wanted to do. Here is a short primer:
> >
> > You have a service that manages a collection of Something:
> >
> > private Map allMyConfiguredSomethings;
> >
> > // I get my Somethings in the constructor
> > public SomeThingManagerImpl(Map somethingMap) {
> >this.allMy

Re: Question on Tapesry Services IoC

2011-01-21 Thread Nicolas Barrera
Thanks Kristian,

first I want to ask a conceptual question:

if a build method receives for example a String value not a map,... can I
contribute to that build method using Configuration/OrderedConfiguration?

what if the build method has no parameters?, is it possible to contribute?


in practice...,
now I 'm facing this problem:

I need to override a property from the service
AuthenticationProcessingFilter, (this is from tapestry-spring-security.. I
can't modify that code):

here's it's build method

@Marker(SpringSecurityServices.class)
> public static AuthenticationProcessingFilter
> buildRealAuthenticationProcessingFilter(
> @SpringSecurityServices
> final AuthenticationManager manager, @SpringSecurityServices
> final RememberMeServices rememberMeServices, @Inject
> @Value("${spring-security.check.url}")
> final String authUrl, @Inject
> @Value("${spring-security.target.url}")
> final String targetUrl, @Inject
> @Value("${spring-security.failure.url}")
> final String failureUrl) throws Exception {
> AuthenticationProcessingFilter filter = new
> AuthenticationProcessingFilter();
> filter.setAuthenticationManager(manager);
> filter.setAuthenticationFailureUrl(failureUrl);
> filter.setDefaultTargetUrl(targetUrl);
> filter.setFilterProcessesUrl(authUrl);
> filter.setRememberMeServices(rememberMeServices);
> filter.afterPropertiesSet();
> return filter;
> }
>
What I 'd like to do is to have something like filter.set
AlwaysUseDefaultTargetUrl(true) in my own AppModule as a contribution


Here, for example is another build method from the same library module,
which uses that object:

@Marker(SpringSecurityServices.class)
> public static HttpServletRequestFilter
> buildAuthenticationProcessingFilter(
> final AuthenticationProcessingFilter filter) throws Exception {
> return new HttpServletRequestFilterWrapper(filter);
> }
>


I 'd need some advice on how to "contribute" and set that property to the
required value in my AppModule, I guess that in the tapestry-spring-security
site they say something about overriding values using contributeAlias, but
as I 'ver read that this type of contribution is going to be deprecated on
5.3 I didn't try that way yet.

hope I was clear,

thanks as usual...

Nicolás.-


On Thu, Jan 20, 2011 at 9:01 AM, Kristian Marinkovic <
kristian.marinko...@porscheinformatik.at> wrote:

> hi nicloas,
>
> you could use a builder method to decouple tapestry ioc from 3rd party
> libraries/constructors
>
> public SomethingManager buildSomethinManager(Map<> map, ...)
> {
> return new SomethingManger(map, ... );
> }
>
> public void contributeSomethingManager(MappedConfiguration<> map)
> {}
>
> g,
> kris
>
>
> Von:Nicolas Barrera 
> An: Tapestry users 
> Datum:  20.01.2011 12:55
> Betreff:Re: Question on Tapesry Services IoC
>
>
>
> Thanks Josh,
>
> sorry for my verbosity
>
> So in order to use contributions to a Service (SomethingManager) through a
> MappedConfiguration,
>
> this SomethingManager should have a constructor that receives the
> corresponding Map, and tapestry will inject the contributed
> MappedConfiguration into it?
>
> ok i got it..., tomorrow  I m going to test it on code.., the thing is
> that
> in my case SomethingManager is a 3rd party class
> (tapestry-spring-security)
> but i think i can handle it with this information.
>
> thanks for the concept.
>
> Do you know why will Alias Contributions be deprecated? I guess that what
> you explained me will be the defacto way of contributing and overriding
> contributions?
>
> thanks again and cheers
>
> Nicolás.-
>
>
> On Wed, Jan 19, 2011 at 8:04 PM, Josh Canfield
> wrote:
>
> > You had me all the way up until you started talking about what you
> > wanted to do. Here is a short primer:
> >
> > You have a service that manages a collection of Something:
> >
> > private Map allMyConfiguredSomethings;
> >
> > // I get my Somethings in the constructor
> > public SomeThingManagerImpl(Map somethingMap) {
> >this.allMyConfiguredSomethings = somethingMap;
> > }
> >
> > // In your app module you tell tapestry about your SomethingManager
> > service.
> >
> >  public static void bind(ServiceBinder binder) {
> >binder.bind(SomethingManager.class, SomethingManagerImpl.class);
> >  }
> >
> > // and  tell the something manager which somethings 

Re: Question on Tapesry Services IoC

2011-01-20 Thread Kristian Marinkovic
hi nicloas,

you could use a builder method to decouple tapestry ioc from 3rd party 
libraries/constructors

public SomethingManager buildSomethinManager(Map<> map, ...)
{
 return new SomethingManger(map, ... );
}

public void contributeSomethingManager(MappedConfiguration<> map)
{}

g,
kris


Von:Nicolas Barrera 
An: Tapestry users 
Datum:  20.01.2011 12:55
Betreff:Re: Question on Tapesry Services IoC



Thanks Josh,

sorry for my verbosity

So in order to use contributions to a Service (SomethingManager) through a
MappedConfiguration,

this SomethingManager should have a constructor that receives the
corresponding Map, and tapestry will inject the contributed
MappedConfiguration into it?

ok i got it..., tomorrow  I m going to test it on code.., the thing is 
that
in my case SomethingManager is a 3rd party class 
(tapestry-spring-security)
but i think i can handle it with this information.

thanks for the concept.

Do you know why will Alias Contributions be deprecated? I guess that what
you explained me will be the defacto way of contributing and overriding
contributions?

thanks again and cheers

Nicolás.-


On Wed, Jan 19, 2011 at 8:04 PM, Josh Canfield 
wrote:

> You had me all the way up until you started talking about what you
> wanted to do. Here is a short primer:
>
> You have a service that manages a collection of Something:
>
> private Map allMyConfiguredSomethings;
>
> // I get my Somethings in the constructor
> public SomeThingManagerImpl(Map somethingMap) {
>this.allMyConfiguredSomethings = somethingMap;
> }
>
> // In your app module you tell tapestry about your SomethingManager
> service.
>
>  public static void bind(ServiceBinder binder) {
>binder.bind(SomethingManager.class, SomethingManagerImpl.class);
>  }
>
> // and  tell the something manager which somethings it's going to manage
>
> public static void
> contributeSomethingManager(MappendConfiguration
> configuration) {
>  // put items in that eventually end up in SomethingManager
> }
>
> MappedConfiguration has an override method which you can use to set a
> value on top of another from within your contribute method.
>
> Josh
>
> On Wed, Jan 19, 2011 at 12:09 PM, Nicolas Barrera 
> wrote:
> > Hi,
> >
> > I 'm trying to understand how does Tapestry IoC works.., I 'm 
currently
> > reading the new docs and I 'm also putting my hands on an example I 
got
> on a
> > working application.
> >
> > What I can't understand yet is how does contribution works,
> >
> > I got that you can define a Service like:
> >
> > public static SaltSourceService buildXxx(...) {
> >>
> >
> > and that you can configure Xxx's dependencies contributing with:
> >
> > public static void contributeXxx(final MappedConfiguration String>
> >> configuration) {
> >>
> >
> > where you add entries to the parameter received map, but... in the
> example I
> > 'm looking at, I only see values being put in the map but never
> retrieved,
> >
> > would I be looking at an incomplete example or there's some tapestry
> magic
> > over this?
> >
> >
> > The example I mention is an application which uses
> tapestry-spring-security
> > and I want to override a property value from a service,
> > I want to set service AuthenticationProcessingFilter's property
> > alwaysUseDefaultTargetUrl to true in my AppModule.
> >
> > hope someone throws some light on this one as it usually happens here 
in
> the
> > ml :)
> >
> > cheers,
> > Nicolás.-
> >
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>



Re: Question on Tapesry Services IoC

2011-01-20 Thread Nicolas Barrera
Thanks Josh,

sorry for my verbosity

So in order to use contributions to a Service (SomethingManager) through a
MappedConfiguration,

this SomethingManager should have a constructor that receives the
corresponding Map, and tapestry will inject the contributed
MappedConfiguration into it?

ok i got it..., tomorrow  I m going to test it on code.., the thing is that
in my case SomethingManager is a 3rd party class (tapestry-spring-security)
but i think i can handle it with this information.

thanks for the concept.

Do you know why will Alias Contributions be deprecated? I guess that what
you explained me will be the defacto way of contributing and overriding
contributions?

thanks again and cheers

Nicolás.-


On Wed, Jan 19, 2011 at 8:04 PM, Josh Canfield wrote:

> You had me all the way up until you started talking about what you
> wanted to do. Here is a short primer:
>
> You have a service that manages a collection of Something:
>
> private Map allMyConfiguredSomethings;
>
> // I get my Somethings in the constructor
> public SomeThingManagerImpl(Map somethingMap) {
>this.allMyConfiguredSomethings = somethingMap;
> }
>
> // In your app module you tell tapestry about your SomethingManager
> service.
>
>  public static void bind(ServiceBinder binder) {
>binder.bind(SomethingManager.class, SomethingManagerImpl.class);
>  }
>
> // and  tell the something manager which somethings it's going to manage
>
> public static void
> contributeSomethingManager(MappendConfiguration
> configuration) {
>  // put items in that eventually end up in SomethingManager
> }
>
> MappedConfiguration has an override method which you can use to set a
> value on top of another from within your contribute method.
>
> Josh
>
> On Wed, Jan 19, 2011 at 12:09 PM, Nicolas Barrera 
> wrote:
> > Hi,
> >
> > I 'm trying to understand how does Tapestry IoC works.., I 'm currently
> > reading the new docs and I 'm also putting my hands on an example I got
> on a
> > working application.
> >
> > What I can't understand yet is how does contribution works,
> >
> > I got that you can define a Service like:
> >
> > public static SaltSourceService buildXxx(...) {
> >>
> >
> > and that you can configure Xxx's dependencies contributing with:
> >
> > public static void contributeXxx(final MappedConfiguration String>
> >> configuration) {
> >>
> >
> > where you add entries to the parameter received map, but... in the
> example I
> > 'm looking at, I only see values being put in the map but never
> retrieved,
> >
> > would I be looking at an incomplete example or there's some tapestry
> magic
> > over this?
> >
> >
> > The example I mention is an application which uses
> tapestry-spring-security
> > and I want to override a property value from a service,
> > I want to set service AuthenticationProcessingFilter's property
> > alwaysUseDefaultTargetUrl to true in my AppModule.
> >
> > hope someone throws some light on this one as it usually happens here in
> the
> > ml :)
> >
> > cheers,
> > Nicolás.-
> >
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>


Re: Question on Tapesry Services IoC

2011-01-19 Thread Josh Canfield
You had me all the way up until you started talking about what you
wanted to do. Here is a short primer:

You have a service that manages a collection of Something:

private Map allMyConfiguredSomethings;

// I get my Somethings in the constructor
public SomeThingManagerImpl(Map somethingMap) {
this.allMyConfiguredSomethings = somethingMap;
}

// In your app module you tell tapestry about your SomethingManager service.

 public static void bind(ServiceBinder binder) {
binder.bind(SomethingManager.class, SomethingManagerImpl.class);
 }

// and  tell the something manager which somethings it's going to manage

public static void
contributeSomethingManager(MappendConfiguration
configuration) {
  // put items in that eventually end up in SomethingManager
}

MappedConfiguration has an override method which you can use to set a
value on top of another from within your contribute method.

Josh

On Wed, Jan 19, 2011 at 12:09 PM, Nicolas Barrera  wrote:
> Hi,
>
> I 'm trying to understand how does Tapestry IoC works.., I 'm currently
> reading the new docs and I 'm also putting my hands on an example I got on a
> working application.
>
> What I can't understand yet is how does contribution works,
>
> I got that you can define a Service like:
>
> public static SaltSourceService buildXxx(...) {
>>
>
> and that you can configure Xxx's dependencies contributing with:
>
> public static void contributeXxx(final MappedConfiguration
>> configuration) {
>>
>
> where you add entries to the parameter received map, but... in the example I
> 'm looking at, I only see values being put in the map but never retrieved,
>
> would I be looking at an incomplete example or there's some tapestry magic
> over this?
>
>
> The example I mention is an application which uses tapestry-spring-security
> and I want to override a property value from a service,
> I want to set service AuthenticationProcessingFilter's property
> alwaysUseDefaultTargetUrl to true in my AppModule.
>
> hope someone throws some light on this one as it usually happens here in the
> ml :)
>
> cheers,
> Nicolás.-
>

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