cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christian Haul <h...@dvs1.informatik.tu-darmstadt.de>
Subject Re: [VOTE] Input module chaining (Re: XML input module)
Date Tue, 08 Oct 2002 07:38:14 GMT
On 08.Oct.2002 -- 08:13 AM, Carsten Ziegeler wrote:
> Christian Haul wrote:
> > 
> > On 04.Oct.2002 -- 11:07 AM, Christian Haul wrote:
> > > On 02.Oct.2002 -- 06:38 PM, Stefano Mazzocchi wrote:
> >
> > > a) if JXPath should be 
> > > a1) a meta module or 
> > +0
> > > a2) property of specific modules.
> > +1
> >
> Sorry, I'm a little bit lost here. Can someone give an explanaition
> or pointer to some use cases or examples for meta modules?

Please see original thread for arguments in detail
http://marc.theaimsgroup.com/?l=forrest-dev&m=103338039706391&w=2
and
http://marc.theaimsgroup.com/?l=xml-cocoon-dev&m=103354978904793&w=2

In the sources you'll find for example a DefaultsMetaModule which does
a simplified chaining (more below) or a DigestMetaModule that does a
secure hash on a value obtained from another module. There is a
CollectionMetaModule that reads parameters and creates a collection
suitable to insert into a object-relational database. ...

request object -> request-param -> collection -> DatabaseAction

     source        InputModule     InputModule      destination
                                     "Meta"

> As far as I understand InputModules, the meaning of the "key" 
> to lookup a values is property of the module, so this can either
> be a path or a single value or whatever.
> 
> > > b) how chaining should be done
> > > b1) as property of individual modules (i.e. through inheritance)
> > -1 (modules may do so)
> > > b2) as meta module (i.e. through composition)
> > +1 (preferred method)
> > 
> I need some examples for chaining here .

See above for an example.

Another, prominent one, is the case where a value is not present and
another value should be used. This is what the original discussion was
mostly about.

Say, you provide different skins (cascading stylesheets for
example). One could provide a default one, the user could have set one
in his / her session or may try a new one, indicated through a request
parameter. In addition, some operations require the design to switch
to yet another skin, based upon the outcome of a action.

So, you want to use 
  1) request attribute
  2) request parameter
  3) session attribute
  4) default value
in this priority order. The first one found should be taken.

The DefaultsMetaModule does a little bit of that. Only that it allows
to use only one source and a default value.

	Chris.
-- 
C h r i s t i a n       H a u l
haul@informatik.tu-darmstadt.de
    fingerprint: 99B0 1D9D 7919 644A 4837  7D73 FEF9 6856 335A 9E08

---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org


Mime
View raw message