    001    // Copyright 2010 The Apache Software Foundation
    002    //
    003    // Licensed under the Apache License, Version 2.0 (the "License");
    004    // you may not use this file except in compliance with the License.
    005    // You may obtain a copy of the License at
    006    //
    007    // http://www.apache.org/licenses/LICENSE-2.0
    008    //
    009    // Unless required by applicable law or agreed to in writing, software
    010    // distributed under the License is distributed on an "AS IS" BASIS,
    011    // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    012    // See the License for the specific language governing permissions and
    013    // limitations under the License.
    014
    015    package org.apache.tapestry5.internal.services.ajax;
    016
    017    import org.apache.tapestry5.MarkupWriter;
    018    import org.apache.tapestry5.ValidationTracker;
    019    import org.apache.tapestry5.ajax.MultiZoneUpdate;
    020    import org.apache.tapestry5.services.FormSupport;
    021
    022    /**
    023     * Coordinates the rendering of page partials in the context of an
    024     * Ajax update to an existing Form.
    025     *
    026     * @see AjaxFormUpdateFilter
    027     * @see MultiZoneUpdate
    028     * @since 5.2.0
    029     */
    030    public interface AjaxFormUpdateController
    031    {
    032        void initializeForForm(String formComponentId, String formClientId);
    033
    034        /**
    035         * Called before starting to render a zone's content; initializes
    036         * the {@link FormSupport} and {@link ValidationTracker} environmentals
    037         * and starts a heartbeat.
    038         */
    039        void setupBeforePartialZoneRender(MarkupWriter writer);
    040
    041        /**
    042         * Ends the heartbeat, executes deferred Form actions,
    043         * and cleans up the environmentals.
    044         */
    045        void cleanupAfterPartialZoneRender();
    046    }