You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by Conny Krappatsch <co...@smb-tec.com> on 2001/03/07 13:54:45 UTC
[C2] enhanced DirectoryGenerator (patch attached)
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
--
______________________________________________________________________
Conny Krappatsch mailto:conny@smb-tec.com
SMB GmbH http://www.smb-tec.com
Re: [C2] enhanced DirectoryGenerator (patch attached)
Posted by Giacomo Pati <gi...@apache.org>.
Conny Krappatsch wrote:
> On Thu, 8 Mar 2001 15:33:45 +0100
>
> Giacomo Pati <gi...@apache.org> wrote:
> > Conny, I've applied your patch.
> >
> > Could you please cross check?
> >
> > Thanks.
> >
> > Giacomo
>
> Are you shure you commited it. Can't see it in CVS. Latest version of the
> DirectoryGenerator is 1.1.2.19 commited on 2001/02/22 by Berin.
Oops. I've commited it now!
Thanks, Giacomo
---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org
Re: [C2] enhanced DirectoryGenerator (patch attached)
Posted by Conny Krappatsch <co...@smb-tec.com>.
On Thu, 8 Mar 2001 15:33:45 +0100
Giacomo Pati <gi...@apache.org> wrote:
> Conny, I've applied your patch.
>
> Could you please cross check?
>
> Thanks.
>
> Giacomo
Are you shure you commited it. Can't see it in CVS. Latest version of the
DirectoryGenerator is 1.1.2.19 commited on 2001/02/22 by Berin.
Conny
--
______________________________________________________________________
Conny Krappatsch mailto:conny@smb-tec.com
SMB GmbH http://www.smb-tec.com
---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org
Re: [C2] enhanced DirectoryGenerator (patch attached)
Posted by Giacomo Pati <gi...@apache.org>.
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