cziegeler 2003/01/30 00:23:40
Modified: src/java/org/apache/cocoon/components/source SourceUtil.java
src/java/org/apache/cocoon/components/language/markup
Logicsheet.java
src/java/org/apache/cocoon/components/treeprocessor
DefaultTreeBuilder.java TreeProcessor.java
src/java/org/apache/cocoon/generation
ServerPagesGenerator.java FileGenerator.java
DirectoryGenerator.java
WebServiceProxyGenerator.java
src/java/org/apache/cocoon/transformation
CIncludeTransformer.java LogTransformer.java
TraxTransformer.java SourceWritingTransformer.java
XIncludeTransformer.java I18nTransformer.java
src/java/org/apache/cocoon/components/source/impl
URLFactoryWrapper.java ContextSourceFactory.java
AvalonToCocoonSource.java
DelayedRefreshSourceWrapper.java
SitemapSourceFactory.java FileSourceFactory.java
SitemapSource.java SourceFactoryWrapper.java
CocoonToAvalonSource.java
src/java/org/apache/cocoon/components/language/generator
ProgramGeneratorImpl.java
lib jars.xml
src/java/org/apache/cocoon/components/language/markup/xsp
XSPFormValidatorHelper.java
src/java/org/apache/cocoon/environment
AbstractEnvironment.java
src/java/org/apache/cocoon/acting
AbstractComplementaryConfigurableAction.java
src/java/org/apache/cocoon/sitemap ContentAggregator.java
src/java/org/apache/cocoon/reading ResourceReader.java
src/java/org/apache/cocoon Cocoon.java
Added: lib/core excalibur-sourceresolve-20030130.jar
Removed: lib/core excalibur-sourceresolve-20030109.jar
Log:
Updating to latest excalibur source resolve
Revision Changes Path
1.16 +15 -80
xml-cocoon2/src/java/org/apache/cocoon/components/source/SourceUtil.java
Index: SourceUtil.java
===================================================================
RCS file:
/home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/source/SourceUtil.java,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
--- SourceUtil.java 30 Jan 2003 05:00:13 -0000 1.15
+++ SourceUtil.java 30 Jan 2003 08:23:36 -0000 1.16
@@ -50,6 +50,11 @@
*/
package org.apache.cocoon.components.source;
+import java.io.IOException;
+import java.io.OutputStream;
+import java.util.Iterator;
+import java.util.Map;
+
import org.apache.avalon.framework.component.Component;
import org.apache.avalon.framework.component.ComponentException;
import org.apache.avalon.framework.component.ComponentManager;
@@ -65,7 +70,6 @@
import org.apache.excalibur.source.SourceNotFoundException;
import org.apache.excalibur.source.SourceParameters;
import org.apache.excalibur.source.SourceResolver;
-import org.apache.excalibur.source.impl.URLSource;
import org.apache.excalibur.xmlizer.XMLizer;
import org.w3c.dom.Document;
import org.w3c.dom.DocumentFragment;
@@ -74,12 +78,6 @@
import org.xml.sax.SAXException;
import org.xml.sax.helpers.DefaultHandler;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.util.Iterator;
-import java.util.Map;
-
/**
* This class contains some utility methods for the source resolving.
*
@@ -120,7 +118,7 @@
try {
xmlizer = (XMLizer) manager.lookup(XMLizer.ROLE);
xmlizer.toSAX(source.getInputStream(), source.getMimeType(),
- source.getSystemId(), handler);
+ source.getURI(), handler);
} catch (SourceException se) {
throw SourceUtil.handle(se);
} catch (ComponentException ce) {
@@ -193,7 +191,7 @@
if (document==null) {
throw new ProcessingException("Could not build DOM for '"+
- source.getSystemId()+"'");
+ source.getURI()+"'");
}
return document;
@@ -250,7 +248,7 @@
try {
final InputSource newObject = new InputSource(source.getInputStream());
- newObject.setSystemId(source.getSystemId());
+ newObject.setSystemId(source.getURI());
return newObject;
} catch (SourceException se) {
throw handle(se);
@@ -341,77 +339,14 @@
}
Map resolverParameters = new java.util.HashMap();
- resolverParameters.put(URLSource.HTTP_METHOD, method);
- resolverParameters.put(URLSource.REQUEST_PARAMETERS,
+ resolverParameters.put(SourceResolver.METHOD, method);
+ resolverParameters.put(SourceResolver.URI_PARAMETERS,
resourceParameters);
return resolver.resolveURI(uri, null, resolverParameters);
}
/**
- * Move the source to a specified destination.
- *
- * @param source Source of the source.
- * @param destination Destination of the source.
- *
- * @throws SourceException If an exception occurs during
- * the move.
- */
- static public void move(Source source,
- Source destination) throws SourceException {
- if (source instanceof WriteableSource) {
- copy(source, destination);
- ((WriteableSource) source).delete();
- } else {
- throw new SourceException("Source '"+source.getSystemId()+
- "' is not writeable");
- }
- }
-
- /**
- * Copy the source to a specified destination.
- *
- * @param source Source of the source.
- * @param destination Destination of the source.
- *
- * @throws SourceException If an exception occurs during
- * the copy.
- */
- static public void copy(Source source,
- Source destination) throws SourceException {
- if ((source instanceof MoveableSource) &&
- (source.getClass().equals(destination.getClass()))) {
- ((MoveableSource) source).copy(destination);
- } else {
- if ( !(destination instanceof WriteableSource)) {
- throw new SourceException("Source '"+
- destination.getSystemId()+
- "' is not writeable");
- }
-
- try {
- OutputStream out = ((WriteableSource)
destination).getOutputStream();
- InputStream in = source.getInputStream();
-
- byte[] buffer = new byte[8192];
- int length = -1;
-
- while ((length = in.read(buffer))>-1) {
- out.write(buffer, 0, length);
- }
- in.close();
- out.flush();
- out.close();
- } catch (IOException ioe) {
- throw new SourceException("Could not copy source '"+
- source.getSystemId()+"' to '"+
- destination.getSystemId()+"' :"+
- ioe.getMessage(), ioe);
- }
- }
- }
-
- /**
* Write a DOM Fragment to a source
* If the source is a {@link WriteableSource} the interface is used.
* If not, the source is invoked with an additional parameter named
@@ -528,14 +463,14 @@
parameters, resolver);
SourceUtil.toSAX(source, new DefaultHandler(), manager);
}
+ } catch (SourceException se) {
+ throw SourceUtil.handle(se);
} catch (IOException ce) {
throw new ProcessingException(ce);
} catch (SAXException ce) {
throw new ProcessingException(ce);
// } catch (ComponentException ce) {
// throw new ProcessingException("Exception during lookup of
component.", ce);
- } catch (SourceException se) {
- throw SourceUtil.handle(se);
} finally {
resolver.release(source);
}
@@ -572,12 +507,12 @@
fragment.appendChild(doc.getDocumentElement());
return fragment;
+ } catch (SourceException se) {
+ throw SourceUtil.handle(se);
} catch (IOException ce) {
throw new ProcessingException(ce);
} catch (SAXException ce) {
throw new ProcessingException(ce);
- } catch (SourceException se) {
- throw SourceUtil.handle(se);
} finally {
resolver.release(source);
}
1.18 +5 -5
xml-cocoon2/src/java/org/apache/cocoon/components/language/markup/Logicsheet.java
Index: Logicsheet.java
===================================================================
RCS file:
/home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/language/markup/Logicsheet.java,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -r1.17 -r1.18
--- Logicsheet.java 22 Jan 2003 05:19:17 -0000 1.17
+++ Logicsheet.java 30 Jan 2003 08:23:36 -0000 1.18
@@ -113,7 +113,7 @@
throws SAXException, IOException, ProcessingException
{
this.resolver = resolver;
- this.systemId = source.getSystemId();
+ this.systemId = source.getURI();
this.manager = manager;
}
@@ -125,7 +125,7 @@
Source source = null;
try {
source = this.resolver.resolveURI( systemId );
- this.systemId = source.getSystemId();
+ this.systemId = source.getURI();
} finally {
this.resolver.release( source );
}
@@ -172,10 +172,10 @@
throw new ProcessingException("Could not obtain XSLT processor", e);
} catch (MalformedURLException e) {
throw new ProcessingException("Could not resolve " + this.systemId, e);
- } catch (IOException e) {
- throw new ProcessingException("Could not resolve " + this.systemId, e);
} catch (SourceException e) {
throw SourceUtil.handle("Could not resolve " + this.systemId, e);
+ } catch (IOException e) {
+ throw new ProcessingException("Could not resolve " + this.systemId, e);
} catch (XSLTProcessorException e) {
throw new ProcessingException("Could not transform " + this.systemId,
e);
} finally {
1.16 +2 -2
xml-cocoon2/src/java/org/apache/cocoon/components/treeprocessor/DefaultTreeBuilder.java
Index: DefaultTreeBuilder.java
===================================================================
RCS file:
/home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/treeprocessor/DefaultTreeBuilder.java,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
--- DefaultTreeBuilder.java 29 Sep 2002 20:24:22 -0000 1.15
+++ DefaultTreeBuilder.java 30 Jan 2003 08:23:36 -0000 1.16
@@ -391,7 +391,7 @@
} catch(Exception e) {
throw new ProcessingException("Failed to load " + this.languageName + "
from " +
- source.getSystemId(), e);
+ source.getURI(), e);
}
}
1.24 +2 -2
xml-cocoon2/src/java/org/apache/cocoon/components/treeprocessor/TreeProcessor.java
Index: TreeProcessor.java
===================================================================
RCS file:
/home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/treeprocessor/TreeProcessor.java,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -r1.23 -r1.24
--- TreeProcessor.java 5 Dec 2002 10:20:35 -0000 1.23
+++ TreeProcessor.java 30 Jan 2003 08:23:36 -0000 1.24
@@ -400,7 +400,7 @@
if (getLogger().isDebugEnabled()) {
double time = (this.lastModified - startTime) / 1000.0;
- getLogger().debug("TreeProcessor built in " + time + " secs from " +
source.getSystemId());
+ getLogger().debug("TreeProcessor built in " + time + " secs from " +
source.getURI());
}
// Finished
1.27 +5 -5
xml-cocoon2/src/java/org/apache/cocoon/generation/ServerPagesGenerator.java
Index: ServerPagesGenerator.java
===================================================================
RCS file:
/home/cvs/xml-cocoon2/src/java/org/apache/cocoon/generation/ServerPagesGenerator.java,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -r1.26 -r1.27
--- ServerPagesGenerator.java 27 Jan 2003 10:37:15 -0000 1.26
+++ ServerPagesGenerator.java 30 Jan 2003 08:23:36 -0000 1.27
@@ -145,8 +145,8 @@
public Serializable generateKey() {
Object generatorkey = generator.generateKey();
if (generatorkey==null)
- return this.inputSource.getSystemId();
- return this.inputSource.getSystemId() + '-' + generatorkey;
+ return this.inputSource.getURI();
+ return this.inputSource.getURI() + '-' + generatorkey;
}
/**
@@ -252,7 +252,7 @@
// Fixes BUG#4062: Set document locator which is used by XIncludeTransformer
org.xml.sax.helpers.LocatorImpl locator = new
org.xml.sax.helpers.LocatorImpl();
- locator.setSystemId(this.inputSource.getSystemId());
+ locator.setSystemId(this.inputSource.getURI());
this.contentHandler.setDocumentLocator(locator);
// log exception and ensure that generator is released.
@@ -429,7 +429,7 @@
if (this.getLogger().isWarnEnabled()) {
if (this.eventStack.size() > 0) {
- this.getLogger().warn("Premature end of document generated by "
+ inputSource.getSystemId());
+ this.getLogger().warn("Premature end of document generated by "
+ inputSource.getURI());
}
}
1.16 +4 -4
xml-cocoon2/src/java/org/apache/cocoon/generation/FileGenerator.java
Index: FileGenerator.java
===================================================================
RCS file:
/home/cvs/xml-cocoon2/src/java/org/apache/cocoon/generation/FileGenerator.java,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
--- FileGenerator.java 6 Sep 2002 14:25:45 -0000 1.15
+++ FileGenerator.java 30 Jan 2003 08:23:36 -0000 1.16
@@ -114,7 +114,7 @@
* @return The generated key hashes the src
*/
public java.io.Serializable generateKey() {
- return this.inputSource.getSystemId();
+ return this.inputSource.getURI();
}
/**
@@ -135,7 +135,7 @@
try {
if (this.getLogger().isDebugEnabled()) {
this.getLogger().debug("processing file " + super.source);
- this.getLogger().debug("file resolved to " +
this.inputSource.getSystemId());
+ this.getLogger().debug("file resolved to " +
this.inputSource.getURI());
}
this.resolver.toSAX(this.inputSource, super.xmlConsumer);
} catch (SAXException e) {
@@ -148,7 +148,7 @@
if ( cause instanceof SAXException )
throw (SAXException)cause;
throw new ProcessingException("Could not read resource "
- + this.inputSource.getSystemId(),
cause);
+ + this.inputSource.getURI(), cause);
}
throw e;
}
1.13 +2 -2
xml-cocoon2/src/java/org/apache/cocoon/generation/DirectoryGenerator.java
Index: DirectoryGenerator.java
===================================================================
RCS file:
/home/cvs/xml-cocoon2/src/java/org/apache/cocoon/generation/DirectoryGenerator.java,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- DirectoryGenerator.java 8 Nov 2002 17:35:35 -0000 1.12
+++ DirectoryGenerator.java 30 Jan 2003 08:23:37 -0000 1.13
@@ -231,7 +231,7 @@
Source inputSource = null;
try {
inputSource = this.resolver.resolveURI(directory);
- String systemId = inputSource.getSystemId();
+ String systemId = inputSource.getURI();
if (!systemId.startsWith(FILE)) {
throw new ResourceNotFoundException(systemId + " does not denote a
directory");
}
1.10 +1 -1
xml-cocoon2/src/java/org/apache/cocoon/generation/WebServiceProxyGenerator.java
Index: WebServiceProxyGenerator.java
===================================================================
RCS file:
/home/cvs/xml-cocoon2/src/java/org/apache/cocoon/generation/WebServiceProxyGenerator.java,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- WebServiceProxyGenerator.java 22 Jan 2003 05:19:18 -0000 1.9
+++ WebServiceProxyGenerator.java 30 Jan 2003 08:23:37 -0000 1.10
@@ -119,7 +119,7 @@
try {
Source inputSource = resolver.resolveURI(super.source);
- this.source = inputSource.getSystemId();
+ this.source = inputSource.getURI();
} catch (SourceException se) {
throw SourceUtil.handle("Unable to resolve " + super.source, se);
}
1.20 +3 -3
xml-cocoon2/src/java/org/apache/cocoon/transformation/CIncludeTransformer.java
Index: CIncludeTransformer.java
===================================================================
RCS file:
/home/cvs/xml-cocoon2/src/java/org/apache/cocoon/transformation/CIncludeTransformer.java,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -r1.19 -r1.20
--- CIncludeTransformer.java 22 Jan 2003 05:19:18 -0000 1.19
+++ CIncludeTransformer.java 30 Jan 2003 08:23:37 -0000 1.20
@@ -385,10 +385,10 @@
}
- } catch (IOException e) {
- throw new SAXException("CIncludeTransformer could not read resource",
e);
} catch (SourceException se) {
throw new SAXException("Exception in CIncludeTransformer",se);
+ } catch (IOException e) {
+ throw new SAXException("CIncludeTransformer could not read resource",
e);
} catch (ProcessingException e){
throw new SAXException("Exception in CIncludeTransformer",e);
} catch(ComponentException e) {
1.10 +2 -2
xml-cocoon2/src/java/org/apache/cocoon/transformation/LogTransformer.java
Index: LogTransformer.java
===================================================================
RCS file:
/home/cvs/xml-cocoon2/src/java/org/apache/cocoon/transformation/LogTransformer.java,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- LogTransformer.java 10 Sep 2002 12:15:49 -0000 1.9
+++ LogTransformer.java 30 Jan 2003 08:23:37 -0000 1.10
@@ -116,7 +116,7 @@
Source source = null;
try {
source = resolver.resolveURI( logfilename );
- final String systemId = source.getSystemId();
+ final String systemId = source.getURI();
if ( systemId.startsWith("file:") ) {
this.logfile = new FileWriter(systemId.substring(5), append );
} else {
1.41 +4 -4
xml-cocoon2/src/java/org/apache/cocoon/transformation/TraxTransformer.java
Index: TraxTransformer.java
===================================================================
RCS file:
/home/cvs/xml-cocoon2/src/java/org/apache/cocoon/transformation/TraxTransformer.java,v
retrieving revision 1.40
retrieving revision 1.41
diff -u -r1.40 -r1.41
--- TraxTransformer.java 25 Jan 2003 02:58:58 -0000 1.40
+++ TraxTransformer.java 30 Jan 2003 08:23:37 -0000 1.41
@@ -331,7 +331,7 @@
_useDeli = par.getParameterAsBoolean("use-deli", this.useDeli);
if (this.getLogger().isDebugEnabled()) {
- this.getLogger().debug("Using stylesheet: '" +
this.inputSource.getSystemId() + "' in " + this);
+ this.getLogger().debug("Using stylesheet: '" +
this.inputSource.getURI() + "' in " + this);
}
/** Get a Transformer Handler */
@@ -354,11 +354,11 @@
public java.io.Serializable generateKey() {
Map map = this.getLogicSheetParameters();
if (map == null) {
- return this.inputSource.getSystemId();
+ return this.inputSource.getURI();
}
StringBuffer sb = new StringBuffer();
- sb.append(this.inputSource.getSystemId());
+ sb.append(this.inputSource.getURI());
Set entries = map.entrySet();
for(Iterator i=entries.iterator(); i.hasNext();){
sb.append(';');
1.15 +1 -1
xml-cocoon2/src/java/org/apache/cocoon/transformation/SourceWritingTransformer.java
Index: SourceWritingTransformer.java
===================================================================
RCS file:
/home/cvs/xml-cocoon2/src/java/org/apache/cocoon/transformation/SourceWritingTransformer.java,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -r1.14 -r1.15
--- SourceWritingTransformer.java 25 Jan 2003 02:58:58 -0000 1.14
+++ SourceWritingTransformer.java 30 Jan 2003 08:23:37 -0000 1.15
@@ -631,7 +631,7 @@
}
WriteableSource ws = (WriteableSource)source;
exists = ws.exists();
- target = source.getSystemId();
+ target = source.getURI();
if ( exists == true && this.state == STATE_INSERT ) {
message = "content inserted at: " + path;
resource = SourceUtil.toDOM( source, this.manager );
1.17 +6 -6
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.16
retrieving revision 1.17
diff -u -r1.16 -r1.17
--- XIncludeTransformer.java 22 Jan 2003 05:19:18 -0000 1.16
+++ XIncludeTransformer.java 30 Jan 2003 08:23:37 -0000 1.17
@@ -187,8 +187,8 @@
base_xmlbase_uri = this.resolver.resolveURI(locator.getSystemId());
// If url ends with .xxx then truncate to dir
- if (base_xmlbase_uri.getSystemId().lastIndexOf('.') >
base_xmlbase_uri.getSystemId().lastIndexOf('/')) {
- String uri =
base_xmlbase_uri.getSystemId().substring(0,base_xmlbase_uri.getSystemId().lastIndexOf('/')+1);
+ if (base_xmlbase_uri.getURI().lastIndexOf('.') >
base_xmlbase_uri.getURI().lastIndexOf('/')) {
+ String uri =
base_xmlbase_uri.getURI().substring(0,base_xmlbase_uri.getURI().lastIndexOf('/')+1);
this.resolver.release(base_xmlbase_uri);
base_xmlbase_uri = null;
base_xmlbase_uri = this.resolver.resolveURI(uri);
@@ -255,7 +255,7 @@
if(current_xmlbase_uri == null)
getLogger().debug("Base URI: null");
else
- getLogger().debug("Base URI: " + current_xmlbase_uri.getSystemId());
+ getLogger().debug("Base URI: " + current_xmlbase_uri.getURI());
}
Source url = null;
@@ -266,13 +266,13 @@
if(current_xmlbase_uri == null)
url = this.resolver.resolveURI(href);
else
- url =
this.resolver.resolveURI(current_xmlbase_uri.getSystemId() + href);
+ url = this.resolver.resolveURI(current_xmlbase_uri.getURI() +
href);
suffix = "";
} else {
if(current_xmlbase_uri == null)
url = this.resolver.resolveURI(href.substring(0,index));
else
- url =
this.resolver.resolveURI(current_xmlbase_uri.getSystemId() + href.substring(0,index));
+ url = this.resolver.resolveURI(current_xmlbase_uri.getURI() +
href.substring(0,index));
suffix = href.substring(index+1);
}
if (getLogger().isDebugEnabled()) {
1.29 +2 -2
xml-cocoon2/src/java/org/apache/cocoon/transformation/I18nTransformer.java
Index: I18nTransformer.java
===================================================================
RCS file:
/home/cvs/xml-cocoon2/src/java/org/apache/cocoon/transformation/I18nTransformer.java,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -r1.28 -r1.29
--- I18nTransformer.java 25 Jan 2003 02:58:58 -0000 1.28
+++ I18nTransformer.java 30 Jan 2003 08:23:37 -0000 1.29
@@ -967,7 +967,7 @@
Source source = null;
try {
source = resolver.resolveURI(location);
- String systemId = source.getSystemId();
+ String systemId = source.getURI();
debug("catalog directory:" + systemId);
dirConf.setValue(systemId);
configuration.addChild(dirConf);
1.6 +2 -2
xml-cocoon2/src/java/org/apache/cocoon/components/source/impl/URLFactoryWrapper.java
Index: URLFactoryWrapper.java
===================================================================
RCS file:
/home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/source/impl/URLFactoryWrapper.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- URLFactoryWrapper.java 9 Jan 2003 08:09:39 -0000 1.5
+++ URLFactoryWrapper.java 30 Jan 2003 08:23:37 -0000 1.6
@@ -204,7 +204,7 @@
public void release( Source source ) {
if ( null != source ) {
if ( this.getLogger().isDebugEnabled() ) {
- this.getLogger().debug("Releasing source " + source.getSystemId());
+ this.getLogger().debug("Releasing source " + source.getURI());
}
// do simply nothing
}
1.11 +2 -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.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- ContextSourceFactory.java 15 Jan 2003 15:55:47 -0000 1.10
+++ ContextSourceFactory.java 30 Jan 2003 08:23:37 -0000 1.11
@@ -173,7 +173,7 @@
public void release( Source source ) {
if ( null != source ) {
if ( this.getLogger().isDebugEnabled() ) {
- this.getLogger().debug("Releasing source " + source.getSystemId());
+ this.getLogger().debug("Releasing source " + source.getURI());
}
this.resolver.release( source );
}
1.9 +3 -3
xml-cocoon2/src/java/org/apache/cocoon/components/source/impl/AvalonToCocoonSource.java
Index: AvalonToCocoonSource.java
===================================================================
RCS file:
/home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/source/impl/AvalonToCocoonSource.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- AvalonToCocoonSource.java 5 Dec 2002 10:17:29 -0000 1.8
+++ AvalonToCocoonSource.java 30 Jan 2003 08:23:38 -0000 1.9
@@ -148,7 +148,7 @@
* Return the unique identifer for this source
*/
public String getSystemId() {
- return this.source.getSystemId();
+ return this.source.getURI();
}
public void recycle() {
@@ -158,7 +158,7 @@
}
public void refresh() {
- this.source.discardValidity();
+ this.source.refresh();
}
/**
1.4 +16 -8
xml-cocoon2/src/java/org/apache/cocoon/components/source/impl/DelayedRefreshSourceWrapper.java
Index: DelayedRefreshSourceWrapper.java
===================================================================
RCS file:
/home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/source/impl/DelayedRefreshSourceWrapper.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- DelayedRefreshSourceWrapper.java 9 Jan 2003 08:09:39 -0000 1.3
+++ DelayedRefreshSourceWrapper.java 30 Jan 2003 08:23:38 -0000 1.4
@@ -95,8 +95,8 @@
return this.source.getInputStream();
}
- public final String getSystemId() {
- return this.source.getSystemId();
+ public final String getURI() {
+ return this.source.getURI();
}
/**
@@ -112,11 +112,19 @@
/**
* Return the protocol identifier.
*/
- public String getProtocol() {
- return this.source.getProtocol();
+ public String getScheme() {
+ return this.source.getScheme();
}
/**
+ *
+ * @see org.apache.excalibur.source.Source#exists()
+ */
+ public boolean exists() {
+ return this.source.exists();
+ }
+
+ /**
* Get the last modification time for the wrapped <code>Source</code>. The
* age of the returned information is guaranteed to be lower than or equal to
* the delay specified in the constructor.
@@ -130,7 +138,7 @@
// Do we have to refresh the source ?
if (System.currentTimeMillis() >= nextCheckTime) {
// Yes
- this.discardValidity();
+ this.refresh();
}
return this.lastModified;
@@ -142,11 +150,11 @@
* <p>
* This method is thread-safe, even if the underlying Source is not.
*/
- public synchronized final void discardValidity() {
+ public synchronized final void refresh() {
this.nextCheckTime = System.currentTimeMillis() + this.delay;
// Refresh modifiable sources
- this.source.discardValidity();
+ this.source.refresh();
// Keep the last modified date
this.lastModified = source.getLastModified();
1.3 +1 -1
xml-cocoon2/src/java/org/apache/cocoon/components/source/impl/SitemapSourceFactory.java
Index: SitemapSourceFactory.java
===================================================================
RCS file:
/home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/source/impl/SitemapSourceFactory.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- SitemapSourceFactory.java 9 Jan 2003 08:09:39 -0000 1.2
+++ SitemapSourceFactory.java 30 Jan 2003 08:23:38 -0000 1.3
@@ -106,7 +106,7 @@
public void release( Source source ) {
if ( null != source ) {
if ( this.getLogger().isDebugEnabled() ) {
- this.getLogger().debug("Releasing source " + source.getSystemId());
+ this.getLogger().debug("Releasing source " + source.getURI());
}
((SitemapSource)source).recycle();
}
1.3 +2 -2
xml-cocoon2/src/java/org/apache/cocoon/components/source/impl/FileSourceFactory.java
Index: FileSourceFactory.java
===================================================================
RCS file:
/home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/source/impl/FileSourceFactory.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- FileSourceFactory.java 9 Jan 2003 08:09:39 -0000 1.2
+++ FileSourceFactory.java 30 Jan 2003 08:23:38 -0000 1.3
@@ -97,7 +97,7 @@
public void release( Source source ) {
if ( null != source ) {
if ( this.getLogger().isDebugEnabled() ) {
- this.getLogger().debug("Releasing source " + source.getSystemId());
+ this.getLogger().debug("Releasing source " + source.getURI());
}
// do simply nothing
}
1.37 +15 -7
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.36
retrieving revision 1.37
diff -u -r1.36 -r1.37
--- SitemapSource.java 14 Jan 2003 12:08:18 -0000 1.36
+++ SitemapSource.java 30 Jan 2003 08:23:38 -0000 1.37
@@ -223,7 +223,7 @@
/**
* Return the protocol identifier.
*/
- public String getProtocol() {
+ public String getScheme() {
return this.protocol;
}
@@ -251,7 +251,7 @@
throws IOException, SourceException {
if (this.needsRefresh) {
- this.discardValidity();
+ this.refresh();
}
// VG: Why exception is not thrown in constructor?
if (this.exception != null) {
@@ -289,11 +289,19 @@
/**
* Return the unique identifer for this source
*/
- public String getSystemId() {
+ public String getURI() {
return this.systemId;
}
/**
+ *
+ * @see org.apache.excalibur.source.Source#exists()
+ */
+ public boolean exists() {
+ return true;
+ }
+
+ /**
* Get the Validity object. This can either wrap the last modification
* date or the expires information or...
* If it is currently not possible to calculate such an information
@@ -301,7 +309,7 @@
*/
public SourceValidity getValidity() {
if (this.needsRefresh) {
- this.discardValidity();
+ this.refresh();
}
if (this.redirectSource != null) {
return this.redirectValidity;
@@ -322,7 +330,7 @@
* Refresh this object and update the last modified date
* and content length.
*/
- public void discardValidity() {
+ public void refresh() {
this.reset();
this.init();
}
@@ -377,7 +385,7 @@
throws SAXException
{
if (this.needsRefresh) {
- this.discardValidity();
+ this.refresh();
}
if (this.exception != null) {
throw this.exception;
1.8 +2 -2
xml-cocoon2/src/java/org/apache/cocoon/components/source/impl/SourceFactoryWrapper.java
Index: SourceFactoryWrapper.java
===================================================================
RCS file:
/home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/source/impl/SourceFactoryWrapper.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- SourceFactoryWrapper.java 9 Jan 2003 08:09:39 -0000 1.7
+++ SourceFactoryWrapper.java 30 Jan 2003 08:23:38 -0000 1.8
@@ -210,7 +210,7 @@
public void release( Source source ) {
if ( null != source ) {
if ( this.getLogger().isDebugEnabled() ) {
- this.getLogger().debug("Releasing source " + source.getSystemId());
+ this.getLogger().debug("Releasing source " + source.getURI());
}
((Recyclable)source).recycle();
}
1.7 +16 -4
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.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- CocoonToAvalonSource.java 14 Jan 2003 09:54:20 -0000 1.6
+++ CocoonToAvalonSource.java 30 Jan 2003 08:23:38 -0000 1.7
@@ -93,11 +93,23 @@
/**
* Return the protocol identifier.
*/
- public String getProtocol() {
+ public String getScheme() {
return this.protocol;
}
/**
+ * @see org.apache.excalibur.source.Source#exists()
+ */
+ public boolean exists() {
+ try {
+ this.getInputStream();
+ return true;
+ } catch (Exception local) {
+ return false;
+ }
+ }
+
+ /**
* Return an <code>InputStream</code> object to read from the source.
*/
public InputStream getInputStream()
@@ -114,7 +126,7 @@
/**
* Return the unique identifer for this source
*/
- public String getSystemId()
+ public String getURI()
{
return this.source.getSystemId();
}
@@ -136,7 +148,7 @@
* Refresh this object and update the last modified date
* and content length.
*/
- public void discardValidity()
+ public void refresh()
{
if (this.source instanceof ModifiableSource) {
((ModifiableSource)this.source).refresh();
1.24 +5 -5
xml-cocoon2/src/java/org/apache/cocoon/components/language/generator/ProgramGeneratorImpl.java
Index: ProgramGeneratorImpl.java
===================================================================
RCS file:
/home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/language/generator/ProgramGeneratorImpl.java,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -r1.23 -r1.24
--- ProgramGeneratorImpl.java 5 Dec 2002 09:48:53 -0000 1.23
+++ ProgramGeneratorImpl.java 30 Jan 2003 08:23:38 -0000 1.24
@@ -241,7 +241,7 @@
SourceResolver resolver)
throws Exception {
- final String id = source.getSystemId();
+ final String id = source.getURI();
ProgrammingLanguage programmingLanguage = null;
MarkupLanguage markupLanguage = null;
@@ -448,7 +448,7 @@
throws Exception {
if (getLogger().isDebugEnabled()) {
- getLogger().debug("Creating sourcecode for [" + source.getSystemId() +
"]");
+ getLogger().debug("Creating sourcecode for [" + source.getURI() + "]");
}
// Input Source
// FIXME(VG): Use Source.toSAX()
@@ -481,7 +481,7 @@
}
IOUtils.serializeString(sourceFile, code);
if (getLogger().isDebugEnabled()) {
- getLogger().debug("Successfully created sourcecode for [" +
source.getSystemId() + "]");
+ getLogger().debug("Successfully created sourcecode for [" +
source.getURI() + "]");
}
}
@@ -499,7 +499,7 @@
* @param source of the program to be removed
*/
public void remove(Source source) {
- final String normalizedName = getNormalizedName(source.getSystemId());
+ final String normalizedName = getNormalizedName(source.getURI());
this.cache.removeGenerator(normalizedName);
}
1.1 xml-cocoon2/lib/core/excalibur-sourceresolve-20030130.jar
<<Binary file>>
1.69 +1 -1 xml-cocoon2/lib/jars.xml
Index: jars.xml
===================================================================
RCS file: /home/cvs/xml-cocoon2/lib/jars.xml,v
retrieving revision 1.68
retrieving revision 1.69
diff -u -r1.68 -r1.69
--- jars.xml 22 Jan 2003 05:19:14 -0000 1.68
+++ jars.xml 30 Jan 2003 08:23:39 -0000 1.69
@@ -155,7 +155,7 @@
<description>Part of jakarta-avalon, it is a set of classes and patterns that
support high level server development.</description>
<used-by>Cocoon</used-by>
- <lib>core/excalibur-sourceresolve-20030109.jar</lib>
+ <lib>core/excalibur-sourceresolve-20030130.jar</lib>
<homepage>http://jakarta.apache.org/avalon/excalibur/</homepage>
</file>
<file>
1.12 +4 -4
xml-cocoon2/src/java/org/apache/cocoon/components/language/markup/xsp/XSPFormValidatorHelper.java
Index: XSPFormValidatorHelper.java
===================================================================
RCS file:
/home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/language/markup/xsp/XSPFormValidatorHelper.java,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- XSPFormValidatorHelper.java 7 Nov 2002 08:08:12 -0000 1.11
+++ XSPFormValidatorHelper.java 30 Jan 2003 08:23:39 -0000 1.12
@@ -399,7 +399,7 @@
Source source = null;
try {
source = resolver.resolveURI(descriptor);
- conf = (ConfigurationHelper)
XSPFormValidatorHelper.configurations.get(source.getSystemId());
+ conf = (ConfigurationHelper)
XSPFormValidatorHelper.configurations.get(source.getURI());
if (conf == null || (reloadable && conf.lastModified !=
source.getLastModified())) {
logger.debug("(Re)Loading " + descriptor);
@@ -413,13 +413,13 @@
conf.lastModified = source.getLastModified();
conf.configuration = builder.getConfiguration();
- XSPFormValidatorHelper.cacheConfiguration(source.getSystemId(),
conf);
+ XSPFormValidatorHelper.cacheConfiguration(source.getURI(),
conf);
} else {
logger.debug("Using cached configuration for " + descriptor);
}
} catch (Exception e) {
logger.error("Could not configure Database mapping environment", e);
- throw new ConfigurationException("Error trying to load
configurations for resource: " + source.getSystemId());
+ throw new ConfigurationException("Error trying to load
configurations for resource: " + source.getURI());
} finally {
resolver.release(source);
}
1.35 +2 -2
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.34
retrieving revision 1.35
diff -u -r1.34 -r1.35
--- AbstractEnvironment.java 27 Jan 2003 10:37:15 -0000 1.34
+++ AbstractEnvironment.java 30 Jan 2003 08:23:39 -0000 1.35
@@ -537,7 +537,7 @@
try {
xmlizer.toSAX( source.getInputStream(),
source.getMimeType(),
- source.getSystemId(),
+ source.getURI(),
handler );
} catch (SourceException se) {
throw SourceUtil.handle(se);
1.10 +4 -4
xml-cocoon2/src/java/org/apache/cocoon/acting/AbstractComplementaryConfigurableAction.java
Index: AbstractComplementaryConfigurableAction.java
===================================================================
RCS file:
/home/cvs/xml-cocoon2/src/java/org/apache/cocoon/acting/AbstractComplementaryConfigurableAction.java,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- AbstractComplementaryConfigurableAction.java 25 Aug 2002 08:49:17 -0000
1.9
+++ AbstractComplementaryConfigurableAction.java 30 Jan 2003 08:23:39 -0000
1.10
@@ -113,7 +113,7 @@
Source resource = null;
try {
resource = resolver.resolveURI(descriptor);
- conf = (ConfigurationHelper)
AbstractComplementaryConfigurableAction.configurations.get(resource.getSystemId());
+ conf = (ConfigurationHelper)
AbstractComplementaryConfigurableAction.configurations.get(resource.getURI());
if (conf == null || (reloadable && conf.lastModified !=
resource.getLastModified())) {
getLogger().debug("(Re)Loading " + descriptor);
@@ -127,14 +127,14 @@
conf.lastModified = resource.getLastModified();
conf.configuration = builder.getConfiguration();
-
AbstractComplementaryConfigurableAction.configurations.put(resource.getSystemId(),
conf);
+
AbstractComplementaryConfigurableAction.configurations.put(resource.getURI(), conf);
} else {
getLogger().debug("Using cached configuration for " +
descriptor);
}
} catch (Exception e) {
getLogger().error("Could not configure Database mapping
environment", e);
throw new ConfigurationException("Error trying to load
configurations for resource: "
- + (resource == null ? "null" : resource.getSystemId()));
+ + (resource == null ? "null" : resource.getURI()));
} finally {
resolver.release(resource);
}
1.12 +3 -3
xml-cocoon2/src/java/org/apache/cocoon/sitemap/ContentAggregator.java
Index: ContentAggregator.java
===================================================================
RCS file:
/home/cvs/xml-cocoon2/src/java/org/apache/cocoon/sitemap/ContentAggregator.java,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- ContentAggregator.java 15 Jan 2003 08:06:37 -0000 1.11
+++ ContentAggregator.java 30 Jan 2003 08:23:39 -0000 1.12
@@ -185,14 +185,14 @@
if (part.element == null) {
buffer.append("P=")
.append(part.stripRootElement).append(':')
- .append(current.getSystemId()).append(';');
+ .append(current.getURI()).append(';');
} else {
buffer.append("P=")
.append(part.element.prefix).append(':')
.append(part.element.name)
.append('<').append(part.element.namespace).append(">:")
.append(part.stripRootElement).append(':')
- .append(current.getSystemId()).append(';');
+ .append(current.getURI()).append(';');
}
}
return buffer.toString();
1.24 +4 -4
xml-cocoon2/src/java/org/apache/cocoon/reading/ResourceReader.java
Index: ResourceReader.java
===================================================================
RCS file:
/home/cvs/xml-cocoon2/src/java/org/apache/cocoon/reading/ResourceReader.java,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -r1.23 -r1.24
--- ResourceReader.java 21 Jan 2003 09:39:43 -0000 1.23
+++ ResourceReader.java 30 Jan 2003 08:23:39 -0000 1.24
@@ -157,7 +157,7 @@
* @return The generated key hashes the src
*/
public java.io.Serializable generateKey() {
- return inputSource.getSystemId();
+ return inputSource.getURI();
}
/**
@@ -179,7 +179,7 @@
return inputSource.getLastModified();
}
final String systemId = (String) documents.get(request.getRequestURI());
- if (inputSource.getSystemId().equals(systemId)) {
+ if (inputSource.getURI().equals(systemId)) {
return inputSource.getLastModified();
}
else {
@@ -291,7 +291,7 @@
if (!quickTest) {
// if everything is ok, add this to the list of generated documents
// (see
http://marc.theaimsgroup.com/?l=xml-cocoon-dev&m=102921894301915&w=2 )
- documents.put(request.getRequestURI(), inputSource.getSystemId());
+ documents.put(request.getRequestURI(), inputSource.getURI());
}
}
catch (IOException e) {
1.50 +4 -4 xml-cocoon2/src/java/org/apache/cocoon/Cocoon.java
Index: Cocoon.java
===================================================================
RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/Cocoon.java,v
retrieving revision 1.49
retrieving revision 1.50
diff -u -r1.49 -r1.50
--- Cocoon.java 22 Jan 2003 05:19:17 -0000 1.49
+++ Cocoon.java 30 Jan 2003 08:23:39 -0000 1.50
@@ -337,12 +337,12 @@
Configuration roleConfig = null;
try {
- this.configurationFile.discardValidity();
+ this.configurationFile.refresh();
p = (SAXParser)startupManager.lookup(SAXParser.ROLE);
SAXConfigurationHandler b = new SAXConfigurationHandler();
InputStream inputStream =
ClassUtils.getResource("org/apache/cocoon/cocoon.roles").openStream();
InputSource is = new InputSource(inputStream);
- is.setSystemId(this.configurationFile.getSystemId());
+ is.setSystemId(this.configurationFile.getURI());
p.parse(is, b);
roleConfig = b.getConfiguration();
} catch (Exception e) {
@@ -394,7 +394,7 @@
throw new ConfigurationException("User-roles configuration
'"+userRoles+"' cannot be found.");
}
InputSource is = new InputSource(new
BufferedInputStream(url.openStream()));
- is.setSystemId(this.configurationFile.getSystemId());
+ is.setSystemId(this.configurationFile.getURI());
p.parse(is, b);
roleConfig = b.getConfiguration();
} catch (Exception e) {
----------------------------------------------------------------------
In case of troubles, e-mail: [EMAIL PROTECTED]
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]