Open Journal Systems  2.4.4
 All Classes Namespaces Functions Variables Groups Pages
OAI Class Reference
Inheritance diagram for OAI:
JournalOAI

Public Member Functions

 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)
 
 OAI (&$config)
 
 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, &$total)
 
 validIdentifier ($identifier)
 

Detailed Description

Class to process and respond to OAI requests.

Utility functions used by OAI related classes.

See Also
OAIDAO

Definition at line 25 of file OAI.inc.php.

Member Function Documentation

OAI::checkParams (   $required = array(),
  $optional = array() 
)

Check request parameters. Outputs error response if an invalid parameter is found.

Parameters
$requiredarray required parameters for the current request
$optionalarray optional parameters for the current request
Returns
boolean

Definition at line 751 of file OAI.inc.php.

References error(), getNonPathInfoParams(), getParam(), PKPRequest\isPathInfoEnabled(), and paramExists().

Referenced by GetRecord(), Identify(), ListIdentifiers(), ListMetadataFormats(), ListRecords(), and ListSets().

OAI::error (   $code,
  $message 
)

Display OAI error response.

Definition at line 662 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 68 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.

Parameters
$paramsarray request parameters
$fromint from timestamp (output parameter)
$untilint until timestamp (output parameter)
Returns
boolean

Definition at line 810 of file OAI.inc.php.

References error().

Referenced by ListIdentifiers(), and ListRecords().

& OAI::formatMetadata (   $format,
  $record 
)

Returns formatted metadata response in specified format.

Parameters
$formatstring
$metadataOAIMetadata
Returns
string

Definition at line 796 of file OAI.inc.php.

References metadataFormats().

Referenced by GetRecord(), and ListRecords().

OAI::getNonPathInfoParams ( )

Return a list of ignorable GET parameters.

Returns
array

Definition at line 740 of file OAI.inc.php.

Referenced by checkParams().

OAI::getParam (   $name)

Returns the value of the specified parameter.

Parameters
$namestring
Returns
string

Definition at line 707 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.

Returns
array

Definition at line 715 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 215 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.

Parameters
$identifierstring
Returns
boolean

Definition at line 123 of file OAI.inc.php.

Referenced by ListMetadataFormats().

& OAI::identifiers (   $metadataPrefix,
  $from,
  $until,
  $set,
  $offset,
  $limit,
$total 
)

Return set of OAI identifiers.

See Also
getRecords
Returns
array OAIIdentifier

Definition at line 158 of file OAI.inc.php.

Referenced by ListIdentifiers().

OAI::Identify ( )

Handle OAI Identify request. Retrieves information about a repository.

Definition at line 270 of file OAI.inc.php.

References checkParams(), repositoryInfo(), and response().

Referenced by execute().

OAI::ListIdentifiers ( )

Handle OAI ListIdentifiers request. Retrieves headers of records from the repository.

Definition at line 327 of file OAI.inc.php.

References checkParams(), error(), extractDateParams(), getParam(), getParams(), identifiers(), metadataFormats(), paramExists(), response(), resumptionToken(), saveResumptionToken(), and setParams().

Referenced by execute().

OAI::ListMetadataFormats ( )

Handle OAI ListMetadataFormats request. Retrieves metadata formats supported by the repository.

Definition at line 422 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 468 of file OAI.inc.php.

References checkParams(), error(), extractDateParams(), formatMetadata(), getParam(), getParams(), metadataFormats(), paramExists(), records(), response(), resumptionToken(), saveResumptionToken(), and setParams().

Referenced by execute().

OAI::ListSets ( )

Handle OAI ListSets request. Retrieves sets from a repository.

Definition at line 572 of file OAI.inc.php.

References checkParams(), error(), getParam(), getParams(), paramExists(), response(), resumptionToken(), saveResumptionToken(), setParams(), and sets().

Referenced by execute().

& OAI::metadataFormats (   $namesOnly = false,
  $identifier = null 
)

Return array of supported metadata formats.

Parameters
$namesOnlyboolean return array of format prefix names only
$identifierstring return formats for specific identifier
Returns
array

Definition at line 200 of file OAI.inc.php.

References HookRegistry\call().

Referenced by formatMetadata(), GetRecord(), ListIdentifiers(), ListMetadataFormats(), and ListRecords().

OAI::OAI ( $config)

Constructor. Initializes object and parses user input.

Parameters
$configOAIConfig repository configuration

Definition at line 41 of file OAI.inc.php.

OAI::paramExists (   $name)

Returns true if the requested parameter is set, false if it is not set.

Parameters
$namestring
Returns
boolean

Definition at line 732 of file OAI.inc.php.

Referenced by checkParams(), ListIdentifiers(), ListMetadataFormats(), ListRecords(), and ListSets().

& OAI::record (   $identifier)

Return OAI record for specified identifier.

Parameters
$identifierstring
Returns
OAIRecord (or false, if identifier is invalid)

Definition at line 132 of file OAI.inc.php.

Referenced by GetRecord().

& OAI::records (   $metadataPrefix,
  $from,
  $until,
  $set,
  $offset,
  $limit,
$total 
)

Return set of OAI records.

Parameters
$metadataPrefixstring specified metadata prefix
$fromint minimum timestamp
$untilint maximum timestamp
$setstring specified set
$offsetint current record offset
$limitint maximum number of records to return
$totalint output parameter, set to total number of records
Returns
array OAIRecord

Definition at line 148 of file OAI.inc.php.

Referenced by ListRecords().

& OAI::repositoryInfo ( )

Return information about the repository.

Returns
OAIRepository

Definition at line 104 of file OAI.inc.php.

Referenced by Identify().

OAI::response (   $response,
  $printParams = true 
)

Output OAI response.

Parameters
$responsestring text of response message.
$printParamsboolean display request parameters

Definition at line 678 of file OAI.inc.php.

References PKPRequest\getBaseUrl().

Referenced by error(), GetRecord(), Identify(), ListIdentifiers(), ListMetadataFormats(), ListRecords(), and ListSets().

& OAI::resumptionToken (   $tokenId)

Retrieve a resumption token.

Parameters
$tokenIdstring
Returns
OAIResumptionToken (or false, if token invalid)

Definition at line 178 of file OAI.inc.php.

Referenced by ListIdentifiers(), ListRecords(), and ListSets().

& OAI::saveResumptionToken (   $offset,
  $params 
)

Save a resumption token.

Parameters
$offsetint current offset
$paramsarray request parameters
Returns
OAIResumptionToken the saved token

Definition at line 189 of file OAI.inc.php.

Referenced by ListIdentifiers(), ListRecords(), and ListSets().

OAI::setParams ( $params)

Set the request parameters.

Parameters
$paramsarray

Definition at line 723 of file OAI.inc.php.

Referenced by ListIdentifiers(), ListRecords(), and ListSets().

& OAI::sets (   $offset,
$total 
)

Return set of OAI sets.

Parameters
$offsetint current set offset
$totalint output parameter, set to total number of sets

Definition at line 168 of file OAI.inc.php.

Referenced by ListSets(), and OAIDAO\setOAIData().

OAI::validIdentifier (   $identifier)

Check if identifier is in the valid format.

Parameters
$identifierstring
Returns
boolean

Definition at line 114 of file OAI.inc.php.

Referenced by GetRecord().


The documentation for this class was generated from the following file: