Open Journal Systems
3.3.0
|
Public Member Functions | |
__construct ($config) | |
checkParams ($required=array(), $optional=array()) | |
error ($code, $message) | |
execute () | |
extractDateParams ($params, &$from, &$until) | |
formatMetadata ($format, $record) | |
getNonPathInfoParams () | |
getParam ($name) | |
getParams () | |
GetRecord () | |
identifierExists ($identifier) | |
identifiers ($metadataPrefix, $from, $until, $set, $offset, $limit, &$total) | |
Identify () | |
ListIdentifiers () | |
ListMetadataFormats () | |
ListRecords () | |
ListSets () | |
metadataFormats ($namesOnly=false, $identifier=null) | |
paramExists ($name) | |
record ($identifier) | |
records ($metadataPrefix, $from, $until, $set, $offset, $limit, &$total) | |
repositoryInfo () | |
response ($response, $printParams=true) | |
resumptionToken ($tokenId) | |
saveResumptionToken ($offset, $params) | |
setParams ($params) | |
sets ($offset, $limit, &$total) | |
validIdentifier ($identifier) | |
Data Fields | |
$config | |
$params | |
$protocolVersion = '2.0' | |
Class to process and respond to OAI requests.
Utility functions used by OAI related classes.
Definition at line 27 of file OAI.inc.php.
OAI::__construct | ( | $config | ) |
Constructor. Initializes object and parses user input.
$config | OAIConfig repository configuration |
Reimplemented in JournalOAI.
Definition at line 52 of file OAI.inc.php.
References $config, $GLOBALS, OAIUtils\parseStr(), and OAIUtils\prepInput().
OAI::checkParams | ( | $required = array() , |
|
$optional = array() |
|||
) |
Check request parameters. Outputs error response if an invalid parameter is found.
$required | array required parameters for the current request |
$optional | array optional parameters for the current request |
Definition at line 749 of file OAI.inc.php.
References error(), PKPApplication\get(), getNonPathInfoParams(), getParam(), and paramExists().
Referenced by GetRecord(), Identify(), ListIdentifiers(), ListMetadataFormats(), ListRecords(), and ListSets().
OAI::error | ( | $code, | |
$message | |||
) |
Display OAI error response.
Definition at line 659 of file OAI.inc.php.
References response().
Referenced by checkParams(), execute(), extractDateParams(), GetRecord(), ListIdentifiers(), ListMetadataFormats(), ListRecords(), and ListSets().
OAI::execute | ( | ) |
Execute the requested OAI protocol request and output the response.
Definition at line 79 of file OAI.inc.php.
References error(), getParam(), GetRecord(), Identify(), ListIdentifiers(), ListMetadataFormats(), ListRecords(), and ListSets().
OAI::extractDateParams | ( | $params, | |
& | $from, | ||
& | $until | ||
) |
Checks if from and until parameters have been passed. If passed, validate and convert to UNIX timestamps.
$params | array request parameters |
$from | int from timestamp (output parameter) |
$until | int until timestamp (output parameter) |
Definition at line 809 of file OAI.inc.php.
References $params, error(), and OAIUtils\UTCtoTimestamp().
Referenced by ListIdentifiers(), and ListRecords().
OAI::formatMetadata | ( | $format, | |
$record | |||
) |
Returns formatted metadata response in specified format.
$format | string |
$metadata | OAIMetadata |
Definition at line 795 of file OAI.inc.php.
References metadataFormats().
Referenced by GetRecord(), and ListRecords().
OAI::getNonPathInfoParams | ( | ) |
Return a list of ignorable GET parameters.
Reimplemented in JournalOAI.
Definition at line 738 of file OAI.inc.php.
Referenced by checkParams().
OAI::getParam | ( | $name | ) |
Returns the value of the specified parameter.
$name | string |
Definition at line 705 of file OAI.inc.php.
Referenced by checkParams(), execute(), GetRecord(), ListIdentifiers(), ListMetadataFormats(), ListRecords(), and ListSets().
OAI::getParams | ( | ) |
Returns an associative array of all request parameters.
Definition at line 713 of file OAI.inc.php.
References $params.
Referenced by ListIdentifiers(), ListRecords(), and ListSets().
OAI::GetRecord | ( | ) |
Handle OAI GetRecord request. Retrieves an individual record from the repository.
Definition at line 212 of file OAI.inc.php.
References checkParams(), error(), formatMetadata(), getParam(), metadataFormats(), record(), response(), and validIdentifier().
Referenced by execute().
OAI::identifierExists | ( | $identifier | ) |
Check if identifier exists.
$identifier | string |
Reimplemented in JournalOAI.
Definition at line 131 of file OAI.inc.php.
Referenced by ListMetadataFormats().
OAI::identifiers | ( | $metadataPrefix, | |
$from, | |||
$until, | |||
$set, | |||
$offset, | |||
$limit, | |||
& | $total | ||
) |
Return set of OAI identifiers.
Reimplemented in JournalOAI.
Definition at line 162 of file OAI.inc.php.
Referenced by ListIdentifiers().
OAI::Identify | ( | ) |
Handle OAI Identify request. Retrieves information about a repository.
Definition at line 267 of file OAI.inc.php.
References checkParams(), OAIUtils\prepOutput(), repositoryInfo(), response(), and OAIUtils\UTCDate().
Referenced by execute().
OAI::ListIdentifiers | ( | ) |
Handle OAI ListIdentifiers request. Retrieves headers of records from the repository.
Definition at line 324 of file OAI.inc.php.
References checkParams(), error(), extractDateParams(), getParam(), getParams(), identifiers(), metadataFormats(), paramExists(), OAIUtils\prepOutput(), response(), resumptionToken(), saveResumptionToken(), setParams(), and OAIUtils\UTCDate().
Referenced by execute().
OAI::ListMetadataFormats | ( | ) |
Handle OAI ListMetadataFormats request. Retrieves metadata formats supported by the repository.
Definition at line 419 of file OAI.inc.php.
References checkParams(), error(), getParam(), identifierExists(), metadataFormats(), paramExists(), and response().
Referenced by execute().
OAI::ListRecords | ( | ) |
Handle OAI ListRecords request. Retrieves records from the repository.
Definition at line 465 of file OAI.inc.php.
References checkParams(), error(), extractDateParams(), formatMetadata(), getParam(), getParams(), metadataFormats(), paramExists(), OAIUtils\prepOutput(), records(), response(), resumptionToken(), saveResumptionToken(), setParams(), and OAIUtils\UTCDate().
Referenced by execute().
OAI::ListSets | ( | ) |
Handle OAI ListSets request. Retrieves sets from a repository.
Definition at line 569 of file OAI.inc.php.
References checkParams(), error(), getParam(), getParams(), paramExists(), OAIUtils\prepOutput(), response(), resumptionToken(), saveResumptionToken(), setParams(), sets(), and OAIUtils\UTCDate().
Referenced by execute().
OAI::metadataFormats | ( | $namesOnly = false , |
|
$identifier = null |
|||
) |
Return array of supported metadata formats.
$namesOnly | boolean return array of format prefix names only |
$identifier | string return formats for specific identifier |
Definition at line 197 of file OAI.inc.php.
References HookRegistry\call().
Referenced by formatMetadata(), GetRecord(), ListIdentifiers(), ListMetadataFormats(), and ListRecords().
OAI::paramExists | ( | $name | ) |
Returns true if the requested parameter is set, false if it is not set.
$name | string |
Definition at line 730 of file OAI.inc.php.
Referenced by checkParams(), ListIdentifiers(), ListMetadataFormats(), ListRecords(), and ListSets().
|
abstract |
Return OAI record for specified identifier.
$identifier | string |
Reimplemented in JournalOAI.
Referenced by GetRecord().
OAI::records | ( | $metadataPrefix, | |
$from, | |||
$until, | |||
$set, | |||
$offset, | |||
$limit, | |||
& | $total | ||
) |
Return set of OAI records.
$metadataPrefix | string specified metadata prefix |
$from | int minimum timestamp |
$until | int maximum timestamp |
$set | string specified set |
$offset | int current record offset |
$limit | int maximum number of records to return |
$total | int output parameter, set to total number of records |
Reimplemented in JournalOAI.
Definition at line 153 of file OAI.inc.php.
Referenced by ListRecords().
|
abstract |
Return information about the repository.
Reimplemented in JournalOAI.
Referenced by Identify().
OAI::response | ( | $response, | |
$printParams = true |
|||
) |
Output OAI response.
$response | string text of response message. |
$printParams | boolean display request parameters |
Definition at line 675 of file OAI.inc.php.
References PKPApplication\get(), OAIUtils\prepOutput(), and OAIUtils\UTCDate().
Referenced by error(), GetRecord(), Identify(), ListIdentifiers(), ListMetadataFormats(), ListRecords(), and ListSets().
|
abstract |
Retrieve a resumption token.
$tokenId | string |
Reimplemented in JournalOAI.
Referenced by ListIdentifiers(), ListRecords(), and ListSets().
|
abstract |
Save a resumption token.
$offset | int current offset |
$params | array request parameters |
Reimplemented in JournalOAI.
Referenced by ListIdentifiers(), ListRecords(), and ListSets().
OAI::setParams | ( | $params | ) |
Set the request parameters.
$params | array |
Definition at line 721 of file OAI.inc.php.
References $params.
Referenced by ListIdentifiers(), ListRecords(), and ListSets().
OAI::sets | ( | $offset, | |
$limit, | |||
& | $total | ||
) |
Return set of OAI sets.
$offset | int current set offset |
$limit | int Maximum number of sets to return |
$total | int output parameter, set to total number of sets |
Reimplemented in JournalOAI.
Definition at line 172 of file OAI.inc.php.
Referenced by ListSets(), and OAIDAO\setOAIData().
OAI::validIdentifier | ( | $identifier | ) |
Check if identifier is in the valid format.
$identifier | string |
Reimplemented in JournalOAI.
Definition at line 122 of file OAI.inc.php.
Referenced by GetRecord().
OAIConfig OAI::$config |
configuration parameters
Definition at line 32 of file OAI.inc.php.
Referenced by JournalOAI\__construct(), and __construct().
array OAI::$params |
list of request parameters
Definition at line 38 of file OAI.inc.php.
Referenced by extractDateParams(), getParams(), JournalOAI\saveResumptionToken(), and setParams().
string OAI::$protocolVersion = '2.0' |
version of the OAI protocol supported by this class
Definition at line 44 of file OAI.inc.php.