Java Doc for DirectoryGenerator.java in  » Content-Management-System » apache-lenya-2.0 » org » apache » cocoon » generation » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Content Management System » apache lenya 2.0 » org.apache.cocoon.generation 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


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,
DirectoryGenerator
public class DirectoryGenerator extends ServiceableGenerator implements CacheableProcessingComponent(Code)

version:
   $Id: DirectoryGenerator.java 433543 2006-08-22 06:22:54Z crossley $

Inner Class :public static class DirValidity implements SourceValidity

Field Summary
final protected static  StringDATE_ATTR_NAME
    
final protected static  StringDIR_NODE_NAME
    
final protected static  StringFILENAME_ATTR_NAME
    
final protected static  StringFILE_NODE_NAME
    
final protected static  StringLASTMOD_ATTR_NAME
    
final protected static  StringPREFIX
     The namespace prefix for this namespace.
final protected static  StringSIZE_ATTR_NAME
    
final protected static  StringURI
     The URI of the namespace of this generator.
protected  AttributesImplattributes
     Convenience object, so we don't need to create an AttributesImpl for every element.
protected  ListcacheKeyParList
     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  SimpleDateFormatdateFormatter
     The dateFormatter determines into which date format the lastModified time should be converted.
protected  intdepth
     The depth parameter determines how deep the DirectoryGenerator should delve.
protected  SourcedirectorySource
     The source object for the directory.
protected  REexcludeRE
     The regular expression for the exclude pattern.
protected  REincludeRE
     The regular expression for the include pattern.
protected  booleanisRequestedDirectory
     This is only set to true for the requested directory specified by the src attribute on the generator's configuration.
protected  longrefreshDelay
     The delay between checks on updates to the filesystem.
protected  booleanreverse
     The reverse parameter reverses the sort order.
protected  RErootRE
     The regular expression for the root pattern.
protected  Stringsort
     The sort parameter determines by which attribute the content of one directory should be sorted.
protected  DirValidityvalidity
    


Method Summary
protected  voidaddAncestorPath(File path, Stack ancestors)
     Adds recursively the path from the directory matched by the root pattern down to the requested directory.
protected  voidaddPath(File path, int depth)
     Adds a single node to the generated document.
protected  voidendNode(String nodeName)
     Ends the named node.
public  voidgenerate()
     Generate XML data.
protected  StackgetAncestors(File path)
     Creates a stack containing the ancestors of File up to specified directory.
public  SerializablegetKey()
    
public  SourceValiditygetValidity()
     Gets the source validity, using a deferred validity object.
protected  booleanisExcluded(File path)
     Determines if a given File shall be excluded from viewing.
protected  booleanisIncluded(File path)
     Determines if a given File shall be visible.
protected  booleanisRoot(File path)
     Determines if a given File is the defined root.
public  voidrecycle()
    
protected  voidsetNodeAttributes(File path)
     Sets the attributes for a given path.
public  voidsetup(SourceResolver resolver, Map objectModel, String src, Parameters par)
     Set the request parameters.
protected  voidstartNode(String nodeName, File path)
     Begins a named node and calls setNodeAttributes to set its attributes.

Field Detail
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





Method Detail
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



generate
public void generate() throws SAXException, ProcessingException(Code)
Generate XML data.
throws:
  SAXException - if an error occurs while outputting the document
throws:
  ProcessingException - if the requsted URI isn't a directory on the local filesystem



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.



getKey
public Serializable getKey()(Code)



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)

Fields inherited from org.apache.cocoon.generation.AbstractGenerator
protected Map objectModel(Code)(Java Doc)
protected Parameters parameters(Code)(Java Doc)
protected SourceResolver resolver(Code)(Java Doc)
protected String source(Code)(Java Doc)

Methods inherited from org.apache.cocoon.generation.AbstractGenerator
public void recycle()(Code)(Java Doc)
public void setup(SourceResolver resolver, Map objectModel, String src, Parameters par) throws ProcessingException, SAXException, IOException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.