unico 2003/11/16 10:27:27
Modified: src/java/org/apache/cocoon/components/treeprocessor
TreeProcessor.java
Log:
put back buildPipeline and getRootProcessor implementations
Revision Changes Path
1.26 +30 -7
cocoon-2.2/src/java/org/apache/cocoon/components/treeprocessor/TreeProcessor.java
Index: TreeProcessor.java
===================================================================
RCS file:
/home/cvs/cocoon-2.2/src/java/org/apache/cocoon/components/treeprocessor/TreeProcessor.java,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -r1.25 -r1.26
--- TreeProcessor.java 16 Nov 2003 14:24:58 -0000 1.25
+++ TreeProcessor.java 16 Nov 2003 18:27:27 -0000 1.26
@@ -89,7 +89,6 @@
import org.apache.excalibur.source.SourceResolver;
import org.apache.excalibur.xml.sax.SAXParser;
import org.apache.excalibur.xml.xslt.XSLTProcessor;
-import org.xml.sax.InputSource;
/**
*
@@ -107,6 +106,9 @@
/** Environment attribute key for redirection status communication */
public static final String COCOON_REDIRECT_ATTR = "cocoon: redirect url";
+ /** The sitemap namespace */
+ public static final String SITEMAP_NS =
"http://apache.org/cocoon/sitemap/1.0";
+
/** The xsl transformation location for turning a sitemap into a
Fortress container configuration */
private static final String SITEMAP2XCONF_URL =
"resource://org.apache.cocoon.components.treeprocessor.sitemap2xconf.xsl";
@@ -366,12 +368,25 @@
return processor.process(newEnv, context);
}
- /* (non-Javadoc)
- * @see
org.apache.cocoon.Processor#buildPipeline(org.apache.cocoon.environment.Environment)
+ /**
+ * Process the given <code>Environment</code> to assemble
+ * a <code>ProcessingPipeline</code>.
+ * @since 2.1
*/
public ProcessingPipeline buildPipeline(Environment environment) throws
Exception {
- // TODO Auto-generated method stub
- return null;
+ InvokeContext context = new InvokeContext( true );
+
+ context.enableLogging(getLogger());
+
+ try {
+ if ( process(environment, context) ) {
+ return context.getProcessingPipeline();
+ } else {
+ return null;
+ }
+ } finally {
+ context.dispose();
+ }
}
/**
@@ -389,10 +404,18 @@
}
/**
- * TODO: why do me need this?
+ * TODO: do we still need this?
+ *
+ * Get the root parent of this processor
+ * @since 2.1.1
*/
public Processor getRootProcessor() {
- return null;
+ TreeProcessor result = this;
+ while(result.m_parent != null) {
+ result = result.m_parent;
+ }
+
+ return result;
}
public EnvironmentHelper getEnvironmentHelper() {