01: /*
02: * Coefficient - facilitates project based collaboration
03: * Copyright (C) 2003, Dylan Etkin, CSIR icomtek
04: * PO Box 395
05: * Pretoria 0001, RSA
06: * This library is free software; you can redistribute it and/or
07: * modify it under the terms of the GNU Lesser General Public
08: * License as published by the Free Software Foundation; either
09: * version 2.1 of the License, or (at your option) any later version.
10: * This library is distributed in the hope that it will be useful,
11: * but WITHOUT ANY WARRANTY; without even the implied warranty of
12: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13: * Lesser General Public License for more details.
14: *
15: * You should have received a copy of the GNU Lesser General Public
16: * License along with this library; if not, write to the Free Software
17: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18: */
19:
20: package za.org.coefficient.core;
21:
22: /**
23: * This class is used to hold coefficient configuration properties that are
24: * backed up by storage on the DB.
25: *
26: */
27: public class Constants extends BaseConfigurationBackedConstants {
28: //~ Static fields/initializers =============================================
29:
30: public static String JMS_CONNECTION_FACTORY = "java:/ConnectionFactory";
31: public static String JMS_STATISTICS_QUEUE = "queue/statisticsQueue";
32: public static String JMS_EVENTS_QUEUE = "queue/eventsQueue";
33: public static String DATA_SOURCE_NAME = "java:/CoefficientDS";
34: public static String JTA_USER_TRANSACTION_JNDI_NAME = "UserTransaction";
35: public static String MAIL_SMTP_HOST = "";
36: public static String MAIL_SENDER_ADDRESS = "";
37: public static String ALIAS_MAIL_HOST_ADDRESS = "coefficient.co.za";
38: /** The default maximum upload size for a file */
39: public static String MAX_FILE_UPLOAD_SIZE_BYTES = "10485760"; // 10MB
40: public static String FILEUPLOAD_SAVE_PATH = "./";
41: public static String USER_SESSION_STRING = "__current_user_obj_";
42: public static String JNDI_CONTEXT = "za/org/coefficient";
43: public static String SYSTEM_DATE_FORMAT = "dd/MM/yyyy";
44: public static String CFG_SITENAME = "Coefficient";
45: public static String CFG_FOOT1 = "footer message";
46: public static String DEFAULT_THEME_JNDI_NAME = "DefaultTheme";
47: public static String WELCOME_MODULE = "Welcome";
48: public static String CURRENT_THEME_STRING = "__current_theme__";
49: public static int MAX_ELEMENTS_PER_PAGE = 10;
50: public static int STATISTICS_GRAPH_HEIGHT = 500;
51: public static int STATISTICS_GRAPH_WIDTH = 700;
52: public static int MAX_NUM_OF_FORUMS = 20;
53:
54: private static String className = "za.org.coefficient.core.Constants";
55: private static String propertiesFileName = "coefficient.properties";
56:
57: static {
58: Constants.init();
59: }
60:
61: public static void init() {
62: BaseConfigurationBackedConstants.init(propertiesFileName,
63: className);
64:
65: // Check to see if the required params are set
66: Constants.hasRequiredFields();
67: }
68:
69: public static boolean hasRequiredFields() {
70: // Check to see if the required params are set
71: return (!MAIL_SMTP_HOST.trim().equals(""))
72: && (!MAIL_SENDER_ADDRESS.trim().equals(""));
73: }
74: }
|