Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OAI Refactoring #1094

Merged
merged 59 commits into from
Oct 20, 2023
Merged
Show file tree
Hide file tree
Changes from 40 commits
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
068bdd0
Separation of the formats regarding the format xslt files and made th…
haogatyp Aug 17, 2023
112b330
#766 Refactor configuration, added options (currently only xslt file…
haogatyp Aug 20, 2023
d7e2477
#766 Including the prefix xslt in the base xslt instead of the other …
haogatyp Aug 23, 2023
83a0a4e
#766 ServerFactory directly reads oai options from configuration and …
haogatyp Aug 25, 2023
84e700e
#766 Fix absolut path for xsltFile
haogatyp Aug 25, 2023
d0fcdcd
#766 Fix some coding style.
haogatyp Aug 25, 2023
5fa63f7
Fix coding style.
haogatyp Aug 28, 2023
32f8269
Adjust visibility of some option getter methods.
haogatyp Aug 29, 2023
b78a459
#766 Add basic option getter tests for the BaseServer.
haogatyp Aug 29, 2023
e92fc9b
#766 Removed usage of getcwd().
haogatyp Aug 29, 2023
ce5004d
#766 Fix method access level
haogatyp Aug 29, 2023
4039c6e
#766 Split ServerFactory test methods.
haogatyp Aug 29, 2023
b167ac2
#766 Merge default and format specific options.
haogatyp Aug 31, 2023
aa07706
#766 Remove unnecessary check on "true".
haogatyp Aug 31, 2023
b9585c9
#766 Removed throwing the exception, as this is already happening at …
haogatyp Aug 31, 2023
97311cc
#766 Set the value for xsltFile so that it can be overwritten again u…
haogatyp Aug 31, 2023
2d24448
#1097 Made ViewHelper configurable.
haogatyp Aug 31, 2023
a711037
#766 Replaced options array with single properties.
haogatyp Sep 1, 2023
9a5da62
#1097 Default and format-specific ViewHelper options are combined add…
haogatyp Sep 1, 2023
098856f
#1097 Check if viewhelpers exist.
haogatyp Sep 1, 2023
88b9275
#766 Replace marker comment with a more technical marker.
haogatyp Sep 1, 2023
2388d8b
#766 Removed some double spaces.
haogatyp Sep 1, 2023
90b25f2
#766 Removed some double blank lines.
haogatyp Sep 1, 2023
a84057c
#766 Remove some hard coded format specific code and reduced oai form…
haogatyp Sep 5, 2023
23621bc
#1101 Generate OAI ListMetadataFormats from configuration.
haogatyp Sep 5, 2023
1b27ea9
#1101 Add xslt viewhelper for generating the OAI ListMetadataFormats.
haogatyp Sep 5, 2023
99c919e
#1101 Made string composition more readable.
haogatyp Sep 6, 2023
a24cf61
#1101 Reworked the behavior of the incremental option merging so that…
haogatyp Sep 6, 2023
f551e13
#1101 Fix option merging.
haogatyp Sep 7, 2023
4963cf7
#1101 Fix coding style.
haogatyp Sep 7, 2023
f8cd379
#1101 Added tests for ListMetadataFormats viewhelper.
haogatyp Sep 7, 2023
52593fc
#1101 Removed deprecated property.
haogatyp Sep 7, 2023
79cac6d
#1101 Fix some coding style.
haogatyp Sep 7, 2023
c4a8ba6
#766 Added comments to OAI config
j3nsch Sep 25, 2023
a8d230c
#766 Rename option "viewHelper"
haogatyp Oct 5, 2023
7967b50
#766 Fixed some typos.
haogatyp Oct 5, 2023
42c37f6
#766 Fix return empty string for integer variables. Renaming maxRecor…
haogatyp Oct 5, 2023
882c038
#766 Now also checking for array.
haogatyp Oct 5, 2023
8c5cec9
#766 Using DocumentInterface instead of Document.
haogatyp Oct 5, 2023
70b7504
#766 Added class comment.
haogatyp Oct 5, 2023
e979a6a
#766 Fix class comment.
haogatyp Oct 6, 2023
6f70e08
#766 Adjust option getters and setters for NULL values.
haogatyp Oct 6, 2023
b773cf1
#766 Using shorter parameter names in setter methods.
haogatyp Oct 6, 2023
111b442
#766 Fix some comments.
haogatyp Oct 6, 2023
c28ecb2
#766 Removed unnecessary ternary operator.
haogatyp Oct 6, 2023
403318e
#766 Removed outdated todo comment.
haogatyp Oct 6, 2023
f25c07a
#766 Renaming the marker for metadata format replacement.
haogatyp Oct 6, 2023
d83ab74
#766 Adjust error message.
haogatyp Oct 6, 2023
bc3f3ac
#766 Renamed OaiConfig to match the class name.
haogatyp Oct 6, 2023
e61c90c
#766 Fixed coding style
j3nsch Oct 9, 2023
f27d9da
#766 Empty line after header (coding style)
j3nsch Oct 9, 2023
719d66b
#766 Shorten class variable comments.
haogatyp Oct 10, 2023
bb48b41
#766 Added a comment to make things hopefully more clear.
haogatyp Oct 10, 2023
43072df
#766 Removed unused method.
haogatyp Oct 10, 2023
1ca259f
#766 Use class name only ones in the function.
haogatyp Oct 10, 2023
01de758
#766 Moved oai server test classes to oai test.
haogatyp Oct 10, 2023
ec8f82d
#766 Updated comment
j3nsch Oct 10, 2023
59b25c3
#766 Removed unnecessary mock test class and moved remaining mock tes…
haogatyp Oct 10, 2023
6527e7b
#766 Added a function to add view helpers to a oai server.
haogatyp Oct 10, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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