|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.apache.avalon.framework.logger.AbstractLoggable | +--org.apache.cocoon.xml.AbstractXMLProducer | +--org.apache.cocoon.xml.AbstractXMLPipe | +--org.apache.cocoon.transformation.AbstractTransformer | +--org.apache.cocoon.transformation.CachingCIncludeTransformer
This transformer triggers for the element include
in the
namespace "http://apache.org/cocoon/include/1.0".
The src
attribute contains the url which points to
an xml resource which is include instead of the element.
With the attributes element
, ns
and
prefix
it is possible to specify an element
which surrounds the included content.
Validity of cached pipelines is calculated not by comparing old and new IncludeCacheValidity objects (as in AggregatedCacheValidity) but by comparing timestamps. Validity object of cached pipeline contain two lists: source urls and timestamps. When it comes to checking validity of cached pipeline we know that generation/transformation steps before CIncludeTransformer are valid (otherwise we would have had discarded cached pipeline already) so source url list of new validity will be the same as of old one. Only timestamps have to be recalculated and compared.
Field Summary | |
static java.lang.String |
CINCLUDE_INCLUDE_ELEMENT
|
static java.lang.String |
CINCLUDE_INCLUDE_ELEMENT_ELEMENT_ATTRIBUTE
|
static java.lang.String |
CINCLUDE_INCLUDE_ELEMENT_NS_ATTRIBUTE
|
static java.lang.String |
CINCLUDE_INCLUDE_ELEMENT_PREFIX_ATTRIBUTE
|
static java.lang.String |
CINCLUDE_INCLUDE_ELEMENT_SRC_ATTRIBUTE
|
static java.lang.String |
CINCLUDE_NAMESPACE_URI
|
protected IncludeXMLConsumer |
consumer
The current IncludeXMLConsumer that ommits start and endDocument events. |
protected IncludeCacheValidity |
currentCacheValidity
The current IncludeCacheValidity . |
protected org.apache.avalon.framework.component.ComponentManager |
manager
The current ComponentManager . |
protected SourceResolver |
sourceResolver
The SourceResolver |
Fields inherited from class org.apache.cocoon.xml.AbstractXMLProducer |
contentHandler, lexicalHandler, xmlConsumer |
Fields inherited from interface org.apache.cocoon.transformation.Transformer |
ROLE |
Constructor Summary | |
CachingCIncludeTransformer()
|
Method Summary | |
void |
compose(org.apache.avalon.framework.component.ComponentManager manager)
Composable Interface |
void |
endDocument()
Receive notification of the end of a document. |
void |
endElement(java.lang.String uri,
java.lang.String name,
java.lang.String raw)
Receive notification of the end of an element. |
long |
generateKey()
Generate the unique key. |
CacheValidity |
generateValidity()
Generate the validity object. |
protected IncludeXMLConsumer |
getConsumer()
|
protected void |
processCIncludeElement(java.lang.String src,
java.lang.String element,
java.lang.String ns,
java.lang.String prefix)
|
void |
recycle()
Recycle the component |
void |
setup(SourceResolver resolver,
java.util.Map objectModel,
java.lang.String source,
org.apache.avalon.framework.parameters.Parameters parameters)
Setup the component. |
void |
startElement(java.lang.String uri,
java.lang.String name,
java.lang.String raw,
org.xml.sax.Attributes attr)
Receive notification of the beginning of an element. |
Methods inherited from class org.apache.cocoon.xml.AbstractXMLPipe |
characters, comment, endCDATA, endDTD, endEntity, endPrefixMapping, ignorableWhitespace, processingInstruction, setDocumentLocator, skippedEntity, startCDATA, startDocument, startDTD, startEntity, startPrefixMapping |
Methods inherited from class org.apache.cocoon.xml.AbstractXMLProducer |
setConsumer, setContentHandler, setLexicalHandler |
Methods inherited from class org.apache.avalon.framework.logger.AbstractLoggable |
getLogger, setLogger, 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.xml.sax.ContentHandler |
characters, endPrefixMapping, ignorableWhitespace, processingInstruction, setDocumentLocator, skippedEntity, startDocument, startPrefixMapping |
Methods inherited from interface org.xml.sax.ext.LexicalHandler |
comment, endCDATA, endDTD, endEntity, startCDATA, startDTD, startEntity |
Methods inherited from interface org.apache.cocoon.xml.XMLProducer |
setConsumer |
Field Detail |
public static final java.lang.String CINCLUDE_NAMESPACE_URI
public static final java.lang.String CINCLUDE_INCLUDE_ELEMENT
public static final java.lang.String CINCLUDE_INCLUDE_ELEMENT_SRC_ATTRIBUTE
public static final java.lang.String CINCLUDE_INCLUDE_ELEMENT_ELEMENT_ATTRIBUTE
public static final java.lang.String CINCLUDE_INCLUDE_ELEMENT_NS_ATTRIBUTE
public static final java.lang.String CINCLUDE_INCLUDE_ELEMENT_PREFIX_ATTRIBUTE
protected SourceResolver sourceResolver
SourceResolver
protected org.apache.avalon.framework.component.ComponentManager manager
ComponentManager
.
protected IncludeCacheValidity currentCacheValidity
IncludeCacheValidity
.
protected IncludeXMLConsumer consumer
IncludeXMLConsumer
that ommits start and endDocument events.
Constructor Detail |
public CachingCIncludeTransformer()
Method Detail |
public void setup(SourceResolver resolver, java.util.Map objectModel, java.lang.String source, org.apache.avalon.framework.parameters.Parameters parameters) throws ProcessingException, org.xml.sax.SAXException, java.io.IOException
setup
in interface SitemapModelComponent
ProcessingException
org.xml.sax.SAXException
java.io.IOException
public final void compose(org.apache.avalon.framework.component.ComponentManager manager) throws org.apache.avalon.framework.component.ComponentException
compose
in interface org.apache.avalon.framework.component.Composable
org.apache.avalon.framework.component.ComponentException
public void recycle()
recycle
in interface org.apache.avalon.excalibur.pool.Recyclable
recycle
in class AbstractXMLProducer
public void startElement(java.lang.String uri, java.lang.String name, java.lang.String raw, org.xml.sax.Attributes attr) throws org.xml.sax.SAXException
AbstractXMLPipe
startElement
in interface org.xml.sax.ContentHandler
startElement
in class AbstractXMLPipe
uri
- The Namespace URI, or the empty string if the element has no
Namespace URI or if Namespace
processing is not being performed.name
- The local name (without prefix), or the empty string if
Namespace processing is not being performed.raw
- The raw XML 1.0 name (with prefix), or the empty string if
raw names are not available.attr
- The attributes attached to the element. If there are no
attributes, it shall be an empty Attributes object.
org.xml.sax.SAXException
public void endElement(java.lang.String uri, java.lang.String name, java.lang.String raw) throws org.xml.sax.SAXException
AbstractXMLPipe
endElement
in interface org.xml.sax.ContentHandler
endElement
in class AbstractXMLPipe
uri
- The Namespace URI, or the empty string if the element has no
Namespace URI or if Namespace
processing is not being performed.name
- The local name (without prefix), or the empty string if
Namespace processing is not being performed.raw
- The raw XML 1.0 name (with prefix), or the empty string if
raw names are not available.
org.xml.sax.SAXException
public void endDocument() throws org.xml.sax.SAXException
AbstractXMLPipe
endDocument
in interface org.xml.sax.ContentHandler
endDocument
in class AbstractXMLPipe
org.xml.sax.SAXException
protected void processCIncludeElement(java.lang.String src, java.lang.String element, java.lang.String ns, java.lang.String prefix) throws org.xml.sax.SAXException
org.xml.sax.SAXException
public long generateKey()
generateKey
in interface Cacheable
public CacheValidity generateValidity()
generateValidity
in interface Cacheable
null
if the
component is currently not cacheable.protected IncludeXMLConsumer getConsumer()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |