|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
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 org.apache.cocoon.generation.XPathDirectoryGenerator
public class XPathDirectoryGenerator
Nested Class Summary |
---|
Nested classes/interfaces inherited from class org.apache.cocoon.generation.DirectoryGenerator |
---|
DirectoryGenerator.DirValidity |
Field Summary | |
---|---|
protected Document |
doc
The document that should be parsed and (partly) included. |
protected static Map |
mappingFiles
All the mapping files lastmodified dates |
protected DOMParser |
parser
The parser for the XML snippets to be included. |
protected PrefixResolver |
prefixResolver
The PrefixResolver responsable for processing current request (if any). |
protected XPathProcessor |
processor
The XPath processor. |
protected static String |
QUERY_ATTR_NAME
Attribute for the XPath query. |
protected org.apache.regexp.RE |
xmlRE
The regular expression for the XML files pattern. |
protected String |
xpath
The XPath. |
protected static String |
XPATH_NODE_NAME
Local name for the element that contains the included XML snippet. |
Fields inherited from class org.apache.cocoon.generation.DirectoryGenerator |
---|
attributes, cacheKeyParList, DATE_ATTR_NAME, dateFormatter, depth, DIR_NODE_NAME, directorySource, excludeRE, FILE_NODE_NAME, FILENAME_ATTR_NAME, includeRE, isRequestedDirectory, LASTMOD_ATTR_NAME, PREFIX, refreshDelay, reverse, rootRE, SIZE_ATTR_NAME, sort, URI, validity |
Fields inherited from class org.apache.cocoon.generation.ServiceableGenerator |
---|
manager |
Fields inherited from class org.apache.cocoon.generation.AbstractGenerator |
---|
objectModel, parameters, resolver, source |
Fields inherited from class org.apache.cocoon.xml.AbstractXMLProducer |
---|
contentHandler, EMPTY_CONTENT_HANDLER, lexicalHandler, xmlConsumer |
Fields inherited from interface org.apache.cocoon.generation.Generator |
---|
ROLE |
Constructor Summary | |
---|---|
XPathDirectoryGenerator()
|
Method Summary | |
---|---|
void |
dispose()
Disposable |
protected boolean |
isXML(File path)
Determines if a given File shall be handled as XML. |
protected void |
performXPathQuery(File xmlFile)
Performs an XPath query on the file. |
void |
recycle()
Recycle resources |
void |
service(ServiceManager manager)
Serviceable |
void |
setup(SourceResolver resolver,
Map objectModel,
String src,
Parameters par)
Setup this sitemap component |
protected void |
startNode(String nodeName,
File path)
Extends the startNode() method of the DirectoryGenerator by starting a possible XPath query on a file. |
Methods inherited from class org.apache.cocoon.generation.DirectoryGenerator |
---|
addAncestorPath, addPath, endNode, generate, getAncestors, getKey, getValidity, isExcluded, isIncluded, isRoot, setNodeAttributes |
Methods inherited from class org.apache.cocoon.xml.AbstractXMLProducer |
---|
setConsumer, setContentHandler, setLexicalHandler |
Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled |
---|
enableLogging, getLogger, setupLogger, setupLogger, setupLogger |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.apache.cocoon.xml.XMLProducer |
---|
setConsumer |
Field Detail |
---|
protected static final String XPATH_NODE_NAME
protected static final String QUERY_ATTR_NAME
protected static final Map mappingFiles
protected DOMParser parser
protected Document doc
protected PrefixResolver prefixResolver
protected org.apache.regexp.RE xmlRE
protected String xpath
protected XPathProcessor processor
Constructor Detail |
---|
public XPathDirectoryGenerator()
Method Detail |
---|
public void dispose()
dispose
in interface Disposable
dispose
in class ServiceableGenerator
public void recycle()
recycle
in interface Recyclable
recycle
in class DirectoryGenerator
public void service(ServiceManager manager) throws ServiceException
service
in interface Serviceable
service
in class ServiceableGenerator
manager
- the ComponentManager
ServiceException
- in case a component could not be foundpublic void setup(SourceResolver resolver, Map objectModel, String src, Parameters par) throws ProcessingException, SAXException, IOException
setup
in interface SitemapModelComponent
setup
in class DirectoryGenerator
resolver
- the SourceResolverobjectModel
- The environmental object modelsrc
- the source attributepar
- the parameters
ProcessingException
- if processing failes
SAXException
- in case of XML related errors
IOException
- in case of file related errorsprotected boolean isXML(File path)
path
- the File to check
protected void performXPathQuery(File xmlFile) throws SAXException
xmlFile
- the File the XPath is performed on.
SAXException
- if something goes wrong while adding the XML snippet.protected void startNode(String nodeName, File path) throws SAXException
startNode
in class DirectoryGenerator
nodeName
- the node currently processingpath
- the file path
SAXException
- in case of errors
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |