You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@cocoon.apache.org by cz...@apache.org on 2005/08/25 09:33:20 UTC
svn commit: r240015 - in /cocoon:
blocks/portal/trunk/java/org/apache/cocoon/portal/coplet/adapter/impl/CachingURICopletAdapter.java
blocks/portal/trunk/samples/coplets/basket/basket.js trunk/status.xml
Author: cziegeler
Date: Thu Aug 25 00:33:12 2005
New Revision: 240015
URL: http://svn.apache.org/viewcvs?rev=240015&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/blocks/portal/trunk/java/org/apache/cocoon/portal/coplet/adapter/impl/CachingURICopletAdapter.java
cocoon/blocks/portal/trunk/samples/coplets/basket/basket.js
cocoon/trunk/status.xml
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=240015&r1=240014&r2=240015&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 Thu Aug 25 00:33:12 2005
@@ -54,10 +54,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 the 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";
/** The cache to use for global caching. */
@@ -114,18 +114,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 {
@@ -144,7 +144,7 @@
this.getLogger().warn("Exception during storing response into cache.", pe);
}
} else {
- coplet.setAttribute(CACHE, data);
+ coplet.setTemporaryAttribute(CACHE, data);
}
}
}
@@ -184,7 +184,7 @@
(String) coplet.getCopletData().getAttribute("uri"));
this.cache.remove(key);
} else {
- coplet.removeAttribute(CACHE);
+ coplet.removeTemporaryAttribute(CACHE);
}
}
}
Modified: cocoon/blocks/portal/trunk/samples/coplets/basket/basket.js
URL: http://svn.apache.org/viewcvs/cocoon/blocks/portal/trunk/samples/coplets/basket/basket.js?rev=240015&r1=240014&r2=240015&view=diff
==============================================================================
--- cocoon/blocks/portal/trunk/samples/coplets/basket/basket.js (original)
+++ cocoon/blocks/portal/trunk/samples/coplets/basket/basket.js Thu Aug 25 00:33:12 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/trunk/status.xml
URL: http://svn.apache.org/viewcvs/cocoon/trunk/status.xml?rev=240015&r1=240014&r2=240015&view=diff
==============================================================================
--- cocoon/trunk/status.xml (original)
+++ cocoon/trunk/status.xml Thu Aug 25 00:33:12 2005
@@ -530,6 +530,12 @@
</action>
</release>
<release version="2.1.8" date="TBD">
+ <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>