001// Copyright 2004, 2005 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.tapestry.services;
016
017/**
018 * Defines constants for query parameters names commonly used by services.
019 * 
020 * @author Howard M. Lewis Ship
021 * @since 4.0
022 */
023public class ServiceConstants
024{
025    /**
026     * The name of the service responsible for processing the request.
027     */
028    public static final String SERVICE = "service";
029
030    /**
031     * The name of the page to activate when processing the service.
032     */
033
034    public static final String PAGE = "page";
035
036    /**
037     * The id path to the component within the page. By convention, this component is within the
038     * {@link #PAGE}, unless {@link #CONTAINER_PAGE} is specified.
039     */
040
041    public static final String COMPONENT = "component";
042
043    /**
044     * The name of the page containing the component; this is only specified when the component is
045     * contained by a page other than the activate page ({@link #PAGE}).
046     */
047
048    public static final String CONTAINER = "container";
049
050    /**
051     * A flag indicating whether a session was active when the link was rendered. If this is true,
052     * but no session is active when the request is processed, the a service may at its discression
053     * throw a {@iink org.apache.tapestry.StaleLinkException}
054     */
055
056    public static final String SESSION = "session";
057
058    /**
059     * Contains a number of additional strings meaningful to the application (the term service
060     * parameters is something of an entrenched misnomer, a better term would have been application
061     * parameters). These parameters are typically objects that have been squeezed into strings by
062     * {@link org.apache.tapestry.services.DataSqueezer}.
063     * <p>
064     * The value is currently "sp" for vaguely historical reasons ("service parameter"), though it
065     * would be better if it were "lp" (for "listener parameter"), or just "param" perhaps.
066     */
067
068    public static final String PARAMETER = "sp";
069
070    /**
071     * A list of all the constants defined by this class.
072     * 
073     * @see org.apache.tapestry.form.FormSupportImpl
074     */
075    public static final String[] RESERVED_IDS =
076    { SERVICE, PAGE, COMPONENT, CONTAINER, SESSION, PARAMETER };
077}