-
Notifications
You must be signed in to change notification settings - Fork 0
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
Create SCCS workflow #77
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
from dsc.workflows.base.simple_csv import SimpleCSV | ||
|
||
|
||
class DemoWorkflow(SimpleCSV): | ||
class Demo(SimpleCSV): | ||
|
||
workflow_name: str = "demo" | ||
submission_system: str = "DSpace@MIT" | ||
metadata_mapping_path: str = "tests/fixtures/demo_metadata_mapping.json" | ||
metadata_mapping_path: str = "dsc/workflows/metadata_mapping/demo.json" |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
{ | ||
"item_identifier": { | ||
"source_field_name": "item_identifier", | ||
"language": null, | ||
"delimiter": "", | ||
jonavellecuerdo marked this conversation as resolved.
Show resolved
Hide resolved
|
||
"required": true | ||
}, | ||
"dc.title": { | ||
"source_field_name": "dc.title", | ||
"language": "en_US", | ||
"delimiter": "", | ||
"required": true | ||
}, | ||
"dc.publisher": { | ||
"source_field_name": "dc.publisher", | ||
"language": "en_US", | ||
"delimiter": "" | ||
}, | ||
"dc.identifier.mitlicense": { | ||
"source_field_name": "dc.identifier.mitlicense", | ||
"language": "en_US", | ||
"delimiter": "" | ||
}, | ||
"dc.eprint.version": { | ||
"source_field_name": "dc.eprint.version", | ||
"language": "en_US", | ||
"delimiter": "" | ||
}, | ||
"dc.type": { | ||
"source_field_name": "dc.type", | ||
"language": "en_US", | ||
"delimiter": "" | ||
}, | ||
"dc.source": { | ||
"source_field_name": "dc.source", | ||
"language": "en_US", | ||
"delimiter": "" | ||
}, | ||
"dc.contributor.author": { | ||
"source_field_name": "dc.contributor.author", | ||
"language": "en_US", | ||
"delimiter": "|" | ||
}, | ||
"dc.relation.isversionof": { | ||
"source_field_name": "dc.relation.isversionof", | ||
"language": "", | ||
"delimiter": "" | ||
}, | ||
"dc.relation.journal": { | ||
"source_field_name": "dc.relation.journal", | ||
"language": "", | ||
"delimiter": "" | ||
}, | ||
"dc.identifier.issn": { | ||
"source_field_name": "dc.identifier.issn", | ||
"language": "", | ||
"delimiter": "" | ||
}, | ||
"dc.date.issued": { | ||
"source_field_name": "dc.date.issued", | ||
"language": "", | ||
"delimiter": "" | ||
}, | ||
"dc.rights": { | ||
"source_field_name": "dc.rights", | ||
"language": "en_US", | ||
"delimiter": "" | ||
}, | ||
"dc.rights.uri": { | ||
"source_field_name": "dc.rights.uri", | ||
"language": "", | ||
"delimiter": "" | ||
}, | ||
"dc.description.sponsorship": { | ||
"source_field_name": "dc.description.sponsorship", | ||
"language": "en_US", | ||
"delimiter": "" | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
from dsc.workflows import SimpleCSV | ||
|
||
|
||
class SCCS(SimpleCSV): | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. When looking at a class this minimal, a couple of thoughts come to mind:
For # 2, the first thing that comes to mind is validation or hooks of some kind. I don't think it's necessary now, but wondering if there might be room in the future for some kind of registration of validation hooks, that could be used to validate items created? reconciliation logic? maybe others? In theory, these could be called -- if defined -- during the normal flow of the base Workflows. Sketch: class MyWorkflow(SimpleCSV):
workflow_name = "Mine!"
metadata_mapping_path = "path/to/mapping.json"
# defined as class attributes, lists pointing to methods
reconciliation_hooks = [] # I don't have any reconciliation hooks...
item_creation_hooks = [
"confirm_title_elements" # reference to method defined on class
]
@classmethod
def confirm_title_elements(cls):
# I will check things yielded by Workflow.item_submissions_iter()...
pass With a little bit of wiring, this might provide a way for a This pattern could also probably be achieved through decorators, which could be even cleaner. Sketch: class MyWorkflow(SimpleCSV):
workflow_name = "Mine!"
metadata_mapping_path = "path/to/mapping.json"
@item_creation_hook
def confirm_title_elements(cls):
# I will check things yielded by Workflow.item_submissions_iter()...
pass
# maybe others like @reconciliation_hook |
||
"""Workflow for SCCS-requested deposits. | ||
|
||
The deposits managed by this workflow are requested by the Scholarly | ||
Communication and Collection Strategy (SCCS) department | ||
and are for submission to DSpace@MIT. | ||
""" | ||
|
||
workflow_name: str = "sccs" | ||
metadata_mapping_path: str = "dsc/workflows/metadata_mapping/sccs.json" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the linting is passing then I guess this is all good!