cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From br...@apache.org
Subject cvs commit: cocoon-2.1/src/blocks/apples/java/org/apache/cocoon/components/flow/apples AppleResponse.java DefaultAppleResponse.java
Date Mon, 04 Aug 2003 09:13:56 GMT
bruno       2003/08/04 02:13:56

  Modified:    src/blocks/apples/java/org/apache/cocoon/components/flow/apples
                        AppleResponse.java DefaultAppleResponse.java
  Log:
   * use sendPage method in AppleResponse to line up more with flowscript
   * added redirectTo method to enable redirecting
  
  Revision  Changes    Path
  1.2       +51 -20    cocoon-2.1/src/blocks/apples/java/org/apache/cocoon/components/flow/apples/AppleResponse.java
  
  Index: AppleResponse.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/blocks/apples/java/org/apache/cocoon/components/flow/apples/AppleResponse.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- AppleResponse.java	4 Aug 2003 08:38:56 -0000	1.1
  +++ AppleResponse.java	4 Aug 2003 09:13:56 -0000	1.2
  @@ -1,10 +1,53 @@
   /*
  - * File AppleResponse.java 
  - * created by mpo
  - * on Jul 21, 2003 | 10:52:10 AM
  - * 
  - * (c) 2003 - Outerthought BVBA
  - */
  +
  + ============================================================================
  +                   The Apache Software License, Version 1.1
  + ============================================================================
  +
  + Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved.
  +
  + Redistribution and use in source and binary forms, with or without modifica-
  + tion, are permitted provided that the following conditions are met:
  +
  + 1. Redistributions of  source code must  retain the above copyright  notice,
  +    this list of conditions and the following disclaimer.
  +
  + 2. Redistributions in binary form must reproduce the above copyright notice,
  +    this list of conditions and the following disclaimer in the documentation
  +    and/or other materials provided with the distribution.
  +
  + 3. The end-user documentation included with the redistribution, if any, must
  +    include  the following  acknowledgment:  "This product includes  software
  +    developed  by the  Apache Software Foundation  (http://www.apache.org/)."
  +    Alternately, this  acknowledgment may  appear in the software itself,  if
  +    and wherever such third-party acknowledgments normally appear.
  +
  + 4. The names "Apache Cocoon" and  "Apache Software Foundation" must  not  be
  +    used to  endorse or promote  products derived from  this software without
  +    prior written permission. For written permission, please contact
  +    apache@apache.org.
  +
  + 5. Products  derived from this software may not  be called "Apache", nor may
  +    "Apache" appear  in their name,  without prior written permission  of the
  +    Apache Software Foundation.
  +
  + THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
  + INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  + FITNESS  FOR A PARTICULAR  PURPOSE ARE  DISCLAIMED.  IN NO  EVENT SHALL  THE
  + APACHE SOFTWARE  FOUNDATION  OR ITS CONTRIBUTORS  BE LIABLE FOR  ANY DIRECT,
  + INDIRECT, INCIDENTAL, SPECIAL,  EXEMPLARY, OR CONSEQUENTIAL  DAMAGES (INCLU-
  + DING, BUT NOT LIMITED TO, PROCUREMENT  OF SUBSTITUTE GOODS OR SERVICES; LOSS
  + OF USE, DATA, OR  PROFITS; OR BUSINESS  INTERRUPTION)  HOWEVER CAUSED AND ON
  + ANY  THEORY OF LIABILITY,  WHETHER  IN CONTRACT,  STRICT LIABILITY,  OR TORT
  + (INCLUDING  NEGLIGENCE OR  OTHERWISE) ARISING IN  ANY WAY OUT OF THE  USE OF
  + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  +
  + This software  consists of voluntary contributions made  by many individuals
  + on  behalf of the Apache Software  Foundation and was  originally created by
  + Stefano Mazzocchi  <stefano@apache.org>. For more  information on the Apache
  + Software Foundation, please see <http://www.apache.org/>.
  +
  +*/
   package org.apache.cocoon.components.flow.apples;
   
   
  @@ -13,20 +56,8 @@
    * AppleResponse defines the parts of the 'response' an AppleController can set.
    */
   public interface AppleResponse {
  -    
   
  -    /**
  -     * Sets the uri of the selected cocoon pipeline for publication of the result.
  -     * @param uri the uri that selects an (internal) publication pipe. 
  -     * @see ApplesProcessor#forwardTo
  -     */
  -    public void setURI(String uri);
  -    
  -    /**
  -     * Sets the 'bizdata' object to be sent as the flow's 'context-object' through 
  -     * the selected publication pipe.
  -     * @param data the 'bizdata' object
  -     */
  -    public void setData(Object data);
  +    public void sendPage(String uri, Object bizData);
  +    public void redirectTo(String uri);
   
   }
  
  
  
  1.2       +16 -21    cocoon-2.1/src/blocks/apples/java/org/apache/cocoon/components/flow/apples/DefaultAppleResponse.java
  
  Index: DefaultAppleResponse.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/blocks/apples/java/org/apache/cocoon/components/flow/apples/DefaultAppleResponse.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- DefaultAppleResponse.java	4 Aug 2003 08:38:56 -0000	1.1
  +++ DefaultAppleResponse.java	4 Aug 2003 09:13:56 -0000	1.2
  @@ -54,33 +54,28 @@
   
       private String uri;
       private Object data;
  -    
  -    /**
  -     * Gets the 'bizdata' that was prepared in this response by the AppleController.
  -     * This will be passed as the flow's so called 'context-object' through the
  -     * selected cocoon pipeline.
  -     */
  -    Object getData() {
  -        return data;
  -    }
  +    private boolean redirect = false;
   
  -    /**
  -     * Gets the 'uri' of the pipeline that was selected and set in this response 
  -     * by the AppleController.
  -     * This will be use to select the publication pipeline.
  -     */
  -    String getURI() {
  -        return uri;
  +    public void sendPage(String uri, Object bizData) {
  +        this.uri = uri;
  +        this.data = bizData;
  +        this.redirect = false;
       }
   
  -
  -    public void setData(Object object) {
  -        data = object;
  +    public void redirectTo(String uri) {
  +        this.uri = uri;
  +        this.redirect = true;
       }
   
  +    protected boolean isRedirect() {
  +        return redirect;
  +    }
   
  -    public void setURI(String string) {
  -        uri = string;
  +    protected String getURI() {
  +        return uri;
       }
   
  +    protected Object getData() {
  +        return data;
  +    }
   }
  
  
  

Mime
View raw message