diff --git a/src/app/core/auth/models/auth-status.model.ts b/src/app/core/auth/models/auth-status.model.ts index df6cc5490f..edad46a7bc 100644 --- a/src/app/core/auth/models/auth-status.model.ts +++ b/src/app/core/auth/models/auth-status.model.ts @@ -54,7 +54,7 @@ export class AuthStatus implements CacheableObject { authenticated: boolean; /** - * The HALLinks for this AuthStatus + * The {@link HALLink}s for this AuthStatus */ @deserialize _links: { @@ -64,7 +64,7 @@ export class AuthStatus implements CacheableObject { /** * The EPerson of this auth status - * Will be undefined unless the eperson HALLink has been resolved. + * Will be undefined unless the eperson {@link HALLink} has been resolved. */ @link(EPERSON) eperson?: Observable>; diff --git a/src/app/core/cache/builders/build-decorators.ts b/src/app/core/cache/builders/build-decorators.ts index e8382d02cf..4ba04bfa55 100644 --- a/src/app/core/cache/builders/build-decorators.ts +++ b/src/app/core/cache/builders/build-decorators.ts @@ -86,7 +86,7 @@ export class LinkDefinition { * @param resourceType the resource type of the object(s) the link retrieves * @param isList an optional boolean indicating whether or not it concerns a list, * defaults to false - * @param linkName an optional string in case the HALLink name differs from the + * @param linkName an optional string in case the {@link HALLink} name differs from the * property name */ export const link = ( diff --git a/src/app/core/cache/builders/link.service.ts b/src/app/core/cache/builders/link.service.ts index 87f8eabd92..c41a5484a1 100644 --- a/src/app/core/cache/builders/link.service.ts +++ b/src/app/core/cache/builders/link.service.ts @@ -7,7 +7,7 @@ import { getDataServiceFor, getLinkDefinition, getLinkDefinitions, LinkDefinitio /** * A Service to handle the resolving and removing - * of resolved HALLinks on HALResources + * of resolved {@link HALLink}s on HALResources */ @Injectable({ providedIn: 'root' diff --git a/src/app/core/cache/builders/remote-data-build.service.ts b/src/app/core/cache/builders/remote-data-build.service.ts index 46b5f28465..94c660d672 100644 --- a/src/app/core/cache/builders/remote-data-build.service.ts +++ b/src/app/core/cache/builders/remote-data-build.service.ts @@ -38,7 +38,7 @@ export class RemoteDataBuildService { * Creates a single {@link RemoteData} object based on the response of a request to the REST server, with a list of * {@link FollowLinkConfig} that indicate which embedded info should be added to the object * @param href$ Observable href of object we want to retrieve - * @param linksToFollow List of {@link FollowLinkConfig} that indicate which HALLinks should be automatically resolved + * @param linksToFollow List of {@link FollowLinkConfig} that indicate which {@link HALLink}s should be automatically resolved */ buildSingle(href$: string | Observable, ...linksToFollow: Array>): Observable> { if (typeof href$ === 'string') { @@ -122,7 +122,7 @@ export class RemoteDataBuildService { * Creates a list of {@link RemoteData} objects based on the response of a request to the REST server, with a list of * {@link FollowLinkConfig} that indicate which embedded info should be added to the objects * @param href$ Observable href of objects we want to retrieve - * @param linksToFollow List of {@link FollowLinkConfig} that indicate which HALLinks should be automatically resolved + * @param linksToFollow List of {@link FollowLinkConfig} that indicate which {@link HALLink}s should be automatically resolved */ buildList(href$: string | Observable, ...linksToFollow: Array>): Observable>> { if (typeof href$ === 'string') { diff --git a/src/app/core/config/models/config-submission-section.model.ts b/src/app/core/config/models/config-submission-section.model.ts index 5a9c3225ab..d8249297b1 100644 --- a/src/app/core/config/models/config-submission-section.model.ts +++ b/src/app/core/config/models/config-submission-section.model.ts @@ -43,7 +43,7 @@ export class SubmissionSectionModel extends ConfigObject { visibility: SubmissionSectionVisibility; /** - * The HALLinks for this SubmissionSectionModel + * The {@link HALLink}s for this SubmissionSectionModel */ @deserialize _links: { diff --git a/src/app/core/data/bitstream-data.service.ts b/src/app/core/data/bitstream-data.service.ts index e1d55598e4..408dceb56e 100644 --- a/src/app/core/data/bitstream-data.service.ts +++ b/src/app/core/data/bitstream-data.service.ts @@ -25,12 +25,18 @@ import { RemoteDataError } from './remote-data-error'; import { FindListOptions } from './request.models'; import { RequestService } from './request.service'; +/** + * A service to retrieve {@link Bitstream}s from the REST API + */ @Injectable({ providedIn: 'root' }) @dataService(BITSTREAM) export class BitstreamDataService extends DataService { + /** + * The HAL path to the bitstream endpoint + */ protected linkPath = 'bitstreams'; constructor( @@ -49,7 +55,7 @@ export class BitstreamDataService extends DataService { } /** - * Retrieves the bitstreams in a given bundle + * Retrieves the {@link Bitstream}s in a given bundle * * @param bundle the bundle to retrieve bitstreams from * @param options options for the find all request @@ -60,9 +66,9 @@ export class BitstreamDataService extends DataService { /** * Retrieves the thumbnail for the given item - * @returns {Observable>} the first bitstream in the THUMBNAIL bundle + * @returns {Observable>} the first bitstream in the THUMBNAIL bundle */ - // TODO should be implemented rest side. Item should get a thumbnail link + // TODO should be implemented rest side. {@link Item} should get a thumbnail link public getThumbnailFor(item: Item): Observable> { return this.bundleService.findByItemAndName(item, 'THUMBNAIL').pipe( switchMap((bundleRD: RemoteData) => { @@ -89,6 +95,15 @@ export class BitstreamDataService extends DataService { ); } + /** + * Retrieve the matching thumbnail for a {@link Bitstream}. + * + * The {@link Item} is technically redundant, but is available + * in all current use cases, and having it simplifies this method + * + * @param item The {@link Item} the {@link Bitstream} and its thumbnail are a part of + * @param bitstreamInOriginal The original {@link Bitstream} to find the thumbnail for + */ // TODO should be implemented rest side public getMatchingThumbnail(item: Item, bitstreamInOriginal: Bitstream): Observable> { return this.bundleService.findByItemAndName(item, 'THUMBNAIL').pipe( @@ -129,6 +144,17 @@ export class BitstreamDataService extends DataService { ); } + /** + * Retrieve all {@link Bitstream}s in a certain {@link Bundle}. + * + * The {@link Item} is technically redundant, but is available + * in all current use cases, and having it simplifies this method + * + * @param item the {@link Item} the {@link Bundle} is a part of + * @param bundleName the name of the {@link Bundle} we want to find {@link Bitstream}s for + * @param options the {@link FindListOptions} for the request + * @param linksToFollow the {@link FollowLinkConfig}s for the request + */ public findAllByItemAndBundleName(item: Item, bundleName: string, options?: FindListOptions, ...linksToFollow: Array>): Observable>> { return this.bundleService.findByItemAndName(item, bundleName).pipe( switchMap((bundleRD: RemoteData) => { diff --git a/src/app/core/data/bundle-data.service.ts b/src/app/core/data/bundle-data.service.ts index 5a5d52b637..64d58eb8ec 100644 --- a/src/app/core/data/bundle-data.service.ts +++ b/src/app/core/data/bundle-data.service.ts @@ -22,7 +22,7 @@ import { FindListOptions } from './request.models'; import { RequestService } from './request.service'; /** - * A service responsible for fetching/sending data from/to the REST API on the bundles endpoint + * A service to retrieve {@link Bundle}s from the REST API */ @Injectable( {providedIn: 'root'} @@ -43,10 +43,24 @@ export class BundleDataService extends DataService { super(); } + /** + * Retrieve all {@link Bundle}s in the given {@link Item} + * + * @param item the {@link Item} the {@link Bundle}s are a part of + * @param options the {@link FindListOptions} for the request + * @param linksToFollow the {@link FollowLinkConfig}s for the request + */ findAllByItem(item: Item, options?: FindListOptions, ...linksToFollow: Array>): Observable>> { return this.findAllByHref(item._links.bundles.href, options, ...linksToFollow); } + /** + * Retrieve a {@link Bundle} in the given {@link Item} by name + * + * @param item the {@link Item} the {@link Bundle}s are a part of + * @param bundleName the name of the {@link Bundle} to retrieve + * @param linksToFollow the {@link FollowLinkConfig}s for the request + */ // TODO should be implemented rest side findByItemAndName(item: Item, bundleName: string, ...linksToFollow: Array>): Observable> { return this.findAllByItem(item, { elementsPerPage: Number.MAX_SAFE_INTEGER }, ...linksToFollow).pipe( diff --git a/src/app/core/data/collection-data.service.ts b/src/app/core/data/collection-data.service.ts index 4c64b0a60b..6ae40f4ca9 100644 --- a/src/app/core/data/collection-data.service.ts +++ b/src/app/core/data/collection-data.service.ts @@ -209,7 +209,7 @@ export class CollectionDataService extends ComColDataService { * Fetches a list of items that are mapped to a collection * @param collectionId The id of the collection * @param searchOptions Search options to sort or filter out items - * @param linksToFollow List of {@link FollowLinkConfig} that indicate which HALLinks should be automatically resolved + * @param linksToFollow List of {@link FollowLinkConfig} that indicate which {@link HALLink}s should be automatically resolved */ getMappedItems(collectionId: string, searchOptions?: PaginatedSearchOptions, ...linksToFollow: Array>): Observable>> { const requestUuid = this.requestService.generateRequestId(); diff --git a/src/app/core/data/data.service.ts b/src/app/core/data/data.service.ts index 5d0b8774e1..3be1ef9768 100644 --- a/src/app/core/data/data.service.ts +++ b/src/app/core/data/data.service.ts @@ -152,7 +152,7 @@ export abstract class DataService { /** * Returns {@link RemoteData} of all object with a list of {@link FollowLinkConfig}, to indicate which embedded * info should be added to the objects - * @param linksToFollow List of {@link FollowLinkConfig} that indicate which HALLinks should be automatically resolved + * @param linksToFollow List of {@link FollowLinkConfig} that indicate which {@link HALLink}s should be automatically resolved */ findAll(options: FindListOptions = {}, ...linksToFollow: Array>): Observable>> { return this.findList(this.getFindAllHref(options), options, ...linksToFollow); @@ -160,9 +160,9 @@ export abstract class DataService { /** * Returns an observable of {@link RemoteData} of an object, based on href observable, - * with a list of {@link FollowLinkConfig}, to automatically resolve HALLinks of the object + * with a list of {@link FollowLinkConfig}, to automatically resolve {@link HALLink}s of the object * @param href$ Observable of href of object we want to retrieve - * @param linksToFollow List of {@link FollowLinkConfig} that indicate which HALLinks should be automatically resolved + * @param linksToFollow List of {@link FollowLinkConfig} that indicate which {@link HALLink}s should be automatically resolved */ protected findList(href$, options: FindListOptions, ...linksToFollow: Array>) { href$.pipe( @@ -189,9 +189,9 @@ export abstract class DataService { /** * Returns an observable of {@link RemoteData} of an object, based on its ID, with a list of {@link FollowLinkConfig}, - * to automatically resolve HALLinks of the object + * to automatically resolve {@link HALLink}s of the object * @param id ID of object we want to retrieve - * @param linksToFollow List of {@link FollowLinkConfig} that indicate which HALLinks should be automatically resolved + * @param linksToFollow List of {@link FollowLinkConfig} that indicate which {@link HALLink}s should be automatically resolved */ findById(id: string, ...linksToFollow: Array>): Observable> { @@ -213,9 +213,9 @@ export abstract class DataService { /** * Returns an observable of {@link RemoteData} of an object, based on an href, with a list of {@link FollowLinkConfig}, - * to automatically resolve HALLinks of the object - * @param href Href of object we want to retrieve - * @param linksToFollow List of {@link FollowLinkConfig} that indicate which HALLinks should be automatically resolved + * to automatically resolve {@link HALLink}s of the object + * @param href The url of object we want to retrieve + * @param linksToFollow List of {@link FollowLinkConfig} that indicate which {@link HALLink}s should be automatically resolved */ findByHref(href: string, ...linksToFollow: Array>): Observable> { const requestHref = this.buildHrefFromFindOptions(href, {}, []); @@ -229,9 +229,9 @@ export abstract class DataService { /** * Returns a list of observables of {@link RemoteData} of objects, based on an href, with a list of {@link FollowLinkConfig}, - * to automatically resolve HALLinks of the object - * @param id ID of object we want to retrieve - * @param linksToFollow List of {@link FollowLinkConfig} that indicate which HALLinks should be automatically resolved + * to automatically resolve {@link HALLink}s of the object + * @param href The url of object we want to retrieve + * @param linksToFollow List of {@link FollowLinkConfig} that indicate which {@link HALLink}s should be automatically resolved */ findAllByHref(href: string, findListOptions: FindListOptions = {}, ...linksToFollow: Array>): Observable>> { const requestHref = this.buildHrefFromFindOptions(href, findListOptions, []); diff --git a/src/app/core/data/entity-type-data.service.ts b/src/app/core/data/entity-type-data.service.ts index 80b6beed81..87de69b935 100644 --- a/src/app/core/data/entity-type-data.service.ts +++ b/src/app/core/data/entity-type-data.service.ts @@ -19,6 +19,10 @@ import { FindListOptions } from './request.models'; import { RequestService } from './request.service'; /* tslint:disable:max-classes-per-file */ + +/** + * A private DataService implementation to delegate specific methods to. + */ class DataServiceImpl extends DataService { protected linkPath = 'entitytypes'; @@ -35,9 +39,15 @@ class DataServiceImpl extends DataService { } } +/** + * A service to retrieve {@link ItemType}s from the REST API. + */ @Injectable() @dataService(ITEM_TYPE) export class ItemTypeDataService { + /** + * A private DataService instance to delegate specific methods to. + */ private dataService: DataServiceImpl; constructor( @@ -53,20 +63,20 @@ export class ItemTypeDataService { } /** - * Returns an observable of {@link RemoteData} of an object, based on an href, with a list of {@link FollowLinkConfig}, - * to automatically resolve HALLinks of the object - * @param href Href of object we want to retrieve - * @param linksToFollow List of {@link FollowLinkConfig} that indicate which HALLinks should be automatically resolved + * Returns an observable of {@link RemoteData} of an {@link ItemType}, based on an href, with a list of {@link FollowLinkConfig}, + * to automatically resolve {@link HALLink}s of the {@link ItemType} + * @param href The url of {@link ItemType} we want to retrieve + * @param linksToFollow List of {@link FollowLinkConfig} that indicate which {@link HALLink}s should be automatically resolved */ findByHref(href: string, ...linksToFollow: Array>): Observable> { return this.dataService.findByHref(href, ...linksToFollow); } /** - * Returns a list of observables of {@link RemoteData} of objects, based on an href, with a list of {@link FollowLinkConfig}, - * to automatically resolve HALLinks of the object - * @param id ID of object we want to retrieve - * @param linksToFollow List of {@link FollowLinkConfig} that indicate which HALLinks should be automatically resolved + * Returns a list of observables of {@link RemoteData} of {@link ItemType}s, based on an href, with a list of {@link FollowLinkConfig}, + * to automatically resolve {@link HALLink}s of the {@link ItemType} + * @param href The url of the {@link ItemType} we want to retrieve + * @param linksToFollow List of {@link FollowLinkConfig} that indicate which {@link HALLink}s should be automatically resolved */ findByAllHref(href: string, findListOptions: FindListOptions = {}, ...linksToFollow: Array>): Observable>> { return this.dataService.findAllByHref(href, findListOptions, ...linksToFollow); diff --git a/src/app/core/data/entity-type.service.ts b/src/app/core/data/entity-type.service.ts index 5726aeb982..b8e8b7cd9a 100644 --- a/src/app/core/data/entity-type.service.ts +++ b/src/app/core/data/entity-type.service.ts @@ -54,7 +54,7 @@ export class EntityTypeService extends DataService { /** * Get the allowed relationship types for an entity type * @param entityTypeId - * @param linksToFollow List of {@link FollowLinkConfig} that indicate which HALLinks should be automatically resolved + * @param linksToFollow List of {@link FollowLinkConfig} that indicate which {@link HALLink}s should be automatically resolved */ getEntityTypeRelationships(entityTypeId: string, ...linksToFollow: Array>): Observable>> { diff --git a/src/app/core/data/license-data.service.ts b/src/app/core/data/license-data.service.ts index 24b77a41a6..23637be596 100644 --- a/src/app/core/data/license-data.service.ts +++ b/src/app/core/data/license-data.service.ts @@ -19,6 +19,10 @@ import { FindListOptions } from './request.models'; import { RequestService } from './request.service'; /* tslint:disable:max-classes-per-file */ + +/** + * A private DataService implementation to delegate specific methods to. + */ class DataServiceImpl extends DataService { protected linkPath = ''; @@ -35,9 +39,15 @@ class DataServiceImpl extends DataService { } } +/** + * A service to retrieve {@link License}s from the REST API. + */ @Injectable() @dataService(LICENSE) export class LicenseDataService { + /** + * A private DataService instance to delegate specific methods to. + */ private dataService: DataServiceImpl; constructor( @@ -52,10 +62,22 @@ export class LicenseDataService { this.dataService = new DataServiceImpl(requestService, rdbService, null, objectCache, halService, notificationsService, http, comparator); } + /** + * Returns an observable of {@link RemoteData} of a {@link License}, based on an href, with a list of {@link FollowLinkConfig}, + * to automatically resolve {@link HALLink}s of the {@link License} + * @param href The URL of object we want to retrieve + * @param linksToFollow List of {@link FollowLinkConfig} that indicate which {@link HALLink}s should be automatically resolved + */ findByHref(href: string, ...linksToFollow: Array>): Observable> { return this.dataService.findByHref(href, ...linksToFollow); } + /** + * Returns a list of observables of {@link RemoteData} of {@link License}s, based on an href, with a list of {@link FollowLinkConfig}, + * to automatically resolve {@link HALLink}s of the {@link License} + * @param href The URL of object we want to retrieve + * @param linksToFollow List of {@link FollowLinkConfig} that indicate which {@link HALLink}s should be automatically resolved + */ findByAllHref(href: string, findListOptions: FindListOptions = {}, ...linksToFollow: Array>): Observable>> { return this.dataService.findAllByHref(href, findListOptions, ...linksToFollow); } diff --git a/src/app/core/data/resource-policy.service.ts b/src/app/core/data/resource-policy.service.ts index 9401168984..f66032925e 100644 --- a/src/app/core/data/resource-policy.service.ts +++ b/src/app/core/data/resource-policy.service.ts @@ -23,6 +23,10 @@ import { DefaultChangeAnalyzer } from '../data/default-change-analyzer.service'; import { PaginatedList } from './paginated-list'; /* tslint:disable:max-classes-per-file */ + +/** + * A private DataService implementation to delegate specific methods to. + */ class DataServiceImpl extends DataService { protected linkPath = 'resourcepolicies'; @@ -59,14 +63,32 @@ export class ResourcePolicyService { this.dataService = new DataServiceImpl(requestService, rdbService, null, objectCache, halService, notificationsService, http, comparator); } + /** + * Returns an observable of {@link RemoteData} of a {@link ResourcePolicy}, based on an href, with a list of {@link FollowLinkConfig}, + * to automatically resolve {@link HALLink}s of the {@link ResourcePolicy} + * @param href The url of {@link ResourcePolicy} we want to retrieve + * @param linksToFollow List of {@link FollowLinkConfig} that indicate which {@link HALLink}s should be automatically resolved + */ findByHref(href: string, ...linksToFollow: Array>): Observable> { return this.dataService.findByHref(href, ...linksToFollow); } + /** + * Returns a list of observables of {@link RemoteData} of {@link ResourcePolicy}s, based on an href, with a list of {@link FollowLinkConfig}, + * to automatically resolve {@link HALLink}s of the {@link ResourcePolicy} + * @param href The url of the {@link ResourcePolicy} we want to retrieve + * @param linksToFollow List of {@link FollowLinkConfig} that indicate which {@link HALLink}s should be automatically resolved + */ findAllByHref(href: string, findListOptions: FindListOptions = {}, ...linksToFollow: Array>): Observable>> { return this.dataService.findAllByHref(href, findListOptions, ...linksToFollow); } + /** + * Return the defaultAccessConditions {@link ResourcePolicy} list for a given {@link Collection} + * + * @param collection the {@link Collection} to retrieve the defaultAccessConditions for + * @param findListOptions the {@link FindListOptions} for the request + */ getDefaultAccessConditionsFor(collection: Collection, findListOptions?: FindListOptions): Observable>> { return this.dataService.findAllByHref(collection._links.defaultAccessConditions.href, findListOptions); } diff --git a/src/app/core/eperson/eperson-data.service.ts b/src/app/core/eperson/eperson-data.service.ts index 2c1a27f4e5..f41cfc3ca0 100644 --- a/src/app/core/eperson/eperson-data.service.ts +++ b/src/app/core/eperson/eperson-data.service.ts @@ -13,6 +13,9 @@ import { HALEndpointService } from '../shared/hal-endpoint.service'; import { EPerson } from './models/eperson.model'; import { EPERSON } from './models/eperson.resource-type'; +/** + * A service to retrieve {@link EPerson}s from the REST API + */ @Injectable() @dataService(EPERSON) export class EPersonDataService extends DataService { diff --git a/src/app/core/eperson/models/eperson.model.ts b/src/app/core/eperson/models/eperson.model.ts index a0e6266311..bb99022112 100644 --- a/src/app/core/eperson/models/eperson.model.ts +++ b/src/app/core/eperson/models/eperson.model.ts @@ -71,7 +71,7 @@ export class EPerson extends DSpaceObject { /** * The list of Groups this EPerson is part of - * Will be undefined unless the groups HALLink has been resolved. + * Will be undefined unless the groups {@link HALLink} has been resolved. */ @link(GROUP, true) public groups?: Observable>>; diff --git a/src/app/core/eperson/models/group.model.ts b/src/app/core/eperson/models/group.model.ts index 3dae9bf864..5d531800b8 100644 --- a/src/app/core/eperson/models/group.model.ts +++ b/src/app/core/eperson/models/group.model.ts @@ -26,7 +26,7 @@ export class Group extends DSpaceObject { public permanent: boolean; /** - * The HALLinks for this Group + * The {@link HALLink}s for this Group */ @deserialize _links: { @@ -36,7 +36,7 @@ export class Group extends DSpaceObject { /** * The list of Groups this Group is part of - * Will be undefined unless the groups HALLink has been resolved. + * Will be undefined unless the groups {@link HALLink} has been resolved. */ @link(GROUP, true) public groups?: Observable>>; diff --git a/src/app/core/integration/models/authority.value.ts b/src/app/core/integration/models/authority.value.ts index 9fb64a2555..4e0183603b 100644 --- a/src/app/core/integration/models/authority.value.ts +++ b/src/app/core/integration/models/authority.value.ts @@ -47,7 +47,7 @@ export class AuthorityValue extends IntegrationModel implements MetadataValueInt language: string; /** - * The HALLinks for this AuthorityValue + * The {@link HALLink}s for this AuthorityValue */ @deserialize _links: { diff --git a/src/app/core/metadata/metadata-field.model.ts b/src/app/core/metadata/metadata-field.model.ts index 44a0f14e82..ad7ec59b25 100644 --- a/src/app/core/metadata/metadata-field.model.ts +++ b/src/app/core/metadata/metadata-field.model.ts @@ -49,7 +49,7 @@ export class MetadataField extends ListableObject implements HALResource { scopeNote: string; /** - * The HALLinks for this MetadataField + * The {@link HALLink}s for this MetadataField */ @deserialize _links: { @@ -59,7 +59,7 @@ export class MetadataField extends ListableObject implements HALResource { /** * The MetadataSchema for this MetadataField - * Will be undefined unless the schema HALLink has been resolved. + * Will be undefined unless the schema {@link HALLink} has been resolved. */ // TODO the responseparsingservice assumes schemas are always embedded. This should use remotedata, and be a link instead. // @link(METADATA_SCHEMA) diff --git a/src/app/core/registry/registry-bitstreamformats-response.model.ts b/src/app/core/registry/registry-bitstreamformats-response.model.ts index 0e346db03d..4da30b4ffc 100644 --- a/src/app/core/registry/registry-bitstreamformats-response.model.ts +++ b/src/app/core/registry/registry-bitstreamformats-response.model.ts @@ -10,7 +10,7 @@ export class RegistryBitstreamformatsResponse { page: PageInfo; /** - * The HALLinks for this RegistryBitstreamformatsResponse + * The {@link HALLink}s for this RegistryBitstreamformatsResponse */ @deserialize _links: { diff --git a/src/app/core/shared/bitstream-format.model.ts b/src/app/core/shared/bitstream-format.model.ts index 1fdb707aaf..8aeba1e3cd 100644 --- a/src/app/core/shared/bitstream-format.model.ts +++ b/src/app/core/shared/bitstream-format.model.ts @@ -75,7 +75,7 @@ export class BitstreamFormat implements CacheableObject { id: string; /** - * The HALLinks for this BitstreamFormat + * The {@link HALLink}s for this BitstreamFormat */ @deserialize _links: { diff --git a/src/app/core/shared/bitstream.model.ts b/src/app/core/shared/bitstream.model.ts index d4060f96a6..231d44eeff 100644 --- a/src/app/core/shared/bitstream.model.ts +++ b/src/app/core/shared/bitstream.model.ts @@ -33,7 +33,7 @@ export class Bitstream extends DSpaceObject implements HALResource { bundleName: string; /** - * The HALLinks for this Bitstream + * The {@link HALLink}s for this Bitstream */ @deserialize _links: { @@ -45,14 +45,14 @@ export class Bitstream extends DSpaceObject implements HALResource { /** * The thumbnail for this Bitstream - * Needs to be resolved first, but isn't available as a HALLink yet + * Needs to be resolved first, but isn't available as a {@link HALLink} yet * Use BitstreamDataService.getThumbnailFor(…) for now. */ thumbnail?: Observable>; /** * The BitstreamFormat of this Bitstream - * Will be undefined unless the format HALLink has been resolved. + * Will be undefined unless the format {@link HALLink} has been resolved. */ @link(BITSTREAM_FORMAT) format?: Observable>; diff --git a/src/app/core/shared/bundle.model.ts b/src/app/core/shared/bundle.model.ts index c2fb25f5b7..c1164f0fc4 100644 --- a/src/app/core/shared/bundle.model.ts +++ b/src/app/core/shared/bundle.model.ts @@ -10,7 +10,7 @@ export class Bundle extends DSpaceObject { static type = BUNDLE; /** - * The HALLinks for this Bundle + * The {@link HALLink}s for this Bundle */ @deserialize _links: { diff --git a/src/app/core/shared/collection.model.ts b/src/app/core/shared/collection.model.ts index 33a8fd444e..d5c6221428 100644 --- a/src/app/core/shared/collection.model.ts +++ b/src/app/core/shared/collection.model.ts @@ -25,7 +25,7 @@ export class Collection extends DSpaceObject { handle: string; /** - * The HALLinks for this Collection + * The {@link HALLink}s for this Collection */ @deserialize _links: { @@ -40,21 +40,21 @@ export class Collection extends DSpaceObject { /** * The license for this Collection - * Will be undefined unless the license HALLink has been resolved. + * Will be undefined unless the license {@link HALLink} has been resolved. */ @link(LICENSE) license?: Observable>; /** * The logo for this Collection - * Will be undefined unless the logo HALLink has been resolved. + * Will be undefined unless the logo {@link HALLink} has been resolved. */ @link(BITSTREAM) logo?: Observable>; /** * The default access conditions for this Collection - * Will be undefined unless the defaultAccessConditions HALLink has been resolved. + * Will be undefined unless the defaultAccessConditions {@link HALLink} has been resolved. */ @link(RESOURCE_POLICY, true) defaultAccessConditions?: Observable>>; diff --git a/src/app/core/shared/community.model.ts b/src/app/core/shared/community.model.ts index 66e71176f3..703c4b3eef 100644 --- a/src/app/core/shared/community.model.ts +++ b/src/app/core/shared/community.model.ts @@ -23,7 +23,7 @@ export class Community extends DSpaceObject { handle: string; /** - * The HALLinks for this Community + * The {@link HALLink}s for this Community */ @deserialize _links: { @@ -35,21 +35,21 @@ export class Community extends DSpaceObject { /** * The logo for this Community - * Will be undefined unless the logo HALLink has been resolved. + * Will be undefined unless the logo {@link HALLink} has been resolved. */ @link(BITSTREAM) logo?: Observable>; /** * The list of Collections that are direct children of this Community - * Will be undefined unless the collections HALLink has been resolved. + * Will be undefined unless the collections {@link HALLink} has been resolved. */ @link(COLLECTION, true) collections?: Observable>>; /** * The list of Communities that are direct children of this Community - * Will be undefined unless the subcommunities HALLink has been resolved. + * Will be undefined unless the subcommunities {@link HALLink} has been resolved. */ @link(COMMUNITY, true) subcommunities?: Observable>>; diff --git a/src/app/core/shared/content-source.model.ts b/src/app/core/shared/content-source.model.ts index 82cacd91ed..3e530b6a3a 100644 --- a/src/app/core/shared/content-source.model.ts +++ b/src/app/core/shared/content-source.model.ts @@ -55,7 +55,7 @@ export class ContentSource implements HALResource { metadataConfigs: MetadataConfig[]; /** - * The HALLinks for this ContentSource + * The {@link HALLink}s for this ContentSource */ @deserialize _links: { diff --git a/src/app/core/shared/external-source-entry.model.ts b/src/app/core/shared/external-source-entry.model.ts index 876ca12f83..5836a01138 100644 --- a/src/app/core/shared/external-source-entry.model.ts +++ b/src/app/core/shared/external-source-entry.model.ts @@ -53,7 +53,7 @@ export class ExternalSourceEntry extends ListableObject { metadata: MetadataMap; /** - * The HALLinks for this ExternalSourceEntry + * The {@link HALLink}s for this ExternalSourceEntry */ @deserialize _links: { diff --git a/src/app/core/shared/external-source.model.ts b/src/app/core/shared/external-source.model.ts index 718ac4ff49..5005fbcd36 100644 --- a/src/app/core/shared/external-source.model.ts +++ b/src/app/core/shared/external-source.model.ts @@ -39,7 +39,7 @@ export class ExternalSource extends CacheableObject { hierarchical: boolean; /** - * The HALLinks for this ExternalSource + * The {@link HALLink}s for this ExternalSource */ @deserialize _links: { diff --git a/src/app/core/shared/hal-link.model.ts b/src/app/core/shared/hal-link.model.ts index 32c4c7c99f..88a136a4b2 100644 --- a/src/app/core/shared/hal-link.model.ts +++ b/src/app/core/shared/hal-link.model.ts @@ -1,5 +1,23 @@ +/** + * A single link in the _links section of a {@link HALResource} + */ export class HALLink { + + /** + * The url of the {@link HALLink}'s target + */ href: string; + + /** + * The name of the {@link HALLink} + */ name?: string; + + /** + * A boolean indicating whether the href contains a template. + * + * e.g. if href is "http://haltalk.herokuapp.com/docs/{rel}" + * {rel} would be the template + */ templated?: boolean } diff --git a/src/app/core/shared/hal-resource.model.ts b/src/app/core/shared/hal-resource.model.ts index d42484febb..b6ef822a23 100644 --- a/src/app/core/shared/hal-resource.model.ts +++ b/src/app/core/shared/hal-resource.model.ts @@ -1,8 +1,23 @@ import { HALLink } from './hal-link.model'; +/** + * Represents HAL resources. + * + * A HAL resource has a _links section with at least a self link. + */ export class HALResource { + /** + * The {@link HALLink}s for this {@link HALResource} + */ _links: { + /** + * The {@link HALLink} that refers to this {@link HALResource} + */ self: HALLink + + /** + * {@link HALLink}s to related {@link HALResource}s + */ [k: string]: HALLink; }; } diff --git a/src/app/core/shared/item-relationships/item-type.model.ts b/src/app/core/shared/item-relationships/item-type.model.ts index 7ff7ba9e74..d41024cdaa 100644 --- a/src/app/core/shared/item-relationships/item-type.model.ts +++ b/src/app/core/shared/item-relationships/item-type.model.ts @@ -39,7 +39,7 @@ export class ItemType implements CacheableObject { uuid: string; /** - * The HALLinks for this ItemType + * The {@link HALLink}s for this ItemType */ @deserialize _links: { diff --git a/src/app/core/shared/item-relationships/relationship-type.model.ts b/src/app/core/shared/item-relationships/relationship-type.model.ts index 437203bd51..fb62f685dd 100644 --- a/src/app/core/shared/item-relationships/relationship-type.model.ts +++ b/src/app/core/shared/item-relationships/relationship-type.model.ts @@ -82,7 +82,7 @@ export class RelationshipType implements CacheableObject { rightMinCardinality: number; /** - * The HALLinks for this RelationshipType + * The {@link HALLink}s for this RelationshipType */ @deserialize _links: { @@ -93,14 +93,14 @@ export class RelationshipType implements CacheableObject { /** * The type of Item found on the left side of this RelationshipType - * Will be undefined unless the leftType HALLink has been resolved. + * Will be undefined unless the leftType {@link HALLink} has been resolved. */ @link(ITEM_TYPE) leftType?: Observable>; /** * The type of Item found on the right side of this RelationshipType - * Will be undefined unless the rightType HALLink has been resolved. + * Will be undefined unless the rightType {@link HALLink} has been resolved. */ @link(ITEM_TYPE) rightType?: Observable>; diff --git a/src/app/core/shared/item-relationships/relationship.model.ts b/src/app/core/shared/item-relationships/relationship.model.ts index 4103208d89..97a5db9e37 100644 --- a/src/app/core/shared/item-relationships/relationship.model.ts +++ b/src/app/core/shared/item-relationships/relationship.model.ts @@ -66,7 +66,7 @@ export class Relationship implements CacheableObject { rightwardValue: string; /** - * The HALLinks for this Relationship + * The {@link HALLink}s for this Relationship */ @deserialize _links: { @@ -78,21 +78,21 @@ export class Relationship implements CacheableObject { /** * The item on the left side of this relationship - * Will be undefined unless the leftItem HALLink has been resolved. + * Will be undefined unless the leftItem {@link HALLink} has been resolved. */ @link(ITEM) leftItem?: Observable>; /** * The item on the right side of this relationship - * Will be undefined unless the rightItem HALLink has been resolved. + * Will be undefined unless the rightItem {@link HALLink} has been resolved. */ @link(ITEM) rightItem?: Observable>; /** * The RelationshipType for this Relationship - * Will be undefined unless the relationshipType HALLink has been resolved. + * Will be undefined unless the relationshipType {@link HALLink} has been resolved. */ @link(RELATIONSHIP_TYPE) relationshipType?: Observable>; diff --git a/src/app/core/shared/item.model.ts b/src/app/core/shared/item.model.ts index 8f5038585d..3fd35280da 100644 --- a/src/app/core/shared/item.model.ts +++ b/src/app/core/shared/item.model.ts @@ -57,7 +57,7 @@ export class Item extends DSpaceObject { isWithdrawn: boolean; /** - * The HALLinks for this Item + * The {@link HALLink}s for this Item */ @deserialize _links: { @@ -71,21 +71,21 @@ export class Item extends DSpaceObject { /** * The owning Collection for this Item - * Will be undefined unless the owningCollection HALLink has been resolved. + * Will be undefined unless the owningCollection {@link HALLink} has been resolved. */ @link(COLLECTION) owningCollection?: Observable>; /** * The list of Bundles inside this Item - * Will be undefined unless the bundles HALLink has been resolved. + * Will be undefined unless the bundles {@link HALLink} has been resolved. */ @link(BUNDLE, true) bundles?: Observable>>; /** * The list of Relationships this Item has with others - * Will be undefined unless the relationships HALLink has been resolved. + * Will be undefined unless the relationships {@link HALLink} has been resolved. */ @link(RELATIONSHIP, true) relationships?: Observable>>; diff --git a/src/app/core/shared/page-info.model.ts b/src/app/core/shared/page-info.model.ts index d05080bfbb..ccb0aae471 100644 --- a/src/app/core/shared/page-info.model.ts +++ b/src/app/core/shared/page-info.model.ts @@ -33,7 +33,7 @@ export class PageInfo implements HALResource { currentPage: number; /** - * The HALLinks for this PageInfo + * The {@link HALLink}s for this PageInfo */ @deserialize _links: { diff --git a/src/app/core/shared/resource-policy.model.ts b/src/app/core/shared/resource-policy.model.ts index 29f901c35b..dd00a16e97 100644 --- a/src/app/core/shared/resource-policy.model.ts +++ b/src/app/core/shared/resource-policy.model.ts @@ -49,7 +49,7 @@ export class ResourcePolicy implements CacheableObject { uuid: string; /** - * The HALLinks for this ResourcePolicy + * The {@link HALLink}s for this ResourcePolicy */ @deserialize _links: { diff --git a/src/app/core/submission/models/submission-object.model.ts b/src/app/core/submission/models/submission-object.model.ts index 3a50484d76..87ea19653d 100644 --- a/src/app/core/submission/models/submission-object.model.ts +++ b/src/app/core/submission/models/submission-object.model.ts @@ -39,7 +39,7 @@ export abstract class SubmissionObject extends DSpaceObject implements Cacheable /** * The collection this submission applies to - * Will be undefined unless the collection HALLink has been resolved. + * Will be undefined unless the collection {@link HALLink} has been resolved. */ @link(COLLECTION) collection?: Observable> | Collection; @@ -57,7 +57,7 @@ export abstract class SubmissionObject extends DSpaceObject implements Cacheable errors: SubmissionObjectError[]; /** - * The HALLinks for this SubmissionObject + * The {@link HALLink}s for this SubmissionObject */ @deserialize _links: { @@ -74,20 +74,20 @@ export abstract class SubmissionObject extends DSpaceObject implements Cacheable /** * The submission item - * Will be undefined unless the item HALLink has been resolved. + * Will be undefined unless the item {@link HALLink} has been resolved. */ @link(ITEM) item?: Observable> | Item; /** * The configuration object that define this submission - * Will be undefined unless the submissionDefinition HALLink has been resolved. + * Will be undefined unless the submissionDefinition {@link HALLink} has been resolved. */ @link(SubmissionDefinitionsModel.type) submissionDefinition?: Observable> | SubmissionDefinitionsModel; /** * The submitter for this SubmissionObject - * Will be undefined unless the submitter HALLink has been resolved. + * Will be undefined unless the submitter {@link HALLink} has been resolved. */ @link(EPERSON) submitter?: Observable> | EPerson; diff --git a/src/app/core/submission/submission-object-data.service.ts b/src/app/core/submission/submission-object-data.service.ts index 0348559eed..0b6d65c758 100644 --- a/src/app/core/submission/submission-object-data.service.ts +++ b/src/app/core/submission/submission-object-data.service.ts @@ -28,7 +28,7 @@ export class SubmissionObjectDataService { * Retrieve a submission object based on its ID. * * @param id The identifier of a submission object - * @param linksToFollow List of {@link FollowLinkConfig} that indicate which HALLinks should be automatically resolved + * @param linksToFollow List of {@link FollowLinkConfig} that indicate which {@link HALLink}s should be automatically resolved */ findById(id: string, ...linksToFollow: Array>): Observable> { switch (this.submissionService.getSubmissionScope()) { diff --git a/src/app/core/submission/submission-response-parsing.service.ts b/src/app/core/submission/submission-response-parsing.service.ts index a37d7c4f49..27a7e43c46 100644 --- a/src/app/core/submission/submission-response-parsing.service.ts +++ b/src/app/core/submission/submission-response-parsing.service.ts @@ -12,8 +12,6 @@ import { BaseResponseParsingService } from '../data/base-response-parsing.servic import { GLOBAL_CONFIG } from '../../../config'; import { GlobalConfig } from '../../../config/global-config.interface'; import { ObjectCacheService } from '../cache/object-cache.service'; -import { Serializer } from '../serializer'; -import { GenericConstructor } from '../shared/generic-constructor'; import { FormFieldMetadataValueObject } from '../../shared/form/builder/models/form-field-metadata-value.model'; import { SubmissionObject } from './models/submission-object.model'; import { WorkflowItem } from './models/workflowitem.model'; @@ -78,6 +76,17 @@ export function normalizeSectionData(obj: any, objIndex?: number) { export class SubmissionResponseParsingService extends BaseResponseParsingService implements ResponseParsingService { protected toCache = false; + + /** + * The submission assumes certain related HALResources will always be embedded. + * It only works if the responseparser finds these embedded resources, and directly + * attaches them to the requested object, instead of putting them in the cache and + * treating them as separate objects. This boolean was added to allow us to disable + * that behavior for the rest of the application, while keeping it for the submission. + * + * It should be removed after the submission has been refactored to treat embeds as + * resources that may need to be retrieved separately. + */ protected shouldDirectlyAttachEmbeds = true; constructor(@Inject(GLOBAL_CONFIG) protected EnvConfig: GlobalConfig, diff --git a/src/app/core/tasks/models/task-object.model.ts b/src/app/core/tasks/models/task-object.model.ts index 2e035f134e..ac659ca9e5 100644 --- a/src/app/core/tasks/models/task-object.model.ts +++ b/src/app/core/tasks/models/task-object.model.ts @@ -40,7 +40,7 @@ export class TaskObject extends DSpaceObject implements CacheableObject { action: string; /** - * The HALLinks for this TaskObject + * The {@link HALLink}s for this TaskObject */ @deserialize _links: { @@ -52,21 +52,21 @@ export class TaskObject extends DSpaceObject implements CacheableObject { /** * The EPerson for this task - * Will be undefined unless the eperson HALLink has been resolved. + * Will be undefined unless the eperson {@link HALLink} has been resolved. */ @link(EPERSON) eperson?: Observable>; /** * The Group for this task - * Will be undefined unless the group HALLink has been resolved. + * Will be undefined unless the group {@link HALLink} has been resolved. */ @link(GROUP) group?: Observable>; /** * The WorkflowItem for this task - * Will be undefined unless the workflowitem HALLink has been resolved. + * Will be undefined unless the workflowitem {@link HALLink} has been resolved. */ @link(WorkflowItem.type) workflowitem?: Observable> | WorkflowItem; diff --git a/src/app/shared/mydspace-actions/workspaceitem/workspaceitem-actions.component.ts b/src/app/shared/mydspace-actions/workspaceitem/workspaceitem-actions.component.ts index 5f2f31c53e..2378c8e251 100644 --- a/src/app/shared/mydspace-actions/workspaceitem/workspaceitem-actions.component.ts +++ b/src/app/shared/mydspace-actions/workspaceitem/workspaceitem-actions.component.ts @@ -54,10 +54,6 @@ export class WorkspaceitemActionsComponent extends MyDSpaceActionsComponent extends ListableObject { hitHighlights: MetadataMap; /** - * The HALLinks for this SearchResult + * The {@link HALLink}s for this SearchResult */ @deserialize _links: { diff --git a/src/app/shared/utils/follow-link-config.model.ts b/src/app/shared/utils/follow-link-config.model.ts index d42ed7bb3f..21df288690 100644 --- a/src/app/shared/utils/follow-link-config.model.ts +++ b/src/app/shared/utils/follow-link-config.model.ts @@ -2,12 +2,12 @@ import { FindListOptions } from '../../core/data/request.models'; import { HALResource } from '../../core/shared/hal-resource.model'; /** - * A class to configure the retrieval of a HALLink + * A class to configure the retrieval of a {@link HALLink} */ export class FollowLinkConfig { /** * The name of the link to fetch. - * Can only be a HALLink of the object you're working with + * Can only be a {@link HALLink} of the object you're working with */ name: keyof R['_links']; @@ -30,7 +30,7 @@ export class FollowLinkConfig { * in order to create them in a less verbose way. * * @param linkName: the name of the link to fetch. - * Can only be a HALLink of the object you're working with + * Can only be a {@link HALLink} of the object you're working with * @param findListOptions: {@link FindListOptions} for the query, * allows you to resolve the link using a certain page, or sorted * in a certain way