Update of /cvsroot/archive-access/archive-access/projects/wera/src/webapps/wera/test
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2269/src/webapps/wera/test
Added Files:
meta.php
Log Message:
moved here from parent directory
--- NEW FILE: meta.php ---
<?php
/*
* This file is part of The NWA Toolset.
*
* Copyright (C) 2001-2002 Royal Library in Stockholm,
* Royal Library in Copenhagen,
* Helsinki University Library of Finland,
* National Library of Norway,
* National and University Library of Iceland.
*
* The NWA Toolset is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* The NWA Toolset is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with The NWA Toolset; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/*
* File: meta.php
*
* $Id: meta.php,v 1.1 2005/10/04 23:49:07 sverreb Exp $
*
* meta.php fetches meta information for the document using the document_retriever.
*/
include_once('lib/config.inc');
include('documentLocator.inc');
include($conf_index_file);
$url = $_REQUEST['url'];
$time = $_REQUEST['time'];
/*
echo "url" . $url;
echo "time" . $time;
*/
// Check input parameters
if(!isset($url)) {
die("This script needs an url to function");
}
$url = index_decode($url);
if(!isset($time)) {
die("This script needs a timestamp to function");
}
//*------------------------------------------------------------
//Create meta retriever link and redirect
$meta_link = document_locator($url, $time, $document_retriever);
header("Location: " . $meta_link);
//*------------------------------------------------------------
function document_locator($url, $timestamp, $document_retriever) {
global $conf_index_class;
$mode = 'standalone';
$searchEngine = new $conf_index_class();
$locator = new documentLocator();
$locator->initialize($searchEngine, $url, false, $timestamp, 'NEAR');
$numhits = $locator->findVersions();
if($numhits <= 0) {
// ERROR: Did not find any document
exit(1);
}
$result = $locator->getResultSet();
$document = $result[1];
$document['dcformat'] = index_decode($document['dcformat']);
$meta = $document_retriever . '?reqtype=getmeta&aid='.urlencode($conf_document_retriever . $document['archiveidentifier']);
return $meta;
}
?>
|