From b477b57ee72957c3673948db9a4ef7e91080b23e Mon Sep 17 00:00:00 2001 From: Klara Peskova Date: Mon, 31 Mar 2014 20:35:16 +0200 Subject: [PATCH 1/2] Fixes issue #161 --- simplestore/lib/simplestore_marc_handler.py | 3 ++- simplestore/lib/simplestore_model/model.py | 13 +++++++------ 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/simplestore/lib/simplestore_marc_handler.py b/simplestore/lib/simplestore_marc_handler.py index 21ec56f95b..e17804f3bd 100644 --- a/simplestore/lib/simplestore_marc_handler.py +++ b/simplestore/lib/simplestore_marc_handler.py @@ -43,7 +43,8 @@ def add_basic_fields(rec, form, email): record_add_field(rec, '245', subfields=[('a', remove_html_markup(form['title']))]) if form['creator']: - record_add_field(rec, '100', subfields=[('a', remove_html_markup(form['creator']))]) + for kw in form['creator'].split(';'): + record_add_field(rec, '100', subfields=[('a', remove_html_markup(kw.strip()))]) if form['domain']: record_add_field(rec, '980', subfields=[('a', remove_html_markup(form['domain']))]) diff --git a/simplestore/lib/simplestore_model/model.py b/simplestore/lib/simplestore_model/model.py index 907549dd25..954652c23e 100644 --- a/simplestore/lib/simplestore_model/model.py +++ b/simplestore/lib/simplestore_model/model.py @@ -44,7 +44,7 @@ class SubmissionMetadata(db.Model): id = db.Column(db.Integer, primary_key=True) description = db.Column(db.Text(), nullable=False) - creator = db.Column(db.String(128)) + creator = db.Column(db.String(256)) # split on ; title = db.Column(db.String(256), nullable=False) open_access = db.Column(db.Boolean(), default=True) @@ -137,10 +137,10 @@ def __init__(self): 'will not be public, however the metadata will be.' } self.field_args['contributors'] = { - 'placeholder': 'co-author 1; co-author 2; ...', + 'placeholder': 'contributor 1; contributor 2; ...', 'description': - 'A semicolon separated list of ' +\ - 'contributors, e.g. further authors. Mention all ' +\ + 'A semicolon separated list of all other ' +\ + 'contributors. Mention all ' +\ 'other persons that were relevant in the creation of the resource.' } self.field_args['language'] = { @@ -161,8 +161,9 @@ def __init__(self): 'Any kind of other reference such as a URN, URI or an ISBN number.' } self.field_args['creator'] = { - 'placeholder': 'The main author of the resource.', - 'description': 'The person who created the resource.' + 'placeholder': 'author 1; author 2; ... ', + 'description': + 'A semicolon separated list of authors of the resource.' } def _create_metadata_class(cfg): From 5044dc33568a05f3f7b90d62c78111d336c97bc6 Mon Sep 17 00:00:00 2001 From: Klara Peskova Date: Tue, 1 Apr 2014 12:56:16 +0200 Subject: [PATCH 2/2] More authors (fixes #161), empty check added. --- simplestore/lib/simplestore_marc_handler.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/simplestore/lib/simplestore_marc_handler.py b/simplestore/lib/simplestore_marc_handler.py index e17804f3bd..40ffeaccb9 100644 --- a/simplestore/lib/simplestore_marc_handler.py +++ b/simplestore/lib/simplestore_marc_handler.py @@ -44,7 +44,8 @@ def add_basic_fields(rec, form, email): if form['creator']: for kw in form['creator'].split(';'): - record_add_field(rec, '100', subfields=[('a', remove_html_markup(kw.strip()))]) + if kw and not kw.isspace(): + record_add_field(rec, '100', subfields=[('a', remove_html_markup(kw.strip()))]) if form['domain']: record_add_field(rec, '980', subfields=[('a', remove_html_markup(form['domain']))]) @@ -68,7 +69,8 @@ def add_basic_fields(rec, form, email): if form['tags']: for kw in form['tags'].split(','): - record_add_field(rec, '653', + if kw and not kw.isspace(): + record_add_field(rec, '653', ind1='1', subfields=[('a', remove_html_markup(kw.strip()))])