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

DOI Manager #2888

Merged
merged 82 commits into from
Jun 15, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
82 commits
Select commit Hold shift + click to select a range
9f8d337
Work in progress: begin restructuring identifier logic to handle mult…
joemull Mar 10, 2022
106a698
#2734 More work on testing and revising template context generation
joemull Mar 11, 2022
05653ae
Simplify references to identifier models
joemull Mar 14, 2022
05c851e
#2734 Update registration preview with segmented crossref context
joemull Mar 14, 2022
3a26142
#2734 Batch template rendering and batch log entry creation
joemull Mar 15, 2022
06854c3
#2734 Updated templates
joemull Mar 15, 2022
883bc12
#2734 Alter CrossrefDeposit model with multiple identifiers and depos…
joemull Mar 18, 2022
ae10424
#2734 Start test_send_crossref_deposit
joemull Mar 18, 2022
40193f2
#2734 Handle multiple DOIs in registration preview
joemull Mar 30, 2022
a4f06e9
Test CrossrefDeposit model with identifiers M2M field
joemull Apr 5, 2022
8e5828c
#2734 Draft of unit tests and data for Crossref XML validation
joemull Apr 12, 2022
61698e9
#2734 Debug nested schema file parsing
joemull Apr 21, 2022
fafec3e
#2734 Debug deposit document template
joemull Apr 22, 2022
7df8a12
#2734 Drafts of schema licenses
joemull Apr 22, 2022
bd1425d
#2734 Update send_crossref_deposit
joemull Apr 22, 2022
3a7a0f4
#2734 Add Crossref CC BY license and organize in LICENSES
joemull Apr 27, 2022
9dc1435
Merge branch '2734-schema-licensing' into 2734-batch-doi-registration
joemull Apr 27, 2022
d12d3c8
#2734 Take license link back out of crossref5.3.1
joemull Apr 27, 2022
322bf9b
Work in progress: begin restructuring identifier logic to handle mult…
joemull Mar 10, 2022
1cae818
#2734 More work on testing and revising template context generation
joemull Mar 11, 2022
4db666e
Simplify references to identifier models
joemull Mar 14, 2022
8c1bc13
#2734 Update registration preview with segmented crossref context
joemull Mar 14, 2022
3d963ff
#2734 Batch template rendering and batch log entry creation
joemull Mar 15, 2022
c584750
#2734 Updated templates
joemull Mar 15, 2022
17c36e8
#2734 Alter CrossrefDeposit model with multiple identifiers and depos…
joemull Mar 18, 2022
662ea1d
#2734 Start test_send_crossref_deposit
joemull Mar 18, 2022
8c98149
#2734 Handle multiple DOIs in registration preview
joemull Mar 30, 2022
d075e08
Test CrossrefDeposit model with identifiers M2M field
joemull Apr 5, 2022
e2bd03f
#2734 Draft of unit tests and data for Crossref XML validation
joemull Apr 12, 2022
e1d73d5
#2734 Debug nested schema file parsing
joemull Apr 21, 2022
8d9613c
#2734 Debug deposit document template
joemull Apr 22, 2022
dddea90
#2734 Update send_crossref_deposit
joemull Apr 22, 2022
0e208f1
#2734 Drafts of schema licenses
joemull Apr 22, 2022
e8a7a3b
#2734 Add Crossref CC BY license and organize in LICENSES
joemull Apr 27, 2022
672e1aa
#2734 Take license link back out of crossref5.3.1
joemull Apr 27, 2022
b9c4639
Merge branch '2734-batch-doi-registration' of github.com:BirkbeckCTP/…
joemull Apr 27, 2022
26d8d7e
#2734 Create facet form for filtering class-based list view
joemull Apr 29, 2022
3c72145
#2734 Fix facet sorting by count
joemull Apr 29, 2022
cd8356e
#2734 Add skeleton DOI Manager pages at press and journal level
joemull Apr 29, 2022
d0924b7
#2734 Add actions with post form and debug batch Crossref registration
joemull May 9, 2022
77405ed
#2734 Revise and clean up Crossref settings validation
joemull May 10, 2022
8ab8585
#2734 Styling and edits
joemull May 12, 2022
3196659
WIP
joemull May 11, 2022
14a5ddb
#2734 Move pagination inside results box
joemull May 12, 2022
e45157d
#2734 Set choices for CrossrefDeposit.status
joemull May 12, 2022
0569485
WIP
joemull May 11, 2022
88d5f9c
#2734 Set choices for CrossrefDeposit.status
joemull May 12, 2022
4e46d1f
#2734 Registration status work
joemull May 13, 2022
841f960
#2734 Filter out unsubmitted articles
joemull May 13, 2022
ea65c5f
Merge branch '2734-registration-status-facet' of github.com:BirkbeckC…
joemull May 13, 2022
f79177f
#2734 Implement query annotation on facet filtering
joemull May 13, 2022
2ec382f
Merge branch '2734-batch-doi-registration' into 2734-registration-sta…
joemull May 13, 2022
9818fca
#2734 Clean up registration status facet
joemull May 13, 2022
6f6154e
#2734 Add edit button
joemull May 13, 2022
90125b8
#2734 Add none to facet charfield facet
joemull May 13, 2022
13addbd
Revert "#2734 Add none to facet charfield facet"
joemull May 13, 2022
74fb320
#2734 Add None choice to charfield facet
joemull May 13, 2022
19229e3
#2734 Prettify None label
joemull May 13, 2022
d2d5e5d
#2734 Touchups
joemull May 13, 2022
9ecdbcf
#2734 Add annotation to get_facet_queryset
joemull May 13, 2022
2f6678a
#2734 Create individual status model and logic
joemull May 17, 2022
0636b98
#2734 Preview XML; adjust empty status behavior
joemull May 17, 2022
5e779e2
#2734 Revise article identifiers view to match
joemull May 17, 2022
a4ac512
#2734 Add date filters
joemull May 18, 2022
7affb98
#2734 Chage to pub date; modify submit behavior
joemull May 18, 2022
174ed6e
#2734 Rename date facets
joemull May 18, 2022
2f1f197
#2734 Make links and actions work at press level
joemull May 19, 2022
36e0683
#2734 Add conference support
joemull May 19, 2022
e1e399d
#2734 Style info and error messages
joemull May 19, 2022
5747f84
#2734 Documentation and responsive styling
joemull May 20, 2022
8c0575b
#2734 version typo fix
joemull May 20, 2022
550d184
#2734 Migration debugging
joemull May 30, 2022
b13f15e
#2848 Migration work in progress
joemull May 30, 2022
e18cc45
#2848 DOIs must now be unique across all journals. Other identifiers …
ajrbyers May 31, 2022
200e346
#2848 updated form, also added tests.
ajrbyers Jun 8, 2022
5eb2b15
#2848 addresses comments.
ajrbyers Jun 8, 2022
989f577
#2848 Address comments on migration
joemull Jun 14, 2022
f84bec9
#2734 Fix string method of CrossrefDeposit
joemull Jun 14, 2022
60bb9c4
#2734 Resolve conflicts with master
joemull Jun 14, 2022
c6f2bba
#2734 Improve exception on classname
joemull Jun 15, 2022
2a1a88d
#2734 Add list tools for admin models
joemull Jun 15, 2022
09232ad
#2734 Move import line up
joemull Jun 15, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions docs/source/editor/prepub.rst
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,15 @@ Check the ‘Mark as Complete’ box to move onto the next step.
3. Verify DOIs
--------------

Articles usually have a DOI, or Digital Object Identifier, automatically assigned and ‘minted’ (created) for them by the system. This unique digital link to the article is usually created automatically for you by the system, and the Verify DOI stage lets you check if the DOI has been issued successfully or if there are any problems.
If the DOI only has two ‘hops’, or two steps shown as bullet points in the Verify DOI stage, this means that no further changes are needed and you are ready to proceed.
You can verify that the article’s DOI is resolving correctly by clicking ‘Edit’ in the top right hand corner of the pop up window and checking that the ‘Status’ column reads ‘Success’. If the DOI Status is listed as pending, or blank, click ‘Poll for DOI Status’. If no DOI has been assigned, click ‘Issue DOI’. NB that newly issued DOIS can take a while to go through.
Articles usually have a DOI (Digital Object Identifier) automatically assigned and ‘minted’ (created) for them by the system. The DOI serves both as a unique identifier and a permalink. The ‘Verify DOI’ step lets you check if the DOI is working successfully as a permalink.

If the DOI only has two ‘hops’, or two steps (shown as bullet points), this means that no further changes are needed and you are ready to proceed.

If the DOI has more than two hops, or you see something else, you need to look more closely at the DOI's details. Select ‘Edit’ in the top right hand corner of the pop up window and check the ‘Status’ column for an indication of what to do next. See :ref:`Interpreting Registration Status<interpreting-registration-status>` for more help.

.. figure:: ../nstatic/prepubgif2.gif

Check the ‘Mark as Complete’ box to move onto the next step.
Check the ‘Mark as Complete’ box to move onto the next step.

4. Select a Galley for Rendering
--------------------------------
Expand Down
2 changes: 1 addition & 1 deletion docs/source/manager.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Manager
manager/submission/index
manager/content/index
manager/articlesissues/index
manager/crossref/index
manager/identifiers/index
manager/users/index
manager/other/index

46 changes: 0 additions & 46 deletions docs/source/manager/crossref/index.rst

This file was deleted.

119 changes: 119 additions & 0 deletions docs/source/manager/identifiers/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
Identifiers
===========

Support for minting Digital Object Identifiers (DOIs) with Crossref is built into Janeway's core. We will be expanding this to other providers in the future.

When Are DOIs Minted?
---------------------
If all the settings are properly configured (see below), Janeway handles DOI registration for you, stepping in at a few key points in the publishing pipeline.

By default, a DOI is registered (a.k.a. minted, deposited) with Crossref when an article is accepted for publication. Some provisional metadata is sent at this time.

.. tip::
You can let editors see a preview of the data that gets sent before accepting an article. See **Accept Article Warning** under :ref:`Review Settings<reviewsettings>`.

At this stage, the DOI will be registered with Crossref, but the webpage it points to on your journal website may not be active yet if the article isn't published yet. That's normal.

The DOI is deposited with Crossref again when the article is published, so any metadata updated in the interim will also be updated in Crossref's metadata feeds. This is also when the DOI starts working as a permalink, in addition to being a unique identifier.

There are things that might interrupt this default behavior. If you are importing backlist content, or there's an issue with the Crossref settings entered, or the required metadata isn't there, you may need to take a more active role. That's where the DOI Manager comes in.

.. _doimanager:

DOI Manager
-----------
You can see all the DOIs for a journal (if you are an editor) or for a press (if you are a staff member) in the DOI Manager.

First, filter by date, registration status, or primary issue until you have an actionable set of articles.

In some cases, you can preview the XML that will get sent to Crossref.

Once you have filtered the articles to your liking, you can take two actions: **Register DOIs** and **Poll for status**. **Register DOIs** will package up all the metadata into XML and send it to Crossref. Crossref will put all the deposits they receive in a queue to process, so the status may not be immediate. After a few moments (or longer if it is a large batch), you can use **Poll for status** to check the result.

.. warning::
**Poll for status** on a large group of articles could take a long time, so test it out on a smaller group first.

.. _interpreting-registration-status:

Interpreting Registration Status
--------------------------------

Unknown
Janeway doesn't know the status. Try **Poll for status**.

Not yet registered
This DOI hasn't been registered yet. You can register it if what you see in the **DOI** column looks right (including pattern previews).

Queued at Crossref
The deposit batch you sent is waiting to be read by the Crossref servers.

Registered
Success! Crossref understood all the metadata you sent and didn't find any problems with it.

.. tip::
A status of **Registered** does not necessarily mean that the DOI will resolve correctly, if the URL it points to isn't fully operational yet on the Janeway side (i.e., the article isn't published).

Registered (but some citations not correctly parsed)
Crossref understood the article-level metadata, but when it went to process the citations, there were errors. Check the XML in the **Response** column for details.

Registered with warning
Crossref understood and registered the DOI, but sent back a warning. Check the XML in the **Response** column for details.

Registration failed
Crossref tried to register the DOI but couldn't because of a problem. Check the XML in the **Response** column for details.

Crossref Settings
-----------------
To edit the Crossref settings, select **Crossref Settings** from the manager interface. The fields are as follows:

Use Crossref DOIs
If disabled, no DOIs will be minted

Use Crossref Test Deposit Server
If enabled, DOIs will be minted on Crossref's test system

Crossref Username
Your crossref username

Crossref Password
Your crossref password

Crossref Depositor Email
The email address of the depositor

Crossref Depositor Name
The name of the depositor

Crossref Prefix
The prefix for your crossref account -- usually 10.XXXX

Crossref Registrant Name
The name of the registrant for this journal on Crossref's system (e.g. Open Library of Humanities)

DOI Display Prefix
Text to prepend to DOIs -- used to generate DOI URLs

DOI Display Suffix
Text to append to DOIs -- also used to generate DOI URLs

DOI Pattern
The pattern for auto-generating DOIs. Defaults to using the journal code and article ID (e.g. orbit.123):

``{{ article.journal.code }}.{{ article.pk }}``

Crosscheck Settings
-------------------
Janeway also has support for Crosscheck (also called Similarity Check), which is provided by iThenticate. You can sign up for an account via Crossref and this will allow you to send submitted manuscripts for originality checking.

The settings are:

Enable
Enables display for Crosscheck buttons

Username
Your iThenticate service username

Password
Your iThenticate service password

More info on Crosscheck/Similarity Check: https://www.crossref.org/services/similarity-check/
2 changes: 2 additions & 0 deletions docs/source/manager/review/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ The management interface has two sections that allow you to manage peer review s
- Review Settings
- Review Forms

.. _reviewsettings:

Review Settings
---------------
Under review settings we can control how peer review operates for the given journal. The settings editable here are:
Expand Down
8 changes: 4 additions & 4 deletions docs/source/published/articles.rst
Original file line number Diff line number Diff line change
Expand Up @@ -56,14 +56,14 @@ Publisher notes appear on the article page below the abstract and how to cite bl

Identifiers
-----------
Any identifiers such as DOIs are listed here and a link to manage them is in the top right of the block. From that link you can manage the identifiers.
Any identifiers such as DOIs are listed here and a link to manage them is in the top right of the block.

.. figure:: /nstatic/edit_doi.png

The identifiers manager
The article-level identifiers manager

.. warning::
Janeway does not currently tell you if a DOI was deposited successfully, to do so you can test the DOI or check the issue admin system.
.. tip::
You can also manage DOIs at the journal level as an editor (and at the press level as a staff user) using the :ref:`DOI Manager<doimanager>`.

Galleys
-------
Expand Down
125 changes: 124 additions & 1 deletion src/core/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,24 @@

import uuid
import copy
import functools
import itertools

from django import forms
from django.forms.fields import Field
from django.utils import timezone
from django.utils.translation import ugettext_lazy as _, get_language
from django.conf import settings
from django.contrib.auth.forms import UserCreationForm
from django.db.models import Q

from django_summernote.widgets import SummernoteWidget

from core import models, validators
from utils.logic import get_current_request
from journal import models as journal_models
from utils import setting_handler
from utils.forms import KeywordModelForm, JanewayTranslationModelForm, CaptchaForm
from utils.forms import KeywordModelForm, JanewayTranslationModelForm, CaptchaForm, HTMLDateInput
from utils.logger import get_logger
from submission import models as submission_models

Expand Down Expand Up @@ -496,3 +499,123 @@ def save(self, commit=True):
access_request.save()

return access_request


class CBVFacetForm(forms.Form):

def __init__(self, *args, **kwargs):
# This form populates the facets that users can filter results on
# If you pass a separate facet_queryset into kwargs, the form is
# the same regardless of how the result queryset changes
# To have the facets dynamically contract based on the result queryset,
# do not pass anything for facet_queryset into kwargs.

self.id = 'facet_form'
self.queryset = kwargs.pop('queryset')
self.facets = kwargs.pop('facets')
self.facet_queryset = kwargs.pop('facet_queryset', None)
if not self.facet_queryset:
self.facet_queryset = self.queryset
self.fields = {}

super().__init__(*args, **kwargs)

for facet_key, facet in self.facets.items():

if facet['type'] == 'foreign_key':

# Note: This retrieval is written to work even for sqlite3.
# It might be rewritten differently if sqlite3 support isn't needed.
if self.facet_queryset:
column = self.facet_queryset.values_list(facet_key, flat=True)
else:
column = self.queryset.values_list(facet_key, flat=True)
values_list = list(filter(bool, column))
choice_queryset = facet['model'].objects.filter(pk__in=values_list)

if facet.get('order_by'):
choice_queryset = self.order_by(choice_queryset, facet, values_list)

choices = []
for each in choice_queryset:
label = getattr(each, facet["choice_label_field"])
count = values_list.count(each.pk)
label_with_count = f'{label} ({count})'
choices.append((each.pk, label_with_count))
self.fields[facet_key] = forms.ChoiceField(
widget=forms.widgets.CheckboxSelectMultiple,
choices=choices,
required=False,
)

elif facet['type'] == 'charfield_with_choices':
# Note: This retrieval is written to work even for sqlite3.
# It might be rewritten differently if sqlite3 support isn't needed.

if self.facet_queryset:
queryset = self.facet_queryset
else:
queryset = self.queryset
column = []
values_list = []
lookup_parts = facet_key.split('.')
for obj in queryset:
for part in lookup_parts:
if obj:
try:
result = getattr(obj, part)
obj = result
except:
result = None

if result != None:
values_list.append(result)
elif result == None and 'default' in facet:
values_list.append(facet['default'])

unique_values = set(values_list)
choices = []
model_choice_dict = dict(facet['model_choices'])
for value in unique_values:
label = model_choice_dict.get(value, value)
count = values_list.count(value)
label_with_count = f'{label} ({count})'
choices.append((value, label_with_count))
self.fields[facet_key] = forms.ChoiceField(
widget=forms.widgets.CheckboxSelectMultiple,
choices=choices,
required=False,
)

# To do:
elif facet['type'] == 'date_time':
self.fields[facet_key] = forms.DateTimeField(
widget=HTMLDateInput(),
required=False,
)

elif facet['type'] == 'boolean':
pass

self.fields[facet_key].label = facet['field_label']

def order_by(self, queryset, facet, fks):
order_by = facet.get('order_by')
if order_by != 'facet_count' and order_by in facet['model']._meta.get_fields():
queryset = queryset.order_by(order_by)
elif order_by == 'facet_count':
sorted_fk_tuples = sorted(
[(fk, fks.count(fk)) for fk in fks],
key=lambda x:x[1],
reverse=True,
)
sorted_fks = [tup[0] for tup in sorted_fk_tuples]
queryset = sorted(
queryset,
key=lambda x: sorted_fks.index(x.pk)
)

# Note: There is no way yet to sort on the result of a
# function property like journal.name

return queryset
1 change: 1 addition & 0 deletions src/core/include_urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@
name='serve_press_file',
),
url(r'^press/merge_users/$', press_views.merge_users, name='merge_users'),
url(r'^doi_manager/$', press_views.IdentifierManager.as_view(), name='press_identifier_manager'),

# Notes
url(r'^article/(?P<article_id>\d+)/note/(?P<note_id>\d+)/delete/$', core_views.delete_note,
Expand Down
11 changes: 11 additions & 0 deletions src/core/templatetags/classname.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
from django import template

register = template.Library()


@register.filter
def classname(obj):
try:
return obj.__class__.__name__
except AttributeError:
return ''
Loading