cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vgritse...@apache.org
Subject svn commit: r585864 - in /cocoon/trunk/core/cocoon-sitemap/cocoon-sitemap-components/src/main/java/org/apache/cocoon/components/modules: input/XMLFileModule.java output/SessionAttributeOutputModule.java
Date Thu, 18 Oct 2007 04:54:25 GMT
Author: vgritsenko
Date: Wed Oct 17 21:54:22 2007
New Revision: 585864

URL: http://svn.apache.org/viewvc?rev=585864&view=rev
Log:
fix errors

Modified:
    cocoon/trunk/core/cocoon-sitemap/cocoon-sitemap-components/src/main/java/org/apache/cocoon/components/modules/input/XMLFileModule.java
    cocoon/trunk/core/cocoon-sitemap/cocoon-sitemap-components/src/main/java/org/apache/cocoon/components/modules/output/SessionAttributeOutputModule.java

Modified: cocoon/trunk/core/cocoon-sitemap/cocoon-sitemap-components/src/main/java/org/apache/cocoon/components/modules/input/XMLFileModule.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-sitemap/cocoon-sitemap-components/src/main/java/org/apache/cocoon/components/modules/input/XMLFileModule.java?rev=585864&r1=585863&r2=585864&view=diff
==============================================================================
--- cocoon/trunk/core/cocoon-sitemap/cocoon-sitemap-components/src/main/java/org/apache/cocoon/components/modules/input/XMLFileModule.java
(original)
+++ cocoon/trunk/core/cocoon-sitemap/cocoon-sitemap-components/src/main/java/org/apache/cocoon/components/modules/input/XMLFileModule.java
Wed Oct 17 21:54:22 2007
@@ -16,24 +16,26 @@
  */
 package org.apache.cocoon.components.modules.input;
 
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Map;
+
 import org.apache.avalon.framework.configuration.Configuration;
 import org.apache.avalon.framework.configuration.ConfigurationException;
-import org.apache.avalon.framework.logger.Logger;
 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.cocoon.components.source.util.SourceUtil;
 import org.apache.commons.collections.map.AbstractReferenceMap;
 import org.apache.commons.collections.map.ReferenceMap;
+import org.apache.commons.logging.Log;
 import org.apache.excalibur.source.Source;
 import org.apache.excalibur.source.SourceResolver;
 import org.apache.excalibur.source.SourceValidity;
-import org.w3c.dom.Document;
 
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Map;
+import org.apache.cocoon.components.source.util.SourceUtil;
+
+import org.w3c.dom.Document;
 
 /**
 
@@ -162,7 +164,7 @@
          * @return a <code>Document</code> value
          * @exception Exception if an error occurs
          */
-        public synchronized Document getDocument(ServiceManager manager, SourceResolver resolver,
Logger logger)
+        public synchronized Document getDocument(ServiceManager manager, SourceResolver resolver,
Log logger)
         throws Exception {
             Source src = null;
             Document dom = null;

Modified: cocoon/trunk/core/cocoon-sitemap/cocoon-sitemap-components/src/main/java/org/apache/cocoon/components/modules/output/SessionAttributeOutputModule.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-sitemap/cocoon-sitemap-components/src/main/java/org/apache/cocoon/components/modules/output/SessionAttributeOutputModule.java?rev=585864&r1=585863&r2=585864&view=diff
==============================================================================
--- cocoon/trunk/core/cocoon-sitemap/cocoon-sitemap-components/src/main/java/org/apache/cocoon/components/modules/output/SessionAttributeOutputModule.java
(original)
+++ cocoon/trunk/core/cocoon-sitemap/cocoon-sitemap-components/src/main/java/org/apache/cocoon/components/modules/output/SessionAttributeOutputModule.java
Wed Oct 17 21:54:22 2007
@@ -19,12 +19,11 @@
 
 import java.util.Iterator;
 import java.util.Map;
-
 import javax.servlet.http.HttpSession;
 
 import org.apache.avalon.framework.configuration.Configuration;
-import org.apache.avalon.framework.logger.Logger;
 import org.apache.avalon.framework.thread.ThreadSafe;
+
 import org.apache.cocoon.environment.ObjectModelHelper;
 
 /**
@@ -40,11 +39,12 @@
  *
  * @version $Id$
  */
-public class SessionAttributeOutputModule extends AbstractOutputModule implements ThreadSafe
{
+public class SessionAttributeOutputModule extends AbstractOutputModule
+                                          implements ThreadSafe {
     
-    public final String PREFIX = "org.apache.cocoon.components.modules.output.OutputModule";
-    public final String TRANS_PREFIX = "org.apache.cocoon.components.modules.output.OutputModule.SessionAttributeOutputModule.transient";
-    public final String ROLLBACK_LIST = "org.apache.cocoon.components.modules.output.OutputModule.SessionAttributeOutputModule.rollback";
+    public static final String PREFIX = "org.apache.cocoon.components.modules.output.OutputModule";
+    public static final String TRANS_PREFIX = "org.apache.cocoon.components.modules.output.OutputModule.SessionAttributeOutputModule.transient";
+    public static final String ROLLBACK_LIST = "org.apache.cocoon.components.modules.output.OutputModule.SessionAttributeOutputModule.rollback";
     
     /**
      * communicate an attribute value to further processing logic.
@@ -141,9 +141,9 @@
     public void commit( Configuration modeConf, Map objectModel ) {
         if (this.settings.get("isolation-level","0").equals("1")) {
 
-            Logger logger = getLogger();
-            if (logger.isDebugEnabled())
-                logger.debug("prepare commit");
+            if (getLogger().isDebugEnabled()) {
+                getLogger().debug("prepare commit");
+            }
 
             Map aMap = this.prepareCommit(objectModel, TRANS_PREFIX);
             if (aMap == null) {
@@ -156,8 +156,8 @@
             }
             
             String prefix = (String) this.settings.get("key-prefix", PREFIX );
-            if (prefix != "") {
-                prefix = prefix+":";
+            if (prefix.length() > 0) {
+                prefix = prefix + ":";
             } else {
                 prefix = null;
             }
@@ -166,25 +166,28 @@
                 String key = (String) iter.next();
                 Object value = aMap.get(key);
                 if (prefix != null) { key = prefix + key; }
-                if (logger.isDebugEnabled())
-                    logger.debug("committing ['"+key+"'] to ['"+value+"']");
+                if (getLogger().isDebugEnabled()) {
+                    getLogger().debug("committing ['"+key+"'] to ['"+value+"']");
+                }
                 session.setAttribute(key, value);
             }
 
-            if (logger.isDebugEnabled())
-                logger.debug("done commit");
+            if (getLogger().isDebugEnabled()) {
+                getLogger().debug("done commit");
+            }
 
         } else {
-            if (getLogger().isDebugEnabled())
+            if (getLogger().isDebugEnabled()) {
                 getLogger().debug("commit");
-            this.prepareCommit(objectModel, ROLLBACK_LIST);
+            }
+
+            prepareCommit(objectModel, ROLLBACK_LIST);
         }
-        
     }
     
     protected String getName( String name ) {
-        String prefix = (String) this.settings.get("key-prefix", PREFIX );
-        return (prefix == "" ? name : prefix+":"+name);
+        String prefix = (String) this.settings.get("key-prefix", PREFIX);
+        return prefix.length() == 0 ? name : prefix + ":" + name;
     }
 
 }



Mime
View raw message