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 ClassesModifier and TypeClassDescriptionstatic final classAn InputStream which releases the Cocoon/Avalon source from which the InputStream has been retrieved when the stream is closed. -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected org.apache.fop.apps.FopThe FOP instance.protected org.apache.fop.apps.FopFactoryFactory to create fop objectsprotected ServiceManagerManager to get URLFactory from.protected StringThe currentmime-type.protected SourceResolverThe source resolverprotected booleanShould we set the content length ?Fields inherited from class org.apache.cocoon.serialization.AbstractSerializer
outputFields inherited from class org.apache.cocoon.xml.AbstractXMLProducer
contentHandler, EMPTY_CONTENT_HANDLER, lexicalHandler, xmlConsumerFields inherited from interface org.apache.cocoon.serialization.Serializer
ROLE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidconfigure(Configuration conf) Set the configurations for this serializer.voidcontextualize(Context context) voiddispose()getKey()Generate the unique key.Return the MIME type.getOutputStream(URI uri) org.apache.xmlgraphics.io.ResourcegetResource(URI uri) Generate the validity object.voidrecycle()Recycle serializer by removing referencesvoidservice(ServiceManager smanager) Set the component manager for this serializer.voidbooleanTest 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, startPrefixMappingMethods inherited from class org.apache.cocoon.xml.AbstractXMLProducer
setConsumer, setContentHandler, setLexicalHandlerMethods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLoggerMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.xml.sax.ContentHandler
characters, declaration, endDocument, endElement, endPrefixMapping, ignorableWhitespace, processingInstruction, setDocumentLocator, skippedEntity, startDocument, startElement, startPrefixMappingMethods inherited from interface org.xml.sax.ext.LexicalHandler
comment, endCDATA, endDTD, endEntity, startCDATA, startDTD, startEntityMethods 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:
contextualizein interfaceContextualizable- Throws:
ContextException
-
service
Set the component manager for this serializer.- Specified by:
servicein interfaceServiceable- Throws:
ServiceException
-
configure
Set the configurations for this serializer.- Specified by:
configurein interfaceConfigurable- Throws:
ConfigurationException
-
recycle
Recycle serializer by removing references- Specified by:
recyclein interfaceRecyclable- Overrides:
recyclein classAbstractSerializer
-
dispose
- Specified by:
disposein interfaceDisposable
-
getMimeType
Return the MIME type.- Specified by:
getMimeTypein interfaceSitemapOutputComponent- Overrides:
getMimeTypein classAbstractSerializer
-
setOutputStream
- Specified by:
setOutputStreamin interfaceSitemapOutputComponent- Overrides:
setOutputStreamin 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:
getKeyin interfaceCacheableProcessingComponent- Returns:
- The generated key or
0if 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:
getValidityin interfaceCacheableProcessingComponent- Returns:
- The generated validity object or
nullif the component is currently not cacheable.
-
shouldSetContentLength
Test if the component wants to set the content length- Specified by:
shouldSetContentLengthin interfaceSitemapOutputComponent- Overrides:
shouldSetContentLengthin classAbstractSerializer
-
getResource
- Specified by:
getResourcein interfaceorg.apache.xmlgraphics.io.ResourceResolver- Throws:
IOException
-
getOutputStream
- Specified by:
getOutputStreamin interfaceorg.apache.xmlgraphics.io.ResourceResolver- Throws:
IOException
-