cziegeler 02/04/24 06:48:20 Modified: src/java/org/apache/cocoon/components CocoonComponentManager.java src/java/org/apache/cocoon/components/source/impl CocoonToAvalonSource.java ContextSourceFactory.java SitemapSource.java src/java/org/apache/cocoon/environment AbstractEnvironment.java URLFactorySourceResolver.java src/java/org/apache/cocoon/sitemap Handler.java Added: lib/core avalon-excalibur-20020424.jar src/java/org/apache/cocoon/components/source xmldb-new.xconf src/java/org/apache/cocoon/components/source/impl AvalonToCocoonSource.java Removed: lib/core avalon-excalibur-20020419.jar avalon-excalibur-scratchpad-20020419.jar Log: Updating to latest excalibur, finishing wrapper classes Revision Changes Path 1.1 xml-cocoon2/lib/core/avalon-excalibur-20020424.jar <<Binary file>> 1.16 +4 -3 xml-cocoon2/src/java/org/apache/cocoon/components/CocoonComponentManager.java Index: CocoonComponentManager.java =================================================================== RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/CocoonComponentManager.java,v retrieving revision 1.15 retrieving revision 1.16 diff -u -r1.15 -r1.16 --- CocoonComponentManager.java 24 Apr 2002 09:59:48 -0000 1.15 +++ CocoonComponentManager.java 24 Apr 2002 13:48:19 -0000 1.16 @@ -64,6 +64,7 @@ import org.apache.cocoon.environment.Environment; import java.net.MalformedURLException; import org.apache.excalibur.source.Source; +import org.apache.excalibur.source.SourceException; import org.apache.excalibur.source.SourceResolver; import org.xml.sax.SAXException; @@ -75,7 +76,7 @@ * and by handling the lookup of the <code>SourceResolver</code> (in development) * * @author <a href="mailto:[EMAIL PROTECTED]">Carsten Ziegeler</a> - * @version CVS $Id: CocoonComponentManager.java,v 1.15 2002/04/24 09:59:48 cziegeler Exp $ + * @version CVS $Id: CocoonComponentManager.java,v 1.16 2002/04/24 13:48:19 cziegeler Exp $ */ public final class CocoonComponentManager extends ExcaliburComponentManager @@ -252,7 +253,7 @@ * Get a <code>Source</code> object. */ public Source resolveURI(final String location) - throws MalformedURLException, IOException, ComponentException { + throws MalformedURLException, IOException, SourceException { return this.resolveURI(location, null, null); } @@ -262,7 +263,7 @@ public Source resolveURI(final String location, String baseURI, final Map parameters) - throws MalformedURLException, IOException, ComponentException { + throws MalformedURLException, IOException, SourceException { if (baseURI == null) { final Stack stack = (Stack)environmentStack.get(); if ( null != stack && !stack.empty()) { 1.1 xml-cocoon2/src/java/org/apache/cocoon/components/source/xmldb-new.xconf Index: xmldb-new.xconf =================================================================== <?xml version="1.0"?> <xconf xpath="/cocoon/source-factories" unless="component-instance[@name='xmldb']"> <!-- xmldb pseudo protocol --> <component-instance class="org.apache.cocoon.components.source.impl.SourceFactoryWrapper" name="xmldb"> <source-factory class="org.apache.cocoon.components.source.XMLDBSourceFactory"> <!-- Xindice driver --> <driver type="xindice" class="org.apache.xindice.client.xmldb.DatabaseImpl"/> <!-- Add here other XML:DB compliant databases drivers --> </source-factory> </component-instance> </xconf> 1.2 +3 -3 xml-cocoon2/src/java/org/apache/cocoon/components/source/impl/CocoonToAvalonSource.java Index: CocoonToAvalonSource.java =================================================================== RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/source/impl/CocoonToAvalonSource.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- CocoonToAvalonSource.java 24 Apr 2002 12:05:59 -0000 1.1 +++ CocoonToAvalonSource.java 24 Apr 2002 13:48:20 -0000 1.2 @@ -66,7 +66,7 @@ * to avoid recoding existing source objects. * * @author <a href="mailto:[EMAIL PROTECTED]">Carsten Ziegeler</a> - * @version CVS $Revision: 1.1 $ $Date: 2002/04/24 12:05:59 $ + * @version CVS $Revision: 1.2 $ $Date: 2002/04/24 13:48:20 $ */ public final class CocoonToAvalonSource @@ -85,11 +85,11 @@ * Return an <code>InputStream</code> object to read from the source. */ public InputStream getInputStream() - throws IOException { + throws IOException, SourceException { try { return this.source.getInputStream(); } catch (ProcessingException pe) { - throw new IOException("ProcessingException: " + pe.getMessage()); + throw new SourceException("ProcessingException", pe); } } 1.3 +4 -2 xml-cocoon2/src/java/org/apache/cocoon/components/source/impl/ContextSourceFactory.java Index: ContextSourceFactory.java =================================================================== RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/source/impl/ContextSourceFactory.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- ContextSourceFactory.java 24 Apr 2002 09:59:48 -0000 1.2 +++ ContextSourceFactory.java 24 Apr 2002 13:48:20 -0000 1.3 @@ -68,7 +68,7 @@ * A factory for the context protocol using the context of the servlet api * * @author <a href="mailto:[EMAIL PROTECTED]">Carsten Ziegeler</a> - * @version $Id: ContextSourceFactory.java,v 1.2 2002/04/24 09:59:48 cziegeler Exp $ + * @version $Id: ContextSourceFactory.java,v 1.3 2002/04/24 13:48:20 cziegeler Exp $ */ public class ContextSourceFactory extends AbstractLogEnabled @@ -119,7 +119,9 @@ this.getLogger().error(location + " could not be found. (possible context problem)"); throw new MalformedURLException(location + " could not be found. (possible context problem)"); } - return new URLSource( u, parameters ); + final URLSource urlSource = new URLSource(); + urlSource.init( u, parameters); + return urlSource; } } 1.2 +4 -3 xml-cocoon2/src/java/org/apache/cocoon/components/source/impl/SitemapSource.java Index: SitemapSource.java =================================================================== RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/source/impl/SitemapSource.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- SitemapSource.java 24 Apr 2002 09:59:48 -0000 1.1 +++ SitemapSource.java 24 Apr 2002 13:48:20 -0000 1.2 @@ -51,6 +51,7 @@ package org.apache.cocoon.components.source.impl; import org.apache.excalibur.source.Source; +import org.apache.excalibur.source.SourceException; import org.apache.excalibur.source.SourceValidity; import org.apache.excalibur.source.impl.validity.TimeStampValidity; import org.apache.avalon.excalibur.pool.Recyclable; @@ -94,7 +95,7 @@ * Description of a source which is defined by a pipeline. * * @author <a href="mailto:[EMAIL PROTECTED]">Carsten Ziegeler</a> - * @version CVS $Id: SitemapSource.java,v 1.1 2002/04/24 09:59:48 cziegeler Exp $ + * @version CVS $Id: SitemapSource.java,v 1.2 2002/04/24 13:48:20 cziegeler Exp $ */ public final class SitemapSource @@ -227,7 +228,7 @@ * Return an <code>InputStream</code> object to read from the source. */ public InputStream getInputStream() - throws IOException { + throws IOException, SourceException { if (this.needsRefresh) { this.discardValidity(); @@ -349,7 +350,7 @@ * Return a new <code>InputSource</code> object */ public InputSource getInputSource() - throws IOException { + throws IOException, SourceException { InputSource newObject = new InputSource(this.getInputStream()); newObject.setSystemId(this.systemId); return newObject; 1.1 xml-cocoon2/src/java/org/apache/cocoon/components/source/impl/AvalonToCocoonSource.java Index: AvalonToCocoonSource.java =================================================================== /* ============================================================================ The Apache Software License, Version 1.1 ============================================================================ Copyright (C) 1999-2002 The Apache Software Foundation. All rights reserved. Redistribution and use in source and binary forms, with or without modifica- tion, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. The end-user documentation included with the redistribution, if any, must include the following acknowledgment: "This product includes software developed by the Apache Software Foundation (http://www.apache.org/)." Alternately, this acknowledgment may appear in the software itself, if and wherever such third-party acknowledgments normally appear. 4. The names "Apache Cocoon" and "Apache Software Foundation" must not be used to endorse or promote products derived from this software without prior written permission. For written permission, please contact [EMAIL PROTECTED] 5. Products derived from this software may not be called "Apache", nor may "Apache" appear in their name, without prior written permission of the Apache Software Foundation. THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLU- DING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. This software consists of voluntary contributions made by many individuals on behalf of the Apache Software Foundation and was originally created by Stefano Mazzocchi <[EMAIL PROTECTED]>. For more information on the Apache Software Foundation, please see <http://www.apache.org/>. */ package org.apache.cocoon.components.source.impl; import java.io.IOException; import java.io.InputStream; import org.apache.avalon.excalibur.xml.XMLizable; import org.apache.excalibur.source.*; import org.apache.cocoon.ProcessingException; import org.apache.cocoon.environment.ModifiableSource; import org.xml.sax.ContentHandler; import org.xml.sax.InputSource; import org.xml.sax.SAXException; /** * This source objects wraps an Avalon Excalibur Source to get * an obsolete Cocoon Source object for the use of the deprecated * resolve() method of the environment! * * @author <a href="mailto:[EMAIL PROTECTED]">Carsten Ziegeler</a> * @version CVS $Revision: 1.1 $ $Date: 2002/04/24 13:48:20 $ */ public final class AvalonToCocoonSource implements ModifiableSource { /** The real source */ protected Source source; /** * Get the last modification date of the source or 0 if it * is not possible to determine the date. */ public long getLastModified() { // We have no possibility to get this! return 0; } /** * Get the content length of the source or -1 if it * is not possible to determine the length. */ public long getContentLength() { // We have no possibility to get this! return -1; } /** * Return an <code>InputStream</code> object to read from the source. */ public InputStream getInputStream() throws ProcessingException, IOException { try { return this.source.getInputStream(); // FIXME (CZ) Change to SourceException } catch (Exception e) { throw new ProcessingException(e); } } /** * Return an <code>InputSource</code> object to read the XML * content. * * @return an <code>InputSource</code> value * @exception ProcessingException if an error occurs * @exception IOException if an error occurs */ public InputSource getInputSource() throws ProcessingException, IOException { try { InputSource newObject = new InputSource(this.source.getInputStream()); newObject.setSystemId(this.getSystemId()); return newObject; } catch (SourceException se) { throw new ProcessingException("SourceException", se); } } /** * Return the unique identifer for this source */ public String getSystemId() { return this.source.getSystemId(); } public void recycle() { // FIXME } public void refresh() { this.source.discardValidity(); } /** * Stream content to a content handler or to an XMLConsumer. * * @throws ResourceNotFoundException if file not found or * HTTP location does not exist. * @throws SAXException if failed to parse source document. */ public void toSAX(ContentHandler handler) throws SAXException, ProcessingException { if (this.source instanceof XMLizable) { ((XMLizable)this.source).toSAX( handler ); } else { // FIXME } } } 1.15 +6 -5 xml-cocoon2/src/java/org/apache/cocoon/environment/AbstractEnvironment.java Index: AbstractEnvironment.java =================================================================== RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/environment/AbstractEnvironment.java,v retrieving revision 1.14 retrieving revision 1.15 diff -u -r1.14 -r1.15 --- AbstractEnvironment.java 19 Apr 2002 23:54:21 -0000 1.14 +++ AbstractEnvironment.java 24 Apr 2002 13:48:20 -0000 1.15 @@ -50,6 +50,7 @@ */ package org.apache.cocoon.environment; +import org.apache.excalibur.source.SourceException; import org.apache.avalon.excalibur.collections.IteratorEnumeration; import org.apache.avalon.framework.component.ComponentException; import org.apache.avalon.framework.logger.AbstractLoggable; @@ -70,7 +71,7 @@ * * @author <a href="mailto:[EMAIL PROTECTED]">Giacomo Pati</a> * @author <a href="mailto:[EMAIL PROTECTED]">Carsten Ziegeler</a> - * @version CVS $Id: AbstractEnvironment.java,v 1.14 2002/04/19 23:54:21 vgritsenko Exp $ + * @version CVS $Id: AbstractEnvironment.java,v 1.15 2002/04/24 13:48:20 cziegeler Exp $ */ public abstract class AbstractEnvironment extends AbstractLoggable implements Environment { @@ -419,7 +420,7 @@ * Get a <code>Source</code> object. */ public org.apache.excalibur.source.Source resolveURI(final String location) - throws MalformedURLException, IOException, ComponentException + throws MalformedURLException, IOException, SourceException { return this.resolveURI(location, null, null); } @@ -428,9 +429,9 @@ * Get a <code>Source</code> object. */ public org.apache.excalibur.source.Source resolveURI(final String location, - String baseURI, - final Map parameters) - throws MalformedURLException, IOException, ComponentException { + String baseURI, + final Map parameters) + throws MalformedURLException, IOException, SourceException { return this.sourceResolver.resolveURI(location, baseURI, parameters); } 1.7 +4 -3 xml-cocoon2/src/java/org/apache/cocoon/environment/URLFactorySourceResolver.java Index: URLFactorySourceResolver.java =================================================================== RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/environment/URLFactorySourceResolver.java,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- URLFactorySourceResolver.java 19 Apr 2002 11:02:57 -0000 1.6 +++ URLFactorySourceResolver.java 24 Apr 2002 13:48:20 -0000 1.7 @@ -50,6 +50,7 @@ */ package org.apache.cocoon.environment; +import org.apache.excalibur.source.SourceException; import org.apache.avalon.framework.component.ComponentException; import org.apache.avalon.framework.component.ComponentManager; import org.apache.cocoon.ProcessingException; @@ -66,7 +67,7 @@ * A <code>SourceResolver</code> based on a <code>URLFactory</code>. * * @author <a href="mailto:[EMAIL PROTECTED]">Sylvain Wallez</a> - * @version CVS $Id: URLFactorySourceResolver.java,v 1.6 2002/04/19 11:02:57 cziegeler Exp $ + * @version CVS $Id: URLFactorySourceResolver.java,v 1.7 2002/04/24 13:48:20 cziegeler Exp $ */ public class URLFactorySourceResolver implements SourceResolver { @@ -113,7 +114,7 @@ * Get a <code>Source</code> object. */ public org.apache.excalibur.source.Source resolveURI(final String location) - throws MalformedURLException, IOException, ComponentException + throws MalformedURLException, IOException, SourceException { return this.resolveURI(location, null, null); } @@ -124,7 +125,7 @@ public org.apache.excalibur.source.Source resolveURI(final String location, String baseURI, final Map parameters) - throws MalformedURLException, IOException, ComponentException { + throws MalformedURLException, IOException, SourceException { throw new RuntimeException("URLFactorySourceResolver.resolveURI() is not implemented yet."); } 1.17 +4 -3 xml-cocoon2/src/java/org/apache/cocoon/sitemap/Handler.java Index: Handler.java =================================================================== RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/sitemap/Handler.java,v retrieving revision 1.16 retrieving revision 1.17 diff -u -r1.16 -r1.17 --- Handler.java 24 Apr 2002 09:59:48 -0000 1.16 +++ Handler.java 24 Apr 2002 13:48:20 -0000 1.17 @@ -50,6 +50,7 @@ */ package org.apache.cocoon.sitemap; +import org.apache.excalibur.source.SourceException; import org.apache.avalon.framework.activity.Disposable; import org.apache.avalon.framework.component.Component; import org.apache.avalon.framework.component.ComponentException; @@ -86,7 +87,7 @@ * @author <a href="mailto:[EMAIL PROTECTED]">Carsten Ziegeler</a> * @author <a href="mailto:[EMAIL PROTECTED]">Giacomo Pati</a> * @author <a href="mailto:[EMAIL PROTECTED]">Stefano Mazzocchi</a> - * @version CVS $Id: Handler.java,v 1.16 2002/04/24 09:59:48 cziegeler Exp $ + * @version CVS $Id: Handler.java,v 1.17 2002/04/24 13:48:20 cziegeler Exp $ */ public class Handler extends AbstractLoggable implements Runnable, Contextualizable, Composable, Processor, Disposable, SourceResolver { @@ -358,7 +359,7 @@ * Get a <code>Source</code> object. */ public org.apache.excalibur.source.Source resolveURI(final String location) - throws MalformedURLException, IOException, ComponentException + throws MalformedURLException, IOException, SourceException { return this.resolveURI(location, null, null); } @@ -369,7 +370,7 @@ public org.apache.excalibur.source.Source resolveURI(final String location, String baseURI, final Map parameters) - throws MalformedURLException, IOException, ComponentException { + throws MalformedURLException, IOException, SourceException { throw new RuntimeException("Handler.resolveURI() is not implemented yet."); }
---------------------------------------------------------------------- In case of troubles, e-mail: [EMAIL PROTECTED] To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]