001: /**
002: * Copyright (c) 2003-2007, David A. Czarnecki
003: * All rights reserved.
004: *
005: * Redistribution and use in source and binary forms, with or without
006: * modification, are permitted provided that the following conditions are met:
007: *
008: * Redistributions of source code must retain the above copyright notice, this list of conditions and the
009: * following disclaimer.
010: * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the
011: * following disclaimer in the documentation and/or other materials provided with the distribution.
012: * Neither the name of "David A. Czarnecki" and "blojsom" nor the names of its contributors may be used to
013: * endorse or promote products derived from this software without specific prior written permission.
014: * Products derived from this software may not be called "blojsom", nor may "blojsom" appear in their name,
015: * without prior written permission of David A. Czarnecki.
016: *
017: * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
018: * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
019: * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
020: * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
021: * EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
022: * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
023: * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
024: * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
025: * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
026: * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
027: * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
028: * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
029: * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
030: */package org.blojsom.util;
031:
032: /**
033: * BlojsomConstants
034: *
035: * @author David Czarnecki
036: * @author Mark Lussier
037: * @since blojsom 3.0
038: * @version $Id: BlojsomConstants.java,v 1.20 2007/01/17 02:35:18 czarneckid Exp $
039: */
040: public interface BlojsomConstants {
041:
042: /**
043: * blojsom version
044: */
045: public static final String BLOJSOM_VERSION_NUMBER = "blojsom v3.1";
046:
047: /**
048: * Key under which blog information will be placed
049: * (example: on the request for the JSPDispatcher)
050: */
051: public static final String BLOJSOM_BLOG = "BLOJSOM_BLOG";
052:
053: /**
054: * Key under which the blog entries will be placed
055: * (example: on the request for the JSPDispatcher)
056: */
057: public static final String BLOJSOM_ENTRIES = "BLOJSOM_ENTRIES";
058:
059: /**
060: * Key under which the blog categories will be placed
061: * (example: on the request for the JSPDispatcher)
062: */
063: public static final String BLOJSOM_CATEGORIES = "BLOJSOM_CATEGORIES";
064:
065: /**
066: * Key under which all the blog categories will be placed
067: * (example: on the request for the JSPDispatcher)
068: */
069: public static final String BLOJSOM_ALL_CATEGORIES = "BLOJSOM_ALL_CATEGORIES";
070:
071: /**
072: * Key under which the date (RFC 822 format) of the blog will be placed
073: * (example: on the request for the JSPDispatcher)
074: */
075: public static final String BLOJSOM_DATE = "BLOJSOM_DATE";
076:
077: /**
078: * Key under which the date (ISO 8601 format) of the blog will be placed
079: * (example: on the request for the JSPDispatcher)
080: */
081: public static final String BLOJSOM_DATE_ISO8601 = "BLOJSOM_DATE_ISO8601";
082:
083: /**
084: * Key under which the date object of the blog will be placed
085: * (example: on the request for the JSPDispatcher)
086: */
087: public static final String BLOJSOM_DATE_OBJECT = "BLOJSOM_DATE_OBJECT";
088:
089: /**
090: * Key under which the date (UTC format) of the blog will be placed
091: * (example: on the request for the JSPDispatcher)
092: */
093: public static final String BLOJSOM_DATE_UTC = "BLOJSOM_DATE_UTC";
094:
095: /**
096: * Key under which the blog site will be placed
097: * (example: on the request for the JSPDispatcher)
098: */
099: public static final String BLOJSOM_SITE_URL = "BLOJSOM_SITE_URL";
100:
101: /**
102: * Key under which the permalink value will be placed. This is used to allow templates
103: * to generate trackback auto-discovery fragments.
104: * (example: on the request for the JSPDispatcher)
105: */
106: public static final String BLOJSOM_PERMALINK = "BLOJSOM_PERMALINK";
107:
108: /**
109: * Key under which the next entry after the permalink value will be placed. This is used to allow templates
110: * to generate linear post navigation links.
111: * (example: on the request for the JSPDispatcher)
112: */
113: public static final String BLOJSOM_PERMALINK_NEXT_ENTRY = "BLOJSOM_PERMALINK_NEXT_ENTRY";
114:
115: /**
116: * Key under which the previous entry after the permalink value will be placed. This is used to allow templates
117: * to generate linear post navigation links.
118: * (example: on the request for the JSPDispatcher)
119: */
120: public static final String BLOJSOM_PERMALINK_PREVIOUS_ENTRY = "BLOJSOM_PERMALINK_PREVIOUS_ENTRY";
121:
122: /**
123: * Key under which the requested category will be placed
124: * (example: on the request for the JSPDispatcher)
125: */
126: public static final String BLOJSOM_REQUESTED_CATEGORY = "BLOJSOM_REQUESTED_CATEGORY";
127:
128: /**
129: * Key under which the lastmodified date of the blog will be placed
130: * (example: on the request for the JSPDispatcher)
131: */
132: public static final String BLOJSOM_LAST_MODIFIED = "BLOJSOM_LAST_MODIFIED";
133:
134: /**
135: * Key under which the blog id will be placed
136: * (example: on the request for the JSPDispatcher)
137: */
138: public static final String BLOJSOM_BLOG_ID = "BLOJSOM_BLOG_ID";
139:
140: /**
141: * Key under which the blojsom version string will be placed
142: * (example: on the request for the JSP dispatcher)
143: */
144: public static final String BLOJSOM_VERSION = "BLOJSOM_VERSION";
145:
146: /**
147: * Key under which the blojsom requested flavor string will be placed
148: * (example: in the context for the Velocity dispatcher)
149: */
150: public static final String BLOJSOM_REQUESTED_FLAVOR = "BLOJSOM_REQUESTED_FLAVOR";
151:
152: /**
153: * Key under which the plugins will be placed
154: * (example: in the context for the Velocity dispatcher)
155: */
156: public static final String BLOJSOM_PLUGINS = "BLOJSOM_PLUGINS";
157:
158: /**
159: * Key under which the resource manager will be placed
160: * (example: in the context for the Velocity dispatcher)
161: */
162: public static final String RESOURCE_MANAGER_CONTEXT_KEY = "BLOJSOM_RESOURCE_MANAGER";
163:
164: public static final String BLOJSOM_APPLICATION_CONTEXT = "BLOJSOM_APPLICATION_CONTEXT";
165: public static final String BLOJSOM_XMLRPC_APPLICATION_CONTEXT = "BLOJSOM_XMLRPC_APPLICATION_CONTEXT";
166: public static final String BLOJSOM_COMMENTAPI_APPLICATION_CONTEXT = "BLOJSOM_COMMENTAPI_APPLICATION_CONTEXT";
167:
168: /**
169: * UTF-8 encoding
170: */
171: public static final String UTF8 = "UTF-8";
172:
173: /**
174: * Default flavor for blojsom if none is requested or the flavor requested is invalid
175: */
176: public static final String DEFAULT_FLAVOR_HTML = "html";
177:
178: /**
179: * Request parameter for the requested "flavor"
180: */
181: public static final String FLAVOR_PARAM = "flavor";
182:
183: /**
184: * Request parameter for a "permalink"
185: */
186: public static final String PERMALINK_PARAM = "permalink";
187:
188: /**
189: * Request parameter for the "plugins"
190: */
191: public static final String PLUGINS_PARAM = "plugins";
192:
193: /**
194: * Request parameter for the "page"
195: */
196: public static final String PAGE_PARAM = "page";
197:
198: /**
199: * Request parameter value for the archive page
200: */
201: public static final String PAGE_PARAM_ARCHIVE = "archive";
202:
203: /**
204: * Request parameter value for not toggling LastModfied and ETag fromgetting generated
205: */
206: public static final String OVERRIDE_LASTMODIFIED_PARAM = "lastmodified";
207:
208: /**
209: * Request parameter for the "category"
210: */
211: public static final String CATEGORY_PARAM = "category";
212:
213: /**
214: * Request parameter for the "blog id"
215: */
216: public static final String BLOG_ID_PARAM = "blog_id";
217:
218: /**
219: * Value indicating all subdirectories under the blog home should be searched
220: */
221: public static final int INFINITE_BLOG_DEPTH = -1;
222:
223: /**
224: * Default language for blog if none supplied (en)
225: */
226: public static final String BLOG_LANGUAGE_DEFAULT = "en";
227:
228: /**
229: * Default country for blog if none supplied (US)
230: */
231: public static final String BLOG_COUNTRY_DEFAULT = "US";
232:
233: /**
234: * Default time zone (America/New_York)
235: */
236: public static final String BLOG_DEFAULT_TIMEZONE = "America/New_York";
237:
238: /**
239: * Default number of blog entries to display
240: */
241: public static final int BLOG_ENTRIES_DISPLAY_DEFAULT = 15;
242:
243: /**
244: * HTTP Header Name representing the Last Modified Timstamp of the blog (GMT Based)
245: */
246: public static final String HTTP_LASTMODIFIED = "Last-Modified";
247:
248: /**
249: * HTTP Header Name representing the ETag of the blog
250: */
251: public static final String HTTP_ETAG = "ETag";
252:
253: /**
254: * RFC 822 style date format
255: */
256: public static final String RFC_822_DATE_FORMAT = "EEE, d MMM yyyy HH:mm:ss Z";
257:
258: /**
259: * ISO 8601 style date format
260: * ISO 8601 [W3CDTF] date format (used in rdf flavor)
261: */
262: public static final String ISO_8601_DATE_FORMAT = "yyyy-MM-dd'T'HH:mm:ssz";
263:
264: /**
265: * Short ISO 8601 style date format
266: */
267: public static final String SHORT_ISO_8601_DATE_FORMAT = "yyyy-MM-dd'T'HH:mm:ss'Z'";
268:
269: /**
270: * UTC style date format
271: */
272: public static final String UTC_DATE_FORMAT = "yyyy-MM-dd'T'HH:mm:ss'Z'";
273:
274: /**
275: * If a entry is longer that this length, then when any content hashing is performed, it is
276: * truncated to this size. NOTE: This only truncates for hash.
277: */
278: public static final int MAX_HASHABLE_LENGTH = 300;
279:
280: public static final String IS_IN_REDIRECT = "IS_IN_REDIRECT";
281:
282: /**
283: * Line separator for the system
284: */
285: public static final String LINE_SEPARATOR = System
286: .getProperty("line.separator");
287:
288: public static final String DEFAULT_DIGEST_ALGORITHM = "MD5";
289:
290: public static final String WHITESPACE = " \t\n\f\r";
291:
292: public static final String REDIRECT_TO_PARAM = "redirect_to";
293:
294: public static final String PAGE_NUMBER_PARAM = "pg_num";
295:
296: public static final String BLOJSOM_AJAX_STATUS = "BLOJSOM_AJAX_STATUS";
297: public static final String SUCCESS = "success";
298: public static final String FAILURE = "failure";
299:
300: public static final String PERMISSION_SUFFIX = "_permission";
301:
302: /**
303: * Various HTTP caching headers
304: */
305: public static final String PRAGMA_HTTP_HEADER = "Pragma";
306: public static final String CACHE_CONTROL_HTTP_HEADER = "Cache-Control";
307: public static final String NO_CACHE_HTTP_HEADER_VALUE = "no-cache";
308:
309: // Blojsom properties
310: public static final String DEFAULT_BLOG_IP = "default-blog";
311: public static final String TEMPLATES_DIRECTORY_IP = "templates-directory";
312: public static final String RESOURCES_DIRECTORY_IP = "resources-directory";
313: public static final String DEFAULT_CONFIGURATION_BASE_DIRECTORY = "/WEB-INF/";
314: public static final String BLOGS_DIRECTORY_IP = "blogs-directory";
315: public static final String DEFAULT_BLOGS_DIRECTORY = "/blogs/";
316: public static final String BOOTSTRAP_DIRECTORY_IP = "bootstrap-directory";
317: public static final String DEFAULT_BOOTSTRAP_DIRECTORY = "/bootstrap/";
318: public static final String DEFAULT_TEMPLATES_DIRECTORY = "/templates/";
319: public static final String DEFAULT_RESOURCES_DIRECTORY = "/resources/";
320: public static final String INSTALLED_LOCALES_IP = "installed-locales";
321:
322: // Blog properties
323: public static final String BLOG_NAME_IP = "blog-name";
324: public static final String BLOG_DEPTH_IP = "blog-directory-depth";
325: public static final String BLOG_LANGUAGE_IP = "blog-language";
326: public static final String BLOG_COUNTRY_IP = "blog-country";
327: public static final String BLOG_DESCRIPTION_IP = "blog-description";
328: public static final String BLOG_URL_IP = "blog-url";
329: public static final String BLOG_ADMIN_URL_IP = "blog-admin-url";
330: public static final String BLOG_BASE_URL_IP = "blog-base-url";
331: public static final String BLOG_BASE_ADMIN_URL_IP = "blog-base-admin-url";
332: public static final String BLOG_ENTRIES_DISPLAY_IP = "blog-entries-display";
333: public static final String BLOG_AUTHORIZATION_IP = "blog-authorization";
334: public static final String BLOG_OWNER = "blog-owner";
335: public static final String BLOG_OWNER_EMAIL = "blog-owner-email";
336: public static final String BLOG_COMMENTS_ENABLED_IP = "blog-comments-enabled";
337: public static final String BLOG_TRACKBACKS_ENABLED_IP = "blog-trackbacks-enabled";
338: public static final String BLOG_PINGBACKS_ENABLED_IP = "blog-pingbacks-enabled";
339: public static final String BLOG_EMAIL_ENABLED_IP = "blog-email-enabled";
340: public static final String BLOJSOM_PLUGIN_CHAIN = "blojsom-plugin-chain";
341: public static final String BLOG_DEFAULT_FLAVOR_IP = "blog-default-flavor";
342: public static final String LINEAR_NAVIGATION_ENABLED_IP = "linear-navigation-enabled";
343: public static final String XMLRPC_ENABLED_IP = "xmlrpc-enabled";
344: public static final String BLOG_ADMINISTRATION_LOCALE_IP = "blog-administration-locale";
345: public static final String USE_ENCRYPTED_PASSWORDS = "use-encrypted-passwords";
346: public static final String DIGEST_ALGORITHM = "digest-algorithm";
347: public static final String RECURSIVE_CATEGORIES = "recursive-categories";
348: public static final String PREFERRED_SYNDICATION_FLAVOR = "preferred-syndication-flavor";
349: public static final String USE_DYNAMIC_BLOG_URLS = "use-dynamic-blog-urls";
350: public static final String RECENT_COMMENTS_COUNT = "recent-comments-count";
351: public static final int DEFAULT_RECENT_COMMENTS_COUNT = 5;
352: public static final String RECENT_TRACKBACKS_COUNT = "recent-trackbacks-count";
353: public static final int DEFAULT_RECENT_TRACKBACKS_COUNT = 5;
354: public static final String RECENT_PINGBACKS_COUNT = "recent-pingbacks-count";
355: public static final int DEFAULT_RECENT_PINGBACKS_COUNT = 5;
356: public static final String DEFAULT_POST_CATEGORY = "default-post-category";
357:
358: // User preferences
359: public static final String USE_RICHTEXT_EDITOR_PREFERENCE = "use-richtext-editor";
360: public static final String DISPLAY_RESPONSE_TEXT_PREFERENCE = "display-response-text";
361: }
|