From: Sverre B. <sv...@us...> - 2005-10-04 23:40:53
|
Update of /cvsroot/archive-access/archive-access/projects/wera/src/webapps/wera/lib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv865/src/webapps/wera/lib Modified Files: config.inc init.inc timeline.inc documentLocator.inc Added Files: footer.inc header.inc Log Message: Index: timeline.inc =================================================================== RCS file: /cvsroot/archive-access/archive-access/projects/wera/src/webapps/wera/lib/timeline.inc,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** timeline.inc 4 Oct 2005 22:59:27 -0000 1.1 --- timeline.inc 4 Oct 2005 23:40:44 -0000 1.2 *************** *** 38,41 **** --- 38,42 ---- class timeline { var $dates_to_display = array (), $chosen_date, $timeline_array = array (), $resolution, $url, $encoded_url, $conf_index_class, $previous_version, $next_version, $first_version, $last_version, $number_of_versions; + var $error = ""; /** *************** *** 54,76 **** $versions = $this->getVersions(); ! ! $this->first_version = $versions[1][archival_time]; ! $this->last_version = $versions[$this->number_of_versions][archival_time]; ! ! if ($chosen_date == "") { ! $chosen_date = $this->last_version; ! } ! ! if ($resolution == 6) { ! $this->autoresolution = 'on'; ! $this->resolution = 5; ! } ! ! do { ! $buildstatus = $this->buildTimeline($chosen_date, $versions); ! if ($buildstatus == "drilldown" and $this->autoresolution == 'on') { ! $this->resolution--; } ! } while ($buildstatus == "drilldown" and $this->autoresolution == 'on'); } --- 55,79 ---- $versions = $this->getVersions(); ! if ($versions != -1) { ! $retval = true; ! $this->first_version = $versions[1][date]; ! $this->last_version = $versions[$this->number_of_versions][date]; ! ! if ($chosen_date == "") { ! $chosen_date = $this->last_version; } ! ! if ($resolution == 6) { ! $this->autoresolution = 'on'; ! $this->resolution = 5; ! } ! ! do { ! $buildstatus = $this->buildTimeline($chosen_date, $versions); ! if ($buildstatus == "drilldown" and $this->autoresolution == 'on') { ! $this->resolution--; ! } ! } while ($buildstatus == "drilldown" and $this->autoresolution == 'on'); ! } } *************** *** 81,85 **** */ function getTimelineData() { ! return $this->timeline_array; } --- 84,94 ---- */ function getTimelineData() { ! if ($this->error != "") { ! $retval = false; ! } ! else { ! $retval = $this->timeline_array; ! } ! return $retval; } *************** *** 164,168 **** $docloc->initialize($search, $this->url, false, 0, 'ALL'); $this->number_of_versions = $docloc->findVersions(); ! return $docloc->getResultSet(); } --- 173,188 ---- $docloc->initialize($search, $this->url, false, 0, 'ALL'); $this->number_of_versions = $docloc->findVersions(); ! if ($this->number_of_versions != -1) { ! $retval = $docloc->getResultSet(); ! } ! else { ! $retval = -1; ! $this->error = "<b>" . $docloc->getErrorMessage() . "</b> (<a href=\"" . $docloc->getQueryUrl() . "\" TARGET=\"_top\">" . $docloc->getQueryUrl() . "</a>)"; ! } ! return $retval; ! } ! ! function getError() { ! return $this->error; } *************** *** 267,271 **** foreach ($this->dates_to_display as $key => $val) { ! $this->dates_to_display[$key] = $this->dateToArray($this->resolution, $this->dates_to_display[$key][archival_time]); } --- 287,291 ---- foreach ($this->dates_to_display as $key => $val) { ! $this->dates_to_display[$key] = $this->dateToArray($this->resolution, $this->dates_to_display[$key][date]); } --- NEW FILE: footer.inc --- </body> </html> --- NEW FILE: header.inc --- <html> <HEAD> <link rel="stylesheet" href="<?php print $conf_gui_style;?>" type="text/css"> <META HTTP-EQUIV="Cache-Control" Content="must-revalidate"> <META Http-Equiv="Pragma" Content="no-cache"> <META Http-Equiv="Expires" Content="0"> <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8"> <title>WERA</title> Index: init.inc =================================================================== RCS file: /cvsroot/archive-access/archive-access/projects/wera/src/webapps/wera/lib/init.inc,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** init.inc 4 Oct 2005 22:59:27 -0000 1.1 --- init.inc 4 Oct 2005 23:40:44 -0000 1.2 *************** *** 29,33 **** if(isset($conf_includepath)) { ! ini_set("include_path",$conf_includepath.":".$conf_index_path); } --- 29,33 ---- if(isset($conf_includepath)) { ! ini_set("include_path",$conf_includepath); } Index: config.inc =================================================================== RCS file: /cvsroot/archive-access/archive-access/projects/wera/src/webapps/wera/lib/config.inc,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** config.inc 4 Oct 2005 22:59:27 -0000 1.1 --- config.inc 4 Oct 2005 23:40:44 -0000 1.2 *************** *** 34,40 **** $conf_debug = 0; // Print out some debug info // Path to includefiles ! $conf_rootpath = "/opt/lampp/htdocs/werawork"; $conf_includepath = "$conf_rootpath/lib"; $conf_searchenginepath = "$conf_includepath/seal"; --- 34,41 ---- $conf_debug = 0; // Print out some debug info + #error_reporting(E_ALL); // Path to includefiles ! $conf_rootpath = "/opt/lampp/htdocs/archive-access-wera"; $conf_includepath = "$conf_rootpath/lib"; $conf_searchenginepath = "$conf_includepath/seal"; *************** *** 42,48 **** // What search engine to use $conf_searchengine = "nutch"; ! $conf_searchengine_url = "http://fast3.nb.no:8080/nutchwax/opensearch"; ! //$conf_searchengine = "fast"; ! //$conf_searchengine_url = "http://utvikling1.nb.no:15100/cgi-bin/asearch"; $conf_index_file = $conf_searchenginepath . "/" . $conf_searchengine . ".inc"; $conf_index_class = $conf_searchengine . "Search"; --- 43,47 ---- // What search engine to use $conf_searchengine = "nutch"; ! $conf_searchengine_url = "http://wbsearch04.archive.org:8080/nutchwax/opensearch"; $conf_index_file = $conf_searchenginepath . "/" . $conf_searchengine . ".inc"; $conf_index_class = $conf_searchengine . "Search"; *************** *** 54,66 **** // // TODO : Move this into the ARC Retriever ! $conf_aid_prefix = "/home/wera/arcs/"; $conf_aid_suffix = ".arc.gz"; // Prefix to document retriever ! $document_retriever = "http://fast3.nb.no:8080/ArcRetriever/ArcRetriever"; $conf_document_retriever = "$document_retriever?reqtype=getfile&aid="; // URL of gui installation ! $conf_http_host = "http://localhost/WERA/gui"; // Logo --- 53,65 ---- // // TODO : Move this into the ARC Retriever ! $conf_aid_prefix = "/2/katrina/nutch-data/arcs/"; $conf_aid_suffix = ".arc.gz"; // Prefix to document retriever ! $document_retriever = "http://wbsearch04.archive.org:8080/ArcRetriever/ArcRetriever"; $conf_document_retriever = "$document_retriever?reqtype=getfile&aid="; // URL of gui installation ! $conf_http_host = "http://localhost/archive-access-wera"; // Logo Index: documentLocator.inc =================================================================== RCS file: /cvsroot/archive-access/archive-access/projects/wera/src/webapps/wera/lib/documentLocator.inc,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** documentLocator.inc 4 Oct 2005 22:59:27 -0000 1.1 --- documentLocator.inc 4 Oct 2005 23:40:44 -0000 1.2 *************** *** 83,90 **** function findVersions() { ! $query_start = "nwa.url:" . $this->url; if ($this->urlextend) { if (substr($this->url,-1)!="/") { ! $query_start = $query_start . " ". $query_start . "/"; } } --- 83,90 ---- function findVersions() { ! $query_start = "exacturl:" . rawurlencode($this->url); if ($this->urlextend) { if (substr($this->url,-1)!="/") { ! $query_start = $query_start . " ". "exacturl:" . rawurlencode($this->url . "/"); } } *************** *** 94,106 **** switch ($this->querymode) { case 'EXACT': ! $query_end = "nwa.archival_time:" . $this->time; $sortorder = 'ascending'; break; case 'BEFORE': ! $query_end = sprintf("nwa.archival_time:[;%s]", $this->time); $sortorder = 'descending'; break; case 'AFTER': ! $query_end = sprintf("nwa.archival_time:[%s;]", $this->time); $sortorder = 'ascending'; break; --- 94,108 ---- switch ($this->querymode) { case 'EXACT': ! $query_end = "date:" . $this->time; $sortorder = 'ascending'; break; case 'BEFORE': ! $query_end = "date:00000101000000-" . $this->time; $sortorder = 'descending'; break; case 'AFTER': ! $today = getdate(); ! $nextyear = $today['year'] + 1; ! $query_end = "date:" . $this->time . "-" . $nextyear . "0101000000"; $sortorder = 'ascending'; break; *************** *** 119,127 **** } $this->query = $query_end . " +(" . $query_start . ")"; - #print "\nQuery : " . $this->query; $this->indexDriver->setQuery($this->query); $this->indexDriver->setSortorder($sortorder); $this->indexDriver->setSizeOfResultSet($sizeofresultset); ! $this->indexDriver->setFieldsInResult("archival_time dcformat url encoding archiveidentifier collection"); if ($this->indexDriver->doQuery()) { --- 121,128 ---- } $this->query = $query_end . " +(" . $query_start . ")"; $this->indexDriver->setQuery($this->query); $this->indexDriver->setSortorder($sortorder); $this->indexDriver->setSizeOfResultSet($sizeofresultset); ! $this->indexDriver->setFieldsInResult("date dcformat url encoding archiveidentifier collection"); if ($this->indexDriver->doQuery()) { *************** *** 132,136 **** $numhits = -1; } - #print "Queryurl: " . $this->indexDriver->queryurl; } else { // querymode = 'NEAR' --- 133,136 ---- *************** *** 151,155 **** } elseif (($numhits_before > 0) and ($numhits_after > 0)) { ! if (($resultset_after[1][archival_time] - $this->time) < ($this->time - $resultset_before[1][archival_time])) { $this->resultset = $resultset_after; } --- 151,155 ---- } elseif (($numhits_before > 0) and ($numhits_after > 0)) { ! if (($resultset_after[1][date] - $this->time) < ($this->time - $resultset_before[1][date])) { $this->resultset = $resultset_after; } *************** *** 188,191 **** --- 188,195 ---- return $this->indexDriver->getErrorMessage(); } + + function getQueryUrl() { + return $this->indexDriver->queryurl; + } } ?> |