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
Nested Classes Modifier and Type Class Description static class
FOPNGSerializer.ReleaseSourceInputStream
An InputStream which releases the Cocoon/Avalon source from which the InputStream has been retrieved when the stream is closed.
-
Field Summary
Fields Modifier and Type Field Description protected org.apache.fop.apps.Fop
_fop
The FOP instance.protected org.apache.fop.apps.FopFactory
_fopfactory
Factory to create fop objectsprotected ServiceManager
_manager
Manager to get URLFactory from.protected String
_mimetype
The currentmime-type
.protected SourceResolver
_resolver
The source resolverprotected boolean
_setContentLength
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
Constructors Constructor Description FOPNGSerializer()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
configure(Configuration conf)
Set the configurations for this serializer.void
contextualize(Context context)
void
dispose()
Serializable
getKey()
Generate the unique key.String
getMimeType()
Return the MIME type.OutputStream
getOutputStream(URI uri)
org.apache.xmlgraphics.io.Resource
getResource(URI uri)
SourceValidity
getValidity()
Generate the validity object.void
recycle()
Recycle serializer by removing referencesvoid
service(ServiceManager smanager)
Set the component manager for this serializer.void
setOutputStream(OutputStream out)
boolean
shouldSetContentLength()
Test if the component wants to set the content length-
Methods 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, 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 Detail
-
_resolver
protected SourceResolver _resolver
The source resolver
-
_fopfactory
protected org.apache.fop.apps.FopFactory _fopfactory
Factory to create fop objects
-
_fop
protected org.apache.fop.apps.Fop _fop
The FOP instance.
-
_setContentLength
protected boolean _setContentLength
Should we set the content length ?
-
_manager
protected ServiceManager _manager
Manager to get URLFactory from.
-
-
Constructor Detail
-
FOPNGSerializer
public FOPNGSerializer()
-
-
Method Detail
-
contextualize
public void contextualize(Context context) throws ContextException
- Specified by:
contextualize
in interfaceContextualizable
- Throws:
ContextException
-
service
public void service(ServiceManager smanager) throws ServiceException
Set the component manager for this serializer.- Specified by:
service
in interfaceServiceable
- Throws:
ServiceException
-
configure
public void configure(Configuration conf) throws ConfigurationException
Set the configurations for this serializer.- Specified by:
configure
in interfaceConfigurable
- Throws:
ConfigurationException
-
recycle
public void recycle()
Recycle serializer by removing references- Specified by:
recycle
in interfaceRecyclable
- Overrides:
recycle
in classAbstractSerializer
-
dispose
public void dispose()
- Specified by:
dispose
in interfaceDisposable
-
getMimeType
public String getMimeType()
Return the MIME type.- Specified by:
getMimeType
in interfaceSitemapOutputComponent
- Overrides:
getMimeType
in classAbstractSerializer
-
setOutputStream
public void setOutputStream(OutputStream out) throws IOException
- Specified by:
setOutputStream
in interfaceSitemapOutputComponent
- Overrides:
setOutputStream
in classAbstractSerializer
- Throws:
IOException
-
getKey
public Serializable 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
public SourceValidity 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
public boolean shouldSetContentLength()
Test if the component wants to set the content length- Specified by:
shouldSetContentLength
in interfaceSitemapOutputComponent
- Overrides:
shouldSetContentLength
in classAbstractSerializer
-
getResource
public org.apache.xmlgraphics.io.Resource getResource(URI uri) throws IOException
- Specified by:
getResource
in interfaceorg.apache.xmlgraphics.io.ResourceResolver
- Throws:
IOException
-
getOutputStream
public OutputStream getOutputStream(URI uri) throws IOException
- Specified by:
getOutputStream
in interfaceorg.apache.xmlgraphics.io.ResourceResolver
- Throws:
IOException
-
-