forked from OSBI/saiku-mondrian
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathxmlaTest.jsp
167 lines (144 loc) · 3.54 KB
/
xmlaTest.jsp
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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
<%@ page import="mondrian.olap.Util,
org.w3c.dom.Element,
org.eigenbase.xom.XMLUtil,
java.io.PrintWriter,
java.io.StringWriter,
mondrian.xmla.test.XmlaTestContext,
org.apache.log4j.Logger"%>
<%@ page language="java" %>
<%--
// This software is subject to the terms of the Eclipse Public License v1.0
// Agreement, available at the following URL:
// http://www.eclipse.org/legal/epl-v10.html.
// You must accept the terms of that agreement to use this software.
//
// Copyright (C) 2003-2005 Julian Hyde
// Copyright (C) 2005-2007 Pentaho
// All Rights Reserved.
//
// Julian Hyde, 3 June, 2003
--%>
<%!
private static final Logger LOGGER = Logger.getLogger("mondrian.jsp.xmlaTest");
/**
* XML-encodes a string.
*/
private static String wrap(String s) {
StringWriter sw = new StringWriter();
PrintWriter pw = new PrintWriter(sw);
XMLUtil.stringEncodeXML(s, pw);
pw.flush();
return sw.toString();
}
%>
<html>
<head>
<title>Mondrian XML for Analysis Tester</title>
<style>
.{
font-family:"verdana";
}
.resulttable {
background-color:#AAAAAA;
}
.slicer {
background-color:#DDDDDD;
font-size:10pt;
}
.columnheading {
background-color:#DDDDDD;
font-size:10pt;
}
.rowheading {
background-color:#DDDDDD;
font-size:10pt;
}
.cell {
font-family:"courier";
background-color:#FFFFFF;
font-size:10pt;
text-align:right;
}
</style>
</head>
<body>
<a href=".">back to index</a><p/>
<%
XmlaTestContext context = new XmlaTestContext();
String[][] requests = context.defaultRequests();
int whichRequest = 0;
if (request.getParameter("whichrequest") != null) {
whichRequest =
Integer.valueOf(request.getParameter("whichrequest")).intValue();
}
if (whichRequest >= requests.length) {
whichRequest = requests.length - 1;
}
String[] defaultPair = requests[whichRequest];
String defaultRequest = defaultPair[1];
String postURL = request.getParameter("postURL");
if (postURL == null) {
postURL = "xmla.jsp";
}
%>
<form id='requestChooser' method='POST' action='xmlaTest.jsp'>
<input type='hidden' name='postURL' value='<%= postURL %>'/>
<table>
<tr>
<td>
<select name="whichrequest"><%
for (int i = 0; i < requests.length; i++) {
String[] pair = requests[i];
String fileName = pair[0];
%>
<option <%= whichRequest == i ? " selected" : "" %>
value="<%= i%>"><%= i %>. <%= fileName %>
</option>
<%
}
%>
</select>
</td>
</tr>
<tr>
<td>
<input type="submit" value="show request">
</td>
</tr>
</table>
</form>
<form id='form' method='POST' action='<%= postURL %>'>
<input type='hidden' name='postURL' value='<%= postURL %>'/>
<table>
<tr>
<td>Request</td>
<td>
<textarea rows='25' cols='120' name='SOAPRequest' id='SOAPRequest' style='font-size: 9pt'>
<%= wrap(defaultRequest) %>
</textarea>
</td>
</tr>
<tr>
<td> </td>
<td><input type='submit' value='Run'/></td>
</tr>
</table>
</form>
<p> </p>
<form id='postForm' method='POST' action='xmlaTest.jsp'>
<table border='1'>
<tr>
<td>Target URL:</td>
<td><%= postURL %></td>
</tr>
<tr>
<td>New target URL:</td>
<td><input size='55' name='postURL' value='<%= postURL %>'/><br/>
<input type='submit' value='Change'/>
</td>
</tr>
</table>
</form>
<a href=".">back to index</a><p/>
</body>
</html>