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

org.apache.felix.webconsole.WebConsoleConstants Maven / Gradle / Ivy

The newest version!
/*
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership.  The ASF licenses this file
 * to you 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.felix.webconsole;

import org.apache.felix.webconsole.servlet.RequestVariableResolver;

/**
 * WebConsoleConstants provides some common constants that are used by plugin
 * developers.
 *
 * @deprecated Either register a servlet using Servlet API 5 or use {@link org.apache.felix.webconsole.servlet.AbstractServlet}
 */
@Deprecated
public interface WebConsoleConstants {

    /**
     * The name of the service to register as to be used as a "plugin" for
     * the OSGi Manager (value is "javax.servlet.Servlet").
     */
    public static final String SERVICE_NAME = "javax.servlet.Servlet";

    /**
     * The URI address label under which the OSGi Manager plugin is called by
     * the OSGi Manager (value is "felix.webconsole.label").
     * 

* This service registration property must be set to a single non-empty * String value. Otherwise the {@link #SERVICE_NAME Servlet} services will * be ignored by the Felix Web Console and not be used as a plugin. */ public static final String PLUGIN_LABEL = "felix.webconsole.label"; /** * The title under which the OSGi Manager plugin is called by * the OSGi Manager (value is "felix.webconsole.title"). *

* For {@link #SERVICE_NAME Servlet} services not extending the * {@link AbstractWebConsolePlugin} this property is required for the * service to be used as a plugin. Otherwise the service is just ignored * by the Felix Web Console. *

* For {@link #SERVICE_NAME Servlet} services extending from the * {@link AbstractWebConsolePlugin} abstract class this property is not * technically required. To support lazy service access, e.g. for plugins * implemented using the OSGi Service Factory pattern, the use * of this service registration property is encouraged. * * @since 2.0.0 */ public static final String PLUGIN_TITLE = "felix.webconsole.title"; /** * The category under which the OSGi Manager plugin is listed in the top * navigation by the OSGi Manager (value is "felix.webconsole.category"). *

* For {@link #SERVICE_NAME Servlet} services not extending the * {@link AbstractWebConsolePlugin} this property is required to declare a * specific category. Otherwise the plugin is put into the default category. *

* For {@link #SERVICE_NAME Servlet} services extending from the * {@link AbstractWebConsolePlugin} abstract class this property is not * technically required. To support lazy service access with categorization, * e.g. for plugins implemented using the OSGi Service Factory * pattern, the use of this service registration property is strongly * encouraged. If the property is missing the * {@link AbstractWebConsolePlugin#getCategory()} is called which should be * overritten. * * @since 3.1.3; Web Console Bundle 4.0.2 */ public static final String PLUGIN_CATEGORY = "felix.webconsole.category"; /** * The property marking a service as a configuration printer. * This can be any service having either a printConfiguration(PrintWriter) * or printConfiguration(PrintWriter, String) method - this is according * to the ConfigurationPrinter and ModeAwareConfigurationPrinter * interfaces. * * If a service has a {@link #PLUGIN_LABEL}, {@link #PLUGIN_TITLE} and * this property, it is treated as a configuration printer service. * * @since 3.1.2; Web Console Bundle 3.1.4 * @deprecated Use the Apache Felix Inventory API */ @Deprecated public static final String CONFIG_PRINTER_MODES = "felix.webconsole.configprinter.modes"; /** * Name of the optional service registration property indicating that a * {@link ConfigurationPrinter} service will provide HTML output when used * in {@link ConfigurationPrinter#MODE_WEB web} mode. If this property is * set to true the configuration printer is expected to * generate HTML output which will not be escaped. Otherwise output in web * mode is escaped for plain text use. * * @since 3.1.2; Web Console Bundle 3.1.4 * @deprecated Use the Apache Felix Inventory API */ @Deprecated public static final String CONFIG_PRINTER_WEB_UNESCAPED = "felix.webconsole.configprinter.web.unescaped"; /** * The name of the service registration properties providing references * to addition CSS files that should be loaded when rendering the header * for a registered plugin. *

* This property is expected to be a single string value, array of string * values or a Collection (or Vector) of string values. *

* This service registration property is only used for plugins registered * as {@link #SERVICE_NAME} services which do not extend the * {@link AbstractWebConsolePlugin}. Extensions of the * {@link AbstractWebConsolePlugin} should overwrite the * {@link AbstractWebConsolePlugin#getCssReferences()} method to provide * additional CSS resources. * * @since 2.0.0 */ public static final String PLUGIN_CSS_REFERENCES = "felix.webconsole.css"; /** * The name of the request attribute providing the absolute path of the * Web Console root (value is "felix.webconsole.appRoot"). This consists of * the servlet context path (from HttpServletRequest.getContextPath()) * and the Web Console servlet path (from * HttpServletRequest.getServletPath(), * /system/console by default). *

* The type of this request attribute is String. * * @since 2.0.0 */ public static final String ATTR_APP_ROOT = "felix.webconsole.appRoot"; /** * The name of the request attribute providing the absolute path of the * current plugin (value is "felix.webconsole.pluginRoot"). This consists of * the servlet context path (from ServletRequest.getContextPath()), * the configured path of the web console root (/system/console * by default) and the plugin label {@link #PLUGIN_LABEL}. *

* The type of this request attribute is String. * * @since 1.2.12 */ public static final String ATTR_PLUGIN_ROOT = "felix.webconsole.pluginRoot"; /** * The name of the request attribute providing a mapping of labels to page * titles of registered console plugins (value is "felix.webconsole.labelMap"). * This map may be used to render a navigation of the console plugins as the * {@link AbstractWebConsolePlugin#renderTopNavigation(javax.servlet.http.HttpServletRequest, java.io.PrintWriter)} * method does. *

* The type of this request attribute is Map<String, String>. * * @since 2.0.0 * @deprecated Plugins should never create a navigation themselves */ @Deprecated public static final String ATTR_LABEL_MAP = "felix.webconsole.labelMap"; /** * The name of the request attribute holding the {@link VariableResolver} * for the request (value is "felix.webconsole.variable.resolver"). * * @see VariableResolver * @see WebConsoleUtil#getVariableResolver(javax.servlet.ServletRequest) * @see WebConsoleUtil#setVariableResolver(javax.servlet.ServletRequest, VariableResolver) * @deprecated Use {@link RequestVariableResolver#REQUEST_ATTRIBUTE} instead * @since 3.0 */ @Deprecated static final String ATTR_CONSOLE_VARIABLE_RESOLVER = RequestVariableResolver.REQUEST_ATTRIBUTE; /** * The name of the request attribute holding the language {@link java.util.Map} * for the request (value is "felix.webconsole.langMap"). * * This map contains the web console supported languages, which are automatically detected. * The keys of the map are the language codes, like "en", "en_US" .. and so-on. * The value for each key is the locale user-friendly name - exactly the same as * returned by {@link java.util.Locale#getDisplayLanguage()}. * * The automatic detection of languages is very simple. It relies on having a * 'res/flags/[lang].gif' file in the bundle. So translators should not only provide * localized l10n/bundle.properties but also a flag image. * * The image should be obtained from http://famfamfam.com/lab/icons/flags/ and eventually * renamed to the correct locale. * * @since 3.1.2 * @deprecated Plugins should never create a navigation themselves */ @Deprecated public static final String ATTR_LANG_MAP = "felix.webconsole.langMap"; /** * The name of the request attribute holding the configuration params {@link java.util.Map} * for the request (value is "felix.webconsole.configuration"). *

* The type of this request attribute is Map<String, Object>. *

* This map contains the web console configuration params managed by the web console. * It can be used to access to the configuration values while processing requests. * * @since 3.5.0 */ public static final String ATTR_CONFIGURATION = "felix.webconsole.configuration"; }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy