Open Monograph Press  1.1
 All Classes Namespaces Functions Variables Groups Pages
OAI Class Reference
Inheritance diagram for OAI:
PressOAI

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)
 

Public Attributes

 $config
 
 $params
 
 $protocolVersion = '2.0'
 

Detailed Description

Class to process and respond to OAI requests.

Utility functions used by OAI related classes.

See Also
OAIDAO

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

Referenced by metadataFormats().

OAI::error (   $code,
  $message 
)

Display OAI error response.

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

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

OAI::execute ( )

Execute the requested OAI protocol request and output the response.

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

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 821 of file OAI.inc.php.

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

Returns formatted metadata response in specified format.

Parameters
$formatstring
$metadataOAIMetadata
Returns
string

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

OAI::getNonPathInfoParams ( )

Return a list of ignorable GET parameters.

Returns
array

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

OAI::getParam (   $name)

Returns the value of the specified parameter.

Parameters
$namestring
Returns
string

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

Referenced by metadataFormats().

OAI::getParams ( )

Returns an associative array of all request parameters.

Returns
array

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

OAI::GetRecord ( )

Handle OAI GetRecord request. Retrieves an individual record from the repository.

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

References error().

OAI::identifierExists (   $identifier)

Check if identifier exists.

Parameters
$identifierstring
Returns
boolean

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

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

Return set of OAI identifiers.

See Also
getRecords
Returns
array OAIIdentifier

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

OAI::Identify ( )

Handle OAI Identify request. Retrieves information about a repository.

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

OAI::ListIdentifiers ( )

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

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

References error().

OAI::ListMetadataFormats ( )

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

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

OAI::ListRecords ( )

Handle OAI ListRecords request. Retrieves records from the repository.

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

References error().

OAI::ListSets ( )

Handle OAI ListSets request. Retrieves sets from a repository.

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

References error().

& 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 211 of file OAI.inc.php.

References checkParams(), and getParam().

OAI::OAI ( $config)

Constructor. Initializes object and parses user input.

Parameters
$configOAIConfig repository configuration

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

& OAI::record (   $identifier)

Return OAI record for specified identifier.

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

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

& 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 159 of file OAI.inc.php.

& OAI::repositoryInfo ( )

Return information about the repository.

Returns
OAIRepository

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

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

Output OAI response.

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

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

& OAI::resumptionToken (   $tokenId)

Retrieve a resumption token.

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

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

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

Save a resumption token.

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

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

OAI::setParams ( $params)

Set the request parameters.

Parameters
$paramsarray

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

& 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 179 of file OAI.inc.php.

OAI::validIdentifier (   $identifier)

Check if identifier is in the valid format.

Parameters
$identifierstring
Returns
boolean

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

Member Data Documentation

OAIConfig OAI::$config

configuration parameters

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

array OAI::$params

list of request parameters

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

Referenced by PressOAI\resumptionToken().

string OAI::$protocolVersion = '2.0'

version of the OAI protocol supported by this class

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


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