Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

search: USI data searchable #21

Merged
merged 1 commit into from
Jun 19, 2019
Merged

search: USI data searchable #21

merged 1 commit into from
Jun 19, 2019

Conversation

sebdeleze
Copy link
Contributor

NEW Import fixtures from RERO doc.
NEW Filter search by contextual IR (USI).

Signed-off-by: Sébastien Délèze sebastien.deleze@rero.ch

@sebdeleze sebdeleze requested a review from jma June 3, 2019 14:49
@@ -40,13 +50,13 @@ class DocumentRecord(SonarRecord):
@classmethod
def create(cls, data, id_=None, **kwargs):
Copy link
Contributor Author

Choose a reason for hiding this comment

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

remove this method

"type": "string"
},
"organization": {
"description": "Organization the author belongs to.",
"key": {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

change to PID

@@ -31,6 +31,9 @@
<div class="row">
<div class="col-12 col-sm-11">
<input class="form-control form-control-lg mr-2" type="search" placeholder="{{_('Search publications, authors, projects, ...')}}" aria-label="Search" name="q">
{% if g.ir|default('sonar') != 'sonar' %}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Explore invenio search UI --> search_hidden_params

"""
url = current_app.config.get('SONAR_DOCUMENTS_RERO_DOC_URL')

click.secho('Importing {} pages of records for "{}" from {}'.format(
Copy link
Contributor Author

Choose a reason for hiding this comment

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

use named arguments for formats

(current_page*10-9), (current_page*10)), nl=False)

# Read Marc21 data for current page
response = requests.get(url + '?of=xm&jrec={}&c=NAVSITE.{}'.format(
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Add URL placeholder to format

Pipfile Outdated
@@ -30,6 +30,7 @@ pytest-mock = ">=1.6.0"
pytest-pep8 = ">=1.0.6"
pytest-random-order = ">=0.5.4"
pytest-runner = ">=3.0.0,<5"
pylint = "*"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

remove pylint dependency

[
{
"name": "Università della Svizzera italiana",
"key": "usi"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

use pid instead of key

@@ -24,12 +24,10 @@ def __init__(self, app=None):
def init_app(self, app):
"""Flask application initialization."""
self.init_config(app)
app.extensions['sonar'] = self
app.extensions['sonar_modules'] = self
Copy link
Contributor Author

Choose a reason for hiding this comment

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

change to sonar_app

for k in dir(config):
if k.startswith('SONAR_'):
if k.startswith('SONAR_MODULES_'):
Copy link
Contributor Author

Choose a reason for hiding this comment

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

change to SONAR_APP_

@@ -22,15 +22,15 @@ def __init__(self, app=None):
def init_app(self, app):
"""Flask application initialization."""
self.init_config(app)
app.extensions['sonar-authors'] = self
app.extensions['sonar_institutions'] = self

def init_config(self, app):
"""Initialize configuration.

Override configuration variables with the values in this package.
"""
# for k in dir(config):
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Remove unused configuration

schema = 'institution'

@classmethod
def get_item_by_key(cls, key):
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this method will be removed as key will not exist anymore

@sebdeleze
Copy link
Contributor Author

@jma I've done the changes we discussed. You can check

"default": "https://sonar.ch/schemas/institutions/institution-v1.0.0.json"
},
"pid": {
"description": "Institution identifier.",
Copy link
Contributor

Choose a reason for hiding this comment

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

please use title instead of description same above

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I corrected the titles and descriptions

NEW Import fixtures from RERO doc.
NEW Filter search by contextual IR (USI).
BETTER Increase code coverage.

Signed-off-by: Sébastien Délèze <sebastien.deleze@rero.ch>
@sebdeleze sebdeleze merged commit 7ffd0e2 into rero:master Jun 19, 2019
@sebdeleze sebdeleze deleted the sed-import-usi-data branch June 19, 2019 13:51
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants