"
.$HostName."";
}
}
/**
* Format an OAI Request for pretty printing.
* @param string $Request OAI Request URL
* @return string Formatted request.
*/
function FormatOaiRequest($Request)
{
$Result = htmlentities($Request);
parse_str($Request, $Args);
if (isset($Args["verb"])) {
$Verb = $Args["verb"];
unset($Args["verb"]);
$CheckOtherArgs = false;
switch ($Verb) {
case "GetRecord":
$CheckOtherArgs = true;
$Result = $Verb;
if (isset($Args["metadataPrefix"])) {
$Result .= " (".htmlentities(
$Args["metadataPrefix"]
).")";
unset($Args["metadataPrefix"]);
}
if (isset($Args["identifier"])) {
$Result .= "
".htmlentities($Args["identifier"]);
unset($Args["identifier"]);
}
break;
case "Identify":
$CheckOtherArgs = true;
$Result = $Verb;
break;
case "ListRecords":
case "ListIdentifiers":
$CheckOtherArgs = true;
$Result = $Verb;
if (isset($Args["resumptionToken"])) {
$Result .= " continued";
unset($Args["resumptionToken"]);
} else {
if (isset($Args["metadataPrefix"])) {
$Result .= " (".htmlentities(
$Args["metadataPrefix"]
).")";
unset($Args["metadataPrefix"]);
}
foreach (["from", "until", "set"] as $Thing) {
if (isset($Args[$Thing])) {
$Result .= "
".$Thing.": "
.htmlentities($Args[$Thing]);
unset($Args[$Thing]);
}
}
}
break;
case "ListMetadataFormats":
$CheckOtherArgs = true;
$Result = $Verb;
if (isset($Args["identifier"])) {
$Result .= "
".htmlentities($Args["identifier"]);
unset($Args["identifier"]);
}
break;
case "ListSets":
$CheckOtherArgs = true;
$Result = $Verb;
if (isset($Args["metadataPrefix"])) {
$Result .= " (".htmlentities(
$Args["metadataPrefix"]
).")";
unset($Args["metadataPrefix"]);
}
break;
default:
break;
}
if ($CheckOtherArgs && count($Args)) {
$Result .= "
Illegal arguments:
";
$OtherArgs = [];
foreach ($Args as $Key => $Val) {
$OtherArgs[] = " ".htmlentities($Key).": ".htmlentities($Val);
}
$Result .= implode("
", $OtherArgs);
}
$Result = "".$Result."";
return $Result;
}
}
$H_ListFields["DataOne"]["AllowHTML"] = true;
$H_ListFields["DataOne"]["ValueFunction"] = function ($Item, $FieldId) {
return FormatIPAddress($Item["DataOne"]);
};
$H_ListFields["DataTwo"]["AllowHTML"] = true;
$H_ListFields["DataTwo"]["ValueFunction"] = function ($Item, $FieldId) {
return FormatOaiRequest($Item["DataTwo"]);
};
# construct the ListUI
$ListUI = new ItemListUI($H_ListFields);
$ListUI->ItemsPerPage($H_ResultsPerPage);
$ListUI->BaseLink($H_BaseLink);
$StartOptionList = new HtmlOptionList(
"ST",
[
ST_FOREVER => "All time",
ST_24_MONTH => "Last 24 months",
ST_12_MONTH => "Last 12 months",
ST_6_MONTH => "Last 6 months",
ST_3_MONTH => "Last 3 months",
ST_1_MONTH => "Last month",
ST_1_WEEK => "Last week",
ST_1_DAY => "Last day"
],
$H_StartTime
);
$StartOptionList->SubmitOnChange(true);
$RPOptionList = new HtmlOptionList(
"RP",
[
50 => 50,
100 => 100,
250 => 250,
500 => 500,
750 => 750
],
$H_ResultsPerPage
);
$RPOptionList->SubmitOnChange(true);
$FTOptionList = new HtmlOptionList(
"FT",
[
FT_ALL => "All requests",
FT_CONTACT => "Contact",
FT_SAMPLE => "Sample",
FT_HARVEST => "Harvest",
FT_SETS => "Sets",
],
$H_FilterType
);
$FTOptionList->SubmitOnChange(true);
?>
Contact: One representative OAI request from each host that issued any requests.
Sample: OAI requests that retrieved a subset of the collection's records (either a
GetRecord or a ListRecords that did not have a subsequent ListRecords
with a resumptionToken).
Harvest: Full or partial harvests (a sequence of ListRecords requests where
one or more of them had a resumptionToken).
Sets: OAI requests asking for a collection-specified set of records (ListSets
or ListRecords requests with a set specification).