// 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
+ data.activeclients
+ '/' + data.clients + ' -- </span>'
+ '<span>Retrieved records: ' + data.records
- + '/' + data.hits + ' :.</span>';
+ + '/' + data.hits
+ + ' -- by '
+ + (useServiceProxy ? 'service proxy' : 'pazpar2')
+ + ' :.</span>';
}
function my_onterm(data) {