Return-Path: Delivered-To: apmail-cocoon-cvs-archive@cocoon.apache.org Received: (qmail 81842 invoked by uid 500); 4 Aug 2003 09:13:31 -0000 Mailing-List: contact cvs-help@cocoon.apache.org; run by ezmlm Precedence: bulk Reply-To: dev@cocoon.apache.org list-help: list-unsubscribe: list-post: Delivered-To: mailing list cvs@cocoon.apache.org Received: (qmail 81831 invoked by uid 500); 4 Aug 2003 09:13:31 -0000 Delivered-To: apmail-cocoon-2.1-cvs@apache.org Received: (qmail 81828 invoked from network); 4 Aug 2003 09:13:31 -0000 Received: from unknown (HELO minotaur.apache.org) (209.237.227.194) by daedalus.apache.org with SMTP; 4 Aug 2003 09:13:31 -0000 Received: (qmail 66190 invoked by uid 1638); 4 Aug 2003 09:13:56 -0000 Date: 4 Aug 2003 09:13:56 -0000 Message-ID: <20030804091356.66189.qmail@minotaur.apache.org> From: bruno@apache.org To: cocoon-2.1-cvs@apache.org Subject: cvs commit: cocoon-2.1/src/blocks/apples/java/org/apache/cocoon/components/flow/apples AppleResponse.java DefaultAppleResponse.java X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N 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 . For more information on the Apache + Software Foundation, please see . + +*/ 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; + } }