KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > za > org > coefficient > core > Constants


1 /*
2  * Coefficient - facilitates project based collaboration
3  * Copyright (C) 2003, Dylan Etkin, CSIR icomtek
4  * PO Box 395
5  * Pretoria 0001, RSA
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * 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 JavaDoc JMS_CONNECTION_FACTORY = "java:/ConnectionFactory";
31     public static String JavaDoc JMS_STATISTICS_QUEUE = "queue/statisticsQueue";
32     public static String JavaDoc JMS_EVENTS_QUEUE = "queue/eventsQueue";
33     public static String JavaDoc DATA_SOURCE_NAME = "java:/CoefficientDS";
34     public static String JavaDoc JTA_USER_TRANSACTION_JNDI_NAME = "UserTransaction";
35     public static String JavaDoc MAIL_SMTP_HOST = "";
36     public static String JavaDoc MAIL_SENDER_ADDRESS = "";
37      public static String JavaDoc ALIAS_MAIL_HOST_ADDRESS = "coefficient.co.za";
38     /** The default maximum upload size for a file */
39     public static String JavaDoc MAX_FILE_UPLOAD_SIZE_BYTES = "10485760"; // 10MB
40
public static String JavaDoc FILEUPLOAD_SAVE_PATH = "./";
41     public static String JavaDoc USER_SESSION_STRING = "__current_user_obj_";
42     public static String JavaDoc JNDI_CONTEXT = "za/org/coefficient";
43     public static String JavaDoc SYSTEM_DATE_FORMAT = "dd/MM/yyyy";
44     public static String JavaDoc CFG_SITENAME = "Coefficient";
45     public static String JavaDoc CFG_FOOT1 = "footer message";
46     public static String JavaDoc DEFAULT_THEME_JNDI_NAME = "DefaultTheme";
47     public static String JavaDoc WELCOME_MODULE = "Welcome";
48     public static String JavaDoc 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 JavaDoc className = "za.org.coefficient.core.Constants";
55     private static String JavaDoc propertiesFileName = "coefficient.properties";
56
57     static {
58         Constants.init();
59     }
60
61     public static void init() {
62         BaseConfigurationBackedConstants.init(propertiesFileName, className);
63
64         // Check to see if the required params are set
65
Constants.hasRequiredFields();
66     }
67
68     public static boolean hasRequiredFields() {
69         // Check to see if the required params are set
70
return (!MAIL_SMTP_HOST.trim().equals("")) &&
71             (!MAIL_SENDER_ADDRESS.trim().equals(""));
72     }
73 }
74
Popular Tags