LdapDataMigration.jsp
2.69 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
64
65
66
67
68
69
70
71
72
73
74
75
76
<%--
Created by IntelliJ IDEA.
User: jiaks
Date: 2019/1/29
Time: 10:08
To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ page import="java.util.ArrayList" %>
<jsp:useBean id="DataSourceXML" class="weaver.servicefiles.DataSourceXML" scope="page" />
<script type="text/javascript" src="/integration/js/jquery-1.10.2.js"></script>
<html>
<head>
<title>Data Migration</title>
<span>Select DataSource:</span>
<select id="dbsource" style='width:180px!important;' name="dbsource">
<option value="<%=DataSourceXML.SYS_LOCAL_POOLNAME%>"></option>
<%
ArrayList pointArrayList = DataSourceXML.getPointArrayList();
for(int i=0;i<pointArrayList.size();i++){
String pointid = (String)pointArrayList.get(i);
String isselected = "";
%>
<option value="<%=pointid%>" <%=isselected%>><%=pointid%></option>
<%
}
%>
</select>
LDAP Code:<input type="text" name="ldapCode" value="" id="ldapCode">
Schedule Task Code:<input type="text" name="scheduleTaskCode" value="" id="scheduleTaskCode">
<input type="button" value="Confirm" onclick="onConfirm()"/>
</head>
<body>
</body>
</html>
<script language="javascript">
function onConfirm(){
var ldapCode = $.trim($("#ldapCode").val());
if(ldapCode.length<=0){
window.alert("LDAP Code can not be empty");
return;
}
var scheduleTaskCode = $.trim($("#scheduleTaskCode").val());
if(scheduleTaskCode.length<=0){
window.alert("Schedule Task Code can not be empty");
return;
}
jQuery.ajax({
url : "/api/integration/ldap/dataMigration",
type : "post",
async : true,
data: {
datasourceid:$("#dbsource").val(),
ldapCode:$("#ldapCode").val(),
scheduleTaskCode:$("#scheduleTaskCode").val()
},
dataType : "json",
success: function(msg){
if(msg&&msg.errorCode=="100"){
window.alert("Success");
}else if(msg&&msg.errorCode=="103"){
window.alert("LDAP configuration not found");
}else if(msg&&msg.errorCode=="104"){
window.alert("Upgraded successfully,LDAP CODE already exists");
}else if(msg&&msg.errorCode=="107"){
window.alert("Schedule Task Code already exists");
}else{
window.alert("Error, please contact Administrator");
}
}
});
}
</script>