Return-Path: Delivered-To: apmail-cocoon-cvs-archive@www.apache.org Received: (qmail 79975 invoked from network); 20 Aug 2004 09:21:42 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 20 Aug 2004 09:21:42 -0000 Received: (qmail 19533 invoked by uid 500); 20 Aug 2004 09:21:41 -0000 Delivered-To: apmail-cocoon-cvs-archive@cocoon.apache.org Received: (qmail 19491 invoked by uid 500); 20 Aug 2004 09:21:40 -0000 Mailing-List: contact cvs-help@cocoon.apache.org; run by ezmlm Precedence: bulk Reply-To: dev@cocoon.apache.org list-help: list-unsubscribe: list-post: Delivered-To: mailing list cvs@cocoon.apache.org Received: (qmail 19477 invoked by uid 99); 20 Aug 2004 09:21:40 -0000 X-ASF-Spam-Status: No, hits=-2.8 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [209.237.227.194] (HELO minotaur.apache.org) (209.237.227.194) by apache.org (qpsmtpd/0.27.1) with SMTP; Fri, 20 Aug 2004 02:21:40 -0700 Received: (qmail 79957 invoked by uid 65534); 20 Aug 2004 09:21:39 -0000 Date: 20 Aug 2004 09:21:39 -0000 Message-ID: <20040820092139.79954.qmail@minotaur.apache.org> From: cziegeler@apache.org To: cvs@cocoon.apache.org Subject: svn commit: rev 36658 - in cocoon/trunk/src: blocks/jfor/java/org/apache/cocoon/serialization java/org/apache/cocoon/serialization X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N Author: cziegeler Date: Fri Aug 20 02:21:39 2004 New Revision: 36658 Modified: cocoon/trunk/src/blocks/jfor/java/org/apache/cocoon/serialization/RTFSerializer.java cocoon/trunk/src/java/org/apache/cocoon/serialization/AbstractTextSerializer.java Log: Enhanced cache key Modified: cocoon/trunk/src/blocks/jfor/java/org/apache/cocoon/serialization/RTFSerializer.java ============================================================================== --- cocoon/trunk/src/blocks/jfor/java/org/apache/cocoon/serialization/RTFSerializer.java (original) +++ cocoon/trunk/src/blocks/jfor/java/org/apache/cocoon/serialization/RTFSerializer.java Fri Aug 20 02:21:39 2004 @@ -21,7 +21,6 @@ import java.io.Writer; import org.apache.avalon.framework.CascadingRuntimeException; -import org.apache.avalon.framework.logger.LogEnabled; import org.jfor.jfor.converter.Converter; /** @@ -29,11 +28,10 @@ * to serialize XSL:FO documents to RTF streams. * * @author Gianugo Rabellino - * @version CVS $Id: RTFSerializer.java,v 1.3 2004/03/05 13:01:57 bdelacretaz Exp $ + * @version CVS $Id$ */ -public class RTFSerializer extends AbstractTextSerializer - implements LogEnabled { +public class RTFSerializer extends AbstractTextSerializer { private Writer rtfWriter; private Converter handler; Modified: cocoon/trunk/src/java/org/apache/cocoon/serialization/AbstractTextSerializer.java ============================================================================== --- cocoon/trunk/src/java/org/apache/cocoon/serialization/AbstractTextSerializer.java (original) +++ cocoon/trunk/src/java/org/apache/cocoon/serialization/AbstractTextSerializer.java Fri Aug 20 02:21:39 2004 @@ -55,7 +55,7 @@ * (Apache Software Foundation) * @author Stefano Mazzocchi * @author Sylvain Wallez - * @version CVS $Id: AbstractTextSerializer.java,v 1.8 2004/03/05 13:02:58 bdelacretaz Exp $ + * @version CVS $Id$ */ public abstract class AbstractTextSerializer extends AbstractSerializer implements Configurable, CacheableProcessingComponent, Contextualizable { @@ -91,6 +91,9 @@ */ private NamespaceAsAttributes namespacePipe; + /** The caching key */ + private String cachingKey = "1"; + /** * Interpose namespace pipe if needed. @@ -175,7 +178,6 @@ * Set the configurations for this serializer. */ public void configure(Configuration conf) throws ConfigurationException { - // configure buffer size // Configuration bsc = conf.getChild("buffer-size", false); // if(null != bsc) @@ -193,37 +195,53 @@ String standAlone = conf.getChild("standalone").getValue(null); String version = conf.getChild("version").getValue(null); + final StringBuffer buffer = new StringBuffer(); + if (cdataSectionElements != null) { format.put(OutputKeys.CDATA_SECTION_ELEMENTS, cdataSectionElements); + buffer.append(";cdata-section-elements=").append(cdataSectionElements); } if (dtPublic != null) { format.put(OutputKeys.DOCTYPE_PUBLIC, dtPublic); + buffer.append(";doctype-public=").append(dtPublic); } if (dtSystem != null) { format.put(OutputKeys.DOCTYPE_SYSTEM, dtSystem); + buffer.append(";doctype-system=").append(dtSystem); } if (encoding != null) { format.put(OutputKeys.ENCODING, encoding); + buffer.append(";encoding=").append(encoding); } if (indent != null) { format.put(OutputKeys.INDENT, indent); + buffer.append(";indent=").append(indent); } if (mediaType != null) { format.put(OutputKeys.MEDIA_TYPE, mediaType); + buffer.append(";media-type=").append(mediaType); } if (method != null) { format.put(OutputKeys.METHOD, method); + buffer.append(";method=").append(method); } if (omitXMLDeclaration != null) { format.put(OutputKeys.OMIT_XML_DECLARATION, omitXMLDeclaration); + buffer.append(";omit-xml-declaration=").append(omitXMLDeclaration); } if (standAlone != null) { format.put(OutputKeys.STANDALONE, standAlone); + buffer.append(";standalone=").append(standAlone); } if (version != null) { format.put(OutputKeys.VERSION, version); + buffer.append(";version=").append(version); } - + + if ( buffer.length() > 0 ) { + this.cachingKey = buffer.toString(); + } + Configuration tFactoryConf = conf.getChild("transformer-factory", false); if (tFactoryConf != null) { String tFactoryClass = tFactoryConf.getValue(); @@ -271,7 +289,7 @@ * is currently not cacheable. */ public java.io.Serializable getKey() { - return "1"; + return this.cachingKey; } /**