cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: rev 55969 - in cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/components/treeprocessor: . sitemap
Date Fri, 29 Oct 2004 14:01:55 GMT
Author: cziegeler
Date: Fri Oct 29 07:01:54 2004
New Revision: 55969

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/TreeProcessor.java
   cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/components/treeprocessor/sitemap/ActTypeNode.java
   cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/components/treeprocessor/sitemap/ErrorHandlerHelper.java
   cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/components/treeprocessor/sitemap/MountNode.java
   cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/components/treeprocessor/sitemap/PipelineNode.java
   cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/components/treeprocessor/sitemap/PipelinesNode.java
Log:
Set redirectory during handle errors
Remove some unused imports

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
Fri Oct 29 07:01:54 2004
@@ -246,7 +246,7 @@
                     CocoonComponentManager.leaveEnvironment();
                     // Restore old redirector and resolver
      	            context.setRedirector(oldRedirector);
-                    objectModel.put(PipelinesNode.OBJECT_SOURCE_RESOLVER, oldResolver);
+                    objectModel.put(ProcessingNode.OBJECT_SOURCE_RESOLVER, oldResolver);
     	        }
 
     		} finally {

Modified: cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/components/treeprocessor/TreeProcessor.java
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/components/treeprocessor/TreeProcessor.java
(original)
+++ cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/components/treeprocessor/TreeProcessor.java
Fri Oct 29 07:01:54 2004
@@ -139,12 +139,14 @@
      * @return a new child processor.
      */
     public TreeProcessor createChildProcessor(ComponentManager manager,
-                                              String           actualSource)
+                                              String           actualSource,
+                                              boolean          checkReload)
     throws Exception {
 
         // Note: lifecycle methods aren't called, since this constructors copies all
         // that can be copied from the parent (see above)
         TreeProcessor child = new TreeProcessor(this, manager);
+        child.checkReload = checkReload;
         child.resolver = (SourceResolver)manager.lookup(SourceResolver.ROLE);
         child.source = new DelayedRefreshSourceWrapper(child.resolver.resolveURI(actualSource),
lastModifiedDelay);
         

Modified: cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/components/treeprocessor/sitemap/ActTypeNode.java
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/components/treeprocessor/sitemap/ActTypeNode.java
(original)
+++ cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/components/treeprocessor/sitemap/ActTypeNode.java
Fri Oct 29 07:01:54 2004
@@ -25,7 +25,6 @@
 import org.apache.avalon.framework.component.Composable;
 import org.apache.avalon.framework.parameters.Parameters;
 import org.apache.cocoon.acting.Action;
-import org.apache.cocoon.components.CocoonComponentManager;
 import org.apache.cocoon.components.treeprocessor.InvokeContext;
 import org.apache.cocoon.components.treeprocessor.ParameterizableProcessingNode;
 import org.apache.cocoon.components.treeprocessor.SimpleSelectorProcessingNode;

Modified: cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/components/treeprocessor/sitemap/ErrorHandlerHelper.java
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/components/treeprocessor/sitemap/ErrorHandlerHelper.java
(original)
+++ cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/components/treeprocessor/sitemap/ErrorHandlerHelper.java
Fri Oct 29 07:01:54 2004
@@ -33,7 +33,7 @@
  *
  * @author <a href="mailto:juergen.seitz@basf-it-services.com">J&uuml;rgen Seitz</a>
  * @author <a href="mailto:bluetkemeier@s-und-n.de">Bj&ouml;rn L&uuml;tkemeier</a>
- * @version CVS $Id: ErrorHandlerHelper.java,v 1.5 2004/03/13 22:02:30 unico Exp $
+ * @version CVS $Id$
  */
 public class ErrorHandlerHelper extends AbstractLogEnabled implements Composable {
 
@@ -46,7 +46,10 @@
         this.manager = manager;
     }
 
-    public boolean invokeErrorHandler(ProcessingNode node, Exception ex, Environment env)
+    public boolean invokeErrorHandler(ProcessingNode node, 
+                                      Exception ex, 
+                                      Environment env,
+                                      InvokeContext originalContext)
     throws Exception {
 		Map objectModel = env.getObjectModel();
   	
@@ -81,7 +84,8 @@
 			errorContext = new InvokeContext();
 			errorContext.enableLogging(getLogger());
 			errorContext.compose(this.manager);
-			
+			errorContext.setRedirector(originalContext.getRedirector());
+            
 			nodeSuccessful = node.invoke(env, errorContext);
         } catch (Exception subEx) {
             getLogger().error("An exception occured while handling errors at " + node.getLocation(),
subEx);
@@ -94,10 +98,9 @@
         }
         
         if (nodeSuccessful) {
-        	return true;
-        } else {
-			throw ex;
+            return true;
         }
+        throw ex;
     }
 }
 

Modified: cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/components/treeprocessor/sitemap/MountNode.java
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/components/treeprocessor/sitemap/MountNode.java
(original)
+++ cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/components/treeprocessor/sitemap/MountNode.java
Fri Oct 29 07:01:54 2004
@@ -145,7 +145,7 @@
                 actualSource = source;
             }
 
-            processor = this.parentProcessor.createChildProcessor(this.manager, actualSource);
+            processor = this.parentProcessor.createChildProcessor(this.manager, actualSource,
this.checkReload);
 
             // Associate to the original source
             processors.put(source, processor);

Modified: cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/components/treeprocessor/sitemap/PipelineNode.java
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/components/treeprocessor/sitemap/PipelineNode.java
(original)
+++ cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/components/treeprocessor/sitemap/PipelineNode.java
Fri Oct 29 07:01:54 2004
@@ -154,11 +154,11 @@
             } else if (error404 != null && ex instanceof ResourceNotFoundException)
{
                 // Invoke 404-specific handler
                 handledErrorsLogger.error(ex.getMessage(), ex);
-                return errorHandlerHelper.invokeErrorHandler(error404, ex, env);
+                return errorHandlerHelper.invokeErrorHandler(error404, ex, env, context);
             } else if (error500 != null) {
                 // Invoke global handler
                 handledErrorsLogger.error(ex.getMessage(), ex);
-                return errorHandlerHelper.invokeErrorHandler(error500, ex, env);
+                return errorHandlerHelper.invokeErrorHandler(error500, ex, env, context);
             } else {
                 // No handler : propagate
                 throw ex;

Modified: cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/components/treeprocessor/sitemap/PipelinesNode.java
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/components/treeprocessor/sitemap/PipelinesNode.java
(original)
+++ cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/components/treeprocessor/sitemap/PipelinesNode.java
Fri Oct 29 07:01:54 2004
@@ -22,9 +22,7 @@
 import org.apache.cocoon.components.treeprocessor.InvokeContext;
 import org.apache.cocoon.components.treeprocessor.ProcessingNode;
 import org.apache.cocoon.components.treeprocessor.SimpleParentProcessingNode;
-import org.apache.cocoon.components.treeprocessor.TreeProcessor;
 import org.apache.cocoon.environment.Environment;
-import org.apache.cocoon.environment.Redirector;
 
 /**
  * Handles &lt;map:pipelines&gt;
@@ -46,12 +44,6 @@
     private ProcessingNode errorHandler;
 
     /**
-     * Constructor
-     */
-    public PipelinesNode() {
-    }
-
-    /**
      * Keep the component manager used everywhere in the tree so that we can
      * cleanly dispose it.
      */
@@ -98,11 +90,10 @@
         } catch (Exception ex) {
             if (this.errorHandler != null) {
                 // Invoke pipelines handler
-                return this.errorHandlerHelper.invokeErrorHandler(this.errorHandler, ex,
env);
-            } else {
-                // No handler : propagate
-                throw ex;
-            }
+                return this.errorHandlerHelper.invokeErrorHandler(this.errorHandler, ex,
env, context);
+            } 
+            // No handler : propagate
+            throw ex;
         }
     }
 

Mime
View raw message