Carsten Ziegeler wrote:
> 
> Unico Hommes wrote:
> >
> > Moving this discussion over to [EMAIL PROTECTED]
> >
> +1
> 
> > > > I had a hunch you were doing that ;-) I have been 
> thinking about a 
> > > > more IoC like solution for this. In order to do this a the 
> > > > component-configurations section of a sitemap could be 
> transformed 
> > > > into component declarations:
> > > >
> > > > <component-configurations>
> > > >   <global-variables>
> > > >     <var1/>
> > > >   </global-variables>
> > > > </component-configurations>
> > > >
> > > >  sitemap2xconf.xsl
> > > >  --->
> > > >
> > > > <global-variables id="global-sitemap-variables">
> > > >   <var1/>
> > > > </global-variables>
> > > >
> > > > This would tell the sitemap container to add that component.
> > > >
> > > > Granted it is a little bit different than 
> SitemapConfigurable, but 
> > > > perhaps it covers the same ground? Advantages are that you
> > > no longer
> > > > have the SitemapConfigureble lifecycle, thus that any 
> configurable 
> > > > component can be configured local to the current sitemap.
> > > >
> > > > WDYT?
> > > I think, this doesn't work :) (but perhaps I'm wrong). 
> The problem 
> > > lies in the container hierarchy. The global input module, that is 
> > > using the global-variables componnent is configured in the root 
> > > container.
> > > So, a lookup from the global input module will never look up the 
> > > correct version from a (sub) sitemap.
> > >
> > > So, the trick (in Cocoon 2.1) is, to have 
> SitemapConfigurable that 
> > > is able at runtime, to get the correct configuration of 
> the current 
> > > sitemap while the sitemap.variables component is a singleton.
> > >
> >
> > How about not using SitemapVariableHolder component anymore 
> but instead
> > make GlobalInputModule configurable?
> >
> Yes, that would do the trick - nearly :)
> 
> But there are some problems:
> 1) Compatibility. We have SitemapConfigurable in 2.1 and I 
> would really like
>    to be compatible in this area.

OK, agreed. We need support for it in 2.2.

> 2) The identifier for the component used in the sitemap is currently
>    "global-variables", the name of the input module is "global".
>    Regardless which of the two you change, you end up in an 
> incompatibility
>    again, I think.
> 

Do you think cocoon.xconf in 2.2 should be compatible with 2.1?

For instance input modules are now declared in cocoon.xconf version 2.1
as follows:

<input-modules>
  <component-instance name="global" src=".." />

In cocoon.xconf I have been using:

<global-input id="global" />

instead.

Btw. the name of the global input module in cocoon.xconf ("global")
refers to its id (hint) not the shorthand you use to declare the
component. Right?

Anyway, I think it should be possible to have more than one shorthand
for a given component by declaring a role mapping in cocoon.roles for
it. That way both <global-variables> and <global-input> can be used to
declare the input module.

Unico

Reply via email to