001    package org.apache.turbine;
002    
003    /*
004     * Licensed to the Apache Software Foundation (ASF) under one
005     * or more contributor license agreements.  See the NOTICE file
006     * distributed with this work for additional information
007     * regarding copyright ownership.  The ASF licenses this file
008     * to you under the Apache License, Version 2.0 (the
009     * "License"); you may not use this file except in compliance
010     * with the License.  You may obtain a copy of the License at
011     *
012     *   http://www.apache.org/licenses/LICENSE-2.0
013     *
014     * Unless required by applicable law or agreed to in writing,
015     * software distributed under the License is distributed on an
016     * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
017     * KIND, either express or implied.  See the License for the
018     * specific language governing permissions and limitations
019     * under the License.
020     */
021    
022    import org.apache.turbine.pipeline.TurbinePipeline;
023    
024    
025    
026    
027    /**
028     * This interface contains all the constants used throughout
029     * the Turbine code base.
030     *
031     * @author <a href="mailto:jvanzyl@apache.org">Jason van Zyl</a>
032     * @author <a href="mailto:hps@intermeta.de">Henning P. Schmiedehausen</a>
033     * @author <a href="mailto:seade@backstagetech.com.au">Scott Eade</a>
034     * @version $Id: TurbineConstants.java 938645 2010-04-27 20:57:51Z tv $
035     */
036    public interface TurbineConstants
037    {
038            /**
039             * <p>The prefix used to denote the namespace reserved for and
040             * used by Turbine-specific configuration parameters (such as
041             * those passed in via servlet container's config file
042             * (<code>server.xml</code>), or the web app deployment descriptor
043             * (<code>web.xml</code>).</p>
044             *
045             * <p>For example, a parameter in the Turbine namespace would be
046             * <code>org.apache.turbine.loggingRoot</code>.</p>
047             */
048            String CONFIG_NAMESPACE = "org.apache.turbine";
049    
050            /** The key for the Log4J File */
051            String LOG4J_CONFIG_FILE = "log4j.file";
052    
053            /** The default value for the Log4J File */
054            String LOG4J_CONFIG_FILE_DEFAULT = "/WEB-INF/conf/Log4j.properties";
055    
056            /** This is the default log file to be used for logging */
057            String DEFAULT_LOGGER = "turbine";
058    
059            /** The logging facility which captures output from the SchedulerService. */
060            String SCHEDULER_LOG_FACILITY = "scheduler";
061    
062            /** The SMTP server Turbine uses to send mail. */
063            String MAIL_SERVER_KEY = "mail.server";
064    
065            /** Default Value for he SMTP server that Turbine uses to send mail. */
066            String MAIL_SERVER_DEFAULT = "localhost";
067    
068            /** The Smtp sender address property */
069            String MAIL_SMTP_FROM = "mail.smtp.from";
070    
071            /** Property that controls whether Turbine modules are cached or not. */
072            String MODULE_CACHE_KEY = "module.cache";
073    
074            /** Default value of the Turbine Module Caching */
075            boolean MODULE_CACHE_DEFAULT = true;
076    
077        /** Property that controls the module cache size. */
078        String MODULE_CACHE_SIZE_KEY = "module.cache.size";
079    
080        /** Default value of the Turbine Module Cache Size */
081        int MODULE_CACHE_SIZE_DEFAULT = 128;
082    
083            /** The packages where Turbine will look for modules. */
084            String MODULE_PACKAGES = "module.packages";
085    
086            /** Home page template. */
087            String TEMPLATE_HOMEPAGE = "template.homepage";
088    
089            /** Login template. */
090            String TEMPLATE_LOGIN = "template.login";
091    
092            /** Template error template Property. */
093            String TEMPLATE_ERROR_KEY = "template.error";
094    
095            /** Template error default for JSP */
096            String TEMPLATE_ERROR_JSP = "error.jsp";
097    
098            /** Template error default for Velocity */
099            String TEMPLATE_ERROR_VM = "error.vm";
100    
101            /** Home page screen. */
102            String SCREEN_HOMEPAGE = "screen.homepage";
103    
104            /** Login screen. */
105            String SCREEN_LOGIN = "screen.login";
106    
107            /** Login error screen. */
108            String SCREEN_ERROR_KEY = "screen.error";
109    
110            /** Default value for Login Screen */
111            String SCREEN_ERROR_DEFAULT = "VelocityErrorScreen";
112    
113            /** Report Screen for invalid state in the application*/
114            String SCREEN_INVALID_STATE = "screen.invalidstate";
115    
116            /** Report Template for invalid state in the application */
117            String TEMPLATE_INVALID_STATE = "template.invalidstate";
118    
119            /** Action to perform when a user logs in. */
120            String ACTION_LOGIN_KEY = "action.login";
121    
122            /** Default Value for login Action */
123            String ACTION_LOGIN_DEFAULT = "LoginUser";
124    
125            /** Action to perform when a user logs out. */
126            String ACTION_LOGOUT_KEY = "action.logout";
127    
128            /** Default Value for ACTION_LOGOUT */
129            String ACTION_LOGOUT_DEFAULT = "LogoutUser";
130    
131            /** Actions that performs session validation. */
132            String ACTION_SESSION_VALIDATOR_KEY = "action.sessionvalidator";
133    
134            /** Default value for the session validator. (org.apache.modules.actions.sessionvalidator.TemplateSessionValidator) */
135            String ACTION_SESSION_VALIDATOR_DEFAULT = "sessionvalidator.TemplateSessionValidator";
136    
137            /** Action that performs Access control */
138            String ACTION_ACCESS_CONTROLLER_KEY = "action.accesscontroller";
139    
140            /** Default value for the access controller. (org.apache.modules.actions.AccessController) */
141            String ACTION_ACCESS_CONTROLLER_DEFAULT = "AccessController";
142    
143            /** Select whether an Action Event must have a non-zero value */
144            String ACTION_EVENTSUBMIT_NEEDSVALUE_KEY = "action.eventsubmit.needsvalue";
145    
146            /** Default value for action.eventsubmit.needsvalue */
147            boolean ACTION_EVENTSUBMIT_NEEDSVALUE_DEFAULT = false;
148    
149            /** Select whether an exception in an Action method is bubbled up to Turbine.handleException() */
150            String ACTION_EVENT_BUBBLE_EXCEPTION_UP = "action.event.bubbleexception";
151    
152            /** Default value for action.event.bubbleexception */
153            boolean ACTION_EVENT_BUBBLE_EXCEPTION_UP_DEFAULT = true;
154    
155            /** Default layout. */
156            String LAYOUT_DEFAULT = "layout.default";
157    
158            /** Default page. */
159            String PAGE_DEFAULT_KEY = "page.default";
160    
161            /** Default value for the Default Page */
162            String PAGE_DEFAULT_DEFAULT = "DefaultPage";
163    
164            /** Default value for the Default Screen */
165            String SCREEN_DEFAULT_DEFAULT = "DefaultScreen";
166    
167            /** Message to display upon successful login. */
168            String LOGIN_MESSAGE = "login.message";
169    
170            /** Message to display when a user fails to login. */
171            String LOGIN_ERROR = "login.error";
172    
173            /** Message to display when screens variable invalid. */
174            String LOGIN_MESSAGE_NOSCREEN = "login.message.noscreen";
175    
176            /** Message to display when a user logs out. */
177            String LOGOUT_MESSAGE = "logout.message";
178    
179            /** Session Timeout */
180            String SESSION_TIMEOUT_KEY = "session.timeout";
181    
182            /** Session Timeout Default Value */
183            int SESSION_TIMEOUT_DEFAULT = -1;
184    
185            /** Indicate whether this Turbine application is using SSL. */
186            String USE_SSL_KEY = "use.ssl";
187    
188            /** Default value for the SSL key */
189            boolean USE_SSL_DEFAULT = true;
190    
191            /**
192             * Should the PP fold the case of everything. Possible values are
193             * "upper", "lower" and "none".
194             */
195            String PP_URL_CASE_FOLDING = "url.case.folding";
196    
197            /** Default document type. */
198            String DEFAULT_DOCUMENT_TYPE_KEY = "default.doctype";
199    
200            /** Html 4.0 Transitional */
201            String DOCUMENT_TYPE_HTML40TRANSITIONAL = "Html40Transitional";
202            /** Html 4.0 Strict */
203            String DOCUMENT_TYPE_HTML40STRICT = "Html40Strict";
204            /** Html 4.0 Frameset */
205            String DOCUMENT_TYPE_HTML40FRAMESET = "Html40Frameset";
206    
207            /** Default doctype root element. */
208            String DEFAULT_HTML_DOCTYPE_ROOT_ELEMENT_KEY
209                            = "default.html.doctype.root.element";
210    
211            /** Default value for the doctype root element */
212            String DEFAULT_HTML_DOCTYPE_ROOT_ELEMENT_DEFAULT
213                            = "HTML";
214    
215            /** Default doctype dtd. */
216            String DEFAULT_HTML_DOCTYPE_IDENTIFIER_KEY
217                            = "default.html.doctype.identifier";
218    
219            /** Default Doctype dtd value */
220            String DEFAULT_HTML_DOCTYPE_IDENTIFIER_DEFAULT
221                            = "-//W3C//DTD HTML 4.01 Transitional//EN";
222    
223            /** Default doctype url. */
224            String DEFAULT_HTML_DOCTYPE_URI_KEY
225                            = "default.html.doctype.url";
226    
227            /** Default doctype url value. */
228            String DEFAULT_HTML_DOCTYPE_URI_DEFAULT
229                            = "http://www.w3.org/TR/1999/REC-html401-19991224/loose.dtd";
230    
231            /** Default Language property */
232            String LOCALE_DEFAULT_LANGUAGE_KEY = "locale.default.language";
233    
234            /** Default value for Language property */
235            String LOCALE_DEFAULT_LANGUAGE_DEFAULT = "en";
236    
237            /** Default Country property */
238            String LOCALE_DEFAULT_COUNTRY_KEY = "locale.default.country";
239    
240            /** Default value for Country property */
241            String LOCALE_DEFAULT_COUNTRY_DEFAULT = "US";
242    
243            /** Default Charset property */
244            String LOCALE_DEFAULT_CHARSET_KEY = "locale.default.charset";
245    
246            /** Default value for Charset property */
247            String LOCALE_DEFAULT_CHARSET_DEFAULT = "ISO-8859-1";
248    
249            /** If this value is set as applicationRoot, then the webContext is used
250             * as application root
251             */
252            String WEB_CONTEXT = "webContext";
253    
254            /** Key for the Path to the TurbineResources.properties File */
255            String APPLICATION_ROOT_KEY = "applicationRoot";
256    
257            /** Default Value for the Path to the TurbineResources.properties File */
258            String APPLICATION_ROOT_DEFAULT = WEB_CONTEXT;
259    
260            /** This is the key used in the Turbine.properties to access resources
261             * relative to the Web Application root. It might differ from the
262             * Application root, but the normal case is, that the webapp root
263             * and the application root point to the same path.
264             */
265            String WEBAPP_ROOT_KEY = "webappRoot";
266    
267            /** The Key in the deployment descriptor for the Logging Directory */
268            String LOGGING_ROOT_KEY = "loggingRoot";
269    
270            /** Default Value for the Logging Directory, relative to the webroot */
271            String LOGGING_ROOT_DEFAULT = "/logs";
272    
273            /** Key for loading the UUID Generator with a constant value */
274            String UUID_ADDRESS_KEY = "uuid.address";
275    
276            /** Context Key for the screen placeholder in the various velocity layouts */
277            String SCREEN_PLACEHOLDER = "screen_placeholder";
278    
279            /** Context Key for the navigation object placeholder in the various velocity layouts */
280            String NAVIGATION_PLACEHOLDER = "navigation";
281    
282            /** Context Key for the Processing Exception */
283            String PROCESSING_EXCEPTION_PLACEHOLDER = "processingException";
284    
285            /** Context Key for the Stack Trace */
286            String STACK_TRACE_PLACEHOLDER = "stackTrace";
287    
288        /** Encoding for Parameter Parser */
289        String PARAMETER_ENCODING_KEY = "input.encoding";
290    
291        /** Default Encoding for Parameter Parser */
292        String PARAMETER_ENCODING_DEFAULT = "ISO-8859-1";
293    
294        /** Default serverName for ServerData */
295        String DEFAULT_SERVER_NAME_KEY
296                = "serverdata.default.serverName";
297    
298        /** Default serverPort for ServerData */
299        String DEFAULT_SERVER_PORT_KEY
300                = "serverdata.default.serverPort";
301    
302        /** Default serverScheme for ServerData */
303        String DEFAULT_SERVER_SCHEME_KEY
304                = "serverdata.default.serverScheme";
305    
306        /** Default scriptName for ServerData */
307        String DEFAULT_SCRIPT_NAME_KEY
308                = "serverdata.default.scriptName";
309    
310        /** Default contextPath for ServerData */
311        String DEFAULT_CONTEXT_PATH_KEY
312                = "serverdata.default.contextPath";
313    
314            /**
315             * The fully qualified class name of the default {@link
316             * org.apache.turbine.Pipeline} implementation to use in the
317             * {@link org.apache.turbine.Turbine} servlet.
318             */
319            String STANDARD_PIPELINE = TurbinePipeline.class.getName();
320    }