You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@cocoon.apache.org by cz...@apache.org on 2002/03/11 12:15:27 UTC
cvs commit: xml-cocoon2/src/scratchpad/src/org/apache/cocoon/sunshine/xml XMLUtil.java
cziegeler 02/03/11 03:15:27
Modified: src/java/org/apache/cocoon/transformation
XIncludeTransformer.java
src/java/org/apache/cocoon/xml IncludeXMLConsumer.java
src/scratchpad/src/org/apache/cocoon/sunshine/connector
ResourceConnectorImpl.java
src/scratchpad/src/org/apache/cocoon/sunshine/context
RequestSessionContext.java
SimpleSessionContext.java
src/scratchpad/src/org/apache/cocoon/sunshine/sunrise
SunRise.java
src/scratchpad/src/org/apache/cocoon/sunshine/sunspot
SunSpot.java
src/scratchpad/src/org/apache/cocoon/sunshine/sunspot/context
SessionContextImpl.java
src/scratchpad/src/org/apache/cocoon/sunshine/sunspot/sunlet
SunLetThread.java
src/scratchpad/src/org/apache/cocoon/sunshine/transformation
AbstractSunShineTransformer.java
src/scratchpad/src/org/apache/cocoon/sunshine/xml
XMLUtil.java
Removed: src/scratchpad/src/org/apache/cocoon/sunshine/util
IncludeFilter.java
Log:
Merged IncludeXMLConsumer with IncludeFilter and removed IncludeFilter
Revision Changes Path
1.10 +1 -2 xml-cocoon2/src/java/org/apache/cocoon/transformation/XIncludeTransformer.java
Index: XIncludeTransformer.java
===================================================================
RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/transformation/XIncludeTransformer.java,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- XIncludeTransformer.java 22 Feb 2002 07:03:56 -0000 1.9
+++ XIncludeTransformer.java 11 Mar 2002 11:15:25 -0000 1.10
@@ -83,7 +83,7 @@
* by the SAX event FSM yet.
*
* @author <a href="mailto:balld@webslingerZ.com">Donald Ball</a>
- * @version CVS $Id: XIncludeTransformer.java,v 1.9 2002/02/22 07:03:56 cziegeler Exp $
+ * @version CVS $Id: XIncludeTransformer.java,v 1.10 2002/03/11 11:15:25 cziegeler Exp $
*/
public class XIncludeTransformer extends AbstractTransformer implements Composable, Disposable {
@@ -307,7 +307,6 @@
}
} else {
IncludeXMLConsumer xinclude_handler = new IncludeXMLConsumer(super.contentHandler,super.lexicalHandler);
- xinclude_handler.setLogger(getLogger());
parser.parse(input, xinclude_handler);
}
} catch(SAXException e) {
1.6 +88 -6 xml-cocoon2/src/java/org/apache/cocoon/xml/IncludeXMLConsumer.java
Index: IncludeXMLConsumer.java
===================================================================
RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/xml/IncludeXMLConsumer.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- IncludeXMLConsumer.java 11 Mar 2002 09:30:35 -0000 1.5
+++ IncludeXMLConsumer.java 11 Mar 2002 11:15:25 -0000 1.6
@@ -50,11 +50,16 @@
*/
package org.apache.cocoon.xml;
+import javax.xml.transform.Transformer;
+import javax.xml.transform.TransformerFactory;
+import javax.xml.transform.dom.DOMSource;
+import javax.xml.transform.sax.SAXResult;
import org.xml.sax.Attributes;
import org.xml.sax.ContentHandler;
import org.xml.sax.Locator;
import org.xml.sax.SAXException;
import org.xml.sax.ext.LexicalHandler;
+import org.w3c.dom.Node;
/**
* A special purpose <code>XMLConsumer</code> used for including files.
@@ -64,27 +69,89 @@
*
* @author <a href="mailto:bloritsch@apache.org>Berin Loritsch</a>
* @author <a href="mailto:cziegeler@apache.org>Carsten Ziegeler</a>
- * @version CVS $Id: IncludeXMLConsumer.java,v 1.5 2002/03/11 09:30:35 cziegeler Exp $
+ * @version CVS $Id: IncludeXMLConsumer.java,v 1.6 2002/03/11 11:15:25 cziegeler Exp $
*/
-public class IncludeXMLConsumer extends AbstractXMLConsumer {
+public class IncludeXMLConsumer implements XMLConsumer {
+
+ /** The TrAX factory for serializing xml */
+ final private static TransformerFactory transformerFactory = TransformerFactory.newInstance();
+
final private ContentHandler contentHandler;
final private LexicalHandler lexicalHandler;
+ private boolean ignoreEmptyCharacters = false;
+ private boolean ignoreRootElement = false;
+ private int ignoreRootElementCount;
+
+ /**
+ * Constructor
+ */
public IncludeXMLConsumer (XMLConsumer consumer) {
this.contentHandler = consumer;
this.lexicalHandler = consumer;
}
+ /**
+ * Constructor
+ */
public IncludeXMLConsumer (ContentHandler contentHandler, LexicalHandler lexicalHandler) {
this.contentHandler = contentHandler;
this.lexicalHandler = lexicalHandler;
}
+ /**
+ * Constructor
+ */
public IncludeXMLConsumer (ContentHandler contentHandler) {
this.contentHandler = contentHandler;
this.lexicalHandler = null;
}
+ /**
+ * Include a node into the current chain.
+ * @param docfrag The DocumentFragment to be included
+ * @param contentHandler The SAX ContentHandler receiving the information
+ * @param lexicalHandler The SAX LexicalHandler receiving the information (optional)
+ */
+ public static void includeNode(Node node,
+ ContentHandler contentHandler,
+ LexicalHandler lexicalHandler)
+ throws SAXException {
+ if (node != null) {
+ try {
+ IncludeXMLConsumer filter = new IncludeXMLConsumer(contentHandler, lexicalHandler);
+ Transformer transformer = transformerFactory.newTransformer();
+ DOMSource source = new DOMSource(node);
+ SAXResult result = new SAXResult(filter);
+ result.setLexicalHandler(filter);
+ transformer.transform(source, result);
+ } catch (javax.xml.transform.TransformerConfigurationException e) {
+ throw new SAXException("TransformerConfigurationException", e);
+ } catch (javax.xml.transform.TransformerException e) {
+ throw new SAXException("TransformerException", e);
+ }
+ }
+ }
+
+ /**
+ * Controll SAX EventHandling
+ * If set to <CODE>true</CODE> all empty characters events are ignored.
+ * The default is <CODE>false</CODE>.
+ */
+ public void setIgnoreEmptyCharacters(boolean value) {
+ this.ignoreEmptyCharacters = value;
+ }
+
+ /**
+ * Controll SAX EventHandling
+ * If set to <CODE>true</CODE> the root element is ignored.
+ * The default is <CODE>false</CODE>.
+ */
+ public void setIgnoreRootElement(boolean value) {
+ this.ignoreRootElement = value;
+ this.ignoreRootElementCount = 0;
+ }
+
public void setDocumentLocator(Locator loc) {
this.contentHandler.setDocumentLocator(loc);
}
@@ -106,19 +173,34 @@
}
public void startElement(String uri, String local, String qName, Attributes attr) throws SAXException {
- this.contentHandler.startElement(uri, local, qName, attr);
+ if (this.ignoreRootElement == false ||
+ this.ignoreRootElementCount > 0) {
+ this.contentHandler.startElement(uri,local,qName,attr);
+ }
+ this.ignoreRootElementCount++;
}
public void endElement(String uri, String local, String qName) throws SAXException {
- this.contentHandler.endElement(uri, local, qName);
+ this.ignoreRootElementCount--;
+ if ( !this.ignoreRootElement || this.ignoreRootElementCount > 0) {
+ this.contentHandler.endElement(uri, local, qName);
+ }
}
public void characters(char[] ch, int start, int end) throws SAXException {
- this.contentHandler.characters(ch, start, end);
+
+ if ( this.ignoreEmptyCharacters ) {
+ String text = new String(ch, start, end).trim();
+ if (text.length() > 0) this.contentHandler.characters(text.toCharArray(),0,text.length());
+ } else {
+ this.contentHandler.characters(ch, start, end);
+ }
}
public void ignorableWhitespace(char[] ch, int start, int end) throws SAXException {
- this.contentHandler.ignorableWhitespace(ch, start, end);
+ if ( !this.ignoreEmptyCharacters ) {
+ this.contentHandler.ignorableWhitespace(ch, start, end);
+ }
}
public void processingInstruction(String name, String value) throws SAXException {
1.3 +8 -8 xml-cocoon2/src/scratchpad/src/org/apache/cocoon/sunshine/connector/ResourceConnectorImpl.java
Index: ResourceConnectorImpl.java
===================================================================
RCS file: /home/cvs/xml-cocoon2/src/scratchpad/src/org/apache/cocoon/sunshine/connector/ResourceConnectorImpl.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- ResourceConnectorImpl.java 22 Feb 2002 06:57:17 -0000 1.2
+++ ResourceConnectorImpl.java 11 Mar 2002 11:15:25 -0000 1.3
@@ -84,7 +84,7 @@
import org.apache.cocoon.xml.XMLConsumer;
import org.apache.cocoon.xml.dom.DOMBuilder;
import org.apache.cocoon.sunshine.helpers.URLRewriter;
-import org.apache.cocoon.sunshine.util.IncludeFilter;
+import org.apache.cocoon.xml.IncludeXMLConsumer;
import org.apache.cocoon.sunshine.xml.XMLUtil;
import org.w3c.dom.*;
@@ -97,7 +97,7 @@
* The Component for loading and saving xml to external resource connectors.
*
* @author <a href="mailto:cziegeler@s-und-n.de">Carsten Ziegeler</a>
- * @version CVS $Id: ResourceConnectorImpl.java,v 1.2 2002/02/22 06:57:17 cziegeler Exp $
+ * @version CVS $Id: ResourceConnectorImpl.java,v 1.3 2002/03/11 11:15:25 cziegeler Exp $
*/
public final class ResourceConnectorImpl
extends AbstractLoggable
@@ -282,16 +282,16 @@
builder.startDocument();
builder.startElement("", "sunShine", "sunShine", this.emptyAttributes);
- IncludeFilter filter;
+ IncludeXMLConsumer filter;
// Test for url rewriting
if (typeParameters != null
&& typeParameters.getParameter(URLRewriter.PARAMETER_MODE, null) != null) {
XMLConsumer consumer = new URLRewriter(typeParameters,
builder,
builder);
- filter = new IncludeFilter(consumer, consumer);
+ filter = new IncludeXMLConsumer(consumer, consumer);
} else {
- filter = new IncludeFilter(builder, builder);
+ filter = new IncludeXMLConsumer(builder, builder);
}
Source input = null;
try {
@@ -486,7 +486,7 @@
builder.startDocument();
builder.startElement("", "sunShine", "sunShine", this.emptyAttributes);
- IncludeFilter filter = new IncludeFilter(builder, builder);
+ IncludeXMLConsumer filter = new IncludeXMLConsumer(builder, builder);
input.toSAX(filter);
builder.endElement("", "sunShine", "sunShine");
@@ -728,7 +728,7 @@
try {
input = this.resolver.resolve(fileName);
- IncludeFilter filter = new IncludeFilter(contentHandler, lexicalHandler);
+ IncludeXMLConsumer filter = new IncludeXMLConsumer(contentHandler, lexicalHandler);
input.toSAX(filter);
} catch (SAXException sax) {
@@ -776,7 +776,7 @@
contentHandler = consumer;
lexicalHandler = consumer;
}
- IncludeFilter filter = new IncludeFilter(contentHandler, lexicalHandler);
+ IncludeXMLConsumer filter = new IncludeXMLConsumer(contentHandler, lexicalHandler);
Source input = null;
try {
1.4 +3 -3 xml-cocoon2/src/scratchpad/src/org/apache/cocoon/sunshine/context/RequestSessionContext.java
Index: RequestSessionContext.java
===================================================================
RCS file: /home/cvs/xml-cocoon2/src/scratchpad/src/org/apache/cocoon/sunshine/context/RequestSessionContext.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- RequestSessionContext.java 22 Feb 2002 06:57:17 -0000 1.3
+++ RequestSessionContext.java 11 Mar 2002 11:15:26 -0000 1.4
@@ -65,7 +65,7 @@
import org.apache.cocoon.environment.http.HttpRequest;
import org.apache.cocoon.sunshine.SunShineConstants;
import org.apache.cocoon.sunshine.connector.Resource;
-import org.apache.cocoon.sunshine.util.IncludeFilter;
+import org.apache.cocoon.xml.IncludeXMLConsumer;
import org.apache.cocoon.sunshine.xml.XMLUtil;
import org.w3c.dom.Document;
@@ -145,7 +145,7 @@
* - getLocales()
*
* @author <a href="mailto:cziegeler@s-und-n.de">Carsten Ziegeler</a>
- * @version CVS $Id: RequestSessionContext.java,v 1.3 2002/02/22 06:57:17 cziegeler Exp $
+ * @version CVS $Id: RequestSessionContext.java,v 1.4 2002/03/11 11:15:26 cziegeler Exp $
*/
public final class RequestSessionContext
implements SessionContext {
@@ -636,7 +636,7 @@
NodeList childs = list.item(i).getChildNodes();
if (childs != null) {
for(int m = 0; m < childs.getLength(); m++) {
- IncludeFilter.includeNode(childs.item(m), contentHandler, lexicalHandler);
+ IncludeXMLConsumer.includeNode(childs.item(m), contentHandler, lexicalHandler);
}
}
}
1.3 +3 -3 xml-cocoon2/src/scratchpad/src/org/apache/cocoon/sunshine/context/SimpleSessionContext.java
Index: SimpleSessionContext.java
===================================================================
RCS file: /home/cvs/xml-cocoon2/src/scratchpad/src/org/apache/cocoon/sunshine/context/SimpleSessionContext.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- SimpleSessionContext.java 22 Feb 2002 06:57:17 -0000 1.2
+++ SimpleSessionContext.java 11 Mar 2002 11:15:26 -0000 1.3
@@ -76,14 +76,14 @@
import org.apache.cocoon.environment.SourceResolver;
import org.apache.cocoon.sunshine.connector.ResourceConnector;
import org.apache.cocoon.sunshine.connector.Resource;
-import org.apache.cocoon.sunshine.util.*;
import org.apache.cocoon.sunshine.xml.*;
+import org.apache.cocoon.xml.IncludeXMLConsumer;
/**
* This is a simple implementation of the session context.
*
* @author <a href="mailto:cziegeler@s-und-n.de">Carsten Ziegeler</a>
- * @version CVS $Id: SimpleSessionContext.java,v 1.2 2002/02/22 06:57:17 cziegeler Exp $
+ * @version CVS $Id: SimpleSessionContext.java,v 1.3 2002/03/11 11:15:26 cziegeler Exp $
*/
public final class SimpleSessionContext
implements SessionContext {
@@ -471,7 +471,7 @@
NodeList childs = list.item(i).getChildNodes();
if (childs != null) {
for(int m = 0; m < childs.getLength(); m++) {
- IncludeFilter.includeNode(childs.item(m), contentHandler, lexicalHandler);
+ IncludeXMLConsumer.includeNode(childs.item(m), contentHandler, lexicalHandler);
}
}
}
1.3 +6 -6 xml-cocoon2/src/scratchpad/src/org/apache/cocoon/sunshine/sunrise/SunRise.java
Index: SunRise.java
===================================================================
RCS file: /home/cvs/xml-cocoon2/src/scratchpad/src/org/apache/cocoon/sunshine/sunrise/SunRise.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- SunRise.java 22 Feb 2002 06:57:18 -0000 1.2
+++ SunRise.java 11 Mar 2002 11:15:26 -0000 1.3
@@ -87,7 +87,7 @@
import org.apache.cocoon.sunshine.context.SimpleSessionContext;
import org.apache.cocoon.sunshine.connector.ResourceConnector;
import org.apache.cocoon.sunshine.connector.Resource;
-import org.apache.cocoon.sunshine.util.IncludeFilter;
+import org.apache.cocoon.xml.IncludeXMLConsumer;
import org.apache.cocoon.sunshine.xml.XMLUtil;
import org.apache.cocoon.sunshine.util.AvalonUtil;
import org.apache.cocoon.sunshine.sunrise.context.SessionContextImpl;
@@ -97,7 +97,7 @@
* This is the basis sunShine component.
*
* @author <a href="mailto:cziegeler@s-und-n.de">Carsten Ziegeler</a>
- * @version CVS $Id: SunRise.java,v 1.2 2002/02/22 06:57:18 cziegeler Exp $
+ * @version CVS $Id: SunRise.java,v 1.3 2002/03/11 11:15:26 cziegeler Exp $
*/
public final class SunRise
extends AbstractSunShineComponent
@@ -549,7 +549,7 @@
NodeList childs = users.getChildNodes();
for(int i = 0; i < childs.getLength(); i++) {
if (childs.item(i).getNodeType() == Node.ELEMENT_NODE)
- IncludeFilter.includeNode(childs.item(i), consumer, consumer);
+ IncludeXMLConsumer.includeNode(childs.item(i), consumer, consumer);
}
}
consumer.endElement("", "uservalues", "uservalues");
@@ -592,7 +592,7 @@
NodeList childs = users.getChildNodes();
for(int i = 0; i < childs.getLength(); i++) {
if (childs.item(i).getNodeType() == Node.ELEMENT_NODE)
- IncludeFilter.includeNode(childs.item(i), consumer, consumer);
+ IncludeXMLConsumer.includeNode(childs.item(i), consumer, consumer);
}
}
consumer.endElement("", "uservalues", "uservalues");
@@ -624,7 +624,7 @@
} catch (javax.xml.transform.TransformerException local) {
throw new ProcessingException("TransformerException: " + local, local);
}
- IncludeFilter.includeNode(users, consumer, consumer);
+ IncludeXMLConsumer.includeNode(users, consumer, consumer);
}
if (isAdmin == true) {
@@ -636,7 +636,7 @@
} catch (javax.xml.transform.TransformerException local) {
throw new ProcessingException("TransformerException: " + local, local);
}
- IncludeFilter.includeNode(roles, consumer, consumer);
+ IncludeXMLConsumer.includeNode(roles, consumer, consumer);
// include selected role
String role = (String)context.getAttribute(SunRise.SESSION_CONTEXT_ATTRIBUTE_ADMIN_ROLE);
1.3 +19 -19 xml-cocoon2/src/scratchpad/src/org/apache/cocoon/sunshine/sunspot/SunSpot.java
Index: SunSpot.java
===================================================================
RCS file: /home/cvs/xml-cocoon2/src/scratchpad/src/org/apache/cocoon/sunshine/sunspot/SunSpot.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- SunSpot.java 22 Feb 2002 06:57:18 -0000 1.2
+++ SunSpot.java 11 Mar 2002 11:15:26 -0000 1.3
@@ -79,7 +79,7 @@
import org.apache.cocoon.sunshine.connector.Resource;
import org.apache.cocoon.sunshine.context.SessionContext;
import org.apache.cocoon.sunshine.context.SessionContextProvider;
-import org.apache.cocoon.sunshine.util.IncludeFilter;
+import org.apache.cocoon.xml.IncludeXMLConsumer;
import org.apache.cocoon.sunshine.util.AvalonUtil;
import org.apache.cocoon.sunshine.xml.XMLUtil;
import org.apache.cocoon.sunshine.sunrise.SunRise;
@@ -105,7 +105,7 @@
* This is the basis sunSpot component
*
* @author <a href="mailto:cziegeler@s-und-n.de">Carsten Ziegeler</a>
- * @version CVS $Id: SunSpot.java,v 1.2 2002/02/22 06:57:18 cziegeler Exp $
+ * @version CVS $Id: SunSpot.java,v 1.3 2002/03/11 11:15:26 cziegeler Exp $
*/
public final class SunSpot
extends AbstractSunShineComponent {
@@ -555,7 +555,7 @@
DocumentFragment rolesDF = this.getSunRise().getRoles();
Node roles = null;
if (rolesDF != null) roles = XMLUtil.getSingleNode(rolesDF, "roles");
- IncludeFilter.includeNode(roles, consumer, consumer);
+ IncludeXMLConsumer.includeNode(roles, consumer, consumer);
}
if (state.equals(Constants.STATE_MAIN_ROLE) == true) {
@@ -563,7 +563,7 @@
DocumentFragment rolesDF = this.getSunRise().getRoles();
Node roles = null;
if (rolesDF != null) roles = XMLUtil.getSingleNode(rolesDF, "roles");
- IncludeFilter.includeNode(roles, consumer, consumer);
+ IncludeXMLConsumer.includeNode(roles, consumer, consumer);
String role = this.request.getParameter(SunSpot.REQ_PARAMETER_ROLE);
if (role == null) {
@@ -578,7 +578,7 @@
DocumentFragment userDF = this.getSunRise().getUsers(role, null);
Node users = null;
if (userDF != null) users = XMLUtil.getSingleNode(userDF, "users");
- IncludeFilter.includeNode(users, consumer, consumer);
+ IncludeXMLConsumer.includeNode(users, consumer, consumer);
this.sendEndElementEvent(consumer, "roleusers");
}
}
@@ -645,7 +645,7 @@
if (sunletsFragment != null && sunletID != null) {
Node sunlet = XMLUtil.getSingleNode(sunletsFragment, "sunlets-profile/sunlets/sunlet[@id='"+sunletID+"']");
if (sunlet != null) {
- IncludeFilter.includeNode(sunlet, consumer, consumer);
+ IncludeXMLConsumer.includeNode(sunlet, consumer, consumer);
}
} else {
state = Constants.STATE_SUNLETS;
@@ -667,7 +667,7 @@
"Error during loading of sunLet base.");
context.setAttribute(ATTRIBUTE_ADMIN_SUNLETS, sunletsFragment);
}
- IncludeFilter.includeNode(XMLUtil.selectSingleNode(sunletsFragment,
+ IncludeXMLConsumer.includeNode(XMLUtil.selectSingleNode(sunletsFragment,
"sunlets-profile"), consumer, consumer);
consumer.endElement("", Constants.ELEMENT_SUNLETS, Constants.ELEMENT_SUNLETS);
}
@@ -812,7 +812,7 @@
element = (Element)portalLayouts.get(mediaType);
childs = element.getChildNodes();
for(int ci = 0; ci < childs.getLength(); ci++) {
- IncludeFilter.includeNode(childs.item(ci),
+ IncludeXMLConsumer.includeNode(childs.item(ci),
consumer,
consumer);
}
@@ -823,7 +823,7 @@
element = (Element)sunletLayouts.get(mediaType);
childs = element.getChildNodes();
for(int ci = 0; ci < childs.getLength(); ci++) {
- IncludeFilter.includeNode(childs.item(ci),
+ IncludeXMLConsumer.includeNode(childs.item(ci),
consumer,
consumer);
}
@@ -901,18 +901,18 @@
// LAYOUT:
if (configMode == true) {
- IncludeFilter.includeNode(XMLUtil.getFirstNodeFromPath(profile, new String[] {"profile","layout-profile"}, false),
+ IncludeXMLConsumer.includeNode(XMLUtil.getFirstNodeFromPath(profile, new String[] {"profile","layout-profile"}, false),
consumer, consumer);
// SunletsConfiguration (only for configMode)
- IncludeFilter.includeNode(XMLUtil.getFirstNodeFromPath(profile, new String[] {"profile","sunlets-profile"}, false),
+ IncludeXMLConsumer.includeNode(XMLUtil.getFirstNodeFromPath(profile, new String[] {"profile","sunlets-profile"}, false),
consumer, consumer);
- IncludeFilter.includeNode(XMLUtil.getFirstNodeFromPath(profile, new String[] {"profile","type-profile","typedefs"}, false),
+ IncludeXMLConsumer.includeNode(XMLUtil.getFirstNodeFromPath(profile, new String[] {"profile","type-profile","typedefs"}, false),
consumer, consumer);
- IncludeFilter.includeNode(XMLUtil.getFirstNodeFromPath(profile, new String[] {"profile","portal-profile"}, false),
+ IncludeXMLConsumer.includeNode(XMLUtil.getFirstNodeFromPath(profile, new String[] {"profile","portal-profile"}, false),
consumer, consumer);
- IncludeFilter.includeNode(XMLUtil.getFirstNodeFromPath(profile, new String[] {"profile","personal-profile"}, false),
+ IncludeXMLConsumer.includeNode(XMLUtil.getFirstNodeFromPath(profile, new String[] {"profile","personal-profile"}, false),
consumer, consumer);
- IncludeFilter.includeNode(XMLUtil.getFirstNodeFromPath(profile, new String[] {"profile","status-profile"}, false),
+ IncludeXMLConsumer.includeNode(XMLUtil.getFirstNodeFromPath(profile, new String[] {"profile","status-profile"}, false),
consumer, consumer);
} else {
SunSpot.streamLayoutProfile(consumer, portalLayouts, sunletLayouts, mediaType);
@@ -2828,7 +2828,7 @@
for(int i = 0; i < l; i++) {
if (children.item(i).getNodeName().equals("status") == false
&& children.item(i).getNodeType() == Node.ELEMENT_NODE) {
- IncludeFilter.includeNode(children.item(i), consumer, consumer);
+ IncludeXMLConsumer.includeNode(children.item(i), consumer, consumer);
}
}
}
@@ -2841,7 +2841,7 @@
int l = children.getLength();
for(int i = 0; i < l; i++) {
if (children.item(i).getNodeType() == Node.ELEMENT_NODE) {
- IncludeFilter.includeNode(children.item(i), consumer, consumer);
+ IncludeXMLConsumer.includeNode(children.item(i), consumer, consumer);
}
}
}
@@ -2877,7 +2877,7 @@
XMLDeserializer interpreter = null;
try {
interpreter = (XMLDeserializer)this.manager.lookup(XMLDeserializer.ROLE);
- interpreter.setConsumer(new IncludeFilter(consumer, consumer));
+ interpreter.setConsumer(new IncludeXMLConsumer(consumer, consumer));
interpreter.deserialize(content);
} catch (ComponentException e) {
throw new ProcessingException("Component for XMLDeserializer not found." + e, e);
@@ -4173,7 +4173,7 @@
*/
public void sendEvents(XMLConsumer consumer, Node node)
throws SAXException {
- IncludeFilter.includeNode(node, consumer, consumer);
+ IncludeXMLConsumer.includeNode(node, consumer, consumer);
}
}
1.3 +3 -3 xml-cocoon2/src/scratchpad/src/org/apache/cocoon/sunshine/sunspot/context/SessionContextImpl.java
Index: SessionContextImpl.java
===================================================================
RCS file: /home/cvs/xml-cocoon2/src/scratchpad/src/org/apache/cocoon/sunshine/sunspot/context/SessionContextImpl.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- SessionContextImpl.java 22 Feb 2002 06:57:19 -0000 1.2
+++ SessionContextImpl.java 11 Mar 2002 11:15:26 -0000 1.3
@@ -75,7 +75,7 @@
import org.apache.cocoon.sunshine.context.SessionContext;
import org.apache.cocoon.sunshine.SunShine;
import org.apache.cocoon.sunshine.connector.Resource;
-import org.apache.cocoon.sunshine.util.IncludeFilter;
+import org.apache.cocoon.xml.IncludeXMLConsumer;
import org.apache.cocoon.xml.dom.DOMBuilder;
import org.apache.cocoon.sunshine.xml.XMLUtil;
import org.apache.cocoon.sunshine.sunspot.Constants;
@@ -101,7 +101,7 @@
* </configuration>
*
* @author <a href="mailto:cziegeler@s-und-n.de">Carsten Ziegeler</a>
- * @version CVS $Id: SessionContextImpl.java,v 1.2 2002/02/22 06:57:19 cziegeler Exp $
+ * @version CVS $Id: SessionContextImpl.java,v 1.3 2002/03/11 11:15:26 cziegeler Exp $
*/
public final class SessionContextImpl
implements SessionContext {
@@ -510,7 +510,7 @@
DocumentFragment fragment = this.getXML(path);
if (fragment != null) {
streamed = true;
- IncludeFilter.includeNode(fragment, contentHandler, lexicalHandler);
+ IncludeXMLConsumer.includeNode(fragment, contentHandler, lexicalHandler);
}
return streamed;
}
1.3 +4 -4 xml-cocoon2/src/scratchpad/src/org/apache/cocoon/sunshine/sunspot/sunlet/SunLetThread.java
Index: SunLetThread.java
===================================================================
RCS file: /home/cvs/xml-cocoon2/src/scratchpad/src/org/apache/cocoon/sunshine/sunspot/sunlet/SunLetThread.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- SunLetThread.java 22 Feb 2002 06:57:19 -0000 1.2
+++ SunLetThread.java 11 Mar 2002 11:15:26 -0000 1.3
@@ -78,7 +78,7 @@
import org.apache.cocoon.sunshine.SunShine;
import org.apache.cocoon.sunshine.connector.Resource;
import org.apache.cocoon.sunshine.connector.ResourceConnector;
-import org.apache.cocoon.sunshine.util.IncludeFilter;
+import org.apache.cocoon.xml.IncludeXMLConsumer;
import org.apache.cocoon.sunshine.xml.XMLUtil;
import org.apache.cocoon.sunshine.sunspot.Constants;
import org.apache.cocoon.sunshine.sunspot.SunSpot;
@@ -88,7 +88,7 @@
* This is the thread for loading one sunlet in the background.
*
* @author <a href="mailto:cziegeler@s-und-n.de">Carsten Ziegeler</a>
- * @version CVS $Id: SunLetThread.java,v 1.2 2002/02/22 06:57:19 cziegeler Exp $
+ * @version CVS $Id: SunLetThread.java,v 1.3 2002/03/11 11:15:26 cziegeler Exp $
*/
public final class SunLetThread implements Runnable {
@@ -177,7 +177,7 @@
try {
if (transformations != null && transformations.getLength() > 0) {
selector = (ComponentSelector) this.manager.lookup(Transformer.ROLE + "Selector");
- nextConsumer = new IncludeFilter(nextConsumer);
+ nextConsumer = new IncludeXMLConsumer(nextConsumer);
for(int k = transformations.getLength()-1; k >=0; k--) {
xslT = (Transformer)selector.select("xslt");
transformers.add(xslT);
@@ -247,7 +247,7 @@
info.put(Constants.SUNLETINFO_STATUSPROFILE, loadedSunlet[7]);
this.resourceConnector.streamXML(resource.getResourceType(), null,
res, (handlesParameters == true ? p : null),
- new IncludeFilter(nextConsumer), null);
+ new IncludeXMLConsumer(nextConsumer), null);
if (this.logger.isDebugEnabled() == true) {
this.logger.debug("sunSpot: Loaded sunlet " + sunletID);
}
1.4 +3 -3 xml-cocoon2/src/scratchpad/src/org/apache/cocoon/sunshine/transformation/AbstractSunShineTransformer.java
Index: AbstractSunShineTransformer.java
===================================================================
RCS file: /home/cvs/xml-cocoon2/src/scratchpad/src/org/apache/cocoon/sunshine/transformation/AbstractSunShineTransformer.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- AbstractSunShineTransformer.java 22 Feb 2002 14:35:21 -0000 1.3
+++ AbstractSunShineTransformer.java 11 Mar 2002 11:15:26 -0000 1.4
@@ -71,13 +71,13 @@
import org.apache.cocoon.environment.SourceResolver;
import org.apache.cocoon.ProcessingException;
import org.apache.cocoon.transformation.AbstractTransformer;
+import org.apache.cocoon.xml.IncludeXMLConsumer;
import org.apache.cocoon.xml.XMLConsumer;
import org.apache.cocoon.xml.dom.DOMBuilder;
import org.apache.cocoon.environment.ObjectModelHelper;
import org.apache.cocoon.sunshine.SunShine;
import org.apache.cocoon.sunshine.connector.*;
import org.apache.cocoon.sunshine.helpers.*;
-import org.apache.cocoon.sunshine.util.*;
import org.apache.cocoon.sunshine.xml.XMLUtil;
import org.w3c.dom.Document;
@@ -129,7 +129,7 @@
*
*
* @author <a href="mailto:cziegeler@s-und-n.de">Carsten Ziegeler</a>
- * @version CVS $Id: AbstractSunShineTransformer.java,v 1.3 2002/02/22 14:35:21 cziegeler Exp $
+ * @version CVS $Id: AbstractSunShineTransformer.java,v 1.4 2002/03/11 11:15:26 cziegeler Exp $
*/
public abstract class AbstractSunShineTransformer
extends AbstractTransformer
@@ -820,7 +820,7 @@
*/
public void sendEvents(Node node)
throws SAXException {
- IncludeFilter.includeNode(node, this, this);
+ IncludeXMLConsumer.includeNode(node, this, this);
}
/**
1.6 +3 -3 xml-cocoon2/src/scratchpad/src/org/apache/cocoon/sunshine/xml/XMLUtil.java
Index: XMLUtil.java
===================================================================
RCS file: /home/cvs/xml-cocoon2/src/scratchpad/src/org/apache/cocoon/sunshine/xml/XMLUtil.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- XMLUtil.java 22 Feb 2002 06:57:19 -0000 1.5
+++ XMLUtil.java 11 Mar 2002 11:15:27 -0000 1.6
@@ -83,7 +83,7 @@
import javax.xml.transform.sax.TransformerHandler;
import javax.xml.transform.dom.DOMSource;
-import org.apache.cocoon.sunshine.util.IncludeFilter;
+import org.apache.cocoon.xml.IncludeXMLConsumer;
/**
* This class is an utitity class for miscellanous XML functions, like creating
@@ -95,7 +95,7 @@
* @deprecated Do not use this class! We will provide a better solution for most methods soon.
*
* @author <a href="mailto:cziegeler@s-und-n.de">Carsten Ziegeler</a>
- * @version CVS $Id: XMLUtil.java,v 1.5 2002/02/22 06:57:19 cziegeler Exp $
+ * @version CVS $Id: XMLUtil.java,v 1.6 2002/03/11 11:15:27 cziegeler Exp $
*/
public final class XMLUtil {
@@ -476,7 +476,7 @@
builder.startDocument();
builder.startElement("", "sunShine", "sunShine", new AttributesImpl());
- IncludeFilter filter = new IncludeFilter(builder, builder);
+ IncludeXMLConsumer filter = new IncludeXMLConsumer(builder, builder);
parser.parse(input, filter);
builder.endElement("", "sunShine", "sunShine");
----------------------------------------------------------------------
In case of troubles, e-mail: webmaster@xml.apache.org
To unsubscribe, e-mail: cocoon-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-cvs-help@xml.apache.org