vgritsenko 02/01/31 08:44:23 Modified: . changes.xml src/java/org/apache/cocoon/components/pipeline AbstractEventPipeline.java src/java/org/apache/cocoon/components/source SitemapSource.java Log: Change SystemID for cocoon: resources. Revision Changes Path 1.87 +8 -2 xml-cocoon2/changes.xml Index: changes.xml =================================================================== RCS file: /home/cvs/xml-cocoon2/changes.xml,v retrieving revision 1.86 retrieving revision 1.87 diff -u -r1.86 -r1.87 --- changes.xml 31 Jan 2002 16:11:32 -0000 1.86 +++ changes.xml 31 Jan 2002 16:44:22 -0000 1.87 @@ -4,7 +4,7 @@ <!-- History of Cocoon changes - $Id: changes.xml,v 1.86 2002/01/31 16:11:32 haul Exp $ + $Id: changes.xml,v 1.87 2002/01/31 16:44:22 vgritsenko Exp $ --> <changes title="History of Changes"> @@ -31,9 +31,15 @@ </devs> <release version="@version@" date="@date@"> + <action dev="VG" type="update"> + SystemID for cocoon: pseudo-protocol URIs changed from the form of + <schema>:\\<host>:<port>\path\to\resource\from\the\root\sitemap + to the form cocoon:\\path\to\resource\from\the\root\sitemap. This provides + portability for compiled resources generated from the cocoon: sources. + </action> <action dev="CH" type="add"> Stored Procedure support for esql plus ability to obtain and use a result - set from any column just like a nested query. + set from any column just like a nested query. </action> </release> <release version="2.0.1" date="January 31, 2002"> 1.2 +2 -2 xml-cocoon2/src/java/org/apache/cocoon/components/pipeline/AbstractEventPipeline.java Index: AbstractEventPipeline.java =================================================================== RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/pipeline/AbstractEventPipeline.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- AbstractEventPipeline.java 3 Jan 2002 12:31:12 -0000 1.1 +++ AbstractEventPipeline.java 31 Jan 2002 16:44:23 -0000 1.2 @@ -33,7 +33,7 @@ * @author <a href="mailto:[EMAIL PROTECTED]">Sylvain Wallez</a * @author <a href="mailto:[EMAIL PROTECTED]">Nicola Ken Barozzi</a> * @author <a href="mailto:[EMAIL PROTECTED]">Peter Royal</a> - * @version CVS $Revision: 1.1 $ $Date: 2002/01/03 12:31:12 $ + * @version CVS $Revision: 1.2 $ $Date: 2002/01/31 16:44:23 $ */ public abstract class AbstractEventPipeline extends AbstractXMLProducer @@ -86,7 +86,7 @@ if (this.generator != null) { throw new ProcessingException ("Generator already set. You can only select one Generator (" + role + ")"); } - this.generatorSelector = (ComponentSelector) this.newManager.lookup(Generator.ROLE + "Selector"); + this.generatorSelector = (ComponentSelector) this.newManager.lookup(Generator.ROLE + "Selector"); this.generator = (Generator) this.generatorSelector.select(role); this.generatorSource = source; this.generatorParam = param; 1.3 +16 -21 xml-cocoon2/src/java/org/apache/cocoon/components/source/SitemapSource.java Index: SitemapSource.java =================================================================== RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/source/SitemapSource.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- SitemapSource.java 15 Jan 2002 11:10:52 -0000 1.2 +++ SitemapSource.java 31 Jan 2002 16:44:23 -0000 1.3 @@ -45,7 +45,7 @@ * Description of a source which is defined by a pipeline. * * @author <a href="mailto:[EMAIL PROTECTED]">Carsten Ziegeler</a> - * @version CVS $Revision: 1.2 $ $Date: 2002/01/15 11:10:52 $ + * @version CVS $Revision: 1.3 $ $Date: 2002/01/31 16:44:23 $ */ public final class SitemapSource @@ -100,6 +100,7 @@ this.manager = manager; this.setLogger(logger); + // remove the protocol int protocolEnd = uri.indexOf(':'); if (protocolEnd != -1) { @@ -118,35 +119,29 @@ this.prefix = ""; // start at the root this.processor = processor; } else if (uri.startsWith("/")) { - this.prefix = null; uri = uri.substring(1); + this.prefix = null; this.processor = sitemap; + } else { + throw new ProcessingException("Malformed cocoon URI."); } - // build the request uri which is relative to the context // create the queryString (if available) - String requestURI = (this.prefix == null ? env.getURIPrefix() + uri : uri); String queryString = null; - int queryStringPos = requestURI.indexOf('?'); - if (queryStringPos != -1) { - queryString = requestURI.substring(queryStringPos+1); - requestURI = requestURI.substring(0, queryStringPos); - } - Request request= (Request)env.getObjectModel().get(Constants.REQUEST_OBJECT); - boolean isDefaultPort = "http".equalsIgnoreCase(request.getScheme()) && 80 == request.getServerPort(); - StringBuffer sysID = new StringBuffer(request.getScheme()).append("://") - .append(request.getServerName()); - - if ( ! isDefaultPort ) { - sysID.append(':').append(request.getServerPort()); - } - sysID.append(request.getContextPath()).append('/').append(requestURI); - queryStringPos = uri.indexOf('?'); + int queryStringPos = uri.indexOf('?'); if (queryStringPos != -1) { + queryString = uri.substring(queryStringPos + 1); uri = uri.substring(0, queryStringPos); - sysID.append('?').append(queryString); } - this.systemId = sysID.toString(); + + // build the request uri which is relative to the context + String requestURI = (this.prefix == null ? env.getURIPrefix() + uri : uri); + + // create system ID + this.systemId = queryString == null ? + "cocoon://" + requestURI : + "cocoon://" + requestURI + "?" + queryString; + this.environment = new EnvironmentWrapper(env, requestURI, queryString, logger); this.uri = uri; this.refresh();
---------------------------------------------------------------------- In case of troubles, e-mail: [EMAIL PROTECTED] To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]