Update of /cvsroot/archive-access/archive-access/projects/wera/src/webapps/wera
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20407
Added Files:
metadata.php
Log Message:
new file
--- NEW FILE: metadata.php ---
<?php
header("Content-Type: text/html; charset=UTF-8");
include_once("lib/config.inc");
include($conf_includepath . "/header.inc");
?>
</HEAD>
<BODY><center>
<font face="helvetica,arial,sans-serif">
<table align="center" class="resultsborder" border="0" cellspacing="0" cellpadding="0" width="90%">
<tr>
<td>
<?php
include_once($conf_index_file);
include_once("$conf_searchenginepath/indexUtils.inc");
include ("$conf_includepath/meta.inc");
include ("$conf_includepath/documentLocator.inc");
$url = $_REQUEST['url'];
$time = $_REQUEST['time'];
$aid = $_REQUEST['aid'];
$urlnotfound = false;
if (!isset($aid)) {
$searchEngine = new $conf_index_class();
$locator = new documentLocator();
if (!isset($timestamp)) {
$locator->initialize($searchEngine, $url, false, $timestamp, 'LAST');
}
else {
$locator->initialize($searchEngine, $url, false, $timestamp, 'NEAR');
}
$numhits = $locator->findVersions();
if($numhits <= 0) {
$urlnotfound = true;
}
$result = $locator->getResultSet();
$document = $result[1];
$aid = $document['archiveidentifier'];
}
if ($urlnotfound) {
print "Sorry, the url " . $url . " was not found in the <a href=" . $locator->getQueryUrl() . ">index</a>";
}
else {
$names = array ( "aid" => "Archive Identifier (aid)",
"url" => "Url",
"archival_time" => "Time of archival",
"last_modified_time" => "Last modified time",
"type" => "Mime-type",
"charset" => "Character Encoding",
"filestatus" => "File Status",
"content_checksum" => "Content Checksum",
"http-header" => "HTTP Header" );
$metaParser = new metaParser($aid);
if ($metaParser->doParseMeta()) {
$metadata = $metaParser->getMetadata();
print "<h1>Metadata</h1>\n";
print "<table class=\"resultsborder\">";
foreach ($metadata as $k => $v) {
echo "<tr><td><b>";
echo $names[$k];
print "</b></td></tr><tr><td> $v</td></tr>";
}
print "</table>";
}
else {
print $metaParser->getErrorMessage();
}
}
?>
</td>
</tr>
</table>
</center>
<?php
include($conf_includepath . "/footer.inc");
?>
|