cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: r290670 - in /cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/coplet: CopletData.java CopletInstanceData.java adapter/impl/CachingURICopletAdapter.java
Date Wed, 21 Sep 2005 09:56:32 GMT
Author: cziegeler
Date: Wed Sep 21 02:56:28 2005
New Revision: 290670

URL: http://svn.apache.org/viewcvs?rev=290670&view=rev
Log:
Fixing bug in CachingURICopletAdapter report by Jean-Baptiste Quenot <jbq@anyware-tech.com>
(fixes bug #36728).

Modified:
    cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/coplet/CopletData.java
    cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/coplet/CopletInstanceData.java
    cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/coplet/adapter/impl/CachingURICopletAdapter.java

Modified: cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/coplet/CopletData.java
URL: http://svn.apache.org/viewcvs/cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/coplet/CopletData.java?rev=290670&r1=290669&r2=290670&view=diff
==============================================================================
--- cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/coplet/CopletData.java (original)
+++ cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/coplet/CopletData.java Wed Sep
21 02:56:28 2005
@@ -92,8 +92,8 @@
         this.copletBaseData = copletBaseData;
     }
 
-    public void removeAttribute(String key) {
-        this.attributes.remove(key);
+    public Object removeAttribute(String key) {
+        return this.attributes.remove(key);
     }
     
     public Object getAttribute(String key) {

Modified: cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/coplet/CopletInstanceData.java
URL: http://svn.apache.org/viewcvs/cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/coplet/CopletInstanceData.java?rev=290670&r1=290669&r2=290670&view=diff
==============================================================================
--- cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/coplet/CopletInstanceData.java
(original)
+++ cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/coplet/CopletInstanceData.java
Wed Sep 21 02:56:28 2005
@@ -81,8 +81,8 @@
         this.attributes.put(key, value);
     }
     
-    public void removeAttribute(String key) {
-        this.attributes.remove(key);
+    public Object removeAttribute(String key) {
+        return this.attributes.remove(key);
     }
     
     public Map getAttributes() {
@@ -115,8 +115,8 @@
         this.temporaryAttributes.put(key, value);
     }
     
-    public void removeTemporaryAttribute(String key) {
-        this.temporaryAttributes.remove(key);
+    public Object removeTemporaryAttribute(String key) {
+        return this.temporaryAttributes.remove(key);
     }
     
     public Map getTemporaryAttributes() {

Modified: cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/coplet/adapter/impl/CachingURICopletAdapter.java
URL: http://svn.apache.org/viewcvs/cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/coplet/adapter/impl/CachingURICopletAdapter.java?rev=290670&r1=290669&r2=290670&view=diff
==============================================================================
--- cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/coplet/adapter/impl/CachingURICopletAdapter.java
(original)
+++ cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/coplet/adapter/impl/CachingURICopletAdapter.java
Wed Sep 21 02:56:28 2005
@@ -135,17 +135,19 @@
 
                 super.streamContent(coplet, uri, bc);
                 data = bc.getSAXFragment();
-                if ( cacheGlobal ) {
-                    CachedResponse response = new CachedResponse((SourceValidity[])null,
(byte[])data);
-                    try {
-                        final String key = this.getCacheKey(coplet, uri);
-                        this.cache.store(key, response);
-                    } catch (ProcessingException pe) {
-                        // we ignore this
-                        this.getLogger().warn("Exception during storing response into cache.",
pe);
+                if (coplet.removeTemporaryAttribute(DO_NOT_CACHE) == null) {
+                    if ( cacheGlobal ) {
+                        CachedResponse response = new CachedResponse((SourceValidity[])null,
(byte[])data);
+                        try {
+                            final String key = this.getCacheKey(coplet, uri);
+                            this.cache.store(key, response);
+                        } catch (ProcessingException pe) {
+                            // we ignore this
+                            this.getLogger().warn("Exception during storing response into
cache.", pe);
+                        }
+                    } else {
+                        coplet.setTemporaryAttribute(CACHE, data);
                     }
-                } else {
-                    coplet.setTemporaryAttribute(CACHE, data);
                 }
             }
         }



Mime
View raw message