You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@cocoon.apache.org by cz...@apache.org on 2004/07/07 09:58:50 UTC

cvs commit: cocoon-2.1/src/java/org/apache/cocoon/environment/commandline CommandLineRequest.java

cziegeler    2004/07/07 00:58:50

  Modified:    .        status.xml
               src/java/org/apache/cocoon/environment Request.java
               src/java/org/apache/cocoon/environment/wrapper
                        RequestWrapper.java
               src/java/org/apache/cocoon/components/flow/javascript/fom
                        FOM_Cocoon.java
               src/blocks/portal/java/org/apache/cocoon/environment/portlet
                        PortletRequest.java
               src/java/org/apache/cocoon/environment/http HttpRequest.java
               src/test/org/apache/cocoon/environment/mock MockRequest.java
               src/java/org/apache/cocoon/environment/commandline
                        CommandLineRequest.java
  Added:       src/java/org/apache/cocoon/environment/wrapper
                        AbstractRequestWrapper.java
  Log:
       New getSitemapPath() method on the Request object to get the path to the
       current sitemap even if you are in a sub sitemap. Added an abstract request
       wrapper class as well.
  
  Revision  Changes    Path
  1.387     +6 -1      cocoon-2.1/status.xml
  
  Index: status.xml
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/status.xml,v
  retrieving revision 1.386
  retrieving revision 1.387
  diff -u -r1.386 -r1.387
  --- status.xml	6 Jul 2004 23:23:39 -0000	1.386
  +++ status.xml	7 Jul 2004 07:58:47 -0000	1.387
  @@ -204,6 +204,11 @@
   
     <changes>
    <release version="@version@" date="@date@">
  +   <action dev="CZ" type="add">
  +     New getSitemapPath() method on the Request object to get the path to the
  +     current sitemap even if you are in a sub sitemap. Added an abstract request
  +     wrapper class as well.
  +   </action>
      <action dev="VG" type="add">
        Portal block: Added ManagedCocoonPortlet, to be used together with
        CocoonServlet or CocoonPortlet.
  
  
  
  1.7       +18 -4     cocoon-2.1/src/java/org/apache/cocoon/environment/Request.java
  
  Index: Request.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/java/org/apache/cocoon/environment/Request.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- Request.java	5 Mar 2004 13:02:54 -0000	1.6
  +++ Request.java	7 Jul 2004 07:58:49 -0000	1.7
  @@ -656,14 +656,14 @@
        * <tr><td>HEAD /xyz?a=b HTTP/1.1<td><td>/xyz
        * </table>
        * </blockquote>
  +     * 
  +     * For internal requests, this method returns
  +     * the information for the original/external request!
        *
        * @return                a <code>String</code> containing
        *                        the part of the URL from the
        *                        protocol name up to the query string
  -     *
  -     *
        */
  -
       String getRequestURI();
   
       /**
  @@ -685,6 +685,20 @@
        */
       String getSitemapURI();
   
  +    /**
  +     * <p>
  +     * Returns the path to the sitemap of the requested resource as interpreted 
  +     * by the sitemap.
  +     * For example, if your webapp is mounted at "webapp" and the HTTP request
  +     * is for "webapp/foo", this method returns "webapp/". Consequently, if the
  +     * request is for "foo", this method returns the empty string.
  +     * </p>
  +     *
  +     * @return a <code>String</code> containing the path to the sitemap
  +     * @since 2.2
  +     */
  +    String getSitemapPath();
  +    
       /**
        *
        * Returns the part of this request's URL that calls
  
  
  
  1.8       +37 -177   cocoon-2.1/src/java/org/apache/cocoon/environment/wrapper/RequestWrapper.java
  
  Index: RequestWrapper.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/java/org/apache/cocoon/environment/wrapper/RequestWrapper.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- RequestWrapper.java	11 Mar 2004 14:21:56 -0000	1.7
  +++ RequestWrapper.java	7 Jul 2004 07:58:49 -0000	1.8
  @@ -15,18 +15,13 @@
    */
   package org.apache.cocoon.environment.wrapper;
   
  -import java.security.Principal;
   import java.util.Enumeration;
   import java.util.HashSet;
   import java.util.Iterator;
  -import java.util.Locale;
  -import java.util.Map;
   import java.util.Set;
   
  -import org.apache.cocoon.environment.Cookie;
   import org.apache.cocoon.environment.Environment;
   import org.apache.cocoon.environment.Request;
  -import org.apache.cocoon.environment.Session;
   
   
   /**
  @@ -37,10 +32,13 @@
    * @author <a href="mailto:cziegeler@apache.org">Carsten Ziegeler</a>
    * @version CVS $Id$
    */
  -public final class RequestWrapper implements Request {
  -
  -    /** The real {@link Request} object */
  -    private final Request req;
  +/**
  + * @author CZiegeler
  + *
  + * To change the template for this generated type comment go to
  + * Window - Preferences - Java - Code Generation - Code and Comments
  + */
  +public final class RequestWrapper extends AbstractRequestWrapper {
   
       /** The query string */
       private String queryString;
  @@ -75,12 +73,12 @@
                             String  queryString,
                             Environment env,
                             boolean rawMode) {
  +        super(request);
           this.environment = env;
  -        this.req = request;
           this.queryString = queryString;
           this.parameters = new RequestParameters(queryString);
           this.rawMode = rawMode;
  -        if (this.req.getQueryString() != null && this.rawMode == false) {
  +        if (this.req.getQueryString() != null && !this.rawMode) {
               if (this.queryString == null)
                   this.queryString = this.req.getQueryString();
               else
  @@ -89,45 +87,23 @@
           this.requestURI = this.req.getRequestURI();
       }
   
  -    public Object get(String name) {
  -        return this.req.get(name);
  -    }
  -
  -    public Object getAttribute(String name) {
  -        return this.req.getAttribute(name);
  -    }
  -
  -    public Enumeration getAttributeNames() {
  -        return this.req.getAttributeNames();
  -    }
  -
  -    public String getCharacterEncoding() {
  -        return this.req.getCharacterEncoding();
  -    }
  -
  -    public void setCharacterEncoding(String enc)
  -    throws java.io.UnsupportedEncodingException {
  -        this.req.setCharacterEncoding(enc);
  -    }
  -
  -    public int getContentLength() {
  -        return this.req.getContentLength();
  -    }
  -
  -    public String getContentType() {
  -        return this.req.getContentType();
  -    }
  -
  +    /* (non-Javadoc)
  +     * @see org.apache.cocoon.environment.Request#getParameter(java.lang.String)
  +     */
       public String getParameter(String name) {
           String value = this.parameters.getParameter(name);
  -        if (value == null && this.rawMode == false)
  +        if (value == null && !this.rawMode) {
               return this.req.getParameter(name);
  -        else
  +        } else {
               return value;
  +        }
       }
   
  +    /* (non-Javadoc)
  +     * @see org.apache.cocoon.environment.Request#getParameterNames()
  +     */
       public Enumeration getParameterNames() {
  -        if ( this.rawMode == false ) {
  +        if ( !this.rawMode ) {
               // put all parameter names into a set
               Set parameterNames = new HashSet();
               Enumeration names = this.parameters.getParameterNames();
  @@ -156,8 +132,11 @@
           public Object nextElement() { return iter.next(); }
       }
   
  +    /* (non-Javadoc)
  +     * @see org.apache.cocoon.environment.Request#getParameterValues(java.lang.String)
  +     */
       public String[] getParameterValues(String name) {
  -        if ( this.rawMode == false) {
  +        if ( !this.rawMode ) {
               String[] values = this.parameters.getParameterValues(name);
               String[] inherited = this.req.getParameterValues(name);
               if (inherited == null) return values;
  @@ -171,153 +150,34 @@
           }
       }
   
  -    public String getProtocol() {
  -        return this.req.getProtocol();
  -    }
  -
  -    public String getScheme() {
  -        return this.req.getScheme();
  -    }
  -
  -    public String getServerName() {
  -        return this.req.getServerName();
  -    }
  -
  -    public int getServerPort() {
  -        return this.req.getServerPort();
  -    }
  -
  -    public String getRemoteAddr() {
  -        return this.req.getRemoteAddr();
  -    }
  -
  -    public String getRemoteHost() {
  -        return this.req.getRemoteHost();
  -    }
  -
  -    public void setAttribute(String name, Object o) {
  -        this.req.setAttribute(name, o);
  -    }
  -
  -    /**
  -     * Remove one attriube
  +    /* (non-Javadoc)
  +     * @see org.apache.cocoon.environment.Request#getQueryString()
        */
  -    public void removeAttribute(String name) {
  -        this.req.removeAttribute(name);
  -    }
  -
  -    public Locale getLocale() {
  -        return this.req.getLocale();
  -    }
  -
  -    public Enumeration getLocales() {
  -        return this.req.getLocales();
  -    }
  -
  -    public boolean isSecure() {
  -        return this.req.isSecure();
  -    }
  -
  -    public Cookie[] getCookies() {
  -        return this.req.getCookies();
  -    }
  -
  -    public Map getCookieMap() {
  -        return this.req.getCookieMap();
  -    }
  -
  -    public long getDateHeader(String name) {
  -        return this.req.getDateHeader(name);
  -    }
  -
  -    public String getHeader(String name) {
  -        return this.req.getHeader(name);
  -    }
  -
  -    public Enumeration getHeaders(String name) {
  -        return this.req.getHeaders(name);
  -    }
  -
  -    public Enumeration getHeaderNames() {
  -        return this.req.getHeaderNames();
  -    }
  -
  -    public String getMethod() {
  -        return this.req.getMethod();
  -    }
  -
  -    public String getPathInfo() {
  -        return this.req.getPathInfo();
  -    }
  -
  -    public String getPathTranslated() {
  -        return this.req.getPathTranslated();
  -    }
  -
  -    public String getContextPath() {
  -        return this.req.getContextPath();
  -    }
  -
       public String getQueryString() {
           return this.queryString;
       }
   
  -    public String getRemoteUser() {
  -        return this.req.getRemoteUser();
  -    }
  -
  -    public String getRequestedSessionId() {
  -        return this.req.getRequestedSessionId();
  -    }
  -
  +    /* (non-Javadoc)
  +     * @see org.apache.cocoon.environment.Request#getRequestURI()
  +     */
       public String getRequestURI() {
           return this.requestURI;
       }
   
  +    /* (non-Javadoc)
  +     * @see org.apache.cocoon.environment.Request#getSitemapURI()
  +     */
       public String getSitemapURI() {
           return this.environment.getURI();
       }
   
  -    public String getServletPath() {
  -        return this.req.getServletPath();
  -    }
  -
  -    public Session getSession(boolean create) {
  -        return this.req.getSession(create);
  -    }
  -
  -    public Session getSession() {
  -        return this.req.getSession();
  -    }
  -
  -    public boolean isRequestedSessionIdValid() {
  -        return this.req.isRequestedSessionIdValid();
  -    }
  -
  -    public boolean isRequestedSessionIdFromCookie()  {
  -        return this.req.isRequestedSessionIdFromCookie();
  -    }
  -
  -    public boolean isRequestedSessionIdFromURL() {
  -        return this.req.isRequestedSessionIdFromURL();
  -    }
  -
  -    public boolean isRequestedSessionIdFromUrl() {
  -        return this.req.isRequestedSessionIdFromURL();
  -    }
  -
  -    public Principal getUserPrincipal() {
  -        return this.req.getUserPrincipal();
  -    }
  -
  -    public boolean isUserInRole(String role) {
  -        return this.req.isUserInRole(role);
  +    /* (non-Javadoc)
  +     * @see org.apache.cocoon.environment.Request#getSitemapPath()
  +     */
  +    public String getSitemapPath() {
  +        return this.environment.getURIPrefix();
       }
   
  -    public String getAuthType() {
  -        return this.req.getAuthType();
  -    }   
  -    
       public void setRequestURI(String prefix, String uri) {
           StringBuffer buffer = new StringBuffer(this.getContextPath());
           buffer.append('/');
  
  
  
  1.1                  cocoon-2.1/src/java/org/apache/cocoon/environment/wrapper/AbstractRequestWrapper.java
  
  Index: AbstractRequestWrapper.java
  ===================================================================
  /*
   * Copyright 1999-2004 The Apache Software Foundation.
   * 
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   * 
   *      http://www.apache.org/licenses/LICENSE-2.0
   * 
   * Unless required by applicable law or agreed to in writing, software
   * distributed under the License is distributed on an "AS IS" BASIS,
   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   * See the License for the specific language governing permissions and
   * limitations under the License.
   */
  package org.apache.cocoon.environment.wrapper;
  
  import java.security.Principal;
  import java.util.Enumeration;
  import java.util.Locale;
  import java.util.Map;
  
  import org.apache.cocoon.environment.Cookie;
  import org.apache.cocoon.environment.Request;
  import org.apache.cocoon.environment.Session;
  
  
  /**
   * This is a wrapper class for the <code>Request</code> object. It
   * just forwards every methods. It is the base class for all wrapper
   * implementations.
   *
   * @author <a href="mailto:cziegeler@apache.org">Carsten Ziegeler</a>
   * @version CVS $Id: AbstractRequestWrapper.java,v 1.1 2004/07/07 07:58:49 cziegeler Exp $
   * @since 2.2
   */
  public abstract class AbstractRequestWrapper implements Request {
  
      /** The real {@link Request} object */
      protected final Request req;
  
      /**
       * Constructor
       */
      public AbstractRequestWrapper(Request request) {
          this.req = request;
      }
  
      /* (non-Javadoc)
       * @see org.apache.cocoon.environment.Request#get(java.lang.String)
       */
      public Object get(String name) {
          return this.req.get(name);
      }
  
      /* (non-Javadoc)
       * @see org.apache.cocoon.environment.Request#getAttribute(java.lang.String)
       */
      public Object getAttribute(String name) {
          return this.req.getAttribute(name);
      }
  
      /* (non-Javadoc)
       * @see org.apache.cocoon.environment.Request#getAttributeNames()
       */
      public Enumeration getAttributeNames() {
          return this.req.getAttributeNames();
      }
  
      /* (non-Javadoc)
       * @see org.apache.cocoon.environment.Request#getCharacterEncoding()
       */
      public String getCharacterEncoding() {
          return this.req.getCharacterEncoding();
      }
  
      /* (non-Javadoc)
       * @see org.apache.cocoon.environment.Request#setCharacterEncoding(java.lang.String)
       */
      public void setCharacterEncoding(String enc)
      throws java.io.UnsupportedEncodingException {
          this.req.setCharacterEncoding(enc);
      }
  
      /* (non-Javadoc)
       * @see org.apache.cocoon.environment.Request#getContentLength()
       */
      public int getContentLength() {
          return this.req.getContentLength();
      }
  
      /* (non-Javadoc)
       * @see org.apache.cocoon.environment.Request#getContentType()
       */
      public String getContentType() {
          return this.req.getContentType();
      }
  
      /* (non-Javadoc)
       * @see org.apache.cocoon.environment.Request#getParameter(java.lang.String)
       */
      public String getParameter(String name) {
          return this.req.getParameter(name);
      }
  
      /* (non-Javadoc)
       * @see org.apache.cocoon.environment.Request#getParameterNames()
       */
      public Enumeration getParameterNames() {
          return this.req.getParameterNames();
      }
  
      /* (non-Javadoc)
       * @see org.apache.cocoon.environment.Request#getParameterValues(java.lang.String)
       */
      public String[] getParameterValues(String name) {
          return this.req.getParameterValues(name);
      }
  
      /* (non-Javadoc)
       * @see org.apache.cocoon.environment.Request#getProtocol()
       */
      public String getProtocol() {
          return this.req.getProtocol();
      }
  
      /* (non-Javadoc)
       * @see org.apache.cocoon.environment.Request#getScheme()
       */
      public String getScheme() {
          return this.req.getScheme();
      }
  
      /* (non-Javadoc)
       * @see org.apache.cocoon.environment.Request#getServerName()
       */
      public String getServerName() {
          return this.req.getServerName();
      }
  
      /* (non-Javadoc)
       * @see org.apache.cocoon.environment.Request#getServerPort()
       */
      public int getServerPort() {
          return this.req.getServerPort();
      }
  
      /* (non-Javadoc)
       * @see org.apache.cocoon.environment.Request#getRemoteAddr()
       */
      public String getRemoteAddr() {
          return this.req.getRemoteAddr();
      }
  
      /* (non-Javadoc)
       * @see org.apache.cocoon.environment.Request#getRemoteHost()
       */
      public String getRemoteHost() {
          return this.req.getRemoteHost();
      }
  
      /* (non-Javadoc)
       * @see org.apache.cocoon.environment.Request#setAttribute(java.lang.String, java.lang.Object)
       */
      public void setAttribute(String name, Object o) {
          this.req.setAttribute(name, o);
      }
  
      /* (non-Javadoc)
       * @see org.apache.cocoon.environment.Request#removeAttribute(java.lang.String)
       */
      public void removeAttribute(String name) {
          this.req.removeAttribute(name);
      }
  
      /* (non-Javadoc)
       * @see org.apache.cocoon.environment.Request#getLocale()
       */
      public Locale getLocale() {
          return this.req.getLocale();
      }
  
      /* (non-Javadoc)
       * @see org.apache.cocoon.environment.Request#getLocales()
       */
      public Enumeration getLocales() {
          return this.req.getLocales();
      }
  
      /* (non-Javadoc)
       * @see org.apache.cocoon.environment.Request#isSecure()
       */
      public boolean isSecure() {
          return this.req.isSecure();
      }
  
      /* (non-Javadoc)
       * @see org.apache.cocoon.environment.Request#getCookies()
       */
      public Cookie[] getCookies() {
          return this.req.getCookies();
      }
  
      /* (non-Javadoc)
       * @see org.apache.cocoon.environment.Request#getCookieMap()
       */
      public Map getCookieMap() {
          return this.req.getCookieMap();
      }
  
      /* (non-Javadoc)
       * @see org.apache.cocoon.environment.Request#getDateHeader(java.lang.String)
       */
      public long getDateHeader(String name) {
          return this.req.getDateHeader(name);
      }
  
      /* (non-Javadoc)
       * @see org.apache.cocoon.environment.Request#getHeader(java.lang.String)
       */
      public String getHeader(String name) {
          return this.req.getHeader(name);
      }
  
      /* (non-Javadoc)
       * @see org.apache.cocoon.environment.Request#getHeaders(java.lang.String)
       */
      public Enumeration getHeaders(String name) {
          return this.req.getHeaders(name);
      }
  
      /* (non-Javadoc)
       * @see org.apache.cocoon.environment.Request#getHeaderNames()
       */
      public Enumeration getHeaderNames() {
          return this.req.getHeaderNames();
      }
  
      /* (non-Javadoc)
       * @see org.apache.cocoon.environment.Request#getMethod()
       */
      public String getMethod() {
          return this.req.getMethod();
      }
  
      /* (non-Javadoc)
       * @see org.apache.cocoon.environment.Request#getPathInfo()
       */
      public String getPathInfo() {
          return this.req.getPathInfo();
      }
  
      /* (non-Javadoc)
       * @see org.apache.cocoon.environment.Request#getPathTranslated()
       */
      public String getPathTranslated() {
          return this.req.getPathTranslated();
      }
  
      /* (non-Javadoc)
       * @see org.apache.cocoon.environment.Request#getContextPath()
       */
      public String getContextPath() {
          return this.req.getContextPath();
      }
  
      /* (non-Javadoc)
       * @see org.apache.cocoon.environment.Request#getQueryString()
       */
      public String getQueryString() {
          return this.req.getQueryString();
      }
  
      /* (non-Javadoc)
       * @see org.apache.cocoon.environment.Request#getRemoteUser()
       */
      public String getRemoteUser() {
          return this.req.getRemoteUser();
      }
  
      /* (non-Javadoc)
       * @see org.apache.cocoon.environment.Request#getRequestedSessionId()
       */
      public String getRequestedSessionId() {
          return this.req.getRequestedSessionId();
      }
  
      /* (non-Javadoc)
       * @see org.apache.cocoon.environment.Request#getRequestURI()
       */
      public String getRequestURI() {
          return this.req.getRequestURI();
      }
  
      /* (non-Javadoc)
       * @see org.apache.cocoon.environment.Request#getSitemapURI()
       */
      public String getSitemapURI() {
          return this.req.getSitemapURI();
      }
  
      /* (non-Javadoc)
       * @see org.apache.cocoon.environment.Request#getSitemapPath()
       */
      public String getSitemapPath() {
          return this.req.getSitemapPath();
      }
  
      /* (non-Javadoc)
       * @see org.apache.cocoon.environment.Request#getServletPath()
       */
      public String getServletPath() {
          return this.req.getServletPath();
      }
  
      /* (non-Javadoc)
       * @see org.apache.cocoon.environment.Request#getSession(boolean)
       */
      public Session getSession(boolean create) {
          return this.req.getSession(create);
      }
  
      /* (non-Javadoc)
       * @see org.apache.cocoon.environment.Request#getSession()
       */
      public Session getSession() {
          return this.req.getSession();
      }
  
      /* (non-Javadoc)
       * @see org.apache.cocoon.environment.Request#isRequestedSessionIdValid()
       */
      public boolean isRequestedSessionIdValid() {
          return this.req.isRequestedSessionIdValid();
      }
  
      /* (non-Javadoc)
       * @see org.apache.cocoon.environment.Request#isRequestedSessionIdFromCookie()
       */
      public boolean isRequestedSessionIdFromCookie()  {
          return this.req.isRequestedSessionIdFromCookie();
      }
  
      /* (non-Javadoc)
       * @see org.apache.cocoon.environment.Request#isRequestedSessionIdFromURL()
       */
      public boolean isRequestedSessionIdFromURL() {
          return this.req.isRequestedSessionIdFromURL();
      }
  
      /* (non-Javadoc)
       * @see org.apache.cocoon.environment.Request#getUserPrincipal()
       */
      public Principal getUserPrincipal() {
          return this.req.getUserPrincipal();
      }
  
      /* (non-Javadoc)
       * @see org.apache.cocoon.environment.Request#isUserInRole(java.lang.String)
       */
      public boolean isUserInRole(String role) {
          return this.req.isUserInRole(role);
      }
  
      /* (non-Javadoc)
       * @see org.apache.cocoon.environment.Request#getAuthType()
       */
      public String getAuthType() {
          return this.req.getAuthType();
      }       
  }
  
  
  
  1.37      +5 -1      cocoon-2.1/src/java/org/apache/cocoon/components/flow/javascript/fom/FOM_Cocoon.java
  
  Index: FOM_Cocoon.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/java/org/apache/cocoon/components/flow/javascript/fom/FOM_Cocoon.java,v
  retrieving revision 1.36
  retrieving revision 1.37
  diff -u -r1.36 -r1.37
  --- FOM_Cocoon.java	28 May 2004 12:20:20 -0000	1.36
  +++ FOM_Cocoon.java	7 Jul 2004 07:58:49 -0000	1.37
  @@ -766,6 +766,10 @@
               return request.getSitemapURI();
           }
   
  +        public String getSitemapPath() {
  +            return request.getSitemapPath();
  +        }
  +
           public String getServletPath() {
               return request.getServletPath();
           }
  
  
  
  1.4       +11 -1     cocoon-2.1/src/blocks/portal/java/org/apache/cocoon/environment/portlet/PortletRequest.java
  
  Index: PortletRequest.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/blocks/portal/java/org/apache/cocoon/environment/portlet/PortletRequest.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- PortletRequest.java	18 Jun 2004 16:45:57 -0000	1.3
  +++ PortletRequest.java	7 Jul 2004 07:58:49 -0000	1.4
  @@ -249,8 +249,18 @@
           return this.portletRequestURI;
       }
   
  +    /* (non-Javadoc)
  +     * @see org.apache.cocoon.environment.Request#getSitemapURI()
  +     */
       public String getSitemapURI() {
           return this.environment.getURI();
  +    }
  +
  +    /* (non-Javadoc)
  +     * @see org.apache.cocoon.environment.Request#getSitemapPath()
  +     */
  +    public String getSitemapPath() {
  +        return this.environment.getURIPrefix();
       }
   
       public String getServletPath() {
  
  
  
  1.9       +17 -1     cocoon-2.1/src/java/org/apache/cocoon/environment/http/HttpRequest.java
  
  Index: HttpRequest.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/java/org/apache/cocoon/environment/http/HttpRequest.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- HttpRequest.java	5 Mar 2004 13:02:55 -0000	1.8
  +++ HttpRequest.java	7 Jul 2004 07:58:50 -0000	1.9
  @@ -201,14 +201,30 @@
           return this.reqURI;
       }
   
  +    /* (non-Javadoc)
  +     * @see org.apache.cocoon.environment.Request#getSitemapURI()
  +     */
       public String getSitemapURI() {
           return this.env.getURI();
       }
   
  +    /* (non-Javadoc)
  +     * @see org.apache.cocoon.environment.Request#getSitemapPath()
  +     */
  +    public String getSitemapPath() {
  +        return this.env.getURIPrefix();
  +    }
  +
  +    /* (non-Javadoc)
  +     * @see org.apache.cocoon.environment.Request#getServletPath()
  +     */
       public String getServletPath() {
           return this.req.getServletPath();
       }
   
  +    /* (non-Javadoc)
  +     * @see org.apache.cocoon.environment.Request#getSession(boolean)
  +     */
       public Session getSession(boolean create) {
           javax.servlet.http.HttpSession serverSession = this.req.getSession(create);
           if ( null != serverSession) {
  
  
  
  1.12      +4 -0      cocoon-2.1/src/test/org/apache/cocoon/environment/mock/MockRequest.java
  
  Index: MockRequest.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/test/org/apache/cocoon/environment/mock/MockRequest.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- MockRequest.java	4 Jul 2004 17:53:34 -0000	1.11
  +++ MockRequest.java	7 Jul 2004 07:58:50 -0000	1.12
  @@ -269,6 +269,10 @@
           return requestURI;
       }
       
  +    public String getSitemapPath() {
  +        return "";
  +    }
  +
       public String getServletPath() {
           return servletPath;
       }
  
  
  
  1.10      +8 -1      cocoon-2.1/src/java/org/apache/cocoon/environment/commandline/CommandLineRequest.java
  
  Index: CommandLineRequest.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/java/org/apache/cocoon/environment/commandline/CommandLineRequest.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- CommandLineRequest.java	5 Mar 2004 13:02:54 -0000	1.9
  +++ CommandLineRequest.java	7 Jul 2004 07:58:50 -0000	1.10
  @@ -130,6 +130,13 @@
           return this.env.getURI();
       }
       
  +    /* (non-Javadoc)
  +     * @see org.apache.cocoon.environment.Request#getSitemapPath()
  +     */
  +    public String getSitemapPath() {
  +        return this.env.getURIPrefix();
  +    }
  +
       public String getQueryString() { return null; } // use parameters instead
       public String getPathTranslated() { return null; } // FIXME (SM) this is legal but should we do something more?