VIVO-734 implement listrdf by delegating to SparqlQueryApiExecutor.

It formerly retrieved the data from Solr.
This commit is contained in:
j2blake 2014-05-06 15:09:54 -04:00
parent 6b77c3b3dc
commit 73fbe66534
2 changed files with 68 additions and 3 deletions

View file

@ -0,0 +1,65 @@
<!-- $This file is distributed under the terms of the license in /doc/license.txt$ -->
<script src="js/jquery.js"></script>
<script>
function TestListRdf() {
self = this;
this.setup = setupButtons;
function setupButtons() {
document.getElementById("submit_button").onclick = function() {
requestWithAcceptHeader(
$("#acceptHeader").val(),
$("#vclass").val());
}
}
function requestWithAcceptHeader(mimetype, vclass) {
var parms = {
type: "GET",
url: "/vivo/listrdf",
headers: {Accept: mimetype},
data: {vclass: vclass},
dataType: "text",
complete: displayResult
};
$.ajax(parms);
}
function displayResult(xhr, status) {
$("#responseCode").text(xhr.status);
$("#mimeType").text(xhr.getResponseHeader("Content-Type"));
$("#responseText").text(xhr.responseText);
}
}
$(document).ready(function() {
new TestListRdf().setup();
});
</script>
<h1>Test the List RDF API</h1>
<h3>Request data</h3>
<table>
<tr>
<td>Accept header</td>
<td><input type="text" size="40" id="acceptHeader"></td>
</tr>
<tr>
<td>VClass URI</td>
<td><input type="text" size="80" id="vclass"></td>
</tr>
<tr>
<td><input type="submit" value="submit the request" id="submit_button"></td>
<td>&nbsp;</td>
</tr>
</table>
<h2>Response data</h2>
<div>Response code is <b><span id="responseCode">000</span></b></div>
<div>MIME type is <b><span id="mimeType">No type</span></b></div>
<div>Text is:</div>
<div><pre id="responseText" style="font-size:small; font-family:monospace">No text</pre></div>

View file

@ -3,7 +3,7 @@
<script src="js/jquery.js"></script> <script src="js/jquery.js"></script>
<script> <script>
function TestLOD() { function TestSparql() {
self = this; self = this;
this.setup = setupButtons; this.setup = setupButtons;
@ -38,11 +38,11 @@ function TestLOD() {
} }
$(document).ready(function() { $(document).ready(function() {
new TestLOD().setup(); new TestSparql().setup();
}); });
</script> </script>
<h1>Test the Linked Open Data requests</h1> <h1>Test the SPARQL Query API</h1>
<h3>Request data</h3> <h3>Request data</h3>
<table> <table>