cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alfred Fuchs <>
Subject DirectoryGenerator
Date Wed, 01 Oct 2003 07:43:03 GMT

hope, this is the right place to post.

I made some changes to the
DirectoryGenerator (1)
and HTMLGenerator (4)
and introduced a PipelineDirectoryGenerator(2)
and FileInfoGenerator (3) for convenience.

my aim was to scan a directory for (Html,XML-)articles,
extract the titles from the files and show a overview site to the user.

I dont know, if this is interesting for You,
where to post the code/example for review,
how to name the packages/classes.

best regards,

(1) ====================
made some extensions to the DirectoryGenerator:
(all can be switched on and off, so the new Generator behaves as the old one
when no optinal parameterers are given)

- it is now possible recursing directories, even when the pattern is not matching the
   directory name.
- directories with no matching files, can be excluded from the resultset.
- matching directories can be added to the resultset (<dir:file type="directory"..../>)
- the sort order can now be a whitespace separated list, so you can also define
   ordering on the second, third... level.

(2) ====================
introduced a PipelineDirectoryGenerator:
the content of the <dir:file>-tag is the result
of a matching pipline:

<map:generate type="pipeline-directory" src=".">
	<map:parameter name="include" value="\.(xml|html|jpg|gif|png)$" />
	<map:parameter name="mimeTypePipeline" value="cocoon:/mime-type-directory" />

<map:match pattern="mime-type-directory**">
	<map:match pattern="mime-type-directory/**.xml">
	<map:match pattern="mime-type-directory/**.html">

(3) ====================
introduced a FileInfoGenerator:
only extracted some pice of code from the ImageDirectoryGenerator
and added some additional code.

(4) ====================
made a patch to the HTMLGenerator
(I always got a NullPointerException on xhtml documents with <?xml ....?> in the header.)


	this.contentHandler.startDocument(); doc.getDocumentElement() );

(would it not be better, move this down to the DOMStreamer?)

View raw message