Package org.ametys.core.cocoon
Class FOPNGSerializer
- All Implemented Interfaces:
Poolable
,Recyclable
,Disposable
,Component
,Configurable
,Contextualizable
,LogEnabled
,Serviceable
,CacheableProcessingComponent
,Serializer
,SitemapOutputComponent
,XMLConsumer
,XMLPipe
,XMLProducer
,XMLConsumer
,org.apache.xmlgraphics.io.ResourceResolver
,ContentHandler
,LexicalHandler
public class FOPNGSerializer
extends AbstractSerializer
implements Configurable, CacheableProcessingComponent, Serviceable, org.apache.xmlgraphics.io.ResourceResolver, Disposable, Contextualizable
FOP 0.95 (and newer) based serializer.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic final class
An InputStream which releases the Cocoon/Avalon source from which the InputStream has been retrieved when the stream is closed. -
Field Summary
Modifier and TypeFieldDescriptionprotected org.apache.fop.apps.Fop
The FOP instance.protected org.apache.fop.apps.FopFactory
Factory to create fop objectsprotected ServiceManager
Manager to get URLFactory from.protected String
The currentmime-type
.protected SourceResolver
The source resolverprotected boolean
Should we set the content length ?Fields inherited from class org.apache.cocoon.serialization.AbstractSerializer
output
Fields inherited from class org.apache.cocoon.xml.AbstractXMLProducer
contentHandler, EMPTY_CONTENT_HANDLER, lexicalHandler, xmlConsumer
Fields inherited from interface org.apache.cocoon.serialization.Serializer
ROLE
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
configure
(Configuration conf) Set the configurations for this serializer.void
contextualize
(Context context) void
dispose()
getKey()
Generate the unique key.Return the MIME type.getOutputStream
(URI uri) org.apache.xmlgraphics.io.Resource
getResource
(URI uri) Generate the validity object.void
recycle()
Recycle serializer by removing referencesvoid
service
(ServiceManager smanager) Set the component manager for this serializer.void
boolean
Test if the component wants to set the content lengthMethods inherited from class org.apache.cocoon.xml.AbstractXMLPipe
characters, comment, endCDATA, endDocument, endDTD, endElement, endEntity, endPrefixMapping, ignorableWhitespace, processingInstruction, setDocumentLocator, skippedEntity, startCDATA, startDocument, startDTD, startElement, 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, declaration, endDocument, endElement, endPrefixMapping, ignorableWhitespace, processingInstruction, setDocumentLocator, skippedEntity, startDocument, startElement, 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 Details
-
_resolver
The source resolver -
_fopfactory
Factory to create fop objects -
_fop
The FOP instance. -
_mimetype
The currentmime-type
. -
_setContentLength
Should we set the content length ? -
_manager
Manager to get URLFactory from.
-
-
Constructor Details
-
FOPNGSerializer
public FOPNGSerializer()
-
-
Method Details
-
contextualize
- Specified by:
contextualize
in interfaceContextualizable
- Throws:
ContextException
-
service
Set the component manager for this serializer.- Specified by:
service
in interfaceServiceable
- Throws:
ServiceException
-
configure
Set the configurations for this serializer.- Specified by:
configure
in interfaceConfigurable
- Throws:
ConfigurationException
-
recycle
Recycle serializer by removing references- Specified by:
recycle
in interfaceRecyclable
- Overrides:
recycle
in classAbstractSerializer
-
dispose
- Specified by:
dispose
in interfaceDisposable
-
getMimeType
Return the MIME type.- Specified by:
getMimeType
in interfaceSitemapOutputComponent
- Overrides:
getMimeType
in classAbstractSerializer
-
setOutputStream
- Specified by:
setOutputStream
in interfaceSitemapOutputComponent
- Overrides:
setOutputStream
in classAbstractSerializer
- Throws:
IOException
-
getKey
Generate the unique key. This key must be unique inside the space of this component. This method must be invoked before the generateValidity() method.- Specified by:
getKey
in interfaceCacheableProcessingComponent
- Returns:
- The generated key or
0
if the component is currently not cacheable.
-
getValidity
Generate the validity object. Before this method can be invoked the generateKey() method must be invoked.- Specified by:
getValidity
in interfaceCacheableProcessingComponent
- Returns:
- The generated validity object or
null
if the component is currently not cacheable.
-
shouldSetContentLength
Test if the component wants to set the content length- Specified by:
shouldSetContentLength
in interfaceSitemapOutputComponent
- Overrides:
shouldSetContentLength
in classAbstractSerializer
-
getResource
- Specified by:
getResource
in interfaceorg.apache.xmlgraphics.io.ResourceResolver
- Throws:
IOException
-
getOutputStream
- Specified by:
getOutputStream
in interfaceorg.apache.xmlgraphics.io.ResourceResolver
- Throws:
IOException
-