Skip to content

Commit

Permalink
Merge pull request #1094 from OPUS4/oai-refactoring
Browse files Browse the repository at this point in the history
OAI Refactoring
  • Loading branch information
j3nsch authored Oct 20, 2023
2 parents a693e4d + 6527e7b commit c676f59
Show file tree
Hide file tree
Showing 27 changed files with 2,432 additions and 477 deletions.
30 changes: 30 additions & 0 deletions application/configs/application.ini
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,36 @@ oai.description.eprints.submissionPolicy.text =
oai.description.eprints.comment.url =
oai.description.eprints.comment.text =

; OAI FORMAT OPTIONS
;
; FORMAT_ID should be a lowercase string identifying the format, like `marc21`. The default configuration options
; are:
;
; oai.format.[FORMAT_ID].
; class = [class implementing format for OAI]
; xsltFile = [xslt file name or location]
; prefix = [metadata prefix used for format]
; visible = 0 or 1 (visibility in ListMetadataFormats)
; adminOnly = 0 or 1 (restrict access to format to administrators)
; viewHelper = [list of view helpers available in XSLT]

; Default OAI server class implementing all the format independent responses
oai.format.default.class = Oai_Model_DefaultServer
; ViewHelpers available in OAI XSLT (additional helpers can be added using this option for a specific format)
oai.format.default.viewHelpers = optionValue, fileUrl, frontdoorUrl, transferUrl, dcmiType, dcType, openAireType

; OPUS 4 XML (only for admins)
oai.format.copy_xml.xsltFile = copy_xml.xslt
oai.format.copy_xml.adminOnly = 1
oai.format.copy_xml.visible = 0

; OAI supported formats (default configuration is part of implementing class)
oai.format.oai_dc.class = Oai_Model_Prefix_Oai_OaiDcServer
oai.format.oai_pp.class = Oai_Model_Prefix_Oai_OaiPpServer
oai.format.epicur.class = Oai_Model_Prefix_Epicur_EpicurServer
oai.format.xmetadissplus.class = Oai_Model_Prefix_XMetaDissPlus_XMetaDissPlusServer
oai.format.marc21.class = Oai_Model_Prefix_MarcXml_MarcXmlServer

; ERROR CONTROLLER SETTINGS
errorController.showException = 0
errorController.showRequest = 0
Expand Down
11 changes: 10 additions & 1 deletion modules/oai/controllers/IndexController.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,16 @@ public function indexAction()
unset($parameters[$name]);
}

$server = new Oai_Model_Server(); // TODO needs factory
$serverFactory = new Oai_Model_ServerFactory();

if (isset($parameters['metadataPrefix'])) {
$server = $serverFactory->create($parameters['metadataPrefix']);
} elseif (isset($parameters['resumptionToken'])) {
$server = $serverFactory->createByResumptionToken($parameters['resumptionToken']);
} else {
$server = $serverFactory->create();
}

$server->setScriptPath($this->view->getScriptPath('index'));
$server->setBaseUrl($this->view->fullUrl());
$server->setBaseUri($request->getBaseUrl());
Expand Down
215 changes: 0 additions & 215 deletions modules/oai/models/Configuration.php

This file was deleted.

Loading

0 comments on commit c676f59

Please sign in to comment.