Helfer Form

Jan Burse, erstellt 27. Aug 2018
<%@page session="false"%><%@page contentType="text/html; charset=UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<!-- -->
<!-- Warranty & Liability -->
<!-- To the extent permitted by applicable law and unless explicitly -->
<!-- otherwise agreed upon, XLOG Technologies GmbH makes no warranties -->
<!-- regarding the provided information. XLOG Technologies GmbH assumes -->
<!-- no liability that any problems might be solved with the information -->
<!-- provided by XLOG Technologies GmbH. -->
<!-- -->
<!-- Rights & License -->
<!-- All industrial property rights regarding the information - copyright -->
<!-- and patent rights in particular - are the sole property of XLOG -->
<!-- Technologies GmbH. If the company was not the originator of some -->
<!-- excerpts, XLOG Technologies GmbH has at least obtained the right to -->
<!-- reproduce, change and translate the information. -->
<!-- -->
<!-- Reproduction is restricted to the whole unaltered document. -->
<!-- Reproduction of the information is only allowed for non-commercial -->
<!-- uses. Selling, giving away or letting of the execution of the -->
<!-- library is prohibited. The library can be distributed as part of -->
<!-- your applications and libraries for execution provided this comment -->
<!-- remains unchanged. -->
<!-- -->
<!-- Trademarks -->
<!-- Jekejeke is a registered trademark of XLOG Technologies GmbH. -->
<!-- -->
<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="content-type">
<title>Deployment Study - Servlet</title>
</head>
<body>
<h1>Deployment Study - Servlet</h1>
<%
request.setCharacterEncoding("UTF-8");
String firstname;
String name;
String agefrom;
String ageto;
String salaryfrom;
String salaryto;
if (request.getParameter("search") != null) {
firstname = request.getParameter("firstname");
name = request.getParameter("name");
agefrom = request.getParameter("agefrom");
ageto = request.getParameter("ageto");
salaryfrom = request.getParameter("salaryfrom");
salaryto = request.getParameter("salaryto");
} else {
firstname = "";
name = "";
agefrom = "";
ageto = "";
salaryfrom = "";
salaryto = "";
}
%>
<table border=0>
<form action="">
<tr>
<td>Firstname:</td>
<td colspan="4"><input name="firstname" type="text" size="12"
value="<%=matula.util.system.ForeignXml.sysTextEscape(firstname)%>"></td>
</tr>
<tr>
<td>Name:</td>
<td colspan="4"><input name="name" type="text" size="12"
value="<%=matula.util.system.ForeignXml.sysTextEscape(name)%>"></td>
</tr>
<tr>
<td>Age:</td>
<td>From:</td>
<td><input style="text-align: right;" name="agefrom"
type="text" size="3"
value="<%=matula.util.system.ForeignXml.sysTextEscape(agefrom)%>"></td>
<td>To:</td>
<td><input style="text-align: right;" name="ageto"
type="text" size="3"
value="<%=matula.util.system.ForeignXml.sysTextEscape(ageto)%>"></td>
</tr>
<tr>
<td>Salary:</td>
<td>From:</td>
<td><input style="text-align: right;" name="salaryfrom"
type="text" size="6"
value="<%=matula.util.system.ForeignXml.sysTextEscape(salaryfrom)%>"></td>
<td>To:</td>
<td><input style="text-align: right;" name="salaryto"
type="text" size="6"
value="<%=matula.util.system.ForeignXml.sysTextEscape(salaryto)%>"></td>
</tr>
<tr>
<td colspan="5" align="right"><input name="search"
type="submit" value="Search"></td>
</tr>
</form>
</table>
<%
if (request.getParameter("search") != null) {
try {
example04.Data.initKnowledgebase();
jekpro.tools.call.Interpreter inter = example04.Data.know.iterable();
example01.Query query = new example01.Query(inter);
query.setFirstname(firstname);
query.setName(name);
query.setAgeFrom(agefrom);
query.setAgeTo(ageto);
query.setSalaryFrom(salaryfrom);
query.setSalaryTo(salaryto);
String[] cols = query.listColumnIdentifiers();
jekpro.tools.term.TermVar[] vars = query.makeVars();
Object queryTerm = query.makeQuery(vars);
query.listRows(vars, queryTerm);
Object[][] rows = query.getRows();
%><table border=1><%
%><tr><%
for (int i = 0; i < cols.length; i++) {
%><th><%=matula.util.system.ForeignXml.sysTextEscape(cols[i])%></th><%
}
%></tr><%
for (int j = 0; j < rows.length; j++) {
%><tr><%
Object[] row = rows[j];
for (int i = 0; i < row.length; i++) {
if (cols[i].endsWith("#")) {
%><td align="right"><%=matula.util.system.ForeignXml.sysTextEscape(
row[i].toString())%></td><%
} else {
%><td><%=matula.util.system.ForeignXml.sysTextEscape(
row[i].toString())%></td><%
}
}
%></tr><%
}
%></table><%
} catch (Exception x) {
%><pre>
<%=matula.util.system.ForeignXml.sysTextEscape(x.toString())%>
</pre><%
}
}
%>
</body>
</html>

Kommentare