All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.apache.cocoon.Constants Maven / Gradle / Ivy

Go to download

Module that contains dependencies to all modules normally needed for a basic Cocoon webapp. Cocoon blocks should normally depend on this modules, as the exact content of the more fine grained sitemap, pipeline and support modules is not stable yet. This module also contains some classes, configuration files and tests that we not have decided where to move yet.

There is a newer version: 2.3.0
Show newest version
/*
 * Copyright 1999-2005 The Apache Software Foundation.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.apache.cocoon;

import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;

/**
 * The Constants used throughout the core of the Cocoon engine.
 *
 * @version $Id: Constants.java 419558 2006-07-06 14:04:36Z cziegeler $
 */
public final class Constants {

    /** Our properties are now here: */
    private static final String PROPS_FILE = "org/apache/cocoon/cocoon.properties";

    static final Properties properties;

    /**
     * Load the cocoon properties
     */
    static {
        properties = new Properties();
        try {
            final InputStream is = Constants.class.getClassLoader().getResourceAsStream(PROPS_FILE);
            if ( null == is ) {
                throw new ConstantsInitializationException("Cocoon cannot find required properties from " + PROPS_FILE);
            }
            properties.load(is);
        } catch (IOException ioe) {
            throw new ConstantsInitializationException("Cocoon cannot load required properties from " + PROPS_FILE, ioe);
        }

    }

    /** The name of this project. 
     * @deprecated This will be removed soon. 
     */
    public static final String NAME = properties.getProperty("name");

    /** The version of this build. */
    public static final String VERSION = properties.getProperty("version");

    /** The full name of this project.
     * @deprecated This will be removed soon. 
     */
    public static final String COMPLETE_NAME = properties.getProperty("fullname") + " " + VERSION;

    /** The version of the configuration schema */
    public static final String CONF_VERSION  = "2.2";

    /** The year of the build */
    public static final String YEAR = properties.getProperty("year");

    /** The build information */
    public static final String BUILD_INFO = properties.getProperty("build.info");

    /**
     * The request parameter name to add a line of the request duration.
     *
     * FIXME(GP): Isn't this Servlet specific?
     */
    public static final String SHOWTIME_PARAM = "cocoon-showtime";

    /**
     * The request parameter name to request a specific view of a resource.
     *
     * FIXME(GP): Isn't this Servlet specific?
     */
    public static final String VIEW_PARAM = "cocoon-view";

    /**
     * The request parameter name to trigger a specific action.
     *
     * FIXME(GP): Isn't this Servlet specific?
     */
    public static final String ACTION_PARAM = "cocoon-action";

    /**
     * The request parameter prefix to trigger a specific action.
     *
     * FIXME(GP): Isn't this Servlet specific?
     */
    public static final String ACTION_PARAM_PREFIX = "cocoon-action-";

    /** The URI for xml namespaces */
    public static final String XML_NAMESPACE_URI = "http://www.w3.org/XML/1998/namespace";

    /**
     * Mime-type for the link view
     *
     * FIXME(GP): Isn't this Environment specific?
     */
    public static final String LINK_CONTENT_TYPE = "application/x-cocoon-links";

    /**
     * Name of the request value for the link view
     *
     * FIXME(GP): Isn't this Environment specific?
     */
    public static final String LINK_VIEW = "links";

    /**
     * Key of the Map of index translation table.
     * 

Presence of this Map in the ObjectModel indicates to the Sitemap that link * translation mode has been requested by the environment. Sitemap adds LinkTranslator * transformer to the pipeline, which replaces all the links in the input document with * the links from this translation table. *

* TODO(VG): Move this declaration to ObjectModelHelper * comment found at ObjectModelHelper(JH): * LINK_OBJECT should also be moved to CommandLineEnvironment */ public static final String LINK_OBJECT = "link"; /** * Key of the List for collecting links. *

Presence of this Map in the ObjectModel indicates to the Sitemap that link * gathering mode has been requested by the environment. Sitemap adds LinkGatherer * transformer to the pipeline, which gathers the links in the input document into * this List. *

*/ public static final String LINK_COLLECTION_OBJECT = "link-collection"; /** * The name of a NotifyingObject in the so called objectModel Map. */ public static final String NOTIFYING_OBJECT = "notifying-object"; /** * The default URI to be used when a URI requested refers to * a directory, e.g. http://localhost:8080/site/ */ public static final String INDEX_URI = "index"; /** * The directory to use as context root. */ public static final String DEFAULT_CONTEXT_DIR = "./webapp"; /** * The diretory to use to use for the generated output. */ public static final String DEFAULT_DEST_DIR = "./site"; /** * The diretory to use for generated files. * @deprecated This will be removed soon. */ public static final String DEFAULT_WORK_DIR = "./work"; /** * How a default configuration file is named. * @deprecated This will be removed soon. */ public static final String DEFAULT_CONF_FILE = "cocoon.xconf"; /** The namespace URI for the Error/Exception XML */ public static final String ERROR_NAMESPACE_URI = "http://apache.org/cocoon/error/2.1"; /** The namespace prefix for the Error/Exception XML */ public static final String ERROR_NAMESPACE_PREFIX = "error"; /** Application Context Key for the environmental Context (= ServletContext) */ public static final String CONTEXT_ENVIRONMENT_CONTEXT = "environment-context"; /** Application Context Key for the work directory path. * @deprecated Use{@link org.apache.cocoon.configuration.Settings#getWorkDirectory() instead.} */ public static final String CONTEXT_WORK_DIR = "work-directory"; /** Application Context Key for the upload directory path. * @deprecated Use{@link org.apache.cocoon.configuration.Settings#getUploadDirectory() instead.} */ public static final String CONTEXT_UPLOAD_DIR = "upload-directory"; /** Application Context Key for the cache directory path. * @deprecated Use{@link org.apache.cocoon.configuration.Settings#getCacheDirectory() instead.} */ public static final String CONTEXT_CACHE_DIR = "cache-directory"; /** Application Context key for the current environment prefix */ public static final String CONTEXT_ENV_PREFIX = "env-prefix"; /** Application Context key prefix for the current sitemap virtual components */ public static final String CONTEXT_VPC_PREFIX = "vpc-"; /** Path to the wiring.xml relative to the context root directory */ public static final String WIRING = "wiring.xml"; public static final String BLOCK_META_DIR = "COB-INF"; /** * Application Context Key for the URL to the configuration file * (usually named cocoon.xconf) * @deprecated Use {@link org.apache.cocoon.configuration.Settings#getConfiguration()}. */ public static final String CONTEXT_CONFIG_URL = "config-url"; /** Application Context Key for the default encoding. * @deprecated Use {@link org.apache.cocoon.configuration.Settings#getFormEncoding()}. */ public static final String CONTEXT_DEFAULT_ENCODING = "default-encoding"; }





© 2015 - 2025 Weber Informatics LLC | Privacy Policy