    001// Licensed under the Apache License, Version 2.0 (the "License");
    002// you may not use this file except in compliance with the License.
    003// You may obtain a copy of the License at
    004//
    005//     http://www.apache.org/licenses/LICENSE-2.0
    006//
    007// Unless required by applicable law or agreed to in writing, software
    008// distributed under the License is distributed on an "AS IS" BASIS,
    009// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    010// See the License for the specific language governing permissions and
    011// limitations under the License.
    012
    013package org.apache.tapestry5.services;
    014
    015import org.apache.tapestry5.MarkupWriter;
    016import org.apache.tapestry5.ioc.annotations.UsesOrderedConfiguration;
    017import org.apache.tapestry5.json.JSONObject;
    018
    019/**
    020 * Defines an Ajax-oriented partial page render, wherein a render of a portion of a page occurs, and the content is
    021 * stored into a key ("content") of a {@link org.apache.tapestry5.json.JSONObject}, which is sent to the client side as
    022 * the final response.  Client-side JavaScript receives this reply and uses it to update a portion of the page.
    023 *
    024 *
    025 * The PartialMarkupRenderer service takes an ordered configuration of {@link PartialMarkupRendererFilter}s.  It can be
    026 * selected using the {@link org.apache.tapestry5.ioc.annotations.Primary} marker annotation.
    027 */
    028@UsesOrderedConfiguration(PartialMarkupRendererFilter.class)
    029public interface PartialMarkupRenderer
    030{
    031    /**
    032     * Implementations should perform work before or after passing the writer to the renderer.
    033     *
    034     * @param writer to which markup should be written
    035     * @param reply  JSONObject which will contain the partial response
    036     */
    037    void renderMarkup(MarkupWriter writer, JSONObject reply);
    038}