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 classFOPNGSerializer.ReleaseSourceInputStreamAn 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_fopThe FOP instance.protected org.apache.fop.apps.FopFactory_fopfactoryFactory to create fop objectsprotected ServiceManager_managerManager to get URLFactory from.protected String_mimetypeThe currentmime-type.protected SourceResolver_resolverThe source resolverprotected boolean_setContentLengthShould 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 voidconfigure(Configuration conf)Set the configurations for this serializer.voidcontextualize(Context context)voiddispose()SerializablegetKey()Generate the unique key.StringgetMimeType()Return the MIME type.OutputStreamgetOutputStream(URI uri)org.apache.xmlgraphics.io.ResourcegetResource(URI uri)SourceValiditygetValidity()Generate the validity object.voidrecycle()Recycle serializer by removing referencesvoidservice(ServiceManager smanager)Set the component manager for this serializer.voidsetOutputStream(OutputStream out)booleanshouldSetContentLength()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:
contextualizein interfaceContextualizable- Throws:
ContextException
-
service
public void service(ServiceManager smanager) throws ServiceException
Set the component manager for this serializer.- Specified by:
servicein interfaceServiceable- Throws:
ServiceException
-
configure
public void configure(Configuration conf) throws ConfigurationException
Set the configurations for this serializer.- Specified by:
configurein interfaceConfigurable- Throws:
ConfigurationException
-
recycle
public void recycle()
Recycle serializer by removing references- Specified by:
recyclein interfaceRecyclable- Overrides:
recyclein classAbstractSerializer
-
dispose
public void dispose()
- Specified by:
disposein interfaceDisposable
-
getMimeType
public String getMimeType()
Return the MIME type.- Specified by:
getMimeTypein interfaceSitemapOutputComponent- Overrides:
getMimeTypein classAbstractSerializer
-
setOutputStream
public void setOutputStream(OutputStream out) throws IOException
- Specified by:
setOutputStreamin interfaceSitemapOutputComponent- Overrides:
setOutputStreamin 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:
getKeyin interfaceCacheableProcessingComponent- Returns:
- The generated key or
0if 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:
getValidityin interfaceCacheableProcessingComponent- Returns:
- The generated validity object or
nullif the component is currently not cacheable.
-
shouldSetContentLength
public boolean shouldSetContentLength()
Test if the component wants to set the content length- Specified by:
shouldSetContentLengthin interfaceSitemapOutputComponent- Overrides:
shouldSetContentLengthin classAbstractSerializer
-
getResource
public org.apache.xmlgraphics.io.Resource getResource(URI uri) throws IOException
- Specified by:
getResourcein interfaceorg.apache.xmlgraphics.io.ResourceResolver- Throws:
IOException
-
getOutputStream
public OutputStream getOutputStream(URI uri) throws IOException
- Specified by:
getOutputStreamin interfaceorg.apache.xmlgraphics.io.ResourceResolver- Throws:
IOException
-
-