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

#1056 Integration of import rules config #1057

Open
wants to merge 2 commits into
base: v4.8.1
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
5 changes: 5 additions & 0 deletions application/configs/application.ini
Original file line number Diff line number Diff line change
Expand Up @@ -450,6 +450,11 @@ sword.generator = 'OPUS 4'
; resource has received or a URI that dereferences to such a description.
sword.treatment = ''

; Import rules are applied to documents after processing the SWORD input
sword.enableImportRules = 0

import.rulesConfigFile = APPLICATION_PATH "/configs/import-rules.ini"

; MIME-Types der Dateien, die importiert werden können
filetypes.default.contentDisposition = 'attachment'

Expand Down
42 changes: 42 additions & 0 deletions application/configs/import-rules.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
; Rules applied to documents in SWORD import
;
; Every line needs to start with
;
; rules.[NAME].[OPTIONS]
;
; The NAME can be freely chosen, but each defined rule needs a different name.
; The OPTIONS depend on the type of rule used. For more information see the
; documentation at: https://github.com/OPUS4/opus4-import
;
; The following are a few examples:

; Add collection, if 'sword' account is used
;rules.institute1.type = 'AddCollection'
;rules.institute1.condition.account = 'sword'
;rules.institute1.collection.id = [COLLECTION ID]

; Add collection, if account 'sword2' is used; The collection is identified use the NAME of the collection role and
; the NUMBER of the collection.
;rules.institute2.type = 'AddCollection'
;rules.institute2.condition.account = 'sword2'
;rules.institute2.collection.roleName = 'institutes'
;rules.institute2.collection.number = 'institute1'

; Add collection, if keyword 'oa-green' is found and remove the keyword from the document
;rules.oagreen.type = 'AddCollection'
;rules.oagreen.condition.keyword.value = 'oa-green'
;rules.oagreen.condition.keyword.remove = 1
;rules.oagreen.collection.roleName = 'openaccess'
;roles.oagreen.collection.number = 'green'

; Add licence ID = 1, if the keyword 'CCBY' is found and remove the keyword
;rules.licence1.type = 'AddLicence'
;rules.licence1.condition.keyword.value = 'CCBY'
;rules.licence1.condition.keyword.remove = 1
;rules.licence1.licence.id = 1

; Add licence ID = 2, if the keyword 'CCBYSA' is found and remove the keyword
;rules.licence2.type = 'AddLicence'
;rules.licence2.condition.keyword.value = 'CCBYSA'
;rules.licence2.condition.keyword.remove = 1
;rules.licence2.licence.id = 2
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"opus4-repo/framework": "dev-master as 4.8.1",
"opus4-repo/search": "^4.7.2",
"opus4-repo/opus4-bibtex": "^4.8",
"opus4-repo/opus4-import": "^4.8",
"opus4-repo/opus4-import": "dev-main as 4.8.1",
"opus4-repo/opus4-pdf": "^4.8",
"opus4-repo/opus4-job": "^4.8",
"opus4-repo/opus4-security": "^4.8",
Expand Down