org.apache.cocoon.serialization
Class FOPSerializer

java.lang.Object
  |
  +--org.apache.avalon.framework.logger.AbstractLoggable
        |
        +--org.apache.cocoon.xml.AbstractXMLProducer
              |
              +--org.apache.cocoon.xml.AbstractXMLPipe
                    |
                    +--org.apache.cocoon.serialization.AbstractSerializer
                          |
                          +--org.apache.cocoon.serialization.FOPSerializer
All Implemented Interfaces:
Cacheable, org.apache.avalon.framework.component.Component, org.apache.avalon.framework.component.Composable, org.apache.avalon.framework.configuration.Configurable, org.xml.sax.ContentHandler, org.xml.sax.ext.LexicalHandler, org.apache.avalon.framework.logger.Loggable, org.apache.avalon.excalibur.pool.Poolable, org.apache.avalon.excalibur.pool.Recyclable, Serializer, SitemapOutputComponent, XMLConsumer, XMLPipe, XMLProducer

public class FOPSerializer
extends AbstractSerializer
implements org.apache.avalon.framework.component.Composable, org.apache.avalon.framework.configuration.Configurable, Cacheable

Version:
CVS $Id: FOPSerializer.java,v 1.7.2.5 2002/11/21 15:06:49 sylvain Exp $
Author:
?, Vadim Gritsenko

Field Summary
protected  org.apache.fop.apps.Driver driver
          The Driver which is FOP.
protected static RendererFactory factory
          The Renderer Factory to use
protected  org.apache.avalon.framework.logger.Logger logger
          This logger is used for FOP
protected  org.apache.avalon.framework.component.ComponentManager manager
          Manager to get URLFactory from.
protected  java.lang.String mimetype
          The current mime-type.
protected  org.apache.fop.render.Renderer renderer
          The current Renderer.
protected  java.lang.String rendererName
          The renderer name if configured
protected  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, lexicalHandler, xmlConsumer
 
Fields inherited from interface org.apache.cocoon.serialization.Serializer
ROLE
 
Constructor Summary
FOPSerializer()
           
 
Method Summary
 void compose(org.apache.avalon.framework.component.ComponentManager componentManager)
          Set the component manager for this serializer.
 void configure(org.apache.avalon.framework.configuration.Configuration conf)
          Set the configurations for this serializer.
 long generateKey()
          Generate the unique key.
 CacheValidity generateValidity()
          Generate the validity object.
 java.lang.String getMimeType()
          Return the MIME type.
 void recycle()
          Recycle serializer by removing references
 void setOutputStream(java.io.OutputStream out)
          Create the FOP driver Set the OutputStream where the XML should be serialized.
 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.AbstractLoggable
getLogger, setLogger, 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

factory

protected static RendererFactory factory
The Renderer Factory to use

driver

protected org.apache.fop.apps.Driver driver
The Driver which is FOP.

renderer

protected org.apache.fop.render.Renderer renderer
The current Renderer.

mimetype

protected java.lang.String mimetype
The current mime-type.

rendererName

protected java.lang.String rendererName
The renderer name if configured

setContentLength

protected boolean setContentLength
Should we set the content length ?

logger

protected org.apache.avalon.framework.logger.Logger logger
This logger is used for FOP

manager

protected org.apache.avalon.framework.component.ComponentManager manager
Manager to get URLFactory from.
Constructor Detail

FOPSerializer

public FOPSerializer()
Method Detail

compose

public void compose(org.apache.avalon.framework.component.ComponentManager componentManager)
             throws org.apache.avalon.framework.component.ComponentException
Set the component manager for this serializer.
Specified by:
compose in interface org.apache.avalon.framework.component.Composable

configure

public void configure(org.apache.avalon.framework.configuration.Configuration conf)
               throws org.apache.avalon.framework.configuration.ConfigurationException
Set the configurations for this serializer.
Specified by:
configure in interface org.apache.avalon.framework.configuration.Configurable

getMimeType

public java.lang.String getMimeType()
Return the MIME type.
Overrides:
getMimeType in class AbstractSerializer

setOutputStream

public void setOutputStream(java.io.OutputStream out)
Create the FOP driver Set the OutputStream where the XML should be serialized.
Overrides:
setOutputStream in class AbstractSerializer

generateKey

public long generateKey()
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:
generateKey in interface Cacheable
Returns:
The generated key or 0 if the component is currently not cacheable.

generateValidity

public CacheValidity generateValidity()
Generate the validity object. Before this method can be invoked the generateKey() method must be invoked.
Specified by:
generateValidity in interface Cacheable
Returns:
The generated validity object or null if the component is currently not cacheable.

recycle

public void recycle()
Recycle serializer by removing references
Overrides:
recycle in class AbstractSerializer

shouldSetContentLength

public boolean shouldSetContentLength()
Test if the component wants to set the content length
Overrides:
shouldSetContentLength in class AbstractSerializer


Copyright � 1999-2002 Apache Software Foundation. All Rights Reserved.