dataquest-dev / DSpace

(Official) The DSpace digital asset management system that powers your Institutional Repository
https://wiki.lyrasis.org/display/DSDOC7x/
BSD 3-Clause "New" or "Revised" License
2 stars 2 forks source link

Enable orcid authority #570

Closed kosarko closed 6 months ago

kosarko commented 7 months ago

based on https://wiki.lyrasis.org/display/DSDOC7x/ORCID+Authority

configuration changes needed:

diff local.cfg ../dspace-angular/docker/local.cfg
157c157
< event.dispatcher.default.consumers = versioning, discovery, eperson, doi
---
> event.dispatcher.default.consumers = authority, versioning, discovery, eperson, doi
183a184,203
>
> ## ORCID authority
> plugin.named.org.dspace.content.authority.ChoiceAuthority = \
>     org.dspace.content.authority.SolrAuthority = SolrAuthorAuthority
> solr.authority.server=${solr.server}/authority
> choices.plugin.dc.contributor.author = SolrAuthorAuthority
> choices.presentation.dc.contributor.author = authorLookup
> authority.controlled.dc.contributor.author = true
> authority.author.indexer.field.1=dc.contributor.author
>
> # These ORCID settings are now required for ORCID Authority
> orcid.domain-url = https://orcid.org
> # You can use either the Public API or Member API
> orcid.api-url = https://pub.orcid.org/v3.0
>
> # You do NOT need to pay for a Member API ID to use ORCID Authority.
> # Instead, you just need a Public API ID from a free ORCID account.
> # https://info.orcid.org/documentation/features/public-api/
> orcid.application-client-id = <ID>
> orcid.application-client-secret = <SECRET>

This is currently deployed on dspace-dev like this:

The wiki instructs me to run bin/dspace index-authority, but when I do that through docker dspace-cli image:

docker compose -p ukrepo --env-file .env -f docker/docker-compose.yml -f docker/docker-compose-rest.yml -f docker/cli.yml run dspace-cli index-authority
Cannot index authority values since the configuration isn't valid. Check dspace logs for more information.
  1. Where are the logs? (cli has only assetstore mount) a. docker cp 5603453344a9:/dspace/log/dspace.log /tmp/cli_dspace.log ? (where the id is obtained via docker ps -a) b. the error there is
    2024-03-28 09:18:28,589 WARN  unknown unknown org.dspace.authority.indexer.DSpaceAuthorityIndexer @ Authority indexer not properly configured, no metadata fields configured for indexing. Check the "authority.author.indexer.field" properties.

    but

    grep "authority.author.indexer" docker/local.cfg
    authority.author.indexer.field.1=dc.contributor.author

    @milanmajchrak does dspace-cli even see the dspace-angular/docker/local.cfg?

summary:

milanmajchrak commented 7 months ago

@kosarko The reason why the dspace index-authority command does not work is that the docker/cli.yml file does not mount local.cfg, causing the updated local.cfg to be ignored.

After this change it works:

diff --git a/docker/cli.yml b/docker/cli.yml
index 6d1c0f194..7fc25d4ee 100644
--- a/docker/cli.yml
+++ b/docker/cli.yml
@@ -40,6 +40,7 @@ services:
       assetstore__P__s3__P__endpoint: ${S3_ENDPOINT:-}
     volumes:
     - "assetstore:/dspace/assetstore"
+    - ./local.cfg:/dspace/config/local.cfg
     entrypoint: /dspace/bin/dspace
     command: help
     networks:
milanmajchrak commented 7 months ago

In relation to configurations, it's worth considering whether clarin-dspace.cfg or authority.cfg could also be mounted.

milanmajchrak commented 7 months ago

@kosarko Unit tests and integration test are failing. Will you fix it or should I try?

kosarko commented 6 months ago

@milanmajchrak the test are now passing. I've moved most of the config into a new file, which can be included from local.cfg like this (I'm showing also the other needed parts that should be added locally):

include=features/enable-orcid.cfg

orcid.application-client-id =
orcid.application-client-secret =

event.dispatcher.default.consumers = authority, versioning, discovery, eperson