Skip to content
  •  
  •  
  •  
50 changes: 49 additions & 1 deletion config/config.example.yml
Original file line number Diff line number Diff line change
Expand Up @@ -707,7 +707,7 @@ accessibility:
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.
# Currently only the authority reference config is available, more will follow with the integration of the so called Dynamic layout.
layout:
# Configuration of icons and styles to be used for each authority controlled link
authorityRef:
Expand Down Expand Up @@ -757,6 +757,54 @@ layout:
- name: checksum
type: attribute

# Configuration for URN (Uniform Resource Name) identifier resolution
# Maps identifier types (e.g., DOI, Handle, Scopus) to their base URLs for creating resolvable links
urn:
- name: doi
baseUrl: 'https://doi.org/'
- name: hdl
baseUrl: 'https://hdl.handle.net/'
- name: scopus
baseUrl: 'https://www.scopus.com/authid/detail.uri?authorId='
- name: researcherid
baseUrl: 'http://www.researcherid.com/rid/'
- name: mailto
baseUrl: 'mailto:'

# Item page layout configuration for different entity types
# Defines the visual layout orientation (horizontal/vertical) for various entity types in the item page detail view
itemPage:
OrgUnit:
orientation: vertical
Project:
orientation: vertical
default:
orientation: horizontal

# Metadata box rendering configuration
# Defines default CSS column styles for metadata labels and values in item page detail view
metadataBox:
# CSS classes for metadata label column (default: 'col-3' = 25% width)
defaultMetadataLabelColStyle: col-3
# CSS classes for metadata value column (default: 'col-9' = 75% width)
defaultMetadataValueColStyle: col-9

# Collections box rendering configuration
# Defines default CSS column styles for collections and inline display settings
collectionsBox:
# CSS classes for collection label column (default: 'col-3 fw-bold' = 25% width, bold text)
defaultCollectionsLabelColStyle: col-3 fw-bold
# CSS classes for collection value column (default: 'col-9' = 75% width)
defaultCollectionsValueColStyle: col-9
# CSS classes for collection row styling
# defaultCollectionsRowStyle: ''
# Whether to display collections inline (true) or in a block layout (false)
isInline: true
# Key/Value map to define metadata holding the style information for each entity type
dynamicRefStyleMetadata:
default: 'dspace.entity.style'
Publication: 'example.entity.style'

# Configuration for customization of search results
searchResults:
# Metadata fields to be displayed in the search results under the standard ones
Expand Down
1 change: 1 addition & 0 deletions src/app/app.component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ const initialState = {
export function getMockLocaleService(): LocaleService {
return jasmine.createSpyObj('LocaleService', {
setCurrentLanguageCode: jasmine.createSpy('setCurrentLanguageCode'),
getCurrentLanguageCode: jasmine.createSpy('getCurrentLanguageCode'),
});
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import { RequestService } from '@dspace/core/data/request.service';
import { NotificationsService } from '@dspace/core/notification-system/notifications.service';
import { Collection } from '@dspace/core/shared/collection.model';
import { ItemType } from '@dspace/core/shared/item-relationships/item-type.model';
import { MetadataValue } from '@dspace/core/shared/metadata.models';
import MetadataValue from '@dspace/core/shared/metadata.models';
import { getFirstSucceededRemoteListPayload } from '@dspace/core/shared/operators';
import {
hasNoValue,
Expand Down
2 changes: 1 addition & 1 deletion src/app/core/breadcrumbs/dso-name.service.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Injectable } from '@angular/core';
import { MetadataValue } from '@dspace/core/shared/metadata.models';
import MetadataValue from '@dspace/core/shared/metadata.models';
import {
hasValue,
isEmpty,
Expand Down
2 changes: 1 addition & 1 deletion src/app/core/browse/search-manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ 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 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';
Expand Down
2 changes: 1 addition & 1 deletion src/app/core/browse/search.manager.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { FindListOptions } from '../data/find-list-options.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 MetadataValue from '../shared/metadata.models';
import { AUTHORITY_REFERENCE } from '../shared/metadata.utils';
import { createPaginatedList } from '../testing/utils.test';
import {
Expand Down
2 changes: 1 addition & 1 deletion src/app/core/cookies/browser-orejime.service.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import { ConfigurationDataService } from '../data/configuration-data.service';
import { EPersonDataService } from '../eperson/eperson-data.service';
import { EPerson } from '../eperson/models/eperson.model';
import { ConfigurationProperty } from '../shared/configuration-property.model';
import { MetadataValue } from '../shared/metadata.models';
import MetadataValue from '../shared/metadata.models';
import { getMockTranslateService } from '../testing/translate.service.mock';
import {
createFailedRemoteDataObject$,
Expand Down
4 changes: 4 additions & 0 deletions src/app/core/data-services-map.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ import { GROUP } from './eperson/models/group.resource-type';
import { WORKFLOWITEM } from './eperson/models/workflowitem.resource-type';
import { WORKSPACEITEM } from './eperson/models/workspaceitem.resource-type';
import { FEEDBACK } from './feedback/models/feedback.resource-type';
import { SECTION } from './layout/models/section.resource-type';
import { TAB } from './layout/models/tab.resource-type';
import { METADATA_FIELD } from './metadata/metadata-field.resource-type';
import { METADATA_SCHEMA } from './metadata/metadata-schema.resource-type';
import { QUALITY_ASSURANCE_EVENT_OBJECT } from './notifications/qa/models/quality-assurance-event-object.resource-type';
Expand Down Expand Up @@ -142,4 +144,6 @@ export const LAZY_DATA_SERVICES: LazyDataServicesMap = new Map([
[AUDIT.value, () => import('./data/audit-data.service').then(m => m.AuditDataService)],
[EditItem.type.value, () => import('./submission/edititem-data.service').then(m => m.EditItemDataService)],
[METADATA_SECURITY_TYPE.value, () => import('./submission/metadatasecurityconfig-data.service').then(m => m.MetadataSecurityConfigurationService)],
[SECTION.value, () => import('./layout/section-data.service').then(m => m.SectionDataService)],
[TAB.value, () => import('./layout/tab-data.service').then(m => m.TabDataService)],
]);
155 changes: 155 additions & 0 deletions src/app/core/data/bitstream-data.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,13 @@ import {
} from './request.models';
import { RequestService } from './request.service';

/**
* Filter for metadata value to be used for rest API
*/
export interface MetadataFilter {
metadataName: string;
metadataValue: string;
}
/**
* A service to retrieve {@link Bitstream}s from the REST API
*/
Expand Down Expand Up @@ -379,4 +386,152 @@ export class BitstreamDataService extends IdentifiableDataService<Bitstream> imp
return this.rdbService.buildFromRequestUUIDAndAwait(requestId, () => observableCombineLatest(bitstreams.map((bitstream: Bitstream) => this.invalidateByHref(bitstream._links.self.href))));
}

/**
* Returns an observable of {@link RemoteData} of a {@link Bitstream} that is not marked
* hidden (that hasn't got the metadata `bitstream.hide` or its value is not true/yes).
* resolve {@link HALLink}s of the object
*
* @param uuid The item UUID to retrieve bitstreams from
* @param bundlename Bundle type of the bitstreams
* @param metadataFilters Array of object we want to filter by
* @param options The {@link FindListOptions} for the request
* @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
*/
findShowableBitstreamsByItem(
uuid: string,
bundlename: string,
metadataFilters: MetadataFilter[],
options: FindListOptions = {},
useCachedVersionIfAvailable = true,
reRequestOnStale = true,
...linksToFollow: FollowLinkConfig<Bitstream>[]
): Observable<RemoteData<PaginatedList<Bitstream>>> {
const searchParams = [];
searchParams.push(new RequestParam('uuid', uuid));
searchParams.push(new RequestParam('name', bundlename));

metadataFilters.forEach((entry: MetadataFilter) => {
searchParams.push(new RequestParam('filterMetadata', entry.metadataName));
searchParams.push(new RequestParam('filterMetadataValue', entry.metadataValue));
});

const hrefObs = this.getSearchByHref(
'showableByItem',
{ searchParams },
...linksToFollow,
);

return this.findListByHref(
hrefObs,
options,
useCachedVersionIfAvailable,
reRequestOnStale,
...linksToFollow,
);
}


/**
* Returns an observable of {@link RemoteData} of a {@link Bitstream}, based on a handle and an
* optional sequenceId or filename, with a list of {@link FollowLinkConfig}, to automatically
* resolve {@link HALLink}s of the object
*
* @param uuid The item UUID to retrieve bitstreams from
* @param bundlename Bundle type of the bitstreams
* @param metadataFilters Array of object we want to filter by
* @param options The {@link FindListOptions} for the request
* @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
*/
findByItem(
uuid: string,
bundlename: string,
metadataFilters: MetadataFilter[],
options: FindListOptions,
useCachedVersionIfAvailable = true,
reRequestOnStale = true,
...linksToFollow: FollowLinkConfig<Bitstream>[]
): Observable<RemoteData<PaginatedList<Bitstream>>> {
const searchParams = [];
searchParams.push(new RequestParam('uuid', uuid));
searchParams.push(new RequestParam('name', bundlename));

metadataFilters.forEach((entry: MetadataFilter) => {
searchParams.push(new RequestParam('filterMetadata', entry.metadataName));
searchParams.push(new RequestParam('filterMetadataValue', entry.metadataValue));
});

const hrefObs = this.getSearchByHref(
'byItemId',
{ searchParams },
...linksToFollow,
);

return this.findListByHref(
hrefObs,
options,
useCachedVersionIfAvailable,
reRequestOnStale,
...linksToFollow,
);
}

/**
* Returns an observable of {@link RemoteData} of a {@link Bitstream} that is not marked
* hidden (that hasn't got the metadata `bitstream.hide` or its value is not true/yes).
* resolve {@link HALLink}s of the object
*
* @param uuid The item UUID to retrieve bitstreams from
* @param bundlename Bundle type of the bitstreams
* @param metadataFilters Array of object we want to filter by
* @param options The {@link FindListOptions} for the request
* @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
*/
showableByItem(
uuid: string,
bundlename: string,
metadataFilters: MetadataFilter[],
options: FindListOptions,
useCachedVersionIfAvailable = true,
reRequestOnStale = true,
...linksToFollow: FollowLinkConfig<Bitstream>[]
): Observable<RemoteData<PaginatedList<Bitstream>>> {
const searchParams = [];
searchParams.push(new RequestParam('uuid', uuid));
searchParams.push(new RequestParam('name', bundlename));

metadataFilters.forEach((entry: MetadataFilter) => {
searchParams.push(new RequestParam('filterMetadata', entry.metadataName));
searchParams.push(new RequestParam('filterMetadataValue', entry.metadataValue));
});

const hrefObs = this.getSearchByHref(
'showableByItem',
{ searchParams },
...linksToFollow,
);

return this.findListByHref(
hrefObs,
options,
useCachedVersionIfAvailable,
reRequestOnStale,
...linksToFollow,
);
}

}
5 changes: 1 addition & 4 deletions src/app/core/data/mydspace-response-parsing.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,7 @@ import { hasValue } from '@dspace/shared/utils/empty.util';
import { ParsedResponse } from '../cache/response.models';
import { DSpaceSerializer } from '../dspace-rest/dspace.serializer';
import { RawRestResponse } from '../dspace-rest/raw-rest-response.model';
import {
MetadataMap,
MetadataValue,
} from '../shared/metadata.models';
import MetadataValue, { MetadataMap } from '../shared/metadata.models';
import { SearchObjects } from '../shared/search/models/search-objects.model';
import { DspaceRestResponseParsingService } from './dspace-rest-response-parsing.service';
import { RestRequest } from './rest-request.model';
Expand Down
2 changes: 1 addition & 1 deletion src/app/core/data/relationship-data.service.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { HALEndpointService } from '../shared/hal-endpoint.service';
import { Item } from '../shared/item.model';
import { Relationship } from '../shared/item-relationships/relationship.model';
import { RelationshipType } from '../shared/item-relationships/relationship-type.model';
import { MetadataValue } from '../shared/metadata.models';
import MetadataValue from '../shared/metadata.models';
import { MetadataRepresentationType } from '../shared/metadata-representation/metadata-representation.model';
import { PageInfo } from '../shared/page-info.model';
import { HALEndpointServiceStub } from '../testing/hal-endpoint-service.stub';
Expand Down
2 changes: 1 addition & 1 deletion src/app/core/data/relationship-data.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ import { Item } from '../shared/item.model';
import { Relationship } from '../shared/item-relationships/relationship.model';
import { RelationshipType } from '../shared/item-relationships/relationship-type.model';
import { ReorderableRelationship } from '../shared/item-relationships/reorderable-relationship';
import { MetadataValue } from '../shared/metadata.models';
import MetadataValue from '../shared/metadata.models';
import { ItemMetadataRepresentation } from '../shared/metadata-representation/item/item-metadata-representation.model';
import { MetadataRepresentation } from '../shared/metadata-representation/metadata-representation.model';
import { MetadatumRepresentation } from '../shared/metadata-representation/metadatum/metadatum-representation.model';
Expand Down
5 changes: 1 addition & 4 deletions src/app/core/data/search-response-parsing.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,7 @@ import { hasValue } from '@dspace/shared/utils/empty.util';
import { ParsedResponse } from '../cache/response.models';
import { DSpaceSerializer } from '../dspace-rest/dspace.serializer';
import { RawRestResponse } from '../dspace-rest/raw-rest-response.model';
import {
MetadataMap,
MetadataValue,
} from '../shared/metadata.models';
import MetadataValue, { MetadataMap } from '../shared/metadata.models';
import { SearchObjects } from '../shared/search/models/search-objects.model';
import { DspaceRestResponseParsingService } from './dspace-rest-response-parsing.service';
import { RestRequest } from './rest-request.model';
Expand Down
Loading
Loading