Directory Generator
Generates an XML directory listing.
The root node of the generated document will normally be a
directory node, and a directory node can contain zero
or more file or directory nodes. A file node has no
children. Each node will contain the following attributes:
-
name : the name of the file or directory
-
lastModified : the time the file was last modified, measured as the number of
milliseconds since the epoch (as in java.io.File.lastModified)
-
date (optional) : the time the file was last modified in human-readable form
All generated elements have the namespace
http://apache.org/cocoon/directory/2.0 .
The root directory
node has the attribute requested with the value true .
-
Name : directory
-
Class: org.apache.cocoon.generation.DirectoryGenerator
-
Cacheable: no.
 |  |  |
 |
<map:generate type="directory" src="the_directory"/>
|  |
 |  |  |
Configuration
The following parameter can be specified in the pipeline for
the generate command:
-
depth (optional) : Sets how deep Directory Generator should delve into the
directory structure. If set to 1 (the default), only the starting
directory's immediate contents will be returned.
-
dateFormat (optional) : Sets the format for the date attribute of each node, as
described in java.text.SimpleDateFormat. If unset, the default
format for the current locale will be used.
-
root (optional) : The root pattern
-
include (optional) : The include pattern
-
exclude (optional) : The exclude pattern
DTD
XML generated by directory generator uses namespace
http://apache.org/cocoon/status/2.0 . The DTD
of XML generated by directory generator:
 |  |  |
 |
<!ELEMENT directory (directory|file)*>
<!ATTLIST directroy
name CDATA #REQUIRED
lastModified CDATA #REQUIRED
date CDATA #IMPLIED
requested CDATA #IMPLIED>
<!ELEMENt file #EMPTY>
<!ATTLIST file
name CDATA #REQUIRED
lastModified CDATA #REQUIRED
date CDATA #IMPLIED>
|  |
 |  |  |
Example
The current directory generator may generate following xml:
 |  |  |
 |
<directory xmlns="http://apache.org/cocoon/directory/2.0"
name="stylesheets" lastModified="999425490000"
date="02.09.01 12:11"
requested="true">
<directory name="sites"
lastModified="999425490000" date="02.09.01 12:11"/>
<file name="dynamic-page2html.xsl"
lastModified="999425490000" date="02.09.01 12:11"/>
<file name="simple-xml2html.xsl"
lastModified="999425490000" date="02.09.01 12:11"/>
</directory>
|  |
 |  |  |
|