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