cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stephan Michels <>
Subject Re: [RT]: Dynamic variables in the Sitemap / Input Modules revisited
Date Thu, 09 Jan 2003 11:23:42 GMT

On Thu, 9 Jan 2003, Christian Haul wrote:

> On 09.Jan.2003 -- 11:24 AM, Stephan Michels wrote:
> >
> >
> > > First, of course, we want a dynamic substitution mechanism in the
> > > sitemap that we can use nearly everywhere. This mechanism uses
> > > different objects to resolve the dynamic values. An object is
> > > represented by a distinct name and gets an identifier for the
> > > actual value. We agree, that the syntax for using this is:
> > >
> > >      {object_identifier:key}
> > >
> > > An example is {request-param:myparameter}.
> >
> > One question, should these 'Dynamic variables' only be accessible
> > in the sitemap? Or will be there a 'Dynamic variables'Transformer,
> > or something more universal?
> There is a transformer pending
> with a detailed description how forrest uses it
> Also, ther is another transformer for simple HTML forms using this
> technique. In addition, there is a logicsheet as well (input.xsl,
> broken in 2.0.4, fixed in CVS), a matcher and most notably the
> database actions from the modular package.

Thank you for the hint.

>From Bugzilla:
> While the transformer I've implemented happens to rewrite links, this
> transformer could be generalized to transform any part of the incoming
> XML. For
> example, we could rewrite any occurrence of ${scheme:address} in the
> source XML.

This could be very useful. I have the following problem, because of
the depending of the DirectoryGenerator to, I have written
an equivalent, which used TraversableSource IF, the
SourceDescriptionGenerator. Then I saw the inherited Generator classes
like ImageDirectoryGenertor or MP3DirectoryGenerator etc. So my conclusion
was to find something more universal, which

1) Get the source
2) Retrieve a source depended property, like image height and width
3) Make a XML description

As result I got a SourceInspector.

And on the other hand I have Sources, which got common properties, and
I created a InspectableSource.

Now, to come to the 'Dynamic variables' discussion I want to merge
these concept with the modules. For the first case, I thought about
something like this

1) <map:generator type="directory" src="dir/"/>
2) <map:transformer src="getImageProbs.xsl"/>
3) <map:transformer type="module"/>

to 1)
<source name="dir" collection="true">
 <source name="file.xml"/>
 <source name="file.jpg"/>

to 2)
<source name="dir" collection="true">
 <source name="file.xml"/>
 <source name="file.jpg" height="${jpg:height}" width="${jpg:width}"/>

to 3)
<source name="dir" collection="true">
 <source name="file.xml"/>
 <source name="file.jpg" height="400" width="300"/>

It could work similar with the common properties using the

My problem is that I have always two parameters: the source uri
and the property name.

Any help is appreciated, Stephan Michels.

To unsubscribe, e-mail:
For additional commands, email:

View raw message