001/*
002 * This library is part of OpenCms -
003 * the Open Source Content Management System
004 *
005 * Copyright (c) Alkacon Software GmbH & Co. KG (http://www.alkacon.com)
006 *
007 * This library is free software; you can redistribute it and/or
008 * modify it under the terms of the GNU Lesser General Public
009 * License as published by the Free Software Foundation; either
010 * version 2.1 of the License, or (at your option) any later version.
011 *
012 * This library is distributed in the hope that it will be useful,
013 * but WITHOUT ANY WARRANTY; without even the implied warranty of
014 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
015 * Lesser General Public License for more details.
016 *
017 * For further information about Alkacon Software GmbH & Co. KG, please see the
018 * company website: http://www.alkacon.com
019 *
020 * For further information about OpenCms, please see the
021 * project website: http://www.opencms.org
022 *
023 * You should have received a copy of the GNU Lesser General Public
024 * License along with this library; if not, write to the Free Software
025 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
026 */
027
028package org.opencms.configuration;
029
030import org.apache.commons.digester3.Digester;
031
032import org.dom4j.Element;
033
034/**
035 * Each configurable element in OpenCms must implement this interface.<p>
036 *
037 * @since 6.0.0
038 */
039public interface I_CmsXmlConfiguration extends I_CmsConfigurationParameterHandler {
040
041    /** The "alias" attribute. */
042    String A_ALIAS = "alias";
043
044    /** The "class" attribute. */
045    String A_CLASS = "class";
046
047    /** The "count" attribute. */
048    String A_COUNT = "count";
049
050    /** The "default" attribute. */
051    String A_DEFAULT = "default";
052
053    /** The "destination" attribute. */
054    String A_DESTINATION = "destination";
055
056    /** The "enabled" attibute. */
057    String A_ENABLED = "enabled";
058
059    /** The "from" attribute. */
060    String A_FROM = "from";
061
062    /** The "handler" attribute. */
063    String A_HANDLER = "handler";
064
065    /** The "icon" attribute. */
066    String A_ICON = "icon";
067
068    /** The "id" attribute. */
069    String A_ID = "id";
070
071    /** The "key" attribute. */
072    String A_KEY = "key";
073
074    /** The "name" attribute. */
075    String A_NAME = "name";
076
077    /** The "order" attribute. */
078    String A_ORDER = "order";
079
080    /** The "password" attribute. */
081    String A_PASSWORD = "password";
082
083    /** The "protocol" attribute. */
084    String A_PROTOCOL = "protocol";
085
086    /** The "protocol" attribute. */
087    String A_PORT = "port";
088
089    /** The suffix attribute. */
090    String A_SUFFIX = "suffix";
091
092    /** The "to" attribute. */
093    String A_TO = "to";
094
095    /** The "type" attribute. */
096    String A_TYPE = "type";
097
098    /** The "mode" attribute. */
099    String A_MODE = "mode";
100
101    /** The "uri" attribute. */
102    String A_URI = "uri";
103
104    /** The "user" attribute. */
105    String A_USER = "user";
106
107    /** The "value" attribute. */
108    String A_VALUE = "value";
109
110    /** Individual export point node. */
111    String N_EXPORTPOINT = "exportpoint";
112
113    /** Export points master node. */
114    String N_EXPORTPOINTS = "exportpoints";
115
116    /** An individual name node. */
117    String N_NAME = "name";
118
119    /** The "param" node name for generic parameters. */
120    String N_PARAM = "param";
121
122    /** An individual property node. */
123    String N_PROPERTY = "property";
124
125    /** An individual resource node. */
126    String N_RESOURCE = "resource";
127
128    /** An individual site node. */
129    String N_SITE = "site";
130
131    /** An individual value node. */
132    String N_VALUE = "value";
133
134    /**
135     * Digests an XML node and creates an instance of this configurable class.<p>
136     *
137     * @param digester the digester to use
138     */
139    void addXmlDigesterRules(Digester digester);
140
141    /**
142     * Generates the XML element for this configurable class.<p>
143     *
144     * @param parent the parent element in the XML tree
145     * @return the XML element for this configurable class
146     */
147    Element generateXml(Element parent);
148
149    /**
150     * Returns the name of the DTD file for this XML configuration,
151     * e.g. <code>opencms-configuration.dtd</code>.<p>
152     *
153     * @return the name of the DTD file for this XML configuration
154     * @see #getDtdSystemLocation()
155     * @see #getDtdUrlPrefix()
156     */
157    String getDtdFilename();
158
159    /**
160     * Returns the internal system location of the DTD file for this XML configuration,
161     * e.g. <code>org/opencms/configuration/</code>.<p>
162     *
163     * If this is not <code>null</code>, then the DTD is not read through the
164     * web URL, but an internal name resolution is added that resolves the
165     * system id of the DTD to
166     * <code>{@link #getDtdSystemLocation()} + {@link #getDtdUrlPrefix()}</code>.<p>
167     *
168     * @return the system location of the DTD file for this XML configuration
169     * @see #getDtdUrlPrefix()
170     * @see #getDtdFilename()
171     */
172    String getDtdSystemLocation();
173
174    /**
175     * Returns the external system id prefix of the DTD file for this XML configuration,
176     * e.g. <code>http://www.opencms.org/dtd/6.0/</code>.<p>
177     *
178     * The full system id for the DTD is calculated like this:
179     * <code>{@link #getDtdSystemLocation()} + {@link #getDtdUrlPrefix()}</code>.<p>
180     *
181     * @return the system id prefix of the DTD file for this XML configuration
182     * @see #getDtdSystemLocation()
183     * @see #getDtdFilename()
184     */
185    String getDtdUrlPrefix();
186
187    /**
188     * Returns the name of the XML input file for this configuration,
189     * e.g. <code>opencms.xml</code>.<p>
190     *
191     * @return the name of the XML input file for this configuration
192     */
193    String getXmlFileName();
194}