upload.jsp
4.18 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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
<%@page import="it.softecspa.portal.ApplicationClusterInfo"%>
<%@page import="it.softecspa.portal.Parameters"%>
<%
Parameters parameters = Parameters.getInstance();
String url = request.getScheme()+"://"+parameters.getChannelInfo().getDomainName();
url += parameters.getChannelInfo().getPortHTTP()+parameters.getChannelInfo().getContextName()+"/proxy-services/statement?upload";
%>
<html>
<head>
<title>Upload file</title>
<meta http-equiv="expires" content="-1">
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<script>
function sendData() {
var xmlhttp;
if (window.XMLHttpRequest) {
xmlhttp = new XMLHttpRequest();
} else if (window.ActiveXObject) {
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
}
//document.dati.risposta.value="Elaborazione in corso....";
xmlhttp.open("POST", "<%=url%>", false);
xmlhttp.setRequestHeader("X-username", document.dati.FIELD_USERNAME.value);
xmlhttp.setRequestHeader("X-password", document.dati.FIELD_PASSWORD.value);
//
xmlhttp.setRequestHeader("X-path", document.dati.FIELD_PATH.value);
xmlhttp.setRequestHeader("X-fileName", document.dati.FIELD_FILENAME.value);
xmlhttp.setRequestHeader("X-bufferLenght", document.dati.FIELD_BUFFER.value);
if (document.dati.FIELD_OVERWRITE.checked) {
xmlhttp.setRequestHeader("X-overwrite", document.dati.FIELD_OVERWRITE.value);
}
if (document.dati.FIELD_APPEND.checked) {
xmlhttp.setRequestHeader("X-append", document.dati.FIELD_APPEND.value);
}
xmlhttp.send(document.dati.FIELD_REQUEST.value);
var risposta = xmlhttp.responseText;
document.dati.FIELD_RESPONSE.value=risposta;
}
</script>
<style>
.tabella {border:solid 1px #DDDDEE; color:#2b2b2b; }
.cella {padding:5px;color:#2b2b2b; background-color:#DDDDEE; font-face:verdana; font-size:14px;}
.cellaIntestazione {padding:5px;color:#2b2b2b; background-color:#DDDDEE; font-face:verdana; font-size:14px; font-weight:bold;}
</style>
</head>
<body>
<form name="dati">
<table border="0" cellspacing="2" cellpadding="2" class="tabella">
<tr><td colspan="2" class="cellaIntestazione">Simulazione traferimento file</td></tr>
<tr>
<td colspan="2" class="cella">
<ul>
<li>Incollare XML nella text area</li>
<li>La login e la password devono essere quelle di un utente abilitato all'import dei dati (ad esempio un amministratore) </li>
<li>Alla fine dell'importazione verrà visualizzato nell'area esito il risultato dell'importazione:</li>
</ul>
</td>
</tr>
<tr>
<td class="cella">login</td>
<td class="cella"><input name="FIELD_USERNAME" type="text"></td>
</tr>
<tr>
<td class="cella">password</td>
<td class="cella"><input name="FIELD_PASSWORD" type="password"></td>
</tr>
<tr>
<td class="cella">path</td>
<td class="cella"><input name="FIELD_PATH" type="text"></td>
</tr>
<tr>
<td class="cella">fileName</td>
<td class="cella"><input name="FIELD_FILENAME" type="text"></td>
</tr>
<tr>
<td class="cella">overwrite</td>
<td class="cella"><input name="FIELD_OVERWRITE" type="checkbox" value="true"></td>
</tr>
<tr>
<td class="cella">append</td>
<td class="cella"><input name="FIELD_APPEND" type="checkbox" value="true"></td>
</tr>
<tr>
<td class="cella">bufferLength</td>
<td class="cella"><input name="FIELD_BUFFER" type="text"></td>
</tr>
<tr>
<td class="cella" colspan="2"><input type="button" value="Invia dati" onclick="sendData();"></td>
</tr>
<tr>
<td colspan="2" class="cella">
<div style="display: inline-block; vertical-align: top;">
<div style="display: inline-block; vertical-align: top;">
Invio<br>
<textarea name="FIELD_REQUEST" cols="80" rows="40"></textarea>
</div>
<div style="display:inline-block; vertical-align: top;">
Esito<br>
<textarea name="FIELD_RESPONSE" readonly="readonly" cols="50" rows="20"></textarea>
</div>
</div>
</td>
</tr>
</table>
</form>
</body>
</html>