Example #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 = srwDiagnostics(61, "Record offset " . ($rowOffset + 1) . " is invalid for current result set (" . $rowsFound . " " . $recordString . " found)", $exportStylesheet);
        // function 'srwDiagnostics()' is defined in 'srwxml.inc.php'
    } else {
        $recordCollection = srwCollection($result, $rowOffset, $showRows, $exportStylesheet, $displayType);
        // function 'srwCollection()' is defined in 'srwxml.inc.php'
    }
    return $recordCollection;
}
Example #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'
}
Example #3
0
function returnDiagnostic($diagCode, $diagDetails)
{
    global $exportContentType;
    global $contentTypeCharset;
    // '$contentTypeCharset' is defined in 'ini.inc.php'
    global $exportStylesheet;
    // use an appropriate default stylesheet:
    if ($exportStylesheet == "DEFAULT") {
        $exportStylesheet = "";
    }
    // TODO: create a stylesheet ('diag2html.xsl') that's appropriate for SRW diagnostics
    // 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'
    // Return SRW diagnostics (i.e. SRW error information) wrapped into SRW XML ('searchRetrieveResponse'):
    echo srwDiagnostics($diagCode, $diagDetails, $exportStylesheet);
    // function 'srwDiagnostics()' is defined in 'srwxml.inc.php'
}