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

pkp/pkp-lib/issues/6201 DOIPubIdPlugin: add CitationStyleLanguagePlugin support #1035

Closed
wants to merge 1 commit into from

Conversation

nongenti
Copy link
Contributor

Hi,
I add support for CitationStyleLanguagePlagin to DOIPubIdPlugin, that the DOI can be shown in the citation of books and chapters. I also changed the PubIdPlugin class to use the new source_chapter_id and not the chapter_id.
Thirdly I found a different result by creating an DOI for a publicaion between OMP 3.3 and OMP 3.4:
In OMP 3.3 (on our systems) the press initials in the DOIs are always lower case, but in OMP 3.4 the press initials are lower case for chapters but not for books. I didn't found the code, that changed this, but a way to fix it (DOIPubIDPlugin.inc.php line 380) .

@asmecher
Copy link
Member

asmecher commented Dec 3, 2021

Thanks as always, @nongenti!

@ewhanson, could you review the DOI-related aspects of this to see how they can be coordinated with your changes?
@withanage, would you mind reviewing this otherwise?

@asmecher
Copy link
Member

asmecher commented Dec 3, 2021

(Actually, tagging @NateWr on this as well, since he's got pkp/citationStyleLanguage#84 (comment) on his list.)

@withanage
Copy link
Member

@asmecher sure, I will review the plugin with @ewhanson

@ewhanson
Copy link
Contributor

ewhanson commented Dec 3, 2021

Hi @asmecher and @withanage, with my changes DOIs will no longer refer to PubIdPlugin and DoiPubIdPlugin will be removed entirely.

The change from chapter_id to source_chapter_id would need to be reflected in the new DOI code, but adding it to PubIdPlugin shouldn't create any conflicts with the my current DOI work. If these were to go in now, I could adapt the new DOI code as needed.

For the change in context initials going into DoiPubIdPlugin it may be best to add this to my todo list for the refactor. If the bug was only in that place in DoiPubIdPlugin, it may no longer be an issue once the refactor is complete.

For the adding of DOIs to citations, I would suggest waiting until pkp/pkp-lib#7014 has been merged and add the DOI fetching directly inside of the CitationStyleLanguage plugin (This is what's being done in OJS as well).

Thanks!

@NateWr
Copy link
Contributor

NateWr commented Dec 6, 2021

Sorry everyone, I've promised @nongenti a review of this but I haven't had time to get to it. I think the key change here is adapting the CSL plugin for OMP. The bulk of that work is here: https://github.com/pkp/citationStyleLanguage/pull/84/files

@nongenti yes, DOIs are getting some heavy revision in 3.4, so it may make sense to wait on that until Erik has merged in #7014. But I think we can still move ahead with a merge of the OMP support for CSL in the meantime. I will try to get to it this week but I've been very backed up.

@nongenti
Copy link
Contributor Author

nongenti commented Dec 6, 2021

Okay, I will add DOI support to the CitationStyleLanguage plugin after #7014 is merged. @NateWr I'm in vacation from December 10th - January 02th, so no stress, we can finish the CSL plugin next year.

@NateWr
Copy link
Contributor

NateWr commented Dec 6, 2021

👍 That's great, @nongenti. I'll set a reminder to revisit this in the new year.

@@ -375,7 +377,7 @@ public function addPublicationFormFields($hookName, $form)
'value' => $form->publication->getData('pub-id::doi'),
'prefix' => $prefix,
'pattern' => $pattern,
'contextInitials' => $form->submissionContext->getData('acronym', $form->submissionContext->getData('primaryLocale')) ?? '',
'contextInitials' => PKPString::strtolower($form->submissionContext->getData('acronym', $form->submissionContext->getData('primaryLocale'))) ?? '',
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this a necessary change? I don't think we want to enforce lower-case on DOIs, which are case-insensitive anyway.

$chapter = $ichapter;
break;
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Instead of searching for the chapter again here, add it to the data passed to the hook at HookRegistry::call('CitationStyleLanguage::citation',.

@nongenti nongenti closed this May 17, 2022
@asmecher asmecher changed the title DOIPubIdPlugin: add CitationStyleLanguagePlugin support pkp/pkp-lib/issues/6201 DOIPubIdPlugin: add CitationStyleLanguagePlugin support May 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants