cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vgritse...@apache.org
Subject svn commit: r562199 - in /cocoon/trunk/core/cocoon-sitemap/cocoon-sitemap-impl: pom.xml src/changes/changes.xml src/main/java/org/apache/cocoon/components/treeprocessor/sitemap/SerializeNode.java
Date Thu, 02 Aug 2007 17:45:06 GMT
Author: vgritsenko
Date: Thu Aug  2 10:45:05 2007
New Revision: 562199

URL: http://svn.apache.org/viewvc?view=rev&rev=562199
Log:
Fix regression introduced in r530406, r532869.
Update changes document: RC1 is long released.

Modified:
    cocoon/trunk/core/cocoon-sitemap/cocoon-sitemap-impl/pom.xml
    cocoon/trunk/core/cocoon-sitemap/cocoon-sitemap-impl/src/changes/changes.xml
    cocoon/trunk/core/cocoon-sitemap/cocoon-sitemap-impl/src/main/java/org/apache/cocoon/components/treeprocessor/sitemap/SerializeNode.java

Modified: cocoon/trunk/core/cocoon-sitemap/cocoon-sitemap-impl/pom.xml
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-sitemap/cocoon-sitemap-impl/pom.xml?view=diff&rev=562199&r1=562198&r2=562199
==============================================================================
--- cocoon/trunk/core/cocoon-sitemap/cocoon-sitemap-impl/pom.xml (original)
+++ cocoon/trunk/core/cocoon-sitemap/cocoon-sitemap-impl/pom.xml Thu Aug  2 10:45:05 2007
@@ -17,13 +17,16 @@
   specific language governing permissions and limitations
   under the License.
 -->
+
 <!--+
     | @version $Id$
     +-->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-  
-  <modelVersion>4.0.0</modelVersion>  
-  <packaging>jar</packaging>    
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+  <modelVersion>4.0.0</modelVersion>
+  <packaging>jar</packaging>
   <parent>
     <artifactId>cocoon-core-modules</artifactId>
     <groupId>org.apache.cocoon</groupId>
@@ -35,22 +38,22 @@
   <description>
     The tree processor implementation of the sitemap with dependencies.
     The Spring packages for Avalon support. Abstract base classes
-    and support classes for making it easier to write sitemap components. 
+    and support classes for making it easier to write sitemap components.
   </description>
-  <url>http://cocoon.apache.org/${docs.m.sitemap-impl.relPath}</url>    
+  <url>http://cocoon.apache.org/${docs.m.sitemap-impl.relPath}</url>
 
   <properties>
-    <docs.name>${project.name}</docs.name>    
+    <docs.name>${project.name}</docs.name>
     <docs.version>${docs.m.sitemap-impl.version}</docs.version>
-  </properties>  
-  
+  </properties>
+
   <distributionManagement>
     <site>
       <id>website</id>
       <url>${docs.deploymentBaseUrl}/${docs.m.sitemap-impl.relPath}</url>
     </site>
-  </distributionManagement>     
-  
+  </distributionManagement>
+
   <dependencies>
     <!-- Cocoon -->
     <dependency>
@@ -124,9 +127,9 @@
           <artifactId>ant-optional</artifactId>
           <groupId>ant</groupId>
         </exclusion>
-        <!-- 
+        <!--
           excluding this because it brings avalon-framework which is NOT ignored by eclipse:eclipse
-          even though we excluded it in our root pom 
+          even though we excluded it in our root pom
         -->
         <exclusion>
           <artifactId>commons-logging</artifactId>
@@ -138,11 +141,11 @@
     <dependency>
       <groupId>org.springframework</groupId>
       <artifactId>spring-core</artifactId>
-    </dependency>   
+    </dependency>
     <dependency>
       <groupId>org.springframework</groupId>
       <artifactId>spring-context</artifactId>
-    </dependency>    
+    </dependency>
     <dependency>
       <groupId>org.springframework</groupId>
       <artifactId>spring-beans</artifactId>
@@ -152,7 +155,7 @@
           <artifactId>avalon-framework</artifactId>
         </exclusion>
       </exclusions>
-    </dependency>   
+    </dependency>
     <dependency>
       <groupId>org.springframework</groupId>
       <artifactId>spring-aop</artifactId>
@@ -161,8 +164,8 @@
           <groupId>avalon-framework</groupId>
           <artifactId>avalon-framework</artifactId>
         </exclusion>
-      </exclusions>      
-    </dependency>      
+      </exclusions>
+    </dependency>
     <dependency>
       <groupId>org.springframework</groupId>
       <artifactId>spring-web</artifactId>

Modified: cocoon/trunk/core/cocoon-sitemap/cocoon-sitemap-impl/src/changes/changes.xml
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-sitemap/cocoon-sitemap-impl/src/changes/changes.xml?view=diff&rev=562199&r1=562198&r2=562199
==============================================================================
--- cocoon/trunk/core/cocoon-sitemap/cocoon-sitemap-impl/src/changes/changes.xml (original)
+++ cocoon/trunk/core/cocoon-sitemap/cocoon-sitemap-impl/src/changes/changes.xml Thu Aug 
2 10:45:05 2007
@@ -17,6 +17,7 @@
   specific language governing permissions and limitations
   under the License.
 -->
+
 <!--+
     | Find usage details at http://maven.apache.org/plugins/maven-changes-plugin/usage.html
     |
@@ -24,15 +25,21 @@
     +-->
 <document>
   <body>
-    <release version="1.0.0-RC1" date="2007-??-??" description="unreleased">  
+    <release version="1.0.0-RC2" date="2007-??-??" description="unreleased">
+      <action dev="vgritsenko" type="fix">
+        Regression in &lt;map:serialize/&gt; - do not override status code if
+        it was not set on serialize element.
+      </action>
+    </release>
+    <release version="1.0.0-RC1" date="2007-05-16" description="released">
       <action dev="reinhard" type="add" due-to="Jochen Seifarth" due-to-email="jochen.seifarth@web.de"
issue="COCOON-1354">
         &lt;map:serialize status-code=&quot;{}&quot;/&gt; supports variable
resolution.
-      </action>  
-    </release> 
-    <release version="1.0.0-M1" date="2007-03-02" description="released">  
+      </action>
+    </release>
+    <release version="1.0.0-M1" date="2007-03-02" description="released">
       <action dev="reinhard" type="add">
         Initial creation.
-      </action>    
+      </action>
     </release>
   </body>
 </document>

Modified: cocoon/trunk/core/cocoon-sitemap/cocoon-sitemap-impl/src/main/java/org/apache/cocoon/components/treeprocessor/sitemap/SerializeNode.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-sitemap/cocoon-sitemap-impl/src/main/java/org/apache/cocoon/components/treeprocessor/sitemap/SerializeNode.java?view=diff&rev=562199&r1=562198&r2=562199
==============================================================================
--- cocoon/trunk/core/cocoon-sitemap/cocoon-sitemap-impl/src/main/java/org/apache/cocoon/components/treeprocessor/sitemap/SerializeNode.java
(original)
+++ cocoon/trunk/core/cocoon-sitemap/cocoon-sitemap-impl/src/main/java/org/apache/cocoon/components/treeprocessor/sitemap/SerializeNode.java
Thu Aug  2 10:45:05 2007
@@ -55,7 +55,7 @@
      */
     public SerializeNode(String name,
                          VariableResolver source,
-                         VariableResolver mimeType, 
+                         VariableResolver mimeType,
                          VariableResolver statusCode) {
         this.serializerName = name;
         this.source = source;
@@ -124,19 +124,20 @@
                                desc.hintParameters,
                                desc.mimeType);
 
-        // Set status code if there is one
-        int statusCodeInt = 200;
-        try {
-            String statusCodeString = this.statusCode.resolve(context, env.getObjectModel());
-            if(null != statusCodeString) {
+        // Set status code *only* if there is one - do not override status
+        // code if it was set elsewhere.
+        String statusCodeString = this.statusCode.resolve(context, env.getObjectModel());
+        if (statusCodeString != null) {
+            int statusCodeInt = 200;
+            try {
                 Integer resolvedStatusCode = new Integer(this.statusCode.resolve(context,
env.getObjectModel()));
                 statusCodeInt = resolvedStatusCode.intValue();
+            } catch (NumberFormatException e) {
+                getLogger().warn("Status code value '" + statusCodeString + "' is not an
integer. " +
+                                 "Using " + statusCodeInt + " instead.", e);
             }
-        } catch (NumberFormatException nfe) {
-            this.getLogger().warn("It was tried to set a non-integer as status code. " +
-                    "This value was ignored and default status code remains.", nfe);
+            env.setStatus(statusCodeInt);
         }
-        env.setStatus(statusCodeInt);        
 
         if (!context.isBuildingPipelineOnly()) {
             // Process pipeline



Mime
View raw message