cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Unico Hommes" <Un...@hippo.nl>
Subject RE: Migrating TreeProcessor to Fortress
Date Tue, 11 Nov 2003 11:33:05 GMT
 

> 
> -----Original Message-----
> From: Joerg Heinicke [mailto:jheinicke@virbus.de] 
> Sent: dinsdag 11 november 2003 0:30
> To: dev@cocoon.apache.org
> 
> On 10.11.2003 21:27, Unico Hommes wrote:
> 
> > * sitemap-container.xconf:
> > 
> > <fortress>
> > 
> >  <pipeline id="p1">
> >   <match id-ref="p1-m1" />
> >   <match id-ref="p1-m2" />
> >  </pipeline>
> > 
> >  <match id="p1-m1">
> >   <call id-ref="p1-m1-c1" />
> >  </match>
> > 
> >  <match id="p1-m2">
> >   <call id-ref="p1-m2-c1" />
> >  </match>
> > 
> >  <call-function id="p1-m1-c1" function="..." />
> > 
> >  <call-resource id="p1-m2-c1" resource="..." />
> > 
> > </fortress>
> 
> Doesn't this id/idref handling fail, if a component is 
> declared only in the parent sitemap and inherited? At least 
> from an XML POV.
> 

Do you mean:

parent.xmap:
<sitemap>
  <components>
    <generators default="file">
      <generator name="file" src="..." />
    </generators>
  </components>
</sitemap>

child.xmap:
<sitemap>
  <pipelines>
    <pipeline>
      <match pattern="..">
        <generate type="file" src=".." />
        <serialize />
      </match>
    </pipeline>
  <pipelines>
</sitemap>

?

No this is not a problem because the ServiceManager of the parent
processor acts as the parent to the ServiceManager of the child
processor. The match node will ask the child ServiceManager for the file
generator, and if the child ServiceManager doesn't find it among its own
components it asks the parent ServiceManager for it. This is also how it
is handled today.

The sitemap components will actually be handled a little different from
the pipeline nodes. The above parent.xmap translated into a fortress
configuration will look like:

parent.xconf:
<fortress>
  <generator id="file-generator" src="..." />
</fortress>

And the child.xmap looks like:

child.xconf:
<fortress>
  ...
  <match id="p1-m1">
   <generate id-ref="p1-m1-g" />
  </match>

  <!-- this is the generate node.
       It looks up its Generator
       on the service manager using 
       key "org.apache.cocoon.generation.Generator/file-generator"
   -->  
  <generate id="p1-m1-g" type="file-generator" />

</fortress>

At first I thought you were asking how mount nodes would be handled.
This is not a problem either because the mount node does not need to be
configured with an id to a node in the subsitemap. Its 'src' attribute
identifies the subprocessor and that's all that is needed.


Regards, Unico

Mime
View raw message