View Javadoc
1   package org.apache.turbine;
2   
3   /*
4    * Licensed to the Apache Software Foundation (ASF) under one
5    * or more contributor license agreements.  See the NOTICE file
6    * distributed with this work for additional information
7    * regarding copyright ownership.  The ASF licenses this file
8    * to you under the Apache License, Version 2.0 (the
9    * "License"); you may not use this file except in compliance
10   * with the License.  You may obtain a copy of the License at
11   *
12   *   http://www.apache.org/licenses/LICENSE-2.0
13   *
14   * Unless required by applicable law or agreed to in writing,
15   * software distributed under the License is distributed on an
16   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17   * KIND, either express or implied.  See the License for the
18   * specific language governing permissions and limitations
19   * under the License.
20   */
21  
22  import java.nio.charset.StandardCharsets;
23  import java.util.Locale;
24  
25  import org.apache.turbine.pipeline.TurbinePipeline;
26  
27  /**
28   * This interface contains all the constants used throughout
29   * the Turbine code base.
30   *
31   * @author <a href="mailto:jvanzyl@apache.org">Jason van Zyl</a>
32   * @author <a href="mailto:hps@intermeta.de">Henning P. Schmiedehausen</a>
33   * @author <a href="mailto:seade@backstagetech.com.au">Scott Eade</a>
34   * @version $Id$
35   */
36  public interface TurbineConstants
37  {
38  	/**
39  	 * <p>The prefix used to denote the namespace reserved for and
40  	 * used by Turbine-specific configuration parameters (such as
41  	 * those passed in via servlet container's config file
42  	 * (<code>server.xml</code>), or the web app deployment descriptor
43  	 * (<code>web.xml</code>).</p>
44  	 *
45  	 * <p>For example, a parameter in the Turbine namespace would be
46  	 * <code>org.apache.turbine.loggingRoot</code>.</p>
47  	 */
48  	String CONFIG_NAMESPACE = "org.apache.turbine";
49  
50  	/** The key for the Log4J File */
51  	String LOG4J2_CONFIG_FILE = "log4j2.file";
52  	/** old key as a reminder */
53  	String LOG4J_CONFIG_FILE = "log4j.file";
54  
55  	/** The default value for the Log4J File */
56  	String LOG4J2_CONFIG_FILE_DEFAULT = "/WEB-INF/conf/log4j2.xml";
57  
58  	/** This is the default log file to be used for logging */
59  	String DEFAULT_LOGGER = "turbine";
60  
61  	/** The logging facility which captures output from the SchedulerService. */
62  	String SCHEDULER_LOG_FACILITY = "scheduler";
63  
64  	/** The SMTP server Turbine uses to send mail. */
65  	String MAIL_SERVER_KEY = "mail.server";
66  
67  	/** Default Value for he SMTP server that Turbine uses to send mail. */
68  	String MAIL_SERVER_DEFAULT = "localhost";
69  
70  	/** The Smtp sender address property */
71  	String MAIL_SMTP_FROM = "mail.smtp.from";
72  
73  	/** Property that controls whether Turbine modules are cached or not. */
74  	String MODULE_CACHE_KEY = "module.cache";
75  
76  	/** Default value of the Turbine Module Caching */
77  	boolean MODULE_CACHE_DEFAULT = true;
78  
79      /** Property that controls the module cache size. */
80      String MODULE_CACHE_SIZE_KEY = "module.cache.size";
81  
82      /** Default value of the Turbine Module Cache Size */
83      int MODULE_CACHE_SIZE_DEFAULT = 128;
84  
85  	/** The packages where Turbine will look for modules. */
86  	String MODULE_PACKAGES = "module.packages";
87  
88  	/** Home page template. */
89  	String TEMPLATE_HOMEPAGE = "template.homepage";
90  
91  	/** Login template. */
92  	String TEMPLATE_LOGIN = "template.login";
93  
94  	/** Template error template Property. */
95  	String TEMPLATE_ERROR_KEY = "template.error";
96  
97  	/** Template error default for JSP */
98  	String TEMPLATE_ERROR_JSP = "error.jsp";
99  
100 	/** Template error default for Velocity */
101 	String TEMPLATE_ERROR_VM = "error.vm";
102 
103 	/** Home page screen. */
104 	String SCREEN_HOMEPAGE = "screen.homepage";
105 
106 	/** Login screen. */
107 	String SCREEN_LOGIN = "screen.login";
108 
109 	/** Login error screen. */
110 	String SCREEN_ERROR_KEY = "screen.error";
111 
112 	/** Default value for Login Screen */
113 	String SCREEN_ERROR_DEFAULT = "VelocityErrorScreen";
114 
115 	/** Report Screen for invalid state in the application*/
116 	String SCREEN_INVALID_STATE = "screen.invalidstate";
117 
118 	/** Report Template for invalid state in the application */
119 	String TEMPLATE_INVALID_STATE = "template.invalidstate";
120 
121 	/** Action to perform when a user logs in. */
122 	String ACTION_LOGIN_KEY = "action.login";
123 
124 	/** Default Value for login Action */
125 	String ACTION_LOGIN_DEFAULT = "LoginUser";
126 
127 	/** Action to perform when a user logs out. */
128 	String ACTION_LOGOUT_KEY = "action.logout";
129 
130 	/** Default Value for ACTION_LOGOUT */
131 	String ACTION_LOGOUT_DEFAULT = "LogoutUser";
132 
133 	/** Actions that performs session validation. */
134 	String ACTION_SESSION_VALIDATOR_KEY = "action.sessionvalidator";
135 
136 	/** Default value for the session validator. (org.apache.modules.actions.sessionvalidator.TemplateSessionValidator) */
137 	String ACTION_SESSION_VALIDATOR_DEFAULT = "sessionvalidator.TemplateSessionValidator";
138 
139 	/** Action that performs Access control */
140 	String ACTION_ACCESS_CONTROLLER_KEY = "action.accesscontroller";
141 
142 	/** Default value for the access controller. (org.apache.modules.actions.AccessController) */
143 	String ACTION_ACCESS_CONTROLLER_DEFAULT = "AccessController";
144 
145 	/** Select whether an Action Event must have a non-zero value */
146 	String ACTION_EVENTSUBMIT_NEEDSVALUE_KEY = "action.eventsubmit.needsvalue";
147 
148 	/** Default value for action.eventsubmit.needsvalue */
149 	boolean ACTION_EVENTSUBMIT_NEEDSVALUE_DEFAULT = false;
150 
151 	/** Select whether an exception in an Action method is bubbled up to Turbine.handleException() */
152 	String ACTION_EVENT_BUBBLE_EXCEPTION_UP = "action.event.bubbleexception";
153 
154 	/** Default value for action.event.bubbleexception */
155 	boolean ACTION_EVENT_BUBBLE_EXCEPTION_UP_DEFAULT = true;
156 
157 	/** Default layout. */
158 	String LAYOUT_DEFAULT = "layout.default";
159 
160 	/** Default page. */
161 	String PAGE_DEFAULT_KEY = "page.default";
162 
163 	/** Default value for the Default Page */
164 	String PAGE_DEFAULT_DEFAULT = "DefaultPage";
165 
166 	/** Default value for the Default Screen */
167 	String SCREEN_DEFAULT_DEFAULT = "DefaultScreen";
168 
169 	/** Message to display upon successful login. */
170 	String LOGIN_MESSAGE = "login.message";
171 
172 	/** Message to display when a user fails to login. */
173 	String LOGIN_ERROR = "login.error";
174 
175 	/** Message to display when screens variable invalid. */
176 	String LOGIN_MESSAGE_NOSCREEN = "login.message.noscreen";
177 
178 	/** Message to display when a user logs out. */
179 	String LOGOUT_MESSAGE = "logout.message";
180 
181 	/** Session Timeout */
182 	String SESSION_TIMEOUT_KEY = "session.timeout";
183 
184 	/** Session Timeout Default Value */
185 	int SESSION_TIMEOUT_DEFAULT = -1;
186 
187 	/** Indicate whether this Turbine application is using SSL. */
188 	String USE_SSL_KEY = "use.ssl";
189 
190 	/** Default value for the SSL key */
191 	boolean USE_SSL_DEFAULT = true;
192 
193 	/**
194 	 * Should the PP fold the case of everything. Possible values are
195 	 * "upper", "lower" and "none".
196 	 */
197 	String PP_URL_CASE_FOLDING = "url.case.folding";
198 
199 	/** Default document type. */
200 	String DEFAULT_DOCUMENT_TYPE_KEY = "default.doctype";
201 
202 	/** Default doctype root element. */
203 	String DEFAULT_HTML_DOCTYPE_ROOT_ELEMENT_KEY = "default.html.doctype.root.element";
204 
205 	/** Default value for the doctype root element */
206 	String DEFAULT_HTML_DOCTYPE_ROOT_ELEMENT_DEFAULT = "HTML";
207 
208 	/** Default doctype dtd. */
209 	String DEFAULT_HTML_DOCTYPE_IDENTIFIER_KEY = "default.html.doctype.identifier";
210 
211 	/** Default Doctype dtd value (empty for HTML5) */
212 	String DEFAULT_HTML_DOCTYPE_IDENTIFIER_DEFAULT = "";
213 
214 	/** Default doctype url. */
215 	String DEFAULT_HTML_DOCTYPE_URI_KEY = "default.html.doctype.url";
216 
217 	/** Default doctype url value. (empty for HTML5) */
218 	String DEFAULT_HTML_DOCTYPE_URI_DEFAULT = "";
219 
220 	/** Define content types **/
221 	String DEFAULT_HTML_CONTENT_TYPE = "text/html";
222 	String DEFAULT_TEXT_CONTENT_TYPE = "text/plain";
223 	String DEFAULT_CSS_CONTENT_TYPE = "text/css";
224 
225 	/** Default Language property */
226 	String LOCALE_DEFAULT_LANGUAGE_KEY = "locale.default.language";
227 
228 	/** Default value for Language property */
229 	String LOCALE_DEFAULT_LANGUAGE_DEFAULT = Locale.US.getLanguage();
230 
231 	/** Default Country property */
232 	String LOCALE_DEFAULT_COUNTRY_KEY = "locale.default.country";
233 
234 	/** Default value for Country property */
235 	String LOCALE_DEFAULT_COUNTRY_DEFAULT = Locale.US.getCountry();
236 
237 	/** Default Charset property */
238 	String LOCALE_DEFAULT_CHARSET_KEY = "locale.default.charset";
239 
240 	/** Default value for Charset property */
241 	String LOCALE_DEFAULT_CHARSET_DEFAULT = StandardCharsets.ISO_8859_1.name();
242 
243     /** Override Charset property */
244     String LOCALE_OVERRIDE_CHARSET_KEY = "locale.override.charset";
245 
246 	/** If this value is set as applicationRoot, then the webContext is used
247 	 * as application root
248 	 */
249 	String WEB_CONTEXT = "webContext";
250 
251 	/** Key for the Path to the TurbineResources.properties File */
252 	String APPLICATION_ROOT_KEY = "applicationRoot";
253 
254 	/** Default Value for the Path to the TurbineResources.properties File */
255 	String APPLICATION_ROOT_DEFAULT = WEB_CONTEXT;
256 
257 	/** This is the key used in the Turbine.properties to access resources
258 	 * relative to the Web Application root. It might differ from the
259 	 * Application root, but the normal case is, that the webapp root
260 	 * and the application root point to the same path.
261 	 */
262 	String WEBAPP_ROOT_KEY = "webappRoot";
263 
264 	/** The Key in the deployment descriptor for the Logging Directory */
265 	String LOGGING_ROOT_KEY = "loggingRoot";
266 
267 	/** Default Value for the Logging Directory, relative to the webroot */
268 	String LOGGING_ROOT_DEFAULT = "/logs";
269 
270 	/** Key for loading the UUID Generator with a constant value */
271 	String UUID_ADDRESS_KEY = "uuid.address";
272 
273 	/** Context Key for the screen placeholder in the various velocity layouts */
274 	String SCREEN_PLACEHOLDER = "screen_placeholder";
275 
276 	/** Context Key for the navigation object placeholder in the various velocity layouts */
277 	String NAVIGATION_PLACEHOLDER = "navigation";
278 
279 	/** Context Key for the Processing Exception */
280 	String PROCESSING_EXCEPTION_PLACEHOLDER = "processingException";
281 
282 	/** Context Key for the Stack Trace */
283 	String STACK_TRACE_PLACEHOLDER = "stackTrace";
284 
285     /** Encoding for Parameter Parser */
286     String PARAMETER_ENCODING_KEY = "input.encoding";
287 
288     /** Default Encoding for Parameter Parser */
289     String PARAMETER_ENCODING_DEFAULT = StandardCharsets.ISO_8859_1.name();
290 
291     /** Default serverName for ServerData */
292     String DEFAULT_SERVER_NAME_KEY
293             = "serverdata.default.serverName";
294 
295     /** Default serverPort for ServerData */
296     String DEFAULT_SERVER_PORT_KEY
297             = "serverdata.default.serverPort";
298 
299     /** Default serverScheme for ServerData */
300     String DEFAULT_SERVER_SCHEME_KEY
301             = "serverdata.default.serverScheme";
302 
303     /** Default scriptName for ServerData */
304     String DEFAULT_SCRIPT_NAME_KEY
305             = "serverdata.default.scriptName";
306 
307     /** Default contextPath for ServerData */
308     String DEFAULT_CONTEXT_PATH_KEY
309             = "serverdata.default.contextPath";
310 
311     /** The default Session key for the Access Control List */
312     String ACL_SESSION_KEY = "turbine.AccessControlList";
313 
314     /**
315 	 * The fully qualified class name of the default {@link
316 	 * org.apache.turbine.pipeline.Pipeline} implementation to use in the
317 	 * {@link org.apache.turbine.Turbine} servlet.
318 	 */
319 	String STANDARD_PIPELINE = TurbinePipeline.class.getName();
320 }