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<String, Something> allMyConfiguredSomethings;

// I get my Somethings in the constructor
public SomeThingManagerImpl(Map<String, Something> 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<String, Something>
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 <nbarr...@gmail.com> 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, 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

Reply via email to