
Public Member Functions | |
| checkParams ($required=array(), $optional=array()) | |
| error ($code, $message) | |
| execute () | |
| extractDateParams ($params, &$from, &$until) | |
| & | formatMetadata ($format, $record) |
| getParam ($name) | |
| getParams () | |
| GetRecord () | |
| identifierExists ($identifier) | |
| & | identifiers ($metadataPrefix, $from, $until, $set, $offset, $limit, &$total) |
| Identify () | |
| ListIdentifiers () | |
| ListMetadataFormats () | |
| ListRecords () | |
| ListSets () | |
| & | metadataFormats ($namesOnly=false, $identifier=null) |
| OAI (&$config) | |
| paramExists ($name) | |
| parseStr ($string, &$array) | |
| prepInput (&$data) | |
| prepOutput (&$data) | |
| & | record ($identifier) |
| & | records ($metadataPrefix, $from, $until, $set, $offset, $limit, &$total) |
| & | repositoryInfo () |
| response ($response, $printParams=true) | |
| & | resumptionToken ($tokenId) |
| & | saveResumptionToken ($offset, $params) |
| setParams (&$params) | |
| & | sets ($offset, &$total) |
| UTCDate ($timestamp=0, $includeTime=true) | |
| UTCtoTimestamp ($date, $checkGranularity=true) | |
| validIdentifier ($identifier) | |
Definition at line 31 of file OAI.inc.php.
| 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 745 of file OAI.inc.php.
References error(), getParam(), Request.isPathInfoEnabled(), and paramExists().
Referenced by GetRecord(), Identify(), ListIdentifiers(), ListMetadataFormats(), ListRecords(), and ListSets().
| OAI.error | ( | $ | code, | |
| $ | message | |||
| ) |
Display OAI error response.
Definition at line 665 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 74 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 856 of file OAI.inc.php.
References error(), and UTCtoTimestamp().
Referenced by ListIdentifiers(), and ListRecords().
| & OAI.formatMetadata | ( | $ | format, | |
| $ | record | |||
| ) |
Returns formatted metadata response in specified format.
| $format | string | |
| $metadata | OAIMetadata |
Definition at line 790 of file OAI.inc.php.
References metadataFormats().
Referenced by GetRecord(), and ListRecords().
| OAI.getParam | ( | $ | name | ) |
Returns the value of the specified parameter.
| $name | string |
Definition at line 709 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 717 of file OAI.inc.php.
Referenced by ListIdentifiers(), ListRecords(), and ListSets().
| OAI.GetRecord | ( | ) |
Handle OAI GetRecord request. Retrieves an individual record from the repository.
Definition at line 237 of file OAI.inc.php.
References checkParams(), error(), formatMetadata(), getParam(), metadataFormats(), record(), response(), sets(), and validIdentifier().
Referenced by execute().
| OAI.identifierExists | ( | $ | identifier | ) |
Check if identifier exists.
| $identifier | string |
Reimplemented in JournalOAI.
Definition at line 129 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 164 of file OAI.inc.php.
Referenced by ListIdentifiers().
| OAI.Identify | ( | ) |
Handle OAI Identify request. Retrieves information about a repository.
Definition at line 290 of file OAI.inc.php.
References checkParams(), prepOutput(), repositoryInfo(), response(), and UTCDate().
Referenced by execute().
| OAI.ListIdentifiers | ( | ) |
Handle OAI ListIdentifiers request. Retrieves headers of records from the repository.
Definition at line 333 of file OAI.inc.php.
References checkParams(), error(), extractDateParams(), getParam(), getParams(), identifiers(), metadataFormats(), paramExists(), prepOutput(), response(), resumptionToken(), saveResumptionToken(), setParams(), sets(), and UTCDate().
Referenced by execute().
| OAI.ListMetadataFormats | ( | ) |
Handle OAI ListMetadataFormats request. Retrieves metadata formats supported by the repository.
Definition at line 428 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 474 of file OAI.inc.php.
References checkParams(), error(), extractDateParams(), formatMetadata(), getParam(), getParams(), metadataFormats(), paramExists(), prepOutput(), records(), response(), resumptionToken(), saveResumptionToken(), setParams(), sets(), and UTCDate().
Referenced by execute().
| OAI.ListSets | ( | ) |
Handle OAI ListSets request. Retrieves sets from a repository.
Definition at line 576 of file OAI.inc.php.
References checkParams(), error(), getParam(), getParams(), paramExists(), prepOutput(), response(), resumptionToken(), saveResumptionToken(), setParams(), sets(), and 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 206 of file OAI.inc.php.
Referenced by formatMetadata(), GetRecord(), ListIdentifiers(), ListMetadataFormats(), and ListRecords().
| OAI.OAI | ( | &$ | config | ) |
Constructor. Initializes object and parses user input.
| $config | OAIConfig repository configuration |
Definition at line 47 of file OAI.inc.php.
References parseStr(), and prepInput().
| OAI.paramExists | ( | $ | name | ) |
Returns true if the requested parameter is set, false if it is not set.
| $name | string |
Definition at line 734 of file OAI.inc.php.
Referenced by checkParams(), ListIdentifiers(), ListMetadataFormats(), ListRecords(), and ListSets().
| OAI.parseStr | ( | $ | string, | |
| &$ | array | |||
| ) |
Parses string $string into an associate array $array. Acts like parse_str($string, $array) except duplicate variable names in $string are converted to an array.
| $duplicate | string input data string | |
| $array | array of parsed parameters |
Definition at line 954 of file OAI.inc.php.
Referenced by OAI().
| OAI.prepInput | ( | &$ | data | ) |
Clean input variables.
| $data | mixed request parameter(s) |
Definition at line 908 of file OAI.inc.php.
Referenced by OAI().
| OAI.prepOutput | ( | &$ | data | ) |
Prepare variables for output. Data is assumed to be UTF-8 encoded (FIXME?)
| $data | mixed output parameter(s) |
Definition at line 930 of file OAI.inc.php.
Referenced by Identify(), ListIdentifiers(), ListRecords(), ListSets(), and response().
| & OAI.record | ( | $ | identifier | ) |
Return OAI record for specified identifier.
| $identifier | string |
Reimplemented in JournalOAI.
Definition at line 138 of file OAI.inc.php.
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 154 of file OAI.inc.php.
Referenced by ListRecords().
| & OAI.repositoryInfo | ( | ) |
Return information about the repository.
Reimplemented in JournalOAI.
Definition at line 110 of file OAI.inc.php.
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 681 of file OAI.inc.php.
References prepOutput(), and UTCDate().
Referenced by error(), GetRecord(), Identify(), ListIdentifiers(), ListMetadataFormats(), ListRecords(), and ListSets().
| & OAI.resumptionToken | ( | $ | tokenId | ) |
Retrieve a resumption token.
| $tokenId | string |
Reimplemented in JournalOAI.
Definition at line 184 of file OAI.inc.php.
Referenced by ListIdentifiers(), ListRecords(), and ListSets().
| & OAI.saveResumptionToken | ( | $ | offset, | |
| $ | params | |||
| ) |
Save a resumption token.
| $offset | int current offset | |
| $params | array request parameters |
Reimplemented in JournalOAI.
Definition at line 195 of file OAI.inc.php.
Referenced by ListIdentifiers(), ListRecords(), and ListSets().
| OAI.setParams | ( | &$ | params | ) |
Set the request parameters.
| $params | array |
Definition at line 725 of file OAI.inc.php.
Referenced by ListIdentifiers(), ListRecords(), and ListSets().
| & OAI.sets | ( | $ | offset, | |
| &$ | total | |||
| ) |
Return set of OAI sets.
| $offset | int current set offset | |
| $total | int output parameter, set to total number of sets |
Reimplemented in JournalOAI.
Definition at line 174 of file OAI.inc.php.
Referenced by GetRecord(), ListIdentifiers(), ListRecords(), and ListSets().
| OAI.UTCDate | ( | $ | timestamp = 0, |
|
| $ | includeTime = true | |||
| ) |
Return a UTC-formatted datestamp from the specified UNIX timestamp.
| $timestamp | int *nix timestamp (if not used, the current time is used) | |
| $includeTime | boolean include both the time and date |
Definition at line 802 of file OAI.inc.php.
Referenced by Identify(), ListIdentifiers(), ListRecords(), ListSets(), and response().
| OAI.UTCtoTimestamp | ( | $ | date, | |
| $ | checkGranularity = true | |||
| ) |
Returns a UNIX timestamp from a UTC-formatted datestamp. Returns the string "invalid" if datestamp is invalid, or "invalid_granularity" if unsupported granularity.
| $date | string UTC datestamp | |
| $checkGranularity | boolean verify that granularity is correct |
Definition at line 824 of file OAI.inc.php.
Referenced by extractDateParams().
| OAI.validIdentifier | ( | $ | identifier | ) |
Check if identifier is in the valid format.
| $identifier | string |
Reimplemented in JournalOAI.
Definition at line 120 of file OAI.inc.php.
Referenced by GetRecord().
1.5.6