cziegeler 01/07/10 03:10:59
Modified: src/org/apache/cocoon/components/source SitemapSource.java
Added: src/org/apache/cocoon/environment/wrapper
EnvironmentWrapper.java RequestParameters.java
RequestWrapper.java
Log:
cocoon urls have its own query string to pass parameters
Revision Changes Path
1.9 +19 -4
xml-cocoon2/src/org/apache/cocoon/components/source/SitemapSource.java
Index: SitemapSource.java
===================================================================
RCS file:
/home/cvs/xml-cocoon2/src/org/apache/cocoon/components/source/SitemapSource.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- SitemapSource.java 2001/07/10 07:44:26 1.8
+++ SitemapSource.java 2001/07/10 10:10:49 1.9
@@ -29,6 +29,7 @@
import org.apache.cocoon.environment.Environment;
import org.apache.cocoon.environment.Request;
import org.apache.cocoon.environment.Source;
+import org.apache.cocoon.environment.wrapper.EnvironmentWrapper;
import org.apache.cocoon.serialization.Serializer;
import org.apache.cocoon.sitemap.Sitemap;
import org.apache.cocoon.sitemap.SitemapComponentSelector;
@@ -43,7 +44,7 @@
* Description of a source which is defined by a pipeline.
*
* @author <a href="mailto:[EMAIL PROTECTED]">Carsten Ziegeler</a>
- * @version CVS $Revision: 1.8 $ $Date: 2001/07/10 07:44:26 $
+ * @version CVS $Revision: 1.9 $ $Date: 2001/07/10 10:10:49 $
*/
public final class SitemapSource
@@ -68,7 +69,7 @@
private Processor processor;
/** The environment */
- private Environment environment;
+ private EnvironmentWrapper environment;
/** The prefix for the processing */
private String prefix;
@@ -83,7 +84,6 @@
throws IOException, ProcessingException {
this.manager = manager;
- this.environment = env;
// remove the protocol
int protocolEnd = uri.indexOf(':');
@@ -108,11 +108,26 @@
this.processor = sitemap;
}
+ // 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);
this.systemId = request.getScheme() + "://" +
request.getServerName() +
(request.getServerPort() == 80 ? "" : ":" +
request.getServerPort()) +
- request.getContextPath() + '/' + env.getURIPrefix() + uri;
+ request.getContextPath() + '/' + requestURI;
+
+ this.environment = new EnvironmentWrapper(env, requestURI, queryString);
+ queryStringPos = uri.indexOf('?');
+ if (queryStringPos != -1) {
+ uri = uri.substring(0, queryStringPos);
+ }
this.uri = uri;
this.contentLength = -1;
this.lastModificationDate = 0;
1.2 +199 -0
xml-cocoon2/src/org/apache/cocoon/environment/wrapper/EnvironmentWrapper.java
1.2 +174 -0
xml-cocoon2/src/org/apache/cocoon/environment/wrapper/RequestParameters.java
1.2 +229 -0
xml-cocoon2/src/org/apache/cocoon/environment/wrapper/RequestWrapper.java
----------------------------------------------------------------------
In case of troubles, e-mail: [EMAIL PROTECTED]
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]