Tester work

This commit is contained in:
jamesagnew 2014-04-30 07:47:05 -04:00
parent 7736e201e2
commit 51c95219f6
3 changed files with 43 additions and 6 deletions

View File

@ -7,12 +7,12 @@ This file is a Thymeleaf template for the
<html>
<head>
<script type="text/javascript" src="jquery-2.1.0.min.js"></script>
<script type="text/javascript" src="PublicTester.js"></script>
<script type="text/javascript">
var serverBase = "<th:block th:text="${base}"/>";
var conformance = <th:block th:text="${jsonEncodedConf}"/>;
var conformance = <th:block th:utext="${jsonEncodedConf}"/>;
</script>
<script type="text/javascript" src="jquery-2.1.0.min.js"></script>
<script type="text/javascript" src="PublicTester.js"></script>
<link rel="stylesheet" type="text/css" href="PublicTester.css"/>
</head>
<body>

View File

@ -16,6 +16,43 @@ function clearCurrentForm(postCompleteFunction) {
}
}
/** Create a tester form for the 'search' method */
/*
function displayRead(expandoTr, resourceName) {
var postCompleteFunction = function() {
var contentCell = $('<td />');
currentForm = $('#' + expandoTr).append(
$('<td class="testerNameCell">Search</td>'),
contentCell
);
conformance.rest.forEach(function(rest){
rest.resource.forEach(function(restResource){
if (restResource.type == 'Patient') {
restResource.searchParam.forEach(function(searchParam){
var formElement = $('<form/>', { action: 'PublicTesterResult.html', method: 'POST' });
contentCell.append(
formElement.append(
$('<input />', { name: 'method', value: 'read', type: 'hidden' }),
$('<input />', { name: 'resourceName', value: resourceName, type: 'hidden' }),
$('<input />', { name: 'id', placeholder: 'Resource ID', type: 'text' }),
)
);
formElement.append(
$('<br />'),
$('<input />', { type: 'submit', value: 'Submit' })
)
});
}
});
});
$('#' + expandoTr).fadeIn(500);
}
clearCurrentForm(postCompleteFunction);
}
*/
/** Create a tester form for the 'read' method */
function displayRead(expandoTr, resourceName) {
var postCompleteFunction = function() {
@ -23,7 +60,7 @@ function displayRead(expandoTr, resourceName) {
currentForm = $('#' + expandoTr).append(
$('<td class="testerNameCell">Read</td>'),
$('<td />').append(
$('<form/>', { id: 'testerform', action: 'PublicTesterResult.html', method: 'POST' }).append(
$('<form/>', { action: 'PublicTesterResult.html', method: 'POST' }).append(
$('<input />', { name: 'method', value: 'read', type: 'hidden' }),
$('<input />', { name: 'resourceName', value: resourceName, type: 'hidden' }),
$('<input />', { name: 'id', placeholder: 'Resource ID', type: 'text' }),
@ -44,7 +81,7 @@ function displayVRead(expandoTr, resourceName) {
currentForm = $('#' + expandoTr).append(
$('<td class="testerNameCell">VRead</td>'),
$('<td />').append(
$('<form/>', { id: 'testerform', action: 'PublicTesterResult.html', method: 'POST' }).append(
$('<form/>', { action: 'PublicTesterResult.html', method: 'POST' }).append(
$('<input />', { name: 'method', value: 'vread', type: 'hidden' }),
$('<input />', { name: 'resourceName', value: resourceName, type: 'hidden' }),
$('<input />', { name: 'id', placeholder: 'Resource ID', type: 'text' }),

View File

@ -55,7 +55,7 @@ public class TesterTest {
PublicTesterServlet testerServlet = new PublicTesterServlet();
testerServlet.setServerBase("http://localhost:" + myPort + "/fhir/context");
testerServlet.setServerBase("http://fhir.healthintersections.com.au/open");
// testerServlet.setServerBase("http://fhir.healthintersections.com.au/open");
ServletHolder handler = new ServletHolder();
handler.setServlet(testerServlet);
proxyHandler.addServlet(handler, "/fhir/tester/*");