|
||||||||||
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.xml.AbstractXMLPipe org.apache.cocoon.transformation.AbstractTransformer org.apache.cocoon.transformation.CachingCIncludeTransformer
public class 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.
(scratchpad)
Field Summary | |
---|---|
static String |
CINCLUDE_INCLUDE_ELEMENT
Deprecated. |
static String |
CINCLUDE_INCLUDE_ELEMENT_ELEMENT_ATTRIBUTE
Deprecated. |
static String |
CINCLUDE_INCLUDE_ELEMENT_NS_ATTRIBUTE
Deprecated. |
static String |
CINCLUDE_INCLUDE_ELEMENT_PREFIX_ATTRIBUTE
Deprecated. |
static String |
CINCLUDE_INCLUDE_ELEMENT_SRC_ATTRIBUTE
Deprecated. |
static String |
CINCLUDE_NAMESPACE_URI
Deprecated. |
protected IncludeXMLConsumer |
consumer
Deprecated. The current IncludeXMLConsumer that ommits start and endDocument events. |
protected IncludeCacheValidity |
currentCacheValidity
Deprecated. The current IncludeCacheValidity . |
protected ComponentManager |
manager
Deprecated. The current ComponentManager . |
protected SourceResolver |
sourceResolver
Deprecated. The SourceResolver |
Fields inherited from class org.apache.cocoon.xml.AbstractXMLProducer |
---|
contentHandler, EMPTY_CONTENT_HANDLER, lexicalHandler, xmlConsumer |
Fields inherited from interface org.apache.cocoon.transformation.Transformer |
---|
ROLE |
Constructor Summary | |
---|---|
CachingCIncludeTransformer()
Deprecated. |
Method Summary | |
---|---|
void |
compose(ComponentManager manager)
Deprecated. Composable Interface |
void |
endDocument()
Deprecated. Receive notification of the end of a document. |
void |
endElement(String uri,
String name,
String raw)
Deprecated. Receive notification of the end of an element. |
long |
generateKey()
Deprecated. Generate the unique key. |
CacheValidity |
generateValidity()
Deprecated. Generate the validity object. |
protected IncludeXMLConsumer |
getConsumer()
Deprecated. |
protected void |
processCIncludeElement(String src,
String element,
String ns,
String prefix)
Deprecated. |
void |
recycle()
Deprecated. Recycle the component |
void |
setup(SourceResolver resolver,
Map objectModel,
String source,
Parameters parameters)
Deprecated. Setup the component. |
void |
startElement(String uri,
String name,
String raw,
Attributes attr)
Deprecated. 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.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.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 String CINCLUDE_NAMESPACE_URI
public static final String CINCLUDE_INCLUDE_ELEMENT
public static final String CINCLUDE_INCLUDE_ELEMENT_SRC_ATTRIBUTE
public static final String CINCLUDE_INCLUDE_ELEMENT_ELEMENT_ATTRIBUTE
public static final String CINCLUDE_INCLUDE_ELEMENT_NS_ATTRIBUTE
public static final String CINCLUDE_INCLUDE_ELEMENT_PREFIX_ATTRIBUTE
protected SourceResolver sourceResolver
SourceResolver
protected 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, Map objectModel, String source, Parameters parameters) throws ProcessingException, SAXException, IOException
setup
in interface SitemapModelComponent
ProcessingException
SAXException
IOException
public final void compose(ComponentManager manager) throws ComponentException
compose
in interface Composable
ComponentException
public void recycle()
recycle
in interface Recyclable
recycle
in class AbstractXMLProducer
public void startElement(String uri, String name, String raw, Attributes attr) throws SAXException
AbstractXMLPipe
startElement
in interface 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.
SAXException
public void endElement(String uri, String name, String raw) throws SAXException
AbstractXMLPipe
endElement
in interface 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.
SAXException
public void endDocument() throws SAXException
AbstractXMLPipe
endDocument
in interface ContentHandler
endDocument
in class AbstractXMLPipe
SAXException
protected void processCIncludeElement(String src, String element, String ns, String prefix) throws SAXException
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 |