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

Citation Integration #33

Closed
kstapelfeldt opened this issue Aug 30, 2021 · 21 comments
Closed

Citation Integration #33

kstapelfeldt opened this issue Aug 30, 2021 · 21 comments
Assignees

Comments

@kstapelfeldt
Copy link
Member

No description provided.

@kstapelfeldt
Copy link
Member Author

@kstapelfeldt
Copy link
Member Author

kstapelfeldt commented Sep 22, 2021

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
Copy link
Member Author

@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
Copy link
Member Author

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

@larkgz
Copy link

larkgz commented Oct 4, 2021

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
Copy link
Member Author

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
Copy link
Member Author

kstapelfeldt commented Oct 6, 2021

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

  • Add Additional Styles.
  • Mapping to fields from existing content types.
  • Displaying properly configured taxonomy terms for the Citation Vocabulary.

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
Copy link

larkgz commented Oct 19, 2021

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
Copy link
Member Author

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

@kstapelfeldt
Copy link
Member Author

Will also scope out the export in RIS and MarcXML

@larkgz
Copy link

larkgz commented Oct 21, 2021

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
Copy link
Member Author

kstapelfeldt commented Oct 27, 2021

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
Copy link

larkgz commented Oct 29, 2021

  • Renamed module to Citation Select
  • Created a more user-friendly list of options based on the one in Drupal core that comes up when adding existing fields to content types
  • Added page URL and title as fields to select
  • Still looking into the Plugin architecture

@kstapelfeldt
Copy link
Member Author

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
Copy link
Member Author

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
Copy link
Member Author

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

@kstapelfeldt
Copy link
Member Author

Needs manual evaluation and testing.

@kstapelfeldt
Copy link
Member Author

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
Copy link
Member Author

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

@kstapelfeldt
Copy link
Member Author

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

@kylehuynh205
Copy link

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

@github-project-automation github-project-automation bot moved this from Done to Review in Islandora Lite Project Jan 24, 2024
@kylehuynh205 kylehuynh205 moved this from Review to Done in Islandora Lite Project Jan 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

No branches or pull requests

3 participants