23 import(
'lib.pkp.classes.oai.OAI');
24 import(
'classes.oai.omp.OAIDAO');
48 $this->site = $request->getSite();
49 $this->press = $request->getPress();
50 $this->pressId = isset($this->press) ? $this->press->getId() :
null;
52 $this->dao->setOAI($this);
60 return array(
'press',
'page');
79 if (strstr($identifier, $prefix)) {
80 return (
int) str_replace($prefix,
'', $identifier);
93 $tmpArray = preg_split(
'/:/', $setSpec);
94 if (count($tmpArray) == 1) {
95 list($pressSpec) = $tmpArray;
96 $pressSpec = urldecode($pressSpec);
98 }
else if (count($tmpArray) == 2) {
99 list($pressSpec, $seriesSpec) = $tmpArray;
100 $pressSpec = urldecode($pressSpec);
101 $seriesSpec = urldecode($seriesSpec);
105 return $this->dao->getSetPressSeriesId($pressSpec, $seriesSpec, $this->pressId);
119 if (isset($this->press)) {
120 $info->repositoryName = $this->press->getLocalizedName();
121 $info->adminEmail = $this->press->getSetting(
'contactEmail');
124 $info->repositoryName = $this->site->getLocalizedTitle();
125 $info->adminEmail = $this->site->getLocalizedContactEmail();
129 $info->earliestDatestamp = $this->dao->getEarliestDatestamp(array($this->pressId));
131 $info->toolkitTitle =
'Open Monograph Press';
133 $currentVersion = $versionDao->getCurrentVersion();
134 $info->toolkitVersion = $currentVersion->getVersionString(
false);
135 $info->toolkitURL =
'http://pkp.sfu.ca/omp/';
151 $recordExists =
false;
153 if ($publicationFormatId) {
154 $recordExists = $this->dao->recordExists($publicationFormatId, array($this->pressId));
156 return $recordExists;
164 if ($publicationFormatId) {
165 $record = $this->dao->getRecord($publicationFormatId, array($this->pressId));
167 if (!isset($record)) {
176 function records($metadataPrefix, $from, $until, $set, $offset, $limit, &$total) {
178 if (!
HookRegistry::call(
'PressOAI::records', array(&$this, $from, $until, $set, $offset, $limit, $total, &$records))) {
185 $records = $this->dao->getRecords(array(
$pressId, $seriesId), $from, $until, $set, $offset, $limit, $total);
193 function identifiers($metadataPrefix, $from, $until, $set, $offset, $limit, &$total) {
195 if (!
HookRegistry::call(
'PressOAI::identifiers', array(&$this, $from, $until, $set, $offset, $limit, $total, &$records))) {
202 $records = $this->dao->getIdentifiers(array(
$pressId, $seriesId), $from, $until, $set, $offset, $limit, $total);
210 function sets($offset, $limit, &$total) {
212 if (!
HookRegistry::call(
'PressOAI::sets', array(&$this, $offset, $limit, $total, &$sets))) {
213 $sets = $this->dao->getSets($this->pressId, $offset, $limit, $total);
222 $this->dao->clearTokens();
223 $token = $this->dao->getToken($tokenId);
224 if (!isset($token)) {
235 $this->dao->insertToken($token);
248 return 'oai:' . $this->config->repositoryId .
':' .
'publicationFormat/';