\acdhOeaw\oaiOai

Implements controller for the OAI-PMH service: - checks OAI-PMH requests correctness, - handles OAI-PMH `identify` and `ListMetadataFormats` commands - delegates OAI-PMH `GetRecord`, `ListIdentifiers` and `ListRecords` commands to a chosen class implementing the `acdhOeaw\oai\search\SearchInterface` - delegates OAI-PMH `ListSets` command to a chosen class extending the `acdhOeaw\oai\set\SetInterface` class.

  • generates OAI-PMH compliant output from results of above mentioned actions
  • catches errors and generates OAI-PMH compliant error responses

Summary

Methods
Properties
Constants
__construct()
handleRequest()
oaiIdentify()
oaiListMetadataFormats()
oaiListRecords()
oaiListRecordRaw()
oaiListSets()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
createHeader()
createElement()
checkRequestParam()
getParam()
$respBegin
$respEnd
$dateRegExp
$fedora
$response
$metadataFormats
$info
N/A

Properties

$respBegin

$respBegin : string

OAI-PMH response beginning template

Type

string

$respEnd

$respEnd : string

OAI-PMH response ending template

Type

string

$dateRegExp

$dateRegExp : string

OAI-PMH date format regexp

Type

string

$fedora

$fedora : \acdhOeaw\fedora\Fedora

Repository connection object

Type

\acdhOeaw\fedora\Fedora

$response

$response : \DOMDocument

XML object used to serialize OAI-PMH response parts

Type

\DOMDocument

$metadataFormats

$metadataFormats : array

List of metadata descriptors

Type

array

$info

$info : \acdhOeaw\oai\RepositoryInfo

Repository info object used to serve OAI-PMH `Identify` requests

Type

\acdhOeaw\oai\RepositoryInfo

Methods

__construct()

__construct(\acdhOeaw\oai\data\RepositoryInfo  $info, array  $metadataFormats) 

Initialized the OAI-PMH server object.

Parameters

\acdhOeaw\oai\data\RepositoryInfo $info
array $metadataFormats

handleRequest()

handleRequest() 

Handles OAI-PMH request.

oaiIdentify()

oaiIdentify() 

Implements the Identify OAI-PMH verb

oaiListMetadataFormats()

oaiListMetadataFormats() 

Implements the ListMetadataFormats OAI-PMH verb

Throws

\acdhOeaw\oai\OaiException

oaiListRecords()

oaiListRecords(string  $verb, string  $id = '') 

Implements the ListIdentifiers, ListRecords and GetRecord OAI-PMH verbs

Parameters

string $verb
string $id

Throws

\acdhOeaw\oai\OaiException

oaiListRecordRaw()

oaiListRecordRaw(string  $id = '') 

Returns a single metadata record without any OAI structures

Parameters

string $id

oaiListSets()

oaiListSets() 

Implements the ListSets OAI-PMH verb.

Fetches set description using a chosen (config:oaiSetClass) class and formats its output as an OAI-PMH XML.

createHeader()

createHeader(\StdClass  $res) : \DOMElement

Creates a resource's <header> element as defined by OAI-PMH standard.

Parameters

\StdClass $res

Returns

\DOMElement

createElement()

createElement(string  $element, string  $value = '', array  $attributes = array()) : \DOMNode

Returns a PHP reresentation of an XML node.

Parameters

string $element
string $value
array $attributes

Returns

\DOMNode

checkRequestParam()

checkRequestParam(array  $allowed) 

Validates request parameters.

Parameters

array $allowed

allowed parameter names list

Throws

\acdhOeaw\oai\OaiException

getParam()

getParam(\acdhOeaw\oai\string  $name) 

Parameters

\acdhOeaw\oai\string $name