001// Copyright 2010-2014 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
015package org.apache.tapestry5;
016
017import org.apache.tapestry5.internal.structure.PageResetListener;
018import org.apache.tapestry5.services.ComponentEventLinkEncoder;
019
020/**
021 * Constants needed by end-user classes.
022 *
023 * @since 5.2.0
024 */
025public class TapestryConstants
026{
027
028    /**
029     * The extension used for Tapestry component template files, <em>T</em>apestry <em>M</em>arkup <em>L</em>anguage.
030     * Template files are well-formed XML files.
031     */
032    public static final String TEMPLATE_EXTENSION = "tml";
033
034    /**
035     * Name of query parameter that is placed on "loopback" links (page render links for the same
036     * page). This mostly includes the redirects sent after a component event request. Page render
037     * requests
038     * that do <em>not</em> have the LOOPBACK query parameter will trigger a {@linkplain PageResetListener reset
039     * notification} after the initialization event; the LOOPBACK prevents this reset notification.
040     *
041     * @see ComponentEventLinkEncoder#createPageRenderLink(org.apache.tapestry5.services.PageRenderRequestParameters)
042     * @see ComponentEventLinkEncoder#decodePageRenderRequest(org.apache.tapestry5.services.Request)
043     * @see PageResetListener
044     * @since 5.2.0
045     */
046    public static final String PAGE_LOOPBACK_PARAMETER_NAME = "t:lb";
047
048    /**
049     * Name of a request attribute that contains an {@link org.apache.tapestry5.ioc.IOOperation}
050     * used to render the response. The operation should return void.
051     * <p/>
052     * Implementations of {@link org.apache.tapestry5.services.ComponentEventResultProcessor}
053     * will store a response rendering operation into the request; the operation, if present,
054     * will be executed as the first filter inside the
055     * {@link org.apache.tapestry5.services.ComponentRequestHandler} pipeline.
056     * <p/>
057     * This approach is recommended for any "complex" rendering that involves components or pages.
058     * It is optional for other types.
059     *
060     * @since 5.4
061     */
062    public static final String RESPONSE_RENDERER = "tapestry.response-renderer";
063}