dims 01/04/24 12:07:49
Modified: src/org/apache/cocoon/components/language/markup/sitemap/java
Tag: xml-cocoon2 sitemap.xsl
src/org/apache/cocoon/components/pipeline Tag: xml-cocoon2
AbstractEventPipeline.java
CachingEventPipeline.java EventPipeline.java
src/org/apache/cocoon/components/saxconnector Tag:
xml-cocoon2 NullSAXConnector.java SAXConnector.java
XIncludeSAXConnector.java
src/org/apache/cocoon/sitemap Tag: xml-cocoon2
ContentAggregator.java
Log:
- cleanup a bit.
- XIncludeSAXConnector needs Sitemap.
(I don't like this set of changes, but is there an alternative?)
Revision Changes Path
No revision
No revision
1.1.2.104 +3 -1
xml-cocoon/src/org/apache/cocoon/components/language/markup/sitemap/java/Attic/sitemap.xsl
Index: sitemap.xsl
===================================================================
RCS file:
/home/cvs/xml-cocoon/src/org/apache/cocoon/components/language/markup/sitemap/java/Attic/sitemap.xsl,v
retrieving revision 1.1.2.103
retrieving revision 1.1.2.104
diff -u -r1.1.2.103 -r1.1.2.104
--- sitemap.xsl 2001/04/24 18:59:31 1.1.2.103
+++ sitemap.xsl 2001/04/24 19:07:38 1.1.2.104
@@ -98,7 +98,7 @@
*
* @author <a href="mailto:[EMAIL PROTECTED]">Giacomo
Pati</a>
* @author <a href="mailto:[EMAIL PROTECTED]">Berin
Loritsch</a>
- * @version CVS $Id: sitemap.xsl,v 1.1.2.103 2001/04/24 18:59:31 giacomo
Exp $
+ * @version CVS $Id: sitemap.xsl,v 1.1.2.104 2001/04/24 19:07:38 dims
Exp $
*/
public class <xsl:value-of select="@file-name"/> extends AbstractSitemap
{
static final String LOCATION = "<xsl:value-of
select="translate(@file-path, '/', '.')"/>.<xsl:value-of select="@file-name"/>";
@@ -376,6 +376,7 @@
/* the <code>EventPipeline</code> is used to collect the
xml producing sitemap
components and the <code>StreamPipeline</code> to
produce the requested resource */
EventPipeline eventPipeline =
(EventPipeline)this.manager.lookup(Roles.EVENT_PIPELINE);
+ eventPipeline.setSitemap(this);
StreamPipeline pipeline =
(StreamPipeline)this.manager.lookup(Roles.STREAM_PIPELINE);
pipeline.setEventPipeline(eventPipeline);
boolean result = false;
@@ -456,6 +457,7 @@
EventPipeline eventPipeline = null;
try {
eventPipeline =
(EventPipeline)this.manager.lookup(Roles.EVENT_PIPELINE);
+ eventPipeline.setSitemap(this);
pipeline =
(StreamPipeline)this.manager.lookup(Roles.STREAM_PIPELINE);
pipeline.setEventPipeline(eventPipeline);
List listOfMaps = (List)(new ArrayList());
No revision
No revision
1.1.2.6 +12 -1
xml-cocoon/src/org/apache/cocoon/components/pipeline/Attic/AbstractEventPipeline.java
Index: AbstractEventPipeline.java
===================================================================
RCS file:
/home/cvs/xml-cocoon/src/org/apache/cocoon/components/pipeline/Attic/AbstractEventPipeline.java,v
retrieving revision 1.1.2.5
retrieving revision 1.1.2.6
diff -u -r1.1.2.5 -r1.1.2.6
--- AbstractEventPipeline.java 2001/04/20 20:49:59 1.1.2.5
+++ AbstractEventPipeline.java 2001/04/24 19:07:40 1.1.2.6
@@ -30,6 +30,7 @@
import org.apache.cocoon.Roles;
import org.apache.cocoon.components.saxconnector.SAXConnector;
+import org.apache.cocoon.sitemap.Sitemap;
import org.apache.cocoon.sitemap.ErrorNotifier;
import org.xml.sax.SAXException;
@@ -38,7 +39,7 @@
/**
* @author <a href="mailto:[EMAIL PROTECTED]">Giacomo Pati</a>
* @author <a href="mailto:[EMAIL PROTECTED] Ziegeler">Carsten Ziegeler</a>
- * @version CVS $Revision: 1.1.2.5 $ $Date: 2001/04/20 20:49:59 $
+ * @version CVS $Revision: 1.1.2.6 $ $Date: 2001/04/24 19:07:40 $
*/
public abstract class AbstractEventPipeline
extends AbstractXMLProducer
@@ -57,6 +58,9 @@
/** the component manager */
protected ComponentManager manager;
+ /** the sitemap */
+ protected Sitemap sitemap;
+
public void compose (ComponentManager manager)
throws ComponentException {
this.manager = manager;
@@ -64,6 +68,10 @@
transformerSelector =
(ComponentSelector)this.manager.lookup(Roles.TRANSFORMERS);
}
+ public void setSitemap(Sitemap sitemap) {
+ this.sitemap = sitemap;
+ }
+
public void setGenerator (String role, String source, Parameters param,
Exception e)
throws Exception {
this.setGenerator (role, source, param);
@@ -190,6 +198,7 @@
// connect SAXConnector
SAXConnector connect = (SAXConnector)
this.manager.lookup(Roles.SAX_CONNECTOR);
connect.setup((EntityResolver)environment,environment.getObjectModel(),null,null);
+ connect.setSitemap(sitemap);
this.connectors.add(connect);
next = (XMLConsumer) connect;
prev.setConsumer(next);
@@ -204,6 +213,8 @@
// insert SAXConnector
SAXConnector connect = (SAXConnector)
this.manager.lookup(Roles.SAX_CONNECTOR);
+
connect.setup((EntityResolver)environment,environment.getObjectModel(),null,null);
+ connect.setSitemap(sitemap);
this.connectors.add(connect);
next = (XMLConsumer) connect;
prev.setConsumer(next);
1.1.2.8 +4 -1
xml-cocoon/src/org/apache/cocoon/components/pipeline/Attic/CachingEventPipeline.java
Index: CachingEventPipeline.java
===================================================================
RCS file:
/home/cvs/xml-cocoon/src/org/apache/cocoon/components/pipeline/Attic/CachingEventPipeline.java,v
retrieving revision 1.1.2.7
retrieving revision 1.1.2.8
diff -u -r1.1.2.7 -r1.1.2.8
--- CachingEventPipeline.java 2001/04/20 20:50:00 1.1.2.7
+++ CachingEventPipeline.java 2001/04/24 19:07:41 1.1.2.8
@@ -56,7 +56,7 @@
* does not cache! (If it would cache, the response would be cached twice!)
*
* @author <a href="mailto:[EMAIL PROTECTED]">Carsten Ziegeler</a>
- * @version CVS $Revision: 1.1.2.7 $ $Date: 2001/04/20 20:50:00 $
+ * @version CVS $Revision: 1.1.2.8 $ $Date: 2001/04/24 19:07:41 $
*/
public final class CachingEventPipeline
extends AbstractEventPipeline
@@ -315,6 +315,7 @@
// connect SAXConnector
SAXConnector connect = (SAXConnector)
this.manager.lookup(Roles.SAX_CONNECTOR);
connect.setup((EntityResolver)environment,environment.getObjectModel(),null,null);
+ connect.setSitemap(sitemap);
this.connectors.add(connect);
next = (XMLConsumer) connect;
prev.setConsumer(next);
@@ -334,6 +335,8 @@
// insert SAXConnector
SAXConnector connect = (SAXConnector)
this.manager.lookup(Roles.SAX_CONNECTOR);
+
connect.setup((EntityResolver)environment,environment.getObjectModel(),null,null);
+ connect.setSitemap(sitemap);
this.connectors.add(connect);
next = (XMLConsumer) connect;
prev.setConsumer(next);
1.1.2.4 +3 -1
xml-cocoon/src/org/apache/cocoon/components/pipeline/Attic/EventPipeline.java
Index: EventPipeline.java
===================================================================
RCS file:
/home/cvs/xml-cocoon/src/org/apache/cocoon/components/pipeline/Attic/EventPipeline.java,v
retrieving revision 1.1.2.3
retrieving revision 1.1.2.4
diff -u -r1.1.2.3 -r1.1.2.4
--- EventPipeline.java 2001/04/20 20:50:00 1.1.2.3
+++ EventPipeline.java 2001/04/24 19:07:41 1.1.2.4
@@ -16,10 +16,11 @@
import org.apache.cocoon.Processor;
import org.apache.cocoon.environment.Environment;
import org.apache.cocoon.generation.Generator;
+import org.apache.cocoon.sitemap.Sitemap;
/**
* @author <a href="mailto:[EMAIL PROTECTED]">Giacomo Pati</a>
- * @version CVS $Revision: 1.1.2.3 $ $Date: 2001/04/20 20:50:00 $
+ * @version CVS $Revision: 1.1.2.4 $ $Date: 2001/04/24 19:07:41 $
*/
public interface EventPipeline extends Component, Composable, Recyclable,
Processor {
public void setGenerator (String role, String source, Parameters param,
Exception e) throws Exception;
@@ -27,4 +28,5 @@
public Generator getGenerator ();
public void addTransformer (String role, String source, Parameters
param) throws Exception;
public boolean process(Environment environment) throws Exception;
+ public void setSitemap(Sitemap sitemap);
}
No revision
No revision
1.1.2.4 +5 -1
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.3
retrieving revision 1.1.2.4
diff -u -r1.1.2.3 -r1.1.2.4
--- NullSAXConnector.java 2001/04/20 20:50:02 1.1.2.3
+++ NullSAXConnector.java 2001/04/24 19:07:43 1.1.2.4
@@ -7,6 +7,7 @@
import org.apache.avalon.parameters.Parameters;
import org.apache.cocoon.ProcessingException;
+import org.apache.cocoon.sitemap.Sitemap;
import org.xml.sax.SAXException;
import org.xml.sax.EntityResolver;
@@ -17,7 +18,7 @@
/**
* 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.3 $ $Date: 2001/04/20 20:50:02 $
+ * @version CVS $Revision: 1.1.2.4 $ $Date: 2001/04/24 19:07:43 $
*/
public class NullSAXConnector extends AbstractXMLPipe implements Poolable,
SAXConnector {
@@ -28,4 +29,7 @@
// do nothing.
}
+ public void setSitemap(Sitemap sitemap) {
+ // do nothing.
+ }
}
1.1.2.4 +3 -1
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.3
retrieving revision 1.1.2.4
diff -u -r1.1.2.3 -r1.1.2.4
--- SAXConnector.java 2001/04/20 20:50:02 1.1.2.3
+++ SAXConnector.java 2001/04/24 19:07:44 1.1.2.4
@@ -4,13 +4,15 @@
import org.xml.sax.XMLFilter;
import org.apache.avalon.component.Component;
+import org.apache.cocoon.sitemap.Sitemap;
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.3 $ $Date: 2001/04/20 20:50:02 $
+ * @version CVS $Revision: 1.1.2.4 $ $Date: 2001/04/24 19:07:44 $
*/
public interface SAXConnector extends XMLPipe, Component,
SitemapModelComponent {
+ public void setSitemap(Sitemap sitemap);
}
1.1.2.2 +12 -2
xml-cocoon/src/org/apache/cocoon/components/saxconnector/Attic/XIncludeSAXConnector.java
Index: XIncludeSAXConnector.java
===================================================================
RCS file:
/home/cvs/xml-cocoon/src/org/apache/cocoon/components/saxconnector/Attic/XIncludeSAXConnector.java,v
retrieving revision 1.1.2.1
retrieving revision 1.1.2.2
diff -u -r1.1.2.1 -r1.1.2.2
--- XIncludeSAXConnector.java 2001/04/24 14:12:38 1.1.2.1
+++ XIncludeSAXConnector.java 2001/04/24 19:07:44 1.1.2.2
@@ -27,6 +27,7 @@
import org.apache.cocoon.components.url.URLFactory;
import org.apache.cocoon.xml.AbstractXMLPipe;
import org.apache.cocoon.ProcessingException;
+import org.apache.cocoon.sitemap.Sitemap;
import org.xml.sax.SAXException;
import org.xml.sax.EntityResolver;
@@ -37,7 +38,7 @@
/**
* Copy of code from XIncludeTransformer as a starting point for
XIncludeSAXConnector.
* @author <a href="[EMAIL PROTECTED]">Davanum Srinivas</a>
- * @version CVS $Revision: 1.1.2.1 $ $Date: 2001/04/24 14:12:38 $
+ * @version CVS $Revision: 1.1.2.2 $ $Date: 2001/04/24 19:07:44 $
*/
public class XIncludeSAXConnector extends AbstractXMLPipe implements
Composable, Poolable, SAXConnector, Disposable {
@@ -53,6 +54,10 @@
public static final String XINCLUDE_INCLUDE_ELEMENT_HREF_ATTRIBUTE =
"href";
public static final String XINCLUDE_INCLUDE_ELEMENT_PARSE_ATTRIBUTE =
"parse";
+
+ /** the current sitemap */
+ protected Sitemap sitemap;
+
protected URL base_xmlbase_uri = null;
/** The current XMLBase URI. We start with an empty "dummy" URL. **/
@@ -84,6 +89,10 @@
}
}
+ public void setSitemap(Sitemap sitemap) {
+ this.sitemap = sitemap;
+ }
+
public void startElement(String uri, String name, String raw, Attributes
attr) throws SAXException {
String value;
if ((value = attr.getValue(XMLBASE_NAMESPACE_URI,XMLBASE_ATTRIBUTE))
!= null) {
@@ -155,7 +164,8 @@
}
protected void processXIncludeElement(String href, String parse) throws
SAXException,MalformedURLException,IOException {
- getLogger().debug("Processing XInclude element: href="+href+",
parse="+parse);
+ getLogger().debug("Processing XInclude element: href="+href+",
parse="+parse+", sitemap="+sitemap);
+ //System.out.println("Processing XInclude element: href="+href+",
parse="+parse+", sitemap="+sitemap);
}
public void dispose()
No revision
No revision
1.1.2.5 +2 -21
xml-cocoon/src/org/apache/cocoon/sitemap/Attic/ContentAggregator.java
Index: ContentAggregator.java
===================================================================
RCS file:
/home/cvs/xml-cocoon/src/org/apache/cocoon/sitemap/Attic/ContentAggregator.java,v
retrieving revision 1.1.2.4
retrieving revision 1.1.2.5
diff -u -r1.1.2.4 -r1.1.2.5
--- ContentAggregator.java 2001/04/22 08:13:37 1.1.2.4
+++ ContentAggregator.java 2001/04/24 19:07:47 1.1.2.5
@@ -41,7 +41,7 @@
/**
* @author <a href="mailto:[EMAIL PROTECTED]">Giacomo Pati</a>
- * @version CVS $Id: ContentAggregator.java,v 1.1.2.4 2001/04/22 08:13:37
giacomo Exp $
+ * @version CVS $Id: ContentAggregator.java,v 1.1.2.5 2001/04/24 19:07:47
dims Exp $
*/
public class ContentAggregator extends ContentHandlerWrapper
@@ -49,9 +49,6 @@
/** the current sitemap */
protected Sitemap sitemap;
- /** the root sitemap */
- protected Sitemap rootSitemap;
-
/** the root element of the aggregated content */
protected String rootElement;
@@ -160,6 +157,7 @@
+ (String)this.partURIs.get(i));
try {
eventPipeline =
(EventPipeline)this.manager.lookup(Roles.EVENT_PIPELINE);
+ eventPipeline.setSitemap(this.sitemap);
this.partEventPipelines.add(eventPipeline);
pipeline =
(StreamPipeline)this.manager.lookup(Roles.STREAM_PIPELINE);
} catch (ComponentException cme) {
@@ -193,14 +191,6 @@
* @return The generated key hashes the src
*/
public long generateKey() {
- try {
- collectParts();
- } catch (Exception e) {
- getLogger().error ("cannot collect pipeline parts", e);
- }
- //if (this.systemID.startsWith("file:") == true) {
- // return HashUtil.hash(super.source);
- //}
return 0;
}
@@ -211,10 +201,6 @@
* component is currently not cacheable.
*/
public CacheValidity generateValidity() {
- //if (this.systemID.startsWith("file:") == true) {
- // File xmlFile = new
File(this.systemID.substring("file:".length()));
- // return new TimeStampCacheValidity(xmlFile.lastModified());
- //}
return null;
}
@@ -226,10 +212,6 @@
this.sitemap = sitemap;
}
- public void setRootSitemap(Sitemap sitemap) {
- this.rootSitemap = sitemap;
- }
-
public void setRootElement(String element, String namespace) {
this.rootElement = element;
if (namespace == null) {
@@ -284,7 +266,6 @@
public void recycle () {
super.recycle();
this.sitemap = null;
- this.rootSitemap = null;
this.resolver = null;
this.objectModel = null;
this.source = null;
----------------------------------------------------------------------
In case of troubles, e-mail: [EMAIL PROTECTED]
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]