-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
documents: export records in Dublic Core format
This PR configures OAI server to export documents records in Dublin Core formats. * Installs `dcxml` library to generate the output in Dublic CORE XML. * Creates and configures the serializer for `oai_dc` format. * Dumps `mimetype` from file object to record's file metadata. * Adds a serializer schema for Dublic Core. * Adds `mimetype` property to all resources that use files. * Avoids to display issue and pages if volume is not defined in `partOf` property. * Adds a custom serializers for dumping DC objects. * Closes #325. Co-Authored-by: Sébastien Délèze <[email protected]>
- Loading branch information
Sébastien Délèze
committed
Nov 12, 2020
1 parent
98c75e1
commit 1a5799e
Showing
17 changed files
with
948 additions
and
40 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,6 +27,9 @@ | |
"key": { | ||
"type": "keyword" | ||
}, | ||
"mimetype": { | ||
"type": "keyword" | ||
}, | ||
"checksum": { | ||
"type": "keyword" | ||
}, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -37,6 +37,9 @@ | |
"key": { | ||
"type": "keyword" | ||
}, | ||
"mimetype": { | ||
"type": "keyword" | ||
}, | ||
"checksum": { | ||
"type": "keyword" | ||
}, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# -*- coding: utf-8 -*- | ||
# | ||
# Swiss Open Access Repository | ||
# Copyright (C) 2019 RERO | ||
# | ||
# This program is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU Affero General Public License as published by | ||
# the Free Software Foundation, version 3 of the License. | ||
# | ||
# This program is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU Affero General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU Affero General Public License | ||
# along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
|
||
"""Dublin Core serializer.""" | ||
|
||
from invenio_records_rest.serializers.dc import DublinCoreSerializer | ||
|
||
|
||
class SonarDublinCoreSerializer(DublinCoreSerializer): | ||
"""Marshmallow based DublinCore serializer for records.""" | ||
|
||
def dump(self, obj, context=None): | ||
"""Serialize object with schema. | ||
Mandatory to override this method, as invenio-records-rest does not | ||
use the right way to dump objects (compatible with marshmallow 3.9). | ||
""" | ||
return self.schema_class(context=context).dump(obj) |
Oops, something went wrong.