cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Giacomo Pati <giac...@apache.org>
Subject Re: [C2] enhanced DirectoryGenerator (patch attached)
Date Thu, 08 Mar 2001 14:33:45 GMT
Conny, I've applied your patch.

Could you please cross check?

Thanks.

Giacomo

Conny Krappatsch wrote:

> > Hi,
>
> during a customer project I had to add some functionality to
> DirectoryGenerator.
>
> It now can be configured with an 'include' parameter and/or 'exclude'
> parameter. The value of these two parameters is a regular expression and
> specifies which files/directories shall be shown or hidden respectivly by
> the generator.
>
> little example:
>
> <map:generate type="directory" src="{1}">
>  <parameter name="include" value="^s.*"/>
>  <parameter name="exclude" value="^sl.*"/>
> </map:generate>
>
> The created XML file will only contain directories and files whose name
> starts with 's' but does not start with 'sl'.
> If the 'include' paramater is omited all directories/files will be
> included. If the 'exclude' parameter is omited no directories/file will be
> excluded.
>
> Another feature is to specify a root directory for the generated directory
> tree.
>
> What do I mean?
> One specifies the root with a RE, let's say '^docs$', and the generator
> goes up the directory tree starting at the requested directory until it
> finds a directory that matches the given root pattern ('docs' in the
> example). This directory becomes the root of the generated XML file. Its
> descendants are the ancestors of the requested directory, the requested
> directory itself and the descendants of the requested directory (according
> to the 'include', 'exclude' and 'depth' parameter).
>
> The requested directory is not necessarily represented by the document
> element of the resulting XML file anymore. Thus, the corrsponding
> <directory> element got a new parameter named 'requested' with the value
> 'true'.
>
> What do I need it for?
> With the information of the ancestors of the requested directory one can
> show the path to it.
> With this path information traveling through a directory structure can be
> made much more convinient.
>
> Without any of the additional parameters ('include', 'exclude' and 'root')
> the DirectoryGenerator works like normal (except the additional
> 'requested' attribute).
>
>
> I attached a diff to current CVS version. Would be great if somebody could
> apply the patch.
>
> thanks and regards,
> Conny Krappatsch

----------------------------------------
Content-Type: application/octet-stream; charset="US-ASCII"; 
name="DirectoryGenerator.java.diff"
Content-Transfer-Encoding: base64
Content-Description: 
----------------------------------------

----------------------------------------
Content-Type: text/plain; charset="us-ascii"; name="Anhang: 2"
Content-Transfer-Encoding: 7bit
Content-Description: 
----------------------------------------

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


Mime
View raw message