You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by an...@wipro.com on 2004/05/06 08:19:39 UTC

Directory Generator/Image Directory Generator

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.



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. Any XSL transformations and where the in the sitemap
should I specify the generator type as directory. 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.



Any kind of help is greatly appreciated.



Regards,

Anand



Confidentiality Notice

The information contained in this electronic message and any attachments to this message are intended
for the exclusive use of the addressee(s) and may contain confidential or privileged information. If
you are not the intended recipient, please notify the sender at Wipro or Mailadmin@wipro.com immediately
and destroy all copies of this message and any attachments.

Re: Directory Generator/Image Directory Generator

Posted by Joerg Heinicke <jo...@gmx.de>.
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