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

Export bagit #27

Merged
merged 7 commits into from Jul 12, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions AUTHORS.rst
Expand Up @@ -28,3 +28,4 @@ Authors
Submission Information Package store for Invenio.

- CERN <info@inveniosoftware.org>
- Rémi Ducceschi <remi.ducceschi@gmail.com>
32 changes: 32 additions & 0 deletions docs/api.rst
Expand Up @@ -28,3 +28,35 @@ API Docs
invenio_sipstore
----------------

.. automodule:: invenio_sipstore.ext
:members:

API
---

.. automodule:: invenio_sipstore.api
:members:

Models
------

.. automodule:: invenio_sipstore.models
:members:

Archivers
---------

.. automodule:: invenio_sipstore.archivers
:members:

BaseArchiver
++++++++++++

.. automodule:: invenio_sipstore.archivers.base_archiver
:members:

BagItArchiver
+++++++++++++

.. automodule:: invenio_sipstore.archivers.bagit_archiver
:members:
7 changes: 6 additions & 1 deletion docs/conf.py
Expand Up @@ -328,7 +328,12 @@


# Example configuration for intersphinx: refer to the Python standard library.
intersphinx_mapping = {'https://docs.python.org/': None}
intersphinx_mapping = {
'python': ('https://docs.python.org/', None),
'invenio_files_rest': ('https://invenio-files-rest.readthedocs.io/en/latest/', None),
'invenio_pidstore': ('https://invenio-pidstore.readthedocs.io/en/latest/', None),
'invenio_records': ('https://invenio-records.readthedocs.io/en/latest/', None),
}

# Autodoc configuraton.
autoclass_content = 'both'
59 changes: 52 additions & 7 deletions invenio_sipstore/admin.py
Expand Up @@ -21,7 +21,7 @@

from flask_admin.contrib.sqla import ModelView

from .models import SIP, RecordSIP, SIPFile
from .models import SIP, RecordSIP, SIPFile, SIPMetadata, SIPMetadataType


class SIPModelView(ModelView):
Expand All @@ -33,18 +33,17 @@ class SIPModelView(ModelView):
can_view_details = True
column_display_all_relations = True
column_list = (
'sip_format', 'content', 'user_id', 'agent'
'user_id', 'agent', 'archivable', 'archived'
)
column_labels = dict(
sip_format='SIP Format',
content='Content',
user_id='User ID',
agent='Agent'
agent='Agent',
archivable='Archivable',
archived='Archived'
)
column_filters = (
'sip_format', 'content', 'user_id',
'user_id', 'archivable', 'archived'
)
column_searchable_list = ('sip_format', 'content')
page_size = 25


Expand All @@ -58,6 +57,42 @@ class SIPFileModelView(ModelView):
page_size = 25


class SIPMetadataModelView(ModelView):
"""ModelView for the SIPMetadata."""

can_create = False
can_edit = False
can_delete = False
can_view_details = True
column_display_all_relations = True
column_list = (
'type.name',
'content',
'sip.agent',
'sip.archivable',
'sip.archived'
)
column_labels = {
'type.name': 'Type',
'content': 'Content',
'sip.agent': 'Agent',
'sip.archivable': 'Archivable',
'sip.archived': 'Archived'
}
page_size = 25


class SIPMetadataTypeModelView(ModelView):
"""ModelView for the SIPMetadataType."""

can_create = True
can_edit = True
can_delete = False
can_view_details = True
column_display_all_relations = True
page_size = 25


class RecordSIPModelView(ModelView):
"""ModelView for the RecordSIP."""

Expand All @@ -78,6 +113,16 @@ class RecordSIPModelView(ModelView):
model=SIPFile,
name='SIPFile',
category='Records')
sipmetadata_adminview = dict(
modelview=SIPMetadataModelView,
model=SIPMetadata,
name='SIPMetadata',
category='Records')
sipmetadatatype_adminview = dict(
modelview=SIPMetadataTypeModelView,
model=SIPMetadataType,
name='SIPMetadataType',
category='Records')
recordsip_adminview = dict(
modelview=RecordSIPModelView,
model=RecordSIP,
Expand Down