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.common.database.fodb;
00030
00031 import java.io.Serializable;
00032
00033 import org.openmobileis.common.context.SessionContext;
00034 import org.openmobileis.common.context.SessionContextManager;
00035 import org.openmobileis.common.intl.IntlResourceManager;
00036 import org.openmobileis.common.util.log.LogManager;
00037 import org.openmobileis.database.fastobjectdb.synchro.client.SynchroFODBReturnListener;
00038 import org.openmobileis.modules.common.data.TerminalUser;
00039 import org.openmobileis.modules.common.data.TerminalUserManager;
00040 import org.openmobileis.synchro.openmsp.OpenMSPException;
00041
00050 public class TerminalUserSynchroFODBReturnListener implements SynchroFODBReturnListener {
00051
00055 public TerminalUserSynchroFODBReturnListener() {
00056 super();
00057 }
00058 public Serializable getSendSynchroMetada() throws OpenMSPException {
00059 return null;
00060 }
00061
00062
00063
00064
00065
00066
00067
00068 public Object notifyBeginDBUpdate(Object object) throws OpenMSPException {
00069 return null;
00070 }
00071
00072
00073
00074
00075
00076
00077 public void notifyDBDelete(String objectId) throws OpenMSPException {
00078 }
00079
00080
00081
00082
00083
00084
00085 public void notifySynchroBegin() {
00086 }
00087
00088
00089
00090
00091
00092
00093 public void notifySynchroEnd() {
00094
00095 try {
00096 TerminalUser[] replist = TerminalUserManager.getManager().getAllTerminalUsers();
00097 for (int i = 0; i < replist.length; i++) {
00098 if (replist[i].isInstallTerminalUser()) {
00099 TerminalUserManager.getManager().setInstallTerminalUser(replist[i].getTerminalUserId());
00100 break;
00101 }
00102 }
00103
00104 SessionContext context = (SessionContext) SessionContextManager.getManager().getSessionContext();
00105 TerminalUser rep = TerminalUserManager.getManager().getInstallTerminalUser();
00106 if (rep != null) {
00107 context.setUserId(rep.getTerminalUserId());
00108 context.setUserLocale(rep.getLangue());
00109 IntlResourceManager.getManager().setManagerLocal(rep.getLangue());
00110 IntlResourceManager.getManager().addLocalizedProperties(System.getProperty("user.dir")+"/WEB-INF/conf/properties/systemmessages.properties", rep.getLangue());
00111 }
00112 } catch (Throwable ex) {
00113 LogManager.traceError(0, ex);
00114 }
00115 }
00116
00117
00118
00119
00120
00121
00122 public void notifyFODBObjectSynchroDone(String ObjectId) throws OpenMSPException {
00123 }
00124
00125 }