baseUrl = $baseUrl; $this->repositoryId = $repositoryId; } } /** * OAI repository information. */ class OAIRepository { /** @var $repositoryName string name of the repository */ var $repositoryName; /** @var $adminEmail string administrative contact email */ var $adminEmail; /** @var $earliestDatestamp int earliest *nix timestamp in the repository */ var $earliestDatestamp; /** @var $delimiter string delimiter in identifier */ var $delimiter = ':'; /** @var $sampleIdentifier string example identifier */ var $sampleIdentifier; } /** * OAI resumption token. * Used to resume a record retrieval at the last-retrieved offset. */ class OAIResumptionToken { /** @var $id string unique token ID */ var $id; /** @var $offset int record offset */ var $offset; /** @var $params array request parameters */ var $params; /** @var $expire int expiration timestamp */ var $expire; /** * Constructor. */ function OAIResumptionToken($id, $offset, $params, $expire) { $this->id = $id; $this->offset = $offset; $this->params = $params; $this->expire = $expire; } } /** * OAI metadata format. * Used to generated metadata XML according to a specified schema. */ class OAIMetadataFormat { /** @var $prefix string metadata prefix */ var $prefix; /** @var $schema string XML schema */ var $schema; /** @var $namespace string XML namespace */ var $namespace; /** @var $oai the parent OAI object */ var $oai; /** * Constructor. */ function OAIMetadataFormat(&$oai, $prefix, $schema, $namespace) { $this->oai = $oai; $this->prefix = $prefix; $this->schema = $schema; $this->namespace = $namespace; } function getLocalizedData($data, $locale) { foreach ($data as $element) { if (isset($data[$locale])) return $data[$locale]; } return ''; } /** * Retrieve XML-formatted metadata for the specified record. * @param $record OAIRecord * @return string */ function toXML($record) { return ''; } } /** * OAI set. * Identifies a set of related records. */ class OAISet { /** @var $spec string unique set specifier */ var $spec; /** @var $name string set name */ var $name; /** @var $description string set description */ var $description; /** * Constructor. */ function OAISet($spec, $name, $description) { $this->spec = $spec; $this->name = $name; $this->description = $description; } } /** * OAI identifier. */ class OAIIdentifier { /** @var $identifier string unique OAI record identifier */ var $identifier; /** @var $datestamp int last-modified *nix timestamp */ var $datestamp; /** @var $sets array sets this record belongs to */ var $sets; } /** * OAI record. * Describes metadata for a single record in the repository. */ class OAIRecord extends OAIIdentifier { // // Metadata fields // var $url; var $titles; var $creator; var $subjects; var $descriptions; var $publishers; var $contributors; var $date; var $types; var $format; var $sources; var $language; var $relation; var $coverage; var $rights; var $pages; var $primaryLocale; } ?>