Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 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
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
94 changes: 94 additions & 0 deletions config/config.example.yml
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,12 @@ submission:
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 @@ -641,3 +647,91 @@ geospatialMapViewer:
accessibility:
# The duration in days after which the accessibility settings cookie expires
cookieExpirationDuration: 7

# Configuration for custom 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

# 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

# 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.*

# 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

# 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
11 changes: 4 additions & 7 deletions scripts/sync-i18n-files.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,11 @@ function parseCliInput() {
.option('-o, --output-file <output>', 'where output of script ends up; mutually exclusive with -i')
.usage('([-d <output-dir>] [-s <source-file>]) || (-t <target-file> (-i | -o <output>) [-s <source-file>])')
.parse(process.argv);

const sourceFile = program.opts().sourceFile;

if (!program.targetFile) {
if (!program.targetFile) {
fs.readdirSync(projectRoot(LANGUAGE_FILES_LOCATION)).forEach(file => {
if (!sourceFile.toString().endsWith(file)) {
if (program.opts().sourceFile && !program.opts().sourceFile.toString().endsWith(file)) {
const targetFileLocation = projectRoot(LANGUAGE_FILES_LOCATION + "/" + file);
console.log('Syncing file at: ' + targetFileLocation + ' with source file at: ' + sourceFile);
console.log('Syncing file at: ' + targetFileLocation + ' with source file at: ' + program.opts().sourceFile);
if (program.outputDir) {
if (!fs.existsSync(program.outputDir)) {
fs.mkdirSync(program.outputDir);
Expand All @@ -69,7 +66,7 @@ function parseCliInput() {
console.log(program.outputHelp());
process.exit(1);
}
if (!checkIfFileExists(sourceFile)) {
if (!checkIfFileExists(program.opts().sourceFile)) {
console.error('Path of source file is not valid.');
console.log(program.outputHelp());
process.exit(1);
Expand Down
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
11 changes: 11 additions & 0 deletions src/app/core/data/external-source-data.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,17 @@ export class ExternalSourceDataService extends IdentifiableDataService<ExternalS
);
}

/**
* Get the endpoint for an external source's entryValues by given entry id
* @param externalSourceId The id of the external source to fetch entry for
* @param entryId The id of the external source entry to retrieve
*/
getEntryIDHref(externalSourceId: string, entryId: string): Observable<string> {
return this.getBrowseEndpoint().pipe(
map((href) => href + '/' + externalSourceId + '/entryValues/' + entryId),
);
}

/**
* Get the entries for an external source
* @param externalSourceId The id of the external source to fetch entries for
Expand Down
13 changes: 8 additions & 5 deletions src/app/core/json-patch/builder/json-patch-operations-builder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,14 @@ export class JsonPatchOperationsBuilder {
* A boolean representing if the value to be added is the first of an array
* @param plain
* A boolean representing if the value to be added is a plain text value
* @param languages
*/
add(path: JsonPatchOperationPathObject, value, first = false, plain = false) {
add(path: JsonPatchOperationPathObject, value, first = false, plain = false, languages: string[] = null) {
this.store.dispatch(
new NewPatchAddOperationAction(
path.rootElement,
path.subRootElement,
path.path, this.prepareValue(value, plain, first)));
path.path, this.prepareValue(value, plain, first, languages)));
}

/**
Expand All @@ -63,8 +64,10 @@ export class JsonPatchOperationsBuilder {
* the value to update the referenced path
* @param plain
* a boolean representing if the value to be added is a plain text value
* @param securityLevel
* @param language
*/
replace(path: JsonPatchOperationPathObject, value, plain = false) {
replace(path: JsonPatchOperationPathObject, value, plain = false, language = null) {
if (hasNoValue(value) || (typeof value === 'object' && hasNoValue(value.value))) {
this.remove(path);
} else {
Expand All @@ -73,7 +76,7 @@ export class JsonPatchOperationsBuilder {
path.rootElement,
path.subRootElement,
path.path,
this.prepareValue(value, plain, false)));
this.prepareValue(value, plain, false, language)));
}
}

Expand Down Expand Up @@ -124,7 +127,7 @@ export class JsonPatchOperationsBuilder {
path.path));
}

protected prepareValue(value: any, plain: boolean, first: boolean) {
protected prepareValue(value: any, plain: boolean, first: boolean, languages: string[] = null) {
let operationValue: any = null;
if (hasValue(value)) {
if (plain) {
Expand Down
14 changes: 14 additions & 0 deletions src/app/core/shared/dspace-object.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,20 @@ export class DSpaceObject extends ListableObject implements CacheableObject {
return Metadata.all(this.metadata, keyOrKeys, undefined, valueFilter, escapeHTML);
}


/**
* Gets all matching metadata in this DSpaceObject, up to a limit.
*
* @param {string|string[]} keyOrKeys The metadata key(s) in scope. Wildcards are supported; see [[Metadata]].
* @param {number} limit The maximum number of results to return.
* @param {MetadataValueFilter} valueFilter The value filter to use. If unspecified, no filtering will be done.
* @returns {MetadataValue[]} the matching values or an empty array.
*/
limitedMetadata(keyOrKeys: string | string[], limit: number, valueFilter?: MetadataValueFilter): MetadataValue[] {
return Metadata.all(this.metadata, keyOrKeys, null, valueFilter, false, limit);
}


/**
* Like [[allMetadata]], but only returns string values.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import {
MetadataValueInterface,
VIRTUAL_METADATA_PREFIX,
} from '../../metadata.models';
import { Metadata } from '../../metadata.utils';
import { PLACEHOLDER_PARENT_METADATA } from '../ds-dynamic-form-constants';

export interface OtherInformation {
Expand Down Expand Up @@ -48,7 +49,7 @@ export class FormFieldMetadataValueObject implements MetadataValueInterface {
this.display = display || value;

this.confidence = confidence;
if (authority != null && (isEmpty(confidence) || confidence === -1)) {
if (Metadata.hasValidAuthority(authority) && (isEmpty(confidence) || confidence === -1)) {
this.confidence = ConfidenceType.CF_ACCEPTED;
} else if (isNotEmpty(confidence)) {
this.confidence = confidence;
Expand All @@ -68,7 +69,7 @@ export class FormFieldMetadataValueObject implements MetadataValueInterface {
* Returns true if this this object has an authority value
*/
hasAuthority(): boolean {
return isNotEmpty(this.authority);
return Metadata.hasValidAuthority(this.authority);
}

/**
Expand Down
3 changes: 3 additions & 0 deletions src/app/core/shared/form/models/form-field.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,9 @@ export class FormFieldModel {
@autoserialize
value: any;

/**
* The visibility object for this field
*/
@autoserialize
visibility: SectionVisibility;
}
7 changes: 7 additions & 0 deletions src/app/core/shared/item.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,13 @@ export class Item extends DSpaceObject implements ChildHALResource, HandleObject
@autoserializeAs(Boolean, 'withdrawn')
isWithdrawn: boolean;

/**
* A string representing the entity type of this Item
*/
Comment on lines 102 to 104
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

@autoserializeAs(String, 'entityType')
entityType: string;


/**
* The {@link HALLink}s for this Item
*/
Expand Down
6 changes: 5 additions & 1 deletion src/app/core/shared/metadata.models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {
} from 'cerialize';
import { v4 as uuidv4 } from 'uuid';


export const VIRTUAL_METADATA_PREFIX = 'virtual::';

/** A single metadata value and its properties. */
Expand Down Expand Up @@ -55,7 +56,6 @@ export class MetadataValue implements MetadataValueInterface {
/** The authority confidence value */
@autoserialize
confidence: number;

}

/** Constraints for matching metadata values. */
Expand All @@ -74,6 +74,10 @@ export interface MetadataValueFilter {

/** Whether the value constraint should match as a substring. */
substring?: boolean;
/**
* Whether to negate the filter
*/
negate?: boolean;
}

export class MetadatumViewModel {
Expand Down
63 changes: 60 additions & 3 deletions src/app/core/shared/metadata.utils.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,19 +50,20 @@ const multiViewModelList = [
{ key: 'foo', ...bar, order: 0 },
];

const testMethod = (fn, resultKind, mapOrMaps, keyOrKeys, hitHighlights, expected, filter?) => {
const testMethod = (fn, resultKind, mapOrMaps, keyOrKeys, hitHighlights, expected, filter?, limit?: number) => {
const keys = keyOrKeys instanceof Array ? keyOrKeys : [keyOrKeys];
describe('and key' + (keys.length === 1 ? (' ' + keys[0]) : ('s ' + JSON.stringify(keys)))
+ ' with ' + (isUndefined(filter) ? 'no filter' : 'filter ' + JSON.stringify(filter)), () => {
const result = fn(mapOrMaps, keys, hitHighlights, filter);
const result = fn(mapOrMaps, keys, hitHighlights, filter, true, limit);
let shouldReturn;
if (resultKind === 'boolean') {
shouldReturn = expected;
} else if (isUndefined(expected)) {
shouldReturn = 'undefined';
} else if (expected instanceof Array) {
shouldReturn = 'an array with ' + expected.length + ' ' + (expected.length > 1 ? 'ordered ' : '')
+ resultKind + (expected.length !== 1 ? 's' : '');
+ resultKind + (expected.length !== 1 ? 's' : '')
+ (isUndefined(limit) ? '' : ' (limited to ' + limit + ')');
} else {
shouldReturn = 'a ' + resultKind;
}
Expand Down Expand Up @@ -255,4 +256,60 @@ describe('Metadata', () => {

});

describe('all method with limit', () => {
const testAllWithLimit = (mapOrMaps, keyOrKeys, expected, limit) =>
testMethod(Metadata.all, 'value', mapOrMaps, keyOrKeys, undefined, expected, undefined, limit);

describe('with multiMap and limit', () => {
testAllWithLimit(multiMap, 'dc.title', [dcTitle1], 1);
});
});

describe('hasValue method', () => {
const testHasValue = (value, expected) =>
testMethod(Metadata.hasValue, 'boolean', value, undefined, undefined, expected);

describe('with undefined value', () => {
testHasValue(undefined, false);
});
describe('with null value', () => {
testHasValue(null, false);
});
describe('with string value', () => {
testHasValue('test', true);
});
describe('with empty string value', () => {
testHasValue('', false);
});
describe('with undefined value for a MetadataValue object', () => {
const value: Partial<MetadataValue> = {
value: undefined,
};
testHasValue(value, false);
});
describe('with null value for a MetadataValue object', () => {
const value: Partial<MetadataValue> = {
value: null,
};
testHasValue(value, false);
});
describe('with empty string for a MetadataValue object', () => {
const value: Partial<MetadataValue> = {
value: '',
};
testHasValue(value, false);
});
describe('with value for a MetadataValue object', () => {
const value: Partial<MetadataValue> = {
value: 'test',
};
testHasValue(value, true);
});
describe('with a generic object', () => {
const value: any = {
test: 'test',
};
testHasValue(value, true);
});
});
});
Loading
Loading