|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.apache.avalon.framework.logger.AbstractLogEnabled
org.apache.cocoon.xml.AbstractXMLProducer
org.apache.cocoon.xml.AbstractXMLPipe
org.apache.cocoon.transformation.AbstractTransformer
org.apache.cocoon.transformation.AbstractSAXTransformer
org.apache.cocoon.transformation.CIncludeTransformer
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.cached-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.
First, it works like the usual include command. But it can be
configured with various parameters:
The most important one is the expires parameter.
If (and only if) this is set to a value greater than zero,
all included content is cached for the given period of time.
So if any other request includes the same URI, the content
is fetched from the cache. The expires value is in seconds.
Usually the content is cached in the usual store, but you
can also define a writeable source with the source parameter,
e.g. "file:/c:/temp". Then the cached content is written into this
directory.
With the optional purge set to true
the cache is purged which means the cached content is regarded as
invalid nevertheless if it has expired or not.
With the optional parameter parallel the various
included contents are processed (included) in parallel rather than
in a series.
With the optional parameter preemptive set to true
a pre-emptive caching is activated. When a resource is requested with
pre-emptive caching, this transformer always attempts to get the
content from the cache. If the content is not in the cache, it is
of course retrieved from the original source and cached.
If the cached resource has expired, it is still provided. The cache
is updated by a background task. This task has to be started
beforehand.| Fields inherited from class org.apache.cocoon.transformation.AbstractSAXTransformer |
context, defaultNamespaceURI, EMPTY_ATTRIBUTES, emptyAttributes, ignoreEmptyCharacters, ignoreEventsCount, ignoreHooksCount, ignoreWhitespaces, manager, namespaceURI, objectModel, parameters, recorderStack, request, resolver, response, source, stack |
| 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 | |
CIncludeTransformer()
Constructor Set the namespace |
|
| Method Summary | |
void |
dispose()
|
protected Object |
endCompiledXMLRecording()
Stop recording of compiled XML. |
void |
endDocument()
Process the SAX event. |
void |
endTransformingElement(String uri,
String name,
String raw)
Start processing elements of our namespace. |
Serializable |
getKey()
Generate the unique key. |
SourceValidity |
getValidity()
Generate the validity object. |
protected String |
processCIncludeElement(String src,
String element,
String select,
String ns,
String prefix,
boolean stripRoot,
boolean cache)
|
void |
recycle()
Recycle the component |
void |
service(ServiceManager manager)
|
void |
setup(SourceResolver resolver,
Map objectModel,
String source,
Parameters parameters)
Setup the component. |
protected void |
startCompiledXMLRecording()
Start recording of compiled xml. |
void |
startDocument()
Process the SAX event. |
void |
startTransformingElement(String uri,
String name,
String raw,
Attributes attr)
Start processing elements of our namespace. |
| 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 |
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_SELECT_ATTRIBUTE
public static final String CINCLUDE_INCLUDE_ELEMENT_NS_ATTRIBUTE
public static final String CINCLUDE_INCLUDE_ELEMENT_PREFIX_ATTRIBUTE
public static final String CINCLUDE_INCLUDE_ELEMENT_STRIP_ROOT_ATTRIBUTE
public static final String CINCLUDE_INCLUDEXML_ELEMENT
public static final String CINCLUDE_INCLUDEXML_ELEMENT_IGNORE_ERRORS_ATTRIBUTE
public static final String CINCLUDE_SRC_ELEMENT
public static final String CINCLUDE_CONFIGURATION_ELEMENT
public static final String CINCLUDE_PARAMETERS_ELEMENT
public static final String CINCLUDE_PARAMETER_ELEMENT
public static final String CINCLUDE_NAME_ELEMENT
public static final String CINCLUDE_VALUE_ELEMENT
public static final String CINCLUDE_CACHED_INCLUDE_ELEMENT
protected static final String CINCLUDE_CACHED_INCLUDE_PLACEHOLDER_ELEMENT
protected Parameters configurationParameters
protected SourceParameters resourceParameters
protected int state
protected IncludeCacheManager cacheManager
protected IncludeCacheManagerSession cachingSession
protected boolean compiling
protected IncludeXMLConsumer filter
protected XMLSerializer recorder
protected AttributesImpl srcAttributes
protected boolean supportCaching
protected long startTime
| Constructor Detail |
public CIncludeTransformer()
| Method Detail |
public void setup(SourceResolver resolver,
Map objectModel,
String source,
Parameters parameters)
throws ProcessingException,
SAXException,
IOException
setup in interface SitemapModelComponentsetup in class AbstractSAXTransformerProcessingException
SAXException
IOException
public void service(ServiceManager manager)
throws ServiceException
service in interface Serviceableservice in class AbstractSAXTransformerServiceExceptionServiceable.service(org.apache.avalon.framework.service.ServiceManager)public void dispose()
dispose in interface Disposabledispose in class AbstractSAXTransformerDisposable.dispose()public void recycle()
recycle in interface Recyclablerecycle in class AbstractSAXTransformer
public void startTransformingElement(String uri,
String name,
String raw,
Attributes attr)
throws ProcessingException,
IOException,
SAXException
AbstractSAXTransformer
startTransformingElement in class AbstractSAXTransformeruri - The namespace of the element.name - The local name of the element.raw - The qualified name of the element.attr - The attributes of the element.
ProcessingException
IOException
SAXException
public void endTransformingElement(String uri,
String name,
String raw)
throws ProcessingException,
IOException,
SAXException
AbstractSAXTransformer
endTransformingElement in class AbstractSAXTransformeruri - The namespace of the element.name - The local name of the element.raw - The qualified name of the element.
ProcessingException
IOException
SAXException
protected String processCIncludeElement(String src,
String element,
String select,
String ns,
String prefix,
boolean stripRoot,
boolean cache)
throws SAXException,
IOException
SAXException
IOException
protected void startCompiledXMLRecording()
throws SAXException
SAXException
protected Object endCompiledXMLRecording()
throws SAXException
SAXException
public void startDocument()
throws SAXException
AbstractSAXTransformerAbstractSAXTransformer.setupTransforming() is invoked.
startDocument in interface ContentHandlerstartDocument in class AbstractSAXTransformerSAXExceptionContentHandler.startDocument()
public void endDocument()
throws SAXException
AbstractSAXTransformer
endDocument in interface ContentHandlerendDocument in class AbstractSAXTransformerSAXExceptionContentHandler.endDocument()public Serializable getKey()
CacheableProcessingComponent
getKey in interface CacheableProcessingComponentnull if the component
is currently not cacheable.CacheableProcessingComponent.getKey()public SourceValidity getValidity()
CacheableProcessingComponent
getValidity in interface CacheableProcessingComponentnull if the
component is currently not cacheable.CacheableProcessingComponent.getValidity()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||