prussell 01/04/09 14:25:56
Modified: src/org/apache/cocoon/components/pipeline Tag: xml-cocoon2
NonCachingEventPipeline.java
src/org/apache/cocoon/components/saxconnector Tag:
xml-cocoon2 NullSAXConnector.java SAXConnector.java
Log:
Added component setup stage for SAXConnectors. Preliminary requirement for
IncludeSAXConnector which will form the foundation of the content
aggregation functionality within Cocoon2.
Revision Changes Path
No revision
No revision
1.1.2.2 +14 -3
xml-cocoon/src/org/apache/cocoon/components/pipeline/Attic/NonCachingEventPipeline.java
Index: NonCachingEventPipeline.java
===================================================================
RCS file:
/home/cvs/xml-cocoon/src/org/apache/cocoon/components/pipeline/Attic/NonCachingEventPipeline.java,v
retrieving revision 1.1.2.1
retrieving revision 1.1.2.2
diff -u -r1.1.2.1 -r1.1.2.2
--- NonCachingEventPipeline.java 2001/04/04 15:42:42 1.1.2.1
+++ NonCachingEventPipeline.java 2001/04/09 21:25:54 1.1.2.2
@@ -36,7 +36,7 @@
/**
* @author <a href="mailto:[EMAIL PROTECTED]">Giacomo Pati</a>
- * @version CVS $Revision: 1.1.2.1 $ $Date: 2001/04/04 15:42:42 $
+ * @version CVS $Revision: 1.1.2.2 $ $Date: 2001/04/09 21:25:54 $
*/
public class NonCachingEventPipeline extends AbstractXMLProducer implements
EventPipeline {
private Generator generator;
@@ -90,7 +90,7 @@
}
setupPipeline(environment);
- connectPipeline();
+ connectPipeline(environment);
// execute the pipeline:
try {
@@ -168,7 +168,7 @@
/** Connect the pipeline.
*/
- private void connectPipeline() throws ProcessingException {
+ private void connectPipeline(Environment environment) throws
ProcessingException {
XMLProducer prev = (XMLProducer) this.generator;
XMLConsumer next;
@@ -177,6 +177,7 @@
while ( itt.hasNext() ) {
// connect SAXConnector
SAXConnector connect = (SAXConnector)
this.manager.lookup(Roles.SAX_CONNECTOR);
+
connect.setup((EntityResolver)environment,environment.getObjectModel(),null,null);
this.connectors.add(connect);
next = (XMLConsumer) connect;
prev.setConsumer(next);
@@ -198,6 +199,16 @@
// insert this consumer
prev.setConsumer(super.xmlConsumer);
+ } catch ( IOException e ) {
+ throw new ProcessingException(
+ "Could not connect pipeline.",
+ e
+ );
+ } catch ( SAXException e ) {
+ throw new ProcessingException(
+ "Could not connect pipeline.",
+ e
+ );
} catch ( ComponentManagerException e ) {
throw new ProcessingException(
"Could not connect pipeline.",
No revision
No revision
1.1.2.2 +18 -2
xml-cocoon/src/org/apache/cocoon/components/saxconnector/Attic/NullSAXConnector.java
Index: NullSAXConnector.java
===================================================================
RCS file:
/home/cvs/xml-cocoon/src/org/apache/cocoon/components/saxconnector/Attic/NullSAXConnector.java,v
retrieving revision 1.1.2.1
retrieving revision 1.1.2.2
diff -u -r1.1.2.1 -r1.1.2.2
--- NullSAXConnector.java 2001/03/03 15:56:38 1.1.2.1
+++ NullSAXConnector.java 2001/04/09 21:25:55 1.1.2.2
@@ -2,14 +2,30 @@
package org.apache.cocoon.components.saxconnector;
-import org.xml.sax.helpers.XMLFilterImpl;
import org.apache.cocoon.xml.AbstractXMLPipe;
import org.apache.avalon.Poolable;
+import org.apache.avalon.configuration.Parameters;
+import org.apache.cocoon.ProcessingException;
+
+import org.xml.sax.SAXException;
+import org.xml.sax.EntityResolver;
+
+import java.util.Map;
+import java.io.IOException;
+
/**
* Null implementation of the SAXConnector. Simply sends events on to the
next component in the pipeline.
* @author <a href="[EMAIL PROTECTED]">Paul Russell</a>
- * @version CVS $Revision: 1.1.2.1 $ $Date: 2001/03/03 15:56:38 $
+ * @version CVS $Revision: 1.1.2.2 $ $Date: 2001/04/09 21:25:55 $
*/
public class NullSAXConnector extends AbstractXMLPipe implements Poolable,
SAXConnector {
+
+ /** Setup this SAXConnector.
+ */
+ public void setup(EntityResolver resolver, Map objectModel, String src,
Parameters params)
+ throws ProcessingException, SAXException, IOException {
+ // do nothing.
+ }
+
}
1.1.2.2 +3 -2
xml-cocoon/src/org/apache/cocoon/components/saxconnector/Attic/SAXConnector.java
Index: SAXConnector.java
===================================================================
RCS file:
/home/cvs/xml-cocoon/src/org/apache/cocoon/components/saxconnector/Attic/SAXConnector.java,v
retrieving revision 1.1.2.1
retrieving revision 1.1.2.2
diff -u -r1.1.2.1 -r1.1.2.2
--- SAXConnector.java 2001/03/03 15:56:36 1.1.2.1
+++ SAXConnector.java 2001/04/09 21:25:55 1.1.2.2
@@ -4,12 +4,13 @@
import org.xml.sax.XMLFilter;
import org.apache.avalon.Component;
+import org.apache.cocoon.sitemap.SitemapModelComponent;
import org.apache.cocoon.xml.XMLPipe;
/**
* Provides a connection between SAX components.
* @author <a href="mailto:[EMAIL PROTECTED]">Paul Russell</a>
- * @version CVS $Revision: 1.1.2.1 $ $Date: 2001/03/03 15:56:36 $
+ * @version CVS $Revision: 1.1.2.2 $ $Date: 2001/04/09 21:25:55 $
*/
-public interface SAXConnector extends XMLPipe, Component {
+public interface SAXConnector extends XMLPipe, Component,
SitemapModelComponent {
}
----------------------------------------------------------------------
In case of troubles, e-mail: [EMAIL PROTECTED]
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]