cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: r240014 - in /cocoon/branches/BRANCH_2_1_X: src/blocks/portal/java/org/apache/cocoon/portal/coplet/adapter/impl/CachingURICopletAdapter.java src/blocks/portal/samples/coplets/basket/basket.js status.xml
Date Thu, 25 Aug 2005 07:30:25 GMT
Author: cziegeler
Date: Thu Aug 25 00:30:14 2005
New Revision: 240014

URL: http://svn.apache.org/viewcvs?rev=240014&view=rev
Log:
Fix bugs in CachingURICopletAdapter - store cache information in temporary attributes.
This bug fix introduces incompatible changes: the cache validity attribute is not
used anymore, use the cache temporary attribute instead and update your code to
use temporary attributes instead of (persistent) attributes.

Modified:
    cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/coplet/adapter/impl/CachingURICopletAdapter.java
    cocoon/branches/BRANCH_2_1_X/src/blocks/portal/samples/coplets/basket/basket.js
    cocoon/branches/BRANCH_2_1_X/status.xml

Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/coplet/adapter/impl/CachingURICopletAdapter.java
URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/coplet/adapter/impl/CachingURICopletAdapter.java?rev=240014&r1=240013&r2=240014&view=diff
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/coplet/adapter/impl/CachingURICopletAdapter.java
(original)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/portal/java/org/apache/cocoon/portal/coplet/adapter/impl/CachingURICopletAdapter.java
Thu Aug 25 00:30:14 2005
@@ -58,10 +58,10 @@
     /** The configuration name for ignoring sizing events to clear the cache. */
     public static final String CONFIGURATION_IGNORE_SIZING_EVENTS = "ignore-sizing-events";
 
-    /** The attribute name for storing the cached coplet content. */
+    /** The temporary attribute name for the storing the cached coplet content. */
     public static final String CACHE = "cacheData";
 
-    /** This attribute can be set on the instance to not cache the current response. */
+    /** This temporary attribute can be set on the instance to not cache the current response.
*/
     public static final String DO_NOT_CACHE = "doNotCache";
 
     /** 
@@ -143,18 +143,18 @@
                     data = response.getResponse();
                 }
             } else {
-                data = coplet.getAttribute(CACHE);
+                data = coplet.getTemporaryAttribute(CACHE);
             }
         } 
         if (data == null) {
             // if caching is permanently or temporary disabled, flush the cache and invoke
coplet
-            if ( !cachingEnabled || coplet.getAttribute(DO_NOT_CACHE) != null ) {
-                coplet.removeAttribute(DO_NOT_CACHE);
+            if ( !cachingEnabled || coplet.getTemporaryAttribute(DO_NOT_CACHE) != null )
{
+                coplet.removeTemporaryAttribute(DO_NOT_CACHE);
                 if ( cacheGlobal ) {
                     final String key = this.getCacheKey(coplet, uri);
                     this.cache.remove(key); 
                 } else {
-                    coplet.removeAttribute(CACHE);
+                    coplet.removeTemporaryAttribute(CACHE);
                 }
                 super.streamContent(coplet, uri, contentHandler);                
             } else {
@@ -173,7 +173,7 @@
                         this.getLogger().warn("Exception during storing response into cache.",
pe);
                     }
                 } else {
-                    coplet.setAttribute(CACHE, data);
+                    coplet.setTemporaryAttribute(CACHE, data);
                 }
             }
         }
@@ -213,7 +213,7 @@
                                                     (String) coplet.getCopletData().getAttribute("uri"));
                 this.cache.remove(key);
             } else {
-                coplet.removeAttribute(CACHE);
+                coplet.removeTemporaryAttribute(CACHE);
             }
         }
     }

Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/portal/samples/coplets/basket/basket.js
URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/blocks/portal/samples/coplets/basket/basket.js?rev=240014&r1=240013&r2=240014&view=diff
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/blocks/portal/samples/coplets/basket/basket.js (original)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/portal/samples/coplets/basket/basket.js Thu Aug
25 00:30:14 2005
@@ -124,7 +124,7 @@
     }
     
     // we have to reset our state
-    coplet.setAttribute("doNotCache", "1");
+    coplet.setTemporaryAttribute("doNotCache", "1");
     coplet.setTemporaryAttribute("application-uri", coplet.getCopletData().getAttribute("temporary:application-uri"));
 
     // and now do a redirect

Modified: cocoon/branches/BRANCH_2_1_X/status.xml
URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/status.xml?rev=240014&r1=240013&r2=240014&view=diff
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/status.xml (original)
+++ cocoon/branches/BRANCH_2_1_X/status.xml Thu Aug 25 00:30:14 2005
@@ -196,6 +196,12 @@
 
   <changes>
   <release version="@version@" date="@date@">
+    <action dev="CZ" type="fix">
+      Portal block: Fix bugs in CachingURICopletAdapter - store cache information in temporary
attributes.
+                    This bug fix introduces incompatible changes: the cache validity attribute
is not
+                    used anymore, use the cache temporary attribute instead and update your
code to
+                    use temporary attributes instead of (persistent) attributes.
+    </action>
     <action dev="AG" type="update">
       Updated jakarta-regexp to 1.4.
     </action>



Mime
View raw message