Java Doc for TraversableGenerator.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.TraversableGenerator

All known Subclasses:   org.apache.cocoon.generation.TraversableSourceDescriptionGenerator,  org.apache.cocoon.generation.XPathTraversableGenerator,
TraversableGenerator
public class TraversableGenerator extends ServiceableGenerator implements CacheableProcessingComponent(Code)
Generates an XML source hierarchy listing from a Traversable Source.

The root node of the generated document will normally be a collection node and a collection node can contain zero or more resource or collection nodes. A resource node has no children. Each node will contain the following attributes:

name
the name of the source
lastModified
the time the source was last modified, measured as the number of milliseconds since the epoch (as in java.io.File.lastModified)
size
the source size, in bytes (as in java.io.File.length)
date (optional)
the time the source was last modified in human-readable form

Configuration options:

depth (optional)
Sets how deep TraversableGenerator should delve into the source hierarchy. If set to 1 (the default), only the starting collection's immediate contents will be returned.
sort (optional)
Sort order in which the nodes are returned. Possible values are name, size, time, collection. collection is the same as name, except that the collection entries are listed first. System order is default.
reverse (optional)
Reverse the order of the sort
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.
timeZone (optional)
Sets the time zone offset ID for the date attribute, as described in java.util.TimeZone. If unset, the default system time zone will be used.
refreshDelay (optional)
Sets the delay (in seconds) between checks on the source hierarchy for changed content. Defaults to 1 second.


author:
   Pierpaolo Fumagalli
author:
   (Apache Software Foundation)
author:
   Conny Krappatsch
author:
   (SMB GmbH) for Virbus AG
author:
   Daniele Madama
author:
   Gianugo Rabellino
version:
   CVS $Id: TraversableGenerator.java 433543 2006-08-22 06:22:54Z crossley $


Field Summary
final protected static  StringCOL_NODE_NAME
    
final protected static  StringDATE_ATTR_NAME
    
final protected static  StringLASTMOD_ATTR_NAME
    
final protected static  StringPREFIX
     The namespace prefix for this namespace.
final protected static  StringRESOURCE_NODE_NAME
    
final protected static  StringRES_NAME_ATTR_NAME
    
final protected static  StringSIZE_ATTR_NAME
    
final protected static  StringURI
     The URI of the namespace of this generator.
final protected static  StringURI_ATTR_NAME
    
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 TraversableGenerator should delve.
protected  REexcludeRE
     The regular expression for the exclude pattern.
protected  REincludeRE
     The regular expression for the include pattern.
protected  booleanisRequestedSource
     This is only set to true for the requested source specified by the src attribute on the generator's configuration.
protected  longrefreshDelay
     The delay between checks on updates to the source hierarchy.
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 collection should be sorted.
protected  MultiSourceValidityvalidity
    


Method Summary
protected  voidaddAncestorPath(TraversableSource source, Stack ancestors)
     Adds recursively the path from the source matched by the root pattern down to the requested source.
protected  voidaddContent(TraversableSource source)
     Allow subclasses a chance to generate additional elements within collection and resource elements.
protected  voidaddPath(TraversableSource source, 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(TraversableSource source)
     Creates a stack containing the ancestors of a traversable source up to specific parent matching the root pattern.
public  SerializablegetKey()
    
public  SourceValiditygetValidity()
     Gets the source validity, using a deferred validity object.
protected  booleanisExcluded(TraversableSource source)
     Determines if a given source shall be excluded from viewing.
protected  booleanisIncluded(TraversableSource source)
     Determines if a given source shall be visible.
protected  booleanisRoot(TraversableSource source)
     Determines if a given source is the defined root.
public  voidrecycle()
    
protected  voidsetNodeAttributes(TraversableSource source)
     Sets the attributes for a given source.
public  voidsetup(SourceResolver resolver, Map objectModel, String src, Parameters par)
     Set the request parameters.
protected  voidstartNode(String nodeName, TraversableSource source)
     Begins a named node and calls setNodeAttributes to set its attributes.

Field Detail
COL_NODE_NAME
final protected static String COL_NODE_NAME(Code)



DATE_ATTR_NAME
final protected static String DATE_ATTR_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.



RESOURCE_NODE_NAME
final protected static String RESOURCE_NODE_NAME(Code)



RES_NAME_ATTR_NAME
final protected static String RES_NAME_ATTR_NAME(Code)



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.



URI_ATTR_NAME
final protected static String URI_ATTR_NAME(Code)



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 TraversableGenerator should delve.



excludeRE
protected RE excludeRE(Code)
The regular expression for the exclude pattern.



includeRE
protected RE includeRE(Code)
The regular expression for the include pattern.



isRequestedSource
protected boolean isRequestedSource(Code)
This is only set to true for the requested source specified by the src attribute on the generator's configuration.



refreshDelay
protected long refreshDelay(Code)
The delay between checks on updates to the source hierarchy.



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 collection should be sorted. Possible values are "name", "size", "time" and "collection", where "collection" is the same as "name", except that collection entries are listed first.



validity
protected MultiSourceValidity validity(Code)
The validity that is being built





Method Detail
addAncestorPath
protected void addAncestorPath(TraversableSource source, Stack ancestors) throws SAXException, ProcessingException(Code)
Adds recursively the path from the source matched by the root pattern down to the requested source.
Parameters:
  source - the requested source.
Parameters:
  ancestors - the stack of the ancestors.
throws:
  SAXException -
throws:
  ProcessingException -



addContent
protected void addContent(TraversableSource source) throws SAXException, ProcessingException(Code)
Allow subclasses a chance to generate additional elements within collection and resource elements.
Parameters:
  source - the source to generate additional data for.



addPath
protected void addPath(TraversableSource source, int depth) throws SAXException, ProcessingException(Code)
Adds a single node to the generated document. If the path is a collection and depth is greater than zero, then recursive calls are made to add nodes for the collection's children.
Parameters:
  source - the resource/collection to process
Parameters:
  depth - how deep to scan the collection hierarchy
throws:
  SAXException - if an error occurs while constructing nodes
throws:
  ProcessingException - if a problem occurs with the source



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 something went wrong while traversingthe source hierarchy



getAncestors
protected Stack getAncestors(TraversableSource source) throws IOException(Code)
Creates a stack containing the ancestors of a traversable source up to specific parent matching the root pattern.
Parameters:
  source - the traversable source 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 resources 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 resources that is traversed.
See Also:   org.apache.cocoon.components.source.impl.MultiSourceValidity



isExcluded
protected boolean isExcluded(TraversableSource source)(Code)
Determines if a given source shall be excluded from viewing.
Parameters:
  source - the source to check false if the given source shall not be excluded or the exclude Pattern is not set,true otherwise.



isIncluded
protected boolean isIncluded(TraversableSource source)(Code)
Determines if a given source shall be visible.
Parameters:
  source - the source to check true if the source shall be visible or the include Pattern is not set,false otherwise.



isRoot
protected boolean isRoot(TraversableSource source)(Code)
Determines if a given source is the defined root.
Parameters:
  source - the source to check true if the source is the root or the root pattern is not set,false otherwise.



recycle
public void recycle()(Code)
Recycle resources



setNodeAttributes
protected void setNodeAttributes(TraversableSource source) throws SAXException, ProcessingException(Code)
Sets the attributes for a given source. For example attributes for the name, the size and the last modification date of the source are added.
Parameters:
  source - the source attributes are added for



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 Traversable Source to be XMLized specified assrc attribute on <map:generate/>
Parameters:
  par - configuration parameters



startNode
protected void startNode(String nodeName, TraversableSource source) throws SAXException, ProcessingException(Code)
Begins a named node and calls setNodeAttributes to set its attributes.
Parameters:
  nodeName - the name of the new node
Parameters:
  source - the source a node with its attributes is added for
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.