cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: rev 36659 - in cocoon/branches/BRANCH_2_1_X/src: blocks/jfor/java/org/apache/cocoon/serialization java/org/apache/cocoon/serialization
Date Fri, 20 Aug 2004 09:42:51 GMT
Author: cziegeler
Date: Fri Aug 20 02:42:50 2004
New Revision: 36659

Modified:
   cocoon/branches/BRANCH_2_1_X/src/blocks/jfor/java/org/apache/cocoon/serialization/RTFSerializer.java
   cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/serialization/AbstractTextSerializer.java
Log:
Enhanced cache key

Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/jfor/java/org/apache/cocoon/serialization/RTFSerializer.java
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/blocks/jfor/java/org/apache/cocoon/serialization/RTFSerializer.java
(original)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/jfor/java/org/apache/cocoon/serialization/RTFSerializer.java
Fri Aug 20 02:42:50 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 <a href="mailto:gianugo@rabellino.it">Gianugo Rabellino</a>
- * @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/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/serialization/AbstractTextSerializer.java
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/serialization/AbstractTextSerializer.java
(original)
+++ cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/serialization/AbstractTextSerializer.java
Fri Aug 20 02:42:50 2004
@@ -55,7 +55,7 @@
  *         (Apache Software Foundation)
  * @author <a href="mailto:stefano@apache.org">Stefano Mazzocchi</a>
  * @author <a href="mailto:sylvain.wallez@anyware-tech.com">Sylvain Wallez</a>
- * @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,35 +195,51 @@
         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);
@@ -271,7 +289,7 @@
      *              is currently not cacheable.
      */
     public java.io.Serializable getKey() {
-        return "1";
+        return this.cachingKey;
     }
 
     /**

Mime
View raw message