| org.apache.cocoon.generation.AbstractGenerator org.apache.cocoon.generation.ServiceableGenerator org.apache.cocoon.generation.DirectoryGenerator
All known Subclasses: org.apache.cocoon.generation.MP3DirectoryGenerator, org.apache.cocoon.generation.XPathDirectoryGenerator, org.apache.cocoon.generation.ImageDirectoryGenerator,
Inner Class :public static class DirValidity implements SourceValidity | |
Field Summary | |
final protected static String | DATE_ATTR_NAME | final protected static String | DIR_NODE_NAME | final protected static String | FILENAME_ATTR_NAME | final protected static String | FILE_NODE_NAME | final protected static String | LASTMOD_ATTR_NAME | final protected static String | PREFIX The namespace prefix for this namespace. | final protected static String | SIZE_ATTR_NAME | final protected static String | URI The URI of the namespace of this generator. | protected AttributesImpl | attributes Convenience object, so we don't need to create an AttributesImpl for every element. | protected List | cacheKeyParList The cache key needs to be generated for the configuration of this
generator, so storing the parameters for generateKey().
Using the member variables after setup() would not work I guess. | protected SimpleDateFormat | dateFormatter The dateFormatter determines into which date format the lastModified
time should be converted. | protected int | depth The depth parameter determines how deep the DirectoryGenerator should delve. | protected Source | directorySource The source object for the directory. | protected RE | excludeRE The regular expression for the exclude pattern. | protected RE | includeRE The regular expression for the include pattern. | protected boolean | isRequestedDirectory This is only set to true for the requested directory specified by the
src attribute on the generator's configuration. | protected long | refreshDelay The delay between checks on updates to the filesystem. | protected boolean | reverse The reverse parameter reverses the sort order. | protected RE | rootRE The regular expression for the root pattern. | protected String | sort The sort parameter determines by which attribute the content of one
directory should be sorted. | protected DirValidity | validity |
Method Summary | |
protected void | addAncestorPath(File path, Stack ancestors) Adds recursively the path from the directory matched by the root pattern
down to the requested directory. | protected void | addPath(File path, int depth) Adds a single node to the generated document. | protected void | endNode(String nodeName) Ends the named node. | public void | generate() Generate XML data. | protected Stack | getAncestors(File path) Creates a stack containing the ancestors of File up to specified directory. | public Serializable | getKey() | public SourceValidity | getValidity() Gets the source validity, using a deferred validity object. | protected boolean | isExcluded(File path) Determines if a given File shall be excluded from viewing. | protected boolean | isIncluded(File path) Determines if a given File shall be visible. | protected boolean | isRoot(File path) Determines if a given File is the defined root. | public void | recycle() | protected void | setNodeAttributes(File path) Sets the attributes for a given path. | public void | setup(SourceResolver resolver, Map objectModel, String src, Parameters par) Set the request parameters. | protected void | startNode(String nodeName, File path) Begins a named node and calls setNodeAttributes to set its attributes. |
DATE_ATTR_NAME | final protected static String DATE_ATTR_NAME(Code) | | |
DIR_NODE_NAME | final protected static String DIR_NODE_NAME(Code) | | |
FILENAME_ATTR_NAME | final protected static String FILENAME_ATTR_NAME(Code) | | |
FILE_NODE_NAME | final protected static String FILE_NODE_NAME(Code) | | |
LASTMOD_ATTR_NAME | final protected static String LASTMOD_ATTR_NAME(Code) | | |
PREFIX | final protected static String PREFIX(Code) | | The namespace prefix for this namespace.
|
SIZE_ATTR_NAME | final protected static String SIZE_ATTR_NAME(Code) | | |
URI | final protected static String URI(Code) | | The URI of the namespace of this generator.
|
attributes | protected AttributesImpl attributes(Code) | | Convenience object, so we don't need to create an AttributesImpl for every element.
|
cacheKeyParList | protected List cacheKeyParList(Code) | | The cache key needs to be generated for the configuration of this
generator, so storing the parameters for generateKey().
Using the member variables after setup() would not work I guess. I don't
know a way from the regular expressions back to the pattern or at least
a useful string.
|
dateFormatter | protected SimpleDateFormat dateFormatter(Code) | | The dateFormatter determines into which date format the lastModified
time should be converted.
FIXME: SimpleDateFormat is not supported by all locales!
|
depth | protected int depth(Code) | | The depth parameter determines how deep the DirectoryGenerator should delve.
|
directorySource | protected Source directorySource(Code) | | The source object for the directory.
|
excludeRE | protected RE excludeRE(Code) | | The regular expression for the exclude pattern.
|
includeRE | protected RE includeRE(Code) | | The regular expression for the include pattern.
|
isRequestedDirectory | protected boolean isRequestedDirectory(Code) | | This is only set to true for the requested directory specified by the
src attribute on the generator's configuration.
|
refreshDelay | protected long refreshDelay(Code) | | The delay between checks on updates to the filesystem.
|
reverse | protected boolean reverse(Code) | | The reverse parameter reverses the sort order. false is default.
|
rootRE | protected RE rootRE(Code) | | The regular expression for the root pattern.
|
sort | protected String sort(Code) | | The sort parameter determines by which attribute the content of one
directory should be sorted. Possible values are "name", "size", "lastmodified"
and "directory", where "directory" is the same as "name", except that
directory entries are listed first.
|
validity | protected DirValidity validity(Code) | | The validity that is being built
|
addAncestorPath | protected void addAncestorPath(File path, Stack ancestors) throws SAXException(Code) | | Adds recursively the path from the directory matched by the root pattern
down to the requested directory.
Parameters: path - the requested directory. Parameters: ancestors - the stack of the ancestors. throws: SAXException - |
addPath | protected void addPath(File path, int depth) throws SAXException(Code) | | Adds a single node to the generated document. If the path is a
directory, and depth is greater than zero, then recursive calls
are made to add nodes for the directory's children.
Parameters: path - the file/directory to process Parameters: depth - how deep to scan the directory throws: SAXException - if an error occurs while constructing nodes |
endNode | protected void endNode(String nodeName) throws SAXException(Code) | | Ends the named node.
Parameters: nodeName - the name of the new node throws: SAXException - if an error occurs while closing the node |
getAncestors | protected Stack getAncestors(File path)(Code) | | Creates a stack containing the ancestors of File up to specified directory.
Parameters: path - the File whose ancestors shall be retrieved a Stack containing the ancestors. |
getValidity | public SourceValidity getValidity()(Code) | | Gets the source validity, using a deferred validity object. The validity
is initially empty since the files that define it are not known before
generation has occured. So the returned object is kept by the generator
and filled with each of the files that are traversed.
See Also: DirectoryGenerator.DirValidity |
isExcluded | protected boolean isExcluded(File path)(Code) | | Determines if a given File shall be excluded from viewing.
Parameters: path - the File to check false if the given File shall not be excluded or the exclude Pattern is null ,true otherwise. |
isIncluded | protected boolean isIncluded(File path)(Code) | | Determines if a given File shall be visible.
Parameters: path - the File to check true if the File shall be visible or the include Pattern is null ,false otherwise. |
isRoot | protected boolean isRoot(File path)(Code) | | Determines if a given File is the defined root.
Parameters: path - the File to check true if the File is the root or the root pattern is not set,false otherwise. |
recycle | public void recycle()(Code) | | Recycle resources
|
setNodeAttributes | protected void setNodeAttributes(File path) throws SAXException(Code) | | Sets the attributes for a given path. The default method sets attributes
for the name of thefile/directory and for the last modification time
of the path.
Parameters: path - the file/directory to use when setting attributes throws: SAXException - if an error occurs while setting the attributes |
setup | public void setup(SourceResolver resolver, Map objectModel, String src, Parameters par) throws ProcessingException, SAXException, IOException(Code) | | Set the request parameters. Must be called before the generate method.
Parameters: resolver - the SourceResolver object Parameters: objectModel - a Map containing model object Parameters: src - the directory to be XMLized specified as src attribute on <map:generate/> Parameters: par - configuration parameters |
startNode | protected void startNode(String nodeName, File path) throws SAXException(Code) | | Begins a named node and calls setNodeAttributes to set its attributes.
Parameters: nodeName - the name of the new node Parameters: path - the file/directory to use when setting attributes throws: SAXException - if an error occurs while creating the node |
Fields inherited from org.apache.cocoon.generation.ServiceableGenerator | protected ServiceManager manager(Code)(Java Doc)
|
Methods inherited from org.apache.cocoon.generation.ServiceableGenerator | public void dispose()(Code)(Java Doc) public void service(ServiceManager manager) throws ServiceException(Code)(Java Doc)
|
|
|