/* ========================================================================= * * 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 * * modification, 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 ." * * * * 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 * * . * * * * 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 DAMAGE * * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVI- * * CES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER * * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABI- * * LITY, 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 individua- * * ls on behalf of the Apache Software Foundation and was originally created * * by Stefano Mazzocchi . For more information * * about the Apache Software Foundation please see . * * * * ------------------------------------------------------------------------- */ /** *

* Interface to Cocoon XMLForm. *

* *

*

*
Authors:
*
* Christopher Oliver. *
*
Copyright:
*
* Copyright © 2002-2003 * The Apache Software Foundation. * All rights reserved. *
*
*

*/ interface XForm { /** * Creates a new JavaScript wrapper of a Form object * @see org.apache.cocoon.components.xmlform.Form * @param id form id * @param validatorNS Namespace of validator * @param validatorDoc Validator document */ cocoon::XForm constructor(in string form_id, in string validator_namespace, in string validator_document); /** * Global variable that stores XForm instances by id */ readonly attribute cocoon::XForms forms; /** * The model object of this form: any Java bean, JavaScript, DOM, or JDOM object */ readonly attribute Object model; /** * Creates a new web continuation * @param lastCont previous web continuation * @param timeToLive expiration time for this continuation */ WebContinuation start(in WebContinuation lastCont, in long timeToLive); /** * Adds a violation to this form * @param xpath xpath expression of field that contains invalid data * @param message error message */ void addViolation(in string xpath, in string message); /** * Computes the value of an xpath expression against the model of this form * @param expr xpath expression * @return result of computing expr */ Object getValue(in string expr); /** * Returns an iterator over a nodeset value of an xpath expression * evaluated against the model of this form * @param expr xpath expression * @return java.util.Iterator representing a nodeset */ java::Iterator iterate(in string expr); /** * Sends view to presentation pipeline and waits for subsequent submission. * Automatically resends view if validation fails. * Creates two continuations: one immediately before the page is sent * and one immediately after. These are used to implement automated support * for back/forward navigation in the form. When you move forward in the * form the second continuation is invoked. When you move back from the * following page the first continuation is invoked. * @param phase view to send (and phase to validate) * @param uri presentation pipeline resource identifier * @param validator optional function invoked to perform validation */ void sendView(in string phase, in string uri, in cocoon::Function validator); /** * Sends view to presentation pipeline but doesn't wait for submission * @param view view to send * @param uri presentation pipeline uri */ void finish(in string view, in string uri); };