Save This Page
Home » cocoon-2.1.11-src » org.apache » cocoon » generation » [javadoc | source]
org.apache.cocoon.generation
public class: DirectoryGenerator [javadoc | source]
java.lang.Object
   org.apache.avalon.framework.logger.AbstractLogEnabled
      org.apache.cocoon.xml.AbstractXMLProducer
         org.apache.cocoon.generation.AbstractGenerator
            org.apache.cocoon.generation.ServiceableGenerator
               org.apache.cocoon.generation.DirectoryGenerator

All Implemented Interfaces:
    CacheableProcessingComponent, org.apache.avalon.framework.activity.Disposable, org.apache.avalon.framework.service.Serviceable, Generator, org.apache.avalon.excalibur.pool.Recyclable, XMLProducer

Direct Known Subclasses:
    XPathDirectoryGenerator, MP3DirectoryGenerator, ImageDirectoryGenerator

Nested Class Summary:
public static class  DirectoryGenerator.DirValidity  Specific validity class, that holds all files that have been generated 
Field Summary
protected static final  String URI    The URI of the namespace of this generator. 
protected static final  String PREFIX    The namespace prefix for this namespace. 
protected static final  String DIR_NODE_NAME     
protected static final  String FILE_NODE_NAME     
protected static final  String FILENAME_ATTR_NAME     
protected static final  String LASTMOD_ATTR_NAME     
protected static final  String DATE_ATTR_NAME     
protected static final  String SIZE_ATTR_NAME     
protected  DirectoryGenerator.DirValidity validity    The validity that is being built 
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. I don't know a way from the regular expressions back to the pattern or at least a useful string. 
protected  int depth    The depth parameter determines how deep the DirectoryGenerator should delve. 
protected  SimpleDateFormat dateFormatter    The dateFormatter determines into which date format the lastModified time should be converted. FIXME: SimpleDateFormat is not supported by all locales! 
protected  long refreshDelay    The delay between checks on updates to the filesystem. 
protected  String sort    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. 
protected  boolean reverse    The reverse parameter reverses the sort order. false is default. 
protected  RE rootRE    The regular expression for the root pattern. 
protected  RE includeRE    The regular expression for the include pattern. 
protected  RE excludeRE    The regular expression for the exclude 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  Source directorySource    The source object for the directory. 
Fields inherited from org.apache.cocoon.generation.ServiceableGenerator:
manager
Fields inherited from org.apache.cocoon.generation.AbstractGenerator:
resolver,  objectModel,  parameters,  source
Fields inherited from org.apache.cocoon.xml.AbstractXMLProducer:
EMPTY_CONTENT_HANDLER,  xmlConsumer,  contentHandler,  lexicalHandler
Method from org.apache.cocoon.generation.DirectoryGenerator Summary:
addAncestorPath,   addPath,   endNode,   generate,   getAncestors,   getKey,   getValidity,   isExcluded,   isIncluded,   isRoot,   recycle,   setNodeAttributes,   setup,   startNode
Methods from org.apache.cocoon.generation.ServiceableGenerator:
dispose,   service
Methods from org.apache.cocoon.generation.AbstractGenerator:
recycle,   setup
Methods from org.apache.cocoon.xml.AbstractXMLProducer:
recycle,   setConsumer,   setContentHandler,   setLexicalHandler
Methods from java.lang.Object:
equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.apache.cocoon.generation.DirectoryGenerator Detail:
 protected  void addAncestorPath(File path,
    Stack ancestors) throws SAXException 
    Adds recursively the path from the directory matched by the root pattern down to the requested directory.
 protected  void addPath(File path,
    int depth) throws SAXException 
    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.
 protected  void endNode(String nodeName) throws SAXException 
    Ends the named node.
 public  void generate() throws SAXException, ProcessingException 
    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. 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.
 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() 
    Recycle resources
 protected  void setNodeAttributes(File path) throws SAXException 
    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.
 public  void setup(SourceResolver resolver,
    Map objectModel,
    String src,
    Parameters par) throws IOException, SAXException, ProcessingException 
    Set the request parameters. Must be called before the generate method.
 protected  void startNode(String nodeName,
    File path) throws SAXException 
    Begins a named node and calls setNodeAttributes to set its attributes.