From e30f406cdb9440b79d768d458748f33067257a60 Mon Sep 17 00:00:00 2001 From: miker Date: Tue, 14 Jun 2005 15:30:53 +0000 Subject: [PATCH] adding sources and a reasonable timeout git-svn-id: svn://svn.open-ils.org/ILS/trunk@813 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- Open-ILS/src/extras/opensearch.pm | 10 ++++++- Open-ILS/src/extras/opensearch.xml | 6 ++--- Open-ILS/src/extras/opensearchportal.html | 32 +++++++++++++---------- 3 files changed, 30 insertions(+), 18 deletions(-) diff --git a/Open-ILS/src/extras/opensearch.pm b/Open-ILS/src/extras/opensearch.pm index 0ec38ab66b..c0b8f582cd 100644 --- a/Open-ILS/src/extras/opensearch.pm +++ b/Open-ILS/src/extras/opensearch.pm @@ -26,7 +26,15 @@ sub handler { if (my $fetch = $cgi->param('fetch')) { - print LWP::UserAgent->new->get($fetch)->content; + try { + alarm(15); + print LWP::UserAgent->new->get($fetch)->content; + alarm(0); + } catch Error with { + alarm(0); + print ''; + }; + alarm(0); } else { diff --git a/Open-ILS/src/extras/opensearch.xml b/Open-ILS/src/extras/opensearch.xml index 9f5edffab6..417656c12d 100644 --- a/Open-ILS/src/extras/opensearch.xml +++ b/Open-ILS/src/extras/opensearch.xml @@ -4,10 +4,10 @@ xmlns:openIll="http://open-ils.org/xml/openIll/1.0"> http://gapines.org/opensearch/?target=mr_result&mr_search_type=keyword&mr_search_query={searchTerms}&page={startPage}&mr_search_depth=0&mr_search_location=1&pagesize={count}&max_rank={relevanceScale} http://a9.com/-/spec/opensearchrss/1.0/ - Pines - Pines Consortium Catalogue + Evergreen DEMO + Pines Consortium DEMO OpenSearch Catalogue Search for books in Pines. - book library research + book library research Evergreen Open-ILS GPLS http://gapines.org/images/small_logo.jpg harry potter GPLS diff --git a/Open-ILS/src/extras/opensearchportal.html b/Open-ILS/src/extras/opensearchportal.html index 49153bdae3..36fb753cbb 100644 --- a/Open-ILS/src/extras/opensearchportal.html +++ b/Open-ILS/src/extras/opensearchportal.html @@ -17,7 +17,8 @@ td { vertical-align: top; } -.data_table { +.source_input { + border: dotted blue 1px; } caption { @@ -66,6 +67,7 @@ a:visited { border-collapse: collapse; /*width: 100%;*/ max-width: 400px; + min-width: 300px; } .res_tr { @@ -346,7 +348,7 @@ function getElementTextNS(prefix, local, parentElem, index) { if (result.childNodes.length > 1) { return result.childNodes[1].nodeValue; } else { - return result.textContent; + return result.firstChild.nodeValue; } } else { return ''; @@ -365,19 +367,19 @@ function add_result_row (tab, index, xml, source) { } try { - title = xml.getElementsByTagName('title')[0].textContent; + title = getElementTextNS('','title',xml,0); } catch (e) { title = ''; } try { - tlink = xml.getElementsByTagName('link')[0].textContent; + tlink = getElementTextNS('','link',xml,0); } catch (e) { tlink = ''; } try { - description = xml.getElementsByTagName('description')[0].textContent; + description = getElementTextNS('','description',xml,0); } catch (e) { description = ''; } @@ -417,13 +419,11 @@ function create_search ( s ) {
- - - - -
Keyword Search: + Keyword Search: Hits per Source: + Hits per Source:
Sources: - GPLS Pines - GIL Universal Catalog - NPL/Koha - WebDefRef + Sources: + + + + + + + +
-- 2.43.2