Java Doc for XPathTraversableGenerator.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
         org.apache.cocoon.generation.XPathTraversableGenerator

XPathTraversableGenerator
public class XPathTraversableGenerator extends TraversableGenerator (Code)
Generates an XML collection listing performing XPath queries on XML sources. It can be used both as a plain TraversableGenerator or, if an XPath is specified, it will perform an XPath query on every XML resource, where "xml resource" is, by default, any resource ending with ".xml", which can be overriden by setting the (regexp) pattern "xmlFiles as a sitemap parameter, or where the name of the resource has a container-wide mime-type mapping to 'text/xml' such as specified by mime-mapping elements in a web.xml descriptor file. The XPath can be specified in two ways:
  1. By using an XPointerish syntax in the URL: everything following the pound sign (possiby preceding query string arguments) will be treated as the XPath;
  2. Specifying it as a sitemap parameter named "xpath"
Sample usage: Sitemap: <map:match pattern="documents/**"> <map:generate type="xpathdirectory" src=" docs/{1}#/article/title|/article/abstract" > < map:parameter name="xmlFiles" value="\.xml$"/> </map:generate> <map: serialize type="xml" /> </map:match> Request: http://www.some.host/documents/test Result: <collection:collection name="test" lastModified="1010400942000" date="1/7/02 11:55 AM" requested="true" xmlns:collection="http://apache.org/cocoon/collection/1.0"> <collection:collection name="subdirectory" lastModified="1010400942000" date="1/7/02 11:55 AM" /> <collection:resource name="test.xml" lastModified="1011011579000" date="1/14/02 1:32 PM"> <collection:xpath docid="test.xml" query="/article/title"> <title>This is a test document</title> <abstract> <para>Abstract of my test article</para> </abstract> </collection:xpath> </collection:resource> <collection:resource name="test.gif" lastModified="1011011579000" date="1/14/02 1:32 PM"> </collection:collection> If you need to use namespaces, you can set them as sitemap parameters in the form: lt;map:parameter name="xmlns:your prefix" value="nsURI"/**">
author:
   Gianugo Rabellino
author:
   Daniele Madama
version:
   CVS $Id: XPathTraversableGenerator.java 433543 2006-08-22 06:22:54Z crossley $

Inner Class :static class XPathPrefixResolver implements PrefixResolver

Field Summary
final protected static  StringQUERY_ATTR_NAME
     Attribute for the XPath query.
final protected static  StringRESULT_DOCID_ATTR
    
final protected static  StringXPATH_NODE_NAME
     Local name for the element that contains the included XML snippet.
protected  Contextcontext
    
protected  Documentdoc
     The document that should be parsed and (partly) included.
protected  XPathPrefixResolverprefixResolver
    
protected  XPathProcessorprocessor
     The XPath processor.
protected  RExmlRE
     The regular expression for the XML files pattern.
protected  Stringxpath
     The XPath.


Method Summary
protected  voidaddContent(TraversableSource source)
    
public  voiddispose()
    
protected  booleanisXML(TraversableSource path)
     Determines if a given TraversableSource shall be handled as XML.
protected  voidperformXPathQuery(TraversableSource in)
     Performs an XPath query on the source.
public  voidrecycle()
    
public  voidservice(ServiceManager manager)
    
public  voidsetup(SourceResolver resolver, Map objectModel, String src, Parameters par)
    

Field Detail
QUERY_ATTR_NAME
final protected static String QUERY_ATTR_NAME(Code)
Attribute for the XPath query.



RESULT_DOCID_ATTR
final protected static String RESULT_DOCID_ATTR(Code)
The document containing a successful XPath query



XPATH_NODE_NAME
final protected static String XPATH_NODE_NAME(Code)
Local name for the element that contains the included XML snippet.



context
protected Context context(Code)
The cocoon context used for mime-type mappings



doc
protected Document doc(Code)
The document that should be parsed and (partly) included.



prefixResolver
protected XPathPrefixResolver prefixResolver(Code)
The prefix resolver for namespaced queries



processor
protected XPathProcessor processor(Code)
The XPath processor.



xmlRE
protected RE xmlRE(Code)
The regular expression for the XML files pattern.



xpath
protected String xpath(Code)
The XPath.





Method Detail
addContent
protected void addContent(TraversableSource source) throws SAXException, ProcessingException(Code)



dispose
public void dispose()(Code)



isXML
protected boolean isXML(TraversableSource path)(Code)
Determines if a given TraversableSource shall be handled as XML.
Parameters:
  path - the TraversableSource to check true if the given TraversableSource shall handled as XML, falseotherwise.



performXPathQuery
protected void performXPathQuery(TraversableSource in) throws SAXException(Code)
Performs an XPath query on the source.
Parameters:
  in - the Source the XPath is performed on.
throws:
  SAXException - if something goes wrong while adding the XML snippet.



recycle
public void recycle()(Code)
Recycle resources



service
public void service(ServiceManager manager) throws ServiceException(Code)



setup
public void setup(SourceResolver resolver, Map objectModel, String src, Parameters par) throws ProcessingException, SAXException, IOException(Code)



Fields inherited from org.apache.cocoon.generation.TraversableGenerator
final protected static String COL_NODE_NAME(Code)(Java Doc)
final protected static String DATE_ATTR_NAME(Code)(Java Doc)
final protected static String LASTMOD_ATTR_NAME(Code)(Java Doc)
final protected static String PREFIX(Code)(Java Doc)
final protected static String RESOURCE_NODE_NAME(Code)(Java Doc)
final protected static String RES_NAME_ATTR_NAME(Code)(Java Doc)
final protected static String SIZE_ATTR_NAME(Code)(Java Doc)
final protected static String URI(Code)(Java Doc)
final protected static String URI_ATTR_NAME(Code)(Java Doc)
protected AttributesImpl attributes(Code)(Java Doc)
protected List cacheKeyParList(Code)(Java Doc)
protected SimpleDateFormat dateFormatter(Code)(Java Doc)
protected int depth(Code)(Java Doc)
protected RE excludeRE(Code)(Java Doc)
protected RE includeRE(Code)(Java Doc)
protected boolean isRequestedSource(Code)(Java Doc)
protected long refreshDelay(Code)(Java Doc)
protected boolean reverse(Code)(Java Doc)
protected RE rootRE(Code)(Java Doc)
protected String sort(Code)(Java Doc)
protected MultiSourceValidity validity(Code)(Java Doc)

Methods inherited from org.apache.cocoon.generation.TraversableGenerator
protected void addAncestorPath(TraversableSource source, Stack ancestors) throws SAXException, ProcessingException(Code)(Java Doc)
protected void addContent(TraversableSource source) throws SAXException, ProcessingException(Code)(Java Doc)
protected void addPath(TraversableSource source, int depth) throws SAXException, ProcessingException(Code)(Java Doc)
protected void endNode(String nodeName) throws SAXException(Code)(Java Doc)
public void generate() throws SAXException, ProcessingException(Code)(Java Doc)
protected Stack getAncestors(TraversableSource source) throws IOException(Code)(Java Doc)
public Serializable getKey()(Code)(Java Doc)
public SourceValidity getValidity()(Code)(Java Doc)
protected boolean isExcluded(TraversableSource source)(Code)(Java Doc)
protected boolean isIncluded(TraversableSource source)(Code)(Java Doc)
protected boolean isRoot(TraversableSource source)(Code)(Java Doc)
public void recycle()(Code)(Java Doc)
protected void setNodeAttributes(TraversableSource source) throws SAXException, ProcessingException(Code)(Java Doc)
public void setup(SourceResolver resolver, Map objectModel, String src, Parameters par) throws ProcessingException, SAXException, IOException(Code)(Java Doc)
protected void startNode(String nodeName, TraversableSource source) throws SAXException, ProcessingException(Code)(Java Doc)

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.