Hi,

I'd also be interested how this works exactly.

I don't think the components get scoped by module in the way you want.

It seems the components are scoped by group (main, sub app, etc...)

It seems to me the modules just load in order, and can overwrite previously 
loaded module's component definitions if they redefine the same types. The 
final config created after all modules load is the one that is then used by the 
whole system.

So to override a definition, it should be enough to make sure the module that 
contains the new def loads after the one with the old def, for example by 
configuring the old def's module as a dependency in the new def's module.

However, in the code, ComponentProvider instances are initialized with slightly 
tweaked configurations in different situations, like for apps and sub apps... 
So using these providers could yield different results.

Maybe someone at magnolia Inc. can elucidate this a bit more clearly...

Regards from Vienna,

Richard

(iPhone)

> On 28.02.2014, at 16:46, "Benoit Olbrechts (via Magnolia Forums)" 
> <[email protected]> wrote:
> 
> Hello,
> 
> I am using magnolia 4.5.15.
> 
> I have a webapp which has 2 modules as dependencies. Let's call them depA and 
> depB.
> 
> Let's say that In the depA I would like to override the default behaviour of 
> the ETKLinkTransformerManager from magnolia by using the following component 
> definition:
>    <components>
>        <id>main</id>
>                ...
>        <component>
>            
> <type>info.magnolia.module.extendedtemplatingkit.ETKLinkTransformerManager</type>
>            
> <implementation>com.example.depA.CustomLinkTransformerManager</implementation>
>        </component>
>                ...
>        </components>
> 
> In depB I have no specific definition for this component and I would like to 
> avoid to re-specify the default ETKLinkTransformerManager in this depB module.
> 
> Now the concern is:
>    - In depA, if I define a constructor with @Inject and 
> ETKLinkTransformerManager as parameter I receive the 
> CustomLinkTransformerManager which is normal.
> BUT
>    - In depB, if I define a constructor with @Inject and 
> ETKLinkTransformerManager as parameter I also receive the 
> CustomLinkTransformerManager which I would like to avoid.
> 
> 
> How can I have components definition only available in the scope of the 
> module in which it was defined!?
> I might be wrong with that way to implement such behaviour but then please 
> indicate me the best pratice to do that!
> 
> Thanks a lot,
> 
> B.
> 
> -- 
> Context is everything: 
> http://forum.magnolia-cms.com/forum/thread.html?threadId=9e3dd8a9-c3e2-48fb-b0a6-35b3e2539ab8
> 
> 
> ----------------------------------------------------------------
> For list details, see http://www.magnolia-cms.com/community/mailing-lists.html
> Alternatively, use our forums: http://forum.magnolia-cms.com/
> To unsubscribe, E-mail to: <[email protected]>
> ----------------------------------------------------------------
> 


----------------------------------------------------------------
For list details, see http://www.magnolia-cms.com/community/mailing-lists.html
Alternatively, use our forums: http://forum.magnolia-cms.com/
To unsubscribe, E-mail to: <[email protected]>
----------------------------------------------------------------

Reply via email to