X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=experiments%2Fspdemo%2Fexample_client.js;h=a8b9a9a43d20495a08d881215847ea6263a86f66;hb=f70db5ec8f1437bf8d4af5d415c1f5b7a43ad6d3;hp=8342494859d9a2a72b9ef965f1ace4272a5dd87c;hpb=b91033999f8920cd86acc11f6af09d0257700e03;p=mkws-moved-to-github.git diff --git a/experiments/spdemo/example_client.js b/experiments/spdemo/example_client.js index 8342494..a8b9a9a 100644 --- a/experiments/spdemo/example_client.js +++ b/experiments/spdemo/example_client.js @@ -4,14 +4,23 @@ // create a parameters array and pass it to the pz2's constructor // then register the form submit event with the pz2.search function // autoInit is set to true on default -var usesessions = true; -var pazpar2path = '/pazpar2/search.pz2'; + +var pazpar2URL = "/pazpar2/search.pz2"; +var serviceProxyURL = "/service-proxy/"; +var authURLServiceProxy = "/service-proxy-auth"; +var pazpar2path = useServiceProxy ? serviceProxyURL : pazpar2URL; + +var usesessions; + var showResponseType = ''; if (document.location.hash == '#useproxy') { usesessions = false; pazpar2path = '/service-proxy/'; showResponseType = 'json'; } +if (useServiceProxy) { + usesessions = false; +} var my_paz = new pz2( { "onshow": my_onshow, "showtime": 500, //each timer (show, stat, term, bytarget) can be specified this way @@ -89,7 +98,10 @@ function my_onstat(data) { + data.activeclients + '/' + data.clients + ' -- ' + 'Retrieved records: ' + data.records - + '/' + data.hits + ' :.'; + + '/' + data.hits + + ' -- by ' + + (useServiceProxy ? 'service proxy' : 'pazpar2') + + ' :.'; } function my_onterm(data) {