svn commit: r106437 - /cocoon/trunk/src/java/org/apache/cocoon/generation/JXTemplateGenerator.java

2004-11-24 Thread unico
Author: unico
Date: Wed Nov 24 09:35:45 2004
New Revision: 106437

URL: http://svn.apache.org/viewcvs?view=revrev=106437
Log:
jxtg validity should be combination of evaluated validity and the template 
source's validity
Modified:
   cocoon/trunk/src/java/org/apache/cocoon/generation/JXTemplateGenerator.java

Modified: 
cocoon/trunk/src/java/org/apache/cocoon/generation/JXTemplateGenerator.java
Url: 
http://svn.apache.org/viewcvs/cocoon/trunk/src/java/org/apache/cocoon/generation/JXTemplateGenerator.java?view=diffrev=106437p1=cocoon/trunk/src/java/org/apache/cocoon/generation/JXTemplateGenerator.javar1=106436p2=cocoon/trunk/src/java/org/apache/cocoon/generation/JXTemplateGenerator.javar2=106437
==
--- cocoon/trunk/src/java/org/apache/cocoon/generation/JXTemplateGenerator.java 
(original)
+++ cocoon/trunk/src/java/org/apache/cocoon/generation/JXTemplateGenerator.java 
Wed Nov 24 09:35:45 2004
@@ -3212,11 +3212,15 @@
public SourceValidity getValidity() {
JXTExpression validityExpr = 
(JXTExpression)getCurrentTemplateProperty(VALIDITY);
 try {
-   return (SourceValidity)getValue(validityExpr, 
globalJexlContext, jxpathContext);
+final SourceValidity sourceValidity = 
this.inputSource.getValidity();
+final SourceValidity templateValidity = (SourceValidity) 
getValue(validityExpr, globalJexlContext, jxpathContext);
+if (sourceValidity != null  templateValidity != null) {
+return new JXSourceValidity(sourceValidity, templateValidity);
+}
} catch (Exception e) {
-   getLogger().error( error evaluating cache key, e );
-   return null;
+   getLogger().error( error evaluating cache validity, e 
);
}
+   return null;
}

private Object getCurrentTemplateProperty(String propertyName) {
@@ -3239,7 +3243,7 @@
 Node node = builder.getDocument().getDocumentElement();
 return node.getChildNodes();
}
-   
+
static final class JXCacheKey implements Serializable {
private final String templateUri;
private final Serializable templateKey;
@@ -3262,4 +3266,50 @@
return false;
}
}
+
+static final class JXSourceValidity implements SourceValidity, 
Serializable {
+private final SourceValidity sourceValidity;
+private final SourceValidity templateValidity;
+private JXSourceValidity(SourceValidity sourceValidity, SourceValidity 
templateValidity) {
+this.sourceValidity = sourceValidity;
+this.templateValidity = templateValidity;
+}
+
+public int isValid() {
+switch (sourceValidity.isValid()) {
+case SourceValidity.INVALID: return SourceValidity.INVALID;
+case SourceValidity.UNKNOWN: {
+if (templateValidity.isValid() == SourceValidity.INVALID) {
+return SourceValidity.INVALID;
+}
+else {
+return SourceValidity.UNKNOWN;
+}
+}
+case SourceValidity.VALID: return templateValidity.isValid();
+}
+return SourceValidity.UNKNOWN;
+}
+
+public int isValid(SourceValidity otherValidity) {
+if (otherValidity instanceof JXSourceValidity) {
+JXSourceValidity otherJXValidity = (JXSourceValidity) 
otherValidity;
+switch 
(sourceValidity.isValid(otherJXValidity.sourceValidity)) {
+   case SourceValidity.INVALID: return 
SourceValidity.INVALID;
+   case SourceValidity.UNKNOWN: {
+   if 
(templateValidity.isValid(otherJXValidity.templateValidity) == 
SourceValidity.INVALID) {
+   return SourceValidity.INVALID;
+   }
+   else {
+   return SourceValidity.UNKNOWN;
+   }
+   }
+   case SourceValidity.VALID: return 
templateValidity.isValid(otherJXValidity.templateValidity);
+}
+}
+return 0;
+}
+
+}
+
 }


svn commit: r106439 - /cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/generation/JXTemplateGenerator.java

2004-11-24 Thread unico
Author: unico
Date: Wed Nov 24 09:35:57 2004
New Revision: 106439

URL: http://svn.apache.org/viewcvs?view=revrev=106439
Log:
jxtg validity should be combination of evaluated validity and the template 
source's validity
Modified:
   
cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/generation/JXTemplateGenerator.java

Modified: 
cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/generation/JXTemplateGenerator.java
Url: 
http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/generation/JXTemplateGenerator.java?view=diffrev=106439p1=cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/generation/JXTemplateGenerator.javar1=106438p2=cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/generation/JXTemplateGenerator.javar2=106439
==
--- 
cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/generation/JXTemplateGenerator.java
 (original)
+++ 
cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/generation/JXTemplateGenerator.java
 Wed Nov 24 09:35:57 2004
@@ -3212,11 +3212,15 @@
 public SourceValidity getValidity() {
 JXTExpression validityExpr = 
(JXTExpression)getCurrentTemplateProperty(VALIDITY);
 try {
-return (SourceValidity)getValue(validityExpr, globalJexlContext, 
jxpathContext);
+final SourceValidity sourceValidity = 
this.inputSource.getValidity();
+final SourceValidity templateValidity = (SourceValidity) 
getValue(validityExpr, globalJexlContext, jxpathContext);
+if (sourceValidity != null  templateValidity != null) {
+return new JXSourceValidity(sourceValidity, templateValidity);
+}
 } catch (Exception e) {
-getLogger().error( error evaluating cache key, e );
-return null;
+getLogger().error( error evaluating cache validity, e );
 }
+return null;
 }
 
 private Object getCurrentTemplateProperty(String propertyName) {
@@ -3261,5 +3265,50 @@
 }
 return false;
 }
+}
+
+static final class JXSourceValidity implements SourceValidity, 
Serializable {
+private final SourceValidity sourceValidity;
+private final SourceValidity templateValidity;
+private JXSourceValidity(SourceValidity sourceValidity, SourceValidity 
templateValidity) {
+this.sourceValidity = sourceValidity;
+this.templateValidity = templateValidity;
+}
+
+public int isValid() {
+switch (sourceValidity.isValid()) {
+case SourceValidity.INVALID: return SourceValidity.INVALID;
+case SourceValidity.UNKNOWN: {
+if (templateValidity.isValid() == SourceValidity.INVALID) {
+return SourceValidity.INVALID;
+}
+else {
+return SourceValidity.UNKNOWN;
+}
+}
+case SourceValidity.VALID: return templateValidity.isValid();
+}
+return SourceValidity.UNKNOWN;
+}
+
+public int isValid(SourceValidity otherValidity) {
+if (otherValidity instanceof JXSourceValidity) {
+JXSourceValidity otherJXValidity = (JXSourceValidity) 
otherValidity;
+switch 
(sourceValidity.isValid(otherJXValidity.sourceValidity)) {
+   case SourceValidity.INVALID: return 
SourceValidity.INVALID;
+   case SourceValidity.UNKNOWN: {
+   if 
(templateValidity.isValid(otherJXValidity.templateValidity) == 
SourceValidity.INVALID) {
+   return SourceValidity.INVALID;
+   }
+   else {
+   return SourceValidity.UNKNOWN;
+   }
+   }
+   case SourceValidity.VALID: return 
templateValidity.isValid(otherJXValidity.templateValidity);
+}
+}
+return 0;
+}
+
 }
 }


svn commit: r76251 - cocoon/trunk/src/java/org/apache/cocoon/components/source/impl

2004-11-18 Thread unico
Author: unico
Date: Thu Nov 18 09:30:58 2004
New Revision: 76251

Modified:
   
cocoon/trunk/src/java/org/apache/cocoon/components/source/impl/SitemapSource.java
Log:
major bugfix: SitemapSourceValidity.isValid(SourceValidity validity) must 
compare its nested validity 
with the other ((SitemapSourceValidity) validity).nested_validity, not with the 
SitemapSourceValidity itself

Modified: 
cocoon/trunk/src/java/org/apache/cocoon/components/source/impl/SitemapSource.java
==
--- 
cocoon/trunk/src/java/org/apache/cocoon/components/source/impl/SitemapSource.java
   (original)
+++ 
cocoon/trunk/src/java/org/apache/cocoon/components/source/impl/SitemapSource.java
   Thu Nov 18 09:30:58 2004
@@ -450,9 +450,12 @@
 }
 
 public int isValid(SourceValidity validity) {
-return(this.nested_validity != null?
-   this.nested_validity.isValid(validity):
-   SourceValidity.INVALID);
+if (validity instanceof SitemapSourceValidity) {
+return(this.nested_validity != null?
+this.nested_validity.isValid(((SitemapSourceValidity) 
validity).getNestedValidity()):
+SourceValidity.INVALID);
+}
+return SourceValidity.INVALID;
 }
 
 public SourceValidity getNestedValidity() {


svn commit: r76252 - cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/components/source/impl

2004-11-18 Thread unico
Author: unico
Date: Thu Nov 18 09:31:07 2004
New Revision: 76252

Modified:
   
cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/components/source/impl/SitemapSource.java
Log:
major bugfix: SitemapSourceValidity.isValid(SourceValidity validity) must 
compare its nested validity 
with the other ((SitemapSourceValidity) validity).nested_validity, not with the 
SitemapSourceValidity itself

Modified: 
cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/components/source/impl/SitemapSource.java
==
--- 
cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/components/source/impl/SitemapSource.java
   (original)
+++ 
cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/components/source/impl/SitemapSource.java
   Thu Nov 18 09:31:07 2004
@@ -517,9 +517,12 @@
 }
 
 public int isValid(SourceValidity validity) {
-return(this.nested_validity != null?
-   this.nested_validity.isValid(validity):
-   SourceValidity.INVALID);
+if (validity instanceof SitemapSourceValidity) {
+return(this.nested_validity != null?
+this.nested_validity.isValid(((SitemapSourceValidity) 
validity).getNestedValidity()):
+SourceValidity.INVALID);
+}
+return SourceValidity.INVALID;
 }
 
 public SourceValidity getNestedValidity() {


svn commit: r76258 - cocoon/trunk/src/blocks/scratchpad/java/org/apache/cocoon/transformation

2004-11-18 Thread unico
Author: unico
Date: Thu Nov 18 09:41:36 2004
New Revision: 76258

Modified:
   
cocoon/trunk/src/blocks/scratchpad/java/org/apache/cocoon/transformation/IncludeTransformer.java
Log:
make sure x_source is nullified

Modified: 
cocoon/trunk/src/blocks/scratchpad/java/org/apache/cocoon/transformation/IncludeTransformer.java
==
--- 
cocoon/trunk/src/blocks/scratchpad/java/org/apache/cocoon/transformation/IncludeTransformer.java
(original)
+++ 
cocoon/trunk/src/blocks/scratchpad/java/org/apache/cocoon/transformation/IncludeTransformer.java
Thu Nov 18 09:41:36 2004
@@ -256,6 +256,7 @@
 this.m_validity = null;
 this.x_parameters = null;
 this.x_value = null;
+this.x_source = null;
 
 if (this.m_buffering) {
 // Wait for threads to complete and release Sources


svn commit: r76259 - cocoon/branches/BRANCH_2_1_X/src/blocks/scratchpad/java/org/apache/cocoon/transformation

2004-11-18 Thread unico
Author: unico
Date: Thu Nov 18 09:41:45 2004
New Revision: 76259

Modified:
   
cocoon/branches/BRANCH_2_1_X/src/blocks/scratchpad/java/org/apache/cocoon/transformation/IncludeTransformer.java
Log:
make sure x_source is nullified

Modified: 
cocoon/branches/BRANCH_2_1_X/src/blocks/scratchpad/java/org/apache/cocoon/transformation/IncludeTransformer.java
==
--- 
cocoon/branches/BRANCH_2_1_X/src/blocks/scratchpad/java/org/apache/cocoon/transformation/IncludeTransformer.java
(original)
+++ 
cocoon/branches/BRANCH_2_1_X/src/blocks/scratchpad/java/org/apache/cocoon/transformation/IncludeTransformer.java
Thu Nov 18 09:41:45 2004
@@ -256,6 +256,7 @@
 this.m_validity = null;
 this.x_parameters = null;
 this.x_value = null;
+this.x_source = null;
 
 if (this.m_buffering) {
 // Wait for threads to complete and release Sources


svn commit: r76260 - cocoon/trunk/src/blocks/scratchpad/java/org/apache/cocoon/components/source/impl

2004-11-18 Thread unico
Author: unico
Date: Thu Nov 18 09:46:32 2004
New Revision: 76260

Modified:
   
cocoon/trunk/src/blocks/scratchpad/java/org/apache/cocoon/components/source/impl/CachingSource.java
Log:
create cached response in the same way irrespective of initialization method

Modified: 
cocoon/trunk/src/blocks/scratchpad/java/org/apache/cocoon/components/source/impl/CachingSource.java
==
--- 
cocoon/trunk/src/blocks/scratchpad/java/org/apache/cocoon/components/source/impl/CachingSource.java
 (original)
+++ 
cocoon/trunk/src/blocks/scratchpad/java/org/apache/cocoon/components/source/impl/CachingSource.java
 Thu Nov 18 09:46:32 2004
@@ -209,14 +209,7 @@
 boolean storeResponse = false;
 CachedSourceResponse response = this.response;
 if (response == null) {
-SourceValidity[] validities;
-if (this.cache instanceof EventAware) {
-validities = new SourceValidity[] { new EventValidity(new 
NamedEvent(this.source.getURI())) };
-}
-else {
-validities = new SourceValidity[] { new 
ExpiresValidity(getExpiration()), source.getValidity() };
-}
-response = new CachedSourceResponse(validities);
+response = new CachedSourceResponse(getCacheValidities());
 storeResponse = true;
 }
 if (response.getExtra() == null) {
@@ -244,7 +237,7 @@
 /* delay caching the response until we have a valid new one */
 CachedSourceResponse response = this.response;
 if (response == null) {
-response = new CachedSourceResponse(new SourceValidity[] { new 
ExpiresValidity(getExpiration()), source.getValidity()});
+response = new CachedSourceResponse(getCacheValidities());
 storeResponse = true;
 }
 if (response.getBinaryResponse() == null) {
@@ -279,7 +272,7 @@
 /* delay caching the response until we have a valid new one */
 CachedSourceResponse response = this.response;
 if (response == null) {
-response = new CachedSourceResponse(new SourceValidity[] { new 
ExpiresValidity(getExpiration()), source.getValidity() });
+response = new CachedSourceResponse(getCacheValidities());
 storeResponse = true;
 }
 if (response.getXMLResponse() == null || refresh) {
@@ -621,7 +614,19 @@
 }
 return valid;
 }
-
+
+private SourceValidity[] getCacheValidities() {
+if (this.cache instanceof EventAware) {
+// use event caching strategy, the associated event is the source 
uri
+return new SourceValidity[] { new EventValidity(new 
NamedEvent(this.source.getURI())) };
+}
+else {
+// we need to store both the cache expiration and the original 
source validity
+// the former is to determine whether to recheck the latter (see 
checkValidity)
+return new SourceValidity[] { new 
ExpiresValidity(getExpiration()), source.getValidity() };
+}
+}
+
 private static boolean isValid(SourceValidity oldValidity, SourceValidity 
newValidity) {
 return (oldValidity.isValid() == SourceValidity.VALID ||
 (oldValidity.isValid() == SourceValidity.UNKNOWN 


svn commit: r76261 - cocoon/branches/BRANCH_2_1_X/src/blocks/scratchpad/java/org/apache/cocoon/components/source/impl

2004-11-18 Thread unico
Author: unico
Date: Thu Nov 18 09:46:41 2004
New Revision: 76261

Modified:
   
cocoon/branches/BRANCH_2_1_X/src/blocks/scratchpad/java/org/apache/cocoon/components/source/impl/CachingSource.java
Log:
create cached response in the same way irrespective of initialization method

Modified: 
cocoon/branches/BRANCH_2_1_X/src/blocks/scratchpad/java/org/apache/cocoon/components/source/impl/CachingSource.java
==
--- 
cocoon/branches/BRANCH_2_1_X/src/blocks/scratchpad/java/org/apache/cocoon/components/source/impl/CachingSource.java
 (original)
+++ 
cocoon/branches/BRANCH_2_1_X/src/blocks/scratchpad/java/org/apache/cocoon/components/source/impl/CachingSource.java
 Thu Nov 18 09:46:41 2004
@@ -209,14 +209,7 @@
 boolean storeResponse = false;
 CachedSourceResponse response = this.response;
 if (response == null) {
-SourceValidity[] validities;
-if (this.cache instanceof EventAware) {
-validities = new SourceValidity[] { new EventValidity(new 
NamedEvent(this.source.getURI())) };
-}
-else {
-validities = new SourceValidity[] { new 
ExpiresValidity(getExpiration()), source.getValidity() };
-}
-response = new CachedSourceResponse(validities);
+response = new CachedSourceResponse(getCacheValidities());
 storeResponse = true;
 }
 if (response.getExtra() == null) {
@@ -244,7 +237,7 @@
 /* delay caching the response until we have a valid new one */
 CachedSourceResponse response = this.response;
 if (response == null) {
-response = new CachedSourceResponse(new SourceValidity[] { new 
ExpiresValidity(getExpiration()), source.getValidity()});
+response = new CachedSourceResponse(getCacheValidities());
 storeResponse = true;
 }
 if (response.getBinaryResponse() == null) {
@@ -279,7 +272,7 @@
 /* delay caching the response until we have a valid new one */
 CachedSourceResponse response = this.response;
 if (response == null) {
-response = new CachedSourceResponse(new SourceValidity[] { new 
ExpiresValidity(getExpiration()), source.getValidity() });
+response = new CachedSourceResponse(getCacheValidities());
 storeResponse = true;
 }
 if (response.getXMLResponse() == null || refresh) {
@@ -621,7 +614,19 @@
 }
 return valid;
 }
-
+
+private SourceValidity[] getCacheValidities() {
+if (this.cache instanceof EventAware) {
+// use event caching strategy, the associated event is the source 
uri
+return new SourceValidity[] { new EventValidity(new 
NamedEvent(this.source.getURI())) };
+}
+else {
+// we need to store both the cache expiration and the original 
source validity
+// the former is to determine whether to recheck the latter (see 
checkValidity)
+return new SourceValidity[] { new 
ExpiresValidity(getExpiration()), source.getValidity() };
+}
+}
+
 private static boolean isValid(SourceValidity oldValidity, SourceValidity 
newValidity) {
 return (oldValidity.isValid() == SourceValidity.VALID ||
 (oldValidity.isValid() == SourceValidity.UNKNOWN 


svn commit: rev 76129 - cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/components/pipeline/impl

2004-11-17 Thread unico
Author: unico
Date: Wed Nov 17 05:44:01 2004
New Revision: 76129

Modified:
   
cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/components/pipeline/impl/AbstractCachingProcessingPipeline.java
Log:
return NOPValidity for event pipeline when it has not yet expired

Modified: 
cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/components/pipeline/impl/AbstractCachingProcessingPipeline.java
==
--- 
cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/components/pipeline/impl/AbstractCachingProcessingPipeline.java
 (original)
+++ 
cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/components/pipeline/impl/AbstractCachingProcessingPipeline.java
 Wed Nov 17 05:44:01 2004
@@ -34,6 +34,7 @@
 import org.apache.excalibur.source.SourceValidity;
 import org.apache.excalibur.source.impl.validity.AggregatedValidity;
 import org.apache.excalibur.source.impl.validity.DeferredValidity;
+import org.apache.excalibur.source.impl.validity.NOPValidity;
 
 import java.io.ByteArrayOutputStream;
 import java.io.OutputStream;
@@ -801,13 +802,20 @@
  * Otherwise return codenull/code
  */
 public SourceValidity getValidityForEventPipeline() {
-if (this.cachedResponse != null  this.toCacheSourceValidities != 
null) {
-final AggregatedValidity validity = new AggregatedValidity();
-for (int i=0; i  this.toCacheSourceValidities.length; i++) {
-validity.add(this.toCacheSourceValidities[i]);
+if (this.cachedResponse != null) {
+if (this.toCacheSourceValidities != null) {
+// This means that the pipeline is valid based on the 
validities 
+// of the individual components
+final AggregatedValidity validity = new AggregatedValidity();
+for (int i=0; i  this.toCacheSourceValidities.length; i++) {
+validity.add(this.toCacheSourceValidities[i]);
+}
+return validity;
+}
+else {
+// This means that the pipeline is valid because it has not 
yet expired
+return NOPValidity.SHARED_INSTANCE;
 }
-return validity;
-
 } else {
 int vals = 0;
 


svn commit: rev 76037 - cocoon/trunk/src/java/org/apache/cocoon/components/pipeline/impl

2004-11-16 Thread unico
Author: unico
Date: Tue Nov 16 13:06:25 2004
New Revision: 76037

Modified:
   
cocoon/trunk/src/java/org/apache/cocoon/components/pipeline/impl/AbstractCachingProcessingPipeline.java
Log:
prevent NPE

Modified: 
cocoon/trunk/src/java/org/apache/cocoon/components/pipeline/impl/AbstractCachingProcessingPipeline.java
==
--- 
cocoon/trunk/src/java/org/apache/cocoon/components/pipeline/impl/AbstractCachingProcessingPipeline.java
 (original)
+++ 
cocoon/trunk/src/java/org/apache/cocoon/components/pipeline/impl/AbstractCachingProcessingPipeline.java
 Tue Nov 16 13:06:25 2004
@@ -781,7 +781,7 @@
  * Otherwise return codenull/code
  */
 public SourceValidity getValidityForEventPipeline() {
-if (this.cachedResponse != null) {
+if (this.cachedResponse != null  this.toCacheSourceValidities != 
null) {
 final AggregatedValidity validity = new AggregatedValidity();
 for (int i=0; i  this.toCacheSourceValidities.length; i++) {
 validity.add(this.toCacheSourceValidities[i]);


svn commit: rev 76038 - cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/components/pipeline/impl

2004-11-16 Thread unico
Author: unico
Date: Tue Nov 16 13:06:41 2004
New Revision: 76038

Modified:
   
cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/components/pipeline/impl/AbstractCachingProcessingPipeline.java
Log:
prevent NPE

Modified: 
cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/components/pipeline/impl/AbstractCachingProcessingPipeline.java
==
--- 
cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/components/pipeline/impl/AbstractCachingProcessingPipeline.java
 (original)
+++ 
cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/components/pipeline/impl/AbstractCachingProcessingPipeline.java
 Tue Nov 16 13:06:41 2004
@@ -801,7 +801,7 @@
  * Otherwise return codenull/code
  */
 public SourceValidity getValidityForEventPipeline() {
-if (this.cachedResponse != null) {
+if (this.cachedResponse != null  this.toCacheSourceValidities != 
null) {
 final AggregatedValidity validity = new AggregatedValidity();
 for (int i=0; i  this.toCacheSourceValidities.length; i++) {
 validity.add(this.toCacheSourceValidities[i]);


svn commit: rev 71474 - cocoon/branches/BRANCH_2_1_X/src/blocks/scratchpad/java/org/apache/cocoon/components/source/impl

2004-11-15 Thread unico
Author: unico
Date: Sun Nov 14 16:07:33 2004
New Revision: 71474

Modified:
   
cocoon/branches/BRANCH_2_1_X/src/blocks/scratchpad/java/org/apache/cocoon/components/source/impl/InspectableTraversableCachingSource.java
   (props changed)
Log:
props


svn commit: rev 57444 - in cocoon/branches/BRANCH_2_1_X: . src/blocks/scratchpad/conf src/blocks/scratchpad/java/org/apache/cocoon/components/source/impl

2004-11-11 Thread unico
Author: unico
Date: Thu Nov 11 08:24:43 2004
New Revision: 57444

Added:
   
cocoon/branches/BRANCH_2_1_X/src/blocks/scratchpad/java/org/apache/cocoon/components/source/impl/InspectableTraversableCachingSource.java
Modified:
   cocoon/branches/BRANCH_2_1_X/blocks.properties
   cocoon/branches/BRANCH_2_1_X/gump.xml
   cocoon/branches/BRANCH_2_1_X/src/blocks/scratchpad/conf/caching-source.xconf
   
cocoon/branches/BRANCH_2_1_X/src/blocks/scratchpad/java/org/apache/cocoon/components/source/impl/CachingSource.java
   
cocoon/branches/BRANCH_2_1_X/src/blocks/scratchpad/java/org/apache/cocoon/components/source/impl/CachingSourceFactory.java
   
cocoon/branches/BRANCH_2_1_X/src/blocks/scratchpad/java/org/apache/cocoon/components/source/impl/DelayRefresher.java
   
cocoon/branches/BRANCH_2_1_X/src/blocks/scratchpad/java/org/apache/cocoon/components/source/impl/TraversableCachingSource.java
   
cocoon/branches/BRANCH_2_1_X/src/blocks/scratchpad/java/org/apache/cocoon/components/source/impl/UpdateTarget.java
   cocoon/branches/BRANCH_2_1_X/status.xml
Log:
port changes to CachingSource from trunk

Modified: cocoon/branches/BRANCH_2_1_X/blocks.properties
==
--- cocoon/branches/BRANCH_2_1_X/blocks.properties  (original)
+++ cocoon/branches/BRANCH_2_1_X/blocks.properties  Thu Nov 11 08:24:43 2004
@@ -59,7 +59,7 @@
 #-[dependency]: fop is needed by tour.
 #include.block.fop=false
 #-[dependency]: hsqldb depends on databases.
-#-[dependency]: hsqldb is needed by jms, petstore.
+#-[dependency]: hsqldb is needed by jms, ojb, petstore.
 #include.block.hsqldb=false
 #-[dependency]: html is needed by portal.
 #include.block.html=false
@@ -82,7 +82,7 @@
 #-[dependency]: session-fw depends on xsp.
 #-[dependency]: session-fw is needed by authentication-fw, portal, 
portal-fw.
 #include.block.session-fw=false
-#-[dependency]: velocity is needed by petstore, scratchpad.
+#-[dependency]: velocity is needed by petstore.
 #include.block.velocity=false
 #include.block.web3=false
 #-[dependency]: xmldb depends on databases.
@@ -110,10 +110,9 @@
 #include.block.cron=false
 #include.block.deli=false
 #-[dependency]: eventcache depends on jms, xsp (for samples).
-#-[dependency]: eventcache is needed by repository.
+#-[dependency]: eventcache is needed by repository, scratchpad.
 #include.block.eventcache=false
 #-[dependency]: faces depends on portal, taglib.
-#-[dependency]: faces is needed by scratchpad.
 #include.block.faces=false
 #-[dependency]: forms depends on xsp (for samples).
 #-[dependency]: forms is needed by apples, javaflow, lucene, 
ojb, petstore, tour.
@@ -124,10 +123,10 @@
 #-[dependency]: jms is needed by eventcache, slide.
 #include.block.jms=false
 #include.block.linotype=false
-#-[dependency]: mail depends on asciiart, scratchpad.
+#-[dependency]: mail depends on asciiart.
 #include.block.mail=false
 #include.block.midi=false
-#-[dependency]: ojb depends on databases, forms (for samples).
+#-[dependency]: ojb depends on databases (for samples), forms (for 
samples), hsqldb (for samples).
 #-[dependency]: ojb is needed by javaflow.
 #include.block.ojb=false
 #-[dependency]: petstore depends on databases, forms, hsqldb, 
velocity.
@@ -135,10 +134,9 @@
 #include.block.proxy=false
 #include.block.qdox=false
 #-[dependency]: repository depends on databases, eventcache.
-#-[dependency]: repository is needed by slide, webdav.
+#-[dependency]: repository is needed by scratchpad, slide, webdav.
 #include.block.repository=false
-#-[dependency]: scratchpad depends on axis, batik (for samples), 
cron, faces, velocity, xsp.
-#-[dependency]: scratchpad is needed by mail.
+#-[dependency]: scratchpad depends on axis, batik (for samples), 
cron, eventcache, repository, xsp.
 #include.block.scratchpad=false
 #include.block.serializers=false
 #-[dependency]: slide depends on jms, repository.

Modified: cocoon/branches/BRANCH_2_1_X/gump.xml
==
--- cocoon/branches/BRANCH_2_1_X/gump.xml   (original)
+++ cocoon/branches/BRANCH_2_1_X/gump.xml   Thu Nov 11 08:24:43 2004
@@ -155,6 +155,8 @@
 depend project=cocoon-block-axis/
 depend project=cocoon-block-batik type=samples/
 depend project=cocoon-block-cron/
+depend project=cocoon-block-eventcache/
+depend project=cocoon-block-repository/
 depend project=cocoon-block-xsp/
 depend project=apache-garbage/
 

Modified: 
cocoon/branches/BRANCH_2_1_X/src/blocks/scratchpad/conf/caching-source.xconf
==
--- 
cocoon/branches/BRANCH_2_1_X/src/blocks/scratchpad/conf/caching-source.xconf
(original)
+++ 
cocoon/branches/BRANCH_2_1_X/src/blocks/scratchpad/conf/caching-source.xconf
Thu Nov 11 08:24:43

svn commit: rev 56954 - cocoon/branches/BRANCH_2_1_X/src/blocks/cron/java/org/apache/cocoon/components/cron

2004-11-08 Thread unico
Author: unico
Date: Mon Nov  8 09:44:43 2004
New Revision: 56954

Modified:
   
cocoon/branches/BRANCH_2_1_X/src/blocks/cron/java/org/apache/cocoon/components/cron/DataSourceComponentConnectionProvider.java
Log:
use selector to lookup datasources in order to work with default way of 
declaring excalibur datasources

Modified: 
cocoon/branches/BRANCH_2_1_X/src/blocks/cron/java/org/apache/cocoon/components/cron/DataSourceComponentConnectionProvider.java
==
--- 
cocoon/branches/BRANCH_2_1_X/src/blocks/cron/java/org/apache/cocoon/components/cron/DataSourceComponentConnectionProvider.java
  (original)
+++ 
cocoon/branches/BRANCH_2_1_X/src/blocks/cron/java/org/apache/cocoon/components/cron/DataSourceComponentConnectionProvider.java
  Mon Nov  8 09:44:43 2004
@@ -22,6 +22,7 @@
 import org.apache.avalon.framework.configuration.ConfigurationException;
 import org.apache.avalon.framework.service.ServiceException;
 import org.apache.avalon.framework.service.ServiceManager;
+import org.apache.avalon.framework.service.ServiceSelector;
 import org.quartz.utils.ConnectionProvider;
 
 /**
@@ -31,12 +32,14 @@
 public class DataSourceComponentConnectionProvider implements 
ConnectionProvider {
 
 private ServiceManager m_manager;
+private ServiceSelector m_datasources;
 private DataSourceComponent m_ds;
 
 public DataSourceComponentConnectionProvider(String dsName, ServiceManager 
manager) throws ConfigurationException {
 m_manager = manager;
 try {
-m_ds = (DataSourceComponent) 
m_manager.lookup(DataSourceComponent.ROLE + / + dsName);
+ m_datasources = (ServiceSelector) 
m_manager.lookup(DataSourceComponent.ROLE + Selector);
+ m_ds = (DataSourceComponent) m_datasources.select(dsName);
 }
 catch (ServiceException e) {
 throw new ConfigurationException(No datasource available by that 
name:  + dsName);
@@ -55,9 +58,13 @@
  */
 public void shutdown() throws SQLException {
 if (m_ds != null) {
-m_manager.release(m_ds);
+m_datasources.release(m_ds);
+}
+if (m_datasources != null) {
+m_manager.release(m_datasources);
 }
 m_ds = null;
+m_datasources = null;
 m_manager = null;
 }
 


svn commit: rev 56955 - cocoon/trunk/src/blocks/cron/java/org/apache/cocoon/components/cron

2004-11-08 Thread unico
Author: unico
Date: Mon Nov  8 09:44:51 2004
New Revision: 56955

Modified:
   
cocoon/trunk/src/blocks/cron/java/org/apache/cocoon/components/cron/DataSourceComponentConnectionProvider.java
Log:
use selector to lookup datasources in order to work with default way of 
declaring excalibur datasources

Modified: 
cocoon/trunk/src/blocks/cron/java/org/apache/cocoon/components/cron/DataSourceComponentConnectionProvider.java
==
--- 
cocoon/trunk/src/blocks/cron/java/org/apache/cocoon/components/cron/DataSourceComponentConnectionProvider.java
  (original)
+++ 
cocoon/trunk/src/blocks/cron/java/org/apache/cocoon/components/cron/DataSourceComponentConnectionProvider.java
  Mon Nov  8 09:44:51 2004
@@ -22,6 +22,7 @@
 import org.apache.avalon.framework.configuration.ConfigurationException;
 import org.apache.avalon.framework.service.ServiceException;
 import org.apache.avalon.framework.service.ServiceManager;
+import org.apache.avalon.framework.service.ServiceSelector;
 import org.quartz.utils.ConnectionProvider;
 
 /**
@@ -31,12 +32,14 @@
 public class DataSourceComponentConnectionProvider implements 
ConnectionProvider {
 
 private ServiceManager m_manager;
+private ServiceSelector m_datasources;
 private DataSourceComponent m_ds;
 
 public DataSourceComponentConnectionProvider(String dsName, ServiceManager 
manager) throws ConfigurationException {
 m_manager = manager;
 try {
-m_ds = (DataSourceComponent) 
m_manager.lookup(DataSourceComponent.ROLE + / + dsName);
+m_datasources = (ServiceSelector) 
m_manager.lookup(DataSourceComponent.ROLE + Selector);
+m_ds = (DataSourceComponent) m_datasources.select(dsName); 
   
 }
 catch (ServiceException e) {
 throw new ConfigurationException(No datasource available by that 
name:  + dsName);
@@ -55,9 +58,13 @@
  */
 public void shutdown() throws SQLException {
 if (m_ds != null) {
-m_manager.release(m_ds);
+m_datasources.release(m_ds);
+}
+if (m_datasources != null) {
+m_manager.release(m_datasources);
 }
 m_ds = null;
+m_datasources = null;
 m_manager = null;
 }
 


svn commit: rev 56663 - cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/components/pipeline/impl

2004-11-05 Thread unico
Author: unico
Date: Fri Nov  5 06:10:13 2004
New Revision: 56663

Modified:
   
cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/components/pipeline/impl/AbstractCachingProcessingPipeline.java
Log:
fix bugzilla bug 31012: this condition doesn't occur

Modified: 
cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/components/pipeline/impl/AbstractCachingProcessingPipeline.java
==
--- 
cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/components/pipeline/impl/AbstractCachingProcessingPipeline.java
 (original)
+++ 
cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/components/pipeline/impl/AbstractCachingProcessingPipeline.java
 Fri Nov  5 06:10:13 2004
@@ -801,7 +801,7 @@
  * Otherwise return codenull/code
  */
 public SourceValidity getValidityForEventPipeline() {
-if (this.cachedResponse != null  this.completeResponseIsCached) {
+if (this.cachedResponse != null) {
 final AggregatedValidity validity = new AggregatedValidity();
 for (int i=0; i  this.toCacheSourceValidities.length; i++) {
 validity.add(this.toCacheSourceValidities[i]);


svn commit: rev 56664 - cocoon/trunk/src/java/org/apache/cocoon/components/pipeline/impl

2004-11-05 Thread unico
Author: unico
Date: Fri Nov  5 06:10:22 2004
New Revision: 56664

Modified:
   
cocoon/trunk/src/java/org/apache/cocoon/components/pipeline/impl/AbstractCachingProcessingPipeline.java
Log:
fix bugzilla bug 31012: this condition doesn't occur

Modified: 
cocoon/trunk/src/java/org/apache/cocoon/components/pipeline/impl/AbstractCachingProcessingPipeline.java
==
--- 
cocoon/trunk/src/java/org/apache/cocoon/components/pipeline/impl/AbstractCachingProcessingPipeline.java
 (original)
+++ 
cocoon/trunk/src/java/org/apache/cocoon/components/pipeline/impl/AbstractCachingProcessingPipeline.java
 Fri Nov  5 06:10:22 2004
@@ -781,7 +781,7 @@
  * Otherwise return codenull/code
  */
 public SourceValidity getValidityForEventPipeline() {
-if (this.cachedResponse != null  this.completeResponseIsCached) {
+if (this.cachedResponse != null) {
 final AggregatedValidity validity = new AggregatedValidity();
 for (int i=0; i  this.toCacheSourceValidities.length; i++) {
 validity.add(this.toCacheSourceValidities[i]);


svn commit: rev 56667 - in cocoon/branches/BRANCH_2_1_X/src: blocks/eventcache/java/org/apache/cocoon/caching/impl java/org/apache/cocoon/components/source/impl

2004-11-05 Thread unico
Author: unico
Date: Fri Nov  5 06:25:33 2004
New Revision: 56667

Modified:
   
cocoon/branches/BRANCH_2_1_X/src/blocks/eventcache/java/org/apache/cocoon/caching/impl/EventAwareCacheImpl.java
   
cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/components/source/impl/SitemapSource.java
Log:
fix bug with new SitemapSourceValidity and eventcaching where no events
for pipelines that use nested pipelines are registered.

Modified: 
cocoon/branches/BRANCH_2_1_X/src/blocks/eventcache/java/org/apache/cocoon/caching/impl/EventAwareCacheImpl.java
==
--- 
cocoon/branches/BRANCH_2_1_X/src/blocks/eventcache/java/org/apache/cocoon/caching/impl/EventAwareCacheImpl.java
 (original)
+++ 
cocoon/branches/BRANCH_2_1_X/src/blocks/eventcache/java/org/apache/cocoon/caching/impl/EventAwareCacheImpl.java
 Fri Nov  5 06:25:33 2004
@@ -27,6 +27,7 @@
 import org.apache.cocoon.caching.EventRegistry;
 import org.apache.cocoon.caching.validity.Event;
 import org.apache.cocoon.caching.validity.EventValidity;
+import org.apache.cocoon.components.source.impl.SitemapSource;
 import org.apache.excalibur.source.SourceValidity;
 import org.apache.excalibur.source.impl.validity.AbstractAggregatedValidity;
 
@@ -174,6 +175,8 @@
 handleAggregatedValidity((AbstractAggregatedValidity)val, key);
 } else if (val instanceof EventValidity) {
 handleEventValidity((EventValidity)val, key);
+} else if (val instanceof SitemapSource.SitemapSourceValidity) {
+examineValidity(((SitemapSource.SitemapSourceValidity) 
val).getNestedValidity(), key);
 }
 }
 

Modified: 
cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/components/source/impl/SitemapSource.java
==
--- 
cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/components/source/impl/SitemapSource.java
   (original)
+++ 
cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/components/source/impl/SitemapSource.java
   Fri Nov  5 06:25:33 2004
@@ -19,6 +19,7 @@
 import java.io.ByteArrayOutputStream;
 import java.io.IOException;
 import java.io.InputStream;
+import java.io.Serializable;
 import java.net.MalformedURLException;
 import java.util.Iterator;
 import java.util.Map;
@@ -497,7 +498,7 @@
 /**
  * A simple SourceValidity protecting callers from resets.
  */
-private static final class SitemapSourceValidity implements SourceValidity 
{
+public static final class SitemapSourceValidity implements SourceValidity, 
Serializable {
 
 private SourceValidity nested_validity = null;
 
@@ -505,7 +506,7 @@
 super();
 }
 
-private void set(SourceValidity validity) {
+void set(SourceValidity validity) {
 this.nested_validity = validity;
 }
 
@@ -520,5 +521,10 @@
this.nested_validity.isValid(validity):
SourceValidity.INVALID);
 }
+
+public SourceValidity getNestedValidity() {
+return this.nested_validity;
+}
+
 }
 }


svn commit: rev 56668 - in cocoon/trunk/src: blocks/eventcache/java/org/apache/cocoon/caching/impl java/org/apache/cocoon/components/source/impl

2004-11-05 Thread unico
Author: unico
Date: Fri Nov  5 06:25:55 2004
New Revision: 56668

Modified:
   
cocoon/trunk/src/blocks/eventcache/java/org/apache/cocoon/caching/impl/EventAwareCacheImpl.java
   
cocoon/trunk/src/java/org/apache/cocoon/components/source/impl/SitemapSource.java
Log:
fix bug with new SitemapSourceValidity and eventcaching where no events
for pipelines that use nested pipelines are registered.

Modified: 
cocoon/trunk/src/blocks/eventcache/java/org/apache/cocoon/caching/impl/EventAwareCacheImpl.java
==
--- 
cocoon/trunk/src/blocks/eventcache/java/org/apache/cocoon/caching/impl/EventAwareCacheImpl.java
 (original)
+++ 
cocoon/trunk/src/blocks/eventcache/java/org/apache/cocoon/caching/impl/EventAwareCacheImpl.java
 Fri Nov  5 06:25:55 2004
@@ -27,6 +27,7 @@
 import org.apache.cocoon.caching.EventRegistry;
 import org.apache.cocoon.caching.validity.Event;
 import org.apache.cocoon.caching.validity.EventValidity;
+import org.apache.cocoon.components.source.impl.SitemapSource;
 import org.apache.excalibur.source.SourceValidity;
 import org.apache.excalibur.source.impl.validity.AbstractAggregatedValidity;
 
@@ -174,6 +175,8 @@
 handleAggregatedValidity((AbstractAggregatedValidity)val, key);
 } else if (val instanceof EventValidity) {
 handleEventValidity((EventValidity)val, key);
+} else if (val instanceof SitemapSource.SitemapSourceValidity) {
+examineValidity(((SitemapSource.SitemapSourceValidity) 
val).getNestedValidity(), key);
 }
 }
 

Modified: 
cocoon/trunk/src/java/org/apache/cocoon/components/source/impl/SitemapSource.java
==
--- 
cocoon/trunk/src/java/org/apache/cocoon/components/source/impl/SitemapSource.java
   (original)
+++ 
cocoon/trunk/src/java/org/apache/cocoon/components/source/impl/SitemapSource.java
   Fri Nov  5 06:25:55 2004
@@ -431,7 +431,7 @@
 /**
  * A simple SourceValidity protecting callers from resets.
  */
-private static final class SitemapSourceValidity implements SourceValidity 
{
+public static final class SitemapSourceValidity implements SourceValidity {
 
 private SourceValidity nested_validity = null;
 
@@ -453,6 +453,10 @@
 return(this.nested_validity != null?
this.nested_validity.isValid(validity):
SourceValidity.INVALID);
+}
+
+public SourceValidity getNestedValidity() {
+return this.nested_validity;
 }
 }
 }


svn commit: rev 56372 - cocoon/branches/BRANCH_2_1_X/src/blocks/repository/java/org/apache/cocoon/components/repository

2004-11-02 Thread unico
Author: unico
Date: Tue Nov  2 05:59:44 2004
New Revision: 56372

Modified:
   
cocoon/branches/BRANCH_2_1_X/src/blocks/repository/java/org/apache/cocoon/components/repository/RepositoryManager.java
Log:
fix deprecated warning

Modified: 
cocoon/branches/BRANCH_2_1_X/src/blocks/repository/java/org/apache/cocoon/components/repository/RepositoryManager.java
==
--- 
cocoon/branches/BRANCH_2_1_X/src/blocks/repository/java/org/apache/cocoon/components/repository/RepositoryManager.java
  (original)
+++ 
cocoon/branches/BRANCH_2_1_X/src/blocks/repository/java/org/apache/cocoon/components/repository/RepositoryManager.java
  Tue Nov  2 05:59:44 2004
@@ -106,15 +106,13 @@
 this.getLogger().debug(loading class + className);
 }
 
-Repository repo = (Repository)repoClass.newInstance();
+Repository repo = (Repository) repoClass.newInstance();
 LifecycleHelper.setupComponent(repo,
this.getLogger(),
null,
this.manager,
-   null,
repoConfiguration,
true);
-
 repo.setCredentials(credentials);
 return repo;
 


svn commit: rev 55841 - cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/components

2004-10-28 Thread unico
Author: unico
Date: Thu Oct 28 06:09:17 2004
New Revision: 55841

Modified:
   
cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/components/CocoonComponentManager.java
Log:
EnvironmentDescriptor must be released before the Environment is cleaned
because it still needs a working environment during release. 
This fixes a NPE that occurred in certain scenarios.

Modified: 
cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/components/CocoonComponentManager.java
==
--- 
cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/components/CocoonComponentManager.java
  (original)
+++ 
cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/components/CocoonComponentManager.java
  Thu Oct 28 06:09:17 2004
@@ -213,9 +213,9 @@
  * [EMAIL PROTECTED] #startProcessing(Environment)}.
  */
 public static void endProcessing(Environment env, Object key) {
-env.finishingProcessing();
 ((EnvironmentDescription) key).release();
 env.getObjectModel().remove(PROCESS_KEY);
+env.finishingProcessing();
 }
 
 /**


svn commit: rev 55855 - cocoon/branches/BRANCH_2_1_X/tools/src

2004-10-28 Thread unico
Author: unico
Date: Thu Oct 28 07:19:35 2004
New Revision: 55855

Modified:
   cocoon/branches/BRANCH_2_1_X/tools/src/blocks-build.xsl
Log:
only include optional jars if block has any library dependencies

Modified: cocoon/branches/BRANCH_2_1_X/tools/src/blocks-build.xsl
==
--- cocoon/branches/BRANCH_2_1_X/tools/src/blocks-build.xsl (original)
+++ cocoon/branches/BRANCH_2_1_X/tools/src/blocks-build.xsl Thu Oct 28 
07:19:35 2004
@@ -529,13 +529,15 @@
   /xsl:if
 
   !-- Copy the library depencies --
-  copy filtering=off todir=${{build.webapp.lib}}
-fileset dir=${{lib.optional}}
-  xsl:for-each select=library
-include name=[EMAIL PROTECTED]/
-  /xsl:for-each
-/fileset
-  /copy
+  xsl:if test=library
+copy filtering=off todir=${{build.webapp.lib}}
+  fileset dir=${{lib.optional}}
+xsl:for-each select=library
+  include name=[EMAIL PROTECTED]/
+/xsl:for-each
+  /fileset
+/copy
+  /xsl:if
 
   !-- Test if this block has global WEB-INF files --
   if
@@ -566,11 +568,13 @@
 
   path id={$block-name}.classpath
 path refid=classpath/
-fileset dir=${{lib.optional}}
-  xsl:for-each select=library
-include name=[EMAIL PROTECTED]/
-  /xsl:for-each
-/fileset
+xsl:if test=library
+  fileset dir=${{lib.optional}}
+xsl:for-each select=library
+  include name=[EMAIL PROTECTED]/
+/xsl:for-each
+  /fileset
+/xsl:if
 pathelement location=${{build.blocks}}/{$block-name}/mocks/
 pathelement location=${{build.blocks}}/{$block-name}/dest/
 pathelement location=${{build.blocks}}/{$block-name}/samples/


svn commit: rev 55856 - cocoon/branches/BRANCH_2_1_X/tools/targets

2004-10-28 Thread unico
Author: unico
Date: Thu Oct 28 07:22:41 2004
New Revision: 55856

Modified:
   cocoon/branches/BRANCH_2_1_X/tools/targets/webapp-build.xml
Log:
don't copy optional jars, these are now copied as needed by individual blocks

Modified: cocoon/branches/BRANCH_2_1_X/tools/targets/webapp-build.xml
==
--- cocoon/branches/BRANCH_2_1_X/tools/targets/webapp-build.xml (original)
+++ cocoon/branches/BRANCH_2_1_X/tools/targets/webapp-build.xml Thu Oct 28 
07:22:41 2004
@@ -66,10 +66,6 @@
   include name=*.jar/
 /fileset
   --
-  fileset dir=${lib.optional}
-include name=*.jar/
-exclude name=servlet*.jar/
-  /fileset
   fileset dir=${lib.local}
 include name=*.jar/
 exclude name=servlet*.jar/


svn commit: rev 55865 - in cocoon/branches/BRANCH_2_1_X: . tools/src

2004-10-28 Thread unico
Author: unico
Date: Thu Oct 28 08:25:52 2004
New Revision: 55865

Modified:
   cocoon/branches/BRANCH_2_1_X/gump.xml
   cocoon/branches/BRANCH_2_1_X/tools/src/blocks-build.xsl
Log:
add attribute bundle to library element to indicate if the jar should be copied 
to WEB-INF/lib
needed for instance to exclude servlet.jar. By default true is assumed.


Modified: cocoon/branches/BRANCH_2_1_X/gump.xml
==
--- cocoon/branches/BRANCH_2_1_X/gump.xml   (original)
+++ cocoon/branches/BRANCH_2_1_X/gump.xml   Thu Oct 28 08:25:52 2004
@@ -159,7 +159,7 @@
 depend project=cocoon-block-axis/
 depend project=apache-garbage/
 
-library name=servlet-2_3/
+library name=servlet-2_3 bundle=false/
 library name=velocity/
 library name=castor/
 library name=commons-jexl/
@@ -527,7 +527,7 @@
 depend project=jakarta-servletapi/
 
 library name=jtidy/
-library name=servlet/
+library name=servlet bundle=false/
 
 work nested=tools/anttasks/
 home nested=build/cocoon-@@DATE@@/
@@ -684,7 +684,7 @@
 depend project=commons-logging/
 depend project=jakarta-servletapi/
 
-library name=servlet/
+library name=servlet bundle=false/
 library name=commons-httpclient/
 library name=commons-logging/
 
@@ -741,7 +741,7 @@
 library name=deli/
 library name=jena/
 library name=icu4j/
-library name=servlet/
+library name=servlet bundle=false/
 library name=log4j/
 
 work nested=tools/anttasks/
@@ -815,7 +815,7 @@
 library name=axis-jaxrpc/
 library name=wsdl4j/
 library name=commons-discovery/
-library name=servlet/
+library name=servlet bundle=false/
 
 work nested=tools/anttasks/
 home nested=build/cocoon-@@DATE@@/
@@ -1220,7 +1220,7 @@
 depend project=cocoon inherit=all/
 depend project=jakarta-servletapi/
 
-library name=servlet/
+library name=servlet bundle=false/
 
 work nested=tools/anttasks/
 home nested=build/cocoon-@@DATE@@/

Modified: cocoon/branches/BRANCH_2_1_X/tools/src/blocks-build.xsl
==
--- cocoon/branches/BRANCH_2_1_X/tools/src/blocks-build.xsl (original)
+++ cocoon/branches/BRANCH_2_1_X/tools/src/blocks-build.xsl Thu Oct 28 
08:25:52 2004
@@ -529,10 +529,10 @@
   /xsl:if
 
   !-- Copy the library depencies --
-  xsl:if test=library
+  xsl:if test=library[not(@bundle='false')]
 copy filtering=off todir=${{build.webapp.lib}}
   fileset dir=${{lib.optional}}
-xsl:for-each select=library
+xsl:for-each select=library[not(@bundle='false')]
   include name=[EMAIL PROTECTED]/
 /xsl:for-each
   /fileset


svn commit: rev 55876 - in cocoon/branches/BRANCH_2_1_X: . lib lib/core lib/optional

2004-10-28 Thread unico
Author: unico
Date: Thu Oct 28 09:43:48 2004
New Revision: 55876

Added:
   cocoon/branches/BRANCH_2_1_X/lib/core/jdtcore-3.0.1.jar
  - copied unchanged from rev 55832, 
cocoon/branches/BRANCH_2_1_X/lib/optional/jdtcore-3.0.1.jar
Removed:
   cocoon/branches/BRANCH_2_1_X/lib/optional/jdtcore-3.0.1.jar
Modified:
   cocoon/branches/BRANCH_2_1_X/gump.xml
   cocoon/branches/BRANCH_2_1_X/lib/jars.xml
Log:
eclipse jdt is core dependency, xsp depends on pizza

Modified: cocoon/branches/BRANCH_2_1_X/gump.xml
==
--- cocoon/branches/BRANCH_2_1_X/gump.xml   (original)
+++ cocoon/branches/BRANCH_2_1_X/gump.xml   Thu Oct 28 09:43:48 2004
@@ -1239,6 +1239,8 @@
 /ant
 
 depend project=cocoon inherit=all/
+
+library name=pizza/
 
 work nested=tools/anttasks/
 home nested=build/cocoon-@@DATE@@/
@@ -1410,7 +1412,7 @@
 description
   Java Development Tools from the Eclipse IDE Project
 /description
-home nested=lib/optional/
+home nested=lib/core/
 jar name=jdtcore-3.0.1.jar/
   /project
 

Modified: cocoon/branches/BRANCH_2_1_X/lib/jars.xml
==
--- cocoon/branches/BRANCH_2_1_X/lib/jars.xml   (original)
+++ cocoon/branches/BRANCH_2_1_X/lib/jars.xml   Thu Oct 28 09:43:48 2004
@@ -673,7 +673,7 @@
 titleEclipse Java Development Tools Core/title
 descriptionEclipse Java Compiler/description
 used-byXSP/used-by
-liboptional/jdtcore-3.0.1.jar/lib
+libcore/jdtcore-3.0.1.jar/lib
 homepagehttp://www.eclipse.org/jdt/homepage
   /file
 


svn commit: rev 55878 - in cocoon/branches/BRANCH_2_1_X: . lib lib/core lib/optional tools/targets

2004-10-28 Thread unico
Author: unico
Date: Thu Oct 28 09:57:37 2004
New Revision: 55878

Added:
   cocoon/branches/BRANCH_2_1_X/lib/core/log4j-1.2.8.jar
  - copied unchanged from rev 55875, 
cocoon/branches/BRANCH_2_1_X/lib/optional/log4j-1.2.8.jar
   cocoon/branches/BRANCH_2_1_X/lib/core/servlet_2_2.jar
  - copied unchanged from rev 55875, 
cocoon/branches/BRANCH_2_1_X/lib/optional/servlet_2_2.jar
Removed:
   cocoon/branches/BRANCH_2_1_X/lib/optional/log4j-1.2.8.jar
   cocoon/branches/BRANCH_2_1_X/lib/optional/servlet_2_2.jar
Modified:
   cocoon/branches/BRANCH_2_1_X/gump.xml
   cocoon/branches/BRANCH_2_1_X/lib/jars.xml
   cocoon/branches/BRANCH_2_1_X/tools/targets/init-build.xml
Log:
servlet 2.2 and log4j are core dependencies; 
don't include optional jars in core classpath

Modified: cocoon/branches/BRANCH_2_1_X/gump.xml
==
--- cocoon/branches/BRANCH_2_1_X/gump.xml   (original)
+++ cocoon/branches/BRANCH_2_1_X/gump.xml   Thu Oct 28 09:57:37 2004
@@ -527,7 +527,6 @@
 depend project=jakarta-servletapi/
 
 library name=jtidy/
-library name=servlet bundle=false/
 
 work nested=tools/anttasks/
 home nested=build/cocoon-@@DATE@@/
@@ -684,7 +683,6 @@
 depend project=commons-logging/
 depend project=jakarta-servletapi/
 
-library name=servlet bundle=false/
 library name=commons-httpclient/
 library name=commons-logging/
 
@@ -741,7 +739,6 @@
 library name=deli/
 library name=jena/
 library name=icu4j/
-library name=servlet bundle=false/
 library name=log4j/
 
 work nested=tools/anttasks/
@@ -815,7 +812,6 @@
 library name=axis-jaxrpc/
 library name=wsdl4j/
 library name=commons-discovery/
-library name=servlet bundle=false/
 
 work nested=tools/anttasks/
 home nested=build/cocoon-@@DATE@@/
@@ -1219,8 +1215,6 @@
 
 depend project=cocoon inherit=all/
 depend project=jakarta-servletapi/
-
-library name=servlet bundle=false/
 
 work nested=tools/anttasks/
 home nested=build/cocoon-@@DATE@@/

Modified: cocoon/branches/BRANCH_2_1_X/lib/jars.xml
==
--- cocoon/branches/BRANCH_2_1_X/lib/jars.xml   (original)
+++ cocoon/branches/BRANCH_2_1_X/lib/jars.xml   Thu Oct 28 09:57:37 2004
@@ -571,7 +571,7 @@
 titleLog4j/title
 descriptionLogging for java/description
 used-byCore and DELI (deli block)/used-by
-liboptional/log4j-1.2.8.jar/lib
+libcore/log4j-1.2.8.jar/lib
 homepagehttp://logging.apache.org/log4j//homepage
   /file
 
@@ -591,7 +591,7 @@
 titleServlet API/title
 descriptionServlet API Version 2.2/description
 used-byCocoon/used-by
-liboptional/servlet_2_2.jar/lib
+libcore/servlet_2_2.jar/lib
 homepagehttp://jakarta.apache.org/tomcat//homepage
   /file
   file

Modified: cocoon/branches/BRANCH_2_1_X/tools/targets/init-build.xml
==
--- cocoon/branches/BRANCH_2_1_X/tools/targets/init-build.xml   (original)
+++ cocoon/branches/BRANCH_2_1_X/tools/targets/init-build.xml   Thu Oct 28 
09:57:37 2004
@@ -129,9 +129,6 @@
   include name=*.jar/
 /fileset
   --
-  fileset dir=${lib.optional}
-include name=*.jar/
-  /fileset
   path location=${build.mocks}/
   path location=${build.dest}/
 /path


svn commit: rev 55701 - in cocoon/trunk/src: test/anteater webapp/samples/test/reader-mime-type

2004-10-27 Thread unico
Author: unico
Date: Wed Oct 27 07:46:15 2004
New Revision: 55701

Modified:
   cocoon/trunk/src/test/anteater/reader-mime-type.xml
   cocoon/trunk/src/webapp/samples/test/reader-mime-type/explain-test.xml
   cocoon/trunk/src/webapp/samples/test/reader-mime-type/sitemap.xmap
Log:
revert removal of testcase

Modified: cocoon/trunk/src/test/anteater/reader-mime-type.xml
==
--- cocoon/trunk/src/test/anteater/reader-mime-type.xml (original)
+++ cocoon/trunk/src/test/anteater/reader-mime-type.xml Wed Oct 27 07:46:15 2004
@@ -69,6 +69,17 @@
 /match
 /httpRequest
 
+httpRequest href=${baseUrl}/test50.html description=Check 
content-type
+match
+header name=Content-type value=text/html/
+/match
+/httpRequest
+httpRequest href=${baseUrl}/test50.html description=Check 
content-type (cached)
+match
+header name=Content-type value=text/html/
+/match
+/httpRequest
+
 httpRequest href=${baseUrl}/test60.html description=Check 
content-type
 match
 header name=Content-type value=text/html/

Modified: cocoon/trunk/src/webapp/samples/test/reader-mime-type/explain-test.xml
==
--- cocoon/trunk/src/webapp/samples/test/reader-mime-type/explain-test.xml  
(original)
+++ cocoon/trunk/src/webapp/samples/test/reader-mime-type/explain-test.xml  
Wed Oct 27 07:46:15 2004
@@ -32,6 +32,7 @@
 lilink href=test20.htmltest20.html/link/li
 lilink href=test30test30/link/li
 lilink href=test40.htmltest40.html/link/li
+lilink href=test50.htmltest50.html/link/li
 lilink href=test60.htmltest60.html/link/li
 lilink href=test70.htmltest70.html/link/li
 /ul

Modified: cocoon/trunk/src/webapp/samples/test/reader-mime-type/sitemap.xmap
==
--- cocoon/trunk/src/webapp/samples/test/reader-mime-type/sitemap.xmap  
(original)
+++ cocoon/trunk/src/webapp/samples/test/reader-mime-type/sitemap.xmap  Wed Oct 
27 07:46:15 2004
@@ -31,6 +31,9 @@
   map:match pattern=test40.html
 map:read src=cocoon:/test10.html/
   /map:match
+  map:match pattern=test50.html
+map:read src=cocoon:/test30/
+  /map:match
   map:match pattern=test60.html
 map:read src=cocoon:/test10.html mime-type=text/html/
   /map:match


svn commit: rev 55702 - in cocoon/branches/BRANCH_2_1_X/src: test/anteater webapp/samples/test/reader-mime-type

2004-10-27 Thread unico
Author: unico
Date: Wed Oct 27 07:48:14 2004
New Revision: 55702

Modified:
   cocoon/branches/BRANCH_2_1_X/src/test/anteater/reader-mime-type.xml
   
cocoon/branches/BRANCH_2_1_X/src/webapp/samples/test/reader-mime-type/explain-test.xml
   
cocoon/branches/BRANCH_2_1_X/src/webapp/samples/test/reader-mime-type/sitemap.xmap
Log:
revert removal of testcase

Modified: cocoon/branches/BRANCH_2_1_X/src/test/anteater/reader-mime-type.xml
==
--- cocoon/branches/BRANCH_2_1_X/src/test/anteater/reader-mime-type.xml 
(original)
+++ cocoon/branches/BRANCH_2_1_X/src/test/anteater/reader-mime-type.xml Wed Oct 
27 07:48:14 2004
@@ -57,6 +57,7 @@
 header name=Content-type value=text/html/
 /match
 /httpRequest
+
 httpRequest href=${baseUrl}/test40.html description=Check 
content-type
 match
 header name=Content-type value=text/html/
@@ -67,6 +68,18 @@
 header name=Content-type value=text/html/
 /match
 /httpRequest
+
+httpRequest href=${baseUrl}/test50.html description=Check 
content-type
+match
+header name=Content-type value=text/html/
+/match
+/httpRequest
+httpRequest href=${baseUrl}/test50.html description=Check 
content-type (cached)
+match
+header name=Content-type value=text/html/
+/match
+/httpRequest
+
 httpRequest href=${baseUrl}/test60.html description=Check 
content-type
 match
 header name=Content-type value=text/html/

Modified: 
cocoon/branches/BRANCH_2_1_X/src/webapp/samples/test/reader-mime-type/explain-test.xml
==
--- 
cocoon/branches/BRANCH_2_1_X/src/webapp/samples/test/reader-mime-type/explain-test.xml
  (original)
+++ 
cocoon/branches/BRANCH_2_1_X/src/webapp/samples/test/reader-mime-type/explain-test.xml
  Wed Oct 27 07:48:14 2004
@@ -32,6 +32,7 @@
 lilink href=test20.htmltest20.html/link/li
 lilink href=test30test30/link/li
 lilink href=test40.htmltest40.html/link/li
+lilink href=test50.htmltest50.html/link/li
 lilink href=test60.htmltest60.html/link/li
 lilink href=test70.htmltest70.html/link/li
 /ul

Modified: 
cocoon/branches/BRANCH_2_1_X/src/webapp/samples/test/reader-mime-type/sitemap.xmap
==
--- 
cocoon/branches/BRANCH_2_1_X/src/webapp/samples/test/reader-mime-type/sitemap.xmap
  (original)
+++ 
cocoon/branches/BRANCH_2_1_X/src/webapp/samples/test/reader-mime-type/sitemap.xmap
  Wed Oct 27 07:48:14 2004
@@ -31,6 +31,9 @@
   map:match pattern=test40.html
 map:read src=cocoon:/test10.html/
   /map:match
+  map:match pattern=test50.html
+map:read src=cocoon:/test30/
+  /map:match
   map:match pattern=test60.html
 map:read src=cocoon:/test10.html mime-type=text/html/
   /map:match


svn commit: rev 55598 - cocoon/branches/BRANCH_2_1_X/tools/lib

2004-10-26 Thread unico
Author: unico
Date: Tue Oct 26 03:51:13 2004
New Revision: 55598

Removed:
   cocoon/branches/BRANCH_2_1_X/tools/lib/junit.jar
Log:
remove old junit.jar


svn commit: rev 55600 - in cocoon/trunk/src: blocks/portal/java/org/apache/cocoon/environment/portlet java/org/apache/cocoon/components/flow/javascript/fom java/org/apache/cocoon/environment java/org/apache/cocoon/environment/commandline java/org/apache/cocoon/environment/http java/org/apache/cocoon/environment/wrapper test/org/apache/cocoon/environment/mock

2004-10-26 Thread unico
Author: unico
Date: Tue Oct 26 04:42:28 2004
New Revision: 55600

Modified:
   
cocoon/trunk/src/blocks/portal/java/org/apache/cocoon/environment/portlet/ActionRequest.java
   
cocoon/trunk/src/blocks/portal/java/org/apache/cocoon/environment/portlet/RenderRequest.java
   
cocoon/trunk/src/java/org/apache/cocoon/components/flow/javascript/fom/FOM_Cocoon.java
   cocoon/trunk/src/java/org/apache/cocoon/environment/Request.java
   
cocoon/trunk/src/java/org/apache/cocoon/environment/commandline/CommandLineRequest.java
   cocoon/trunk/src/java/org/apache/cocoon/environment/http/HttpRequest.java
   
cocoon/trunk/src/java/org/apache/cocoon/environment/wrapper/AbstractRequestWrapper.java
   
cocoon/trunk/src/java/org/apache/cocoon/environment/wrapper/RequestWrapper.java
   cocoon/trunk/src/test/org/apache/cocoon/environment/mock/MockRequest.java
Log:
add getInputStream method to the Request interface as discussed in 
http://marc.theaimsgroup.com/?t=10985748662r=1w=2

Modified: 
cocoon/trunk/src/blocks/portal/java/org/apache/cocoon/environment/portlet/ActionRequest.java
==
--- 
cocoon/trunk/src/blocks/portal/java/org/apache/cocoon/environment/portlet/ActionRequest.java
(original)
+++ 
cocoon/trunk/src/blocks/portal/java/org/apache/cocoon/environment/portlet/ActionRequest.java
Tue Oct 26 04:42:28 2004
@@ -23,7 +23,7 @@
  * Implements the [EMAIL PROTECTED] org.apache.cocoon.environment.Request} 
interface for the
  * JSR-168 (Portlet) environment.
  *
- * @version CVS $Id: ActionRequest.java,v 1.2 2004/03/05 13:02:08 bdelacretaz 
Exp $
+ * @version CVS $Id$
  * @author a href=mailto:[EMAIL PROTECTED]Alex Rudnev/a
  * @author a href=mailto:[EMAIL PROTECTED]Vadim Gritsenko/a
  */
@@ -68,6 +68,13 @@
 return (javax.portlet.ActionRequest) getPortletRequest();
 }
 
+public InputStream getInputStream() throws IOException {
+return getActionRequest().getPortletInputStream();
+}
+
+/**
+ * @deprecated  use [EMAIL PROTECTED] #getInputStream()}
+ */
 public InputStream getPortletInputStream() throws IOException {
 return getActionRequest().getPortletInputStream();
 }

Modified: 
cocoon/trunk/src/blocks/portal/java/org/apache/cocoon/environment/portlet/RenderRequest.java
==
--- 
cocoon/trunk/src/blocks/portal/java/org/apache/cocoon/environment/portlet/RenderRequest.java
(original)
+++ 
cocoon/trunk/src/blocks/portal/java/org/apache/cocoon/environment/portlet/RenderRequest.java
Tue Oct 26 04:42:28 2004
@@ -15,13 +15,15 @@
  */
 package org.apache.cocoon.environment.portlet;
 
+import java.io.InputStream;
+
 /**
  * Implements the [EMAIL PROTECTED] org.apache.cocoon.environment.Request} 
interface for
  * the JSR-168 (Portlet) environment.
  *
  * @author a href=mailto:[EMAIL PROTECTED]Alex Rudnev/a
  * @author a href=mailto:[EMAIL PROTECTED]Vadim Gritsenko/a
- * @version CVS $Id: RenderRequest.java,v 1.2 2004/03/05 13:02:08 bdelacretaz 
Exp $
+ * @version CVS $Id$
  */
 public final class RenderRequest extends PortletRequest {
 
@@ -50,4 +52,11 @@
 public String getMethod() {
 return GET;
 }
+
+   /* (non-Javadoc)
+* @see org.apache.cocoon.environment.Request#getInputStream()
+*/
+   public InputStream getInputStream() throws 
UnsupportedOperationException {
+   throw new UnsupportedOperationException();
+   }
 }

Modified: 
cocoon/trunk/src/java/org/apache/cocoon/components/flow/javascript/fom/FOM_Cocoon.java
==
--- 
cocoon/trunk/src/java/org/apache/cocoon/components/flow/javascript/fom/FOM_Cocoon.java
  (original)
+++ 
cocoon/trunk/src/java/org/apache/cocoon/components/flow/javascript/fom/FOM_Cocoon.java
  Tue Oct 26 04:42:28 2004
@@ -15,6 +15,7 @@
  */
 package org.apache.cocoon.components.flow.javascript.fom;
 
+import java.io.IOException;
 import java.io.InputStream;
 import java.io.OutputStream;
 import java.net.MalformedURLException;
@@ -604,6 +605,10 @@
 public boolean jsFunction_isUserInRole(String role) {
 return request.isUserInRole(role);
 }
+
+public InputStream jsFunction_getInputStream() throws IOException, 
UnsupportedOperationException {
+   return request.getInputStream();
+}
 
 // Request interface
 
@@ -792,33 +797,25 @@
 return request.isRequestedSessionIdFromURL();
 }
 
-/* (non-Javadoc)
- * @see 
org.apache.cocoon.environment.Request#getAttribute(java.lang.String, int)
- */
 public Object getAttribute(String name, int scope) {
 return this.request.getAttribute(name, scope);
 }
 
-/* (non-Javadoc)
- * @see org.apache.cocoon.environment.Request#getAttributeNames(int

svn commit: rev 55618 - cocoon/trunk/src/blocks/axis/conf

2004-10-26 Thread unico
Author: unico
Date: Tue Oct 26 09:58:44 2004
New Revision: 55618

Modified:
   cocoon/trunk/src/blocks/axis/conf/soapserver.xconf
Log:
instrumentation descriptor was removed

Modified: cocoon/trunk/src/blocks/axis/conf/soapserver.xconf
==
--- cocoon/trunk/src/blocks/axis/conf/soapserver.xconf  (original)
+++ cocoon/trunk/src/blocks/axis/conf/soapserver.xconf  Tue Oct 26 09:58:44 2004
@@ -23,7 +23,6 @@
  descriptor 
src=resource://org/apache/cocoon/webservices/memory/DeploymentDescriptor.wsdd/
  descriptor 
src=resource://org/apache/cocoon/webservices/system/DeploymentDescriptor.wsdd/
  descriptor 
src=resource://org/apache/cocoon/webservices/cache/DeploymentDescriptor.wsdd/
- descriptor 
src=resource://org/apache/cocoon/webservices/instrument/DeploymentDescriptor.wsdd/
 
/managed-services
  /component
 /xconf


svn commit: rev 55619 - in cocoon/branches/BRANCH_2_1_X/src: test/anteater webapp/samples/test/reader-mime-type

2004-10-26 Thread unico
Author: unico
Date: Tue Oct 26 10:07:04 2004
New Revision: 55619

Modified:
   cocoon/branches/BRANCH_2_1_X/src/test/anteater/reader-mime-type.xml
   
cocoon/branches/BRANCH_2_1_X/src/webapp/samples/test/reader-mime-type/explain-test.xml
   
cocoon/branches/BRANCH_2_1_X/src/webapp/samples/test/reader-mime-type/sitemap.xmap
Log:
remove testcase that no longer complies with expected behavior:
internal requests should not be able to alter response headers 
as discussed in http://marc.theaimsgroup.com/?t=10978326015r=1w=2

Modified: cocoon/branches/BRANCH_2_1_X/src/test/anteater/reader-mime-type.xml
==
--- cocoon/branches/BRANCH_2_1_X/src/test/anteater/reader-mime-type.xml 
(original)
+++ cocoon/branches/BRANCH_2_1_X/src/test/anteater/reader-mime-type.xml Tue Oct 
26 10:07:04 2004
@@ -57,7 +57,6 @@
 header name=Content-type value=text/html/
 /match
 /httpRequest
-
 httpRequest href=${baseUrl}/test40.html description=Check 
content-type
 match
 header name=Content-type value=text/html/
@@ -68,18 +67,6 @@
 header name=Content-type value=text/html/
 /match
 /httpRequest
-
-httpRequest href=${baseUrl}/test50.html description=Check 
content-type
-match
-header name=Content-type value=text/html/
-/match
-/httpRequest
-httpRequest href=${baseUrl}/test50.html description=Check 
content-type (cached)
-match
-header name=Content-type value=text/html/
-/match
-/httpRequest
-
 httpRequest href=${baseUrl}/test60.html description=Check 
content-type
 match
 header name=Content-type value=text/html/

Modified: 
cocoon/branches/BRANCH_2_1_X/src/webapp/samples/test/reader-mime-type/explain-test.xml
==
--- 
cocoon/branches/BRANCH_2_1_X/src/webapp/samples/test/reader-mime-type/explain-test.xml
  (original)
+++ 
cocoon/branches/BRANCH_2_1_X/src/webapp/samples/test/reader-mime-type/explain-test.xml
  Tue Oct 26 10:07:04 2004
@@ -15,7 +15,7 @@
   limitations under the License.
 --
 
-!-- CVS $Id: explain-test.xml,v 1.3 2004/03/06 02:26:00 antonio Exp $ --
+!-- CVS $Id$ --
 
 page
 titlereader-mime-type test/title
@@ -32,7 +32,6 @@
 lilink href=test20.htmltest20.html/link/li
 lilink href=test30test30/link/li
 lilink href=test40.htmltest40.html/link/li
-lilink href=test50.htmltest50.html/link/li
 lilink href=test60.htmltest60.html/link/li
 lilink href=test70.htmltest70.html/link/li
 /ul

Modified: 
cocoon/branches/BRANCH_2_1_X/src/webapp/samples/test/reader-mime-type/sitemap.xmap
==
--- 
cocoon/branches/BRANCH_2_1_X/src/webapp/samples/test/reader-mime-type/sitemap.xmap
  (original)
+++ 
cocoon/branches/BRANCH_2_1_X/src/webapp/samples/test/reader-mime-type/sitemap.xmap
  Tue Oct 26 10:07:04 2004
@@ -31,9 +31,6 @@
   map:match pattern=test40.html
 map:read src=cocoon:/test10.html/
   /map:match
-  map:match pattern=test50.html
-map:read src=cocoon:/test30/
-  /map:match
   map:match pattern=test60.html
 map:read src=cocoon:/test10.html mime-type=text/html/
   /map:match


svn commit: rev 55622 - in cocoon/trunk/src: test/anteater webapp/samples/test/reader-mime-type

2004-10-26 Thread unico
Author: unico
Date: Tue Oct 26 10:19:53 2004
New Revision: 55622

Modified:
   cocoon/trunk/src/test/anteater/reader-mime-type.xml
   cocoon/trunk/src/webapp/samples/test/reader-mime-type/explain-test.xml
   cocoon/trunk/src/webapp/samples/test/reader-mime-type/sitemap.xmap
Log:
remove testcase that no longer complies with expected behavior:
internal requests should not be able to alter response headers 
as discussed in http://marc.theaimsgroup.com/?t=10978326015r=1w=2

Modified: cocoon/trunk/src/test/anteater/reader-mime-type.xml
==
--- cocoon/trunk/src/test/anteater/reader-mime-type.xml (original)
+++ cocoon/trunk/src/test/anteater/reader-mime-type.xml Tue Oct 26 10:19:53 2004
@@ -69,17 +69,6 @@
 /match
 /httpRequest
 
-httpRequest href=${baseUrl}/test50.html description=Check 
content-type
-match
-header name=Content-type value=text/html/
-/match
-/httpRequest
-httpRequest href=${baseUrl}/test50.html description=Check 
content-type (cached)
-match
-header name=Content-type value=text/html/
-/match
-/httpRequest
-
 httpRequest href=${baseUrl}/test60.html description=Check 
content-type
 match
 header name=Content-type value=text/html/

Modified: cocoon/trunk/src/webapp/samples/test/reader-mime-type/explain-test.xml
==
--- cocoon/trunk/src/webapp/samples/test/reader-mime-type/explain-test.xml  
(original)
+++ cocoon/trunk/src/webapp/samples/test/reader-mime-type/explain-test.xml  
Tue Oct 26 10:19:53 2004
@@ -15,7 +15,7 @@
   limitations under the License.
 --
 
-!-- CVS $Id: explain-test.xml,v 1.4 2004/06/22 02:41:14 crossley Exp $ --
+!-- CVS $Id$ --
 
 page
 titlereader-mime-type test/title
@@ -32,7 +32,6 @@
 lilink href=test20.htmltest20.html/link/li
 lilink href=test30test30/link/li
 lilink href=test40.htmltest40.html/link/li
-lilink href=test50.htmltest50.html/link/li
 lilink href=test60.htmltest60.html/link/li
 lilink href=test70.htmltest70.html/link/li
 /ul

Modified: cocoon/trunk/src/webapp/samples/test/reader-mime-type/sitemap.xmap
==
--- cocoon/trunk/src/webapp/samples/test/reader-mime-type/sitemap.xmap  
(original)
+++ cocoon/trunk/src/webapp/samples/test/reader-mime-type/sitemap.xmap  Tue Oct 
26 10:19:53 2004
@@ -31,9 +31,6 @@
   map:match pattern=test40.html
 map:read src=cocoon:/test10.html/
   /map:match
-  map:match pattern=test50.html
-map:read src=cocoon:/test30/
-  /map:match
   map:match pattern=test60.html
 map:read src=cocoon:/test10.html mime-type=text/html/
   /map:match


svn commit: rev 55315 - cocoon/branches/BRANCH_2_1_X/src/blocks/slide/java/org/apache/cocoon/samples

2004-10-22 Thread unico
Author: unico
Date: Fri Oct 22 04:16:54 2004
New Revision: 55315

Removed:
   cocoon/branches/BRANCH_2_1_X/src/blocks/slide/java/org/apache/cocoon/samples/
Log:
remove empty directory


svn commit: rev 55218 - in cocoon/branches/BRANCH_2_1_X: lib lib/optional src/blocks/cron/java/org/apache/cocoon/components/cron src/blocks/databases/lib

2004-10-21 Thread unico
Author: unico
Date: Thu Oct 21 05:51:49 2004
New Revision: 55218

Added:
   cocoon/branches/BRANCH_2_1_X/lib/optional/excalibur-datasource-1.1.1.jar
  - copied unchanged from rev 54675, 
cocoon/branches/BRANCH_2_1_X/src/blocks/databases/lib/excalibur-datasource-1.1.1.jar
   
cocoon/branches/BRANCH_2_1_X/src/blocks/cron/java/org/apache/cocoon/components/cron/DataSourceComponentConnectionProvider.java
Removed:
   
cocoon/branches/BRANCH_2_1_X/src/blocks/databases/lib/excalibur-datasource-1.1.1.jar
Modified:
   cocoon/branches/BRANCH_2_1_X/lib/jars.xml
   
cocoon/branches/BRANCH_2_1_X/src/blocks/cron/java/org/apache/cocoon/components/cron/QuartzJobScheduler.java
Log:
ability to use an excalibur DataSourceComponent as the ConnectionProvider 
for the QuartzJobScheduler's JobStore

Modified: cocoon/branches/BRANCH_2_1_X/lib/jars.xml
==
--- cocoon/branches/BRANCH_2_1_X/lib/jars.xml   (original)
+++ cocoon/branches/BRANCH_2_1_X/lib/jars.xml   Thu Oct 21 05:51:49 2004
@@ -42,7 +42,7 @@
   support high level server development. 
 /description
 used-byCocoon/used-by
-libdatabases/lib/excalibur-datasource-1.1.1.jar/lib
+liboptional/excalibur-datasource-1.1.1.jar/lib
 homepagehttp://avalon.apache.org/excalibur//homepage
   /file
 

Added: 
cocoon/branches/BRANCH_2_1_X/src/blocks/cron/java/org/apache/cocoon/components/cron/DataSourceComponentConnectionProvider.java
==
--- (empty file)
+++ 
cocoon/branches/BRANCH_2_1_X/src/blocks/cron/java/org/apache/cocoon/components/cron/DataSourceComponentConnectionProvider.java
  Thu Oct 21 05:51:49 2004
@@ -0,0 +1,64 @@
+/*
+ * Copyright 1999-2004 The Apache Software Foundation.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.cocoon.components.cron;
+
+import java.sql.Connection;
+import java.sql.SQLException;
+
+import org.apache.avalon.excalibur.datasource.DataSourceComponent;
+import org.apache.avalon.framework.configuration.ConfigurationException;
+import org.apache.avalon.framework.service.ServiceException;
+import org.apache.avalon.framework.service.ServiceManager;
+import org.quartz.utils.ConnectionProvider;
+
+/**
+ * Quartz database connection provider that uses the 
+ * Excalibur DataSourceComponent service.
+ */
+public class DataSourceComponentConnectionProvider implements 
ConnectionProvider {
+
+private ServiceManager m_manager;
+private DataSourceComponent m_ds;
+
+public DataSourceComponentConnectionProvider(String dsName, ServiceManager 
manager) throws ConfigurationException {
+m_manager = manager;
+try {
+m_manager.lookup(DataSourceComponent.ROLE + / + dsName); 
   
+}
+catch (ServiceException e) {
+throw new ConfigurationException(No datasource available by that 
name:  + dsName);
+}
+}
+
+/*
+ * @see org.quartz.utils.ConnectionProvider#getConnection()
+ */
+public Connection getConnection() throws SQLException {
+return m_ds.getConnection();
+}
+
+/*
+ * @see org.quartz.utils.ConnectionProvider#shutdown()
+ */
+public void shutdown() throws SQLException {
+if (m_ds != null) {
+m_manager.release(m_ds);
+}
+m_ds = null;
+m_manager = null;
+}
+
+}

Modified: 
cocoon/branches/BRANCH_2_1_X/src/blocks/cron/java/org/apache/cocoon/components/cron/QuartzJobScheduler.java
==
--- 
cocoon/branches/BRANCH_2_1_X/src/blocks/cron/java/org/apache/cocoon/components/cron/QuartzJobScheduler.java
 (original)
+++ 
cocoon/branches/BRANCH_2_1_X/src/blocks/cron/java/org/apache/cocoon/components/cron/QuartzJobScheduler.java
 Thu Oct 21 05:51:49 2004
@@ -734,6 +734,8 @@
 ConnectionProvider provider;
 if (dsType.equals(jndi)) {
 provider = new JNDIConnectionProvider(dsName, false);
+} else if (dsType.equals(excalibur)) {
+provider = new DataSourceComponentConnectionProvider(dsName, 
this.manager);
 } else {
 // assume class name
 try {


svn commit: rev 55220 - cocoon/branches/BRANCH_2_1_X/src/blocks/cron/java/org/apache/cocoon/components/cron

2004-10-21 Thread unico
Author: unico
Date: Thu Oct 21 05:55:18 2004
New Revision: 55220

Modified:
   
cocoon/branches/BRANCH_2_1_X/src/blocks/cron/java/org/apache/cocoon/components/cron/DataSourceComponentConnectionProvider.java
   (contents, props changed)
Log:
props

Modified: 
cocoon/branches/BRANCH_2_1_X/src/blocks/cron/java/org/apache/cocoon/components/cron/DataSourceComponentConnectionProvider.java
==
--- 
cocoon/branches/BRANCH_2_1_X/src/blocks/cron/java/org/apache/cocoon/components/cron/DataSourceComponentConnectionProvider.java
  (original)
+++ 
cocoon/branches/BRANCH_2_1_X/src/blocks/cron/java/org/apache/cocoon/components/cron/DataSourceComponentConnectionProvider.java
  Thu Oct 21 05:55:18 2004
@@ -1,64 +1,64 @@
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- * 
- * Licensed under the Apache License, Version 2.0 (the License);
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *  http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an AS IS BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.cocoon.components.cron;
-
-import java.sql.Connection;
-import java.sql.SQLException;
-
-import org.apache.avalon.excalibur.datasource.DataSourceComponent;
-import org.apache.avalon.framework.configuration.ConfigurationException;
-import org.apache.avalon.framework.service.ServiceException;
-import org.apache.avalon.framework.service.ServiceManager;
-import org.quartz.utils.ConnectionProvider;
-
-/**
- * Quartz database connection provider that uses the 
- * Excalibur DataSourceComponent service.
- */
-public class DataSourceComponentConnectionProvider implements 
ConnectionProvider {
-
-private ServiceManager m_manager;
-private DataSourceComponent m_ds;
-
-public DataSourceComponentConnectionProvider(String dsName, ServiceManager 
manager) throws ConfigurationException {
-m_manager = manager;
-try {
-m_manager.lookup(DataSourceComponent.ROLE + / + dsName); 
   
-}
-catch (ServiceException e) {
-throw new ConfigurationException(No datasource available by that 
name:  + dsName);
-}
-}
-
-/*
- * @see org.quartz.utils.ConnectionProvider#getConnection()
- */
-public Connection getConnection() throws SQLException {
-return m_ds.getConnection();
-}
-
-/*
- * @see org.quartz.utils.ConnectionProvider#shutdown()
- */
-public void shutdown() throws SQLException {
-if (m_ds != null) {
-m_manager.release(m_ds);
-}
-m_ds = null;
-m_manager = null;
-}
-
-}
+/*
+ * Copyright 1999-2004 The Apache Software Foundation.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.cocoon.components.cron;
+
+import java.sql.Connection;
+import java.sql.SQLException;
+
+import org.apache.avalon.excalibur.datasource.DataSourceComponent;
+import org.apache.avalon.framework.configuration.ConfigurationException;
+import org.apache.avalon.framework.service.ServiceException;
+import org.apache.avalon.framework.service.ServiceManager;
+import org.quartz.utils.ConnectionProvider;
+
+/**
+ * Quartz database connection provider that uses the 
+ * Excalibur DataSourceComponent service.
+ */
+public class DataSourceComponentConnectionProvider implements 
ConnectionProvider {
+
+private ServiceManager m_manager;
+private DataSourceComponent m_ds;
+
+public DataSourceComponentConnectionProvider(String dsName, ServiceManager 
manager) throws ConfigurationException {
+m_manager = manager;
+try {
+m_manager.lookup(DataSourceComponent.ROLE + / + dsName); 
   
+}
+catch (ServiceException e) {
+throw new ConfigurationException(No datasource available by that 
name:  + dsName);
+}
+}
+
+/*
+ * @see org.quartz.utils.ConnectionProvider#getConnection()
+ */
+public Connection getConnection() throws SQLException {
+return m_ds.getConnection();
+}
+
+/*
+ * @see org.quartz.utils.ConnectionProvider#shutdown

svn commit: rev 55221 - cocoon/branches/BRANCH_2_1_X/src/blocks/cron/java/org/apache/cocoon/components/cron

2004-10-21 Thread unico
Author: unico
Date: Thu Oct 21 05:57:28 2004
New Revision: 55221

Modified:
   
cocoon/branches/BRANCH_2_1_X/src/blocks/cron/java/org/apache/cocoon/components/cron/DataSourceComponentConnectionProvider.java
Log:
oops

Modified: 
cocoon/branches/BRANCH_2_1_X/src/blocks/cron/java/org/apache/cocoon/components/cron/DataSourceComponentConnectionProvider.java
==
--- 
cocoon/branches/BRANCH_2_1_X/src/blocks/cron/java/org/apache/cocoon/components/cron/DataSourceComponentConnectionProvider.java
  (original)
+++ 
cocoon/branches/BRANCH_2_1_X/src/blocks/cron/java/org/apache/cocoon/components/cron/DataSourceComponentConnectionProvider.java
  Thu Oct 21 05:57:28 2004
@@ -36,7 +36,7 @@
 public DataSourceComponentConnectionProvider(String dsName, ServiceManager 
manager) throws ConfigurationException {
 m_manager = manager;
 try {
-m_manager.lookup(DataSourceComponent.ROLE + / + dsName); 
   
+m_ds = (DataSourceComponent) 
m_manager.lookup(DataSourceComponent.ROLE + / + dsName);
 }
 catch (ServiceException e) {
 throw new ConfigurationException(No datasource available by that 
name:  + dsName);


svn commit: rev 55222 - in cocoon/trunk: lib lib/optional src/blocks/cron/java/org/apache/cocoon/components/cron src/blocks/databases/lib

2004-10-21 Thread unico
Author: unico
Date: Thu Oct 21 06:06:08 2004
New Revision: 55222

Added:
   cocoon/trunk/lib/optional/excalibur-datasource-1.1.1.jar
  - copied unchanged from rev 54676, 
cocoon/trunk/src/blocks/databases/lib/excalibur-datasource-1.1.1.jar
   
cocoon/trunk/src/blocks/cron/java/org/apache/cocoon/components/cron/DataSourceComponentConnectionProvider.java
Removed:
   cocoon/trunk/src/blocks/databases/lib/excalibur-datasource-1.1.1.jar
Modified:
   cocoon/trunk/lib/jars.xml
   
cocoon/trunk/src/blocks/cron/java/org/apache/cocoon/components/cron/QuartzJobScheduler.java
Log:
ability to use an excalibur DataSourceComponent as the ConnectionProvider 
for the QuartzJobScheduler's JobStore

Modified: cocoon/trunk/lib/jars.xml
==
--- cocoon/trunk/lib/jars.xml   (original)
+++ cocoon/trunk/lib/jars.xml   Thu Oct 21 06:06:08 2004
@@ -42,7 +42,7 @@
   support high level server development. 
 /description
 used-byCocoon/used-by
-libdatabases/lib/excalibur-datasource-1.1.1.jar/lib
+liboptional/excalibur-datasource-1.1.1.jar/lib
 homepagehttp://avalon.apache.org/excalibur//homepage
   /file
 

Added: 
cocoon/trunk/src/blocks/cron/java/org/apache/cocoon/components/cron/DataSourceComponentConnectionProvider.java
==
--- (empty file)
+++ 
cocoon/trunk/src/blocks/cron/java/org/apache/cocoon/components/cron/DataSourceComponentConnectionProvider.java
  Thu Oct 21 06:06:08 2004
@@ -0,0 +1,64 @@
+/*
+ * Copyright 1999-2004 The Apache Software Foundation.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.cocoon.components.cron;
+
+import java.sql.Connection;
+import java.sql.SQLException;
+
+import org.apache.avalon.excalibur.datasource.DataSourceComponent;
+import org.apache.avalon.framework.configuration.ConfigurationException;
+import org.apache.avalon.framework.service.ServiceException;
+import org.apache.avalon.framework.service.ServiceManager;
+import org.quartz.utils.ConnectionProvider;
+
+/**
+ * Quartz database connection provider that uses the 
+ * Excalibur DataSourceComponent service.
+ */
+public class DataSourceComponentConnectionProvider implements 
ConnectionProvider {
+
+private ServiceManager m_manager;
+private DataSourceComponent m_ds;
+
+public DataSourceComponentConnectionProvider(String dsName, ServiceManager 
manager) throws ConfigurationException {
+m_manager = manager;
+try {
+m_ds = (DataSourceComponent) 
m_manager.lookup(DataSourceComponent.ROLE + / + dsName);
+}
+catch (ServiceException e) {
+throw new ConfigurationException(No datasource available by that 
name:  + dsName);
+}
+}
+
+/*
+ * @see org.quartz.utils.ConnectionProvider#getConnection()
+ */
+public Connection getConnection() throws SQLException {
+return m_ds.getConnection();
+}
+
+/*
+ * @see org.quartz.utils.ConnectionProvider#shutdown()
+ */
+public void shutdown() throws SQLException {
+if (m_ds != null) {
+m_manager.release(m_ds);
+}
+m_ds = null;
+m_manager = null;
+}
+
+}

Modified: 
cocoon/trunk/src/blocks/cron/java/org/apache/cocoon/components/cron/QuartzJobScheduler.java
==
--- 
cocoon/trunk/src/blocks/cron/java/org/apache/cocoon/components/cron/QuartzJobScheduler.java
 (original)
+++ 
cocoon/trunk/src/blocks/cron/java/org/apache/cocoon/components/cron/QuartzJobScheduler.java
 Thu Oct 21 06:06:08 2004
@@ -42,12 +42,12 @@
 import org.quartz.Job;
 import org.quartz.JobDataMap;
 import org.quartz.JobDetail;
-import org.quartz.JobExecutionContext;
-import org.quartz.JobExecutionException;
 import org.quartz.Scheduler;
 import org.quartz.SchedulerException;
 import org.quartz.SimpleTrigger;
 import org.quartz.Trigger;
+import org.quartz.JobExecutionContext;
+import org.quartz.JobExecutionException;
 import org.quartz.impl.DirectSchedulerFactory;
 import org.quartz.impl.jdbcjobstore.InvalidConfigurationException;
 import org.quartz.impl.jdbcjobstore.JobStoreSupport;
@@ -734,6 +734,8 @@
 ConnectionProvider provider;
 if (dsType.equals(jndi)) {
 provider = new JNDIConnectionProvider(dsName, false);
+} else if (dsType.equals(excalibur

svn commit: rev 55223 - cocoon/trunk/src/blocks/cron/java/org/apache/cocoon/components/cron

2004-10-21 Thread unico
Author: unico
Date: Thu Oct 21 06:11:41 2004
New Revision: 55223

Modified:
   
cocoon/trunk/src/blocks/cron/java/org/apache/cocoon/components/cron/DataSourceComponentConnectionProvider.java
   (contents, props changed)
Log:
props

Modified: 
cocoon/trunk/src/blocks/cron/java/org/apache/cocoon/components/cron/DataSourceComponentConnectionProvider.java
==
--- 
cocoon/trunk/src/blocks/cron/java/org/apache/cocoon/components/cron/DataSourceComponentConnectionProvider.java
  (original)
+++ 
cocoon/trunk/src/blocks/cron/java/org/apache/cocoon/components/cron/DataSourceComponentConnectionProvider.java
  Thu Oct 21 06:11:41 2004
@@ -1,64 +1,64 @@
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- * 
- * Licensed under the Apache License, Version 2.0 (the License);
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *  http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an AS IS BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.cocoon.components.cron;
-
-import java.sql.Connection;
-import java.sql.SQLException;
-
-import org.apache.avalon.excalibur.datasource.DataSourceComponent;
-import org.apache.avalon.framework.configuration.ConfigurationException;
-import org.apache.avalon.framework.service.ServiceException;
-import org.apache.avalon.framework.service.ServiceManager;
-import org.quartz.utils.ConnectionProvider;
-
-/**
- * Quartz database connection provider that uses the 
- * Excalibur DataSourceComponent service.
- */
-public class DataSourceComponentConnectionProvider implements 
ConnectionProvider {
-
-private ServiceManager m_manager;
-private DataSourceComponent m_ds;
-
-public DataSourceComponentConnectionProvider(String dsName, ServiceManager 
manager) throws ConfigurationException {
-m_manager = manager;
-try {
-m_ds = (DataSourceComponent) 
m_manager.lookup(DataSourceComponent.ROLE + / + dsName);
-}
-catch (ServiceException e) {
-throw new ConfigurationException(No datasource available by that 
name:  + dsName);
-}
-}
-
-/*
- * @see org.quartz.utils.ConnectionProvider#getConnection()
- */
-public Connection getConnection() throws SQLException {
-return m_ds.getConnection();
-}
-
-/*
- * @see org.quartz.utils.ConnectionProvider#shutdown()
- */
-public void shutdown() throws SQLException {
-if (m_ds != null) {
-m_manager.release(m_ds);
-}
-m_ds = null;
-m_manager = null;
-}
-
-}
+/*
+ * Copyright 1999-2004 The Apache Software Foundation.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.cocoon.components.cron;
+
+import java.sql.Connection;
+import java.sql.SQLException;
+
+import org.apache.avalon.excalibur.datasource.DataSourceComponent;
+import org.apache.avalon.framework.configuration.ConfigurationException;
+import org.apache.avalon.framework.service.ServiceException;
+import org.apache.avalon.framework.service.ServiceManager;
+import org.quartz.utils.ConnectionProvider;
+
+/**
+ * Quartz database connection provider that uses the 
+ * Excalibur DataSourceComponent service.
+ */
+public class DataSourceComponentConnectionProvider implements 
ConnectionProvider {
+
+private ServiceManager m_manager;
+private DataSourceComponent m_ds;
+
+public DataSourceComponentConnectionProvider(String dsName, ServiceManager 
manager) throws ConfigurationException {
+m_manager = manager;
+try {
+m_ds = (DataSourceComponent) 
m_manager.lookup(DataSourceComponent.ROLE + / + dsName);
+}
+catch (ServiceException e) {
+throw new ConfigurationException(No datasource available by that 
name:  + dsName);
+}
+}
+
+/*
+ * @see org.quartz.utils.ConnectionProvider#getConnection()
+ */
+public Connection getConnection() throws SQLException {
+return m_ds.getConnection();
+}
+
+/*
+ * @see org.quartz.utils.ConnectionProvider#shutdown

svn commit: rev 55002 - cocoon/trunk/src/java/org/apache/cocoon/environment/wrapper

2004-10-18 Thread unico
Author: unico
Date: Mon Oct 18 06:10:24 2004
New Revision: 55002

Added:
   
cocoon/trunk/src/java/org/apache/cocoon/environment/wrapper/ResponseWrapper.java
Modified:
   
cocoon/trunk/src/java/org/apache/cocoon/environment/wrapper/EnvironmentWrapper.java
Log:
introduce WrappedResponse for preventing internal requests to modify the 
response headers
as discussed here: http://marc.theaimsgroup.com/?t=10978326015r=1w=2

Modified: 
cocoon/trunk/src/java/org/apache/cocoon/environment/wrapper/EnvironmentWrapper.java
==
--- 
cocoon/trunk/src/java/org/apache/cocoon/environment/wrapper/EnvironmentWrapper.java
 (original)
+++ 
cocoon/trunk/src/java/org/apache/cocoon/environment/wrapper/EnvironmentWrapper.java
 Mon Oct 18 06:10:24 2004
@@ -27,6 +27,7 @@
 import org.apache.cocoon.environment.Environment;
 import org.apache.cocoon.environment.ObjectModelHelper;
 import org.apache.cocoon.environment.Request;
+import org.apache.cocoon.environment.Response;
 import org.apache.cocoon.util.BufferedOutputStream;
 
 
@@ -37,7 +38,7 @@
  *
  * @author a href=mailto:[EMAIL PROTECTED]Bjouml;rn Luuml;tkemeier/a
  * @author a href=mailto:[EMAIL PROTECTED]Carsten Ziegeler/a
- * @version CVS $Id: EnvironmentWrapper.java,v 1.21 2004/06/25 15:36:38 
cziegeler Exp $
+ * @version CVS $Id$
  */
 public class EnvironmentWrapper 
 extends AbstractEnvironment {
@@ -90,7 +91,9 @@
   info.queryString,
   this,
   info.rawMode);
+Response response = new 
ResponseWrapper(ObjectModelHelper.getResponse(oldObjectModel));
 this.objectModel.put(ObjectModelHelper.REQUEST_OBJECT, this.request);
+this.objectModel.put(ObjectModelHelper.RESPONSE_OBJECT, response);
 
 this.setURI(info.prefix, info.uri);
 }

Added: 
cocoon/trunk/src/java/org/apache/cocoon/environment/wrapper/ResponseWrapper.java
==
--- (empty file)
+++ 
cocoon/trunk/src/java/org/apache/cocoon/environment/wrapper/ResponseWrapper.java
Mon Oct 18 06:10:24 2004
@@ -0,0 +1,82 @@
+/*
+ * Copyright 1999-2004 The Apache Software Foundation.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.cocoon.environment.wrapper;
+
+import java.util.Locale;
+
+import org.apache.cocoon.environment.Cookie;
+import org.apache.cocoon.environment.Response;
+
+/**
+ * This is a wrapper class for the Response object.
+ * It contains the same properties as the wrapped instance
+ * but swallows calls that would modify response headers.
+ */
+public class ResponseWrapper implements Response {
+
+private Response res;
+
+public ResponseWrapper(Response response) {
+this.res = response;
+}
+
+public String getCharacterEncoding() {
+return res.getCharacterEncoding();
+}
+
+public void setLocale(Locale loc) {
+res.setLocale(loc);
+}
+
+public Locale getLocale() {
+return res.getLocale();
+}
+
+public Cookie createCookie(String name, String value) {
+return res.createCookie(name, value);
+}
+
+public void addCookie(Cookie cookie) {
+res.addCookie(cookie);
+}
+
+public String encodeURL(String url) {
+return res.encodeURL(url);
+}
+
+public boolean containsHeader(String name) {
+return res.containsHeader(name);
+}
+
+public void setDateHeader(String name, long date) {
+}
+
+public void addDateHeader(String name, long date) {
+}
+
+public void setHeader(String name, String value) {
+}
+
+public void addHeader(String name, String value) {
+}
+
+public void setIntHeader(String name, int value) {
+}
+
+public void addIntHeader(String name, int value) {
+}
+
+}


svn commit: rev 55003 - cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/environment/wrapper

2004-10-18 Thread unico
Author: unico
Date: Mon Oct 18 06:10:37 2004
New Revision: 55003

Added:
   
cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/environment/wrapper/ResponseWrapper.java
Modified:
   
cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/environment/wrapper/EnvironmentWrapper.java
Log:
introduce WrappedResponse for preventing internal requests to modify the 
response headers
as discussed here: http://marc.theaimsgroup.com/?t=10978326015r=1w=2

Modified: 
cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/environment/wrapper/EnvironmentWrapper.java
==
--- 
cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/environment/wrapper/EnvironmentWrapper.java
 (original)
+++ 
cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/environment/wrapper/EnvironmentWrapper.java
 Mon Oct 18 06:10:37 2004
@@ -29,6 +29,7 @@
 import org.apache.cocoon.environment.Environment;
 import org.apache.cocoon.environment.ObjectModelHelper;
 import org.apache.cocoon.environment.Request;
+import org.apache.cocoon.environment.Response;
 import org.apache.cocoon.util.BufferedOutputStream;
 
 
@@ -39,7 +40,7 @@
  *
  * @author a href=mailto:[EMAIL PROTECTED]Bjouml;rn Luuml;tkemeier/a
  * @author a href=mailto:[EMAIL PROTECTED]Carsten Ziegeler/a
- * @version CVS $Id: EnvironmentWrapper.java,v 1.15 2004/03/18 15:08:12 
cziegeler Exp $
+ * @version CVS $Id$
  */
 public class EnvironmentWrapper 
 extends AbstractEnvironment 
@@ -163,7 +164,10 @@
   queryString,
   this,
   rawMode);
+Response response = new 
ResponseWrapper(ObjectModelHelper.getResponse(oldObjectModel));
 this.objectModel.put(ObjectModelHelper.REQUEST_OBJECT, this.request);
+this.objectModel.put(ObjectModelHelper.RESPONSE_OBJECT, response);
+
 }

 public EnvironmentWrapper(Environment env, ComponentManager manager, 
String uri,  Logger logger)  throws MalformedURLException {

Added: 
cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/environment/wrapper/ResponseWrapper.java
==
--- (empty file)
+++ 
cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/environment/wrapper/ResponseWrapper.java
Mon Oct 18 06:10:37 2004
@@ -0,0 +1,82 @@
+/*
+ * Copyright 1999-2004 The Apache Software Foundation.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.cocoon.environment.wrapper;
+
+import java.util.Locale;
+
+import org.apache.cocoon.environment.Cookie;
+import org.apache.cocoon.environment.Response;
+
+/**
+ * This is a wrapper class for the Response object.
+ * It contains the same properties as the wrapped instance
+ * but swallows calls that would modify response headers.
+ */
+public class ResponseWrapper implements Response {
+
+private Response res;
+
+public ResponseWrapper(Response response) {
+this.res = response;
+}
+
+public String getCharacterEncoding() {
+return res.getCharacterEncoding();
+}
+
+public void setLocale(Locale loc) {
+res.setLocale(loc);
+}
+
+public Locale getLocale() {
+return res.getLocale();
+}
+
+public Cookie createCookie(String name, String value) {
+return res.createCookie(name, value);
+}
+
+public void addCookie(Cookie cookie) {
+res.addCookie(cookie);
+}
+
+public String encodeURL(String url) {
+return res.encodeURL(url);
+}
+
+public boolean containsHeader(String name) {
+return res.containsHeader(name);
+}
+
+public void setDateHeader(String name, long date) {
+}
+
+public void addDateHeader(String name, long date) {
+}
+
+public void setHeader(String name, String value) {
+}
+
+public void addHeader(String name, String value) {
+}
+
+public void setIntHeader(String name, int value) {
+}
+
+public void addIntHeader(String name, int value) {
+}
+
+}


svn commit: rev 55005 - cocoon/trunk/src/java/org/apache/cocoon/environment/wrapper

2004-10-18 Thread unico
Author: unico
Date: Mon Oct 18 06:16:08 2004
New Revision: 55005

Modified:
   
cocoon/trunk/src/java/org/apache/cocoon/environment/wrapper/ResponseWrapper.java
   (contents, props changed)
Log:
props

Modified: 
cocoon/trunk/src/java/org/apache/cocoon/environment/wrapper/ResponseWrapper.java
==
--- 
cocoon/trunk/src/java/org/apache/cocoon/environment/wrapper/ResponseWrapper.java
(original)
+++ 
cocoon/trunk/src/java/org/apache/cocoon/environment/wrapper/ResponseWrapper.java
Mon Oct 18 06:16:08 2004
@@ -1,82 +1,82 @@
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- * 
- * Licensed under the Apache License, Version 2.0 (the License);
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *  http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an AS IS BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.cocoon.environment.wrapper;
-
-import java.util.Locale;
-
-import org.apache.cocoon.environment.Cookie;
-import org.apache.cocoon.environment.Response;
-
-/**
- * This is a wrapper class for the Response object.
- * It contains the same properties as the wrapped instance
- * but swallows calls that would modify response headers.
- */
-public class ResponseWrapper implements Response {
-
-private Response res;
-
-public ResponseWrapper(Response response) {
-this.res = response;
-}
-
-public String getCharacterEncoding() {
-return res.getCharacterEncoding();
-}
-
-public void setLocale(Locale loc) {
-res.setLocale(loc);
-}
-
-public Locale getLocale() {
-return res.getLocale();
-}
-
-public Cookie createCookie(String name, String value) {
-return res.createCookie(name, value);
-}
-
-public void addCookie(Cookie cookie) {
-res.addCookie(cookie);
-}
-
-public String encodeURL(String url) {
-return res.encodeURL(url);
-}
-
-public boolean containsHeader(String name) {
-return res.containsHeader(name);
-}
-
-public void setDateHeader(String name, long date) {
-}
-
-public void addDateHeader(String name, long date) {
-}
-
-public void setHeader(String name, String value) {
-}
-
-public void addHeader(String name, String value) {
-}
-
-public void setIntHeader(String name, int value) {
-}
-
-public void addIntHeader(String name, int value) {
-}
-
-}
+/*
+ * Copyright 1999-2004 The Apache Software Foundation.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.cocoon.environment.wrapper;
+
+import java.util.Locale;
+
+import org.apache.cocoon.environment.Cookie;
+import org.apache.cocoon.environment.Response;
+
+/**
+ * This is a wrapper class for the Response object.
+ * It contains the same properties as the wrapped instance
+ * but swallows calls that would modify response headers.
+ */
+public class ResponseWrapper implements Response {
+
+private Response res;
+
+public ResponseWrapper(Response response) {
+this.res = response;
+}
+
+public String getCharacterEncoding() {
+return res.getCharacterEncoding();
+}
+
+public void setLocale(Locale loc) {
+res.setLocale(loc);
+}
+
+public Locale getLocale() {
+return res.getLocale();
+}
+
+public Cookie createCookie(String name, String value) {
+return res.createCookie(name, value);
+}
+
+public void addCookie(Cookie cookie) {
+res.addCookie(cookie);
+}
+
+public String encodeURL(String url) {
+return res.encodeURL(url);
+}
+
+public boolean containsHeader(String name) {
+return res.containsHeader(name);
+}
+
+public void setDateHeader(String name, long date) {
+}
+
+public void addDateHeader(String name, long date) {
+}
+
+public void setHeader(String name, String value) {
+}
+
+public void addHeader(String name, String value) {
+}
+
+public void setIntHeader(String name, int value) {
+}
+
+public void addIntHeader(String name, int value) {
+}
+
+}


svn commit: rev 55006 - cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/environment/wrapper

2004-10-18 Thread unico
Author: unico
Date: Mon Oct 18 06:16:18 2004
New Revision: 55006

Modified:
   
cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/environment/wrapper/ResponseWrapper.java
   (contents, props changed)
Log:
props

Modified: 
cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/environment/wrapper/ResponseWrapper.java
==
--- 
cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/environment/wrapper/ResponseWrapper.java
(original)
+++ 
cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/environment/wrapper/ResponseWrapper.java
Mon Oct 18 06:16:18 2004
@@ -1,82 +1,82 @@
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- * 
- * Licensed under the Apache License, Version 2.0 (the License);
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *  http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an AS IS BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.cocoon.environment.wrapper;
-
-import java.util.Locale;
-
-import org.apache.cocoon.environment.Cookie;
-import org.apache.cocoon.environment.Response;
-
-/**
- * This is a wrapper class for the Response object.
- * It contains the same properties as the wrapped instance
- * but swallows calls that would modify response headers.
- */
-public class ResponseWrapper implements Response {
-
-private Response res;
-
-public ResponseWrapper(Response response) {
-this.res = response;
-}
-
-public String getCharacterEncoding() {
-return res.getCharacterEncoding();
-}
-
-public void setLocale(Locale loc) {
-res.setLocale(loc);
-}
-
-public Locale getLocale() {
-return res.getLocale();
-}
-
-public Cookie createCookie(String name, String value) {
-return res.createCookie(name, value);
-}
-
-public void addCookie(Cookie cookie) {
-res.addCookie(cookie);
-}
-
-public String encodeURL(String url) {
-return res.encodeURL(url);
-}
-
-public boolean containsHeader(String name) {
-return res.containsHeader(name);
-}
-
-public void setDateHeader(String name, long date) {
-}
-
-public void addDateHeader(String name, long date) {
-}
-
-public void setHeader(String name, String value) {
-}
-
-public void addHeader(String name, String value) {
-}
-
-public void setIntHeader(String name, int value) {
-}
-
-public void addIntHeader(String name, int value) {
-}
-
-}
+/*
+ * Copyright 1999-2004 The Apache Software Foundation.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.cocoon.environment.wrapper;
+
+import java.util.Locale;
+
+import org.apache.cocoon.environment.Cookie;
+import org.apache.cocoon.environment.Response;
+
+/**
+ * This is a wrapper class for the Response object.
+ * It contains the same properties as the wrapped instance
+ * but swallows calls that would modify response headers.
+ */
+public class ResponseWrapper implements Response {
+
+private Response res;
+
+public ResponseWrapper(Response response) {
+this.res = response;
+}
+
+public String getCharacterEncoding() {
+return res.getCharacterEncoding();
+}
+
+public void setLocale(Locale loc) {
+res.setLocale(loc);
+}
+
+public Locale getLocale() {
+return res.getLocale();
+}
+
+public Cookie createCookie(String name, String value) {
+return res.createCookie(name, value);
+}
+
+public void addCookie(Cookie cookie) {
+res.addCookie(cookie);
+}
+
+public String encodeURL(String url) {
+return res.encodeURL(url);
+}
+
+public boolean containsHeader(String name) {
+return res.containsHeader(name);
+}
+
+public void setDateHeader(String name, long date) {
+}
+
+public void addDateHeader(String name, long date) {
+}
+
+public void setHeader(String name, String value) {
+}
+
+public void addHeader(String name, String value) {
+}
+
+public void setIntHeader(String name, int value

svn commit: rev 55023 - in cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon: components/treeprocessor environment/wrapper

2004-10-18 Thread unico
Author: unico
Date: Mon Oct 18 10:24:18 2004
New Revision: 55023

Modified:
   
cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/components/treeprocessor/ConcreteTreeProcessor.java
   
cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/environment/wrapper/EnvironmentWrapper.java
Log:
add a flag to the wrapper environment telling it whether to wrap the response 
or not
because forwarding redirects from the treeprocessor must not be handled with a 
wrapped response

Modified: 
cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/components/treeprocessor/ConcreteTreeProcessor.java
==
--- 
cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/components/treeprocessor/ConcreteTreeProcessor.java
 (original)
+++ 
cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/components/treeprocessor/ConcreteTreeProcessor.java
 Mon Oct 18 10:24:18 2004
@@ -361,7 +361,7 @@
 public ForwardEnvironmentWrapper(Environment env,
 ComponentManager manager, String uri, Logger logger) 
 throws MalformedURLException {
-super(env, manager, uri, logger);
+super(env, manager, uri, logger, false);
 }
 
 public void setStatus(int statusCode) {

Modified: 
cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/environment/wrapper/EnvironmentWrapper.java
==
--- 
cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/environment/wrapper/EnvironmentWrapper.java
 (original)
+++ 
cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/environment/wrapper/EnvironmentWrapper.java
 Mon Oct 18 10:24:18 2004
@@ -110,7 +110,7 @@
   ComponentManager manager,
   boolean  rawMode)
 throws MalformedURLException {
-this(env, requestURI, queryString, logger, null, 
rawMode,env.getView());
+this(env, requestURI, queryString, logger, null, 
rawMode,env.getView(), true);
 }
 
 /**
@@ -125,17 +125,34 @@
   boolean  rawMode,
   String   view)
 throws MalformedURLException {
-super(env.getURI(), view, env.getContext(), env.getAction());
-init(env, requestURI, queryString, logger, manager, rawMode, view);
+this(env, requestURI, queryString, logger, manager, rawMode, view, 
true);
 }
 
-private void init(Environment  env,
+/**
+ * Constructs an EnvironmentWrapper object from a Request
+ * and Response objects
+ */
+public EnvironmentWrapper(Environment  env,
   String   requestURI,
   String   queryString,
   Logger   logger,
   ComponentManager manager,
   boolean  rawMode,
-  String   view)
+  String   view,
+  boolean  wrapResponse)
+throws MalformedURLException {
+super(env.getURI(), view, env.getContext(), env.getAction());
+init(env, requestURI, queryString, logger, manager, rawMode, view, 
wrapResponse);
+}
+
+private void init(Environment  env,
+  String   requestURI,
+  String   queryString,
+  Logger   logger,
+  ComponentManager manager,
+  boolean  rawMode,
+  String   view,
+  boolean  wrapResponse)
 throws MalformedURLException {
 //super(env.getURI(), view, env.getContext(), env.getAction());
 this.rootContext = env.getRootContext();
@@ -164,13 +181,14 @@
   queryString,
   this,
   rawMode);
-Response response = new 
ResponseWrapper(ObjectModelHelper.getResponse(oldObjectModel));
 this.objectModel.put(ObjectModelHelper.REQUEST_OBJECT, this.request);
-this.objectModel.put(ObjectModelHelper.RESPONSE_OBJECT, response);
-
+if (wrapResponse) {
+Response response = new 
ResponseWrapper(ObjectModelHelper.getResponse(oldObjectModel));
+this.objectModel.put(ObjectModelHelper.RESPONSE_OBJECT, response);
+}
 }

-public EnvironmentWrapper(Environment env, ComponentManager manager, 
String uri,  Logger logger)  throws MalformedURLException {
+public EnvironmentWrapper(Environment env, ComponentManager manager, 
String uri,  Logger logger, boolean wrapResponse)  throws MalformedURLException 
{
 super(env.getURI(), env.getView(), env.getContext(), env.getAction

svn commit: rev 54739 - in cocoon/trunk/src/blocks/cron: conf java/org/apache/cocoon/components/cron

2004-10-13 Thread unico
Author: unico
Date: Wed Oct 13 03:58:03 2004
New Revision: 54739

Added:
   
cocoon/trunk/src/blocks/cron/java/org/apache/cocoon/components/cron/CocoonQuartzJobExecutor.java
   
cocoon/trunk/src/blocks/cron/java/org/apache/cocoon/components/cron/CocoonQuartzJobScheduler.java
Modified:
   cocoon/trunk/src/blocks/cron/conf/cron.xconf
   
cocoon/trunk/src/blocks/cron/java/org/apache/cocoon/components/cron/QuartzJobExecutor.java
   
cocoon/trunk/src/blocks/cron/java/org/apache/cocoon/components/cron/QuartzJobScheduler.java
Log:
Factor out Cocoon specific setup within executor to allow for the possibility 
of running Jobs ouside Cocoon environment (default remains like before)


Modified: cocoon/trunk/src/blocks/cron/conf/cron.xconf
==
--- cocoon/trunk/src/blocks/cron/conf/cron.xconf(original)
+++ cocoon/trunk/src/blocks/cron/conf/cron.xconfWed Oct 13 03:58:03 2004
@@ -19,7 +19,7 @@
 xconf xpath=/cocoon unless=[EMAIL 
PROTECTED]'org.apache.cocoon.components.cron.JobScheduler']
 
 component role=org.apache.cocoon.components.cron.JobScheduler
-   class=org.apache.cocoon.components.cron.QuartzJobScheduler
+   
class=org.apache.cocoon.components.cron.CocoonQuartzJobScheduler
logger=cron
   !--+
   | Definitions for a thread pool used to schedule jobs

Added: 
cocoon/trunk/src/blocks/cron/java/org/apache/cocoon/components/cron/CocoonQuartzJobExecutor.java
==
--- (empty file)
+++ 
cocoon/trunk/src/blocks/cron/java/org/apache/cocoon/components/cron/CocoonQuartzJobExecutor.java
Wed Oct 13 03:58:03 2004
@@ -0,0 +1,81 @@
+/*
+ * Copyright 1999-2004 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.cocoon.components.cron;
+
+import org.apache.avalon.framework.context.ContextException;
+import org.apache.avalon.framework.service.ServiceException;
+import org.apache.cocoon.Constants;
+import org.apache.cocoon.ProcessingException;
+import org.apache.cocoon.Processor;
+import org.apache.cocoon.environment.Context;
+import org.apache.cocoon.environment.background.BackgroundEnvironment;
+import org.apache.cocoon.environment.internal.EnvironmentHelper;
+import org.quartz.JobDataMap;
+import org.quartz.JobExecutionException;
+
+/**
+ * This component is resposible to launch a [EMAIL PROTECTED] CronJob}s in a 
Quart Scheduler.
+ *
+ * @author a href=mailto:[EMAIL PROTECTED]Giacomo Pati/a
+ * @version CVS $Id: CocoonQuartzJobExecutor.java 54674 2004-10-12 15:50:03Z 
unico $
+ *
+ * @since 2.1.1
+ */
+public class CocoonQuartzJobExecutor extends QuartzJobExecutor {
+
+private BackgroundEnvironment m_env;
+private Processor m_processor;
+
+protected void setup(JobDataMap data) throws JobExecutionException {
+super.setup(data);
+
+Context envContext;
+try {
+envContext = (Context) 
m_context.get(Constants.CONTEXT_ENVIRONMENT_CONTEXT);
+} catch (ContextException e) {
+   throw new JobExecutionException(e);
+}
+
+m_env = new BackgroundEnvironment(m_logger, envContext);
+
+try {
+m_processor = (Processor) m_manager.lookup(Processor.ROLE);
+} catch (ServiceException e) {
+throw new JobExecutionException(e);
+}
+
+m_env.startingProcessing();
+
+try {
+EnvironmentHelper.enterProcessor(m_processor, m_manager, m_env);
+}
+catch (ProcessingException e) {
+throw new JobExecutionException(e);
+}
+}
+
+protected void release(JobDataMap data) {
+super.release(data);
+
+EnvironmentHelper.leaveProcessor();
+m_env.finishingProcessing();
+
+if (m_manager != null) {
+m_manager.release(m_processor);
+}
+}
+
+}

Added: 
cocoon/trunk/src/blocks/cron/java/org/apache/cocoon/components/cron/CocoonQuartzJobScheduler.java
==
--- (empty file)
+++ 
cocoon/trunk/src/blocks/cron/java/org/apache/cocoon/components/cron/CocoonQuartzJobScheduler.java
   Wed Oct 13 03:58:03 2004
@@ -0,0 +1,37 @@
+/*
+ * Copyright 1999-2004 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the License

svn commit: rev 54740 - cocoon/trunk/src/blocks/cron/java/org/apache/cocoon/components/cron

2004-10-13 Thread unico
Author: unico
Date: Wed Oct 13 03:59:38 2004
New Revision: 54740

Modified:
   
cocoon/trunk/src/blocks/cron/java/org/apache/cocoon/components/cron/CocoonQuartzJobExecutor.java
   (contents, props changed)
   
cocoon/trunk/src/blocks/cron/java/org/apache/cocoon/components/cron/CocoonQuartzJobScheduler.java
   (contents, props changed)
Log:
props

Modified: 
cocoon/trunk/src/blocks/cron/java/org/apache/cocoon/components/cron/CocoonQuartzJobExecutor.java
==
--- 
cocoon/trunk/src/blocks/cron/java/org/apache/cocoon/components/cron/CocoonQuartzJobExecutor.java
(original)
+++ 
cocoon/trunk/src/blocks/cron/java/org/apache/cocoon/components/cron/CocoonQuartzJobExecutor.java
Wed Oct 13 03:59:38 2004
@@ -1,81 +1,81 @@
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the License);
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *  http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an AS IS BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.cocoon.components.cron;
-
-import org.apache.avalon.framework.context.ContextException;
-import org.apache.avalon.framework.service.ServiceException;
-import org.apache.cocoon.Constants;
-import org.apache.cocoon.ProcessingException;
-import org.apache.cocoon.Processor;
-import org.apache.cocoon.environment.Context;
-import org.apache.cocoon.environment.background.BackgroundEnvironment;
-import org.apache.cocoon.environment.internal.EnvironmentHelper;
-import org.quartz.JobDataMap;
-import org.quartz.JobExecutionException;
-
-/**
- * This component is resposible to launch a [EMAIL PROTECTED] CronJob}s in a 
Quart Scheduler.
- *
- * @author a href=mailto:[EMAIL PROTECTED]Giacomo Pati/a
- * @version CVS $Id: CocoonQuartzJobExecutor.java 54674 2004-10-12 15:50:03Z 
unico $
- *
- * @since 2.1.1
- */
-public class CocoonQuartzJobExecutor extends QuartzJobExecutor {
-
-private BackgroundEnvironment m_env;
-private Processor m_processor;
-
-protected void setup(JobDataMap data) throws JobExecutionException {
-super.setup(data);
-
-Context envContext;
-try {
-envContext = (Context) 
m_context.get(Constants.CONTEXT_ENVIRONMENT_CONTEXT);
-} catch (ContextException e) {
-   throw new JobExecutionException(e);
-}
-
-m_env = new BackgroundEnvironment(m_logger, envContext);
-
-try {
-m_processor = (Processor) m_manager.lookup(Processor.ROLE);
-} catch (ServiceException e) {
-throw new JobExecutionException(e);
-}
-
-m_env.startingProcessing();
-
-try {
-EnvironmentHelper.enterProcessor(m_processor, m_manager, m_env);
-}
-catch (ProcessingException e) {
-throw new JobExecutionException(e);
-}
-}
-
-protected void release(JobDataMap data) {
-super.release(data);
-
-EnvironmentHelper.leaveProcessor();
-m_env.finishingProcessing();
-
-if (m_manager != null) {
-m_manager.release(m_processor);
-}
-}
-
-}
+/*
+ * Copyright 1999-2004 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.cocoon.components.cron;
+
+import org.apache.avalon.framework.context.ContextException;
+import org.apache.avalon.framework.service.ServiceException;
+import org.apache.cocoon.Constants;
+import org.apache.cocoon.ProcessingException;
+import org.apache.cocoon.Processor;
+import org.apache.cocoon.environment.Context;
+import org.apache.cocoon.environment.background.BackgroundEnvironment;
+import org.apache.cocoon.environment.internal.EnvironmentHelper;
+import org.quartz.JobDataMap;
+import org.quartz.JobExecutionException;
+
+/**
+ * This component is resposible to launch a [EMAIL PROTECTED] CronJob}s in a 
Quart Scheduler.
+ *
+ * @author a href=mailto:[EMAIL PROTECTED]Giacomo Pati/a
+ * @version CVS $Id$
+ *
+ * @since 2.1.1
+ */
+public class CocoonQuartzJobExecutor extends

svn commit: rev 54673 - in cocoon/branches/BRANCH_2_1_X/src/blocks/cron: conf java/org/apache/cocoon/components/cron

2004-10-12 Thread unico
Author: unico
Date: Tue Oct 12 08:42:11 2004
New Revision: 54673

Added:
   
cocoon/branches/BRANCH_2_1_X/src/blocks/cron/java/org/apache/cocoon/components/cron/CocoonQuartzJobExecutor.java
   
cocoon/branches/BRANCH_2_1_X/src/blocks/cron/java/org/apache/cocoon/components/cron/CocoonQuartzJobScheduler.java
Modified:
   cocoon/branches/BRANCH_2_1_X/src/blocks/cron/conf/cron.xconf
   
cocoon/branches/BRANCH_2_1_X/src/blocks/cron/java/org/apache/cocoon/components/cron/QuartzJobExecutor.java
   
cocoon/branches/BRANCH_2_1_X/src/blocks/cron/java/org/apache/cocoon/components/cron/QuartzJobScheduler.java
Log:
Factor out Cocoon specific setup within executor to allow for the possibility 
of running Jobs ouside Cocoon environment (default remains like before)


Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/cron/conf/cron.xconf
==
--- cocoon/branches/BRANCH_2_1_X/src/blocks/cron/conf/cron.xconf
(original)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/cron/conf/cron.xconfTue Oct 
12 08:42:11 2004
@@ -19,7 +19,7 @@
 xconf xpath=/cocoon unless=[EMAIL 
PROTECTED]'org.apache.cocoon.components.cron.JobScheduler']
 
 component role=org.apache.cocoon.components.cron.JobScheduler
-   class=org.apache.cocoon.components.cron.QuartzJobScheduler
+   
class=org.apache.cocoon.components.cron.CocoonQuartzJobScheduler
logger=cron
   !--+
   | Definitions for a thread pool used to schedule jobs

Added: 
cocoon/branches/BRANCH_2_1_X/src/blocks/cron/java/org/apache/cocoon/components/cron/CocoonQuartzJobExecutor.java
==
--- (empty file)
+++ 
cocoon/branches/BRANCH_2_1_X/src/blocks/cron/java/org/apache/cocoon/components/cron/CocoonQuartzJobExecutor.java
Tue Oct 12 08:42:11 2004
@@ -0,0 +1,80 @@
+/*
+ * Copyright 1999-2004 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.cocoon.components.cron;
+
+import java.net.MalformedURLException;
+
+import org.apache.avalon.framework.component.WrapperComponentManager;
+import org.apache.avalon.framework.context.ContextException;
+import org.apache.avalon.framework.service.ServiceException;
+import org.apache.cocoon.Constants;
+import org.apache.cocoon.Processor;
+import org.apache.cocoon.components.CocoonComponentManager;
+import org.apache.cocoon.environment.background.BackgroundEnvironment;
+import org.quartz.JobDataMap;
+import org.quartz.JobExecutionException;
+
+/**
+ * This component is resposible to launch a [EMAIL PROTECTED] CronJob}s in a 
Quart Scheduler.
+ *
+ * @author a href=mailto:[EMAIL PROTECTED]Giacomo Pati/a
+ * @version CVS $Id: QuartzJobExecutor.java 47533 2004-09-30 03:15:55Z 
vgritsenko $
+ *
+ * @since 2.1.1
+ */
+public class CocoonQuartzJobExecutor extends QuartzJobExecutor {
+
+private Object m_key;
+private BackgroundEnvironment m_env;
+private Processor m_processor;
+
+protected void setup(JobDataMap data) throws JobExecutionException {
+super.setup(data);
+org.apache.cocoon.environment.Context envContext;
+try {
+envContext =
+(org.apache.cocoon.environment.Context) 
m_context.get(Constants.CONTEXT_ENVIRONMENT_CONTEXT);
+} catch (ContextException e) {
+   throw new JobExecutionException(e);
+}
+
+try {
+m_env = new BackgroundEnvironment(m_logger, envContext);
+} catch (MalformedURLException e) {
+// Unlikely to happen
+throw new JobExecutionException(e);
+}
+
+try {
+m_processor = (Processor) m_manager.lookup(Processor.ROLE);
+} catch (ServiceException e) {
+throw new JobExecutionException(e);
+}
+
+m_key = CocoonComponentManager.startProcessing(m_env);
+CocoonComponentManager.enterEnvironment(m_env, new 
WrapperComponentManager(m_manager), m_processor);
+}
+
+protected void release(JobDataMap data) {
+super.release(data);
+CocoonComponentManager.leaveEnvironment();
+CocoonComponentManager.endProcessing(m_env, m_key);
+if (m_manager != null) {
+m_manager.release(m_processor);
+}
+}
+
+}

Added: 
cocoon/branches/BRANCH_2_1_X/src/blocks/cron/java/org/apache/cocoon/components/cron

svn commit: rev 54674 - cocoon/branches/BRANCH_2_1_X/src/blocks/cron/java/org/apache/cocoon/components/cron

2004-10-12 Thread unico
Author: unico
Date: Tue Oct 12 08:50:03 2004
New Revision: 54674

Modified:
   
cocoon/branches/BRANCH_2_1_X/src/blocks/cron/java/org/apache/cocoon/components/cron/CocoonQuartzJobExecutor.java
   (contents, props changed)
   
cocoon/branches/BRANCH_2_1_X/src/blocks/cron/java/org/apache/cocoon/components/cron/CocoonQuartzJobScheduler.java
   (contents, props changed)
Log:
props

Modified: 
cocoon/branches/BRANCH_2_1_X/src/blocks/cron/java/org/apache/cocoon/components/cron/CocoonQuartzJobExecutor.java
==
--- 
cocoon/branches/BRANCH_2_1_X/src/blocks/cron/java/org/apache/cocoon/components/cron/CocoonQuartzJobExecutor.java
(original)
+++ 
cocoon/branches/BRANCH_2_1_X/src/blocks/cron/java/org/apache/cocoon/components/cron/CocoonQuartzJobExecutor.java
Tue Oct 12 08:50:03 2004
@@ -1,80 +1,80 @@
-/*
- * Copyright 1999-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the License);
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *  http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an AS IS BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.cocoon.components.cron;
-
-import java.net.MalformedURLException;
-
-import org.apache.avalon.framework.component.WrapperComponentManager;
-import org.apache.avalon.framework.context.ContextException;
-import org.apache.avalon.framework.service.ServiceException;
-import org.apache.cocoon.Constants;
-import org.apache.cocoon.Processor;
-import org.apache.cocoon.components.CocoonComponentManager;
-import org.apache.cocoon.environment.background.BackgroundEnvironment;
-import org.quartz.JobDataMap;
-import org.quartz.JobExecutionException;
-
-/**
- * This component is resposible to launch a [EMAIL PROTECTED] CronJob}s in a 
Quart Scheduler.
- *
- * @author a href=mailto:[EMAIL PROTECTED]Giacomo Pati/a
- * @version CVS $Id: QuartzJobExecutor.java 47533 2004-09-30 03:15:55Z 
vgritsenko $
- *
- * @since 2.1.1
- */
-public class CocoonQuartzJobExecutor extends QuartzJobExecutor {
-
-private Object m_key;
-private BackgroundEnvironment m_env;
-private Processor m_processor;
-
-protected void setup(JobDataMap data) throws JobExecutionException {
-super.setup(data);
-org.apache.cocoon.environment.Context envContext;
-try {
-envContext =
-(org.apache.cocoon.environment.Context) 
m_context.get(Constants.CONTEXT_ENVIRONMENT_CONTEXT);
-} catch (ContextException e) {
-   throw new JobExecutionException(e);
-}
-
-try {
-m_env = new BackgroundEnvironment(m_logger, envContext);
-} catch (MalformedURLException e) {
-// Unlikely to happen
-throw new JobExecutionException(e);
-}
-
-try {
-m_processor = (Processor) m_manager.lookup(Processor.ROLE);
-} catch (ServiceException e) {
-throw new JobExecutionException(e);
-}
-
-m_key = CocoonComponentManager.startProcessing(m_env);
-CocoonComponentManager.enterEnvironment(m_env, new 
WrapperComponentManager(m_manager), m_processor);
-}
-
-protected void release(JobDataMap data) {
-super.release(data);
-CocoonComponentManager.leaveEnvironment();
-CocoonComponentManager.endProcessing(m_env, m_key);
-if (m_manager != null) {
-m_manager.release(m_processor);
-}
-}
-
-}
+/*
+ * Copyright 1999-2004 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.cocoon.components.cron;
+
+import java.net.MalformedURLException;
+
+import org.apache.avalon.framework.component.WrapperComponentManager;
+import org.apache.avalon.framework.context.ContextException;
+import org.apache.avalon.framework.service.ServiceException;
+import org.apache.cocoon.Constants;
+import org.apache.cocoon.Processor;
+import org.apache.cocoon.components.CocoonComponentManager;
+import org.apache.cocoon.environment.background.BackgroundEnvironment;
+import

svn commit: rev 51879 - cocoon/branches/BRANCH_2_1_X/src/blocks/chaperon/java/org/apache/cocoon/generation

2004-10-04 Thread unico
Author: unico
Date: Mon Oct  4 05:20:20 2004
New Revision: 51879

Modified:
   
cocoon/branches/BRANCH_2_1_X/src/blocks/chaperon/java/org/apache/cocoon/generation/TextGenerator.java
Log:
include parameters in cache key

Modified: 
cocoon/branches/BRANCH_2_1_X/src/blocks/chaperon/java/org/apache/cocoon/generation/TextGenerator.java
==
--- 
cocoon/branches/BRANCH_2_1_X/src/blocks/chaperon/java/org/apache/cocoon/generation/TextGenerator.java
   (original)
+++ 
cocoon/branches/BRANCH_2_1_X/src/blocks/chaperon/java/org/apache/cocoon/generation/TextGenerator.java
   Mon Oct  4 05:20:20 2004
@@ -51,7 +51,7 @@
  *
  * @author a href=mailto:[EMAIL PROTECTED]Stephan Michels /a
  * @author a href=mailto:[EMAIL PROTECTED]Rolf Schumacher/a
- * @version CVS $Id: TextGenerator.java,v 1.8 2004/04/03 00:46:33 antonio Exp $
+ * @version CVS $Id$
  */
 public class TextGenerator extends ServiceableGenerator implements 
Parameterizable,

CacheableProcessingComponent
@@ -138,7 +138,9 @@
*/
   public Serializable getKey()
   {
-return inputSource.getURI();
+return inputSource.getURI()
+   + ;localizable= + localizable
+   + ;encoding= + encoding;
   }
 
   /**


svn commit: rev 51878 - cocoon/trunk/src/blocks/chaperon/java/org/apache/cocoon/generation

2004-10-04 Thread unico
Author: unico
Date: Mon Oct  4 05:20:10 2004
New Revision: 51878

Modified:
   
cocoon/trunk/src/blocks/chaperon/java/org/apache/cocoon/generation/TextGenerator.java
Log:
include parameters in cache key

Modified: 
cocoon/trunk/src/blocks/chaperon/java/org/apache/cocoon/generation/TextGenerator.java
==
--- 
cocoon/trunk/src/blocks/chaperon/java/org/apache/cocoon/generation/TextGenerator.java
   (original)
+++ 
cocoon/trunk/src/blocks/chaperon/java/org/apache/cocoon/generation/TextGenerator.java
   Mon Oct  4 05:20:10 2004
@@ -51,7 +51,7 @@
  *
  * @author a href=mailto:[EMAIL PROTECTED]Stephan Michels /a
  * @author a href=mailto:[EMAIL PROTECTED]Rolf Schumacher/a
- * @version CVS $Id: TextGenerator.java,v 1.8 2004/04/03 00:46:33 antonio Exp $
+ * @version CVS $Id$
  */
 public class TextGenerator extends ServiceableGenerator implements 
Parameterizable,

CacheableProcessingComponent
@@ -138,7 +138,9 @@
*/
   public Serializable getKey()
   {
-return inputSource.getURI();
+return inputSource.getURI()
+   + ;localizable= + localizable
+   + ;encoding= + encoding;
   }
 
   /**


svn commit: rev 47641 - cocoon/branches/BRANCH_2_1_X/src/blocks/scratchpad/java/org/apache/cocoon/components/store

2004-10-01 Thread unico
Author: unico
Date: Fri Oct  1 03:45:07 2004
New Revision: 47641

Removed:
   
cocoon/branches/BRANCH_2_1_X/src/blocks/scratchpad/java/org/apache/cocoon/components/store/EHStore.java
   
cocoon/branches/BRANCH_2_1_X/src/blocks/scratchpad/java/org/apache/cocoon/components/store/ehcache-defaults.xml
   
cocoon/branches/BRANCH_2_1_X/src/blocks/scratchpad/java/org/apache/cocoon/components/store/ehcache.xml
Log:
ehcache store was moved


svn commit: rev 47573 - cocoon/branches/BRANCH_2_1_X/src/blocks/scratchpad/java/org/apache/cocoon/components/store

2004-09-30 Thread unico
Author: unico
Date: Thu Sep 30 03:42:19 2004
New Revision: 47573

Added:
   
cocoon/branches/BRANCH_2_1_X/src/blocks/scratchpad/java/org/apache/cocoon/components/store/EHStore.java
   
cocoon/branches/BRANCH_2_1_X/src/blocks/scratchpad/java/org/apache/cocoon/components/store/ehcache.xml
  - copied unchanged from rev 47396, 
cocoon/branches/BRANCH_2_1_X/src/blocks/scratchpad/java/org/apache/cocoon/components/store/ehcache-defaults.xml
Log:
- implement free()
- reduce configuration complexity and make it a proper DefaultStore
- use same parametrization as current DefaultStore to specify disk store 
location


Added: 
cocoon/branches/BRANCH_2_1_X/src/blocks/scratchpad/java/org/apache/cocoon/components/store/EHStore.java
==
--- (empty file)
+++ 
cocoon/branches/BRANCH_2_1_X/src/blocks/scratchpad/java/org/apache/cocoon/components/store/EHStore.java
 Thu Sep 30 03:42:19 2004
@@ -0,0 +1,370 @@
+/*
+ * Copyright 2004,2004 The Apache Software Foundation.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.cocoon.components.store;
+
+import java.io.File;
+import java.io.IOException;
+import java.io.Serializable;
+import java.net.URL;
+import java.util.Collections;
+import java.util.Enumeration;
+import java.util.List;
+
+import net.sf.ehcache.Cache;
+import net.sf.ehcache.CacheException;
+import net.sf.ehcache.CacheManager;
+import net.sf.ehcache.Element;
+
+import org.apache.cocoon.Constants;
+import org.apache.cocoon.util.IOUtils;
+
+import org.apache.avalon.framework.activity.Disposable;
+import org.apache.avalon.framework.activity.Initializable;
+import org.apache.avalon.framework.context.Context;
+import org.apache.avalon.framework.context.ContextException;
+import org.apache.avalon.framework.context.Contextualizable;
+import org.apache.avalon.framework.logger.AbstractLogEnabled;
+import org.apache.avalon.framework.parameters.ParameterException;
+import org.apache.avalon.framework.parameters.Parameterizable;
+import org.apache.avalon.framework.parameters.Parameters;
+import org.apache.avalon.framework.service.ServiceException;
+import org.apache.avalon.framework.service.ServiceManager;
+import org.apache.avalon.framework.service.Serviceable;
+import org.apache.avalon.framework.thread.ThreadSafe;
+import org.apache.excalibur.store.Store;
+import org.apache.excalibur.store.StoreJanitor;
+
+/**
+ * Store implementation based on EHCache.
+ * (http://ehcache.sourceforge.net/)
+ */
+public class EHStore extends AbstractLogEnabled 
+implements Store, Contextualizable, Serviceable, Parameterizable, 
Initializable, Disposable, ThreadSafe {
+
+//  Constants
+
+private static final String CONFIG_FILE = 
org/apache/cocoon/components/store/ehcache.xml;
+
+private static int instanceCount = 0;
+
+//  Instance variables
+
+private Cache cache;
+private CacheManager cacheManager;
+
+private final String cacheName;
+
+// configuration options
+private int maxObjects;
+private boolean overflowToDisk;
+
+/** The service manager */
+private ServiceManager manager;
+
+/** The store janitor */
+private StoreJanitor storeJanitor;
+
+private File workDir;
+private File cacheDir;
+
+//  Lifecycle
+
+public EHStore() {
+instanceCount++;
+this.cacheName = cocoon-ehcache- + instanceCount;
+}
+
+/* (non-Javadoc)
+ * @see 
org.apache.avalon.framework.context.Contextualizable#contextualize(org.apache.avalon.framework.context.Context)
+ */
+public void contextualize(Context context) throws ContextException {
+this.workDir = (File)context.get(Constants.CONTEXT_WORK_DIR);
+this.cacheDir = (File)context.get(Constants.CONTEXT_CACHE_DIR);
+}
+
+/* (non-Javadoc)
+ * @see 
org.apache.avalon.framework.service.Serviceable#service(org.apache.avalon.framework.service.ServiceManager)
+ */
+public void service(ServiceManager aManager) throws ServiceException {
+this.manager = aManager;
+this.storeJanitor = (StoreJanitor) 
this.manager.lookup(StoreJanitor.ROLE);
+}
+
+/**
+ * Configure the store. The following options can be used:
+ * ul
+ *  licodemaxobjects/code (1) - The maximum number of in-memory

svn commit: rev 47575 - in cocoon/branches/BRANCH_2_1_X: lib lib/core src/java/org/apache/cocoon src/java/org/apache/cocoon/components/store/impl src/webapp/WEB-INF

2004-09-30 Thread unico
Author: unico
Date: Thu Sep 30 04:05:19 2004
New Revision: 47575

Added:
   cocoon/branches/BRANCH_2_1_X/lib/core/ehcache-1.0.jar
  - copied unchanged from rev 47396, 
cocoon/branches/BRANCH_2_1_X/src/blocks/scratchpad/lib/ehcache-1.0.jar
   
cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/components/store/impl/EHDefaultStore.java
   (contents, props changed)
   
cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/components/store/impl/ehcache.xml
  - copied unchanged from rev 47573, 
cocoon/branches/BRANCH_2_1_X/src/blocks/scratchpad/java/org/apache/cocoon/components/store/ehcache.xml
Modified:
   cocoon/branches/BRANCH_2_1_X/lib/jars.xml
   cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/cocoon.roles
   cocoon/branches/BRANCH_2_1_X/src/webapp/WEB-INF/cocoon.xconf
Log:
move ehcache based store to the core and make it the default

Modified: cocoon/branches/BRANCH_2_1_X/lib/jars.xml
==
--- cocoon/branches/BRANCH_2_1_X/lib/jars.xml   (original)
+++ cocoon/branches/BRANCH_2_1_X/lib/jars.xml   Thu Sep 30 04:05:19 2004
@@ -568,7 +568,7 @@
 titleEHCache/title
 descriptionEasy Hibernate Cache/description
 used-byEHCache Store/used-by
-libscratchpad/lib/ehcache-1.0.jar/lib
+libcore/ehcache-1.0.jar/lib
 homepagehttp://ehcache.sourceforge.net//homepage
   /file
 

Modified: cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/cocoon.roles
==
--- cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/cocoon.roles
(original)
+++ cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/cocoon.roles
Thu Sep 30 04:05:19 2004
@@ -77,7 +77,7 @@
   !-- Stores: --
   role name=org.apache.excalibur.store.Store
shorthand=store
-   
default-class=org.apache.cocoon.components.store.impl.JCSDefaultStore/
+   default-class=org.apache.cocoon.components.store.impl.EHDefaultStore/
 
   role name=org.apache.excalibur.store.Store/TransientStore
 shorthand=transient-store

Added: 
cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/components/store/impl/EHDefaultStore.java
==
--- (empty file)
+++ 
cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/components/store/impl/EHDefaultStore.java
   Thu Sep 30 04:05:19 2004
@@ -0,0 +1,370 @@
+/*
+ * Copyright 2004,2004 The Apache Software Foundation.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.cocoon.components.store.impl;
+
+import java.io.File;
+import java.io.IOException;
+import java.io.Serializable;
+import java.net.URL;
+import java.util.Collections;
+import java.util.Enumeration;
+import java.util.List;
+
+import net.sf.ehcache.Cache;
+import net.sf.ehcache.CacheException;
+import net.sf.ehcache.CacheManager;
+import net.sf.ehcache.Element;
+
+import org.apache.cocoon.Constants;
+import org.apache.cocoon.util.IOUtils;
+
+import org.apache.avalon.framework.activity.Disposable;
+import org.apache.avalon.framework.activity.Initializable;
+import org.apache.avalon.framework.context.Context;
+import org.apache.avalon.framework.context.ContextException;
+import org.apache.avalon.framework.context.Contextualizable;
+import org.apache.avalon.framework.logger.AbstractLogEnabled;
+import org.apache.avalon.framework.parameters.ParameterException;
+import org.apache.avalon.framework.parameters.Parameterizable;
+import org.apache.avalon.framework.parameters.Parameters;
+import org.apache.avalon.framework.service.ServiceException;
+import org.apache.avalon.framework.service.ServiceManager;
+import org.apache.avalon.framework.service.Serviceable;
+import org.apache.avalon.framework.thread.ThreadSafe;
+import org.apache.excalibur.store.Store;
+import org.apache.excalibur.store.StoreJanitor;
+
+/**
+ * Store implementation based on EHCache.
+ * (http://ehcache.sourceforge.net/)
+ */
+public class EHDefaultStore extends AbstractLogEnabled 
+implements Store, Contextualizable, Serviceable, Parameterizable, 
Initializable, Disposable, ThreadSafe {
+
+//  Constants
+
+private static final String CONFIG_FILE = 
org/apache/cocoon/components/store/impl/ehcache.xml;
+
+private static int instanceCount = 0;
+
+//  Instance

svn commit: rev 47396 - in cocoon/branches/BRANCH_2_1_X: legal lib src/blocks/scratchpad/conf src/blocks/scratchpad/java/org/apache/cocoon/components/store src/blocks/scratchpad/lib

2004-09-28 Thread unico
Author: unico
Date: Tue Sep 28 07:07:23 2004
New Revision: 47396

Added:
   cocoon/branches/BRANCH_2_1_X/legal/ehcache-1.0.jar.license.txt
  - copied unchanged from rev 47395, 
cocoon/branches/BRANCH_2_1_X/legal/ehcache-0.9.jar.license.txt
   cocoon/branches/BRANCH_2_1_X/src/blocks/scratchpad/lib/ehcache-1.0.jar   
(contents, props changed)
Removed:
   cocoon/branches/BRANCH_2_1_X/src/blocks/scratchpad/lib/ehcache-0.9.jar
Modified:
   cocoon/branches/BRANCH_2_1_X/lib/jars.xml
   cocoon/branches/BRANCH_2_1_X/src/blocks/scratchpad/conf/ehstore.xconf
   
cocoon/branches/BRANCH_2_1_X/src/blocks/scratchpad/java/org/apache/cocoon/components/store/EHStore.java
   
cocoon/branches/BRANCH_2_1_X/src/blocks/scratchpad/java/org/apache/cocoon/components/store/ehcache-defaults.xml
Log:
update ehcache to version 1.0

Modified: cocoon/branches/BRANCH_2_1_X/lib/jars.xml
==
--- cocoon/branches/BRANCH_2_1_X/lib/jars.xml   (original)
+++ cocoon/branches/BRANCH_2_1_X/lib/jars.xml   Tue Sep 28 07:07:23 2004
@@ -568,7 +568,7 @@
 titleEHCache/title
 descriptionEasy Hibernate Cache/description
 used-byEHCache Store/used-by
-libscratchpad/lib/ehcache-0.9.jar/lib
+libscratchpad/lib/ehcache-1.0.jar/lib
 homepagehttp://ehcache.sourceforge.net//homepage
   /file
 

Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/scratchpad/conf/ehstore.xconf
==
--- cocoon/branches/BRANCH_2_1_X/src/blocks/scratchpad/conf/ehstore.xconf   
(original)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/scratchpad/conf/ehstore.xconf   
Tue Sep 28 07:07:23 2004
@@ -15,21 +15,14 @@
   limitations under the License.
 --
 
-xconf xpath=/cocoon unless=comment()[contains(.,'Experimental EHCache 
Store implementation')]
+xconf xpath=/cocoon unless=comment()[contains(.,'EHCache Store 
implementation')]
 
-  !-- Experimental EHCache Store implementation --
+  !-- EHCache Store implementation --
   !--
   store class=org.apache.cocoon.components.store.EHStore 
  logger=core.store
 parameter name=maxobjects value=1/
   /store
-  
-  transient-store class=org.apache.cocoon.components.store.EHStore 
-   logger=core.store.transient
-parameter name=maxobjects value=1000/
-parameter name=cache-name value=transient/
-parameter name=overflow-to-disk value=false/
-  /transient-store
   --
-  
+
 /xconf

Modified: 
cocoon/branches/BRANCH_2_1_X/src/blocks/scratchpad/java/org/apache/cocoon/components/store/EHStore.java
==
--- 
cocoon/branches/BRANCH_2_1_X/src/blocks/scratchpad/java/org/apache/cocoon/components/store/EHStore.java
 (original)
+++ 
cocoon/branches/BRANCH_2_1_X/src/blocks/scratchpad/java/org/apache/cocoon/components/store/EHStore.java
 Tue Sep 28 07:07:23 2004
@@ -20,6 +20,7 @@
 import java.net.URL;
 import java.util.Collections;
 import java.util.Enumeration;
+import java.util.List;
 
 import net.sf.ehcache.Cache;
 import net.sf.ehcache.CacheException;
@@ -47,20 +48,29 @@
 /**
  * Store implementation based on EHCache.
  * (http://ehcache.sourceforge.net/)
- * 
- * p
- *  IMPORTANT:br
- *  (from http://ehcache.sourceforge.net/documentation/) 
- *  Persistence:
- *  The Disk Cache used by EHCache is not meant to be persistence mechanism. 
- *  The data file for each cache is deleted, if it exists, on startup.
- *  No data from a previous instance of an application is persisted through 
the disk cache. 
- *  The data file for each cache is also deleted on shutdown.
- * /p
  */
 public class EHStore extends AbstractLogEnabled 
-implements Store, Parameterizable, Initializable, Disposable, ThreadSafe, 
Serviceable, Contextualizable {
-
+implements Store, Contextualizable, Serviceable, Parameterizable, 
Initializable, Disposable, ThreadSafe {
+
+   //  Constants
+
+   private static final String CACHE_NAME_PARAM = cache-name;
+   private static final String MAXOBJECTS_PARAM = maxobjects;
+   private static final String OVERFLOW_TO_DISK_PARAM = overflow-to-disk;
+   private static final String ETERNAL_PARAM = eternal;
+   private static final String TIME_TO_IDLE_PARAM = time-to-idle-seconds;
+private static final String TIME_TO_LIVE_PARAM = time-to-live-seconds;
+   private static final String THREAD_INTERVAL_PARAM = thread-interval;
+private static final String CONFIG_FILE_PARAM = config-file;
+
+   private static final String DEFAULT_CACHE_NAME = main;
+   private static final long DEFAULT_TIME_TO_IDLE = 120;
+   private static final long DEFAULT_TIME_TO_LIVE = 120;
+   private static final long DEFAULT_THREAD_INTERVAL = 120;
+   private static final String DEFAULT_CONFIG_FILE = 
org/apache/cocoon/components/store/ehcache-defaults.xml

svn commit: rev 47398 - cocoon/branches/BRANCH_2_1_X/src/blocks/scratchpad/java/org/apache/cocoon/components/store

2004-09-28 Thread unico
Author: unico
Date: Tue Sep 28 07:28:51 2004
New Revision: 47398

Modified:
   
cocoon/branches/BRANCH_2_1_X/src/blocks/scratchpad/java/org/apache/cocoon/components/store/EHStore.java
Log:
spaces for tabs

Modified: 
cocoon/branches/BRANCH_2_1_X/src/blocks/scratchpad/java/org/apache/cocoon/components/store/EHStore.java
==
--- 
cocoon/branches/BRANCH_2_1_X/src/blocks/scratchpad/java/org/apache/cocoon/components/store/EHStore.java
 (original)
+++ 
cocoon/branches/BRANCH_2_1_X/src/blocks/scratchpad/java/org/apache/cocoon/components/store/EHStore.java
 Tue Sep 28 07:28:51 2004
@@ -52,35 +52,36 @@
 public class EHStore extends AbstractLogEnabled 
 implements Store, Contextualizable, Serviceable, Parameterizable, 
Initializable, Disposable, ThreadSafe {
 
-   //  Constants
+//  Constants
 
-   private static final String CACHE_NAME_PARAM = cache-name;
-   private static final String MAXOBJECTS_PARAM = maxobjects;
-   private static final String OVERFLOW_TO_DISK_PARAM = overflow-to-disk;
-   private static final String ETERNAL_PARAM = eternal;
-   private static final String TIME_TO_IDLE_PARAM = time-to-idle-seconds;
+private static final String CACHE_NAME_PARAM = cache-name;
+private static final String MAXOBJECTS_PARAM = maxobjects;
+private static final String OVERFLOW_TO_DISK_PARAM = overflow-to-disk;
+private static final String ETERNAL_PARAM = eternal;
+private static final String TIME_TO_IDLE_PARAM = time-to-idle-seconds;
 private static final String TIME_TO_LIVE_PARAM = time-to-live-seconds;
-   private static final String THREAD_INTERVAL_PARAM = thread-interval;
+private static final String THREAD_INTERVAL_PARAM = thread-interval;
 private static final String CONFIG_FILE_PARAM = config-file;
 
-   private static final String DEFAULT_CACHE_NAME = main;
-   private static final long DEFAULT_TIME_TO_IDLE = 120;
-   private static final long DEFAULT_TIME_TO_LIVE = 120;
-   private static final long DEFAULT_THREAD_INTERVAL = 120;
-   private static final String DEFAULT_CONFIG_FILE = 
org/apache/cocoon/components/store/ehcache-defaults.xml;
+private static final String DEFAULT_CACHE_NAME = main;
+private static final long DEFAULT_TIME_TO_IDLE = 120;
+private static final long DEFAULT_TIME_TO_LIVE = 120;
+private static final long DEFAULT_THREAD_INTERVAL = 120;
+private static final String DEFAULT_CONFIG_FILE = 
org/apache/cocoon/components/store/ehcache-defaults.xml;
 
-   //  Instance 
variables
+//  Instance variables
 
 private Cache cache;
 private CacheManager cacheManager;
-
+
 // configuration options
 private String cacheName;
 private int maximumSize;
 private boolean overflowToDisk;
-   private boolean eternal;
+private boolean eternal;
 private long timeToIdle;
-   private long timeToLive;
+private long timeToLive;
+private long threadInterval;
 private String configFile;
 
 /** The service manager */
@@ -91,9 +92,8 @@
 
 /** The context containing the work and the cache directory */
 private Context context;
-   private long threadInterval;
 
-   //  Lifecycle
+//  Lifecycle
 
 public EHStore() {
 }
@@ -160,13 +160,13 @@
 this.cacheManager = CacheManager.create(configFileURL);
 if (tempDir != null) System.setProperty(java.io.tmpdir, tempDir);
 this.cache = new Cache(this.cacheName,
-  this.maximumSize,
-  this.overflowToDisk,
-  this.eternal,
-  this.timeToLive,
-  this.timeToIdle,
-  true,
-  this.threadInterval);
+   this.maximumSize,
+   this.overflowToDisk,
+   this.eternal,
+   this.timeToLive,
+   this.timeToIdle,
+   true,
+   this.threadInterval);
 this.cacheManager.addCache(this.cache);
 this.storeJanitor.register(this);
 }
@@ -273,16 +273,16 @@
  * @see org.apache.excalibur.store.Store#keys()
  */
 public Enumeration keys() {
-   List keys = null;
-   try

svn commit: rev 47049 - cocoon/trunk/src/blocks/cron/java/org/apache/cocoon/components/cron

2004-09-22 Thread unico
Author: unico
Date: Wed Sep 22 07:54:46 2004
New Revision: 47049

Modified:
   
cocoon/trunk/src/blocks/cron/java/org/apache/cocoon/components/cron/QuartzJobExecutor.java
   
cocoon/trunk/src/blocks/cron/java/org/apache/cocoon/components/cron/QuartzJobScheduler.java
Log:
apply avalon lifecycle methods to jobs that are not looked up from the service 
manager
similar to createObject FOM functionality

Modified: 
cocoon/trunk/src/blocks/cron/java/org/apache/cocoon/components/cron/QuartzJobExecutor.java
==
--- 
cocoon/trunk/src/blocks/cron/java/org/apache/cocoon/components/cron/QuartzJobExecutor.java
  (original)
+++ 
cocoon/trunk/src/blocks/cron/java/org/apache/cocoon/components/cron/QuartzJobExecutor.java
  Wed Sep 22 07:54:46 2004
@@ -15,6 +15,8 @@
  */
 package org.apache.cocoon.components.cron;
 
+import org.apache.avalon.framework.container.ContainerUtil;
+import org.apache.avalon.framework.context.Context;
 import org.apache.avalon.framework.logger.Logger;
 import org.apache.avalon.framework.parameters.Parameters;
 import org.apache.avalon.framework.service.ServiceManager;
@@ -66,6 +68,7 @@
 logger.info(Scheduling cron job named ' + name + ');
 }
 
+Context appContext = (Context) 
data.get(QuartzJobScheduler.DATA_MAP_CONTEXT);
 ServiceManager manager = 
(ServiceManager)data.get(QuartzJobScheduler.DATA_MAP_MANAGER);
 org.apache.cocoon.environment.Context envContext =
 
(org.apache.cocoon.environment.Context)data.get(QuartzJobScheduler.DATA_MAP_ENV_CONTEXT);
@@ -84,6 +87,9 @@
 
 if (null == jobrole) {
 job = data.get(QuartzJobScheduler.DATA_MAP_OBJECT);
+ContainerUtil.enableLogging(job, logger);
+ContainerUtil.contextualize(job, appContext);
+ContainerUtil.service(job, manager);
 } else {
 job = manager.lookup(jobrole);
 release = true;
@@ -120,6 +126,9 @@
 
 if (release  manager != null) {
 manager.release(job);
+}
+else if (job != null) {
+   ContainerUtil.dispose(job);
 }
 }
 }

Modified: 
cocoon/trunk/src/blocks/cron/java/org/apache/cocoon/components/cron/QuartzJobScheduler.java
==
--- 
cocoon/trunk/src/blocks/cron/java/org/apache/cocoon/components/cron/QuartzJobScheduler.java
 (original)
+++ 
cocoon/trunk/src/blocks/cron/java/org/apache/cocoon/components/cron/QuartzJobScheduler.java
 Wed Sep 22 07:54:46 2004
@@ -74,8 +74,6 @@
Serviceable, Configurable, 
Startable,
Disposable, Contextualizable, 
Initializable {
 
-private org.apache.cocoon.environment.Context environmentContext;
-
 /** ThreadPool policy RUN */
 private static final String POLICY_RUN = RUN;
 
@@ -101,6 +99,9 @@
 /** Map key for the job name */
 static final String DATA_MAP_NAME = QuartzJobScheduler.JobName;
 
+/** Map key for the avalon context */
+static final String DATA_MAP_CONTEXT = QuartzJobScheduler.Context;
+
 /** Map key for the service manager */
 static final String DATA_MAP_MANAGER = QuartzJobScheduler.ServiceManager;
 
@@ -132,6 +133,12 @@
 /** The scheduler name */
 static final String DEFAULT_QUARTZ_SCHEDULER_NAME = Cocoon;
 
+/** The Avalon Context instance */
+private Context applicationContext;
+
+/** The Cocoon environment Context instance */
+private org.apache.cocoon.environment.Context environmentContext;
+
 /** The PooledExecutor instance */
 private PooledExecutor executor;
 
@@ -307,6 +314,7 @@
  * @see 
org.apache.avalon.framework.context.Contextualizable#contextualize(org.apache.avalon.framework.context.Context)
  */
 public void contextualize(Context context) throws ContextException {
+   this.applicationContext = context;
 this.environmentContext = 
(org.apache.cocoon.environment.Context)context.get(Constants.CONTEXT_ENVIRONMENT_CONTEXT);
 }
 
@@ -547,6 +555,7 @@
 
 jobDataMap.put(DATA_MAP_NAME, name);
 jobDataMap.put(DATA_MAP_LOGGER, getLogger());
+jobDataMap.put(DATA_MAP_CONTEXT, this.applicationContext);
 jobDataMap.put(DATA_MAP_MANAGER, this.manager);
 jobDataMap.put(DATA_MAP_ENV_CONTEXT, this.environmentContext);
 jobDataMap.put(DATA_MAP_RUN_CONCURRENT, new 
Boolean(canRunConcurrently));


svn commit: rev 47051 - cocoon/trunk/src/blocks/cron/java/org/apache/cocoon/components/cron

2004-09-22 Thread unico
Author: unico
Date: Wed Sep 22 08:02:18 2004
New Revision: 47051

Modified:
   
cocoon/trunk/src/blocks/cron/java/org/apache/cocoon/components/cron/QuartzJobExecutor.java
Log:
dispose on correct condition

Modified: 
cocoon/trunk/src/blocks/cron/java/org/apache/cocoon/components/cron/QuartzJobExecutor.java
==
--- 
cocoon/trunk/src/blocks/cron/java/org/apache/cocoon/components/cron/QuartzJobExecutor.java
  (original)
+++ 
cocoon/trunk/src/blocks/cron/java/org/apache/cocoon/components/cron/QuartzJobExecutor.java
  Wed Sep 22 08:02:18 2004
@@ -79,6 +79,7 @@
 String jobrole = null;
 
 boolean release = false;
+boolean dispose = false;
 try {
 env.startingProcessing();
 EnvironmentHelper.enterProcessor(env.getProcessor(), manager, env);
@@ -90,6 +91,7 @@
 ContainerUtil.enableLogging(job, logger);
 ContainerUtil.contextualize(job, appContext);
 ContainerUtil.service(job, manager);
+dispose = true;
 } else {
 job = manager.lookup(jobrole);
 release = true;
@@ -127,7 +129,7 @@
 if (release  manager != null) {
 manager.release(job);
 }
-else if (job != null) {
+if (dispose) {
ContainerUtil.dispose(job);
 }
 }


svn commit: rev 47061 - cocoon/trunk/src/blocks/cron/java/org/apache/cocoon/components/cron

2004-09-22 Thread unico
Author: unico
Date: Wed Sep 22 09:34:53 2004
New Revision: 47061

Modified:
   
cocoon/trunk/src/blocks/cron/java/org/apache/cocoon/components/cron/QuartzDriverDelegate.java
   
cocoon/trunk/src/blocks/cron/java/org/apache/cocoon/components/cron/QuartzJobExecutor.java
   
cocoon/trunk/src/blocks/cron/java/org/apache/cocoon/components/cron/QuartzJobScheduler.java
   
cocoon/trunk/src/blocks/cron/java/org/apache/cocoon/components/cron/QuartzJobStoreCMT.java
   
cocoon/trunk/src/blocks/cron/java/org/apache/cocoon/components/cron/QuartzJobStoreTX.java
   
cocoon/trunk/src/blocks/cron/java/org/apache/cocoon/components/cron/TestCronJob.java
Log:
pass the application context instead of the environment context 
and remove and add transient context object to the data map

Modified: 
cocoon/trunk/src/blocks/cron/java/org/apache/cocoon/components/cron/QuartzDriverDelegate.java
==
--- 
cocoon/trunk/src/blocks/cron/java/org/apache/cocoon/components/cron/QuartzDriverDelegate.java
   (original)
+++ 
cocoon/trunk/src/blocks/cron/java/org/apache/cocoon/components/cron/QuartzDriverDelegate.java
   Wed Sep 22 09:34:53 2004
@@ -15,11 +15,10 @@
  */
 package org.apache.cocoon.components.cron;
 
+import org.apache.avalon.framework.context.Context;
 import org.apache.avalon.framework.logger.Logger;
 import org.apache.avalon.framework.service.ServiceManager;
 
-import org.apache.cocoon.environment.Context;
-
 import org.quartz.Calendar;
 import org.quartz.CronTrigger;
 import org.quartz.JobDataMap;
@@ -90,7 +89,7 @@
 this.logger.debug(QuartzDriverDelegate: Removing transient data);
 map.remove(QuartzJobScheduler.DATA_MAP_LOGGER);
 map.remove(QuartzJobScheduler.DATA_MAP_MANAGER);
-map.remove(QuartzJobScheduler.DATA_MAP_ENV_CONTEXT);
+map.remove(QuartzJobScheduler.DATA_MAP_CONTEXT);
 }
 }
 
@@ -105,7 +104,7 @@
 this.logger.debug(QuartzDriverDelegate: Adding transient 
data);
 map.put(QuartzJobScheduler.DATA_MAP_LOGGER, this.logger);
 map.put(QuartzJobScheduler.DATA_MAP_MANAGER, this.manager);
-map.put(QuartzJobScheduler.DATA_MAP_ENV_CONTEXT, this.context);
+map.put(QuartzJobScheduler.DATA_MAP_CONTEXT, this.context);
 }
 }
 return job;

Modified: 
cocoon/trunk/src/blocks/cron/java/org/apache/cocoon/components/cron/QuartzJobExecutor.java
==
--- 
cocoon/trunk/src/blocks/cron/java/org/apache/cocoon/components/cron/QuartzJobExecutor.java
  (original)
+++ 
cocoon/trunk/src/blocks/cron/java/org/apache/cocoon/components/cron/QuartzJobExecutor.java
  Wed Sep 22 09:34:53 2004
@@ -17,12 +17,15 @@
 
 import org.apache.avalon.framework.container.ContainerUtil;
 import org.apache.avalon.framework.context.Context;
+import org.apache.avalon.framework.context.ContextException;
 import org.apache.avalon.framework.logger.Logger;
 import org.apache.avalon.framework.parameters.Parameters;
 import org.apache.avalon.framework.service.ServiceException;
 import org.apache.avalon.framework.service.ServiceManager;
 
+import org.apache.cocoon.Constants;
 import org.apache.cocoon.Processor;
+
 import org.apache.cocoon.environment.background.BackgroundEnvironment;
 import org.apache.cocoon.environment.internal.EnvironmentHelper;
 
@@ -72,8 +75,13 @@
 
 Context appContext = (Context) 
data.get(QuartzJobScheduler.DATA_MAP_CONTEXT);
 ServiceManager manager = 
(ServiceManager)data.get(QuartzJobScheduler.DATA_MAP_MANAGER);
-org.apache.cocoon.environment.Context envContext =
-
(org.apache.cocoon.environment.Context)data.get(QuartzJobScheduler.DATA_MAP_ENV_CONTEXT);
+org.apache.cocoon.environment.Context envContext;
+try {
+   envContext = (org.apache.cocoon.environment.Context) 
appContext.get(Constants.CONTEXT_ENVIRONMENT_CONTEXT);
+}
+catch (ContextException e) {
+   throw new JobExecutionException(e);
+}
 
 BackgroundEnvironment env = new BackgroundEnvironment(logger, 
envContext);
 

Modified: 
cocoon/trunk/src/blocks/cron/java/org/apache/cocoon/components/cron/QuartzJobScheduler.java
==
--- 
cocoon/trunk/src/blocks/cron/java/org/apache/cocoon/components/cron/QuartzJobScheduler.java
 (original)
+++ 
cocoon/trunk/src/blocks/cron/java/org/apache/cocoon/components/cron/QuartzJobScheduler.java
 Wed Sep 22 09:34:53 2004
@@ -105,9 +105,6 @@
 /** Map key for the service manager */
 static final String DATA_MAP_MANAGER = QuartzJobScheduler.ServiceManager;
 
-/** Map key for the environment context (needed by BackgroundEnvironment) 
*/
-static final String DATA_MAP_ENV_CONTEXT = 
QuartzJobScheduler.EnvironmentContext;
-
 /** Map key

svn commit: rev 46104 - cocoon/trunk/src/blocks/eventcache/java/org/apache/cocoon/caching/impl

2004-09-15 Thread unico
Author: unico
Date: Wed Sep 15 03:15:37 2004
New Revision: 46104

Modified:
   
cocoon/trunk/src/blocks/eventcache/java/org/apache/cocoon/caching/impl/EventAwareCacheImpl.java
Log:
apply patch by Oliver Powell (oliver.powell at tvnz dot co dot nz)
fixing bugzilla bug 31234: Event Aware cache does not remove registry key


Modified: 
cocoon/trunk/src/blocks/eventcache/java/org/apache/cocoon/caching/impl/EventAwareCacheImpl.java
==
--- 
cocoon/trunk/src/blocks/eventcache/java/org/apache/cocoon/caching/impl/EventAwareCacheImpl.java
 (original)
+++ 
cocoon/trunk/src/blocks/eventcache/java/org/apache/cocoon/caching/impl/EventAwareCacheImpl.java
 Wed Sep 15 03:15:37 2004
@@ -25,7 +25,6 @@
 import org.apache.cocoon.caching.CachedResponse;
 import org.apache.cocoon.caching.EventAware;
 import org.apache.cocoon.caching.EventRegistry;
-import org.apache.cocoon.caching.PipelineCacheKey;
 import org.apache.cocoon.caching.validity.Event;
 import org.apache.cocoon.caching.validity.EventValidity;
 import org.apache.excalibur.source.SourceValidity;
@@ -36,7 +35,7 @@
  * in two MultiHashMap to facilitate efficient lookup by either as Key.
  * 
  * @author Geoff Howard ([EMAIL PROTECTED])
- * @version $Id: EventAwareCacheImpl.java,v 1.9 2004/03/05 13:01:56 
bdelacretaz Exp $
+ * @version $Id$
  */
 public class EventAwareCacheImpl extends CacheImpl implements Initializable,
   EventAware {
@@ -95,7 +94,7 @@
  * Un-register this key in the EventRegistry in addition to 
  * removing it from the Store
 */
-   public void remove(PipelineCacheKey key) {
+   public void remove(Serializable key) {
super.remove(key);
 m_eventRegistry.removeKey(key);
}


svn commit: rev 43415 - cocoon/trunk/src/java/org/apache/cocoon/components/pipeline/impl

2004-09-06 Thread unico
Author: unico
Date: Mon Sep  6 05:29:46 2004
New Revision: 43415

Modified:
   
cocoon/trunk/src/java/org/apache/cocoon/components/pipeline/impl/AbstractCachingProcessingPipeline.java
Log:
fix bugzilla bug 31012, thanks to Oliver Powell (oliver.powell at tvnz.co.nz)

Modified: 
cocoon/trunk/src/java/org/apache/cocoon/components/pipeline/impl/AbstractCachingProcessingPipeline.java
==
--- 
cocoon/trunk/src/java/org/apache/cocoon/components/pipeline/impl/AbstractCachingProcessingPipeline.java
 (original)
+++ 
cocoon/trunk/src/java/org/apache/cocoon/components/pipeline/impl/AbstractCachingProcessingPipeline.java
 Mon Sep  6 05:29:46 2004
@@ -540,6 +540,7 @@
 // we are valid, ok that's it
 this.cachedResponse = response.getResponse();
 this.cachedLastModified = response.getLastModified();
+this.toCacheSourceValidities = fromCacheValidityObjects;
 } else {
 if (this.getLogger().isDebugEnabled()) {
 this.getLogger().debug(validatePipeline: cached 
content is invalid for ' + environment.getURI() + '.);
@@ -800,26 +801,35 @@
  * Otherwise return codenull/code
  */
 public SourceValidity getValidityForEventPipeline() {
-int vals = 0;
-
-if ( null != this.toCacheKey
-  !this.cacheCompleteResponse
-  this.firstNotCacheableTransformerIndex == 
super.transformers.size()) {
- vals = this.toCacheKey.size();
-} else if ( null != this.fromCacheKey
-  !this.completeResponseIsCached
-  this.firstProcessedTransformerIndex == 
super.transformers.size()) {
- vals = this.fromCacheKey.size();
-}
-if ( vals  0 ) {
+if (this.cachedResponse != null  this.completeResponseIsCached) {
 final AggregatedValidity validity = new AggregatedValidity();
-for(int i=0; i  vals; i++) {
-validity.add(this.getValidityForInternalPipeline(i));
-//validity.add(new DeferredPipelineValidity(this, i));
+for (int i=0; i  this.toCacheSourceValidities.length; i++) {
+validity.add(this.toCacheSourceValidities[i]);
 }
 return validity;
+
+} else {
+int vals = 0;
+
+if ( null != this.toCacheKey
+  !this.cacheCompleteResponse
+  this.firstNotCacheableTransformerIndex == 
super.transformers.size()) {
+ vals = this.toCacheKey.size();
+} else if ( null != this.fromCacheKey
+  !this.completeResponseIsCached
+  this.firstProcessedTransformerIndex == 
super.transformers.size()) {
+ vals = this.fromCacheKey.size();
+}
+if ( vals  0 ) {
+final AggregatedValidity validity = new AggregatedValidity();
+for(int i=0; i  vals; i++) {
+validity.add(this.getValidityForInternalPipeline(i));
+//validity.add(new DeferredPipelineValidity(this, i));
+}
+return validity;
+}
+return null;
 }
-return null;
 }
 
 /* (non-Javadoc)


svn commit: rev 43416 - cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/components/pipeline/impl

2004-09-06 Thread unico
Author: unico
Date: Mon Sep  6 05:29:56 2004
New Revision: 43416

Modified:
   
cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/components/pipeline/impl/AbstractCachingProcessingPipeline.java
Log:
fix bugzilla bug 31012, thanks to Oliver Powell (oliver.powell at tvnz.co.nz)

Modified: 
cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/components/pipeline/impl/AbstractCachingProcessingPipeline.java
==
--- 
cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/components/pipeline/impl/AbstractCachingProcessingPipeline.java
 (original)
+++ 
cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/components/pipeline/impl/AbstractCachingProcessingPipeline.java
 Mon Sep  6 05:29:56 2004
@@ -48,7 +48,7 @@
  * @since 2.1
  * @author a href=mailto:[EMAIL PROTECTED]Carsten Ziegeler/a
  * @author a href=mailto:[EMAIL PROTECTED]Michael Melhem/a
- * @version CVS $Id: AbstractCachingProcessingPipeline.java,v 1.19 2004/04/26 
21:28:39 ugo Exp $
+ * @version CVS $Id$
  */
 public abstract class AbstractCachingProcessingPipeline
 extends BaseCachingProcessingPipeline {
@@ -566,6 +566,7 @@
 // we are valid, ok that's it
 this.cachedResponse = response.getResponse();
 this.cachedLastModified = response.getLastModified();
+this.toCacheSourceValidities = fromCacheValidityObjects;
 } else {
 if (this.getLogger().isDebugEnabled()) {
 this.getLogger().debug(validatePipeline: cached 
content is invalid for ' + environment.getURI() + '.);
@@ -844,26 +845,35 @@
  * Otherwise return codenull/code
  */
 public SourceValidity getValidityForEventPipeline() {
-int vals = 0;
-
-if ( null != this.toCacheKey
-  !this.cacheCompleteResponse 
-  this.firstNotCacheableTransformerIndex == 
super.transformers.size()) {
- vals = this.toCacheKey.size();
-} else if ( null != this.fromCacheKey
-  !this.completeResponseIsCached
-  this.firstProcessedTransformerIndex == 
super.transformers.size()) {
- vals = this.fromCacheKey.size();
-}
-if ( vals  0 ) {
+if (this.cachedResponse != null  this.completeResponseIsCached) {
 final AggregatedValidity validity = new AggregatedValidity();
-for(int i=0; i  vals; i++) {
-validity.add(this.getValidityForInternalPipeline(i));
-//validity.add(new DeferredPipelineValidity(this, i));
+for (int i=0; i  this.toCacheSourceValidities.length; i++) {
+validity.add(this.toCacheSourceValidities[i]);
 }
 return validity;
+
+} else {
+int vals = 0;
+
+if ( null != this.toCacheKey
+  !this.cacheCompleteResponse 
+  this.firstNotCacheableTransformerIndex == 
super.transformers.size()) {
+ vals = this.toCacheKey.size();
+} else if ( null != this.fromCacheKey
+  !this.completeResponseIsCached
+  this.firstProcessedTransformerIndex == 
super.transformers.size()) {
+ vals = this.fromCacheKey.size();
+}
+if ( vals  0 ) {
+final AggregatedValidity validity = new AggregatedValidity();
+for(int i=0; i  vals; i++) {
+validity.add(this.getValidityForInternalPipeline(i));
+//validity.add(new DeferredPipelineValidity(this, i));
+}
+return validity;
+}
+return null;
 }
-return null;
 }
 
 /* (non-Javadoc)


svn commit: rev 36664 - cocoon/branches/BRANCH_2_1_X/src/blocks/scratchpad/java/org/apache/cocoon/transformation

2004-08-20 Thread unico
Author: unico
Date: Fri Aug 20 06:38:46 2004
New Revision: 36664

Modified:
   
cocoon/branches/BRANCH_2_1_X/src/blocks/scratchpad/java/org/apache/cocoon/transformation/IncludeTransformer.java
Log:
filter startDocument and endDocument events from included sources

Modified: 
cocoon/branches/BRANCH_2_1_X/src/blocks/scratchpad/java/org/apache/cocoon/transformation/IncludeTransformer.java
==
--- 
cocoon/branches/BRANCH_2_1_X/src/blocks/scratchpad/java/org/apache/cocoon/transformation/IncludeTransformer.java
(original)
+++ 
cocoon/branches/BRANCH_2_1_X/src/blocks/scratchpad/java/org/apache/cocoon/transformation/IncludeTransformer.java
Fri Aug 20 06:38:46 2004
@@ -28,6 +28,7 @@
 import org.apache.cocoon.components.source.SourceUtil;
 import org.apache.cocoon.components.source.impl.MultiSourceValidity;
 import org.apache.cocoon.environment.SourceResolver;
+import org.apache.cocoon.xml.IncludeXMLConsumer;
 import org.apache.excalibur.source.Source;
 import org.apache.excalibur.source.SourceValidity;
 import org.xml.sax.Attributes;
@@ -56,8 +57,8 @@
 private static final String INCLUDE_ELEMENT = include;
 private static final String SRC_ATTRIBUTE = src;
 
-private SourceResolver m_resolver;
 private ServiceManager m_manager;
+private SourceResolver m_resolver;
 private MultiSourceValidity m_validity;
 
 public IncludeTransformer() {
@@ -74,6 +75,12 @@
 m_validity = null;
 }
 
+public void recycle() {
+super.recycle();
+m_resolver = null;
+m_validity = null;
+}
+
 public void startElement(String uri, String localName, String qName, 
Attributes atts) 
 throws SAXException {
 if (NS_URI.equals(uri)) {
@@ -85,7 +92,8 @@
 if (m_validity != null) {
 m_validity.addSource(source);
 }
-SourceUtil.toSAX(m_manager, source, text/xml, 
super.contentHandler);
+SourceUtil.toSAX(m_manager, source, text/xml, 
+new IncludeXMLConsumer(super.contentHandler));
 }
 catch (IOException e) {
 throw new SAXException(e);
@@ -103,12 +111,6 @@
 else {
 super.startElement(uri, localName, qName, atts);
 }
-}
-
-public void recycle() {
-super.recycle();
-m_resolver = null;
-m_validity = null;
 }
 
 public void endElement(String uri, String localName, String qName) throws 
SAXException {


svn commit: rev 36607 - cocoon/trunk/src/blocks/scratchpad/java/org/apache/cocoon/components/source/impl

2004-08-19 Thread unico
Author: unico
Date: Thu Aug 19 05:21:31 2004
New Revision: 36607

Modified:
   
cocoon/trunk/src/blocks/scratchpad/java/org/apache/cocoon/components/source/impl/InspectableTraversableCachingSource.java
Log:
fix NPE

Modified: 
cocoon/trunk/src/blocks/scratchpad/java/org/apache/cocoon/components/source/impl/InspectableTraversableCachingSource.java
==
--- 
cocoon/trunk/src/blocks/scratchpad/java/org/apache/cocoon/components/source/impl/InspectableTraversableCachingSource.java
   (original)
+++ 
cocoon/trunk/src/blocks/scratchpad/java/org/apache/cocoon/components/source/impl/InspectableTraversableCachingSource.java
   Thu Aug 19 05:21:31 2004
@@ -126,7 +126,7 @@
 
 protected void initMeta(SourceMeta meta, Source source) throws IOException 
{
 super.initMeta(meta, source);
-final InspectableSourceMeta imeta = ((InspectableSourceMeta) 
super.response.getExtra());
+final InspectableSourceMeta imeta = ((InspectableSourceMeta) meta);
 imeta.setSourceProperties(isource.getSourceProperties());
 }
 


svn commit: rev 36609 - cocoon/trunk/src/blocks/scratchpad/java/org/apache/cocoon/components/source/impl

2004-08-19 Thread unico
Author: unico
Date: Thu Aug 19 06:21:30 2004
New Revision: 36609

Modified:
   
cocoon/trunk/src/blocks/scratchpad/java/org/apache/cocoon/components/source/impl/CachingSource.java
Log:
use event validity when cache is instance of event aware

Modified: 
cocoon/trunk/src/blocks/scratchpad/java/org/apache/cocoon/components/source/impl/CachingSource.java
==
--- 
cocoon/trunk/src/blocks/scratchpad/java/org/apache/cocoon/components/source/impl/CachingSource.java
 (original)
+++ 
cocoon/trunk/src/blocks/scratchpad/java/org/apache/cocoon/components/source/impl/CachingSource.java
 Thu Aug 19 06:21:30 2004
@@ -29,7 +29,10 @@
 import org.apache.cocoon.CascadingIOException;
 import org.apache.cocoon.ProcessingException;
 import org.apache.cocoon.caching.Cache;
+import org.apache.cocoon.caching.EventAware;
 import org.apache.cocoon.caching.IdentifierCacheKey;
+import org.apache.cocoon.caching.validity.EventValidity;
+import org.apache.cocoon.caching.validity.NamedEvent;
 import org.apache.cocoon.components.sax.XMLDeserializer;
 import org.apache.cocoon.components.sax.XMLSerializer;
 import org.apache.cocoon.xml.ContentHandlerWrapper;
@@ -66,7 +69,7 @@
  * always. code0/code can be used to achieve the exact opposite. That is 
to say,
  * the cached contents will be thrown out and updated immediately and 
unconditionally.
  * p
- * @version CVS $Id: CachingSource.java,v 1.13 2004/07/01 14:24:36 unico Exp $
+ * @version CVS $Id$
  */
 public class CachingSource extends AbstractLogEnabled
 implements Source, Serviceable, Initializable, XMLizable {
@@ -206,7 +209,14 @@
 boolean storeResponse = false;
 CachedSourceResponse response = this.response;
 if (response == null) {
-response = new CachedSourceResponse(new SourceValidity[] { new 
ExpiresValidity(getExpiration()), source.getValidity() });
+SourceValidity[] validities;
+if (this.cache instanceof EventAware) {
+validities = new SourceValidity[] { new EventValidity(new 
NamedEvent(this.source.getURI())) };
+}
+else {
+validities = new SourceValidity[] { new 
ExpiresValidity(getExpiration()), source.getValidity() };
+}
+response = new CachedSourceResponse(validities);
 storeResponse = true;
 }
 if (response.getExtra() == null) {
@@ -573,32 +583,40 @@
 private boolean checkValidity() {
 if (this.response == null) return false;
 
-final ExpiresValidity expiresValidity = (ExpiresValidity) 
this.response.getValidityObjects()[0];
-final SourceValidity sourceValidity = 
this.response.getValidityObjects()[1];
-
+final SourceValidity[] validities = this.response.getValidityObjects();
 boolean valid = true;
-
-if (expiresValidity.isValid() != SourceValidity.VALID) {
-if (getLogger().isDebugEnabled()) {
-getLogger().debug(Cached response of source  + 
getSourceURI() +  is expired.);
-}
-if (!isValid(sourceValidity, source.getValidity())) {
+if (validities.length == 2) {
+final ExpiresValidity expiresValidity = (ExpiresValidity) 
validities[0];
+final SourceValidity sourceValidity = validities[1];
+
+if (expiresValidity.isValid() != SourceValidity.VALID) {
 if (getLogger().isDebugEnabled()) {
-getLogger().debug(Cached response of source  + 
getSourceURI() +  is invalid.);
+getLogger().debug(Cached response of source  + 
getSourceURI() +  is expired.);
+}
+if (!isValid(sourceValidity, source.getValidity())) {
+if (getLogger().isDebugEnabled()) {
+getLogger().debug(Cached response of source  + 
getSourceURI() +  is invalid.);
+}
+valid = false;
+}
+else {
+if (getLogger().isDebugEnabled()) {
+getLogger().debug(Cached response of source  + 
getSourceURI() +  is still valid.);
+}
+// set new expiration period
+this.response.getValidityObjects()[0] = new 
ExpiresValidity(getExpiration());
 }
-valid = false;
 }
 else {
 if (getLogger().isDebugEnabled()) {
-getLogger().debug(Cached response of source  + 
getSourceURI() +  is still valid.);
+getLogger().debug(Cached response of source  + 
getSourceURI() +  is NOT expired.);
 }
-// set new expiration period
-this.response.getValidityObjects()[0] = new 
ExpiresValidity(getExpiration());
 }
 }
 else {
+// assert(validities.length == 1

svn commit: rev 36615 - cocoon/trunk/tools/src/anttasks

2004-08-19 Thread unico
Author: unico
Date: Thu Aug 19 09:41:37 2004
New Revision: 36615

Modified:
   cocoon/trunk/tools/src/anttasks/DocumentCache.java
Log:
fix bug where only one of either system or public doctype was specified 
(such as is the case with log4j.xconf)

Modified: cocoon/trunk/tools/src/anttasks/DocumentCache.java
==
--- cocoon/trunk/tools/src/anttasks/DocumentCache.java  (original)
+++ cocoon/trunk/tools/src/anttasks/DocumentCache.java  Thu Aug 19 09:41:37 2004
@@ -123,9 +123,13 @@
 // if we have any DOCTYPE declaration in the input xml document
 final DocumentType doctype = document.getDoctype();
 Properties props = new Properties();
-if (null != doctype  null != doctype.getPublicId()) {
-props.put(OutputKeys.DOCTYPE_PUBLIC, doctype.getPublicId());
-props.put(OutputKeys.DOCTYPE_SYSTEM, doctype.getSystemId());
+if (null != doctype) {
+if (null != doctype.getPublicId()) {
+props.put(OutputKeys.DOCTYPE_PUBLIC, doctype.getPublicId());  
+}
+if (null != doctype.getSystemId()) {
+props.put(OutputKeys.DOCTYPE_SYSTEM, doctype.getSystemId());
+}
 }
 transformer.setOutputProperties(props);
 


svn commit: rev 36616 - cocoon/branches/BRANCH_2_1_X/tools/src/anttasks

2004-08-19 Thread unico
Author: unico
Date: Thu Aug 19 09:41:46 2004
New Revision: 36616

Modified:
   cocoon/branches/BRANCH_2_1_X/tools/src/anttasks/DocumentCache.java
Log:
fix bug where only one of either system or public doctype was specified 
(such as is the case with log4j.xconf)

Modified: cocoon/branches/BRANCH_2_1_X/tools/src/anttasks/DocumentCache.java
==
--- cocoon/branches/BRANCH_2_1_X/tools/src/anttasks/DocumentCache.java  
(original)
+++ cocoon/branches/BRANCH_2_1_X/tools/src/anttasks/DocumentCache.java  Thu Aug 
19 09:41:46 2004
@@ -123,9 +123,13 @@
 // if we have any DOCTYPE declaration in the input xml document
 final DocumentType doctype = document.getDoctype();
 Properties props = new Properties();
-if (null != doctype  null != doctype.getPublicId()) {
-props.put(OutputKeys.DOCTYPE_PUBLIC, doctype.getPublicId());
-props.put(OutputKeys.DOCTYPE_SYSTEM, doctype.getSystemId());
+if (null != doctype) {
+if (null != doctype.getPublicId()) {
+props.put(OutputKeys.DOCTYPE_PUBLIC, doctype.getPublicId());
+}
+if (null != doctype.getSystemId()) {
+props.put(OutputKeys.DOCTYPE_SYSTEM, doctype.getSystemId());
+}
 }
 transformer.setOutputProperties(props);
 


svn commit: rev 36557 - cocoon/branches/BRANCH_2_1_X/src/blocks/jms/conf

2004-08-18 Thread unico
Author: unico
Date: Wed Aug 18 02:57:17 2004
New Revision: 36557

Added:
   cocoon/branches/BRANCH_2_1_X/src/blocks/jms/conf/jms.xsamples
  - copied unchanged from rev 36553, 
cocoon/branches/BRANCH_2_1_X/src/blocks/jms/conf/jms.xsamples
Log:
undelete accidentally removed file


svn commit: rev 36567 - cocoon/branches/BRANCH_2_1_X/src/blocks/eventcache/java/org/apache/cocoon/caching/impl

2004-08-18 Thread unico
Author: unico
Date: Wed Aug 18 07:42:39 2004
New Revision: 36567

Modified:
   
cocoon/branches/BRANCH_2_1_X/src/blocks/eventcache/java/org/apache/cocoon/caching/impl/JMSEventMessageListener.java
Log:
lookup event aware

Modified: 
cocoon/branches/BRANCH_2_1_X/src/blocks/eventcache/java/org/apache/cocoon/caching/impl/JMSEventMessageListener.java
==
--- 
cocoon/branches/BRANCH_2_1_X/src/blocks/eventcache/java/org/apache/cocoon/caching/impl/JMSEventMessageListener.java
 (original)
+++ 
cocoon/branches/BRANCH_2_1_X/src/blocks/eventcache/java/org/apache/cocoon/caching/impl/JMSEventMessageListener.java
 Wed Aug 18 07:42:39 2004
@@ -73,6 +73,11 @@
 m_eventAwareRole = parameters.getParameter(EVENTCACHE_ROLE_PARAM, 
DEFAULT_EVENTCACHE_ROLE);
 }
 
+public void initialize() throws Exception {
+super.initialize();
+m_eventCache = (EventAware) m_manager.lookup(m_eventAwareRole);
+}
+
 public void dispose() {
 super.dispose();
 this.m_manager.release(m_eventCache);


svn commit: rev 36568 - cocoon/trunk/src/blocks/eventcache/java/org/apache/cocoon/caching/impl

2004-08-18 Thread unico
Author: unico
Date: Wed Aug 18 07:42:47 2004
New Revision: 36568

Modified:
   
cocoon/trunk/src/blocks/eventcache/java/org/apache/cocoon/caching/impl/JMSEventMessageListener.java
Log:
lookup event aware

Modified: 
cocoon/trunk/src/blocks/eventcache/java/org/apache/cocoon/caching/impl/JMSEventMessageListener.java
==
--- 
cocoon/trunk/src/blocks/eventcache/java/org/apache/cocoon/caching/impl/JMSEventMessageListener.java
 (original)
+++ 
cocoon/trunk/src/blocks/eventcache/java/org/apache/cocoon/caching/impl/JMSEventMessageListener.java
 Wed Aug 18 07:42:47 2004
@@ -73,6 +73,11 @@
 m_eventAwareRole = parameters.getParameter(EVENTCACHE_ROLE_PARAM, 
DEFAULT_EVENTCACHE_ROLE);
 }
 
+public void initialize() throws Exception {
+super.initialize();
+m_eventCache = (EventAware) m_manager.lookup(m_eventAwareRole);
+}
+
 public void dispose() {
 super.dispose();
 this.m_manager.release(m_eventCache);


svn commit: rev 36576 - cocoon/trunk

2004-08-18 Thread unico
Author: unico
Date: Wed Aug 18 08:57:10 2004
New Revision: 36576

Modified:
   cocoon/trunk/gump.xml
Log:
comment jcr block for now

Modified: cocoon/trunk/gump.xml
==
--- cocoon/trunk/gump.xml   (original)
+++ cocoon/trunk/gump.xml   Wed Aug 18 08:57:10 2004
@@ -1166,6 +1166,7 @@
 nag from=Gump lt;general@gump.apache.orggt; 
to=dev@cocoon.apache.org/
   /project
 
+!--
   project name=cocoon-block-jcr status=unstable
 packageorg.apache.cocoon/package
 
@@ -1184,6 +1185,7 @@
 nag from=Gump to=dev@cocoon.apache.org/
 
   /project
+--
 
   !--
 


svn commit: rev 36525 - in cocoon/trunk/src/blocks/cron: conf java/org/apache/cocoon/components/cron

2004-08-17 Thread unico
Author: unico
Date: Tue Aug 17 06:21:13 2004
New Revision: 36525

Modified:
   cocoon/trunk/src/blocks/cron/conf/cron.xconf
   
cocoon/trunk/src/blocks/cron/java/org/apache/cocoon/components/cron/QuartzJobScheduler.java
Log:
make type of job store to use configurable

Modified: cocoon/trunk/src/blocks/cron/conf/cron.xconf
==
--- cocoon/trunk/src/blocks/cron/conf/cron.xconf(original)
+++ cocoon/trunk/src/blocks/cron/conf/cron.xconfTue Aug 17 06:21:13 2004
@@ -46,6 +46,14 @@
 !-- The maximum time to wait for running jobs to complete. 
Defaults to unlimited time (0 == default) --
 shutdown-wait-time-ms5000/shutdown-wait-time-ms
 /thread-pool
+!-- Definition of the JobStore --
+!-- store type is one of ram (default), tx, or cmt --
+store type=ram/
+!--
+store type=tx
+  datasourcejdbc/MyJobStoreDS/datasource
+/store
+--
 !-- Definintions of triggers --
 triggers
 !-- Sample definition of a trigger --

Modified: 
cocoon/trunk/src/blocks/cron/java/org/apache/cocoon/components/cron/QuartzJobScheduler.java
==
--- 
cocoon/trunk/src/blocks/cron/java/org/apache/cocoon/components/cron/QuartzJobScheduler.java
 (original)
+++ 
cocoon/trunk/src/blocks/cron/java/org/apache/cocoon/components/cron/QuartzJobScheduler.java
 Tue Aug 17 06:21:13 2004
@@ -48,7 +48,11 @@
 import org.quartz.SimpleTrigger;
 import org.quartz.Trigger;
 import org.quartz.impl.DirectSchedulerFactory;
+import org.quartz.impl.jdbcjobstore.JobStoreCMT;
+import org.quartz.impl.jdbcjobstore.JobStoreSupport;
+import org.quartz.impl.jdbcjobstore.JobStoreTX;
 import org.quartz.simpl.RAMJobStore;
+import org.quartz.spi.JobStore;
 
 import EDU.oswego.cs.dl.util.concurrent.BoundedBuffer;
 import EDU.oswego.cs.dl.util.concurrent.LinkedQueue;
@@ -59,7 +63,7 @@
  * This component can either schedule jobs or directly execute one.
  *
  * @author a href=mailto:[EMAIL PROTECTED]Giacomo Pati/a
- * @version CVS $Id: QuartzJobScheduler.java,v 1.13 2004/07/21 09:23:32 
cziegeler Exp $
+ * @version CVS $Id$
  *
  * @since 2.1.1
  */
@@ -304,8 +308,8 @@
// we cannot create the same scheduler again
final String runID = new Date().toString().replace(' ', 
'_');
final ThreadPool pool = 
createThreadPool(this.config.getChild(thread-pool));
-   
DirectSchedulerFactory.getInstance().createScheduler(DEFAULT_QUARTZ_SCHEDULER_NAME,
 runID, pool,
-   
 new RAMJobStore());
+final JobStore store = 
createJobStore(this.config.getChild(job-store));
+   
DirectSchedulerFactory.getInstance().createScheduler(DEFAULT_QUARTZ_SCHEDULER_NAME,
 runID, pool,store);
// scheduler = 
DirectSchedulerFactory.getInstance().getScheduler(DEFAULT_QUARTZ_SCHEDULER_NAME,
 runID);
scheduler = 
DirectSchedulerFactory.getInstance().getScheduler(DEFAULT_QUARTZ_SCHEDULER_NAME);
} catch (final SchedulerException se) {
@@ -686,6 +690,26 @@
 }
 }
 
+private JobStore createJobStore(final Configuration configuration)
+throws ConfigurationException {
+String type = configuration.getAttribute(type, ram);
+if (type.equals(ram)) {
+return new RAMJobStore();
+}
+JobStoreSupport store = null;
+if (type.equals(tx)) {
+store = new JobStoreTX();
+}
+else if (type.equals(cmt)) {
+store = new JobStoreCMT();
+}
+else {
+throw new ConfigurationException(Unknown job type:  + type);
+}
+store.setDataSource(configuration.getChild(datasource).getValue());
+return store;
+}
+
 /* (non-Javadoc)
  * @see 
org.apache.cocoon.components.cron.JobScheduler#fireTarget(java.lang.Object)
  */
@@ -717,7 +741,7 @@
  * A ThreadPool for the Quartz Scheduler based on Doug Leas concurrency 
utilities PooledExecutor
  *
  * @author a href=mailto:[EMAIL PROTECTED]Giacomo Pati/a
- * @version CVS $Id: QuartzJobScheduler.java,v 1.13 2004/07/21 09:23:32 
cziegeler Exp $
+ * @version CVS $Id$
  */
 private static class ThreadPool extends AbstractLogEnabled implements 
org.quartz.spi.ThreadPool {
 /** Our executor thread pool */


svn commit: rev 36526 - in cocoon/branches/BRANCH_2_1_X/src/blocks/cron: conf java/org/apache/cocoon/components/cron

2004-08-17 Thread unico
Author: unico
Date: Tue Aug 17 06:26:46 2004
New Revision: 36526

Modified:
   cocoon/branches/BRANCH_2_1_X/src/blocks/cron/conf/cron.xconf
   
cocoon/branches/BRANCH_2_1_X/src/blocks/cron/java/org/apache/cocoon/components/cron/QuartzJobScheduler.java
Log:
port from 2.2: make type of job store to use configurable

Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/cron/conf/cron.xconf
==
--- cocoon/branches/BRANCH_2_1_X/src/blocks/cron/conf/cron.xconf
(original)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/cron/conf/cron.xconfTue Aug 
17 06:26:46 2004
@@ -45,6 +45,14 @@
 !-- The maximum time to wait for running jobs to complete. 
Defaults to unlimited time (0 == default) --
 shutdown-wait-time-ms5000/shutdown-wait-time-ms
 /thread-pool
+!-- Definition of the JobStore --
+!-- store type is one of ram (default), tx, or cmt --
+store type=ram/
+!--
+store type=tx
+  datasourcejdbc/MyJobStoreDS/datasource
+/store
+--
 !-- Definintions of triggers --
 triggers
 !-- Sample definition of a trigger --

Modified: 
cocoon/branches/BRANCH_2_1_X/src/blocks/cron/java/org/apache/cocoon/components/cron/QuartzJobScheduler.java
==
--- 
cocoon/branches/BRANCH_2_1_X/src/blocks/cron/java/org/apache/cocoon/components/cron/QuartzJobScheduler.java
 (original)
+++ 
cocoon/branches/BRANCH_2_1_X/src/blocks/cron/java/org/apache/cocoon/components/cron/QuartzJobScheduler.java
 Tue Aug 17 06:26:46 2004
@@ -48,7 +48,11 @@
 import org.quartz.SimpleTrigger;
 import org.quartz.Trigger;
 import org.quartz.impl.DirectSchedulerFactory;
+import org.quartz.impl.jdbcjobstore.JobStoreCMT;
+import org.quartz.impl.jdbcjobstore.JobStoreSupport;
+import org.quartz.impl.jdbcjobstore.JobStoreTX;
 import org.quartz.simpl.RAMJobStore;
+import org.quartz.spi.JobStore;
 
 import EDU.oswego.cs.dl.util.concurrent.BoundedBuffer;
 import EDU.oswego.cs.dl.util.concurrent.LinkedQueue;
@@ -59,7 +63,7 @@
  * This component can either schedule jobs or directly execute one.
  *
  * @author a href=mailto:[EMAIL PROTECTED]Giacomo Pati/a
- * @version CVS $Id: QuartzJobScheduler.java,v 1.12 2004/03/11 22:05:12 
sylvain Exp $
+ * @version CVS $Id$
  *
  * @since 2.1.1
  */
@@ -304,8 +308,8 @@
// we cannot create the same scheduler again
final String runID = new Date().toString().replace(' ', 
'_');
final ThreadPool pool = 
createThreadPool(this.config.getChild(thread-pool));
-   
DirectSchedulerFactory.getInstance().createScheduler(DEFAULT_QUARTZ_SCHEDULER_NAME,
 runID, pool,
-   
 new RAMJobStore());
+final JobStore store = 
createJobStore(this.config.getChild(job-store));
+   
DirectSchedulerFactory.getInstance().createScheduler(DEFAULT_QUARTZ_SCHEDULER_NAME,
 runID, pool, store);
// scheduler = 
DirectSchedulerFactory.getInstance().getScheduler(DEFAULT_QUARTZ_SCHEDULER_NAME,
 runID);
scheduler = 
DirectSchedulerFactory.getInstance().getScheduler(DEFAULT_QUARTZ_SCHEDULER_NAME);
} catch (final SchedulerException se) {
@@ -686,6 +690,26 @@
 }
 }
 
+private JobStore createJobStore(final Configuration configuration)
+throws ConfigurationException {
+String type = configuration.getAttribute(type, ram);
+if (type.equals(ram)) {
+return new RAMJobStore();
+}
+JobStoreSupport store = null;
+if (type.equals(tx)) {
+store = new JobStoreTX();
+}
+else if (type.equals(cmt)) {
+store = new JobStoreCMT();
+}
+else {
+throw new ConfigurationException(Unknown store type:  + type);
+}
+store.setDataSource(configuration.getChild(datasource).getValue());
+return store;
+}
+
 /* (non-Javadoc)
  * @see 
org.apache.cocoon.components.cron.JobScheduler#fireTarget(java.lang.Object)
  */
@@ -717,7 +741,7 @@
  * A ThreadPool for the Quartz Scheduler based on Doug Leas concurrency 
utilities PooledExecutor
  *
  * @author a href=mailto:[EMAIL PROTECTED]Giacomo Pati/a
- * @version CVS $Id: QuartzJobScheduler.java,v 1.12 2004/03/11 22:05:12 
sylvain Exp $
+ * @version CVS $Id$
  */
 private static class ThreadPool extends AbstractLogEnabled implements 
org.quartz.spi.ThreadPool {
 /** Our executor thread pool */


svn commit: rev 36527 - cocoon/trunk/src/blocks/cron/java/org/apache/cocoon/components/cron

2004-08-17 Thread unico
Author: unico
Date: Tue Aug 17 06:29:38 2004
New Revision: 36527

Modified:
   
cocoon/trunk/src/blocks/cron/java/org/apache/cocoon/components/cron/QuartzJobScheduler.java
Log:
typo

Modified: 
cocoon/trunk/src/blocks/cron/java/org/apache/cocoon/components/cron/QuartzJobScheduler.java
==
--- 
cocoon/trunk/src/blocks/cron/java/org/apache/cocoon/components/cron/QuartzJobScheduler.java
 (original)
+++ 
cocoon/trunk/src/blocks/cron/java/org/apache/cocoon/components/cron/QuartzJobScheduler.java
 Tue Aug 17 06:29:38 2004
@@ -704,7 +704,7 @@
 store = new JobStoreCMT();
 }
 else {
-throw new ConfigurationException(Unknown job type:  + type);
+throw new ConfigurationException(Unknown store type:  + type);
 }
 store.setDataSource(configuration.getChild(datasource).getValue());
 return store;


svn commit: rev 36335 - cocoon/trunk/src/java/org/apache/cocoon/components/source/impl

2004-08-13 Thread unico
Author: unico
Date: Fri Aug 13 03:58:38 2004
New Revision: 36335

Added:
   
cocoon/trunk/src/java/org/apache/cocoon/components/source/impl/MultiSourceValidity.java
  - copied, changed from rev 31072, 
cocoon/trunk/src/blocks/repository/java/org/apache/cocoon/components/source/impl/MultiSourceValidity.java
Log:
move MultiSourceValidity to the core

Copied: 
cocoon/trunk/src/java/org/apache/cocoon/components/source/impl/MultiSourceValidity.java
 (from rev 31072, 
cocoon/trunk/src/blocks/repository/java/org/apache/cocoon/components/source/impl/MultiSourceValidity.java)
==
--- 
cocoon/trunk/src/blocks/repository/java/org/apache/cocoon/components/source/impl/MultiSourceValidity.java
   (original)
+++ 
cocoon/trunk/src/java/org/apache/cocoon/components/source/impl/MultiSourceValidity.java
 Fri Aug 13 03:58:38 2004
@@ -28,7 +28,7 @@
  * An aggregated validity for multiple sources.
  * 
  * @author a href=http://www.apache.org/~sylvain;Sylvain Wallez/a
- * @version CVS $Id: MultiSourceValidity.java,v 1.3 2004/03/05 13:02:21 
bdelacretaz Exp $
+ * @version CVS $Id$
  */
 public class MultiSourceValidity extends AbstractAggregatedValidity implements 
SourceValidity {
 


svn commit: rev 36336 - cocoon/trunk/src/blocks/scratchpad/java/org/apache/cocoon/transformation

2004-08-13 Thread unico
Author: unico
Date: Fri Aug 13 04:02:57 2004
New Revision: 36336

Added:
   
cocoon/trunk/src/blocks/scratchpad/java/org/apache/cocoon/transformation/IncludeTransformer.java
Log:
Simple cacheable Source include transformer as discussed in bug 30356

Added: 
cocoon/trunk/src/blocks/scratchpad/java/org/apache/cocoon/transformation/IncludeTransformer.java
==
--- (empty file)
+++ 
cocoon/trunk/src/blocks/scratchpad/java/org/apache/cocoon/transformation/IncludeTransformer.java
Fri Aug 13 04:02:57 2004
@@ -0,0 +1,131 @@
+/*
+ * Copyright 1999-2004 The Apache Software Foundation.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.cocoon.transformation;
+
+import java.io.IOException;
+import java.io.Serializable;
+import java.util.Map;
+
+import org.apache.avalon.framework.parameters.Parameters;
+import org.apache.avalon.framework.service.ServiceException;
+import org.apache.avalon.framework.service.ServiceManager;
+import org.apache.avalon.framework.service.Serviceable;
+import org.apache.cocoon.ProcessingException;
+import org.apache.cocoon.caching.CacheableProcessingComponent;
+import org.apache.cocoon.components.source.SourceUtil;
+import org.apache.cocoon.components.source.impl.MultiSourceValidity;
+import org.apache.cocoon.environment.SourceResolver;
+import org.apache.excalibur.source.Source;
+import org.apache.excalibur.source.SourceValidity;
+import org.xml.sax.Attributes;
+import org.xml.sax.SAXException;
+
+/**
+ * Simple Source include transformer.
+ * 
+ * p
+ *  Triggers for the element codeinclude/code in the
+ *  namespace codehttp://apache.org/cocoon/include/1.0/code.
+ *  Use codelt;include src=scheme://path/gt;/code
+ * /p
+ * 
+ * @cocoon.sitemap.component.name   include
+ * @cocoon.sitemap.component.logger sitemap.transformer.include
+ *
+ * @cocoon.sitemap.component.pooling.min   2
+ * @cocoon.sitemap.component.pooling.max  16
+ * @cocoon.sitemap.component.pooling.grow  2
+ */
+public class IncludeTransformer extends AbstractTransformer 
+implements Serviceable, Transformer, CacheableProcessingComponent {
+
+private static final String NS_URI = 
http://apache.org/cocoon/include/1.0;;
+private static final String INCLUDE_ELEMENT = include;
+private static final String SRC_ATTRIBUTE = src;
+
+private SourceResolver m_resolver;
+private ServiceManager m_manager;
+private MultiSourceValidity m_validity;
+
+public IncludeTransformer() {
+super();
+}
+
+public void service(ServiceManager manager) throws ServiceException {
+m_manager = manager;
+}
+
+public void setup(SourceResolver resolver, Map om, String src, Parameters 
parameters) 
+throws ProcessingException, SAXException, IOException {
+m_resolver = resolver;
+m_validity = null;
+}
+
+public void startElement(String uri, String localName, String qName, 
Attributes atts) 
+throws SAXException {
+if (NS_URI.equals(uri)) {
+if (INCLUDE_ELEMENT.equals(localName)) {
+String src = atts.getValue(SRC_ATTRIBUTE);
+Source source = null;
+try {
+source = m_resolver.resolveURI(src);
+if (m_validity != null) {
+m_validity.addSource(source);
+}
+SourceUtil.toSAX(m_manager, source, text/xml, 
super.contentHandler);
+}
+catch (IOException e) {
+throw new SAXException(e);
+}
+catch (ProcessingException e) {
+throw new SAXException(e);
+}
+finally {
+if (source != null) {
+m_resolver.release(source);
+}
+}
+}
+}
+else {
+super.startElement(uri, localName, qName, atts);
+}
+}
+
+public void recycle() {
+super.recycle();
+m_resolver = null;
+m_validity = null;
+}
+
+public void endElement(String uri, String localName, String qName) throws 
SAXException {
+if (!NS_URI.equals(uri)) {
+super.endElement(uri, localName, qName);
+}
+}
+
+public Serializable getKey() {
+return IncludeTransformer;
+}
+
+public SourceValidity getValidity

svn commit: rev 36337 - in cocoon/branches/BRANCH_2_1_X/src: blocks/scratchpad/java/org/apache/cocoon/transformation java/org/apache/cocoon/components/source/impl

2004-08-13 Thread unico
Author: unico
Date: Fri Aug 13 04:19:59 2004
New Revision: 36337

Added:
   
cocoon/branches/BRANCH_2_1_X/src/blocks/scratchpad/java/org/apache/cocoon/transformation/IncludeTransformer.java
   
cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/components/source/impl/MultiSourceValidity.java
  - copied, changed from rev 36290, 
cocoon/branches/BRANCH_2_1_X/src/blocks/repository/java/org/apache/cocoon/components/source/impl/MultiSourceValidity.java
Log:
sync with 2.2: move MultiSourceValidity to the core and add simple caching 
Source IncludeTransformer to the scratchpad (see bug 30356)

Added: 
cocoon/branches/BRANCH_2_1_X/src/blocks/scratchpad/java/org/apache/cocoon/transformation/IncludeTransformer.java
==
--- (empty file)
+++ 
cocoon/branches/BRANCH_2_1_X/src/blocks/scratchpad/java/org/apache/cocoon/transformation/IncludeTransformer.java
Fri Aug 13 04:19:59 2004
@@ -0,0 +1,131 @@
+/*
+ * Copyright 1999-2004 The Apache Software Foundation.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.cocoon.transformation;
+
+import java.io.IOException;
+import java.io.Serializable;
+import java.util.Map;
+
+import org.apache.avalon.framework.parameters.Parameters;
+import org.apache.avalon.framework.service.ServiceException;
+import org.apache.avalon.framework.service.ServiceManager;
+import org.apache.avalon.framework.service.Serviceable;
+import org.apache.cocoon.ProcessingException;
+import org.apache.cocoon.caching.CacheableProcessingComponent;
+import org.apache.cocoon.components.source.SourceUtil;
+import org.apache.cocoon.components.source.impl.MultiSourceValidity;
+import org.apache.cocoon.environment.SourceResolver;
+import org.apache.excalibur.source.Source;
+import org.apache.excalibur.source.SourceValidity;
+import org.xml.sax.Attributes;
+import org.xml.sax.SAXException;
+
+/**
+ * Simple Source include transformer.
+ * 
+ * p
+ *  Triggers for the element codeinclude/code in the
+ *  namespace codehttp://apache.org/cocoon/include/1.0/code.
+ *  Use codelt;include src=scheme://path/gt;/code
+ * /p
+ * 
+ * @cocoon.sitemap.component.name   include
+ * @cocoon.sitemap.component.logger sitemap.transformer.include
+ *
+ * @cocoon.sitemap.component.pooling.min   2
+ * @cocoon.sitemap.component.pooling.max  16
+ * @cocoon.sitemap.component.pooling.grow  2
+ */
+public class IncludeTransformer extends AbstractTransformer 
+implements Serviceable, Transformer, CacheableProcessingComponent {
+
+private static final String NS_URI = 
http://apache.org/cocoon/include/1.0;;
+private static final String INCLUDE_ELEMENT = include;
+private static final String SRC_ATTRIBUTE = src;
+
+private SourceResolver m_resolver;
+private ServiceManager m_manager;
+private MultiSourceValidity m_validity;
+
+public IncludeTransformer() {
+super();
+}
+
+public void service(ServiceManager manager) throws ServiceException {
+m_manager = manager;
+}
+
+public void setup(SourceResolver resolver, Map om, String src, Parameters 
parameters) 
+throws ProcessingException, SAXException, IOException {
+m_resolver = resolver;
+m_validity = null;
+}
+
+public void startElement(String uri, String localName, String qName, 
Attributes atts) 
+throws SAXException {
+if (NS_URI.equals(uri)) {
+if (INCLUDE_ELEMENT.equals(localName)) {
+String src = atts.getValue(SRC_ATTRIBUTE);
+Source source = null;
+try {
+source = m_resolver.resolveURI(src);
+if (m_validity != null) {
+m_validity.addSource(source);
+}
+SourceUtil.toSAX(m_manager, source, text/xml, 
super.contentHandler);
+}
+catch (IOException e) {
+throw new SAXException(e);
+}
+catch (ProcessingException e) {
+throw new SAXException(e);
+}
+finally {
+if (source != null) {
+m_resolver.release(source);
+}
+}
+}
+}
+else {
+super.startElement(uri, localName, qName, atts);
+}
+}
+
+public void recycle() {
+super.recycle

svn commit: rev 36341 - in cocoon/branches/BRANCH_2_1_X: . src/blocks/eventcache/java/org/apache/cocoon/caching/impl src/blocks/jms/java/org/apache/cocoon/acting src/blocks/jms/java/org/apache/cocoon/components/jms

2004-08-13 Thread unico
Author: unico
Date: Fri Aug 13 05:32:03 2004
New Revision: 36341

Added:
   
cocoon/branches/BRANCH_2_1_X/src/blocks/eventcache/java/org/apache/cocoon/caching/impl/JMSEventMessageListener.java
   cocoon/branches/BRANCH_2_1_X/src/blocks/jms/java/org/apache/cocoon/acting/
   
cocoon/branches/BRANCH_2_1_X/src/blocks/jms/java/org/apache/cocoon/acting/JMSPublisherAction.java
   
cocoon/branches/BRANCH_2_1_X/src/blocks/jms/java/org/apache/cocoon/components/jms/AbstractMessageListener.java
   
cocoon/branches/BRANCH_2_1_X/src/blocks/jms/java/org/apache/cocoon/components/jms/AbstractMessagePublisher.java
   
cocoon/branches/BRANCH_2_1_X/src/blocks/jms/java/org/apache/cocoon/components/jms/JMSConnectionManager.java
   
cocoon/branches/BRANCH_2_1_X/src/blocks/jms/java/org/apache/cocoon/components/jms/JMSConnectionManagerImpl.java
Removed:
   
cocoon/branches/BRANCH_2_1_X/src/blocks/jms/java/org/apache/cocoon/components/jms/JMSConnection.java
   
cocoon/branches/BRANCH_2_1_X/src/blocks/jms/java/org/apache/cocoon/components/jms/JMSConnectionImpl.java
   
cocoon/branches/BRANCH_2_1_X/src/blocks/jms/java/org/apache/cocoon/components/jms/JMSEventListener.java
   
cocoon/branches/BRANCH_2_1_X/src/blocks/jms/java/org/apache/cocoon/components/jms/JMSPublisherAction.java
Modified:
   cocoon/branches/BRANCH_2_1_X/blocks.properties
   cocoon/branches/BRANCH_2_1_X/gump.xml
   cocoon/branches/BRANCH_2_1_X/status.xml
Log:
port changes from 2.2: enhanced JMS support

Modified: cocoon/branches/BRANCH_2_1_X/blocks.properties
==
--- cocoon/branches/BRANCH_2_1_X/blocks.properties  (original)
+++ cocoon/branches/BRANCH_2_1_X/blocks.properties  Fri Aug 13 05:32:03 2004
@@ -81,7 +81,6 @@
 #-[dependency]: session-fw depends on xsp.
 #-[dependency]: session-fw is needed by authentication-fw, portal, 
portal-fw.
 #include.block.session-fw=false
-#include.block.swf=false
 #-[dependency]: velocity is needed by petstore, scratchpad.
 #include.block.velocity=false
 #include.block.web3=false
@@ -109,14 +108,14 @@
 #include.block.cron=false
 #include.block.deli=false
 #-[dependency]: eventcache depends on xsp (for samples).
-#-[dependency]: eventcache is needed by jms, repository.
+#-[dependency]: eventcache is needed by jms (for samples), 
repository.
 #include.block.eventcache=false
 #-[dependency]: forms depends on xsp (for samples).
 #-[dependency]: forms is needed by apples, javaflow, ojb, 
petstore, tour.
 #include.block.forms=false
 #-[dependency]: javaflow depends on forms, ojb.
 #include.block.javaflow=false
-#-[dependency]: jms depends on databases (for samples), eventcache, 
hsqldb.
+#-[dependency]: jms depends on databases (for samples), hsqldb, 
eventcache (for samples).
 #-[dependency]: jms is needed by slide.
 #include.block.jms=false
 #include.block.linotype=false
@@ -153,8 +152,9 @@
 
 # Although some of these blocks may have been stable, they are now deprecated
 # in favour of other blocks and therefore are excluded by default from the 
build.
-# For including one of them you have to set the include property to true in
-# local.blocks.properties.
+# For including one of them you have to set the exclude property into comment 
in
+# blocks.properties.
 
+include.block.swf=false
 #-[dependency]: woody depends on xsp (for samples).
 include.block.woody=false

Modified: cocoon/branches/BRANCH_2_1_X/gump.xml
==
--- cocoon/branches/BRANCH_2_1_X/gump.xml   (original)
+++ cocoon/branches/BRANCH_2_1_X/gump.xml   Fri Aug 13 05:32:03 2004
@@ -17,7 +17,7 @@
 !--+
 | Cocoon GUMP Descriptor
 |
-| CVS $Id: gump.xml,v 1.155 2004/05/24 08:00:55 cziegeler Exp $
+| CVS $Id$
 +--
 
 module name=cocoon-2.1
@@ -1047,7 +1047,8 @@
 /ant
 
 depend project=cocoon inherit=all/
-depend project=cocoon-block-eventcache/
+!-- commented out because of circular dependency --
+!--depend project=cocoon-block-eventcache type=samples/--
 depend project=cocoon-block-databases type=samples/
 depend project=cocoon-block-hsqldb/
 

Added: 
cocoon/branches/BRANCH_2_1_X/src/blocks/eventcache/java/org/apache/cocoon/caching/impl/JMSEventMessageListener.java
==
--- (empty file)
+++ 
cocoon/branches/BRANCH_2_1_X/src/blocks/eventcache/java/org/apache/cocoon/caching/impl/JMSEventMessageListener.java
 Fri Aug 13 05:32:03 2004
@@ -0,0 +1,112 @@
+/*
+ * Copyright 1999-2004 The Apache Software Foundation.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under

svn commit: rev 36342 - cocoon/branches/BRANCH_2_1_X

2004-08-13 Thread unico
Author: unico
Date: Fri Aug 13 05:40:39 2004
New Revision: 36342

Modified:
   cocoon/branches/BRANCH_2_1_X/gump.xml
Log:
eventcache dependency on jms block

Modified: cocoon/branches/BRANCH_2_1_X/gump.xml
==
--- cocoon/branches/BRANCH_2_1_X/gump.xml   (original)
+++ cocoon/branches/BRANCH_2_1_X/gump.xml   Fri Aug 13 05:40:39 2004
@@ -932,6 +932,7 @@
 /ant
 
 depend project=cocoon inherit=all/
+depend project=cocoon-block-jms/
 depend project=cocoon-block-xsp type=samples/
 
 work nested=build/cocoon-@@DATE@@/blocks/eventcache/dest/


svn commit: rev 36345 - cocoon/branches/BRANCH_2_1_X/src/blocks/jms/java/org/apache/cocoon/components/jms

2004-08-13 Thread unico
Author: unico
Date: Fri Aug 13 06:27:29 2004
New Revision: 36345

Added:
   
cocoon/branches/BRANCH_2_1_X/src/blocks/jms/java/org/apache/cocoon/components/jms/JMSConnection.java
  - copied, changed from rev 36340, 
cocoon/branches/BRANCH_2_1_X/src/blocks/jms/java/org/apache/cocoon/components/jms/JMSConnection.java
   
cocoon/branches/BRANCH_2_1_X/src/blocks/jms/java/org/apache/cocoon/components/jms/JMSConnectionImpl.java
  - copied, changed from rev 36340, 
cocoon/branches/BRANCH_2_1_X/src/blocks/jms/java/org/apache/cocoon/components/jms/JMSConnectionImpl.java
Log:
Resurrect accidentally removed JMSConnection and deprecate it

Copied: 
cocoon/branches/BRANCH_2_1_X/src/blocks/jms/java/org/apache/cocoon/components/jms/JMSConnection.java
 (from rev 36340, 
cocoon/branches/BRANCH_2_1_X/src/blocks/jms/java/org/apache/cocoon/components/jms/JMSConnection.java)
==
--- 
cocoon/branches/BRANCH_2_1_X/src/blocks/jms/java/org/apache/cocoon/components/jms/JMSConnection.java
(original)
+++ 
cocoon/branches/BRANCH_2_1_X/src/blocks/jms/java/org/apache/cocoon/components/jms/JMSConnection.java
Fri Aug 13 06:27:29 2004
@@ -26,8 +26,9 @@
 /**
  * JMSConnection properties container plus utilities.
  * 
- * @version CVS $Id: JMSConnection.java,v 1.8 2004/03/05 13:01:57 bdelacretaz 
Exp $
+ * @version CVS $Id$
  * @author a href=mailto:[EMAIL PROTECTED]haul/a
+ * @deprecated  use [EMAIL PROTECTED] 
org.apache.cocoon.components.jms.JMSConnectionManager} instead
  */
 public interface JMSConnection {
 

Copied: 
cocoon/branches/BRANCH_2_1_X/src/blocks/jms/java/org/apache/cocoon/components/jms/JMSConnectionImpl.java
 (from rev 36340, 
cocoon/branches/BRANCH_2_1_X/src/blocks/jms/java/org/apache/cocoon/components/jms/JMSConnectionImpl.java)
==
--- 
cocoon/branches/BRANCH_2_1_X/src/blocks/jms/java/org/apache/cocoon/components/jms/JMSConnectionImpl.java
(original)
+++ 
cocoon/branches/BRANCH_2_1_X/src/blocks/jms/java/org/apache/cocoon/components/jms/JMSConnectionImpl.java
Fri Aug 13 06:27:29 2004
@@ -61,8 +61,9 @@
  *  /tbody
  * /table
  * 
- * @version CVS $Id: JMSConnectionImpl.java,v 1.12 2004/04/30 11:36:26 
cziegeler Exp $
+ * @version CVS $Id$
  * @author a href=mailto:[EMAIL PROTECTED]haul/a
+ * @deprecated  use [EMAIL PROTECTED] 
org.apache.cocoon.components.jms.JMSConnectionManager} instead
  */
 public class JMSConnectionImpl extends AbstractLogEnabled 
implements Configurable, 


svn commit: rev 36346 - cocoon/branches/BRANCH_2_1_X/src/blocks/jms/samples/database

2004-08-13 Thread unico
Author: unico
Date: Fri Aug 13 06:38:46 2004
New Revision: 36346

Modified:
   cocoon/branches/BRANCH_2_1_X/src/blocks/jms/samples/database/access-error.xml
   cocoon/branches/BRANCH_2_1_X/src/blocks/jms/samples/database/invalidated.xml
   cocoon/branches/BRANCH_2_1_X/src/blocks/jms/samples/database/sitemap.xmap
Log:
port changes from 2.2: enhanced JMS support

Modified: 
cocoon/branches/BRANCH_2_1_X/src/blocks/jms/samples/database/access-error.xml
==
--- 
cocoon/branches/BRANCH_2_1_X/src/blocks/jms/samples/database/access-error.xml   
(original)
+++ 
cocoon/branches/BRANCH_2_1_X/src/blocks/jms/samples/database/access-error.xml   
Fri Aug 13 06:38:46 2004
@@ -14,4 +14,4 @@
   See the License for the specific language governing permissions and
   limitations under the License.
 --
-htmlbodypaccess rules forbid you to access this URL./p/html
\ No newline at end of file
+htmlbodypaccess rules forbid you to access this URL./p/body/html

Modified: 
cocoon/branches/BRANCH_2_1_X/src/blocks/jms/samples/database/invalidated.xml
==
--- 
cocoon/branches/BRANCH_2_1_X/src/blocks/jms/samples/database/invalidated.xml
(original)
+++ 
cocoon/branches/BRANCH_2_1_X/src/blocks/jms/samples/database/invalidated.xml
Fri Aug 13 06:38:46 2004
@@ -14,4 +14,4 @@
   See the License for the specific language governing permissions and
   limitations under the License.
 --
-htmlbodypinvalidated cache/p/html
\ No newline at end of file
+htmlbodypinvalidated cache/p/body/html

Modified: 
cocoon/branches/BRANCH_2_1_X/src/blocks/jms/samples/database/sitemap.xmap
==
--- cocoon/branches/BRANCH_2_1_X/src/blocks/jms/samples/database/sitemap.xmap   
(original)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/jms/samples/database/sitemap.xmap   
Fri Aug 13 06:38:46 2004
@@ -16,7 +16,7 @@
 --
 
 !--
-  CVS $Id: sitemap.xmap,v 1.3 2004/03/11 16:25:48 stephan Exp $
+  CVS $Id$
 
   Event Cache Sample
 --
@@ -27,14 +27,17 @@
 map:matcher name=host-matcher
  logger=sitemap.matcher.wildcard
  
src=org.apache.cocoon.matching.modular.CachingWildcardMatcher
-input-module name=request/
-parameter-nameserverName/parameter-name
+  input-module name=request/
+  parameter-nameserverName/parameter-name
 /map:matcher
 /map:matchers
 map:actions
   map:action name=cacheevent 
src=org.apache.cocoon.acting.CacheEventAction/
-  map:action name=jmsevent 
src=org.apache.cocoon.components.jms.JMSPublisherAction
-  parameter name=connection value=OpenJMS-demo/
+  map:action name=jmsevent
+  src=org.apache.cocoon.acting.JMSPublisherAction
+  logger=sitemap.actions.jms
+parameter name=connection value=local-topics/
+parameter name=topic value=topic1/
   /map:action
 /map:actions
 


svn commit: rev 36347 - in cocoon/branches/BRANCH_2_1_X/src/blocks/slide: java/org/apache/cocoon/components/slide/impl samples samples/screens

2004-08-13 Thread unico
Author: unico
Date: Fri Aug 13 06:44:19 2004
New Revision: 36347

Modified:
   
cocoon/branches/BRANCH_2_1_X/src/blocks/slide/java/org/apache/cocoon/components/slide/impl/SlideConfigurationAdapter.java
   cocoon/branches/BRANCH_2_1_X/src/blocks/slide/samples/flow.js
   cocoon/branches/BRANCH_2_1_X/src/blocks/slide/samples/screens/locks.jx
   cocoon/branches/BRANCH_2_1_X/src/blocks/slide/samples/screens/permissions.jx
   cocoon/branches/BRANCH_2_1_X/src/blocks/slide/samples/screens/users.jx
Log:
port changes from 2.2: fix slide sample administration app

Modified: 
cocoon/branches/BRANCH_2_1_X/src/blocks/slide/java/org/apache/cocoon/components/slide/impl/SlideConfigurationAdapter.java
==
--- 
cocoon/branches/BRANCH_2_1_X/src/blocks/slide/java/org/apache/cocoon/components/slide/impl/SlideConfigurationAdapter.java
   (original)
+++ 
cocoon/branches/BRANCH_2_1_X/src/blocks/slide/java/org/apache/cocoon/components/slide/impl/SlideConfigurationAdapter.java
   Fri Aug 13 06:44:19 2004
@@ -25,7 +25,7 @@
 /**
  * The class represent an adapter for the configuration class from jakarta 
slide
  *
- * @version CVS $Id: SlideConfigurationAdapter.java,v 1.4 2004/04/13 15:16:37 
unico Exp $
+ * @version CVS $Id$
  */
 public class SlideConfigurationAdapter implements Configuration {
 
@@ -62,6 +62,9 @@
  */
 public Configuration getConfiguration(String child)
   throws ConfigurationException {
+if (this.configuration.getChild(child, false) == null)
+throw new ConfigurationException(No configuration element  + 
child 
++  at  + this.configuration.getLocation(), this);
 return new 
SlideConfigurationAdapter(this.configuration.getChild(child));
 }
 

Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/slide/samples/flow.js
==
--- cocoon/branches/BRANCH_2_1_X/src/blocks/slide/samples/flow.js   
(original)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/slide/samples/flow.js   Fri Aug 
13 06:44:19 2004
@@ -16,12 +16,11 @@
 
 importPackage(Packages.org.apache.cocoon.components.modules.input);
 importPackage(Packages.org.apache.cocoon.components.slide);
-importPackage(Packages.org.apache.cocoon.components.source);
+importClass(Packages.org.apache.cocoon.components.source.SourceDTO);
 importPackage(Packages.org.apache.cocoon.components.source.helpers);
-importPackage(Packages.org.apache.cocoon.samples.slide);
+importPackage(Packages.org.apache.cocoon.slide.util);
 importPackage(Packages.org.apache.excalibur.source);
 
-var repository = 
cocoon.getComponent('org.apache.cocoon.components.repository.SourceRepository');
 var resolver = cocoon.getComponent(SourceResolver.ROLE);
 var global = cocoon.getComponent(InputModule.ROLE + 
Selector).select(global);
 var namespace = global.getAttribute(namespace,null,null);
@@ -80,9 +79,18 @@
 
   login();
 
-  var baseUri= slide:// + principal + @ + namespace + /;
+  var baseUri  = slide:// + principal + @ + namespace + /;
   var location = baseUri + parentPath + / + collectionName;
-  var status = repository.makeCollection(location);
+  var source = null;
+  try {
+source = resolver.resolveURI(location);
+source.makeCollection();
+  }
+  finally {
+if (source != null) {
+  resolver.release(source);
+}
+  }
 
   cocoon.redirectTo(viewcontent.do?path= + parentPath);
 }
@@ -95,10 +103,24 @@
   //FIXME: retrieve upload object before login
   login();
 
-  var baseUri  = slide:// + principal + @ + namespace + /;
+  var baseUri = slide:// + principal + @ + namespace + /;
   var dest = baseUri + parentPath + / + resourceName;
   var src  = upload://uploadFile;
-  var status = repository.save(src,dest);
+
+  var source, destination = null;
+  try {
+source = resolver.resolveURI(src);
+destination = resolver.resolveURI(dest);
+SourceUtil.copy(source, destination);
+  }
+  finally {
+if (source != null) {
+  resolver.release(source);
+}
+if (destination != null) {
+  resolver.release(destination);
+}
+  }
 
   cocoon.redirectTo(viewcontent.do?path= + parentPath);
 }
@@ -112,7 +134,16 @@
   
   var baseUri = slide:// + principal + @ + namespace + /;
   var location = baseUri + parentPath + / + resourceName;
-  var status = repository.remove(location);
+  var source = null;
+  try {
+source = resolver.resolveURI(location);
+source[delete].call(source);
+  }
+  finally {
+if (source != null) {
+  resolver.release(source);
+}
+  }
 
   cocoon.redirectTo(viewcontent.do?path= + parentPath);
 }
@@ -209,18 +240,20 @@
   var roles = AdminHelper.listGroups(nat,principal,/roles);
   var users = AdminHelper.listUsers(nat,principal);
   var privileges = AdminHelper.listPrivileges(nat,principal);
-  cocoon.sendPage(screens/permissions.html,{source:sourceDTO, roles:roles, 
users:users, privileges:privileges

svn commit: rev 36348 - in cocoon/branches/BRANCH_2_1_X/src/blocks/slide/java/org/apache/cocoon/slide: . util

2004-08-13 Thread unico
Author: unico
Date: Fri Aug 13 06:50:59 2004
New Revision: 36348

Added:
   cocoon/branches/BRANCH_2_1_X/src/blocks/slide/java/org/apache/cocoon/slide/
   
cocoon/branches/BRANCH_2_1_X/src/blocks/slide/java/org/apache/cocoon/slide/util/
   
cocoon/branches/BRANCH_2_1_X/src/blocks/slide/java/org/apache/cocoon/slide/util/AdminHelper.java
  - copied, changed from rev 36290, 
cocoon/branches/BRANCH_2_1_X/src/blocks/slide/java/org/apache/cocoon/samples/slide/AdminHelper.java
Log:
port changes from 2.2: fix slide sample administration app

Copied: 
cocoon/branches/BRANCH_2_1_X/src/blocks/slide/java/org/apache/cocoon/slide/util/AdminHelper.java
 (from rev 36290, 
cocoon/branches/BRANCH_2_1_X/src/blocks/slide/java/org/apache/cocoon/samples/slide/AdminHelper.java)
==
--- 
cocoon/branches/BRANCH_2_1_X/src/blocks/slide/java/org/apache/cocoon/samples/slide/AdminHelper.java
 (original)
+++ 
cocoon/branches/BRANCH_2_1_X/src/blocks/slide/java/org/apache/cocoon/slide/util/AdminHelper.java
Fri Aug 13 06:50:59 2004
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
-package org.apache.cocoon.samples.slide;
+package org.apache.cocoon.slide.util;
 
 import java.util.ArrayList;
 import java.util.Collections;


svn commit: rev 36349 - cocoon/branches/BRANCH_2_1_X/src/blocks/slide/java/org/apache/cocoon/samples/slide

2004-08-13 Thread unico
Author: unico
Date: Fri Aug 13 06:51:08 2004
New Revision: 36349

Removed:
   
cocoon/branches/BRANCH_2_1_X/src/blocks/slide/java/org/apache/cocoon/samples/slide/AdminHelper.java
Log:
port changes from 2.2: fix slide sample administration app


svn commit: rev 36061 - cocoon/trunk/src/java/org/apache/cocoon/transformation

2004-08-07 Thread unico
Author: unico
Date: Sat Aug  7 05:12:22 2004
New Revision: 36061

Modified:
   
cocoon/trunk/src/java/org/apache/cocoon/transformation/CIncludeTransformer.java
Log:
fix typos

Modified: 
cocoon/trunk/src/java/org/apache/cocoon/transformation/CIncludeTransformer.java
==
--- 
cocoon/trunk/src/java/org/apache/cocoon/transformation/CIncludeTransformer.java 
(original)
+++ 
cocoon/trunk/src/java/org/apache/cocoon/transformation/CIncludeTransformer.java 
Sat Aug  7 05:12:22 2004
@@ -122,7 +122,7 @@
  *
  * @author a href=mailto:[EMAIL PROTECTED]Carsten Ziegeler/a
  * @author a href=mailto:[EMAIL PROTECTED]Andrew C. Oliver/a
- * @version CVS $Id: CIncludeTransformer.java,v 1.13 2004/07/08 07:22:33 
tcurdt Exp $
+ * @version CVS $Id$
  */
 public class CIncludeTransformer
 extends AbstractSAXTransformer
@@ -199,7 +199,7 @@
 }
 this.compiling = false;
 this.supportCaching = 
parameters.getParameterAsBoolean(support-caching, false);
-if (this.getLogger().isErrorEnabled()) {
+if (this.getLogger().isDebugEnabled()) {
 this.getLogger().debug(Starting CIncludeTransformer with session 
 + this.cachingSession);
 this.startTime = System.currentTimeMillis();
 }
@@ -243,7 +243,7 @@
 super.recycle();
 this.configurationParameters = null;
 this.resourceParameters = null;
-if (getLogger().isErrorEnabled()) {
+if (getLogger().isDebugEnabled()) {
 getLogger().debug(Finishing CachingCIncludeTransformer, time:  +
   (System.currentTimeMillis() - this.startTime));
 this.startTime = 0;


svn commit: rev 35677 - cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/components/modules/input

2004-08-04 Thread unico
Author: unico
Date: Wed Aug  4 04:42:12 2004
New Revision: 35677

Modified:
   
cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/components/modules/input/XMLFileModule.java
Log:
port changes from trunk: reload bugfix

Modified: 
cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/components/modules/input/XMLFileModule.java
==
--- 
cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/components/modules/input/XMLFileModule.java
 (original)
+++ 
cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/components/modules/input/XMLFileModule.java
 Wed Aug  4 04:42:12 2004
@@ -1,19 +1,18 @@
 /*
  * Copyright 1999-2004 The Apache Software Foundation.
- * 
+ *
  * Licensed under the Apache License, Version 2.0 (the License);
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
- * 
+ *
  *  http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an AS IS BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-
 package org.apache.cocoon.components.modules.input;
 
 import org.apache.avalon.framework.component.ComponentException;
@@ -24,6 +23,7 @@
 import org.apache.avalon.framework.logger.Logger;
 import org.apache.avalon.framework.thread.ThreadSafe;
 import org.apache.cocoon.components.source.SourceUtil;
+import org.apache.commons.collections.map.AbstractReferenceMap;
 import org.apache.commons.collections.map.ReferenceMap;
 import org.apache.excalibur.source.Source;
 import org.apache.excalibur.source.SourceResolver;
@@ -58,9 +58,8 @@
   optionalattribute name=cachabledata 
type=boolean//attribute/optional
/element
 /define
-
  /grammar
- 
+
  * This module provides an Input Module interface to any XML document, by using
  * XPath expressions as attribute keys.
  * The XML can be obtained from any Cocoon codeSource/code (e.g.,
@@ -75,7 +74,7 @@
  * src=protocol:path/to/file.xml reloadable=true
  * cacheable=true/gt;/code optionally overriding defaults for
  * caching and or reloading./p
- * 
+ *
  * pIn addition, xpath expressions are cached for higher performance.
  * Thus, if an expression has been evaluated for a file, the result
  * is cached and will be reused, the expression is not evaluated
@@ -84,7 +83,7 @@
  *
  * @author a href=mailto:[EMAIL PROTECTED]Jeff Turner/a
  * @author a href=mailto:[EMAIL PROTECTED]Christian Haul/a
- * @version CVS $Id: XMLFileModule.java,v 1.16 2004/03/05 13:02:48 bdelacretaz 
Exp $
+ * @version CVS $Id$
  */
 public class XMLFileModule extends AbstractJXPathModule implements Composable, 
ThreadSafe {
 
@@ -93,16 +92,16 @@
 /** Cached documents */
 Map documents = null;
 /** Default value for reloadability of sources */
-boolean reloadAll = false;
+boolean reloadAll;
 /** Default value for cachability of sources */
 boolean cacheAll = true;
 /** Default value for cachability of xpath expressions. */
 boolean cacheExpressions = true;
 /** Default src */
-String src = null;
+String src;
 
-SourceResolver resolver = null;
-ComponentManager manager = null;
+SourceResolver resolver;
+ComponentManager manager;
 
 //
 // need two caches for Object and Object[]
@@ -114,17 +113,18 @@
 
 /**
  * Takes care of (re-)loading and caching of sources.
- *
  */
 protected class DocumentHelper {
-
-private boolean reloadable = true;
-private boolean cacheable = true;
-/** source location */
-private String uri = null;
-/** cached DOM */
-private Document document = null;
-private SourceValidity srcVal = null;
+private boolean reloadable;
+private boolean cacheable;
+/** Source location */
+private String uri;
+/** Source validity */
+private SourceValidity validity;
+/** Source content cached as DOM Document */
+private Document document;
+/** Remember who created us (and who's caching us) */
+private XMLFileModule instance;
 
 /**
  * Creates a new codeDocumentHelper/code instance.
@@ -133,11 +133,12 @@
  * @param cache a codeboolean/code value, whether this source 
should be kept in memory.
  * @param src a codeString/code value containing the URI
  */
-public DocumentHelper(boolean reload, boolean cache, String src) {
+public DocumentHelper(boolean reload, boolean cache, String src, 
XMLFileModule instance) {
 this.reloadable = reload;
 this.cacheable = cache;
 this.uri = src;
-// deferr loading document
+this.instance

svn commit: rev 35679 - in cocoon/branches/BRANCH_2_1_X: legal lib lib/core

2004-08-04 Thread unico
Author: unico
Date: Wed Aug  4 05:36:01 2004
New Revision: 35679

Added:
   cocoon/branches/BRANCH_2_1_X/legal/commons-collections-3.1.jar.license.txt
   cocoon/branches/BRANCH_2_1_X/lib/core/commons-collections-3.1.jar   
(contents, props changed)
Modified:
   cocoon/branches/BRANCH_2_1_X/lib/jars.xml
Log:
upgrade commons-collections to 3.1

Added: 
cocoon/branches/BRANCH_2_1_X/legal/commons-collections-3.1.jar.license.txt
==
--- (empty file)
+++ cocoon/branches/BRANCH_2_1_X/legal/commons-collections-3.1.jar.license.txt  
Wed Aug  4 05:36:01 2004
@@ -0,0 +1,53 @@
+/* 
+ * The Apache Software License, Version 1.1
+ *
+ * Copyright (c) 1999-2004 The Apache Software Foundation.  All rights
+ * reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in
+ *the documentation and/or other materials provided with the
+ *distribution.
+ *
+ * 3. The end-user documentation included with the redistribution, if
+ *any, must include the following acknowledgement:
+ *   This product includes software developed by the
+ *Apache Software Foundation (http://www.apache.org/).
+ *Alternately, this acknowledgement may appear in the software itself,
+ *if and wherever such third-party acknowledgements normally appear.
+ *
+ * 4. The names The Jakarta Project, Commons, and Apache Software
+ *Foundation must not be used to endorse or promote products derived
+ *from this software without prior written permission. For written
+ *permission, please contact [EMAIL PROTECTED]
+ *
+ * 5. Products derived from this software may not be called Apache
+ *nor may Apache appear in their names without prior written
+ *permission of the Apache Software Foundation.
+ *
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * 
+ *
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation.  For more
+ * information on the Apache Software Foundation, please see
+ * http://www.apache.org/.
+ */

Added: cocoon/branches/BRANCH_2_1_X/lib/core/commons-collections-3.1.jar
==
Binary file. No diff available.

Modified: cocoon/branches/BRANCH_2_1_X/lib/jars.xml
==
--- cocoon/branches/BRANCH_2_1_X/lib/jars.xml   (original)
+++ cocoon/branches/BRANCH_2_1_X/lib/jars.xml   Wed Aug  4 05:36:01 2004
@@ -305,7 +305,7 @@
 titleJakarta Commons Collections/title
 descriptionCommon implementations of collection classes./description
 used-byCocoon, OJB/used-by
-libcore/commons-collections-3.0.jar/lib
+libcore/commons-collections-3.1.jar/lib
 
homepagehttp://jakarta.apache.org/commons/collections/index.html/homepage
   /file
 


svn commit: rev 35682 - cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/generation

2004-08-04 Thread unico
Author: unico
Date: Wed Aug  4 07:12:20 2004
New Revision: 35682

Modified:
   
cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/generation/JXTemplateGenerator.java
Log:
port changes from trunk: bugfixes, formatting and cacheability

Modified: 
cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/generation/JXTemplateGenerator.java
==
--- 
cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/generation/JXTemplateGenerator.java
 (original)
+++ 
cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/generation/JXTemplateGenerator.java
 Wed Aug  4 07:12:20 2004
@@ -20,6 +20,7 @@
 import java.io.IOException;
 import java.io.PrintStream;
 import java.io.PrintWriter;
+import java.io.Serializable;
 import java.io.StringReader;
 import java.lang.reflect.Field;
 import java.lang.reflect.InvocationTargetException;
@@ -36,13 +37,15 @@
 import java.util.List;
 import java.util.Locale;
 import java.util.Map;
+import java.util.Properties;
 import java.util.Stack;
 import java.util.TimeZone;
 
 import org.apache.avalon.framework.parameters.Parameters;
-import org.apache.avalon.framework.service.ServiceManager;
 import org.apache.avalon.framework.service.ServiceException;
+import org.apache.avalon.framework.service.ServiceManager;
 import org.apache.cocoon.ProcessingException;
+import org.apache.cocoon.caching.CacheableProcessingComponent;
 import org.apache.cocoon.components.flow.FlowHelper;
 import org.apache.cocoon.components.flow.WebContinuation;
 import 
org.apache.cocoon.components.flow.javascript.fom.FOM_JavaScriptFlowHelper;
@@ -51,10 +54,12 @@
 import org.apache.cocoon.environment.Request;
 import org.apache.cocoon.environment.SourceResolver;
 import org.apache.cocoon.transformation.ServiceableTransformer;
-import org.apache.cocoon.xml.XMLConsumer;
 import org.apache.cocoon.xml.IncludeXMLConsumer;
+import org.apache.cocoon.xml.XMLConsumer;
+import org.apache.cocoon.xml.XMLUtils;
 import org.apache.cocoon.xml.dom.DOMBuilder;
 import org.apache.cocoon.xml.dom.DOMStreamer;
+import org.apache.commons.jexl.Expression;
 import org.apache.commons.jexl.ExpressionFactory;
 import org.apache.commons.jexl.JexlContext;
 import org.apache.commons.jexl.util.Introspector;
@@ -71,6 +76,8 @@
 import org.apache.commons.jxpath.JXPathIntrospector;
 import org.apache.commons.jxpath.Pointer;
 import org.apache.commons.jxpath.Variables;
+import org.apache.commons.lang.ArrayUtils;
+import org.apache.commons.lang.StringUtils;
 import org.apache.excalibur.source.Source;
 import org.apache.excalibur.source.SourceException;
 import org.apache.excalibur.source.SourceValidity;
@@ -97,266 +104,52 @@
 import org.xml.sax.helpers.LocatorImpl;
 
 /**
- * p(emJX/em for a 
href=http://jakarta.apache.org/commons/jxpath;Apache emJX/emPath/a
- * and a href=http://jakarta.apache.org/commons/jexl;Apache 
emJ/emeemx/eml/a)./p
- * pUses the namespace 
codehttp://apache.org/cocoon/templates/jx/1.0/code/p
- * pProvides a generic page template with embedded JSTL and XPath
- * expression substitution to access data sent by Cocoon Flowscripts./p
- * The embedded expression language allows a page author to access an
- * object using a simplified syntax such as
- *
- *  ppre
- *  lt;site signOn=${accountForm.signOn}gt;
- *  /pre/p
- *
- * pEmbedded JSTL expressions are contained in code${}/code./p
- * pEmbedded XPath expressions are contained in code#{}/code./p
- * pNote that since this generator uses
- * a href=http://jakarta.apache.org/commons/jxpath;Apache JXPath/a
- * and a href=http://jakarta.apache.org/commons/jexl;Apache Jexl/a, the
- * referenced objects may be Java Beans, DOM, JDOM, or JavaScript objects from
- * a Flowscript. In addition the following implicit objects are available as
- * both XPath and JSTL variables:/p
- * p
- * dl
- * dtcoderequest/code 
(codeorg.apache.cocoon.environment.Request/code)/dt
- * ddThe Cocoon current request/dd
- *
- * dtcodesession/code 
(codeorg.apache.cocoon.environment.Session/code)/dt
- * ddThe Cocoon session associated with the current request/dd
- *
- * dtcodecontext/code 
(codeorg.apache.cocoon.environment.Context/code)/dt
- * ddThe Cocoon context associated with the current request/dd
- *
- * dtcodeparameters/code 
(codeorg.apache.avalon.framework.parameters.Parameters/code)/dt
- * ddA map of parameters passed to the generator in the pipeline/dd
- * /dl
- * /p
- *
- * The current Web Continuation from the Flowscript
- * is also available as a variable named codecontinuation/code. You would
- * typically access its codeid/code:
- *
- * ppre
- *lt;form action=${continuation.id}gt;
- * /pre/p
- *
- * pYou can also reach previous continuations by using the
- * codegetContinuation()/code function:/p
- *
- * ppre
- * lt;form action=${continuation.getContinuation(1).id} 
- * /pre/p
- *
- * p
- * pThe codetemplate/code tag defines a new template:/ppre
- *lt;templategt;
- *body
- *lt;/templategt;
- * /pre/p

cvs commit: cocoon-2.1/src/java/org/apache/cocoon/transformation/pagination Pagesheet.java

2004-07-22 Thread unico
unico   2004/07/22 02:12:35

  Modified:src/java/org/apache/cocoon/transformation/pagination
Pagesheet.java
  Log:
  deja vu all over again
  
  Revision  ChangesPath
  1.8   +2 -2  
cocoon-2.1/src/java/org/apache/cocoon/transformation/pagination/Pagesheet.java
  
  Index: Pagesheet.java
  ===
  RCS file: 
/home/cvs/cocoon-2.1/src/java/org/apache/cocoon/transformation/pagination/Pagesheet.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- Pagesheet.java21 Jul 2004 13:20:30 -  1.7
  +++ Pagesheet.java22 Jul 2004 09:12:34 -  1.8
  @@ -98,7 +98,7 @@
6) range link(s) will have an attribute 'range' to indicate the range size
   
   */
  -public class Pagesheet extends DefaultHandler implements Cloneable, 
Modifiable, Serializable {
  +public class Pagesheet extends DefaultHandler implements Cloneable, 
Modifiable {
   
   // Used only during parsing of pagesheet document
   private int level = 0;
  
  
  


cvs commit: cocoon-2.1/src/java/org/apache/cocoon/transformation/pagination Pagesheet.java

2004-07-21 Thread unico
unico   2004/07/21 06:20:30

  Modified:src/java/org/apache/cocoon/transformation/pagination
Pagesheet.java
  Log:
  make pagesheet work with ehcache store which requires object to be 
Serializable
  
  Revision  ChangesPath
  1.7   +3 -3  
cocoon-2.1/src/java/org/apache/cocoon/transformation/pagination/Pagesheet.java
  
  Index: Pagesheet.java
  ===
  RCS file: 
/home/cvs/cocoon-2.1/src/java/org/apache/cocoon/transformation/pagination/Pagesheet.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- Pagesheet.java17 May 2004 16:17:11 -  1.6
  +++ Pagesheet.java21 Jul 2004 13:20:30 -  1.7
  @@ -16,6 +16,7 @@
   
   package org.apache.cocoon.transformation.pagination;
   
  +import java.io.Serializable;
   import java.util.ArrayList;
   import java.util.HashMap;
   import java.util.Iterator;
  @@ -97,8 +98,7 @@
6) range link(s) will have an attribute 'range' to indicate the range size
   
   */
  -public class Pagesheet extends DefaultHandler
  -   implements Cloneable, Modifiable {
  +public class Pagesheet extends DefaultHandler implements Cloneable, 
Modifiable, Serializable {
   
   // Used only during parsing of pagesheet document
   private int level = 0;
  
  
  


cvs commit: cocoon-2.1/src/blocks/slide/java/org/apache/cocoon/slide - New directory

2004-07-17 Thread unico
unico   2004/07/17 10:57:19

  cocoon-2.1/src/blocks/slide/java/org/apache/cocoon/slide - New directory


cvs commit: cocoon-2.1/src/blocks/slide/java/org/apache/cocoon/slide/util - New directory

2004-07-17 Thread unico
unico   2004/07/17 10:57:19

  cocoon-2.1/src/blocks/slide/java/org/apache/cocoon/slide/util - New directory


cvs commit: cocoon-2.1/src/blocks/slide/samples flow.js

2004-07-17 Thread unico
unico   2004/07/17 10:57:25

  Modified:src/blocks/slide/samples/screens users.jx locks.jx
permissions.jx
   src/blocks/slide/samples flow.js
  Added:   src/blocks/slide/java/org/apache/cocoon/slide/util
AdminHelper.java
  Removed: src/blocks/slide/java/org/apache/cocoon/samples/slide
AdminHelper.java
  Log:
  fix the slide samples again after stephan's refactorings of a few months ago 
apparently
  broke half of them.  I find it unexceptable that I would have to loose half a 
day to fix the
  fumbling failures of people that apparently don't take the time to test their 
dubious refactorings.
  goddammit.
  
  Revision  ChangesPath
  1.5   +13 -9 cocoon-2.1/src/blocks/slide/samples/screens/users.jx
  
  Index: users.jx
  ===
  RCS file: /home/cvs/cocoon-2.1/src/blocks/slide/samples/screens/users.jx,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- users.jx  13 Apr 2004 14:25:24 -  1.4
  +++ users.jx  17 Jul 2004 17:57:24 -  1.5
  @@ -55,7 +55,7 @@
   /form
 /td
 form action=changepwd.do method=post
  -input type=hidden name=username value=${user}/
  +input type=hidden name=useruri value=${user}/
   td align=left
 input type=password name=password size=10 
maxlength=40/
   /td
  @@ -67,11 +67,15 @@
   input type=hidden name=subjecturi value=${user}/
   td align=left
 select name=objecturi
  -jx:forEach var=role items=#{roles[member = $user]}
  -  option value={$role.uri}
  -${role.uri}
  -  /option
  -/jx:forEach 
  +jx:forEach var=role items=${roles}
  +  jx:forEach var=member items=${role.members}
  +jx:if test=${member == user}
  +  option value=${role.uri}
  +${role.uri}
  +  /option
  +/jx:if
  +  /jx:forEach
  +/jx:forEach
 /select
   /td
   td align=left
  @@ -82,11 +86,11 @@
   tr
 td colspan=4/
 form action=addmember.do method=post
  -input type=hidden name=subjecturi value={$user}/
  +input type=hidden name=subjecturi value=${user}/
   td align=left
 select name=objecturi size=1
   jx:forEach var=role items=${roles}
  -  option value={$role.uri}
  +  option value=${role.uri}
   ${role.uri}
 /option
   /jx:forEach
  @@ -127,7 +131,7 @@
 jx:forEach var=role items=${roles}
   tr
 form action=removeobject.do method=post
  -input type=hidden name=objecturi value={$roleuri}/
  +input type=hidden name=objecturi value=${role.uri}/
   td align=left
 ${role.uri}
   /td
  
  
  
  1.4   +17 -17cocoon-2.1/src/blocks/slide/samples/screens/locks.jx
  
  Index: locks.jx
  ===
  RCS file: /home/cvs/cocoon-2.1/src/blocks/slide/samples/screens/locks.jx,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- locks.jx  13 Apr 2004 14:25:24 -  1.3
  +++ locks.jx  17 Jul 2004 17:57:24 -  1.4
  @@ -60,7 +60,7 @@
 bType/b
   /td
   td align=left
  -  bExpiration (mins)/b
  +  bExpiration/b
   /td
   td align=left
 bInheritable/b
  @@ -70,16 +70,16 @@
   /td
   td align=right/
 /tr
  -  jx:forEach var=lock items=${source.locks}
  +  jx:forEach var=lock items=${locks}
   tr bgcolor=#ee
 td align=left
  -${lock.subject}
  +${lock.subjectUri}
 /td
 td align=left
  -${lock.type}
  +${lock.typeUri}
 /td
 td align=left
  -${lock.expiration}
  +${lock.expirationDate}
 /td
 td align=left
   ${lock.inheritable}
  @@ -90,8 +90,8 @@
 td align=right
   form action=removelock.do method=post
 input type=hidden name=resourcePath 
value=${source.path

cvs commit: cocoon-2.1 status.xml

2004-07-10 Thread unico
unico   2004/07/10 02:06:18

  Modified:.status.xml
  Log:
  - describe two recent actions
  - fix missing action end tag
  
  Revision  ChangesPath
  1.390 +15 -3 cocoon-2.1/status.xml
  
  Index: status.xml
  ===
  RCS file: /home/cvs/cocoon-2.1/status.xml,v
  retrieving revision 1.389
  retrieving revision 1.390
  diff -u -r1.389 -r1.390
  --- status.xml8 Jul 2004 10:11:38 -   1.389
  +++ status.xml10 Jul 2004 09:06:18 -  1.390
  @@ -203,7 +203,19 @@
   
   
 changes
  - release version=@version@ date=@date@
  +  release version=@version@ date=@date@
  +   action dev=UH type=add
  + Enhanced JMS support by adding a JMSConnectionManager component to the 
JMS block.
  + This component replaces the JMSConnection component which only 
supported 
  + publish/subscribe messaging and which mixed some concerns. Two abstract 
classes: 
  + AbstractMessageListener and AbstractMessagePublisher should be used as 
basis for
  + custom publish/subscribe components.
  +   /action
  +   action dev=UH type=add
  + Still in the scratchpad area at the time of this writing, added a 
  + CachedSource proxy subclass for Sources that implement 
TraversableSource and
  + InspectableSource (for instance WebDAVSource).
  +   /action
  action dev=UV type=add
Added a NekoHTMLGenerator to HTML block. This is a simpler HTML parser 
than
JTidy, which preserves more of the original HTML, primarily just 
balancing
  @@ -211,7 +223,7 @@
  /action
  action dev=TC type=add fixes-bug=29935 due-to=Leszek Gawron 
due-to-email=[EMAIL PROTECTED]
   added support for stripping root elements in the CIncludeTransformer
  -   action
  +   /action
  action dev=CZ type=add
New getSitemapPath() method on the Request object to get the path to the
current sitemap even if you are in a sub sitemap. Added an abstract 
request
  
  
  


cvs commit: cocoon-2.1/src/blocks/jms/conf jms-connection-manager.xconf

2004-07-10 Thread unico
unico   2004/07/10 02:24:08

  Modified:src/blocks/jms/conf jms-connection-manager.xconf
  Log:
  document configuration options
  
  Revision  ChangesPath
  1.2   +19 -8 
cocoon-2.1/src/blocks/jms/conf/jms-connection-manager.xconf
  
  Index: jms-connection-manager.xconf
  ===
  RCS file: 
/home/cvs/cocoon-2.1/src/blocks/jms/conf/jms-connection-manager.xconf,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- jms-connection-manager.xconf  1 Jul 2004 13:43:00 -   1.1
  +++ jms-connection-manager.xconf  10 Jul 2004 09:24:08 -  1.2
  @@ -15,20 +15,31 @@
 limitations under the License.
   --
   xconf xpath=/cocoon unless=jms-connection-manager
  +  !-- +
  +| Configuration of a set JMS Connections. 
  +| Three types of connections can be configured: 
  +| - general connections: created by a call to 
ConnectionFactory.createConnection()
  +| - topic-connections: created by a call to 
TopicConnectionFactory.createTopicConnection()
  +| - queue-connections: created by a call to 
QeueuConnectionFactory.createQueueConnection()
  +| 
  +| Each connection must have a unique name to retrieve it. This is the 
name other components
  +| use to retrieve it.
  +| 
  +| All connection types support the same set of parameters:
  +| - javax.naming.*: properties used to create the initial JNDI context.
  +|   JNDI parameters must be specified with their literal values here.
  +|   For example, javax.naming.Context.INITIAL_CONTEXT_FACTORY is 
  +|   equivalent to java.naming.factory.initial.
  +| - connection-factory: the JNDI lookup name of the 
javax.jms.ConnectionFactory service.
  +| - username / password: optional connection credentials
  ++ --
 jms-connection-manager logger=core.jms
   topic-connection name=local-topics
  -  !-- +
  -| JNDI Parameters must be specified with their literal values here.
  -| For example, javax.naming.Context.INITIAL_CONTEXT_FACTORY is 
  -| equivalent to java.naming.factory.initial.  If a jndi.properties 
  -| file is on the classpath, jndi-info can be left empty to use those 
  -| properties instead.
  -+ --
 parameter name=java.naming.factory.initial 
value=org.exolab.jms.jndi.InitialContextFactory/
 parameter name=java.naming.provider.url 
value=rmi://localhost:1099//
 !-- OpenJMS RMI topic connection factory --
 parameter name=connection-factory 
value=JmsTopicConnectionFactory/
  -  !-- optional username and password
  +  !--
 parameter name=username value=user/
 parameter name=password value=secret/
 --
  
  
  


cvs commit: cocoon-2.1/src/blocks/jms/conf jms-connection-manager.xconf

2004-07-10 Thread unico
unico   2004/07/10 02:42:19

  Modified:src/blocks/jms/conf jms-connection-manager.xconf
  Log:
  better blah
  
  Revision  ChangesPath
  1.3   +1 -1  
cocoon-2.1/src/blocks/jms/conf/jms-connection-manager.xconf
  
  Index: jms-connection-manager.xconf
  ===
  RCS file: 
/home/cvs/cocoon-2.1/src/blocks/jms/conf/jms-connection-manager.xconf,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- jms-connection-manager.xconf  10 Jul 2004 09:24:08 -  1.2
  +++ jms-connection-manager.xconf  10 Jul 2004 09:42:19 -  1.3
  @@ -22,7 +22,7 @@
   | - topic-connections: created by a call to 
TopicConnectionFactory.createTopicConnection()
   | - queue-connections: created by a call to 
QeueuConnectionFactory.createQueueConnection()
   | 
  -| Each connection must have a unique name to retrieve it. This is the 
name other components
  +| Each connection must have a unique name. This is the name other 
components
   | use to retrieve it.
   | 
   | All connection types support the same set of parameters:
  
  
  


cvs commit: cocoon-2.1/src/blocks/scratchpad/lib ehcache-0.9.jar ehcache-0.8.jar

2004-07-08 Thread unico
unico   2004/07/08 02:17:32

  Modified:lib  jars.xml
  Added:   src/blocks/scratchpad/lib ehcache-0.9.jar
  Removed: src/blocks/scratchpad/lib ehcache-0.8.jar
  Log:
  upgrade ehcache
  
  Revision  ChangesPath
  1.237 +2 -2  cocoon-2.1/lib/jars.xml
  
  Index: jars.xml
  ===
  RCS file: /home/cvs/cocoon-2.1/lib/jars.xml,v
  retrieving revision 1.236
  retrieving revision 1.237
  diff -u -r1.236 -r1.237
  --- jars.xml  4 Jul 2004 09:45:33 -   1.236
  +++ jars.xml  8 Jul 2004 09:17:31 -   1.237
  @@ -558,7 +558,7 @@
   titleEHCache/title
   descriptionEasy Hibernate Cache/description
   used-byEHCache Store/used-by
  -libscratchpad/lib/ehcache-0.8.jar/lib
  +libscratchpad/lib/ehcache-0.9.jar/lib
   homepagehttp://ehcache.sourceforge.net//homepage
 /file
   
  
  
  
  1.1  cocoon-2.1/src/blocks/scratchpad/lib/ehcache-0.9.jar
  
Binary file
  
  


cvs commit: cocoon-2.1/src/blocks/scratchpad/java/org/apache/cocoon/components/store ehcache-defaults.xml EHStore.java

2004-07-08 Thread unico
unico   2004/07/08 02:23:15

  Modified:src/blocks/scratchpad/java/org/apache/cocoon/components/store
ehcache-defaults.xml EHStore.java
  Log:
  nit picking
  
  Revision  ChangesPath
  1.3   +2 -2  
cocoon-2.1/src/blocks/scratchpad/java/org/apache/cocoon/components/store/ehcache-defaults.xml
  
  Index: ehcache-defaults.xml
  ===
  RCS file: 
/home/cvs/cocoon-2.1/src/blocks/scratchpad/java/org/apache/cocoon/components/store/ehcache-defaults.xml,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- ehcache-defaults.xml  23 Mar 2004 02:20:10 -  1.2
  +++ ehcache-defaults.xml  8 Jul 2004 09:23:15 -   1.3
  @@ -34,8 +34,8 @@
   The following attributes are required for defaultCache:
   
   maxInMemory   - Sets the maximum number of objects that will be 
created in memory
  -eternal   - Sets whether elements are eternal. If eternal,  
timeouts are ignored and the element
  -is never expired.
  +eternal   - Sets whether elements are eternal. If eternal,  
timeouts are ignored 
  +and the element is never expired.
   timeToIdleSeconds - Sets the time to idle for an element before it 
expires. Is only used
   if the element is not eternal.
   timeToLiveSeconds - Sets the time to idle for an element before it 
expires. Is only used
  
  
  
  1.6   +10 -10
cocoon-2.1/src/blocks/scratchpad/java/org/apache/cocoon/components/store/EHStore.java
  
  Index: EHStore.java
  ===
  RCS file: 
/home/cvs/cocoon-2.1/src/blocks/scratchpad/java/org/apache/cocoon/components/store/EHStore.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- EHStore.java  11 Jun 2004 16:19:04 -  1.5
  +++ EHStore.java  8 Jul 2004 09:23:15 -   1.6
  @@ -71,7 +71,7 @@
   /** The store janitor */
   private StoreJanitor storeJanitor;
   
  -/* (non-Javadoc)
  +/*
* @see 
org.apache.avalon.framework.service.Serviceable#service(org.apache.avalon.framework.service.ServiceManager)
*/
   public void service(ServiceManager aManager) throws ServiceException {
  @@ -132,7 +132,7 @@
   
   //  Store 
implementation
   
  -/* (non-Javadoc)
  +/*
* @see org.apache.excalibur.store.Store#free()
*/
   public Object get(Object key) {
  @@ -157,7 +157,7 @@
   return value;
   }
   
  -/* (non-Javadoc)
  +/*
* @see org.apache.excalibur.store.Store#free()
*/
   public void store(Object key, Object value) throws IOException {
  @@ -168,14 +168,14 @@
   this.cache.put(element);
   }
   
  -/* (non-Javadoc)
  +/*
* @see org.apache.excalibur.store.Store#free()
*/
   public void free() {
  -// FIXME - we have to implement this!
  +// FIXME: we have to implement this!
   }
   
  -/* (non-Javadoc)
  +/*
* @see org.apache.excalibur.store.Store#remove(java.lang.Object)
*/
   public void remove(Object key) {
  @@ -185,7 +185,7 @@
   this.cache.remove((Serializable) key);
   }
   
  -/* (non-Javadoc)
  +/*
* @see org.apache.excalibur.store.Store#clear()
*/
   public void clear() {
  @@ -200,7 +200,7 @@
   }
   }
   
  -/* (non-Javadoc)
  +/*
* @see org.apache.excalibur.store.Store#containsKey(java.lang.Object)
*/
   public boolean containsKey(Object key) {
  @@ -213,14 +213,14 @@
   return false;
   }
   
  -/* (non-Javadoc)
  +/*
* @see org.apache.excalibur.store.Store#keys()
*/
   public Enumeration keys() {
   return Collections.enumeration(this.cache.getKeys());
   }
   
  -/* (non-Javadoc)
  +/*
* @see org.apache.excalibur.store.Store#size()
*/
   public int size() {
  
  
  


cvs commit: cocoon-2.1/src/blocks/scratchpad/java/org/apache/cocoon/components/source/impl InspectableTraversableCachingSource.java

2004-07-08 Thread unico
unico   2004/07/08 03:18:14

  Modified:
src/blocks/scratchpad/java/org/apache/cocoon/components/source/impl
InspectableTraversableCachingSource.java
  Log:
  initialize cached response by getting all properties at once instead of lazily
  getting them one at a time
  
  Revision  ChangesPath
  1.2   +17 -13
cocoon-2.1/src/blocks/scratchpad/java/org/apache/cocoon/components/source/impl/InspectableTraversableCachingSource.java
  
  Index: InspectableTraversableCachingSource.java
  ===
  RCS file: 
/home/cvs/cocoon-2.1/src/blocks/scratchpad/java/org/apache/cocoon/components/source/impl/InspectableTraversableCachingSource.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- InspectableTraversableCachingSource.java  1 Jul 2004 14:24:36 -   
1.1
  +++ InspectableTraversableCachingSource.java  8 Jul 2004 10:18:14 -   
1.2
  @@ -58,6 +58,13 @@
   final InspectableSourceMeta imeta = ((InspectableSourceMeta) 
super.response.getExtra());
   SourceProperty property = imeta.getSourceProperty(namespace, name);
   if (property == null) {
  +// In the case of webdav the source cannot
  +// determine all available properties beforehand.
  +// Therefore, although we initialized the cached
  +// response by calling getSourceProperties(),
  +// this does not mean this particular property
  +// was returned and cached. Hence we try to 
  +// get it here still and remember if it was null.
   property = isource.getSourceProperty(namespace, name);
   if (property == null) {
   // remember that this property is null
  @@ -96,12 +103,7 @@
   return null;
   }
   final InspectableSourceMeta imeta = ((InspectableSourceMeta) 
super.response.getExtra());
  -SourceProperty[] properties = imeta.getSourceProperties();
  -if (properties == null) {
  -properties = isource.getSourceProperties();
  -imeta.setSourceProperties(properties);
  -}
  -return properties;
  +return imeta.getSourceProperties();
   }
   
   public void removeSourceProperty(String namespace, String name) throws 
SourceException {
  @@ -121,7 +123,13 @@
   protected SourceMeta createMeta() {
   return new InspectableSourceMeta();
   }
  -
  +
  +protected void initMeta(SourceMeta meta, Source source) throws 
IOException {
  +super.initMeta(meta, source);
  +final InspectableSourceMeta imeta = ((InspectableSourceMeta) 
super.response.getExtra());
  +imeta.setSourceProperties(isource.getSourceProperties());
  +}
  +
   protected TraversableCachingSource newSource(String uri, Source wrapped) 
{
   return  new InspectableTraversableCachingSource(super.protocol,
   uri,
  @@ -133,13 +141,10 @@
   
   protected static class InspectableSourceMeta extends 
TraversableSourceMeta {
   
  -protected static final SourceProperty NULL_PROPERTY = new 
SourceProperty(cocoon,isnull);
  +protected static final SourceProperty NULL_PROPERTY = new 
SourceProperty(cocoon, isnull);
   
   private Map properties;
   
  -/* flag for determining whether we have all properties */
  -private boolean all;
  -
   protected SourceProperty getSourceProperty(String namespace, String 
name) {
   if (properties == null) return null;
   final String key = namespace + # + name;
  @@ -155,7 +160,7 @@
   }
   
   protected SourceProperty[] getSourceProperties() {
  -if (this.properties == null || !all) return null;
  +if (this.properties == null) return null;
   final Collection values = this.properties.values();
   return (SourceProperty[]) values.toArray(new 
SourceProperty[values.size()]);
   }
  @@ -167,7 +172,6 @@
   for (int i = 0; i  props.length; i++) {
   setSourceProperty(props[i]);
   }
  -all = true;
   }
   
   protected void removeSourceProperty(String namespace, String name) {
  
  
  


cvs commit: cocoon-2.1/src/blocks/jms/java/org/apache/cocoon/components/jms JMSConnection.java JMSConnectionImpl.java

2004-07-06 Thread unico
unico   2004/07/06 00:57:00

  Modified:src/blocks/jms/java/org/apache/cocoon/components/jms
JMSConnection.java JMSConnectionImpl.java
  Removed: src/blocks/jms/conf jmsconnection.xconf
  Log:
  deprecate JMSConnection
  
  Revision  ChangesPath
  1.9   +2 -1  
cocoon-2.1/src/blocks/jms/java/org/apache/cocoon/components/jms/JMSConnection.java
  
  Index: JMSConnection.java
  ===
  RCS file: 
/home/cvs/cocoon-2.1/src/blocks/jms/java/org/apache/cocoon/components/jms/JMSConnection.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- JMSConnection.java5 Mar 2004 13:01:57 -   1.8
  +++ JMSConnection.java6 Jul 2004 07:57:00 -   1.9
  @@ -28,6 +28,7 @@
* 
* @version CVS $Id$
* @author a href=mailto:[EMAIL PROTECTED]haul/a
  + * @deprecated  use [EMAIL PROTECTED] 
org.apache.cocoon.components.jms.JMSConnectionManager} instead
*/
   public interface JMSConnection {
   
  
  
  
  1.13  +2 -1  
cocoon-2.1/src/blocks/jms/java/org/apache/cocoon/components/jms/JMSConnectionImpl.java
  
  Index: JMSConnectionImpl.java
  ===
  RCS file: 
/home/cvs/cocoon-2.1/src/blocks/jms/java/org/apache/cocoon/components/jms/JMSConnectionImpl.java,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- JMSConnectionImpl.java30 Apr 2004 11:36:26 -  1.12
  +++ JMSConnectionImpl.java6 Jul 2004 07:57:00 -   1.13
  @@ -63,6 +63,7 @@
* 
* @version CVS $Id$
* @author a href=mailto:[EMAIL PROTECTED]haul/a
  + * @deprecated  use [EMAIL PROTECTED] 
org.apache.cocoon.components.jms.JMSConnectionManager} instead
*/
   public class JMSConnectionImpl extends AbstractLogEnabled 
  implements Configurable, 
  
  
  


cvs commit: cocoon-2.1/src/java/org/apache/cocoon/generation JXTemplateGenerator.java

2004-07-06 Thread unico
unico   2004/07/06 03:34:36

  Modified:src/java/org/apache/cocoon/generation
JXTemplateGenerator.java
  Log:
  qualify template cache-key with the template source uri
  
  Revision  ChangesPath
  1.52  +32 -5 
cocoon-2.1/src/java/org/apache/cocoon/generation/JXTemplateGenerator.java
  
  Index: JXTemplateGenerator.java
  ===
  RCS file: 
/home/cvs/cocoon-2.1/src/java/org/apache/cocoon/generation/JXTemplateGenerator.java,v
  retrieving revision 1.51
  retrieving revision 1.52
  diff -u -r1.51 -r1.52
  --- JXTemplateGenerator.java  2 Jul 2004 08:33:42 -   1.51
  +++ JXTemplateGenerator.java  6 Jul 2004 10:34:36 -   1.52
  @@ -42,8 +42,8 @@
   import java.util.TimeZone;
   
   import org.apache.avalon.framework.parameters.Parameters;
  -import org.apache.avalon.framework.service.ServiceManager;
   import org.apache.avalon.framework.service.ServiceException;
  +import org.apache.avalon.framework.service.ServiceManager;
   import org.apache.cocoon.ProcessingException;
   import org.apache.cocoon.caching.CacheableProcessingComponent;
   import org.apache.cocoon.components.flow.FlowHelper;
  @@ -54,8 +54,8 @@
   import org.apache.cocoon.environment.Request;
   import org.apache.cocoon.environment.SourceResolver;
   import org.apache.cocoon.transformation.ServiceableTransformer;
  -import org.apache.cocoon.xml.XMLConsumer;
   import org.apache.cocoon.xml.IncludeXMLConsumer;
  +import org.apache.cocoon.xml.XMLConsumer;
   import org.apache.cocoon.xml.XMLUtils;
   import org.apache.cocoon.xml.dom.DOMBuilder;
   import org.apache.cocoon.xml.dom.DOMStreamer;
  @@ -3191,17 +3191,21 @@
   ev = ev.next;
   }
   }
  +
/* (non-Javadoc)
 * @see org.apache.cocoon.caching.CacheableProcessingComponent#getKey()
 */
public Serializable getKey() {
JXTExpression cacheKeyExpr = 
(JXTExpression)getCurrentTemplateProperty(CACHE_KEY);
   try {
  - return (Serializable) getValue(cacheKeyExpr, 
globalJexlContext, jxpathContext);
  +final Serializable templateKey = (Serializable) 
getValue(cacheKeyExpr, globalJexlContext, jxpathContext);
  +if (templateKey != null) {
  + return new JXCacheKey(this.inputSource.getURI(), 
templateKey);
  +}
} catch (Exception e) {
getLogger().error(error evaluating cache key, e);
  - return null;
}
  + return null;
}
   
/* (non-Javadoc)
  @@ -3236,5 +3240,28 @@
   builder.endDocument();
   Node node = builder.getDocument().getDocumentElement();
   return node.getChildNodes();
  + }
  + 
  + static final class JXCacheKey implements Serializable {
  + private final String templateUri;
  + private final Serializable templateKey;
  + private JXCacheKey(String templateUri, Serializable templateKey) {
  + this.templateUri = templateUri;
  + this.templateKey = templateKey;
  + }
  + public int hashCode() {
  + return templateUri.hashCode() + templateKey.hashCode();
  + }
  + public String toString() {
  + return TK: + templateUri + _ + templateKey;
  + }
  + public boolean equals(Object o) {
  + if (o instanceof JXCacheKey) {
  + JXCacheKey jxck = (JXCacheKey)o;
  + return this.templateUri.equals(jxck.templateUri)
  +this.templateKey.equals(jxck.templateKey);
  + }
  + return false;
  + }
}
   }
  
  
  


  1   2   3   4   5   >