Beispiel #1
0
function exportRecords($result, $rowOffset, $showRows, $exportStylesheet, $displayType)
{
    global $rowsFound;
    if ($rowsFound > 0 && $rowOffset + 1 > $rowsFound) {
        if ($rowsFound == 1) {
            $recordString = "record";
        } else {
            $recordString = "records";
        }
        $recordCollection = openSearchDiagnostics(61, "Record offset " . ($rowOffset + 1) . " is invalid for current result set (" . $rowsFound . " " . $recordString . " found)", $exportStylesheet);
        // function 'openSearchDiagnostics()' is defined in 'opensearch.inc.php'
    } else {
        $recordCollection = atomCollection($result, $rowOffset, $showRows, $exportStylesheet, $displayType);
        // function 'atomCollection()' is defined in 'atomxml.inc.php'
    }
    return $recordCollection;
}
Beispiel #2
0
function returnDiagnostic($diagCode, $diagDetails)
{
    global $recordSchema;
    global $exportContentType;
    global $contentTypeCharset;
    // '$contentTypeCharset' is defined in 'ini.inc.php'
    global $exportStylesheet;
    // Set the appropriate mimetype & set the character encoding to the one given in '$contentTypeCharset':
    setHeaderContentType($exportContentType, $contentTypeCharset);
    // function 'setHeaderContentType()' is defined in 'include.inc.php'
    if (preg_match("/^srw([ _]?(mods|dc))?([ _]?xml)?\$/i", $recordSchema)) {
        // Return SRW diagnostics (i.e. SRW error information) wrapped into SRW XML ('searchRetrieveResponse'):
        echo srwDiagnostics($diagCode, $diagDetails, $exportStylesheet);
    } else {
        // Return OpenSearch diagnostics (i.e. OpenSearch error information) wrapped into OpenSearch Atom XML:
        echo openSearchDiagnostics($diagCode, $diagDetails, $exportStylesheet);
    }
    // function 'openSearchDiagnostics()' is defined in 'opensearch.inc.php'
}