    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.corelib.base.AbstractField;
    016import org.apache.tapestry5.corelib.components.AjaxFormLoop;
    017import org.apache.tapestry5.corelib.components.BeanDisplay;
    018import org.apache.tapestry5.corelib.components.BeanEditForm;
    019import org.apache.tapestry5.corelib.components.BeanEditor;
    020import org.apache.tapestry5.corelib.components.Errors;
    021import org.apache.tapestry5.corelib.mixins.FormGroup;
    022import org.apache.tapestry5.http.TapestryHttpConstants;
    023import org.apache.tapestry5.http.TapestryHttpSymbolConstants;
    024import org.apache.tapestry5.http.services.BaseURLSource;
    025import org.apache.tapestry5.http.services.CorsHandler;
    026import org.apache.tapestry5.http.services.CorsHandlerHelper;
    027import org.apache.tapestry5.http.services.CorsHttpServletRequestFilter;
    028import org.apache.tapestry5.internal.services.AssetDispatcher;
    029import org.apache.tapestry5.internal.services.ComponentDependencyRegistry;
    030import org.apache.tapestry5.internal.services.rest.DefaultOpenApiDescriptionGenerator;
    031import org.apache.tapestry5.modules.NoBootstrapModule;
    032import org.apache.tapestry5.services.Html5Support;
    033import org.apache.tapestry5.services.assets.AssetPathConstructor;
    034import org.apache.tapestry5.services.assets.ResourceMinimizer;
    035import org.apache.tapestry5.services.compatibility.Trait;
    036import org.apache.tapestry5.services.javascript.JavaScriptStack;
    037import org.apache.tapestry5.services.pageload.PageClassLoaderContextManager;
    038import org.apache.tapestry5.services.rest.OpenApiDescriptionGenerator;
    039
    040/**
    041 * Defines the names of symbols used to configure Tapestry.
    042 *
    043 * @see org.apache.tapestry5.ioc.services.SymbolSource
    044 */
    045public class SymbolConstants
    046{
    047    /**
    048     * A comma separated list of execution modes used to control how the application is initialized.
    049     * Each modes can contribute a list (comma separated) of Module classes to be loaded during startup,
    050     * the order in which they appear is preserved.
    051     * The default value is: <code>production</code>.
    052     * This is an alias for {@link TapestryHttpSymbolConstants#EXECUTION_MODE}.
    053     */
    054    public static final String EXECUTION_MODE = TapestryHttpSymbolConstants.EXECUTION_MODE;
    055    /**
    056     * Indicates whether Tapestry is running in production mode or developer mode. This affects a large
    057     * number of Tapestry behaviors related to performance and security, including how exceptions are
    058     * reported, whether far-future expire headers are emitted, whether JavaScript files may be combined,
    059     * whether JSON is compressed, whether component field and parameter values are shadowed to instance
    060     * variables (to assist with debugging), and more.
    061     *
    062     * This is an alias to {@link TapestryHttpSymbolConstants#PRODUCTION_MODE}.
    063     */
    064    public static final String PRODUCTION_MODE = TapestryHttpSymbolConstants.PRODUCTION_MODE;
    065
    066    /**
    067     * A version of {@link TapestryHttpSymbolConstants#PRODUCTION_MODE} as a symbol reference. This can be used as the default value
    068     * of other symbols, to indicate that their default matches whatever PRODUCTION_MODE is set to, which is quite
    069     * common.
    070     *
    071     * @since 5.2.0
    072     */
    073    public static final String PRODUCTION_MODE_VALUE = String.format("${%s}", TapestryHttpSymbolConstants.PRODUCTION_MODE);
    074
    075    /**
    076     * The list of locales supported by the application; locales identified in the incoming request are "narrowed" to
    077     * one of these values. The first locale name in the list is the default locale used when no proper match can be
    078     * found.
    079     */
    080    public static final String SUPPORTED_LOCALES = "tapestry.supported-locales";
    081
    082    /**
    083     * Controls whether whitespace is compressed by default in templates, or left as is. The factory default is to
    084     * compress whitespace. (This can also be overridden using the xml:space attribute inside template elements.)
    085     */
    086    public static final String COMPRESS_WHITESPACE = "tapestry.compress-whitespace";
    087
    088    /**
    089     * Time interval defining how often Tapestry will check for updates to local files (including classes).
    090     * Starting with 5.3, this is only used when not running in production mode. The default is "1 s"
    091     * (one second), which is appropriate for development. With Tapestry 5.2 and earlier this number
    092     * should be raised in a production environment.
    093     */
    094    public static final String FILE_CHECK_INTERVAL = "tapestry.file-check-interval";
    095
    096    /**
    097     * Time interval that sets how long Tapestry will wait to obtain the exclusive lock needed to check local files. The
    098     * default is "50 ms". Starting with 5.3, this is only used when not running in production mode.
    099     */
    100    public static final String FILE_CHECK_UPDATE_TIMEOUT = "tapestry.file-check-update-timeout";
    101
    102    /**
    103     * The version number of the core Tapestry framework, or UNKNOWN if the version number is not available (which
    104     * should only occur when developing Tapestry).
    105     * This is an alias for {@link TapestryHttpSymbolConstants#TAPESTRY_VERSION}.
    106     */
    107    public static final String TAPESTRY_VERSION = TapestryHttpSymbolConstants.TAPESTRY_VERSION;
    108
    109    /**
    110     * The location of the application-wide component messages catalog, relative to the web application context. This
    111     * will normally be <code>WEB-INF/app.properties</code>.
    112     */
    113    public static final String APPLICATION_CATALOG = "tapestry.app-catalog";
    114
    115    /**
    116     * The charset used when rendering page markup; the charset is also used as the request encoding when handling
    117     * incoming requests. The default is "UTF-8".
    118     * This is an alias for {@link TapestryHttpSymbolConstants#CHARSET}.
    119     */
    120    public static final String CHARSET = TapestryHttpSymbolConstants.CHARSET;
    121
    122    /**
    123     * Used as the default for the Form's autofocus and clientValidation parameters. If overridden to "false", then
    124     * Forms will not (unless explicitly specified) use client validation or autofocus, which in turn, means that most
    125     * pages with Forms will not make use of the Tapestry JavaScript stack.
    126     */
    127    public static final String FORM_CLIENT_LOGIC_ENABLED = "tapestry.form-client-logic-enabled";
    128
    129    /**
    130     * Name of page used to report exceptions; the page must implement
    131     * {@link org.apache.tapestry5.services.ExceptionReporter}.
    132     * This is used by the default exception report handler service.
    133     */
    134    public static final String EXCEPTION_REPORT_PAGE = "tapestry.exception-report-page";
    135
    136    /**
    137     * Identifies the default persistence strategy for all pages that do not provide an override (using this value as
    138     * {@link org.apache.tapestry5.annotations.Meta key}).
    139     *
    140     * @since 5.1.0.0
    141     */
    142    public static final String PERSISTENCE_STRATEGY = "tapestry.persistence-strategy";
    143
    144    /**
    145     * Minimum output stream size, in bytes, before output is compressed using GZIP. Shorter streams are not compressed.
    146     * Tapestry buffers this amount and switches to a GZIP output stream as needed. The default is "100".
    147     * This is an alias to {@link TapestryHttpSymbolConstants#MIN_GZIP_SIZE}.
    148     *
    149     * @see TapestryHttpSymbolConstants#GZIP_COMPRESSION_ENABLED
    150     * @since 5.1.0.0
    151     */
    152    public static final String MIN_GZIP_SIZE = TapestryHttpSymbolConstants.MIN_GZIP_SIZE;
    153
    154    /**
    155     * Version number of the application. Prior to 5.4, this version number was integrated into asset URLs. Starting
    156     * with 5.4, a checksum of the individual asset's content is used instead, and this version number is only used
    157     * for documentation purposes; it appears in the default exception report page, for example.
    158     *
    159     * The default value is "0.0.1".  In 5.3 and earlier, the default value was a random hexadecimal string.
    160     *
    161     * This is an alias to {@link TapestryHttpSymbolConstants#APPLICATION_VERSION}.
    162     *
    163     * @see AssetDispatcher
    164     * @see AssetPathConstructor
    165     * @since 5.1.0.0
    166     */
    167    public static final String APPLICATION_VERSION = TapestryHttpSymbolConstants.APPLICATION_VERSION;
    168
    169    /**
    170     * Used to omit the normal Tapestry framework generator meta tag. The meta tag is rendered by default, but clients
    171     * who do not wish to advertise their use of Tapestry may set this symbol to "true".
    172     *
    173     * @since 5.1.0.0
    174     */
    175    public static final String OMIT_GENERATOR_META = "tapestry.omit-generator-meta";
    176
    177    /**
    178     * If "true" (the default) then GZip compression is enabled for dynamic requests and for static assets. If you are
    179     * using a server that handles GZip compression for you, or you don't want to use the extra processing power
    180     * necessary to GZIP requests, then override this to "false".
    181     * This is an alias to {@link TapestryHttpSymbolConstants#GZIP_COMPRESSION_ENABLED}.
    182     *
    183     * @see TapestryHttpSymbolConstants#MIN_GZIP_SIZE
    184     * @see org.apache.tapestry5.http.services.ResponseCompressionAnalyzer
    185     * @see org.apache.tapestry5.http.services.CompressionAnalyzer
    186     * @since 5.1.0.0
    187     */
    188    public static final String GZIP_COMPRESSION_ENABLED = TapestryHttpSymbolConstants.GZIP_COMPRESSION_ENABLED;
    189
    190    /**
    191     * If "true" (which itself defaults to production mode), then the {@link org.apache.tapestry5.annotations.Secure}
    192     * annotation will be honored. If "false" (i.e., development mode), then the annotation and related HTTP/HTTPS
    193     * logic is ignored.
    194     *
    195     * @since 5.1.0.1
    196     */
    197    public static final String SECURE_ENABLED = "tapestry.secure-enabled";
    198
    199    /**
    200     * If "true" (the default), then the {@link org.apache.tapestry5.services.PersistentLocale} will be encoded into the
    201     * {@link org.apache.tapestry5.http.Link} path by the {@link org.apache.tapestry5.services.ComponentEventLinkEncoder}
    202     * service. If overridden to "false" this does not occur, but you should provide a
    203     * {@link org.apache.tapestry5.services.LinkCreationListener2} (registered with the
    204     * {@link org.apache.tapestry5.services.LinkCreationHub}) in order to add the locale as a query parameter (or
    205     * provide some alternate means of persisting the locale between requests).
    206     *
    207     * @since 5.1.0.1
    208     */
    209    public static final String ENCODE_LOCALE_INTO_PATH = "tapestry.encode-locale-into-path";
    210
    211    /**
    212     * If "true" then JavaScript files in a {@link JavaScriptStack} will be combined into a single virtual JavaScript
    213     * file. Defaults to "true" in production mode.
    214     *
    215     * @since 5.1.0.2
    216     */
    217    public static final String COMBINE_SCRIPTS = "tapestry.combine-scripts";
    218
    219
    220    /**
    221     * The default time interval that cookies created by Tapestry will be kept in the client web browser. The default is
    222     * "7 d" (that is, seven days).
    223     *
    224     * @since 5.2.0
    225     */
    226    public static final String COOKIE_MAX_AGE = "tapestry.default-cookie-max-age";
    227
    228    /**
    229     * The logical name of the start page, the page that is rendered for the root URL.
    230     *
    231     * @since 5.2.0
    232     */
    233    public static final String START_PAGE_NAME = "tapestry.start-page-name";
    234
    235    /**
    236     * The default stylesheet automatically inserted into every rendered HTML page when
    237     * no Bootstrap version is enabled (i.e both {@link Trait#BOOTSTRAP_3} and {@link Trait#BOOTSTRAP_4}
    238     * traits are disabled, something done by {@linkplain NoBootstrapModule}).
    239     *
    240     * It was deprecated in 5.4 with no replacement (the stylesheet is now associated with the core {@link JavaScriptStack}.),
    241     * but undeprecated in 5.5.0 with the caveat described above.
    242     *
    243     * @see NoBootstrapModule
    244     * @since 5.2.0
    245     */
    246    public static final String DEFAULT_STYLESHEET = "tapestry.default-stylesheet";
    247
    248    /**
    249     * The Asset path to the embedded copy of script.aculo.us packaged with Tapestry.
    250     *
    251     * @since 5.2.0
    252     */
    253    public static final String SCRIPTACULOUS = "tapestry.scriptaculous";
    254
    255    /**
    256     * The Asset path to the embedded datepicker.
    257     *
    258     * @since 5.2.0
    259     */
    260    public static final String DATEPICKER = "tapestry.datepicker";
    261
    262    /**
    263     * If "true", then JSON page initialization content is compressed; if "false"
    264     * then extra white space is added (pretty printing). Defaults to "true" in production mode.
    265     *
    266     * @since 5.2.0
    267     */
    268    public static final String COMPACT_JSON = "tapestry.compact-json";
    269
    270    /**
    271     * If "true" and {@link TapestryHttpSymbolConstants#PRODUCTION_MODE} is off, comments will be rendered before and after the rendering of any
    272     * component
    273     * allowing more visibility into which components rendered which markup. Defaults to "false". Component render
    274     * tracing may be
    275     * enabled per-request by the presence of a request parameter "t:component-trace" with a value of "true".
    276     *
    277     * @since 5.2.5
    278     */
    279    public static final String COMPONENT_RENDER_TRACING_ENABLED = "tapestry.component-render-tracing-enabled";
    280
    281    /**
    282     * The hostname that application should use when constructing an absolute URL. The default is "", i.e. an empty
    283     * string,
    284     * in which case system will use request.getServerName(). Not the same as environment variable HOSTNAME, but you can
    285     * also
    286     * contribute "$HOSTNAME" as the value to make it the same as the environment variable HOSTNAME.
    287     * This is an alias to {@link TapestryHttpSymbolConstants#HOSTNAME}.
    288     *
    289     * @since 5.3
    290     */
    291    public static final String HOSTNAME = TapestryHttpSymbolConstants.HOSTNAME;
    292
    293    /**
    294     * The hostport that application should use when constructing an absolute URL. The default is "0", i.e. use the port
    295     * value from
    296     * the request. This is an alias to {@link TapestryHttpSymbolConstants#HOSTPORT}.
    297     *
    298     * @since 5.3
    299     */
    300    public static final String HOSTPORT = TapestryHttpSymbolConstants.HOSTPORT;
    301
    302    /**
    303     * The secure (https) hostport that application should use when constructing an absolute URL. The default is "0",
    304     * i.e. use
    305     * the value from the request.
    306     * This is an alias to {@link TapestryHttpSymbolConstants#HOSTPORT_SECURE}.
    307     *
    308     * @since 5.3
    309     */
    310    public static final String HOSTPORT_SECURE = TapestryHttpSymbolConstants.HOSTPORT_SECURE;
    311
    312    /**
    313     * If "true", then resources (individually or when aggregated into stacks) will be minimized via the
    314     * {@link ResourceMinimizer} service. If "false", then minification is disabled. Tracks production mode
    315     * (minification is normally disabled in development mode).
    316     *
    317     * Note that Tapestry's default implementation of {@link ResourceMinimizer} does nothing; minification is provided
    318     * by add-on libraries.
    319     *
    320     * @since 5.3
    321     */
    322    public static final String MINIFICATION_ENABLED = "tapestry.enable-minification";
    323
    324    /**
    325     * If "true" then at the end of each request the
    326     * {@link org.apache.tapestry5.http.services.SessionPersistedObjectAnalyzer} will be called on each session persisted
    327     * object that was accessed during the request.
    328     *
    329     * This is provided as a performance enhancement for servers that do not use clustered sessions.
    330     *
    331     * The default is {@code true}, to preserve 5.2 behavior. For non-clustered applications (the majority), this value should be
    332     * overridden to {@code false}. A future release of Tapestry may change the default.
    333     *
    334     * This is an alias to {@link TapestryHttpSymbolConstants#CLUSTERED_SESSIONS}.
    335     *
    336     * @since 5.3
    337     */
    338    public static final String CLUSTERED_SESSIONS = TapestryHttpSymbolConstants.CLUSTERED_SESSIONS;
    339
    340    /**
    341     * The name of a folder in which the Tapestry application executes. Prior to 5.3, a Tapestry application always responded to all
    342     * URLs in the context under the context root; by setting this to the name of a folder, the T5 URLs will be inside that folder only, and should
    343     * match a corresponding entry in the {@code web.xml} configuration file.  This is useful when running multiple servlets within the same web application (such as when migrating
    344     * from Tapestry 4 or some other framework, to Tapestry 5).
    345     * Effectively, if this symbol is set to a value, that folder name will be placed after the context path
    346     * (typically "/") and before the locale, page name, or other prefix.  For example, if this symbol is set to "app", the {@code web.xml <url-pattern>} should be set to {@code /app/*}, and Tapestry will
    347     * only be in invoked by the servlet container for requests inside the virtual {@code app} folder.
    348     *
    349     * This also affects the search for page templates (which are allowed within the web context). When set to a non-blank value, page templates are searched for in the folder, rather than in the root context.
    350     *
    351     * The default value is the empty string, which preserves Tapestry 5.2 behavior (and continues to be appropriate for most applications).
    352     *
    353     * Note that while Tapestry is case-insensitive, the servlet container is not, so the configured value must exactly match
    354     * the folder name inside the {@code <url-parameter>} value, including case.
    355     *
    356     * @since 5.3
    357     */
    358    public static final String APPLICATION_FOLDER = "tapestry.application-folder";
    359
    360    /**
    361     * Boolean value to indicate if every {@link  org.apache.tapestry5.Asset} should be fully qualified or not.
    362     * Default to <code>false</code> meaning no Asset URL will be fully qualified.
    363     *
    364     * @since 5.3
    365     */
    366    public static final String ASSET_URL_FULL_QUALIFIED = "tapestry.asset-url-fully-qualified";
    367
    368    /**
    369     * Prefix to be used for all resource paths, used to recognize which requests are for assets. This value
    370     * is appended to the context path and the (optional {@linkplain #APPLICATION_FOLDER application folder}.
    371     * It may contain slashes, but should not begin or end with one.
    372     *
    373     * The default is "assets".
    374     */
    375    public static final String ASSET_PATH_PREFIX = "tapestry.asset-path-prefix";
    376
    377
    378    /**
    379     * Prefix used for all module resources. This may contain slashes, but should not being or end with one.
    380     * Tapestry will create two {@link org.apache.tapestry5.http.services.Dispatcher}s from this: one for normal
    381     * modules, the other for GZip compressed modules (by appending ".gz" to this value).
    382     *
    383     * The default is "modules".
    384     *
    385     * @since 5.4
    386     */
    387    public static final String MODULE_PATH_PREFIX = "tapestry.module-path-prefix";
    388
    389    /**
    390     * Identifies the context path of the application, as determined from {@link javax.servlet.ServletContext#getContextPath()}.
    391     * This is either a blank string or a string that starts with a slash but does not end with one.
    392     * This is an alias to {@link TapestryHttpSymbolConstants#CONTEXT_PATH}.
    393     *
    394     * @since 5.4
    395     */
    396    public static final String CONTEXT_PATH = TapestryHttpSymbolConstants.CONTEXT_PATH;
    397
    398    /**
    399     * A passphrase used as the basis of hash-based message authentication (HMAC) for any object stream data stored on
    400     * the client.  The default phrase is the empty string, which will result in a logged runtime <em>error</em>.
    401     * You should configure this to a reasonable value (longer is better) and ensure that all servers in your cluster
    402     * share the same value (configuring this in code, rather than the command line, is preferred).
    403     *
    404     * @see org.apache.tapestry5.services.ClientDataEncoder
    405     * @since 5.3.6
    406     */
    407    public static final String HMAC_PASSPHRASE = "tapestry.hmac-passphrase";
    408
    409    /**
    410     * The root asset path for Twitter Bootstrap; if your application uses a modified version of Bootstrap,
    411     * you can override this symbol to have Tapestry automatically use your version. The value should be a path
    412     * to a folder (under "classpath:" or "context:") and should not include a trailing slash.
    413     *
    414     * @since 5.4
    415     */
    416    public static final String BOOTSTRAP_ROOT = "tapestry.bootstrap-root";
    417
    418    /**
    419     * The root asset path for Font Awesome; if your application uses a modified version of it,
    420     * you can override this symbol to have Tapestry automatically use your version. The value should be a path
    421     * to a folder (under "classpath:" or "context:") and should not include a trailing slash.
    422     *
    423     * @since 5.5
    424     */
    425    public static final String FONT_AWESOME_ROOT = "tapestry.font-awesome-root";
    426
    427    /**
    428     * Tapestry relies on an underlying client-side JavaScript infrastructure framework to handle DOM manipulation,
    429     * event handling, and Ajax requests. Through Tapestry 5.3, the foundation was
    430     * <a href="http://http://prototypejs.org/">Prototype</a>. In 5.4, support for
    431     * <a href="http://jquery.org/">jQuery</a> has been added, and it is possible to add others. This symbol defines a value that is used to select
    432     * a resource that is provided to the {@link org.apache.tapestry5.services.javascript.ModuleManager} service
    433     * as a {@link org.apache.tapestry5.services.javascript.JavaScriptModuleConfiguration} to provide a specific implementation
    434     * of the {@code t5/core/dom} module. Tapestry 5.4 directly supports "prototype" or "jquery".  To support
    435     * other foundation frameworks, override this symbol value and supply your own module configuration.
    436     *
    437     * In Tapestry 5.4, this defaults to "prototype" for compatibility with 5.3. This will likely change in
    438     * 5.5 to default to "jquery". At some point in the future, Prototype support will no longer be present.
    439     *
    440     * @since 5.4
    441     */
    442    public static final String JAVASCRIPT_INFRASTRUCTURE_PROVIDER = "tapestry.javascript-infrastructure-provider";
    443
    444    /**
    445     * If true (the default), then Tapestry will apply locking semantics around access to the {@link javax.servlet.http.HttpSession}.
    446     * Reading attribute names occurs with a shared read lock; getting or setting an attribute upgrades to an exclusive write lock.
    447     * This can tend to serialize threads when a number of simultaneous (Ajax) requests from the client arrive ... however,
    448     * many implementations of HttpSession are not thread safe, and often mutable objects are stored in the session and shared
    449     * between threads. Leaving this on the default will yield a more robust application; setting it to false may speed
    450     * up processing for more Ajax intensive applications (but care should then be given to ensuring that objects shared inside
    451     * the session are themselves immutable or thread-safe).
    452     *
    453     * This is an alias to {@link TapestryHttpSymbolConstants#SESSION_LOCKING_ENABLED}.
    454     *
    455     * @since 5.4
    456     */
    457    public static final String SESSION_LOCKING_ENABLED = TapestryHttpSymbolConstants.SESSION_LOCKING_ENABLED;
    458
    459    /**
    460     * If true (the default), then Tapestry will automatically include the "core" stack in all
    461     * pages.
    462     *
    463     * @see <a href="https://issues.apache.org/jira/browse/TAP5-2169">TAP5-2169</a>
    464     * @since 5.4
    465     */
    466    public static final String INCLUDE_CORE_STACK = "tapestry.include-core-stack";
    467
    468    /**
    469     * Defines the CSS class that will be given to HTML element (usually a div) &lt;div&gt; generated by
    470     * the {@linkplain FormGroup} mixin and the
    471     * {@linkplain BeanEditForm} and {@linkplain BeanEditor}
    472     * components surrounding the label and the field. If the value isn't
    473     * {@code form-group}, the div will have {@code class="form-group [value]}.
    474     * The default value is <code>form-group</code>.
    475     *
    476     * @see <a href="https://issues.apache.org/jira/browse/TAP5-2182">TAP5-2182</a>
    477     * @since 5.4
    478     */
    479    public static final String FORM_GROUP_WRAPPER_CSS_CLASS = "tapestry.form-group-wrapper-css-class";
    480
    481    /**
    482     * Defines the name of the HTML element that will surround the HTML form field generated by
    483     * the {@linkplain FormGroup} mixin and the {@linkplain BeanEditForm} and {@linkplain BeanEditor}.
    484     * If this symbol is null or an empty string, no element will be generated surrouding the
    485     * form field. The default value is the empty string (no wrapping).
    486     *
    487     * @see <a href="https://issues.apache.org/jira/browse/TAP5-2182">TAP5-2182</a>
    488     * @see #FORM_GROUP_FORM_FIELD_WRAPPER_ELEMENT_CSS_CLASS
    489     * @since 5.4
    490     */
    491    public static final String FORM_GROUP_FORM_FIELD_WRAPPER_ELEMENT_NAME = "tapestry.form-group-form-field-wrapper-element-name";
    492
    493    /**
    494     * Defines the CSS class of the HTML element generated by
    495     * the {@linkplain FormGroup} mixin and the {@linkplain BeanEditForm} and {@linkplain BeanEditor}.
    496     * when {@linkplain #FORM_GROUP_FORM_FIELD_WRAPPER_ELEMENT_NAME} is not set to null or the empty string.
    497     * The default value is the empty string (no CSS class added).
    498     *
    499     * @see <a href="https://issues.apache.org/jira/browse/TAP5-2182">TAP5-2182</a>
    500     * @since 5.4
    501     */
    502    public static final String FORM_GROUP_FORM_FIELD_WRAPPER_ELEMENT_CSS_CLASS = "tapestry.form-group-form-field-wrapper-element-css-class";
    503
    504    /**
    505     * Defines the CSS class that will be given to &lt;label&gt; element generated by
    506     * the {@linkplain FormGroup} mixin and the
    507     * {@linkplain BeanEditForm} and {@linkplain BeanEditor}
    508     * components. The default value is <code>control-label</code>.
    509     *
    510     * @see <a href="https://issues.apache.org/jira/browse/TAP5-2182">TAP5-2182</a>
    511     * @since 5.4
    512     */
    513    public static final String FORM_GROUP_LABEL_CSS_CLASS = "tapestry.form-group-label-css-class";
    514
    515    /**
    516     * Defines the CSS class that will be given to form field components which are
    517     * {@linkplain AbstractField} subclasses. The default value is <code>form-control</code>.
    518     *
    519     * @see <a href="https://issues.apache.org/jira/browse/TAP5-2182">TAP5-2182</a>
    520     * @since 5.4
    521     */
    522    public static final String FORM_FIELD_CSS_CLASS = "tapestry.form-field-css-class";
    523
    524    /**
    525     * Defines the CSS class that will be given to the &lt;dl&gt; HTML element generated by
    526     * {@linkplain BeanDisplay}. The default value is <code>well dl-horizontal</code>.
    527     *
    528     * @since 5.5
    529     */
    530    public static final String BEAN_DISPLAY_CSS_CLASS = "tapestry.bean-display-css-class";
    531
    532    /**
    533     * Defines the CSS class that will be given to the &lt;div&gt; HTML element generated by
    534     * {@linkplain BeanEditor}/{@linkplain BeanEditForm} for boolean properties.
    535     * The default value is <code>input-group</code>.
    536     *
    537     * @since 5.5
    538     */
    539    public static final String BEAN_EDITOR_BOOLEAN_PROPERTY_DIV_CSS_CLASS = "tapestry.bean-editor-boolean-property-div-css-class";
    540
    541    /**
    542     * Defines the CSS class that will be given to the HTML element generated by
    543     * {@linkplain Error}. If the value isn't <code>help-block</code>, the class attribute
    544     * will be <code>help-block [symbol value]</code>
    545     * The default value is <code>help-block</code>.
    546     *
    547     * @since 5.5
    548     */
    549    public static final String ERROR_CSS_CLASS = "tapestry.error-css-class";
    550
    551    /**
    552     * Defines the CSS class that will be given to the add row link generated by
    553     * {@linkplain AjaxFormLoop}. The default value is <code>btn btn-default btn-sm</code>.
    554     *
    555     * @since 5.5
    556     */
    557    public static final String AJAX_FORM_LOOP_ADD_ROW_LINK_CSS_CLASS = "tapestry.ajax-form-loop-add-row-link-css-class";
    558
    559    /**
    560     * Defines the prefix of the CSS class that will be given to the outer &lt;div&gt; element generated by
    561     * {@linkplain Errors}. The value of {@linkplain Errors}'s <code>class</code> parameter appended
    562     * after the prefix and a space character. The default value is <code>alert-dismissable</code>.
    563     *
    564     * @since 5.5
    565     */
    566    public static final String ERRORS_BASE_CSS_CLASS = "tapestry.errors-base-css-class";
    567
    568    /**
    569     * Defines the default value of the {@linkplain Errors}'s <code>class</code> parameter.
    570     * The default value for this symbol is <code>alert alert-danger</code>.
    571     *
    572     * @since 5.5
    573     */
    574    public static final String ERRORS_DEFAULT_CLASS_PARAMETER_VALUE = "tapestry.errors-default-class-parameter-value";
    575
    576    /**
    577     * Defines the CSS class that will be given to the close &lt;button&gt; generated by
    578     * {@linkplain Errors}. The default value is <code>close</code>.
    579     *
    580     * @since 5.5
    581     */
    582    public static final String ERRORS_CLOSE_BUTTON_CSS_CLASS = "tapestry.errors-close-button-css-class";
    583
    584    /**
    585     * Defines whether {@link java.text.DateFormat} instances created by Tapestry should be
    586     * lenient or not by default. The default value is <code>false</code>.
    587     *
    588     * @since 5.4
    589     */
    590    public static final String LENIENT_DATE_FORMAT = "tapestry.lenient-date-format";
    591
    592    /**
    593     * The directory to which exception report files should be written. The default is appropriate
    594     * for development: {@code build/exceptions}, and should be changed for production.
    595     *
    596     * @see org.apache.tapestry5.services.ExceptionReporter
    597     * @since 5.4
    598     */
    599
    600    public static final String EXCEPTION_REPORTS_DIR = "tapestry.exception-reports-dir";
    601
    602    /**
    603     * Defines whether {@link org.apache.tapestry5.internal.services.assets.CSSURLRewriter} will throw an exception when a CSS file
    604     * references an URL which doesn't exist. The default value is <code>false</code>.
    605     *
    606     * @since 5.4
    607     */
    608    public static final String STRICT_CSS_URL_REWRITING = "tapestry.strict-css-url-rewriting";
    609
    610    /**
    611     * When an asset (typically, a JavaScript module) is streamed without an explicit expiration header, then
    612     * this value is sent as the {@code Cache-Control} header; the default is "max-age=60, must-revalidate". Setting
    613     * max-age to a value above zero significantly reduces the number of client requests for module content, as client
    614     * browsers will then cache previously downloaded versions. For normal assets, which are immutable, and fingerprinted with
    615     * a content hash, there is no need to set max age, and instead, a far-future expiration date is provided.
    616     *
    617     * @since 5.4
    618     */
    619    public static final String OMIT_EXPIRATION_CACHE_CONTROL_HEADER = "tapestry.omit-expiration-cache-control-header";
    620
    621    /**
    622     * Defines whether HTML5 features should be used. Value used in the default implementation of
    623     * {@link Html5Support#isHtml5SupportEnabled()}. Default value: <code>false</code>.
    624     *
    625     * @see Html5Support#isHtml5SupportEnabled()
    626     * @since 5.4
    627     */
    628    public static final String ENABLE_HTML5_SUPPORT = "tapestry.enable-html5-support";
    629
    630    /**
    631     * A general switch for restrictive environments, such as Google App Engine, which forbid some useful operations,
    632     * such as creating files or directories. Defaults to false.
    633     *
    634     * @since 5.4
    635     */
    636    public static final String RESTRICTIVE_ENVIRONMENT = "tapestry.restrictive-environment";
    637
    638    /**
    639     * If true, then when a page includes any JavaScript, a {@code script} block is added to insert
    640     * a pageloader mask into the page; the pageloader mask ensure that the user can't interact with the page
    641     * until after the page is fully initialized.
    642     *
    643     * @since 5.4
    644     */
    645    public static final String ENABLE_PAGELOADING_MASK = "tapestry.enable-pageloading-mask";
    646
    647    /**
    648     * Controls in what environment page preloading should occur. By default, preloading only occurs
    649     * in production.
    650     *
    651     * @see org.apache.tapestry5.services.pageload.PagePreloader
    652     * @see org.apache.tapestry5.services.pageload.PreloaderMode
    653     * @since 5.4
    654     */
    655    public static final String PRELOADER_MODE = "tapestry.page-preload-mode";
    656
    657    /**
    658     * Defines the OpenAPI version to be used in the generated OpenAPI description.
    659     * Default value is <code>3.0.0</code>.
    660     * @see DefaultOpenApiDescriptionGenerator
    661     * @see OpenApiDescriptionGenerator
    662     * @since 5.8.0
    663     */
    664    public static final String OPENAPI_VERSION = "tapestry.openapi-version";
    665
    666    /**
    667     * Defines the title of this application in the generated OpenAPI description. No default value is provided.
    668     * @see DefaultOpenApiDescriptionGenerator
    669     * @see OpenApiDescriptionGenerator
    670     * @since 5.8.0
    671     */
    672    public static final String OPENAPI_TITLE = "tapestry.openapi-title";
    673
    674    /**
    675     * Defines the description of this application in the generated OpenAPI description.
    676     * No default value is provided.
    677     * @see DefaultOpenApiDescriptionGenerator
    678     * @see OpenApiDescriptionGenerator
    679     * @since 5.8.0
    680     */
    681    public static final String OPENAPI_DESCRIPTION = "tapestry.openapi-description";
    682
    683    /**
    684     * Defines the version of this application in the generated OpenAPI description (i.e. info/version).
    685     * No default value is provided.
    686     * @see DefaultOpenApiDescriptionGenerator
    687     * @see OpenApiDescriptionGenerator
    688     * @since 5.8.0
    689     */
    690    public static final String OPENAPI_APPLICATION_VERSION = "tapestry.openapi-application-version";
    691
    692    /**
    693     * Defines whether the OpenAPI description file of this application's REST endpoints should be
    694     * published or not. The default value is <code>false</code>.
    695     * @see OpenApiDescriptionGenerator
    696     * @see #OPENAPI_DESCRIPTION_PATH
    697     * @since 5.8.0
    698     */
    699    public static final String PUBLISH_OPENAPI_DEFINITON = "tapestry.publish-openapi-description";
    700
    701    /**
    702     * Defines the path the OpenAPI description file of this application's REST endpoints will be
    703     * published. It should start with a slash. Default value is <code>/openapi.json</code>.
    704     * The description will only be published if {@link #PUBLISH_OPENAPI_DEFINITON} is set to
    705     * <code>true</code>.
    706     * @see OpenApiDescriptionGenerator
    707     * @since 5.8.0
    708     */
    709    public static final String OPENAPI_DESCRIPTION_PATH = "tapestry.openapi-description-path";
    710
    711    /**
    712     * Defines a base path to the generated OpenAPI description relative to the application
    713     * URL as defined by {@link BaseURLSource#getBaseURL(boolean)}. It should be either
    714     * the empty string, meaning there's no base path, or a string starting and ending
    715     * with a slash. Default value is "/" (without the quotes)
    716     * @see OpenApiDescriptionGenerator
    717     * @since 5.8.0
    718     */
    719    public static final String OPENAPI_BASE_PATH = "tapestry.openapi-base-path";
    720
    721    /**
    722     * Defines whether the CORS (Cross-Origing Resource Sharing) support
    723     * should be enabled or not. Default value is "false". If you set this to "true",
    724     * you should also set {@link #CORS_ALLOWED_ORIGINS}.
    725     * This is an alias for {@link TapestryHttpSymbolConstants#CORS_ENABLED}.
    726     * @see CorsHandler
    727     * @see CorsHttpServletRequestFilter
    728     * @since 5.8.2
    729     */
    730    public static final String CORS_ENABLED = TapestryHttpSymbolConstants.CORS_ENABLED;
    731
    732    /**
    733     * Comma-delimited of origins allowed for CORS. The special value "*" means allowing all origins.
    734     * This is used by the default implementation of {@link CorsHandlerHelper#getAllowedOrigin(javax.servlet.http.HttpServletRequest)}.
    735     * Default value is the empty string (i.e. no origins allowed and CORS actually disabled).
    736     * This is an alias for {@link TapestryHttpSymbolConstants#CORS_ALLOWED_ORIGINS}.
    737     * @since 5.8.2
    738     */
    739    public static final String CORS_ALLOWED_ORIGINS = TapestryHttpSymbolConstants.CORS_ALLOWED_ORIGINS;
    740
    741    /**
    742     * Boolean value defining whether the Access-Control-Allow-Credentials HTTP header
    743     * should be set automatically in the response for CORS requests. Default value is
    744     * <code>false</code>. This is used by the default implementation of {@link CorsHandlerHelper#configureCredentials(javax.servlet.http.HttpServletResponse)}.
    745     * This is an alias for {@link TapestryHttpSymbolConstants#CORS_ALLOW_CREDENTIALS}.
    746     * @since 5.8.2
    747     */
    748    public static final String CORS_ALLOW_CREDENTIALS = TapestryHttpSymbolConstants.CORS_ALLOW_CREDENTIALS;
    749
    750    /**
    751     * Value to be used in the Access-Control-Allow-Methods in CORS preflight request responses.
    752     * This is used by the default implementation of {@link CorsHandlerHelper#configureMethods(javax.servlet.http.HttpServletResponse)}.
    753     * Default value is <code>GET,HEAD,PUT,PATCH,POST,DELETE</code>.
    754     * This is an alias for {@link TapestryHttpSymbolConstants#CORS_ALLOW_METHODS}.
    755     * @since 5.8.2
    756     */
    757    public static final String CORS_ALLOW_METHODS = TapestryHttpSymbolConstants.CORS_ALLOW_METHODS;
    758
    759    /**
    760     * Value to be used in the Access-Control-Allow-Headers in CORS preflight request responses.
    761     * This is used by the default implementation of {@link CorsHandlerHelper#configureAllowedHeaders(javax.servlet.http.HttpServletResponse, javax.servlet.http.HttpServletRequest)}.
    762     * Default value is the empty string.
    763     * This is an alias for {@link TapestryHttpSymbolConstants#CORS_ALLOWED_HEADERS}.
    764     * @since 5.8.2
    765     */
    766    public static final String CORS_ALLOWED_HEADERS = TapestryHttpSymbolConstants.CORS_ALLOWED_HEADERS;
    767
    768    /**
    769     * Value to be used in the Access-Control-Expose-Headers in CORS request responses.
    770     * This is used by the default implementation of {@link CorsHandlerHelper#configureExposeHeaders(javax.servlet.http.HttpServletResponse)}.
    771     * Default value is the empty string.
    772     * This is an alias for {@link TapestryHttpSymbolConstants#CORS_EXPOSE_HEADERS}.
    773     * @since 5.8.2
    774     */
    775    public static final String CORS_EXPOSE_HEADERS = TapestryHttpSymbolConstants.CORS_EXPOSE_HEADERS;
    776
    777    /**
    778     * Value to be used in the Access-Control-Max-Age in responses to preflight CORS requests.
    779     * This is used by the default implementation of {@link CorsHandlerHelper#configureMaxAge(javax.servlet.http.HttpServletResponse)}.
    780     * Default value is the empty string.
    781     * This is an alias for {@link TapestryHttpSymbolConstants#CORS_MAX_AGE}.
    782     * @since 5.8.2
    783     */
    784    public static final String CORS_MAX_AGE = TapestryHttpSymbolConstants.CORS_MAX_AGE;
    785
    786    /**
    787     * Defines whether multiple classloaders will be used instead of one for smarter page invalidation.
    788     * This is ignored when in production mode.
    789     * Default value is <code>false</code>.
    790     * @see PageClassLoaderContextManager
    791     * @since 5.8.3
    792     */
    793    public static final String MULTIPLE_CLASSLOADERS = "tapestry.multiple-classloaders";
    794
    795    /**
    796     * <p>
    797     * Defines what file should be used to store and read component dependency information.
    798     * It can be either an absolute path or a path relative to the current folder where
    799     * the JVM is running.
    800     * </p>
    801     * <p>
    802     * This symbol is ignored when in production mode.
    803     * </p>
    804     * <p>
    805     * Default value is <code>tapestryComponentDependencies.json</code>
    806     * ({@linkplain ComponentDependencyRegistry#FILENAME}).
    807     * </p>
    808     * @see ComponentDependencyRegistry
    809     * @since 5.8.4
    810     */
    811    public static final String COMPONENT_DEPENDENCY_FILE = "tapestry.component-dependency-file";
    812
    813}