cziegeler    2003/10/30 04:56:49

  Modified:    src/java/org/apache/cocoon/environment/wrapper
                        MutableEnvironmentFacade.java
  Log:
  Updating environment handling
  
  Revision  Changes    Path
  1.8       +13 -52    
cocoon-2.2/src/java/org/apache/cocoon/environment/wrapper/MutableEnvironmentFacade.java
  
  Index: MutableEnvironmentFacade.java
  ===================================================================
  RCS file: 
/home/cvs/cocoon-2.2/src/java/org/apache/cocoon/environment/wrapper/MutableEnvironmentFacade.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- MutableEnvironmentFacade.java     29 Oct 2003 14:39:08 -0000      1.7
  +++ MutableEnvironmentFacade.java     30 Oct 2003 12:56:48 -0000      1.8
  @@ -76,8 +76,8 @@
       private EnvironmentWrapper env;
       
       // Track the first values set for prefix and uri
  -    private String prefix = null;
  -    private String uri = null;
  +    private String prefix;
  +    private String uri;
       
       public MutableEnvironmentFacade(EnvironmentWrapper env) {
           this.env = env;
  @@ -96,19 +96,10 @@
       public void setURI(String prefix, String uri) {
           this.env.setURI(prefix, uri);
           
  -        if (this.uri == null) {
  -            // First call : keep the values to restore them on the wrapped
  -            // enviromnent in reset()
  -            this.prefix = prefix;
  -            this.uri = uri;
  -        }
  -    }
  -
  -    /* (non-Javadoc)
  -     * @see 
org.apache.cocoon.environment.Environment#setURI(java.lang.String)
  -     */
  -    public void setURI(String value) {
  -        // TODO Auto-generated method stub
  +        // keep the values to restore them on the wrapped
  +        // enviromnent in reset()
  +        this.prefix = prefix;
  +        this.uri = uri;
       }
   
       public void setOutputStream(OutputStream os) {
  @@ -126,11 +117,7 @@
       
       public void reset() {
           this.env.reset();
  -        // TODO - If we remove the line below, do we break something
  -        //        else again? If we leave it in, the SitemapSource
  -        //        object is unusable after a call to getInputStream()
  -        //        or toSAX() :(
  -        //this.env.setURI(this.uri, this.prefix);
  +        this.env.setURI(this.uri, this.prefix);
       }
       //----------------------------------
   
  @@ -149,20 +136,6 @@
       }
   
       /* (non-Javadoc)
  -     * @see org.apache.cocoon.environment.Environment#getRootContext()
  -     */
  -    public String getRootContext() {
  -        return env.getRootContext();
  -    }
  -
  -    /* (non-Javadoc)
  -     * @see org.apache.cocoon.environment.Environment#getContext()
  -     */
  -    public String getContext() {
  -        return env.getContext();
  -    }
  -
  -    /* (non-Javadoc)
        * @see org.apache.cocoon.environment.Environment#getView()
        */
       public String getView() {
  @@ -177,24 +150,12 @@
       }
   
       /* (non-Javadoc)
  -     * @see 
org.apache.cocoon.environment.Environment#setContext(java.lang.String, 
java.lang.String, java.lang.String)
  -     */
  -    public void setContext(String prefix, String uri, String context) {
  -        env.setContext(prefix, uri, context);
  -    }
  -
  -    /* (non-Javadoc)
  -     * @see 
org.apache.cocoon.environment.Environment#changeContext(java.lang.String, 
java.lang.String)
  -     */
  -    public void changeContext(String uriprefix, String context) throws 
Exception {
  -        env.changeContext(uriprefix, context);
  -    }
  -
  -    /* (non-Javadoc)
  -     * @see org.apache.cocoon.environment.Environment#redirect(boolean, 
java.lang.String)
  +     * @see 
org.apache.cocoon.environment.Environment#redirect(java.lang.String, boolean, 
boolean)
        */
  -    public void redirect(boolean sessionmode, String url) throws IOException 
{
  -        env.redirect(sessionmode, url);
  +    public void redirect(String url, 
  +                         boolean global, 
  +                         boolean permanent) throws IOException {
  +        env.redirect(url, global, permanent);
       }
   
       /* (non-Javadoc)
  
  
  

Reply via email to