cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Giacomo Pati <Giacomo.P...@pwr.ch>
Subject Sitemap class generation
Date Fri, 07 Jul 2000 19:46:46 GMT
Hi all

I want to show the layout of the currently generated sitemap class for
discussion.

Some notes: a Pipeline in the context below is a object which holds a
generator, maybe several transformers and a serializer. This object has
a process method to produce the resource requested.


  class GeneratedSitemap {

    for each sitemap-component {
      define a variable to hold a reference to the sitemap-component
object
    }

    for each <mount> tag {
      define a variable to hold a reference to the sub-sitemap object
    }

    method setConfiguration (from interface Configurable) {
      for each sitemap-component {
        collect configuration tags to build a Configuration object for
the component
        store an instance of the component into the variable generated
above
        provide the Configuration at the setConfiguration method of the
component 
      }

      for each <mount> tag {
        store an instance of the sub-sitemap object into the variable
generated above
        provide the Configuration at the setConfiguration method of the
sub-sitemap 
      }
    }

    for each <resource> tag {
      define a method with the process signature from interface
Processor {
        generate code to build a Pipeline which represents this resource
        [see the process method how such code is generated
      }
    }

    process method (from interface Processor) {
      for each <pipeline> tag {
        try {
          generate the code to build a Pipeline object 
            [This is straight forward code generation using <match> and
<choose> to
            [build if-else trees. The returned Maps of the matchers will
be pushed onto a Stack
            [and a resolver method uses this Stack of Maps to resolve
URIs that contains xpath
            [references.
            [At a <serializer> tag we should have a complete Pipeline
object constructed 
            [which can be processed and control can be returned.
            [At a <mount> tag processing is delegate to the sub sitemap.
            [At a <redirect-to> with a uri attribute the uri of the
request is modified and 
            [the this process method is called again
            [At a <redirect-to> with a resource attribute the
corresponding method generated above
            [is called
            [At a <read> tag a utility method is called to produce the
resource requested
            [without processing a Pipeline
        } catch {
          build a Pipeline object from the <handle-errors> fragment
            [this uses a special generator which produces SAX from a
Exception
        }
      }        
    }
  }

I still have no idea (or not reflected sufficently) how views and labels
can be incorporated into this class. I hope someone can help me here.

Any comments and suggestions as very welcome.

Giacomo

-- 
PWR GmbH, Organisation & Entwicklung      Tel:   +41 (0)1 856 2202
Giacomo Pati, CTO/CEO                     Fax:   +41 (0)1 856 2201
Hintereichenstrasse 7                     Mailto:Giacomo.Pati@pwr.ch
CH-8166 Niederweningen                    Web:   http://www.pwr.ch

Mime
View raw message