You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Joerg Heinicke <jo...@gmx.de> on 2004/05/06 12:10:02 UTC

Re: Directory Generator/Image Directory Generator

On 06.05.2004 08:19, anand.vasudevan@wipro.com wrote:

> Hi,
> 
> We need to implement a Tree Structure which will have directories of
> images as their nodes and on clicking the directory node its
> subdirectories (if it is the last then the images) are displayed on the
> browser.

Sounds like a simple explorer view. For the directory part the 
DirectoryGenerator is sufficient. For the images you need the 
ImageDirectoryGenerator.

> We came to know that Cocoon provides Directory Generator which can be
> used to provide the above functionality. I am unable to find any
> samples/code that explains how to use it. Examples like what should the
> XML file contain.

Which XML file? The DirectoryGenerator directly operates on the file 
system. It does not use any XML as input.

> Any XSL transformations and where the in the sitemap
> should I specify the generator type as directory.

There are two (not that obvious) samples in the Cocoon samples:

cocoon-2.1\src\webapp\samples\blocks\sitemap.xmap
cocoon-2.1\src\webapp\samples\test\sitemap.xmap

The latter one generates just the XML of one dir:

<map:generate type="directory" src=".">
     <depth>1</depth>
</map:generate>

while the first one also transforms the XML into another XML:

<map:generate type="directory" src=".">
     <map:parameter name="depth" value="2"/>
</map:generate>
<map:transform src="directory2xsamples.xsl"/>
<map:serialize type="xml"/>

Furthermore there is a directory2html.xslt at 
cocoon-2.1\src\webapp\stylesheets\system, that creates not that nice 
HTML view out of the XML, but it should help.

> Of course I did find
> out from the following link something about Directory Generator
> http://cocoon.apache.org/2.1/userdocs/generators/directory-generator.htm
> l#Example . But this does not help in any way as to get this running in
> cocoon.

Feel free to ask more.

Joerg

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