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.modules.profiles.embedded;
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.modules.profiles.embedded.ProfileManager;
00040 import org.openmobileis.services.servlet.OpenMISInit;
00041
00042 public class ProfileOpenMISInit implements OpenMISInit {
00043
00044 public ProfileOpenMISInit() {
00045 super();
00046 }
00047
00048 public void preLoadingInit() throws ServiceException {
00049 Properties props = new Properties();
00050 props.put("LOGFILE", System.getProperty("user.dir")+"/WEB-INF/log/pdalog.txt");
00051 File file = new File(System.getProperty("user.dir")+"/WEB-INF/log");
00052 if (file.exists()) FileLogManager.registerLogManager(props);
00053 else LogManager.registerLogManager(null);
00054
00055
00056 PropertiesManager.getManager().addProperty("fastobjectdb.database.path", System.getProperty("user.dir")+"/database");
00057 PropertiesManager.getManager().addProperty("fastobjectdb.database.name", "db");
00058
00059 try {
00060 String locale = IntlResourceManager.getManager().getSystemDefaultLocale();
00061 IntlResourceManager.getManager().addLocalizedProperties(System.getProperty("user.dir")+"/WEB-INF/conf/properties/systemmessages.properties", locale);
00062 } catch (Throwable ex) {
00063 throw new ServiceException(ex);
00064 }
00065
00066 String numsyncpropsfile = PropertiesManager.getManager().getProperty("org.openmobileis.synchro.client.openmsp.numsyncpropsfile");
00067 if (numsyncpropsfile == null) {
00068 PropertiesManager.getManager().addProperty("org.openmobileis.synchro.client.openmsp.numsyncpropsfile",System.getProperty("user.dir") + "/WEB-INF/conf/numsync.txt");
00069 }
00070
00071
00072 ProfileManager.getManager();
00073 System.out.println();
00074
00075 }
00076
00077 public void postLoadingInit() throws ServiceException {
00078
00079 ProfileManager.getManager().loadProfile();
00080 System.out.println();
00081 }
00082
00083 }