00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029 package org.openmobileis.module;
00030
00031 import java.io.File;
00032 import java.util.Properties;
00033
00034 import org.openmobileis.common.intl.IntlResourceManager;
00035 import org.openmobileis.common.util.PropertiesManager;
00036 import org.openmobileis.common.util.exception.ServiceException;
00037 import org.openmobileis.common.util.log.FileLogManager;
00038 import org.openmobileis.common.util.log.LogManager;
00039 import org.openmobileis.services.servlet.OpenMISInit;
00040
00041 public class ModulesOpenMISInit implements OpenMISInit {
00042
00043 public ModulesOpenMISInit() {
00044 super();
00045 }
00046
00047 public void preLoadingInit() throws ServiceException {
00048 Properties props = new Properties();
00049 props.put("LOGFILE", System.getProperty("user.dir")+"/WEB-INF/log/pdalog.txt");
00050 File file = new File(System.getProperty("user.dir")+"/WEB-INF/log");
00051 if (file.exists()) FileLogManager.registerLogManager(props);
00052 else LogManager.registerLogManager(null);
00053
00054
00055 PropertiesManager.getManager().addProperty("fastobjectdb.database.path", System.getProperty("user.dir")+"/database");
00056 PropertiesManager.getManager().addProperty("fastobjectdb.database.name", "db");
00057
00058 try {
00059 String locale = IntlResourceManager.getManager().getSystemDefaultLocale();
00060 IntlResourceManager.getManager().addLocalizedProperties(System.getProperty("user.dir")+"/WEB-INF/conf/properties/systemmessages.properties", locale);
00061 } catch (Throwable ex) {
00062 throw new ServiceException(ex);
00063 }
00064
00065 String numsyncpropsfile = PropertiesManager.getManager().getProperty("org.openmobileis.synchro.client.openmsp.numsyncpropsfile");
00066 if (numsyncpropsfile == null) {
00067 PropertiesManager.getManager().addProperty("org.openmobileis.synchro.client.openmsp.numsyncpropsfile",System.getProperty("user.dir") + "/WEB-INF/conf/numsync.txt");
00068 }
00069 System.out.println();
00070
00071 }
00072
00073 public void postLoadingInit() throws ServiceException {
00074 }
00075
00076 }