Skip to content

[DSpace-CRIS] Porting of authority framework functionalities (Frontend)#4956

Open
FrancescoMolinaro wants to merge 31 commits intoDSpace:mainfrom
4Science:task/main/DURACOM-426
Open

[DSpace-CRIS] Porting of authority framework functionalities (Frontend)#4956
FrancescoMolinaro wants to merge 31 commits intoDSpace:mainfrom
4Science:task/main/DURACOM-426

Conversation

@FrancescoMolinaro
Copy link
Contributor

@FrancescoMolinaro FrancescoMolinaro commented Dec 19, 2025

References

Description

Initial port of the DSpace-CRIS authority framework into core DSpace, enabling real-time entity lookup, confidence-based linking, and automatic graph maintenance through server-side consumers.

On the UI this PR introduces a new way to link authorithy controlled metadata to the related item, generating a link in search results or item page, this connection is handled in submission. (for configuration check the rest PR)

image

Through a rest configuration, is possible also to activate an "auto-fill" functionality, that will populate the submission fields based on the selected value (value must be authority controlled).

Exaple of config in cris-authority-metadatagenerator.xml:

<bean class="org.dspace.content.authority.ItemSimpleAuthorityMetadataGenerator">
    <property name="authorityName" value="AuthorAuthority"/>
    <property name="keyId" value="person_identifier_orcid"/>
    <property name="useForDisplay" value="true"/>
    <property name="useAsData" value="true"/>
    <property name="schema" value="person"/>
    <property name="element" value="identifier"/>
    <property name="qualifier" value="orcid"/>
    <property name="singleResultOnAggregate" value="true"/>
</bean>
auto-fill.webm

The information of the related item are previewed via a new pop-up component enabled on hover, visible on both search results and item page:

image image

In addition the PR introduce also multilanguage support for authority controlled vocabularies, to achieve this we need to have a vocabulary version for each language enabled by the property: webui.supported.locales

For instance if we have

webui.supported.locales = en, de

we can create a translated vocabulary (srsc_de in this example) and then configure the authority as follows (authority.cfg):

vocabulary.plugin.srsc.hierarchy.store = true
vocabulary.plugin.srsc.hierarchy.suggest = true
vocabulary.plugin.srsc.delimiter = "::"
vocabulary.plugin.authority.store = true
authority.controlled.dc.subject = true

This will enable to display the translated value in the UI, if the language matches the translated one:

EN:

image

DE:

image

This last feature will be consolidated later in the merger with the cust layout functionality from CRIS (at the moment this is not presente in the exact same way on CRIS as there we rely on the layout feature that is not yet in scope).
The implementation will remain anyway as it will be useful also as fallback for not configured layouts.

Instructions for Reviewers

Once the item relation is enstablished (submitted) the metadata will be linking to the related item, with a preview of metadata visible on link hover.

The new configuration for the pop-hover preview is available in default-app.config.ts, under the name:

metadataLinkViewPopoverData

It provides the opportunity to customize the preview metadata based on entity type.

In submission is possible also to configure specific icons for each source of authority, see config:

sourceIcons (under authority config)

In general for the newly added configuration you can refer to the config.example.yml file.

Once submitted, the authorithy controlled value should then result in a clickable link the search results (if the value is displayed) and in a clickable link in the item page (see images above).

Is possible to configure also auto-fill and generated metadata based on the authority (see descriptio or rest PR).

For the multilanguage support on vocabularies a translated vocabulary and submission form are needed, in addition to the properties based on the vocabulary name and metadata (see description).

List of changes in this PR:

Enhanced search results and item page with linkable related items (authority controlled)
Added new popover component for metadata preview on hover.
Implemented custom pipe for icon/info handling in onebox component.
Improved editing of authority via admin view, improved handling of search filters (filter by authorithy not value).
Implemented auto-fill functionality in submission.
Added support for multilanguage visualization of controlled vocabulary values in item page.

Checklist

This checklist provides a reminder of what we are going to look for when reviewing your PR. You do not need to complete this checklist prior creating your PR (draft PRs are always welcome).
However, reviewers may request that you complete any actions in this list if you have not done so. If you are unsure about an item in the checklist, don't hesitate to ask. We're here to help!

  • My PR is created against the main branch of code (unless it is a backport or is fixing an issue specific to an older branch).
  • My PR is small in size (e.g. less than 1,000 lines of code, not including comments & specs/tests), or I have provided reasons as to why that's not possible.
  • My PR passes ESLint validation using npm run lint
  • My PR doesn't introduce circular dependencies (verified via npm run check-circ-deps)
  • My PR includes TypeDoc comments for all new (or modified) public methods and classes. It also includes TypeDoc for large or complex private methods.
  • My PR passes all specs/tests and includes new/updated specs or tests based on the Code Testing Guide.
  • My PR aligns with Accessibility guidelines if it makes changes to the user interface.
  • My PR uses i18n (internationalization) keys instead of hardcoded English text, to allow for translations.
  • My PR includes details on how to test it. I've provided clear instructions to reviewers on how to successfully test this fix or feature.
  • If my PR includes new libraries/dependencies (in package.json), I've made sure their licenses align with the DSpace BSD License based on the Licensing of Contributions documentation.
  • If my PR includes new features or configurations, I've provided basic technical documentation in the PR itself.
  • If my PR fixes an issue ticket, I've linked them together.

@FrancescoMolinaro FrancescoMolinaro changed the title Task/main/duracom 426 Merger: porting of authority framework functionalities Dec 19, 2025
@tdonohue tdonohue added the DSpace-CRIS merger This ticket/PR relates to the merger of DSpace-CRIS into DSpace. label Jan 8, 2026
@tdonohue tdonohue moved this to 🙋 Needs Reviewers Assigned in DSpace 10.0 Release Jan 8, 2026
@github-actions
Copy link

Hi @FrancescoMolinaro,
Conflicts have been detected against the base branch.
Please resolve these conflicts as soon as you can. Thanks!

@FrancescoMolinaro FrancescoMolinaro marked this pull request as ready for review January 22, 2026 16:50
@artlowel artlowel self-requested a review January 29, 2026 08:27
Copy link
Member

@artlowel artlowel left a comment

Choose a reason for hiding this comment

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

Thanks @FrancescoMolinaro

I haven't tested it yet, just did a code review for now. Most of it looks good, but I have a few inline comments

Comment on lines 726 to 732
followAuthorityMetadataValuesLimit: 5;

# When the search results are retrieved, for each item type the metadata with a valid authority value are inspected.
# Referenced items will be fetched with a find all by id strategy to avoid individual rest requests to efficiently display the search results.
followAuthorityMetadata:
- type: Publication
metadata: dc.contributor.author
Copy link
Member

Choose a reason for hiding this comment

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

These are duplicated above

Comment on lines 102 to 104
/**
* A boolean representing if this Item is currently withdrawn or not
*/
Copy link
Member

Choose a reason for hiding this comment

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

This comment is for something else

# Icons to be displayed next to an authority controlled value, to give indication of the source.
sourceIcons:
# Example of configuration for authority logo based on sources.
# The condigured icon will be displayed next to the authority value in submission and on item page or search results.
Copy link
Member

Choose a reason for hiding this comment

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

Typo: "condigured"

Comment on lines 131 to 138
getExternalSourceEntryById(externalSourceId: string, entryId: string): Observable<RemoteData<ExternalSourceEntry>> {
const href$ = this.getEntryIDHref(externalSourceId, entryId).pipe(
isNotEmptyOperator(),
distinctUntilChanged(),
);

return this.findByHref(href$) as any;
}
Copy link
Member

Choose a reason for hiding this comment

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

This method doesn't seem to be used anywhere

Comment on lines +474 to +483
public findById(id: string, useCachedVersionIfAvailable = true, reRequestOnStale = true, ...linksToFollow: FollowLinkConfig<Item>[]): Observable<RemoteData<Item>> {

if (uuidValidate(id)) {
const href$ = this.getIDHrefObs(encodeURIComponent(id), ...linksToFollow);
return this.findByHref(href$, useCachedVersionIfAvailable, reRequestOnStale, ...linksToFollow);
} else {
return this.findByCustomUrl(id, useCachedVersionIfAvailable, reRequestOnStale, linksToFollow);
}
}

Copy link
Member

Choose a reason for hiding this comment

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

I think this check should be moved to the resolver. findById does one, well defined thing in all dataservices. The resolver should parse the route and determine whether to call findById or findByCustom URL, or even cleaner: move custom URLs to a different subroute, so you can have a separate resolver as well.

Comment on lines 61 to 78
/**
* Returns true if this Metadatum's authority key starts with 'virtual::'
*/
get isVirtual(): boolean {
return hasValue(this.authority) && this.authority.startsWith(VIRTUAL_METADATA_PREFIX);
}

/**
* If this is a virtual Metadatum, it returns everything in the authority key after 'virtual::'.
* Returns undefined otherwise.
*/
get virtualValue(): string {
if (this.isVirtual) {
return this.authority.substring(this.authority.indexOf(VIRTUAL_METADATA_PREFIX) + VIRTUAL_METADATA_PREFIX.length);
} else {
return undefined;
}
}
Copy link
Member

Choose a reason for hiding this comment

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

These methods were moved out of the models, to a service in #2875. In general we want to avoid having methods in models, as they cause issues with caching serialization etc

Comment on lines 189 to 193
tap((isHierarchical: boolean) => {
if (this.model.value) {
this.setCurrentValue(this.model.value, isHierarchical);
}
}),
Copy link
Member

Choose a reason for hiding this comment

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

It's not a good idea to do "work" in a tap(). Because that code will only be executed if something is subscribed to the pipe. It's better to have a dedicated subscription to do the value updates, that way you can be sure it happens every time the source observable updates.

this.orcidUrl$ = this.configurationService
.findByPropertyName('orcid.domain-url')
.pipe(
getFirstSucceededRemoteDataPayload(),
Copy link
Member

Choose a reason for hiding this comment

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

I suspect that, if orcid.domain-url isn't set on the server, there will never be a succeeded remote data, so this will never emit. Better deal with the failed case as well

@github-project-automation github-project-automation bot moved this from 🙋 Needs Reviewers Assigned to 👀 Under Review in DSpace 10.0 Release Jan 29, 2026
@FrancescoMolinaro
Copy link
Contributor Author

Hi @artlowel ,

thank you very much for the review and for the feedback. I have addressed all the points raised, with the exception of the custom URL aspect.

The custom URL functionality originates from #4814. Since this pull request builds upon that work, I believe it would be more appropriate to address any related issue directly within that original PR, if needed.

During the implementation, we chose to place the ID format control within the findById method because route resolvers and guards primarily rely on this method to retrieve item information from UUID/ID parameters in the URL.

Following the referenced PR, when the relevant metadata is present, the custom URL replaces the standard UUID/ID parameter in the page URL and effectively becomes a unique identifier for the item.

For this reason, we considered it preferable to keep the validation logic inside the findById method, as this approach minimizes the impact across the application and avoids the need to modify multiple code paths where the UUID/ID is extracted from the URL.

I would really appreaciate your thoughts on this reasoning and of course if it is not enough to justify the choice made I will make sure to adapt the code accordingly in the referenced pull request.

@tdonohue tdonohue changed the title Merger: porting of authority framework functionalities [DSpace-CRIS] Porting of authority framework functionalities (Frontend) Feb 4, 2026
@github-actions
Copy link

github-actions bot commented Feb 5, 2026

Hi @FrancescoMolinaro,
Conflicts have been detected against the base branch.
Please resolve these conflicts as soon as you can. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

DSpace-CRIS merger This ticket/PR relates to the merger of DSpace-CRIS into DSpace. high priority merge conflict new feature

Projects

Status: 👀 Under Review

Development

Successfully merging this pull request may close these issues.

[DSpace-CRIS] Data model preparation work (Authority Framework enhancements, etc)

3 participants