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

API for managing SIP models #26

Closed

Conversation

remileduc
Copy link
Member

@remileduc remileduc commented May 31, 2017

Support for Invenio-Archivematica (see #25)

  • Added an API to manage the models
  • Added a signal sent each time a SIP is created
  • Changed models:
    • added archivable and archived booleans on SIP
    • added a SIPMetadata table to enable the storage of multiple metadata
  • Tests updated

API based on https://github.com/zenodo/zenodo/blob/master/zenodo/modules/sipstore/api.py

- added class `SIPMetadata` to be able to have multiple metadata
- added attribute `archive` (boolean) to say if the content should
  be archived or not
- updated the model views to integrate the new fields
- added the model view for SIPMetadata with links to SIP
@@ -66,7 +67,7 @@
'invenio-accounts>=1.0.0a10',
'invenio-pidstore>=1.0.0a7',
'invenio-jsonschemas>=1.0.0a3',
'invenio-files-rest>=1.0.0a1',
'invenio-files-rest>=1.0.0a14',
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

to use the bump version of fs: inveniosoftware/invenio-files-rest@bd3f879

@@ -71,24 +65,35 @@ class SIP(db.Model, Timestamp):
agent = db.Column(JSONType, default=lambda: dict(), nullable=False)
"""Agent information regarding given SIP."""

archivable = db.Column(
db.Boolean(name='ck_sip_archivable'),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ck_sipstore_archivable

- add a signal when a SIP is created from the API
- 2 API classes: SIP and RecordSIP to manage the models
  based on Zenodo:
  https://github.com/zenodo/zenodo/blob/master/zenodo/modules/sipstore/api.py
- add a function to automatically find the current storage
  location of a SIPFile
- add a config variable to generate agent of the SIPs
- updated tests
@remileduc
Copy link
Member Author

ready to merge

@remileduc remileduc mentioned this pull request Jun 27, 2017
The created model is stored in the attribute 'model'.
:param bool archivable: tells if the SIP should be archived or not.
Usefull if ``Invenio-Archivematica`` is installed.
:param list files: The list of files to associate with the SIP. See
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is :param <type> <name> a standard?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@ -71,24 +65,35 @@ class SIP(db.Model, Timestamp):
agent = db.Column(JSONType, default=lambda: dict(), nullable=False)
"""Agent information regarding given SIP."""

archivable = db.Column(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this flag necessary? perhaps we could reduce it to a single "state" flag (enum)?

@krzysztof krzysztof closed this Jul 12, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants