digitalutsc / islandora_lite_docs

Contains a Wiki with documentation for the UTSC Library's Islandora Lite System
GNU General Public License v3.0
2 stars 0 forks source link

Citation Integration #33

Closed kstapelfeldt closed 7 months ago

kstapelfeldt commented 2 years ago

Can we adapt https://www.drupal.org/project/bibcite? Or is there a better module?

https://www.drupal.org/case-study/bibliography-and-citation-module-for-drupal-8 https://www.drupal.org/project/biblio

kstapelfeldt commented 2 years ago

Bibcite is in dev but should have a release soon. They have a social media presence with people using BibCite in the dev version. ttps://www.adcisolutions.com/knowledge/five-use-cases-highlight-benefits-bibliography-citation-project

Can we make this work with our content type, and how?

kstapelfeldt commented 2 years ago

@ravence has a "select citation" form and csl uploaded and used elsewhere. Wants form to show up on node displays and then after submission use ajax or something to get citation from the node, but is not sure how to get the node from a block or view.

@Natkeeran if you do this as a block, you can pass in any number of tokens from the block. If we choose to go that route (put citation generation as a block) you could do this with tokens. It will also be available from the javascript level (through the variable). Can define a service in your module and call the service to return JSON or HTML response that can be displayed on the front end. https://www.drupal.org/docs/drupal-apis/services-and-dependency-injection/services-and-dependency-injection-in-drupal-8

kstapelfeldt commented 2 years ago

In a block in the node, but not pulling data. Still working on it!

larkgz commented 2 years ago

Now pulling data from the node:

demo_select_citation

Right now it's assuming that everything is a book, but I think that we can use the genre field to guess the type.

kstapelfeldt commented 2 years ago

Install a taxonomy vocabulary based on: https://aurimasv.github.io/z2csl/typeMap.xml and then allow a user to identify in configuration where this vocabulary will exist in content types for generation of the citation.

kstapelfeldt commented 2 years ago

stripping Italics issue due to security challenge (prevent script injection) - Lara found a workaround. See also: https://www.drupal.org/project/bibcite/issues/3065463

Suggestion:

Affordances required in config

For documentation/config screen (to be reviewed DRAFT).

The Citation generation module installs a fixed Taxonomy vocabulary called Citation Vocabulary based on the [Citation Style Language] and provides a block that needs to be placed on the pages where users should be able to generate citations. It also requires mapping fields in an existing content type so that the citation can be properly managed. You can update the mapping in the configuration pane for the module.

In order to allow a content type to generate a citation, this Citation Vocabulary vocabulary needs to be referenced from an existing entity in one of your content types. Please add or configure the field you would like to reference this vocabulary. Properly configured fields will appear in a list in the configuration of the module.

Once a field is configured, it will be mapped this way if it appears in one or multiple content types.

Dream scenario: A table/matrix that displays all machine names in the system and makes them available for mapping to a fixed vocabulary required by citation generation.

Other wish-list items: Export formats (such as RIS and marc, especially)

larkgz commented 2 years ago

Add Additional Styles

Formatting styles are pulled directly from Bibcite, so adding new styles to Bibcite will also enable them in the block.

Mapping to fields from existing content types

CSL fields can be mapped to existing node fields, which are selected from dropdowns in settings.

image of a table with two columns titled 'CSL FIELD' and 'NODE FIELD'. The column titled 'CSL FIELD' lists names of CSL fields, while the column titled 'NODE FIELD' lists dropdown menus

Assigned mappings can be reused across different content types, assuming that the machine name of the field is the same.

An image of two citations side-by-side for different content types. The field 'edition' is highlighted in both to show that the setting applies to both content types
kstapelfeldt commented 2 years ago

Wow so great! As per our meeting this morning, I understand you will be testing against plain Drupal, Islandora, and Islandora Lite playbook.

kstapelfeldt commented 2 years ago

Will also scope out the export in RIS and MarcXML

larkgz commented 2 years ago

Did some testing: the module installs and citations display properly on Drupal and Islandora Lite playbook. I had some trouble working with the Islandora sandbox, so I have not been able to test there.

Also, a few of the listed fields (e.g. id, title, created, etc) cause errors because they need to be accessed differently: will probably need to write more specific cases or truncate the options a little bit.

kstapelfeldt commented 2 years ago

We went through specific cases. We don't need NID, but we do need the URL of the page (or any added "link" fields) to be options. We need any date fields added by a user, and the date the URL was accessed. We never need file fields. We will definitely need the node title.

Nat asks if we can architect a plugin architecture for this so that her work (and potentially the work of others) can be added without modifying the core. This way, if somebody adds a new field type, it would be automatically added.

Here's plugin work that was done for RipRap: https://github.com/digitalutsc/riprap/blob/RiprapFiles/src/Plugin/AbstractVerifyChecksumPlugin.php

Nat did a little demo on how this might work.

larkgz commented 2 years ago
kstapelfeldt commented 2 years ago

How to format fields flexibly - There are different ways of getting data and putting it into the array format. Discussion and Lara will move forward.

kstapelfeldt commented 2 years ago

Working with the plugins but still need to put into Drupal codebase. Spending time fixing a bug. Have to account for one more case because of the way the code changed.

kstapelfeldt commented 2 years ago

small code cleanup left. Needs testing with multiple end users to confirm.

kstapelfeldt commented 2 years ago

Needs manual evaluation and testing.

kstapelfeldt commented 2 years ago

Notes about Citation Select oddities / feature creep Settings are stored in a really unintuive way, especially for “custom” formats such as “title” and “current url”. Restructure? Explanation: Stored as a mapping of CSL fields to a list of corresponding node fields. This is to backload some processing onto when settings are set because otherwise it will need to create this list every time it’s run. “Custom” formats have custom names and the mapping didn’t seem to read properly by default or something? Add default or confirmation screen for “type” because it’s a required field. Might want to restrict it to taxonomy terms if being strict about it. It’s stored separately from the other settings but should probably be condensed with the rest Missing explicit date case for typed relations plugin Add configuration mappings (right now it’s just using the default of linked agents) for typed relations in plugin Entity references are assumed to be taxonomy terms, might want that to be more easily diversified Add export for RIS / MARC Add brief explanation of plugin development (check if need to restructure first though) Check input sanitation is good because it’s skipping security checks so that the formatting works

kstapelfeldt commented 2 years ago

@ravence to cut a dev release and sync the readme into the project page.

kstapelfeldt commented 2 years ago

Once the release is complete @Natkeeran will put this in playbook and core for testing

kylehuynh205 commented 7 months ago

Release a module: https://www.drupal.org/project/citation_select