Skip to content
Merged
Show file tree
Hide file tree
Changes from 38 commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
bf14771
[DURACOM-413] port custom url functionality
FrancescoMolinaro Nov 12, 2025
66bd310
Merge remote-tracking branch 'gitHub/main' into task/main/DURACOM-413
FrancescoMolinaro Nov 13, 2025
b42bf55
[DURACOM-413] additional tests
FrancescoMolinaro Nov 13, 2025
e88a40d
[DURACOM-413] update labels, fix sync script, adapt section handling
FrancescoMolinaro Nov 18, 2025
c93cb50
[DURACOM-413] update error handling/validation + resync translations
FrancescoMolinaro Nov 19, 2025
75937c4
Merge remote-tracking branch 'gitHub/main' into task/main/DURACOM-413
FrancescoMolinaro Dec 5, 2025
d1c1ecf
[DURACOM-413] fix lint
FrancescoMolinaro Dec 5, 2025
8bdfd01
[DURACOM-426] init integration of authority framework
FrancescoMolinaro Dec 10, 2025
a9dc8ec
Merge branch 'task/main/DURACOM-413' into task/main/DURACOM-426
FrancescoMolinaro Dec 12, 2025
8c073ff
[DURACOM-426] port metadata link components for authorithy
FrancescoMolinaro Dec 15, 2025
d262480
[DURACOM-426] fix some tests
FrancescoMolinaro Dec 15, 2025
9c5e6bb
[DURACOM-426] fix some unit tests
FrancescoMolinaro Dec 16, 2025
a514b6e
[DURACOM-426] fix tests and lint
FrancescoMolinaro Dec 16, 2025
a9ee4e5
[DURACOM-426] add authority link for md representation
FrancescoMolinaro Dec 16, 2025
306029c
Merge remote-tracking branch 'gitHub/main' into task/main/DURACOM-426
FrancescoMolinaro Dec 18, 2025
36c77fe
[DURACOM-426] clean up, add example, minor restyle, fix templates
FrancescoMolinaro Dec 18, 2025
e9f3df5
[DURACOM-426] improve tests
FrancescoMolinaro Dec 18, 2025
5b6fa80
[DURACOM-426] refactor
FrancescoMolinaro Dec 19, 2025
b29dc1e
[DURACOM-426] improve title configurability in popover, add link view…
FrancescoMolinaro Jan 15, 2026
3f35069
[DURACOM-426] add labels, fix facets labels,fix onebox other info tem…
FrancescoMolinaro Jan 16, 2026
1258bc2
[DURACOM-426] filter data labels
FrancescoMolinaro Jan 19, 2026
36e34a2
[DURACOM-426] revert changes to lables, except for english
FrancescoMolinaro Jan 19, 2026
d2c0749
[DURACOM-426] add config example, remove unnecessary config
FrancescoMolinaro Jan 19, 2026
1aef155
[DURACOM-426] clean config, add labels
FrancescoMolinaro Jan 19, 2026
995ff87
[DURACOM-426] add authority enrichment
FrancescoMolinaro Jan 21, 2026
efc488a
[DURACOM-426] fix tests
FrancescoMolinaro Jan 21, 2026
252c249
[DURACOM-426] fix test and model update
FrancescoMolinaro Jan 22, 2026
e316b11
[DURACOM-426] add vocabulary template in item field, adapt tests
FrancescoMolinaro Jan 22, 2026
317c1ee
Merge remote-tracking branch 'gitHub/main' into task/main/DURACOM-426
FrancescoMolinaro Jan 23, 2026
be381eb
[DURACOM-426] fix lint
FrancescoMolinaro Jan 23, 2026
a19ef43
[DURACOM-426] refactor
FrancescoMolinaro Jan 29, 2026
837b47e
Merge remote-tracking branch 'gitHub/main' into task/main/DURACOM-426
FrancescoMolinaro Feb 6, 2026
ca4edf7
Merge remote-tracking branch 'gitHub/main' into task/main/DURACOM-426
FrancescoMolinaro Feb 12, 2026
a15ad30
[DURACOM-426] remove unused method and duplicated config example
FrancescoMolinaro Feb 12, 2026
5160bf9
[DURACOM-426] revert changes to sync script
FrancescoMolinaro Feb 12, 2026
4575977
[DURACOM-426] fix authority link layout
FrancescoMolinaro Feb 20, 2026
d8a3873
[DURACOM-426] config refactor, add typesdoc, fix popover issue, fix s…
FrancescoMolinaro Feb 26, 2026
c37f216
[DURACOM-426] fix test
FrancescoMolinaro Feb 26, 2026
15ff78d
[DURACOM-426] accessibility fixes, fix issue with sticky popover dire…
FrancescoMolinaro Mar 5, 2026
f9389d4
[DURACOM-426] fix identifier for form removal
FrancescoMolinaro Mar 12, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
90 changes: 89 additions & 1 deletion config/config.example.yml
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,12 @@ submission:
- value: default
style: text-muted
icon: fa-circle-xmark

# 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 configured icon will be displayed next to the authority value in submission and on item page or search results.
- source: orcid
- path: assets/images/orcid.logo.icon.svg
# Fallback language in which the UI will be rendered if the user's browser language is not an active language
fallbackLanguage: en

Expand Down Expand Up @@ -393,6 +398,30 @@ item:
pageSize: 5
# Show the bitstream access status label on the item page
showAccessStatuses: false
# Configuration of metadata to be displayed in the item metadata link view popover
metadataLinkViewPopoverData:
# Metdadata list to be displayed for entities without a specific configuration
fallbackMetdataList:
- dc.description.abstract
- dc.description.note
# Configuration for each entity type
entityDataConfig:
- entityType: Person
# Descriptive metadata (popover body)
metadataList:
- person.affiliation.name
- person.email
# Title metadata (popover header)
titleMetadataList:
- person.givenName
- person.familyName
# Configuration for identifier subtypes, based on metadata like dc.identifier.ror where ror is the subtype.
# This is used to map the layout of the identifier in the popover and the icon displayed next to the metadata value.
identifierSubtypes:
- name: ror
icon: assets/images/ror.logo.icon.svg
iconPosition: IdentifierSubtypesIconPositionEnum.LEFT
link: https://ror.org

# Community Page Config
community:
Expand Down Expand Up @@ -641,3 +670,62 @@ geospatialMapViewer:
accessibility:
# The duration in days after which the accessibility settings cookie expires
cookieExpirationDuration: 7

# Configuration for layout customization of metadata rendering in Item page
# Currently only the authority reference config is available, more will follow with the integration of the so called CRIS layout.
layout:
# Configuration of icons and styles to be used for each authority controlled link
authorityRef:
- entityType: DEFAULT
entityStyle:
default:
icon: fa fa-user
style: text-info
- entityType: PERSON
entityStyle:
person:
icon: fa fa-user
style: text-success
default:
icon: fa fa-user
style: text-info
- entityType: ORGUNIT
entityStyle:
default:
icon: fa fa-university
style: text-success
- entityType: PROJECT
entityStyle:
default:
icon: fas fa-project-diagram
style: text-success

# Configuration for customization of search results
searchResults:
# Metadata fields to be displayed in the search results under the standard ones
additionalMetadataFields:
- dc.contributor.author
- dc.date.issued
- dc.type
# Metadata fields to be displayed in the search results for the author section
authorMetadata:
- dc.contributor.author
- dc.creator
- dc.contributor.*
# 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
- type: Product
metadata: dc.contributor.author

# The maximum number of item to process when following authority metadata values.
followAuthorityMaxItemLimit: 100

# The maximum number of metadata values to process for each metadata key
# when following authority metadata values.
followAuthorityMetadataValuesLimit: 5


Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ export class BrowseByTaxonomyComponent implements OnInit, OnChanges, OnDestroy {
this.selectedItems = [];
this.facetType = browseDefinition.facetType;
this.vocabularyName = browseDefinition.vocabulary;
this.vocabularyOptions = { name: this.vocabularyName, closed: true };
this.vocabularyOptions = { name: this.vocabularyName, metadata: null, scope: null, closed: true };
this.description = this.translate.instant(`browse.metadata.${this.vocabularyName}.tree.description`);
}));
this.subs.push(this.scope$.subscribe(() => {
Expand Down
151 changes: 151 additions & 0 deletions src/app/core/browse/search-manager.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,151 @@
import { Injectable } from '@angular/core';
import { FollowAuthorityMetadata } from '@dspace/config/search-follow-metadata.interface';
import {
hasValue,
isNotEmpty,
} from '@dspace/shared/utils/empty.util';
import isArray from 'lodash/isArray';
import {
Observable,
of,
} from 'rxjs';
import {
map,
switchMap,
} from 'rxjs/operators';
import { SearchService } from 'src/app/shared/search/search.service';

import { environment } from '../../../environments/environment';
import { ItemDataService } from '../data/item-data.service';
import { PaginatedList } from '../data/paginated-list.model';
import { RemoteData } from '../data/remote-data';
import { WORKFLOWITEM } from '../eperson/models/workflowitem.resource-type';
import { WORKSPACEITEM } from '../eperson/models/workspaceitem.resource-type';
import { DSpaceObject } from '../shared/dspace-object.model';
import { FollowLinkConfig } from '../shared/follow-link-config.model';
import { Item } from '../shared/item.model';
import { ITEM } from '../shared/item.resource-type';
import { MetadataValue } from '../shared/metadata.models';
import { Metadata } from '../shared/metadata.utils';
import { getFirstCompletedRemoteData } from '../shared/operators';
import { PaginatedSearchOptions } from '../shared/search/models/paginated-search-options.model';
import { SearchObjects } from '../shared/search/models/search-objects.model';
import { BrowseService } from './browse.service';

/**
* The service aims to manage browse requests and subsequent extra fetch requests.
*/
@Injectable({ providedIn: 'root' })
export class SearchManager {

constructor(
protected itemService: ItemDataService,
protected browseService: BrowseService,
protected searchService: SearchService,
) {
}

/**
* Method to retrieve a paginated list of search results from the server
* @param {PaginatedSearchOptions} searchOptions The configuration necessary to perform this search
* @param responseMsToLive The amount of milliseconds for the response to live in cache
* @param useCachedVersionIfAvailable If this is true, the request will only be sent if there's
* no valid cached version. Defaults to true
* @param reRequestOnStale Whether or not the request should automatically be re-requested after
* the response becomes stale
* @param linksToFollow List of {@link FollowLinkConfig} that indicate which {@link HALLink}s should be automatically resolved
* @returns {Observable<RemoteData<SearchObjects<T>>>} Emits a paginated list with all search results found
*/
search<T extends DSpaceObject>(
searchOptions?: PaginatedSearchOptions,
responseMsToLive?: number,
useCachedVersionIfAvailable = true,
reRequestOnStale = true,
...linksToFollow: FollowLinkConfig<T>[]): Observable<RemoteData<SearchObjects<T>>> {
return this.searchService.search(searchOptions, responseMsToLive, useCachedVersionIfAvailable, reRequestOnStale, ...linksToFollow)
.pipe(this.completeSearchObjectsWithExtraData());
}


protected completeWithExtraData() {
return switchMap((itemsRD: RemoteData<PaginatedList<Item>>) => {
if (itemsRD.isSuccess) {
return this.fetchExtraData(itemsRD.payload.page).pipe(map(() => {
return itemsRD;
}));
}
return of(itemsRD);
});
}

protected completeSearchObjectsWithExtraData<T extends DSpaceObject>() {
return switchMap((searchObjectsRD: RemoteData<SearchObjects<T>>) => {
if (searchObjectsRD.isSuccess) {
const items: Item[] = searchObjectsRD.payload.page
.map((searchResult) => isNotEmpty(searchResult?._embedded?.indexableObject) ? searchResult._embedded.indexableObject : searchResult.indexableObject) as any;
return this.fetchExtraData(items).pipe(map(() => {
return searchObjectsRD;
}));
}
return of(searchObjectsRD);
});
}

protected fetchExtraData<T extends DSpaceObject>(objects: T[]): Observable<any> {

const items: Item[] = objects
.map((object: any) => {
if (object.type === ITEM.value) {
return object as Item;
} else if (object.type === WORKSPACEITEM.value || object.type === WORKFLOWITEM.value) {
return object?._embedded?.item as Item;
} else {
// Handle workflow task here, where the item is embedded in a workflowitem
return object?._embedded?.workflowitem?._embedded?.item as Item;
}

})
.filter((item) => hasValue(item));

const uuidList = this.extractUUID(items, environment.searchResult.followAuthorityMetadata, environment.searchResult.followAuthorityMaxItemLimit);

return uuidList.length > 0 ? this.itemService.findAllById(uuidList).pipe(
getFirstCompletedRemoteData(),
map(data => {
if (data.hasSucceeded) {
return of(data);
} else {
of(null);
}
}),
) : of(null);
}

protected extractUUID(items: Item[], metadataToFollow: FollowAuthorityMetadata[], numberOfElementsToReturn?: number): string[] {
const uuidMap = {};

items.forEach((item) => {
metadataToFollow.forEach((followMetadata: FollowAuthorityMetadata) => {
if (item.entityType === followMetadata.type) {
if (isArray(followMetadata.metadata)) {
followMetadata.metadata.forEach((metadata) => {
Metadata.all(item.metadata, metadata, null, null, false, environment.searchResult.followAuthorityMetadataValuesLimit)
.filter((metadataValue: MetadataValue) => Metadata.hasValidItemAuthority(metadataValue.authority))
.forEach((metadataValue: MetadataValue) => uuidMap[metadataValue.authority] = metadataValue);
});
} else {
Metadata.all(item.metadata, followMetadata.metadata, null, null, false, environment.searchResult.followAuthorityMetadataValuesLimit)
.filter((metadataValue: MetadataValue) => Metadata.hasValidItemAuthority(metadataValue.authority))
.forEach((metadataValue: MetadataValue) => uuidMap[metadataValue.authority] = metadataValue);
}
}
});
});

if (hasValue(numberOfElementsToReturn) && numberOfElementsToReturn > 0) {
return Object.keys(uuidMap).slice(0, numberOfElementsToReturn);
}

return Object.keys(uuidMap);
}
}
Loading
Loading