-
Notifications
You must be signed in to change notification settings - Fork 3
/
repository.php
107 lines (96 loc) · 3.2 KB
/
repository.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
<?php
namespace oaiprovider;
interface Repository {
/**
* Return identify data for this repository in the following form:
* array(
* 'repositoryName' => 'Example OAI Provider',
* 'baseUrl' => 'http://example.com/oai/',
* 'protocolVersion' => '2.0',
* 'adminEmail' => '[email protected]',
* 'earliestDatestamp' => '1970-01-01T00:00:00Z',
* 'deletedRecord' => 'persistent',
* 'granularity' => 'YYYY-MM-DDThh:mm:ssZ')
*
* @return array of identify data
*/
function getIdentifyData();
/**
* Return available metadata formats either for this repository or for the item
* with provided identifier in the following form:
* array(
* array(
* 'metadataPrefix' => 'oai_dc',
* 'schema' => 'http://www.openarchives.org/OAI/2.0/oai_dc.xsd',
* 'metadataNamespace' => 'http://www.openarchives.org/OAI/2.0/oai_dc/',
* ),
* array(
* 'metadataPrefix' => 'ese',
* 'schema' => 'http://www.europeana.eu/schemas/ese/ESE-V3.3.xsd',
* 'metadataNamespace' => 'http://www.europeana.eu/schemas/ese/',
* ),
* )
*
* @param $identifier optional parameter that specifies the identifier of
* the item
*
*/
function getMetadataFormats($identifier);
/**
* Return the sets of this repository in the following form:
* <code>
* array(
* array('spec' => 'FICTION' , 'name' => 'All books in the fiction category'),
* array('spec' => 'NON_FICTION' , 'name' => 'All books in the non-fiction category')
* );
* </code>
*
* @return array sets
*/
function getSets();
/**
* Return identifiers of records satisfying the criteria.
* Implementors MUST return records ordered by ascending identifier.
*
* @param $from timestamp if set, return only identifiers of records changed after
* this date
* @param $until timestamp if set, return only identifiers of records changed before
* this date
* @param $set string if set, return only identifiers of records in this set
* @param $last_identifier mixed if set, return only identifiers of records that are
* a continuation of the incomplete list ended with this identifier.
* @param $max_results int if set, return only identifiers of records that are
* a continuation of the incomplete list ended with this identifier.
* @return array list of identifiers
*/
function getIdentifiers($from, $until, $set, $last_identifier, $max_results);
/**
* @return <code>Header</code> instance for the record with specified identifier
*/
function getHeader($identifier);
/**
* @return XML representation of the record in the specified metadataFormat
*/
function getMetadata($metadataPrefix, $identifier);
}
/**
* OAI Header structure returned by <code>getHeader</code>
*/
class Header {
/**
* Unique identifier of the record
*/
public $identifier;
/**
* Time of last change in seconds since UNIX epoch
*/
public $datestamp;
/**
* List of all sets this record is contained in
*/
public $setSpec = array();
/**
* <code>true</code> if this record has been deleted
*/
public $deleted = false;
}