Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 2 additions & 0 deletions src/app/core/provide-core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import {
makeEnvironmentProviders,
} from '@angular/core';
import { APP_CONFIG } from '@dspace/config/app-config.interface';
import { Identifier } from '@dspace/core/shared/identifiers-data/identifier.model';
import { SubmissionCustomUrl } from '@dspace/core/submission/models/submission-custom-url.model';

import { Audit } from './audit/model/audit.model';
Expand Down Expand Up @@ -199,6 +200,7 @@ export const models =
ResearcherProfile,
OrcidQueue,
OrcidHistory,
Identifier,
IdentifierData,
Subscription,
ItemRequest,
Expand Down
12 changes: 11 additions & 1 deletion src/app/core/shared/identifiers-data/identifier.model.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,28 @@
import { typedObject } from '@dspace/core/cache/builders/build-decorators';
import { IDENTIFIER } from '@dspace/core/shared/identifiers-data/identifier.resource-type';
import { autoserialize } from 'cerialize';

/**
* Identifier model. Identifiers using this model are returned in lists from the /item/{id}/identifiers endpoint
*
* @author Kim Shepherd
*/
@typedObject
export class Identifier {
static type = IDENTIFIER;

/**
* Unique ID for this identifier object
*/
@autoserialize
id: string;
/**
* The value of the identifier, eg. http://hdl.handle.net/123456789/123 or https://doi.org/test/doi/1234
*/
@autoserialize
value: string;
/**
* The type of identiifer, eg. "doi", or "handle", or "other"
* The type of identifier, eg. "doi", or "handle", or "other"
*/
@autoserialize
identifierType: string;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { ResourceType } from '@dspace/core/shared/resource-type';

/**
* The resource type for Identifier
*
* Needs to be in a separate file to prevent circular
* dependencies in webpack.
*/
export const IDENTIFIER = new ResourceType('identifier');
Original file line number Diff line number Diff line change
Expand Up @@ -88,12 +88,14 @@ const mockItem = Object.assign(new Item(), {
// Mock identifier data to use with tests
const identifierData: WorkspaceitemSectionIdentifiersObject = {
identifiers: [{
id: 'https://doi.org/10.33515/dspace-61',
value: 'https://doi.org/10.33515/dspace-61',
identifierType: 'doi',
identifierStatus: 'TO_BE_REGISTERED',
type: 'identifier',
},
{
id: '123456789/418',
value: '123456789/418',
identifierType: 'handle',
identifierStatus: null,
Expand Down
Loading