cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject cvs commit: xml-cocoon2/src/org/apache/cocoon/components/source SitemapSource.java
Date Tue, 10 Jul 2001 10:07:26 GMT
cziegeler    01/07/10 03:07:25

  Modified:    src/org/apache/cocoon/components/source Tag:
                        cocoon_20_branch SitemapSource.java
  Log:
  cocoon urls have its own query string to pass parameters
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.8   +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.1.2.7
  retrieving revision 1.1.2.8
  diff -u -r1.1.2.7 -r1.1.2.8
  --- SitemapSource.java	2001/07/10 08:16:55	1.1.2.7
  +++ SitemapSource.java	2001/07/10 10:07:20	1.1.2.8
  @@ -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:cziegeler@apache.org">Carsten Ziegeler</a>
  - * @version CVS $Revision: 1.1.2.7 $ $Date: 2001/07/10 08:16:55 $
  + * @version CVS $Revision: 1.1.2.8 $ $Date: 2001/07/10 10:07:20 $
    */
   
   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;
  
  
  

----------------------------------------------------------------------
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


Mime
View raw message