<body>
<script type="text/javascript">
+ var mkws_config = { show_lang: true };
+
jQuery.pazpar2({
"layout": "popup", /* "table" [default], "div", "popup" */
"id_button": "input#mkwsButton", /* submit button id in search field */
"id_popup": "#mkwsPopup", /* internal id of popup window */
- "width": 880, /* popup width, should be at least 800 */
+ "width": 990, /* popup width, should be at least 800 */
"height": 760 /* popup height, should be at least 600 */
});
</script>
<script type="text/javascript">
var mkws_config = {
pazpar2_url : "/service-proxy/",
+ show_perpage: false,
+ show_sort: false,
+ perpage_default: 10,
+ sort_default: "title:1",
service_proxy_auth : "/service-proxy-auth"
};
</script>
it("limit search to first author", function () {
var hits_all_targets = get_hit_counter();
+ var author_number = 2; // 2=first author
+ var author_name = $("div#mkwsFacetAuthors div.term:nth-child(" + author_number + ") a").text();
+ // do not click on author with numbers, e.g.: Bower, James M. Beeman, David, 1938-
+ if (author_name.match(/[0-9].+[0-9]/)) {
+ author_number++;
+ }
- var click = $("div#mkwsFacetAuthors div.term:nth-child(2) a").trigger("click");
+ var click = $("div#mkwsFacetAuthors div.term:nth-child(" + author_number + ") a").trigger("click");
debug("limit author click is success: " + click.length);
expect(click.length).toBe(1);
waitsFor(function () {
return get_hit_counter() < hits_all_targets ? true : false;
- }, "Limited author search for less than " + hits_all_targets + " hits", 8 * 1000);
+ }, "Limited author search for less than " + hits_all_targets + " hits", 6 * 1000);
runs(function () {
var hits_single_target = get_hit_counter();
}
}, "Search for source in navi bar", 1000);
- // Note: it may happens that limited source search returns the same number of hits
- // as before. Thats not really an error, but unfortunate
+ // Note: it may happens that limited source search returns the same number of hits
+ // as before. Thats not really an error, but unfortunate
waitsFor(function () {
return get_hit_counter() <= hits_all_targets ? true : false;
}, "Limited source search for less than " + hits_all_targets + " hits", 5 * 1000);
--- /dev/null
+#!/bin/sh
+# Copyright (c) 2014 Index Data ApS, http://indexdata.com
+#
+# nagios test if the the service proxy is up and running
+
+set -e
+: ${mkws_host="http://mkws.indexdata.com/service-proxy/"}
+: ${mkws_username="mkws"}
+: ${mkws_password="mkws"}
+: ${user_agent="nagios service-proxy v0.9"}
+
+tempfile=$(mktemp)
+exit=0
+
+url="$mkws_host?command=auth&action=login&username=$mkws_username&password=$mkws_password"
+if curl -sSf -A "$user_agent" "$url" > $tempfile; then
+ if ! egrep -q '<status>OK</status>' $tempfile; then
+ echo "status not OK"
+ exit=1
+ fi
+ if ! egrep -q '<response jsessionId="[0-9A-F]+"' $tempfile; then
+ echo "response jsessionId missing"
+ exit=1
+ fi
+else
+ echo "URL: $url failed"
+ exit=1
+fi
+
+if [ $exit -gt 0 ]; then
+ cat $tempfile
+fi
+
+rm -f $tempfile
+exit $exit
+
}
}
+
mkws.sort = mkws_config.sort_default;
debug("copied mkws_config.sort_default '" + mkws_config.sort_default + "' to mkws.sort");
var SubjectMax = 10;
var AuthorMax = 10;
+if (!isNaN(parseInt(mkws_config.perpage_default))) {
+ recPerPage = parseInt(mkws_config.perpage_default);
+}
+
//
// pz2.js event handlers:
//