CheckServer.jsp
2.56 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
<%@ page language="java" contentType="application/json" pageEncoding="UTF-8"%>
<%@page import="net.sf.json.*"%>
<%@ page import="java.util.*" %>
<%@ page import="weaver.general.*" %>
<%@ page import="weaver.file.*" %>
<%@ page import="weaver.hrm.*" %>
<%@ page import="weaver.mobile.rong.*" %>
<jsp:useBean id="ps" class="weaver.mobile.plugin.ecology.service.PluginServiceImpl" scope="page" />
<%
response.setContentType("application/json;charset=UTF-8");
FileUpload fu = new FileUpload(request);
String type = Util.null2String(fu.getParameter("type"));
Map result = new HashMap();
if("checkPluginFile".equalsIgnoreCase(type)) {
String fileHash = fu.getParameter("fileHash");
result = ps.checkPluginFile(fileHash);
} else if("mobileSetting".equalsIgnoreCase(type)) {
String settings = fu.getParameter("settings");
String timestamp = fu.getParameter("timestamp");
result = ps.syncMobileSetting(settings, timestamp);
} else if("serverSetting".equalsIgnoreCase(type)){
RongConfig rc = RongService.getRongConfig();
result.put("rongAppUDID", rc.getAppUDID());
result.put("rongAppKey", rc.getAppKey());
result.put("rongAppSecret", rc.getAppSecret());
result.put("rongAppUDIDNew", rc.getAppUDIDNew());
result.put("openfireModule", rc.getOpenfire());
result.put("openfireServerSecrect", rc.getServerSecrect());
result.put("openfireDomain", rc.getOpenfireDomain());
result.put("openfireEMobileUrl", rc.getOpenfireEMobileUrl());
result.put("openfireMobileClientUrl", rc.getOpenfireMobileClientUrl());
} else if("pushSetting".equalsIgnoreCase(type)){
String serverUrl = Prop.getPropValue("EMobile4", "serverUrl");
String EMobilePush = Prop.getPropValue("EMobile4", "EMobilePush");
String pushKey= Prop.getPropValue("EMobile4", "pushKey");
result.put("serverUrl", serverUrl );
result.put("EMobilePush", EMobilePush );
result.put("pushKey", pushKey );
} else if("changePushKey".equalsIgnoreCase(type)){
String pushKey= fu.getParameter("pushKey");
Prop.setPropValue("EMobile4", "pushKey",pushKey);
} else if("changeServerUrl".equalsIgnoreCase(type)){
String serverUrl= fu.getParameter("serverUrl");
Prop.setPropValue("EMobile4", "serverUrl",serverUrl);
} else if("openEMobilePush".equalsIgnoreCase(type)){
String EMobilePush= fu.getParameter("EMobilePush");
Prop.setPropValue("EMobile4", "EMobilePush",EMobilePush);
} else{
result = ps.checkServerStatus();
}
if(result!=null) {
JSONObject jo = JSONObject.fromObject(result);
//System.out.println(jo);
out.println(jo.toString());
}
%>