mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 18:14:17 +00:00
feat: fix services lazy loading
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
import { distinctUntilChanged, take, withLatestFrom } from 'rxjs/operators';
|
import { distinctUntilChanged, take, withLatestFrom } from 'rxjs/operators';
|
||||||
import { DOCUMENT, isPlatformBrowser, AsyncPipe } from '@angular/common';
|
import { DOCUMENT, isPlatformBrowser } from '@angular/common';
|
||||||
import {
|
import {
|
||||||
AfterViewInit,
|
AfterViewInit,
|
||||||
ChangeDetectionStrategy,
|
ChangeDetectionStrategy,
|
||||||
@@ -27,19 +27,15 @@ import { isAuthenticationBlocking } from './core/auth/selectors';
|
|||||||
import { AuthService } from './core/auth/auth.service';
|
import { AuthService } from './core/auth/auth.service';
|
||||||
import { CSSVariableService } from './shared/sass-helper/css-variable.service';
|
import { CSSVariableService } from './shared/sass-helper/css-variable.service';
|
||||||
import { environment } from '../environments/environment';
|
import { environment } from '../environments/environment';
|
||||||
import { models } from './core/core.module';
|
|
||||||
import { ThemeService } from './shared/theme-support/theme.service';
|
import { ThemeService } from './shared/theme-support/theme.service';
|
||||||
import { IdleModalComponent } from './shared/idle-modal/idle-modal.component';
|
import { IdleModalComponent } from './shared/idle-modal/idle-modal.component';
|
||||||
import { distinctNext } from './core/shared/distinct-next';
|
import { distinctNext } from './core/shared/distinct-next';
|
||||||
import { ThemedRootComponent } from './root/themed-root.component';
|
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'ds-app',
|
selector: 'ds-app',
|
||||||
templateUrl: './app.component.html',
|
templateUrl: './app.component.html',
|
||||||
styleUrls: ['./app.component.scss'],
|
styleUrls: ['./app.component.scss'],
|
||||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||||
standalone: true,
|
|
||||||
imports: [ThemedRootComponent, AsyncPipe]
|
|
||||||
})
|
})
|
||||||
export class AppComponent implements OnInit, AfterViewInit {
|
export class AppComponent implements OnInit, AfterViewInit {
|
||||||
notificationOptions;
|
notificationOptions;
|
||||||
@@ -80,9 +76,6 @@ export class AppComponent implements OnInit, AfterViewInit {
|
|||||||
) {
|
) {
|
||||||
this.notificationOptions = environment.notifications;
|
this.notificationOptions = environment.notifications;
|
||||||
|
|
||||||
/* Use models object so all decorators are actually called */
|
|
||||||
this.models = models;
|
|
||||||
|
|
||||||
if (isPlatformBrowser(this.platformId)) {
|
if (isPlatformBrowser(this.platformId)) {
|
||||||
this.trackIdleModal();
|
this.trackIdleModal();
|
||||||
}
|
}
|
||||||
|
@@ -16,7 +16,6 @@ import { AppComponent } from './app.component';
|
|||||||
import { appEffects } from './app.effects';
|
import { appEffects } from './app.effects';
|
||||||
import { appMetaReducers, debugMetaReducers } from './app.metareducers';
|
import { appMetaReducers, debugMetaReducers } from './app.metareducers';
|
||||||
import { appReducers, AppState, storeModuleConfig } from './app.reducer';
|
import { appReducers, AppState, storeModuleConfig } from './app.reducer';
|
||||||
import { CoreModule } from './core/core.module';
|
|
||||||
import { ClientCookieService } from './core/services/client-cookie.service';
|
import { ClientCookieService } from './core/services/client-cookie.service';
|
||||||
import { NavbarModule } from './navbar/navbar.module';
|
import { NavbarModule } from './navbar/navbar.module';
|
||||||
import { DSpaceRouterStateSerializer } from './shared/ngrx/dspace-router-state-serializer';
|
import { DSpaceRouterStateSerializer } from './shared/ngrx/dspace-router-state-serializer';
|
||||||
@@ -30,6 +29,8 @@ import { EagerThemesModule } from '../themes/eager-themes.module';
|
|||||||
import { APP_CONFIG, AppConfig } from '../config/app-config.interface';
|
import { APP_CONFIG, AppConfig } from '../config/app-config.interface';
|
||||||
import { StoreDevModules } from '../config/store/devtools';
|
import { StoreDevModules } from '../config/store/devtools';
|
||||||
import { RootModule } from './root.module';
|
import { RootModule } from './root.module';
|
||||||
|
import { models, provideCore } from './core/provide-core';
|
||||||
|
import { ThemedRootComponent } from './root/themed-root.component';
|
||||||
|
|
||||||
export function getConfig() {
|
export function getConfig() {
|
||||||
return environment;
|
return environment;
|
||||||
@@ -51,7 +52,6 @@ const IMPORTS = [
|
|||||||
NavbarModule,
|
NavbarModule,
|
||||||
HttpClientModule,
|
HttpClientModule,
|
||||||
AppRoutingModule,
|
AppRoutingModule,
|
||||||
CoreModule.forRoot(),
|
|
||||||
ScrollToModule.forRoot(),
|
ScrollToModule.forRoot(),
|
||||||
NgbModule,
|
NgbModule,
|
||||||
TranslateModule.forRoot(),
|
TranslateModule.forRoot(),
|
||||||
@@ -107,27 +107,24 @@ const PROVIDERS = [
|
|||||||
...DYNAMIC_MATCHER_PROVIDERS,
|
...DYNAMIC_MATCHER_PROVIDERS,
|
||||||
];
|
];
|
||||||
|
|
||||||
const DECLARATIONS = [
|
|
||||||
AppComponent,
|
|
||||||
];
|
|
||||||
|
|
||||||
const EXPORTS = [
|
|
||||||
];
|
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
|
declarations: [
|
||||||
|
AppComponent,
|
||||||
|
],
|
||||||
imports: [
|
imports: [
|
||||||
BrowserModule.withServerTransition({ appId: 'dspace-angular' }),
|
BrowserModule.withServerTransition({appId: 'dspace-angular'}),
|
||||||
...IMPORTS,
|
...IMPORTS,
|
||||||
...DECLARATIONS
|
ThemedRootComponent
|
||||||
],
|
],
|
||||||
providers: [
|
providers: [
|
||||||
...PROVIDERS
|
...PROVIDERS,
|
||||||
|
provideCore(),
|
||||||
],
|
],
|
||||||
exports: [
|
bootstrap: [AppComponent]
|
||||||
...EXPORTS,
|
|
||||||
...DECLARATIONS,
|
|
||||||
]
|
|
||||||
})
|
})
|
||||||
export class AppModule {
|
export class AppModule {
|
||||||
|
|
||||||
|
/* Use models object so all decorators are actually called */
|
||||||
|
modelList = models;
|
||||||
}
|
}
|
||||||
|
@@ -6,10 +6,12 @@ import { BROWSE_BY_COMPONENT_FACTORY } from './browse-by-decorator';
|
|||||||
import { GenericConstructor } from '../../core/shared/generic-constructor';
|
import { GenericConstructor } from '../../core/shared/generic-constructor';
|
||||||
import { BrowseDefinition } from '../../core/shared/browse-definition.model';
|
import { BrowseDefinition } from '../../core/shared/browse-definition.model';
|
||||||
import { ThemeService } from '../../shared/theme-support/theme.service';
|
import { ThemeService } from '../../shared/theme-support/theme.service';
|
||||||
|
import { AsyncPipe, NgComponentOutlet } from '@angular/common';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'ds-browse-by-switcher',
|
selector: 'ds-browse-by-switcher',
|
||||||
templateUrl: './browse-by-switcher.component.html',
|
templateUrl: './browse-by-switcher.component.html',
|
||||||
|
imports: [AsyncPipe, NgComponentOutlet],
|
||||||
standalone: true
|
standalone: true
|
||||||
})
|
})
|
||||||
/**
|
/**
|
||||||
|
@@ -65,7 +65,7 @@ export const IMPERSONATING_COOKIE = 'dsImpersonatingEPerson';
|
|||||||
/**
|
/**
|
||||||
* The auth service.
|
* The auth service.
|
||||||
*/
|
*/
|
||||||
@Injectable()
|
@Injectable({ providedIn: 'root' })
|
||||||
export class AuthService {
|
export class AuthService {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -19,7 +19,7 @@ import { CoreState } from '../core-state.model';
|
|||||||
* Prevent unauthorized activating and loading of routes
|
* Prevent unauthorized activating and loading of routes
|
||||||
* @class AuthenticatedGuard
|
* @class AuthenticatedGuard
|
||||||
*/
|
*/
|
||||||
@Injectable()
|
@Injectable({ providedIn: 'root' })
|
||||||
export class AuthenticatedGuard implements CanActivate {
|
export class AuthenticatedGuard implements CanActivate {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -5,7 +5,7 @@ import { isNotEmpty } from '../../shared/empty.util';
|
|||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
import { RestRequest } from '../data/rest-request.model';
|
import { RestRequest } from '../data/rest-request.model';
|
||||||
|
|
||||||
@Injectable()
|
@Injectable({ providedIn: 'root' })
|
||||||
/**
|
/**
|
||||||
* A ResponseParsingService used to parse RawRestResponse coming from the REST API to a token string
|
* A ResponseParsingService used to parse RawRestResponse coming from the REST API to a token string
|
||||||
* wrapped in a TokenResponse
|
* wrapped in a TokenResponse
|
||||||
|
@@ -1,6 +1,5 @@
|
|||||||
// eslint-disable-next-line max-classes-per-file
|
// eslint-disable-next-line max-classes-per-file
|
||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
import { BROWSE_DEFINITION } from '../shared/browse-definition.resource-type';
|
|
||||||
import { RequestService } from '../data/request.service';
|
import { RequestService } from '../data/request.service';
|
||||||
import { RemoteDataBuildService } from '../cache/builders/remote-data-build.service';
|
import { RemoteDataBuildService } from '../cache/builders/remote-data-build.service';
|
||||||
import { ObjectCacheService } from '../cache/object-cache.service';
|
import { ObjectCacheService } from '../cache/object-cache.service';
|
||||||
@@ -12,7 +11,6 @@ import { PaginatedList } from '../data/paginated-list.model';
|
|||||||
import { FindListOptions } from '../data/find-list-options.model';
|
import { FindListOptions } from '../data/find-list-options.model';
|
||||||
import { IdentifiableDataService } from '../data/base/identifiable-data.service';
|
import { IdentifiableDataService } from '../data/base/identifiable-data.service';
|
||||||
import { FindAllData, FindAllDataImpl } from '../data/base/find-all-data';
|
import { FindAllData, FindAllDataImpl } from '../data/base/find-all-data';
|
||||||
import { dataService } from '../data/base/data-service.decorator';
|
|
||||||
import { isNotEmpty, isNotEmptyOperator, hasValue } from '../../shared/empty.util';
|
import { isNotEmpty, isNotEmptyOperator, hasValue } from '../../shared/empty.util';
|
||||||
import { take } from 'rxjs/operators';
|
import { take } from 'rxjs/operators';
|
||||||
import { BrowseDefinitionRestRequest } from '../data/request.models';
|
import { BrowseDefinitionRestRequest } from '../data/request.models';
|
||||||
@@ -62,7 +60,6 @@ class BrowseDefinitionFindAllDataImpl extends FindAllDataImpl<BrowseDefinition>
|
|||||||
@Injectable({
|
@Injectable({
|
||||||
providedIn: 'root',
|
providedIn: 'root',
|
||||||
})
|
})
|
||||||
@dataService(BROWSE_DEFINITION)
|
|
||||||
export class BrowseDefinitionDataService extends IdentifiableDataService<BrowseDefinition> implements FindAllData<BrowseDefinition>, SearchData<BrowseDefinition> {
|
export class BrowseDefinitionDataService extends IdentifiableDataService<BrowseDefinition> implements FindAllData<BrowseDefinition>, SearchData<BrowseDefinition> {
|
||||||
private findAllData: BrowseDefinitionFindAllDataImpl;
|
private findAllData: BrowseDefinitionFindAllDataImpl;
|
||||||
private searchData: SearchDataImpl<BrowseDefinition>;
|
private searchData: SearchDataImpl<BrowseDefinition>;
|
||||||
|
@@ -33,7 +33,7 @@ export const BROWSE_LINKS_TO_FOLLOW: FollowLinkConfig<BrowseEntry | Item>[] = [
|
|||||||
/**
|
/**
|
||||||
* The service handling all browse requests
|
* The service handling all browse requests
|
||||||
*/
|
*/
|
||||||
@Injectable()
|
@Injectable({ providedIn: 'root' })
|
||||||
export class BrowseService {
|
export class BrowseService {
|
||||||
protected linkPath = 'browses';
|
protected linkPath = 'browses';
|
||||||
|
|
||||||
|
45
src/app/core/cache/builders/link.service.ts
vendored
45
src/app/core/cache/builders/link.service.ts
vendored
@@ -1,31 +1,28 @@
|
|||||||
import { Inject, Injectable, Injector } from '@angular/core';
|
import { Inject, Injectable, Injector } from '@angular/core';
|
||||||
import { hasNoValue, hasValue, isNotEmpty } from '../../../shared/empty.util';
|
import { hasValue, isNotEmpty } from '../../../shared/empty.util';
|
||||||
import { FollowLinkConfig } from '../../../shared/utils/follow-link-config.model';
|
import { FollowLinkConfig } from '../../../shared/utils/follow-link-config.model';
|
||||||
import { GenericConstructor } from '../../shared/generic-constructor';
|
import { GenericConstructor } from '../../shared/generic-constructor';
|
||||||
import { HALResource } from '../../shared/hal-resource.model';
|
import { HALResource } from '../../shared/hal-resource.model';
|
||||||
import { DATA_SERVICE_FACTORY } from '../../data/base/data-service.decorator';
|
import { DATA_SERVICE_FACTORY } from '../../data/base/data-service.decorator';
|
||||||
import {
|
import { LINK_DEFINITION_FACTORY, LINK_DEFINITION_MAP_FACTORY, LinkDefinition, } from './build-decorators';
|
||||||
LINK_DEFINITION_FACTORY,
|
|
||||||
LINK_DEFINITION_MAP_FACTORY,
|
|
||||||
LinkDefinition,
|
|
||||||
} from './build-decorators';
|
|
||||||
import { RemoteData } from '../../data/remote-data';
|
import { RemoteData } from '../../data/remote-data';
|
||||||
import { EMPTY, Observable } from 'rxjs';
|
import { EMPTY, Observable, of } from 'rxjs';
|
||||||
import { ResourceType } from '../../shared/resource-type';
|
import { ResourceType } from '../../shared/resource-type';
|
||||||
import { HALDataService } from '../../data/base/hal-data-service.interface';
|
import { HALDataService } from '../../data/base/hal-data-service.interface';
|
||||||
import { PaginatedList } from '../../data/paginated-list.model';
|
import { PaginatedList } from '../../data/paginated-list.model';
|
||||||
|
import { lazyService } from '../../lazy-service';
|
||||||
|
import { LAZY_DATA_SERVICES } from '../../../data-services';
|
||||||
|
import { catchError, switchMap } from 'rxjs/operators';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A Service to handle the resolving and removing
|
* A Service to handle the resolving and removing
|
||||||
* of resolved {@link HALLink}s on HALResources
|
* of resolved {@link HALLink}s on HALResources
|
||||||
*/
|
*/
|
||||||
@Injectable({
|
@Injectable({providedIn: 'root',})
|
||||||
providedIn: 'root',
|
|
||||||
})
|
|
||||||
export class LinkService {
|
export class LinkService {
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
protected parentInjector: Injector,
|
protected injector: Injector,
|
||||||
@Inject(DATA_SERVICE_FACTORY) private getDataServiceFor: (resourceType: ResourceType) => GenericConstructor<HALDataService<any>>,
|
@Inject(DATA_SERVICE_FACTORY) private getDataServiceFor: (resourceType: ResourceType) => GenericConstructor<HALDataService<any>>,
|
||||||
@Inject(LINK_DEFINITION_FACTORY) private getLinkDefinition: <T extends HALResource>(source: GenericConstructor<T>, linkName: keyof T['_links']) => LinkDefinition<T>,
|
@Inject(LINK_DEFINITION_FACTORY) private getLinkDefinition: <T extends HALResource>(source: GenericConstructor<T>, linkName: keyof T['_links']) => LinkDefinition<T>,
|
||||||
@Inject(LINK_DEFINITION_MAP_FACTORY) private getLinkDefinitions: <T extends HALResource>(source: GenericConstructor<T>) => Map<keyof T['_links'], LinkDefinition<T>>,
|
@Inject(LINK_DEFINITION_MAP_FACTORY) private getLinkDefinitions: <T extends HALResource>(source: GenericConstructor<T>) => Map<keyof T['_links'], LinkDefinition<T>>,
|
||||||
@@ -57,32 +54,32 @@ export class LinkService {
|
|||||||
const matchingLinkDef = this.getLinkDefinition(model.constructor, linkToFollow.name);
|
const matchingLinkDef = this.getLinkDefinition(model.constructor, linkToFollow.name);
|
||||||
|
|
||||||
if (hasValue(matchingLinkDef)) {
|
if (hasValue(matchingLinkDef)) {
|
||||||
const provider = this.getDataServiceFor(matchingLinkDef.resourceType);
|
const lazyProvider$: Observable<HALDataService<any>> = lazyService(LAZY_DATA_SERVICES[matchingLinkDef.resourceType.value], this.injector);
|
||||||
|
|
||||||
if (hasNoValue(provider)) {
|
|
||||||
throw new Error(`The @link() for ${String(linkToFollow.name)} on ${model.constructor.name} models uses the resource type ${matchingLinkDef.resourceType.value.toUpperCase()}, but there is no service with an @dataService(${matchingLinkDef.resourceType.value.toUpperCase()}) annotation in order to retrieve it`);
|
|
||||||
}
|
|
||||||
|
|
||||||
const service: HALDataService<any> = Injector.create({
|
|
||||||
providers: [],
|
|
||||||
parent: this.parentInjector,
|
|
||||||
}).get(provider);
|
|
||||||
|
|
||||||
|
return lazyProvider$.pipe(
|
||||||
|
switchMap((provider: HALDataService<any>) => {
|
||||||
const link = model._links[matchingLinkDef.linkName];
|
const link = model._links[matchingLinkDef.linkName];
|
||||||
if (hasValue(link)) {
|
if (hasValue(link)) {
|
||||||
const href = link.href;
|
const href = link.href;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if (matchingLinkDef.isList) {
|
if (matchingLinkDef.isList) {
|
||||||
return service.findListByHref(href, linkToFollow.findListOptions, linkToFollow.useCachedVersionIfAvailable, linkToFollow.reRequestOnStale, ...linkToFollow.linksToFollow);
|
return provider.findListByHref(href, linkToFollow.findListOptions, linkToFollow.useCachedVersionIfAvailable, linkToFollow.reRequestOnStale, ...linkToFollow.linksToFollow);
|
||||||
} else {
|
} else {
|
||||||
return service.findByHref(href, linkToFollow.useCachedVersionIfAvailable, linkToFollow.reRequestOnStale, ...linkToFollow.linksToFollow);
|
return provider.findByHref(href, linkToFollow.useCachedVersionIfAvailable, linkToFollow.reRequestOnStale, ...linkToFollow.linksToFollow);
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error(`Something went wrong when using @dataService(${matchingLinkDef.resourceType.value}) ${hasValue(service) ? '' : '(undefined) '}to resolve link ${String(linkToFollow.name)} at ${href}`);
|
console.error(`Something went wrong when using ${matchingLinkDef.resourceType.value}) ${hasValue(provider) ? '' : '(undefined) '}to resolve link ${String(linkToFollow.name)} at ${href}`);
|
||||||
throw e;
|
throw e;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return of(null);
|
||||||
|
}),
|
||||||
|
catchError((err) => {
|
||||||
|
throw new Error(`The @link() for ${String(linkToFollow.name)} on ${model.constructor.name} models uses the resource type ${matchingLinkDef.resourceType.value.toUpperCase()}, but there is no service with an @dataService(${matchingLinkDef.resourceType.value.toUpperCase()}) annotation in order to retrieve it`);
|
||||||
|
})
|
||||||
|
);
|
||||||
} else if (!linkToFollow.isOptional) {
|
} else if (!linkToFollow.isOptional) {
|
||||||
throw new Error(`followLink('${String(linkToFollow.name)}') was used as a required link for a ${model.constructor.name}, but there is no property on ${model.constructor.name} models with an @link() for ${String(linkToFollow.name)}`);
|
throw new Error(`followLink('${String(linkToFollow.name)}') was used as a required link for a ${model.constructor.name}, but there is no property on ${model.constructor.name} models with an @link() for ${String(linkToFollow.name)}`);
|
||||||
}
|
}
|
||||||
|
@@ -27,7 +27,7 @@ import { RequestEntry } from '../../data/request-entry.model';
|
|||||||
import { ResponseState } from '../../data/response-state.model';
|
import { ResponseState } from '../../data/response-state.model';
|
||||||
import { getFirstCompletedRemoteData } from '../../shared/operators';
|
import { getFirstCompletedRemoteData } from '../../shared/operators';
|
||||||
|
|
||||||
@Injectable()
|
@Injectable({ providedIn: 'root' })
|
||||||
export class RemoteDataBuildService {
|
export class RemoteDataBuildService {
|
||||||
constructor(protected objectCache: ObjectCacheService,
|
constructor(protected objectCache: ObjectCacheService,
|
||||||
protected linkService: LinkService,
|
protected linkService: LinkService,
|
||||||
|
2
src/app/core/cache/object-cache.service.ts
vendored
2
src/app/core/cache/object-cache.service.ts
vendored
@@ -42,7 +42,7 @@ const entryFromSelfLinkSelector =
|
|||||||
/**
|
/**
|
||||||
* A service to interact with the object cache
|
* A service to interact with the object cache
|
||||||
*/
|
*/
|
||||||
@Injectable()
|
@Injectable({ providedIn: 'root' })
|
||||||
export class ObjectCacheService {
|
export class ObjectCacheService {
|
||||||
constructor(
|
constructor(
|
||||||
private store: Store<CoreState>,
|
private store: Store<CoreState>,
|
||||||
|
@@ -4,14 +4,11 @@ import { ObjectCacheService } from '../cache/object-cache.service';
|
|||||||
import { HALEndpointService } from '../shared/hal-endpoint.service';
|
import { HALEndpointService } from '../shared/hal-endpoint.service';
|
||||||
import { RequestService } from '../data/request.service';
|
import { RequestService } from '../data/request.service';
|
||||||
import { ConfigDataService } from './config-data.service';
|
import { ConfigDataService } from './config-data.service';
|
||||||
import { dataService } from '../data/base/data-service.decorator';
|
|
||||||
import { BULK_ACCESS_CONDITION_OPTIONS } from './models/config-type';
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Data Service responsible for retrieving Bulk Access Condition Options from the REST API
|
* Data Service responsible for retrieving Bulk Access Condition Options from the REST API
|
||||||
*/
|
*/
|
||||||
@Injectable({ providedIn: 'root' })
|
@Injectable({ providedIn: 'root' })
|
||||||
@dataService(BULK_ACCESS_CONDITION_OPTIONS)
|
|
||||||
export class BulkAccessConfigDataService extends ConfigDataService {
|
export class BulkAccessConfigDataService extends ConfigDataService {
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
|
@@ -3,20 +3,17 @@ import { ConfigDataService } from './config-data.service';
|
|||||||
import { RequestService } from '../data/request.service';
|
import { RequestService } from '../data/request.service';
|
||||||
import { HALEndpointService } from '../shared/hal-endpoint.service';
|
import { HALEndpointService } from '../shared/hal-endpoint.service';
|
||||||
import { ObjectCacheService } from '../cache/object-cache.service';
|
import { ObjectCacheService } from '../cache/object-cache.service';
|
||||||
import { SUBMISSION_ACCESSES_TYPE } from './models/config-type';
|
|
||||||
import { RemoteDataBuildService } from '../cache/builders/remote-data-build.service';
|
import { RemoteDataBuildService } from '../cache/builders/remote-data-build.service';
|
||||||
import { ConfigObject } from './models/config.model';
|
import { ConfigObject } from './models/config.model';
|
||||||
import { SubmissionAccessesModel } from './models/config-submission-accesses.model';
|
import { SubmissionAccessesModel } from './models/config-submission-accesses.model';
|
||||||
import { RemoteData } from '../data/remote-data';
|
import { RemoteData } from '../data/remote-data';
|
||||||
import { Observable } from 'rxjs';
|
import { Observable } from 'rxjs';
|
||||||
import { FollowLinkConfig } from '../../shared/utils/follow-link-config.model';
|
import { FollowLinkConfig } from '../../shared/utils/follow-link-config.model';
|
||||||
import { dataService } from '../data/base/data-service.decorator';
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Provides methods to retrieve, from REST server, bitstream access conditions configurations applicable during the submission process.
|
* Provides methods to retrieve, from REST server, bitstream access conditions configurations applicable during the submission process.
|
||||||
*/
|
*/
|
||||||
@Injectable()
|
@Injectable()
|
||||||
@dataService(SUBMISSION_ACCESSES_TYPE)
|
|
||||||
export class SubmissionAccessesConfigDataService extends ConfigDataService {
|
export class SubmissionAccessesConfigDataService extends ConfigDataService {
|
||||||
constructor(
|
constructor(
|
||||||
protected requestService: RequestService,
|
protected requestService: RequestService,
|
||||||
|
@@ -15,7 +15,7 @@ import { dataService } from '../data/base/data-service.decorator';
|
|||||||
/**
|
/**
|
||||||
* Data service to retrieve submission form configuration objects from the REST server.
|
* Data service to retrieve submission form configuration objects from the REST server.
|
||||||
*/
|
*/
|
||||||
@Injectable()
|
@Injectable({ providedIn: 'root' })
|
||||||
@dataService(SUBMISSION_FORMS_TYPE)
|
@dataService(SUBMISSION_FORMS_TYPE)
|
||||||
export class SubmissionFormsConfigDataService extends ConfigDataService {
|
export class SubmissionFormsConfigDataService extends ConfigDataService {
|
||||||
constructor(
|
constructor(
|
||||||
|
@@ -3,20 +3,17 @@ import { ConfigDataService } from './config-data.service';
|
|||||||
import { RequestService } from '../data/request.service';
|
import { RequestService } from '../data/request.service';
|
||||||
import { HALEndpointService } from '../shared/hal-endpoint.service';
|
import { HALEndpointService } from '../shared/hal-endpoint.service';
|
||||||
import { ObjectCacheService } from '../cache/object-cache.service';
|
import { ObjectCacheService } from '../cache/object-cache.service';
|
||||||
import { SUBMISSION_UPLOADS_TYPE } from './models/config-type';
|
|
||||||
import { RemoteDataBuildService } from '../cache/builders/remote-data-build.service';
|
import { RemoteDataBuildService } from '../cache/builders/remote-data-build.service';
|
||||||
import { ConfigObject } from './models/config.model';
|
import { ConfigObject } from './models/config.model';
|
||||||
import { SubmissionUploadsModel } from './models/config-submission-uploads.model';
|
import { SubmissionUploadsModel } from './models/config-submission-uploads.model';
|
||||||
import { RemoteData } from '../data/remote-data';
|
import { RemoteData } from '../data/remote-data';
|
||||||
import { Observable } from 'rxjs';
|
import { Observable } from 'rxjs';
|
||||||
import { FollowLinkConfig } from '../../shared/utils/follow-link-config.model';
|
import { FollowLinkConfig } from '../../shared/utils/follow-link-config.model';
|
||||||
import { dataService } from '../data/base/data-service.decorator';
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Provides methods to retrieve, from REST server, bitstream access conditions configurations applicable during the submission process.
|
* Provides methods to retrieve, from REST server, bitstream access conditions configurations applicable during the submission process.
|
||||||
*/
|
*/
|
||||||
@Injectable()
|
@Injectable()
|
||||||
@dataService(SUBMISSION_UPLOADS_TYPE)
|
|
||||||
export class SubmissionUploadsConfigDataService extends ConfigDataService {
|
export class SubmissionUploadsConfigDataService extends ConfigDataService {
|
||||||
constructor(
|
constructor(
|
||||||
protected requestService: RequestService,
|
protected requestService: RequestService,
|
||||||
|
@@ -1,416 +0,0 @@
|
|||||||
import { CommonModule } from '@angular/common';
|
|
||||||
import { HttpClient } from '@angular/common/http';
|
|
||||||
import { ModuleWithProviders, NgModule, Optional, SkipSelf } from '@angular/core';
|
|
||||||
|
|
||||||
import { EffectsModule } from '@ngrx/effects';
|
|
||||||
|
|
||||||
import { Action, StoreConfig, StoreModule } from '@ngrx/store';
|
|
||||||
import { MyDSpaceGuard } from '../my-dspace-page/my-dspace.guard';
|
|
||||||
|
|
||||||
import { isNotEmpty } from '../shared/empty.util';
|
|
||||||
import { HostWindowService } from '../shared/host-window.service';
|
|
||||||
import { MenuService } from '../shared/menu/menu.service';
|
|
||||||
import { EndpointMockingRestService } from '../shared/mocks/dspace-rest/endpoint-mocking-rest.service';
|
|
||||||
import {
|
|
||||||
MOCK_RESPONSE_MAP,
|
|
||||||
mockResponseMap,
|
|
||||||
ResponseMapMock
|
|
||||||
} from '../shared/mocks/dspace-rest/mocks/response-map.mock';
|
|
||||||
import { NotificationsService } from '../shared/notifications/notifications.service';
|
|
||||||
import { SelectableListService } from '../shared/object-list/selectable-list/selectable-list.service';
|
|
||||||
import { ObjectSelectService } from '../shared/object-select/object-select.service';
|
|
||||||
import { PaginationComponentOptions } from '../shared/pagination/pagination-component-options.model';
|
|
||||||
import { SidebarService } from '../shared/sidebar/sidebar.service';
|
|
||||||
import { AuthenticatedGuard } from './auth/authenticated.guard';
|
|
||||||
import { AuthStatus } from './auth/models/auth-status.model';
|
|
||||||
import { BrowseService } from './browse/browse.service';
|
|
||||||
import { RemoteDataBuildService } from './cache/builders/remote-data-build.service';
|
|
||||||
import { ObjectCacheService } from './cache/object-cache.service';
|
|
||||||
import { SubmissionDefinitionsModel } from './config/models/config-submission-definitions.model';
|
|
||||||
import { SubmissionFormsModel } from './config/models/config-submission-forms.model';
|
|
||||||
import { SubmissionSectionModel } from './config/models/config-submission-section.model';
|
|
||||||
import { SubmissionUploadsModel } from './config/models/config-submission-uploads.model';
|
|
||||||
import { SubmissionFormsConfigDataService } from './config/submission-forms-config-data.service';
|
|
||||||
import { coreEffects } from './core.effects';
|
|
||||||
import { coreReducers } from './core.reducers';
|
|
||||||
import { BitstreamFormatDataService } from './data/bitstream-format-data.service';
|
|
||||||
import { CollectionDataService } from './data/collection-data.service';
|
|
||||||
import { CommunityDataService } from './data/community-data.service';
|
|
||||||
import { ContentSourceResponseParsingService } from './data/content-source-response-parsing.service';
|
|
||||||
import { DebugResponseParsingService } from './data/debug-response-parsing.service';
|
|
||||||
import { DefaultChangeAnalyzer } from './data/default-change-analyzer.service';
|
|
||||||
import { DSOChangeAnalyzer } from './data/dso-change-analyzer.service';
|
|
||||||
import { DSOResponseParsingService } from './data/dso-response-parsing.service';
|
|
||||||
import { DSpaceObjectDataService } from './data/dspace-object-data.service';
|
|
||||||
import { EndpointMapResponseParsingService } from './data/endpoint-map-response-parsing.service';
|
|
||||||
import { EntityTypeDataService } from './data/entity-type-data.service';
|
|
||||||
import { ExternalSourceDataService } from './data/external-source-data.service';
|
|
||||||
import { FacetConfigResponseParsingService } from './data/facet-config-response-parsing.service';
|
|
||||||
import { FacetValueResponseParsingService } from './data/facet-value-response-parsing.service';
|
|
||||||
import { FilteredDiscoveryPageResponseParsingService } from './data/filtered-discovery-page-response-parsing.service';
|
|
||||||
import { ItemDataService } from './data/item-data.service';
|
|
||||||
import { LookupRelationService } from './data/lookup-relation.service';
|
|
||||||
import { MyDSpaceResponseParsingService } from './data/mydspace-response-parsing.service';
|
|
||||||
import { ObjectUpdatesService } from './data/object-updates/object-updates.service';
|
|
||||||
import { RelationshipTypeDataService } from './data/relationship-type-data.service';
|
|
||||||
import { RelationshipDataService } from './data/relationship-data.service';
|
|
||||||
import { ResourcePolicyDataService } from './resource-policy/resource-policy-data.service';
|
|
||||||
import { SearchResponseParsingService } from './data/search-response-parsing.service';
|
|
||||||
import { SiteDataService } from './data/site-data.service';
|
|
||||||
import { DspaceRestService } from './dspace-rest/dspace-rest.service';
|
|
||||||
import { EPersonDataService } from './eperson/eperson-data.service';
|
|
||||||
import { EPerson } from './eperson/models/eperson.model';
|
|
||||||
import { Group } from './eperson/models/group.model';
|
|
||||||
import { JsonPatchOperationsBuilder } from './json-patch/builder/json-patch-operations-builder';
|
|
||||||
import { MetadataField } from './metadata/metadata-field.model';
|
|
||||||
import { MetadataSchema } from './metadata/metadata-schema.model';
|
|
||||||
import { MetadataService } from './metadata/metadata.service';
|
|
||||||
import { RegistryService } from './registry/registry.service';
|
|
||||||
import { RoleService } from './roles/role.service';
|
|
||||||
import { FeedbackDataService } from './feedback/feedback-data.service';
|
|
||||||
|
|
||||||
import { ServerResponseService } from './services/server-response.service';
|
|
||||||
import { NativeWindowFactory, NativeWindowService } from './services/window.service';
|
|
||||||
import { BitstreamFormat } from './shared/bitstream-format.model';
|
|
||||||
import { Bitstream } from './shared/bitstream.model';
|
|
||||||
import { BrowseDefinition } from './shared/browse-definition.model';
|
|
||||||
import { BrowseEntry } from './shared/browse-entry.model';
|
|
||||||
import { Bundle } from './shared/bundle.model';
|
|
||||||
import { Collection } from './shared/collection.model';
|
|
||||||
import { Community } from './shared/community.model';
|
|
||||||
import { DSpaceObject } from './shared/dspace-object.model';
|
|
||||||
import { ExternalSourceEntry } from './shared/external-source-entry.model';
|
|
||||||
import { ExternalSource } from './shared/external-source.model';
|
|
||||||
import { HALEndpointService } from './shared/hal-endpoint.service';
|
|
||||||
import { ItemType } from './shared/item-relationships/item-type.model';
|
|
||||||
import { RelationshipType } from './shared/item-relationships/relationship-type.model';
|
|
||||||
import { Relationship } from './shared/item-relationships/relationship.model';
|
|
||||||
import { Item } from './shared/item.model';
|
|
||||||
import { License } from './shared/license.model';
|
|
||||||
import { ResourcePolicy } from './resource-policy/models/resource-policy.model';
|
|
||||||
import { SearchConfigurationService } from './shared/search/search-configuration.service';
|
|
||||||
import { SearchFilterService } from './shared/search/search-filter.service';
|
|
||||||
import { SearchService } from './shared/search/search.service';
|
|
||||||
import { Site } from './shared/site.model';
|
|
||||||
import { UUIDService } from './shared/uuid.service';
|
|
||||||
import { WorkflowItem } from './submission/models/workflowitem.model';
|
|
||||||
import { WorkspaceItem } from './submission/models/workspaceitem.model';
|
|
||||||
import { SubmissionJsonPatchOperationsService } from './submission/submission-json-patch-operations.service';
|
|
||||||
import { SubmissionResponseParsingService } from './submission/submission-response-parsing.service';
|
|
||||||
import { SubmissionRestService } from './submission/submission-rest.service';
|
|
||||||
import { WorkflowItemDataService } from './submission/workflowitem-data.service';
|
|
||||||
import { WorkspaceitemDataService } from './submission/workspaceitem-data.service';
|
|
||||||
import { ClaimedTaskDataService } from './tasks/claimed-task-data.service';
|
|
||||||
import { ClaimedTask } from './tasks/models/claimed-task-object.model';
|
|
||||||
import { PoolTask } from './tasks/models/pool-task-object.model';
|
|
||||||
import { TaskObject } from './tasks/models/task-object.model';
|
|
||||||
import { PoolTaskDataService } from './tasks/pool-task-data.service';
|
|
||||||
import { TaskResponseParsingService } from './tasks/task-response-parsing.service';
|
|
||||||
import { ArrayMoveChangeAnalyzer } from './data/array-move-change-analyzer.service';
|
|
||||||
import { BitstreamDataService } from './data/bitstream-data.service';
|
|
||||||
import { environment } from '../../environments/environment';
|
|
||||||
import { storeModuleConfig } from '../app.reducer';
|
|
||||||
import { VersionDataService } from './data/version-data.service';
|
|
||||||
import { VersionHistoryDataService } from './data/version-history-data.service';
|
|
||||||
import { Version } from './shared/version.model';
|
|
||||||
import { VersionHistory } from './shared/version-history.model';
|
|
||||||
import { Script } from '../process-page/scripts/script.model';
|
|
||||||
import { Process } from '../process-page/processes/process.model';
|
|
||||||
import { ProcessDataService } from './data/processes/process-data.service';
|
|
||||||
import { ScriptDataService } from './data/processes/script-data.service';
|
|
||||||
import { WorkflowActionDataService } from './data/workflow-action-data.service';
|
|
||||||
import { WorkflowAction } from './tasks/models/workflow-action-object.model';
|
|
||||||
import { ItemTemplateDataService } from './data/item-template-data.service';
|
|
||||||
import { TemplateItem } from './shared/template-item.model';
|
|
||||||
import { Feature } from './shared/feature.model';
|
|
||||||
import { Authorization } from './shared/authorization.model';
|
|
||||||
import { FeatureDataService } from './data/feature-authorization/feature-data.service';
|
|
||||||
import { AuthorizationDataService } from './data/feature-authorization/authorization-data.service';
|
|
||||||
import {
|
|
||||||
SiteAdministratorGuard
|
|
||||||
} from './data/feature-authorization/feature-authorization-guard/site-administrator.guard';
|
|
||||||
import { Registration } from './shared/registration.model';
|
|
||||||
import { MetadataSchemaDataService } from './data/metadata-schema-data.service';
|
|
||||||
import { MetadataFieldDataService } from './data/metadata-field-data.service';
|
|
||||||
import { TokenResponseParsingService } from './auth/token-response-parsing.service';
|
|
||||||
import { SubmissionCcLicenseDataService } from './submission/submission-cc-license-data.service';
|
|
||||||
import { SubmissionCcLicence } from './submission/models/submission-cc-license.model';
|
|
||||||
import { SubmissionCcLicenceUrl } from './submission/models/submission-cc-license-url.model';
|
|
||||||
import { SubmissionCcLicenseUrlDataService } from './submission/submission-cc-license-url-data.service';
|
|
||||||
import { VocabularyEntry } from './submission/vocabularies/models/vocabulary-entry.model';
|
|
||||||
import { Vocabulary } from './submission/vocabularies/models/vocabulary.model';
|
|
||||||
import { VocabularyEntryDetail } from './submission/vocabularies/models/vocabulary-entry-detail.model';
|
|
||||||
import { VocabularyService } from './submission/vocabularies/vocabulary.service';
|
|
||||||
import { ConfigurationDataService } from './data/configuration-data.service';
|
|
||||||
import { ConfigurationProperty } from './shared/configuration-property.model';
|
|
||||||
import { ReloadGuard } from './reload/reload.guard';
|
|
||||||
import { EndUserAgreementCurrentUserGuard } from './end-user-agreement/end-user-agreement-current-user.guard';
|
|
||||||
import { EndUserAgreementCookieGuard } from './end-user-agreement/end-user-agreement-cookie.guard';
|
|
||||||
import { EndUserAgreementService } from './end-user-agreement/end-user-agreement.service';
|
|
||||||
import { SiteRegisterGuard } from './data/feature-authorization/feature-authorization-guard/site-register.guard';
|
|
||||||
import { ShortLivedToken } from './auth/models/short-lived-token.model';
|
|
||||||
import { UsageReport } from './statistics/models/usage-report.model';
|
|
||||||
import { RootDataService } from './data/root-data.service';
|
|
||||||
import { Root } from './data/root.model';
|
|
||||||
import { SearchConfig } from './shared/search/search-filters/search-config.model';
|
|
||||||
import { SequenceService } from './shared/sequence.service';
|
|
||||||
import { CoreState } from './core-state.model';
|
|
||||||
import { GroupDataService } from './eperson/group-data.service';
|
|
||||||
import { SubmissionAccessesModel } from './config/models/config-submission-accesses.model';
|
|
||||||
import { RatingAdvancedWorkflowInfo } from './tasks/models/rating-advanced-workflow-info.model';
|
|
||||||
import { AdvancedWorkflowInfo } from './tasks/models/advanced-workflow-info.model';
|
|
||||||
import { SelectReviewerAdvancedWorkflowInfo } from './tasks/models/select-reviewer-advanced-workflow-info.model';
|
|
||||||
import { AccessStatusObject } from '../shared/object-collection/shared/badges/access-status-badge/access-status.model';
|
|
||||||
import { AccessStatusDataService } from './data/access-status-data.service';
|
|
||||||
import { LinkHeadService } from './services/link-head.service';
|
|
||||||
import { ResearcherProfileDataService } from './profile/researcher-profile-data.service';
|
|
||||||
import { ProfileClaimService } from '../profile-page/profile-claim/profile-claim.service';
|
|
||||||
import { ResearcherProfile } from './profile/model/researcher-profile.model';
|
|
||||||
import { OrcidQueueDataService } from './orcid/orcid-queue-data.service';
|
|
||||||
import { OrcidHistoryDataService } from './orcid/orcid-history-data.service';
|
|
||||||
import { OrcidQueue } from './orcid/model/orcid-queue.model';
|
|
||||||
import { OrcidHistory } from './orcid/model/orcid-history.model';
|
|
||||||
import { OrcidAuthService } from './orcid/orcid-auth.service';
|
|
||||||
import { VocabularyDataService } from './submission/vocabularies/vocabulary.data.service';
|
|
||||||
import { VocabularyEntryDetailsDataService } from './submission/vocabularies/vocabulary-entry-details.data.service';
|
|
||||||
import { IdentifierData } from '../shared/object-list/identifier-data/identifier-data.model';
|
|
||||||
import { Subscription } from '../shared/subscriptions/models/subscription.model';
|
|
||||||
import { SupervisionOrderDataService } from './supervision-order/supervision-order-data.service';
|
|
||||||
import { ItemRequest } from './shared/item-request.model';
|
|
||||||
import { HierarchicalBrowseDefinition } from './shared/hierarchical-browse-definition.model';
|
|
||||||
import { FlatBrowseDefinition } from './shared/flat-browse-definition.model';
|
|
||||||
import { ValueListBrowseDefinition } from './shared/value-list-browse-definition.model';
|
|
||||||
import { NonHierarchicalBrowseDefinition } from './shared/non-hierarchical-browse-definition';
|
|
||||||
import { BulkAccessConditionOptions } from './config/models/bulk-access-condition-options.model';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* When not in production, endpoint responses can be mocked for testing purposes
|
|
||||||
* If there is no mock version available for the endpoint, the actual REST response will be used just like in production mode
|
|
||||||
*/
|
|
||||||
export const restServiceFactory = (mocks: ResponseMapMock, http: HttpClient) => {
|
|
||||||
if (environment.production) {
|
|
||||||
return new DspaceRestService(http);
|
|
||||||
} else {
|
|
||||||
return new EndpointMockingRestService(mocks, http);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
const IMPORTS = [
|
|
||||||
CommonModule,
|
|
||||||
StoreModule.forFeature('core', coreReducers, storeModuleConfig as StoreConfig<CoreState, Action>),
|
|
||||||
EffectsModule.forFeature(coreEffects)
|
|
||||||
];
|
|
||||||
|
|
||||||
const DECLARATIONS = [];
|
|
||||||
|
|
||||||
const EXPORTS = [];
|
|
||||||
|
|
||||||
const PROVIDERS = [
|
|
||||||
AuthenticatedGuard,
|
|
||||||
CommunityDataService,
|
|
||||||
CollectionDataService,
|
|
||||||
SiteDataService,
|
|
||||||
DSOResponseParsingService,
|
|
||||||
{ provide: MOCK_RESPONSE_MAP, useValue: mockResponseMap },
|
|
||||||
{ provide: DspaceRestService, useFactory: restServiceFactory, deps: [MOCK_RESPONSE_MAP, HttpClient] },
|
|
||||||
EPersonDataService,
|
|
||||||
LinkHeadService,
|
|
||||||
HALEndpointService,
|
|
||||||
HostWindowService,
|
|
||||||
ItemDataService,
|
|
||||||
MetadataService,
|
|
||||||
ObjectCacheService,
|
|
||||||
PaginationComponentOptions,
|
|
||||||
ResourcePolicyDataService,
|
|
||||||
RegistryService,
|
|
||||||
BitstreamFormatDataService,
|
|
||||||
RemoteDataBuildService,
|
|
||||||
EndpointMapResponseParsingService,
|
|
||||||
FacetValueResponseParsingService,
|
|
||||||
FacetConfigResponseParsingService,
|
|
||||||
DebugResponseParsingService,
|
|
||||||
SearchResponseParsingService,
|
|
||||||
MyDSpaceResponseParsingService,
|
|
||||||
ServerResponseService,
|
|
||||||
BrowseService,
|
|
||||||
AccessStatusDataService,
|
|
||||||
SubmissionCcLicenseDataService,
|
|
||||||
SubmissionCcLicenseUrlDataService,
|
|
||||||
SubmissionFormsConfigDataService,
|
|
||||||
SubmissionRestService,
|
|
||||||
SubmissionResponseParsingService,
|
|
||||||
SubmissionJsonPatchOperationsService,
|
|
||||||
JsonPatchOperationsBuilder,
|
|
||||||
UUIDService,
|
|
||||||
NotificationsService,
|
|
||||||
WorkspaceitemDataService,
|
|
||||||
WorkflowItemDataService,
|
|
||||||
DSpaceObjectDataService,
|
|
||||||
ConfigurationDataService,
|
|
||||||
DSOChangeAnalyzer,
|
|
||||||
DefaultChangeAnalyzer,
|
|
||||||
ArrayMoveChangeAnalyzer,
|
|
||||||
ObjectSelectService,
|
|
||||||
MenuService,
|
|
||||||
ObjectUpdatesService,
|
|
||||||
SearchService,
|
|
||||||
RelationshipDataService,
|
|
||||||
MyDSpaceGuard,
|
|
||||||
RoleService,
|
|
||||||
TaskResponseParsingService,
|
|
||||||
ClaimedTaskDataService,
|
|
||||||
PoolTaskDataService,
|
|
||||||
BitstreamDataService,
|
|
||||||
EntityTypeDataService,
|
|
||||||
ContentSourceResponseParsingService,
|
|
||||||
ItemTemplateDataService,
|
|
||||||
SearchService,
|
|
||||||
SidebarService,
|
|
||||||
SearchFilterService,
|
|
||||||
SearchFilterService,
|
|
||||||
SearchConfigurationService,
|
|
||||||
SelectableListService,
|
|
||||||
RelationshipTypeDataService,
|
|
||||||
ExternalSourceDataService,
|
|
||||||
LookupRelationService,
|
|
||||||
VersionDataService,
|
|
||||||
VersionHistoryDataService,
|
|
||||||
WorkflowActionDataService,
|
|
||||||
ProcessDataService,
|
|
||||||
ScriptDataService,
|
|
||||||
FeatureDataService,
|
|
||||||
AuthorizationDataService,
|
|
||||||
SiteAdministratorGuard,
|
|
||||||
SiteRegisterGuard,
|
|
||||||
MetadataSchemaDataService,
|
|
||||||
MetadataFieldDataService,
|
|
||||||
TokenResponseParsingService,
|
|
||||||
ReloadGuard,
|
|
||||||
EndUserAgreementCurrentUserGuard,
|
|
||||||
EndUserAgreementCookieGuard,
|
|
||||||
EndUserAgreementService,
|
|
||||||
RootDataService,
|
|
||||||
NotificationsService,
|
|
||||||
FilteredDiscoveryPageResponseParsingService,
|
|
||||||
{ provide: NativeWindowService, useFactory: NativeWindowFactory },
|
|
||||||
VocabularyService,
|
|
||||||
VocabularyDataService,
|
|
||||||
VocabularyEntryDetailsDataService,
|
|
||||||
SequenceService,
|
|
||||||
GroupDataService,
|
|
||||||
FeedbackDataService,
|
|
||||||
ResearcherProfileDataService,
|
|
||||||
ProfileClaimService,
|
|
||||||
OrcidAuthService,
|
|
||||||
OrcidQueueDataService,
|
|
||||||
OrcidHistoryDataService,
|
|
||||||
SupervisionOrderDataService
|
|
||||||
];
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Declaration needed to make sure all decorator functions are called in time
|
|
||||||
*/
|
|
||||||
export const models =
|
|
||||||
[
|
|
||||||
Root,
|
|
||||||
DSpaceObject,
|
|
||||||
Bundle,
|
|
||||||
Bitstream,
|
|
||||||
BitstreamFormat,
|
|
||||||
Item,
|
|
||||||
Site,
|
|
||||||
Collection,
|
|
||||||
Community,
|
|
||||||
EPerson,
|
|
||||||
Group,
|
|
||||||
ResourcePolicy,
|
|
||||||
MetadataSchema,
|
|
||||||
MetadataField,
|
|
||||||
License,
|
|
||||||
WorkflowItem,
|
|
||||||
WorkspaceItem,
|
|
||||||
SubmissionCcLicence,
|
|
||||||
SubmissionCcLicenceUrl,
|
|
||||||
SubmissionDefinitionsModel,
|
|
||||||
SubmissionFormsModel,
|
|
||||||
SubmissionSectionModel,
|
|
||||||
SubmissionUploadsModel,
|
|
||||||
AuthStatus,
|
|
||||||
BrowseEntry,
|
|
||||||
BrowseDefinition,
|
|
||||||
NonHierarchicalBrowseDefinition,
|
|
||||||
FlatBrowseDefinition,
|
|
||||||
ValueListBrowseDefinition,
|
|
||||||
HierarchicalBrowseDefinition,
|
|
||||||
ClaimedTask,
|
|
||||||
TaskObject,
|
|
||||||
PoolTask,
|
|
||||||
Relationship,
|
|
||||||
RelationshipType,
|
|
||||||
ItemType,
|
|
||||||
ExternalSource,
|
|
||||||
ExternalSourceEntry,
|
|
||||||
Script,
|
|
||||||
Process,
|
|
||||||
Version,
|
|
||||||
VersionHistory,
|
|
||||||
WorkflowAction,
|
|
||||||
AdvancedWorkflowInfo,
|
|
||||||
RatingAdvancedWorkflowInfo,
|
|
||||||
SelectReviewerAdvancedWorkflowInfo,
|
|
||||||
TemplateItem,
|
|
||||||
Feature,
|
|
||||||
Authorization,
|
|
||||||
Registration,
|
|
||||||
Vocabulary,
|
|
||||||
VocabularyEntry,
|
|
||||||
VocabularyEntryDetail,
|
|
||||||
ConfigurationProperty,
|
|
||||||
ShortLivedToken,
|
|
||||||
Registration,
|
|
||||||
UsageReport,
|
|
||||||
Root,
|
|
||||||
SearchConfig,
|
|
||||||
SubmissionAccessesModel,
|
|
||||||
AccessStatusObject,
|
|
||||||
ResearcherProfile,
|
|
||||||
OrcidQueue,
|
|
||||||
OrcidHistory,
|
|
||||||
AccessStatusObject,
|
|
||||||
IdentifierData,
|
|
||||||
Subscription,
|
|
||||||
ItemRequest,
|
|
||||||
BulkAccessConditionOptions
|
|
||||||
];
|
|
||||||
|
|
||||||
@NgModule({
|
|
||||||
imports: [
|
|
||||||
...IMPORTS
|
|
||||||
],
|
|
||||||
declarations: [
|
|
||||||
...DECLARATIONS
|
|
||||||
],
|
|
||||||
exports: [
|
|
||||||
...EXPORTS
|
|
||||||
],
|
|
||||||
providers: [
|
|
||||||
...PROVIDERS
|
|
||||||
]
|
|
||||||
})
|
|
||||||
|
|
||||||
export class CoreModule {
|
|
||||||
static forRoot(): ModuleWithProviders<CoreModule> {
|
|
||||||
return {
|
|
||||||
ngModule: CoreModule,
|
|
||||||
providers: [
|
|
||||||
...PROVIDERS
|
|
||||||
]
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
constructor(@Optional() @SkipSelf() parentModule: CoreModule) {
|
|
||||||
if (isNotEmpty(parentModule)) {
|
|
||||||
throw new Error('CoreModule is already loaded. Import it in the AppModule only');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@@ -4,18 +4,15 @@ import { ObjectCacheService } from '../cache/object-cache.service';
|
|||||||
import { HALEndpointService } from '../shared/hal-endpoint.service';
|
import { HALEndpointService } from '../shared/hal-endpoint.service';
|
||||||
import { RequestService } from './request.service';
|
import { RequestService } from './request.service';
|
||||||
import { AccessStatusObject } from 'src/app/shared/object-collection/shared/badges/access-status-badge/access-status.model';
|
import { AccessStatusObject } from 'src/app/shared/object-collection/shared/badges/access-status-badge/access-status.model';
|
||||||
import { ACCESS_STATUS } from 'src/app/shared/object-collection/shared/badges/access-status-badge/access-status.resource-type';
|
|
||||||
import { Observable } from 'rxjs';
|
import { Observable } from 'rxjs';
|
||||||
import { RemoteData } from './remote-data';
|
import { RemoteData } from './remote-data';
|
||||||
import { Item } from '../shared/item.model';
|
import { Item } from '../shared/item.model';
|
||||||
import { BaseDataService } from './base/base-data.service';
|
import { BaseDataService } from './base/base-data.service';
|
||||||
import { dataService } from './base/data-service.decorator';
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Data service responsible for retrieving the access status of Items
|
* Data service responsible for retrieving the access status of Items
|
||||||
*/
|
*/
|
||||||
@Injectable()
|
@Injectable({ providedIn: 'root' })
|
||||||
@dataService(ACCESS_STATUS)
|
|
||||||
export class AccessStatusDataService extends BaseDataService<AccessStatusObject> {
|
export class AccessStatusDataService extends BaseDataService<AccessStatusObject> {
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
|
@@ -6,7 +6,7 @@ import { hasValue } from '../../shared/empty.util';
|
|||||||
/**
|
/**
|
||||||
* A class to determine move operations between two arrays
|
* A class to determine move operations between two arrays
|
||||||
*/
|
*/
|
||||||
@Injectable()
|
@Injectable({ providedIn: 'root' })
|
||||||
export class ArrayMoveChangeAnalyzer<T> {
|
export class ArrayMoveChangeAnalyzer<T> {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -7,7 +7,6 @@ import { FollowLinkConfig } from '../../shared/utils/follow-link-config.model';
|
|||||||
import { RemoteDataBuildService } from '../cache/builders/remote-data-build.service';
|
import { RemoteDataBuildService } from '../cache/builders/remote-data-build.service';
|
||||||
import { ObjectCacheService } from '../cache/object-cache.service';
|
import { ObjectCacheService } from '../cache/object-cache.service';
|
||||||
import { Bitstream } from '../shared/bitstream.model';
|
import { Bitstream } from '../shared/bitstream.model';
|
||||||
import { BITSTREAM } from '../shared/bitstream.resource-type';
|
|
||||||
import { Bundle } from '../shared/bundle.model';
|
import { Bundle } from '../shared/bundle.model';
|
||||||
import { HALEndpointService } from '../shared/hal-endpoint.service';
|
import { HALEndpointService } from '../shared/hal-endpoint.service';
|
||||||
import { Item } from '../shared/item.model';
|
import { Item } from '../shared/item.model';
|
||||||
@@ -32,16 +31,12 @@ import { DeleteData, DeleteDataImpl } from './base/delete-data';
|
|||||||
import { NotificationsService } from '../../shared/notifications/notifications.service';
|
import { NotificationsService } from '../../shared/notifications/notifications.service';
|
||||||
import { NoContent } from '../shared/NoContent.model';
|
import { NoContent } from '../shared/NoContent.model';
|
||||||
import { IdentifiableDataService } from './base/identifiable-data.service';
|
import { IdentifiableDataService } from './base/identifiable-data.service';
|
||||||
import { dataService } from './base/data-service.decorator';
|
|
||||||
import { Operation, RemoveOperation } from 'fast-json-patch';
|
import { Operation, RemoveOperation } from 'fast-json-patch';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A service to retrieve {@link Bitstream}s from the REST API
|
* A service to retrieve {@link Bitstream}s from the REST API
|
||||||
*/
|
*/
|
||||||
@Injectable({
|
@Injectable({ providedIn: 'root' })
|
||||||
providedIn: 'root',
|
|
||||||
})
|
|
||||||
@dataService(BITSTREAM)
|
|
||||||
export class BitstreamDataService extends IdentifiableDataService<Bitstream> implements SearchData<Bitstream>, PatchData<Bitstream>, DeleteData<Bitstream> {
|
export class BitstreamDataService extends IdentifiableDataService<Bitstream> implements SearchData<Bitstream>, PatchData<Bitstream>, DeleteData<Bitstream> {
|
||||||
private searchData: SearchDataImpl<Bitstream>;
|
private searchData: SearchDataImpl<Bitstream>;
|
||||||
private patchData: PatchDataImpl<Bitstream>;
|
private patchData: PatchDataImpl<Bitstream>;
|
||||||
|
@@ -2,14 +2,17 @@ import { Injectable } from '@angular/core';
|
|||||||
import { createSelector, select, Store } from '@ngrx/store';
|
import { createSelector, select, Store } from '@ngrx/store';
|
||||||
import { Observable } from 'rxjs';
|
import { Observable } from 'rxjs';
|
||||||
import { distinctUntilChanged, map, tap } from 'rxjs/operators';
|
import { distinctUntilChanged, map, tap } from 'rxjs/operators';
|
||||||
import { BitstreamFormatsRegistryDeselectAction, BitstreamFormatsRegistryDeselectAllAction, BitstreamFormatsRegistrySelectAction } from '../../admin/admin-registries/bitstream-formats/bitstream-format.actions';
|
import {
|
||||||
|
BitstreamFormatsRegistryDeselectAction,
|
||||||
|
BitstreamFormatsRegistryDeselectAllAction,
|
||||||
|
BitstreamFormatsRegistrySelectAction
|
||||||
|
} from '../../admin/admin-registries/bitstream-formats/bitstream-format.actions';
|
||||||
import { BitstreamFormatRegistryState } from '../../admin/admin-registries/bitstream-formats/bitstream-format.reducers';
|
import { BitstreamFormatRegistryState } from '../../admin/admin-registries/bitstream-formats/bitstream-format.reducers';
|
||||||
import { NotificationsService } from '../../shared/notifications/notifications.service';
|
import { NotificationsService } from '../../shared/notifications/notifications.service';
|
||||||
import { RemoteDataBuildService } from '../cache/builders/remote-data-build.service';
|
import { RemoteDataBuildService } from '../cache/builders/remote-data-build.service';
|
||||||
import { ObjectCacheService } from '../cache/object-cache.service';
|
import { ObjectCacheService } from '../cache/object-cache.service';
|
||||||
import { coreSelector } from '../core.selectors';
|
import { coreSelector } from '../core.selectors';
|
||||||
import { BitstreamFormat } from '../shared/bitstream-format.model';
|
import { BitstreamFormat } from '../shared/bitstream-format.model';
|
||||||
import { BITSTREAM_FORMAT } from '../shared/bitstream-format.resource-type';
|
|
||||||
import { Bitstream } from '../shared/bitstream.model';
|
import { Bitstream } from '../shared/bitstream.model';
|
||||||
import { HALEndpointService } from '../shared/hal-endpoint.service';
|
import { HALEndpointService } from '../shared/hal-endpoint.service';
|
||||||
import { RemoteData } from './remote-data';
|
import { RemoteData } from './remote-data';
|
||||||
@@ -24,7 +27,6 @@ import { FollowLinkConfig } from 'src/app/shared/utils/follow-link-config.model'
|
|||||||
import { FindListOptions } from './find-list-options.model';
|
import { FindListOptions } from './find-list-options.model';
|
||||||
import { PaginatedList } from './paginated-list.model';
|
import { PaginatedList } from './paginated-list.model';
|
||||||
import { NoContent } from '../shared/NoContent.model';
|
import { NoContent } from '../shared/NoContent.model';
|
||||||
import { dataService } from './base/data-service.decorator';
|
|
||||||
|
|
||||||
const bitstreamFormatsStateSelector = createSelector(
|
const bitstreamFormatsStateSelector = createSelector(
|
||||||
coreSelector,
|
coreSelector,
|
||||||
@@ -38,8 +40,7 @@ const selectedBitstreamFormatSelector = createSelector(
|
|||||||
/**
|
/**
|
||||||
* A service responsible for fetching/sending data from/to the REST API on the bitstreamformats endpoint
|
* A service responsible for fetching/sending data from/to the REST API on the bitstreamformats endpoint
|
||||||
*/
|
*/
|
||||||
@Injectable()
|
@Injectable({ providedIn: 'root' })
|
||||||
@dataService(BITSTREAM_FORMAT)
|
|
||||||
export class BitstreamFormatDataService extends IdentifiableDataService<BitstreamFormat> implements FindAllData<BitstreamFormat>, DeleteData<BitstreamFormat> {
|
export class BitstreamFormatDataService extends IdentifiableDataService<BitstreamFormat> implements FindAllData<BitstreamFormat>, DeleteData<BitstreamFormat> {
|
||||||
|
|
||||||
protected linkPath = 'bitstreamformats';
|
protected linkPath = 'bitstreamformats';
|
||||||
|
@@ -27,10 +27,7 @@ import { dataService } from './base/data-service.decorator';
|
|||||||
/**
|
/**
|
||||||
* A service to retrieve {@link Bundle}s from the REST API
|
* A service to retrieve {@link Bundle}s from the REST API
|
||||||
*/
|
*/
|
||||||
@Injectable(
|
@Injectable({ providedIn: 'root' })
|
||||||
{ providedIn: 'root' },
|
|
||||||
)
|
|
||||||
@dataService(BUNDLE)
|
|
||||||
export class BundleDataService extends IdentifiableDataService<Bundle> implements PatchData<Bundle> {
|
export class BundleDataService extends IdentifiableDataService<Bundle> implements PatchData<Bundle> {
|
||||||
private bitstreamsEndpoint = 'bitstreams';
|
private bitstreamsEndpoint = 'bitstreams';
|
||||||
|
|
||||||
|
@@ -14,7 +14,6 @@ import { ObjectCacheService } from '../cache/object-cache.service';
|
|||||||
import { HttpOptions } from '../dspace-rest/dspace-rest.service';
|
import { HttpOptions } from '../dspace-rest/dspace-rest.service';
|
||||||
import { DSpaceSerializer } from '../dspace-rest/dspace.serializer';
|
import { DSpaceSerializer } from '../dspace-rest/dspace.serializer';
|
||||||
import { Collection } from '../shared/collection.model';
|
import { Collection } from '../shared/collection.model';
|
||||||
import { COLLECTION } from '../shared/collection.resource-type';
|
|
||||||
import { ContentSource } from '../shared/content-source.model';
|
import { ContentSource } from '../shared/content-source.model';
|
||||||
import { HALEndpointService } from '../shared/hal-endpoint.service';
|
import { HALEndpointService } from '../shared/hal-endpoint.service';
|
||||||
import { Item } from '../shared/item.model';
|
import { Item } from '../shared/item.model';
|
||||||
@@ -33,10 +32,8 @@ import { BitstreamDataService } from './bitstream-data.service';
|
|||||||
import { RestRequest } from './rest-request.model';
|
import { RestRequest } from './rest-request.model';
|
||||||
import { FindListOptions } from './find-list-options.model';
|
import { FindListOptions } from './find-list-options.model';
|
||||||
import { Community } from '../shared/community.model';
|
import { Community } from '../shared/community.model';
|
||||||
import { dataService } from './base/data-service.decorator';
|
|
||||||
|
|
||||||
@Injectable()
|
@Injectable({ providedIn: 'root' })
|
||||||
@dataService(COLLECTION)
|
|
||||||
export class CollectionDataService extends ComColDataService<Collection> {
|
export class CollectionDataService extends ComColDataService<Collection> {
|
||||||
protected errorTitle = 'collection.source.update.notifications.error.title';
|
protected errorTitle = 'collection.source.update.notifications.error.title';
|
||||||
protected contentSourceError = 'collection.source.update.notifications.error.content';
|
protected contentSourceError = 'collection.source.update.notifications.error.content';
|
||||||
|
@@ -6,7 +6,6 @@ import { NotificationsService } from '../../shared/notifications/notifications.s
|
|||||||
import { RemoteDataBuildService } from '../cache/builders/remote-data-build.service';
|
import { RemoteDataBuildService } from '../cache/builders/remote-data-build.service';
|
||||||
import { ObjectCacheService } from '../cache/object-cache.service';
|
import { ObjectCacheService } from '../cache/object-cache.service';
|
||||||
import { Community } from '../shared/community.model';
|
import { Community } from '../shared/community.model';
|
||||||
import { COMMUNITY } from '../shared/community.resource-type';
|
|
||||||
import { HALEndpointService } from '../shared/hal-endpoint.service';
|
import { HALEndpointService } from '../shared/hal-endpoint.service';
|
||||||
import { ComColDataService } from './comcol-data.service';
|
import { ComColDataService } from './comcol-data.service';
|
||||||
import { DSOChangeAnalyzer } from './dso-change-analyzer.service';
|
import { DSOChangeAnalyzer } from './dso-change-analyzer.service';
|
||||||
@@ -17,10 +16,8 @@ import { BitstreamDataService } from './bitstream-data.service';
|
|||||||
import { FollowLinkConfig } from '../../shared/utils/follow-link-config.model';
|
import { FollowLinkConfig } from '../../shared/utils/follow-link-config.model';
|
||||||
import { isNotEmpty } from '../../shared/empty.util';
|
import { isNotEmpty } from '../../shared/empty.util';
|
||||||
import { FindListOptions } from './find-list-options.model';
|
import { FindListOptions } from './find-list-options.model';
|
||||||
import { dataService } from './base/data-service.decorator';
|
|
||||||
|
|
||||||
@Injectable()
|
@Injectable({ providedIn: 'root' })
|
||||||
@dataService(COMMUNITY)
|
|
||||||
export class CommunityDataService extends ComColDataService<Community> {
|
export class CommunityDataService extends ComColDataService<Community> {
|
||||||
protected topLinkPath = 'search/top';
|
protected topLinkPath = 'search/top';
|
||||||
|
|
||||||
|
@@ -7,12 +7,9 @@ import { HALEndpointService } from '../shared/hal-endpoint.service';
|
|||||||
import { RemoteData } from './remote-data';
|
import { RemoteData } from './remote-data';
|
||||||
import { RequestService } from './request.service';
|
import { RequestService } from './request.service';
|
||||||
import { ConfigurationProperty } from '../shared/configuration-property.model';
|
import { ConfigurationProperty } from '../shared/configuration-property.model';
|
||||||
import { CONFIG_PROPERTY } from '../shared/config-property.resource-type';
|
|
||||||
import { IdentifiableDataService } from './base/identifiable-data.service';
|
import { IdentifiableDataService } from './base/identifiable-data.service';
|
||||||
import { dataService } from './base/data-service.decorator';
|
|
||||||
|
|
||||||
@Injectable()
|
@Injectable({ providedIn: 'root' })
|
||||||
@dataService(CONFIG_PROPERTY)
|
|
||||||
/**
|
/**
|
||||||
* Data Service responsible for retrieving Configuration properties
|
* Data Service responsible for retrieving Configuration properties
|
||||||
*/
|
*/
|
||||||
|
@@ -7,7 +7,7 @@ import { MetadataConfig } from '../shared/metadata-config.model';
|
|||||||
import { DspaceRestResponseParsingService } from './dspace-rest-response-parsing.service';
|
import { DspaceRestResponseParsingService } from './dspace-rest-response-parsing.service';
|
||||||
import { RestRequest } from './rest-request.model';
|
import { RestRequest } from './rest-request.model';
|
||||||
|
|
||||||
@Injectable()
|
@Injectable({ providedIn: 'root' })
|
||||||
/**
|
/**
|
||||||
* A ResponseParsingService used to parse RawRestResponse coming from the REST API to a ContentSource object
|
* A ResponseParsingService used to parse RawRestResponse coming from the REST API to a ContentSource object
|
||||||
*/
|
*/
|
||||||
|
@@ -4,7 +4,7 @@ import { RawRestResponse } from '../dspace-rest/raw-rest-response.model';
|
|||||||
import { ResponseParsingService } from './parsing.service';
|
import { ResponseParsingService } from './parsing.service';
|
||||||
import { RestRequest } from './rest-request.model';
|
import { RestRequest } from './rest-request.model';
|
||||||
|
|
||||||
@Injectable()
|
@Injectable({ providedIn: 'root' })
|
||||||
export class DebugResponseParsingService implements ResponseParsingService {
|
export class DebugResponseParsingService implements ResponseParsingService {
|
||||||
parse(request: RestRequest, data: RawRestResponse): RestResponse {
|
parse(request: RestRequest, data: RawRestResponse): RestResponse {
|
||||||
console.log('request', request, 'data', data);
|
console.log('request', request, 'data', data);
|
||||||
|
@@ -10,7 +10,7 @@ import { TypedObject } from '../cache/typed-object.model';
|
|||||||
* A class to determine what differs between two
|
* A class to determine what differs between two
|
||||||
* CacheableObjects
|
* CacheableObjects
|
||||||
*/
|
*/
|
||||||
@Injectable()
|
@Injectable({ providedIn: 'root' })
|
||||||
export class DefaultChangeAnalyzer<T extends TypedObject> implements ChangeAnalyzer<T> {
|
export class DefaultChangeAnalyzer<T extends TypedObject> implements ChangeAnalyzer<T> {
|
||||||
/**
|
/**
|
||||||
* Compare the metadata of two CacheableObject and return the differences as
|
* Compare the metadata of two CacheableObject and return the differences as
|
||||||
|
@@ -9,7 +9,7 @@ import cloneDeep from 'lodash/cloneDeep';
|
|||||||
* A class to determine what differs between two
|
* A class to determine what differs between two
|
||||||
* DSpaceObjects
|
* DSpaceObjects
|
||||||
*/
|
*/
|
||||||
@Injectable()
|
@Injectable({ providedIn: 'root' })
|
||||||
export class DSOChangeAnalyzer<T extends DSpaceObject> implements ChangeAnalyzer<T> {
|
export class DSOChangeAnalyzer<T extends DSpaceObject> implements ChangeAnalyzer<T> {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -14,7 +14,7 @@ import { RestRequest } from './rest-request.model';
|
|||||||
* @deprecated use DspaceRestResponseParsingService for new code, this is only left to support a
|
* @deprecated use DspaceRestResponseParsingService for new code, this is only left to support a
|
||||||
* few legacy use cases, and should get removed eventually
|
* few legacy use cases, and should get removed eventually
|
||||||
*/
|
*/
|
||||||
@Injectable()
|
@Injectable({ providedIn: 'root' })
|
||||||
export class DSOResponseParsingService extends BaseResponseParsingService implements ResponseParsingService {
|
export class DSOResponseParsingService extends BaseResponseParsingService implements ResponseParsingService {
|
||||||
protected toCache = true;
|
protected toCache = true;
|
||||||
|
|
||||||
|
@@ -2,14 +2,11 @@ import { Injectable } from '@angular/core';
|
|||||||
import { RemoteDataBuildService } from '../cache/builders/remote-data-build.service';
|
import { RemoteDataBuildService } from '../cache/builders/remote-data-build.service';
|
||||||
import { ObjectCacheService } from '../cache/object-cache.service';
|
import { ObjectCacheService } from '../cache/object-cache.service';
|
||||||
import { DSpaceObject } from '../shared/dspace-object.model';
|
import { DSpaceObject } from '../shared/dspace-object.model';
|
||||||
import { DSPACE_OBJECT } from '../shared/dspace-object.resource-type';
|
|
||||||
import { HALEndpointService } from '../shared/hal-endpoint.service';
|
import { HALEndpointService } from '../shared/hal-endpoint.service';
|
||||||
import { RequestService } from './request.service';
|
import { RequestService } from './request.service';
|
||||||
import { IdentifiableDataService } from './base/identifiable-data.service';
|
import { IdentifiableDataService } from './base/identifiable-data.service';
|
||||||
import { dataService } from './base/data-service.decorator';
|
|
||||||
|
|
||||||
@Injectable()
|
@Injectable({ providedIn: 'root' })
|
||||||
@dataService(DSPACE_OBJECT)
|
|
||||||
export class DSpaceObjectDataService extends IdentifiableDataService<DSpaceObject> {
|
export class DSpaceObjectDataService extends IdentifiableDataService<DSpaceObject> {
|
||||||
constructor(
|
constructor(
|
||||||
protected requestService: RequestService,
|
protected requestService: RequestService,
|
||||||
|
@@ -20,7 +20,7 @@ import { RestRequest } from './rest-request.model';
|
|||||||
*
|
*
|
||||||
* When all endpoints are properly typed, it can be removed.
|
* When all endpoints are properly typed, it can be removed.
|
||||||
*/
|
*/
|
||||||
@Injectable()
|
@Injectable({ providedIn: 'root' })
|
||||||
export class EndpointMapResponseParsingService extends DspaceRestResponseParsingService {
|
export class EndpointMapResponseParsingService extends DspaceRestResponseParsingService {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -20,7 +20,7 @@ import { FindAllData, FindAllDataImpl } from './base/find-all-data';
|
|||||||
/**
|
/**
|
||||||
* Service handling all ItemType requests
|
* Service handling all ItemType requests
|
||||||
*/
|
*/
|
||||||
@Injectable()
|
@Injectable({ providedIn: 'root' })
|
||||||
export class EntityTypeDataService extends BaseDataService<ItemType> implements FindAllData<ItemType>, SearchData<ItemType> {
|
export class EntityTypeDataService extends BaseDataService<ItemType> implements FindAllData<ItemType>, SearchData<ItemType> {
|
||||||
private findAllData: FindAllData<ItemType>;
|
private findAllData: FindAllData<ItemType>;
|
||||||
private searchData: SearchDataImpl<ItemType>;
|
private searchData: SearchDataImpl<ItemType>;
|
||||||
|
@@ -19,7 +19,7 @@ import { SearchData, SearchDataImpl } from './base/search-data';
|
|||||||
/**
|
/**
|
||||||
* A service handling all external source requests
|
* A service handling all external source requests
|
||||||
*/
|
*/
|
||||||
@Injectable()
|
@Injectable({ providedIn: 'root' })
|
||||||
export class ExternalSourceDataService extends IdentifiableDataService<ExternalSource> implements SearchData<ExternalSource> {
|
export class ExternalSourceDataService extends IdentifiableDataService<ExternalSource> implements SearchData<ExternalSource> {
|
||||||
private searchData: SearchData<ExternalSource>;
|
private searchData: SearchData<ExternalSource>;
|
||||||
|
|
||||||
|
@@ -7,7 +7,7 @@ import { DspaceRestResponseParsingService } from './dspace-rest-response-parsing
|
|||||||
import { FacetConfigResponse } from '../../shared/search/models/facet-config-response.model';
|
import { FacetConfigResponse } from '../../shared/search/models/facet-config-response.model';
|
||||||
import { RestRequest } from './rest-request.model';
|
import { RestRequest } from './rest-request.model';
|
||||||
|
|
||||||
@Injectable()
|
@Injectable({ providedIn: 'root' })
|
||||||
export class FacetConfigResponseParsingService extends DspaceRestResponseParsingService {
|
export class FacetConfigResponseParsingService extends DspaceRestResponseParsingService {
|
||||||
parse(request: RestRequest, data: RawRestResponse): ParsedResponse {
|
parse(request: RestRequest, data: RawRestResponse): ParsedResponse {
|
||||||
|
|
||||||
|
@@ -7,7 +7,7 @@ import { FacetValues } from '../../shared/search/models/facet-values.model';
|
|||||||
import { DspaceRestResponseParsingService } from './dspace-rest-response-parsing.service';
|
import { DspaceRestResponseParsingService } from './dspace-rest-response-parsing.service';
|
||||||
import { RestRequest } from './rest-request.model';
|
import { RestRequest } from './rest-request.model';
|
||||||
|
|
||||||
@Injectable()
|
@Injectable({ providedIn: 'root' })
|
||||||
export class FacetValueResponseParsingService extends DspaceRestResponseParsingService {
|
export class FacetValueResponseParsingService extends DspaceRestResponseParsingService {
|
||||||
parse(request: RestRequest, data: RawRestResponse): ParsedResponse {
|
parse(request: RestRequest, data: RawRestResponse): ParsedResponse {
|
||||||
const payload = data.payload;
|
const payload = data.payload;
|
||||||
|
@@ -1,6 +1,5 @@
|
|||||||
import { Observable, of as observableOf } from 'rxjs';
|
import { Observable, of as observableOf } from 'rxjs';
|
||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
import { AUTHORIZATION } from '../../shared/authorization.resource-type';
|
|
||||||
import { Authorization } from '../../shared/authorization.model';
|
import { Authorization } from '../../shared/authorization.model';
|
||||||
import { RequestService } from '../request.service';
|
import { RequestService } from '../request.service';
|
||||||
import { RemoteDataBuildService } from '../../cache/builders/remote-data-build.service';
|
import { RemoteDataBuildService } from '../../cache/builders/remote-data-build.service';
|
||||||
@@ -20,13 +19,11 @@ import { getFirstCompletedRemoteData } from '../../shared/operators';
|
|||||||
import { FindListOptions } from '../find-list-options.model';
|
import { FindListOptions } from '../find-list-options.model';
|
||||||
import { BaseDataService } from '../base/base-data.service';
|
import { BaseDataService } from '../base/base-data.service';
|
||||||
import { SearchData, SearchDataImpl } from '../base/search-data';
|
import { SearchData, SearchDataImpl } from '../base/search-data';
|
||||||
import { dataService } from '../base/data-service.decorator';
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A service to retrieve {@link Authorization}s from the REST API
|
* A service to retrieve {@link Authorization}s from the REST API
|
||||||
*/
|
*/
|
||||||
@Injectable()
|
@Injectable({ providedIn: 'root' })
|
||||||
@dataService(AUTHORIZATION)
|
|
||||||
export class AuthorizationDataService extends BaseDataService<Authorization> implements SearchData<Authorization> {
|
export class AuthorizationDataService extends BaseDataService<Authorization> implements SearchData<Authorization> {
|
||||||
protected linkPath = 'authorizations';
|
protected linkPath = 'authorizations';
|
||||||
protected searchByObjectPath = 'object';
|
protected searchByObjectPath = 'object';
|
||||||
|
@@ -10,9 +10,7 @@ import { AuthService } from '../../../auth/auth.service';
|
|||||||
* Prevent unauthorized activating and loading of routes when the current authenticated user doesn't have administrator
|
* Prevent unauthorized activating and loading of routes when the current authenticated user doesn't have administrator
|
||||||
* rights to the {@link Site}
|
* rights to the {@link Site}
|
||||||
*/
|
*/
|
||||||
@Injectable({
|
@Injectable({ providedIn: 'root' })
|
||||||
providedIn: 'root'
|
|
||||||
})
|
|
||||||
export class SiteAdministratorGuard extends SingleFeatureAuthorizationGuard {
|
export class SiteAdministratorGuard extends SingleFeatureAuthorizationGuard {
|
||||||
constructor(protected authorizationService: AuthorizationDataService, protected router: Router, protected authService: AuthService) {
|
constructor(protected authorizationService: AuthorizationDataService, protected router: Router, protected authService: AuthService) {
|
||||||
super(authorizationService, router, authService);
|
super(authorizationService, router, authService);
|
||||||
|
@@ -10,9 +10,7 @@ import { AuthService } from '../../../auth/auth.service';
|
|||||||
* Prevent unauthorized activating and loading of routes when the current authenticated user doesn't have registration
|
* Prevent unauthorized activating and loading of routes when the current authenticated user doesn't have registration
|
||||||
* rights to the {@link Site}
|
* rights to the {@link Site}
|
||||||
*/
|
*/
|
||||||
@Injectable({
|
@Injectable({ providedIn: 'root' })
|
||||||
providedIn: 'root'
|
|
||||||
})
|
|
||||||
export class SiteRegisterGuard extends SingleFeatureAuthorizationGuard {
|
export class SiteRegisterGuard extends SingleFeatureAuthorizationGuard {
|
||||||
constructor(protected authorizationService: AuthorizationDataService, protected router: Router, protected authService: AuthService) {
|
constructor(protected authorizationService: AuthorizationDataService, protected router: Router, protected authService: AuthService) {
|
||||||
super(authorizationService, router, authService);
|
super(authorizationService, router, authService);
|
||||||
|
@@ -1,18 +1,15 @@
|
|||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
import { FEATURE } from '../../shared/feature.resource-type';
|
|
||||||
import { Feature } from '../../shared/feature.model';
|
import { Feature } from '../../shared/feature.model';
|
||||||
import { RequestService } from '../request.service';
|
import { RequestService } from '../request.service';
|
||||||
import { RemoteDataBuildService } from '../../cache/builders/remote-data-build.service';
|
import { RemoteDataBuildService } from '../../cache/builders/remote-data-build.service';
|
||||||
import { ObjectCacheService } from '../../cache/object-cache.service';
|
import { ObjectCacheService } from '../../cache/object-cache.service';
|
||||||
import { HALEndpointService } from '../../shared/hal-endpoint.service';
|
import { HALEndpointService } from '../../shared/hal-endpoint.service';
|
||||||
import { BaseDataService } from '../base/base-data.service';
|
import { BaseDataService } from '../base/base-data.service';
|
||||||
import { dataService } from '../base/data-service.decorator';
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A service to retrieve {@link Feature}s from the REST API
|
* A service to retrieve {@link Feature}s from the REST API
|
||||||
*/
|
*/
|
||||||
@Injectable()
|
@Injectable({ providedIn: 'root' })
|
||||||
@dataService(FEATURE)
|
|
||||||
export class FeatureDataService extends BaseDataService<Feature> {
|
export class FeatureDataService extends BaseDataService<Feature> {
|
||||||
protected linkPath = 'features';
|
protected linkPath = 'features';
|
||||||
|
|
||||||
|
@@ -10,7 +10,7 @@ import { RestRequest } from './rest-request.model';
|
|||||||
* A ResponseParsingService used to parse RawRestResponse coming from the REST API to a discovery query (string)
|
* A ResponseParsingService used to parse RawRestResponse coming from the REST API to a discovery query (string)
|
||||||
* wrapped in a FilteredDiscoveryQueryResponse
|
* wrapped in a FilteredDiscoveryQueryResponse
|
||||||
*/
|
*/
|
||||||
@Injectable()
|
@Injectable({ providedIn: 'root' })
|
||||||
export class FilteredDiscoveryPageResponseParsingService extends BaseResponseParsingService implements ResponseParsingService {
|
export class FilteredDiscoveryPageResponseParsingService extends BaseResponseParsingService implements ResponseParsingService {
|
||||||
objectFactory = {};
|
objectFactory = {};
|
||||||
toCache = false;
|
toCache = false;
|
||||||
|
@@ -3,18 +3,14 @@ import { RemoteDataBuildService } from '../cache/builders/remote-data-build.serv
|
|||||||
import { ObjectCacheService } from '../cache/object-cache.service';
|
import { ObjectCacheService } from '../cache/object-cache.service';
|
||||||
import { HALEndpointService } from '../shared/hal-endpoint.service';
|
import { HALEndpointService } from '../shared/hal-endpoint.service';
|
||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
import { VOCABULARY_ENTRY } from '../submission/vocabularies/models/vocabularies.resource-type';
|
|
||||||
import { FollowLinkConfig } from '../../shared/utils/follow-link-config.model';
|
import { FollowLinkConfig } from '../../shared/utils/follow-link-config.model';
|
||||||
import { RemoteData } from './remote-data';
|
import { RemoteData } from './remote-data';
|
||||||
import { Observable } from 'rxjs';
|
import { Observable } from 'rxjs';
|
||||||
import { PaginatedList } from './paginated-list.model';
|
import { PaginatedList } from './paginated-list.model';
|
||||||
import { ITEM_TYPE } from '../shared/item-relationships/item-type.resource-type';
|
|
||||||
import { LICENSE } from '../shared/license.resource-type';
|
|
||||||
import { CacheableObject } from '../cache/cacheable-object.model';
|
import { CacheableObject } from '../cache/cacheable-object.model';
|
||||||
import { FindListOptions } from './find-list-options.model';
|
import { FindListOptions } from './find-list-options.model';
|
||||||
import { BaseDataService } from './base/base-data.service';
|
import { BaseDataService } from './base/base-data.service';
|
||||||
import { HALDataService } from './base/hal-data-service.interface';
|
import { HALDataService } from './base/hal-data-service.interface';
|
||||||
import { dataService } from './base/data-service.decorator';
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A DataService with only findByHref methods. Its purpose is to be used for resources that don't
|
* A DataService with only findByHref methods. Its purpose is to be used for resources that don't
|
||||||
@@ -32,12 +28,7 @@ import { dataService } from './base/data-service.decorator';
|
|||||||
* ```
|
* ```
|
||||||
* This means we cannot extend from {@link BaseDataService} directly because the method signatures would not match.
|
* This means we cannot extend from {@link BaseDataService} directly because the method signatures would not match.
|
||||||
*/
|
*/
|
||||||
@Injectable({
|
@Injectable({providedIn: 'root'})
|
||||||
providedIn: 'root',
|
|
||||||
})
|
|
||||||
@dataService(VOCABULARY_ENTRY)
|
|
||||||
@dataService(ITEM_TYPE)
|
|
||||||
@dataService(LICENSE)
|
|
||||||
export class HrefOnlyDataService implements HALDataService<any> {
|
export class HrefOnlyDataService implements HALDataService<any> {
|
||||||
/**
|
/**
|
||||||
* Works with a {@link BaseDataService} internally, but only exposes two of its methods
|
* Works with a {@link BaseDataService} internally, but only exposes two of its methods
|
||||||
|
@@ -2,7 +2,6 @@ import { HttpClient, HttpHeaders, HttpParams } from '@angular/common/http';
|
|||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
import { Store } from '@ngrx/store';
|
import { Store } from '@ngrx/store';
|
||||||
import { NotificationsService } from '../../shared/notifications/notifications.service';
|
import { NotificationsService } from '../../shared/notifications/notifications.service';
|
||||||
import { dataService } from './base/data-service.decorator';
|
|
||||||
import { RemoteDataBuildService } from '../cache/builders/remote-data-build.service';
|
import { RemoteDataBuildService } from '../cache/builders/remote-data-build.service';
|
||||||
import { ObjectCacheService } from '../cache/object-cache.service';
|
import { ObjectCacheService } from '../cache/object-cache.service';
|
||||||
import { HALEndpointService } from '../shared/hal-endpoint.service';
|
import { HALEndpointService } from '../shared/hal-endpoint.service';
|
||||||
@@ -13,12 +12,11 @@ import { CoreState } from '../core-state.model';
|
|||||||
import { Observable } from 'rxjs';
|
import { Observable } from 'rxjs';
|
||||||
import { RemoteData } from './remote-data';
|
import { RemoteData } from './remote-data';
|
||||||
import { Item } from '../shared/item.model';
|
import { Item } from '../shared/item.model';
|
||||||
import { IDENTIFIERS } from '../../shared/object-list/identifier-data/identifier-data.resource-type';
|
|
||||||
import { IdentifierData } from '../../shared/object-list/identifier-data/identifier-data.model';
|
import { IdentifierData } from '../../shared/object-list/identifier-data/identifier-data.model';
|
||||||
import { getFirstCompletedRemoteData } from '../shared/operators';
|
import { getFirstCompletedRemoteData } from '../shared/operators';
|
||||||
import { map, switchMap } from 'rxjs/operators';
|
import { map, switchMap } from 'rxjs/operators';
|
||||||
import {ConfigurationProperty} from '../shared/configuration-property.model';
|
import { ConfigurationProperty } from '../shared/configuration-property.model';
|
||||||
import {ConfigurationDataService} from './configuration-data.service';
|
import { ConfigurationDataService } from './configuration-data.service';
|
||||||
import { HttpOptions } from '../dspace-rest/dspace-rest.service';
|
import { HttpOptions } from '../dspace-rest/dspace-rest.service';
|
||||||
import { PostRequest } from './request.models';
|
import { PostRequest } from './request.models';
|
||||||
import { sendRequest } from '../shared/request.operators';
|
import { sendRequest } from '../shared/request.operators';
|
||||||
@@ -29,8 +27,7 @@ import { RestRequest } from './rest-request.model';
|
|||||||
* from the /identifiers endpoint, as well as the backend configuration that controls whether a 'Register DOI'
|
* from the /identifiers endpoint, as well as the backend configuration that controls whether a 'Register DOI'
|
||||||
* button appears for admins in the item status page
|
* button appears for admins in the item status page
|
||||||
*/
|
*/
|
||||||
@Injectable()
|
@Injectable({ providedIn: 'root' })
|
||||||
@dataService(IDENTIFIERS)
|
|
||||||
export class IdentifierDataService extends BaseDataService<IdentifierData> {
|
export class IdentifierDataService extends BaseDataService<IdentifierData> {
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
|
@@ -20,7 +20,6 @@ import { Collection } from '../shared/collection.model';
|
|||||||
import { ExternalSourceEntry } from '../shared/external-source-entry.model';
|
import { ExternalSourceEntry } from '../shared/external-source-entry.model';
|
||||||
import { HALEndpointService } from '../shared/hal-endpoint.service';
|
import { HALEndpointService } from '../shared/hal-endpoint.service';
|
||||||
import { Item } from '../shared/item.model';
|
import { Item } from '../shared/item.model';
|
||||||
import { ITEM } from '../shared/item.resource-type';
|
|
||||||
import { URLCombiner } from '../url-combiner/url-combiner';
|
import { URLCombiner } from '../url-combiner/url-combiner';
|
||||||
import { DSOChangeAnalyzer } from './dso-change-analyzer.service';
|
import { DSOChangeAnalyzer } from './dso-change-analyzer.service';
|
||||||
import { PaginatedList } from './paginated-list.model';
|
import { PaginatedList } from './paginated-list.model';
|
||||||
@@ -45,7 +44,6 @@ import { DeleteData, DeleteDataImpl } from './base/delete-data';
|
|||||||
import { RestRequestMethod } from './rest-request-method';
|
import { RestRequestMethod } from './rest-request-method';
|
||||||
import { CreateData, CreateDataImpl } from './base/create-data';
|
import { CreateData, CreateDataImpl } from './base/create-data';
|
||||||
import { RequestParam } from '../cache/models/request-param.model';
|
import { RequestParam } from '../cache/models/request-param.model';
|
||||||
import { dataService } from './base/data-service.decorator';
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* An abstract service for CRUD operations on Items
|
* An abstract service for CRUD operations on Items
|
||||||
@@ -403,8 +401,7 @@ export abstract class BaseItemDataService extends IdentifiableDataService<Item>
|
|||||||
/**
|
/**
|
||||||
* A service for CRUD operations on Items
|
* A service for CRUD operations on Items
|
||||||
*/
|
*/
|
||||||
@Injectable()
|
@Injectable({ providedIn: 'root' })
|
||||||
@dataService(ITEM)
|
|
||||||
export class ItemDataService extends BaseItemDataService {
|
export class ItemDataService extends BaseItemDataService {
|
||||||
constructor(
|
constructor(
|
||||||
protected requestService: RequestService,
|
protected requestService: RequestService,
|
||||||
|
@@ -63,7 +63,7 @@ class CollectionItemTemplateDataService extends IdentifiableDataService<Item> {
|
|||||||
/**
|
/**
|
||||||
* A service responsible for fetching/sending data from/to the REST API on a collection's itemtemplates endpoint
|
* A service responsible for fetching/sending data from/to the REST API on a collection's itemtemplates endpoint
|
||||||
*/
|
*/
|
||||||
@Injectable()
|
@Injectable({ providedIn: 'root' })
|
||||||
export class ItemTemplateDataService extends BaseItemDataService {
|
export class ItemTemplateDataService extends BaseItemDataService {
|
||||||
private byCollection: CollectionItemTemplateDataService;
|
private byCollection: CollectionItemTemplateDataService;
|
||||||
|
|
||||||
|
@@ -19,7 +19,7 @@ import { RequestService } from './request.service';
|
|||||||
/**
|
/**
|
||||||
* A service for retrieving local and external entries information during a relation lookup
|
* A service for retrieving local and external entries information during a relation lookup
|
||||||
*/
|
*/
|
||||||
@Injectable()
|
@Injectable({ providedIn: 'root' })
|
||||||
export class LookupRelationService {
|
export class LookupRelationService {
|
||||||
/**
|
/**
|
||||||
* The search config last used for retrieving local results
|
* The search config last used for retrieving local results
|
||||||
|
@@ -5,7 +5,6 @@ import { RemoteData } from './remote-data';
|
|||||||
import { RequestService } from './request.service';
|
import { RequestService } from './request.service';
|
||||||
import { RemoteDataBuildService } from '../cache/builders/remote-data-build.service';
|
import { RemoteDataBuildService } from '../cache/builders/remote-data-build.service';
|
||||||
import { HALEndpointService } from '../shared/hal-endpoint.service';
|
import { HALEndpointService } from '../shared/hal-endpoint.service';
|
||||||
import { METADATA_FIELD } from '../metadata/metadata-field.resource-type';
|
|
||||||
import { MetadataField } from '../metadata/metadata-field.model';
|
import { MetadataField } from '../metadata/metadata-field.model';
|
||||||
import { MetadataSchema } from '../metadata/metadata-schema.model';
|
import { MetadataSchema } from '../metadata/metadata-schema.model';
|
||||||
import { FollowLinkConfig } from '../../shared/utils/follow-link-config.model';
|
import { FollowLinkConfig } from '../../shared/utils/follow-link-config.model';
|
||||||
@@ -21,13 +20,11 @@ import { NotificationsService } from '../../shared/notifications/notifications.s
|
|||||||
import { ObjectCacheService } from '../cache/object-cache.service';
|
import { ObjectCacheService } from '../cache/object-cache.service';
|
||||||
import { DeleteData, DeleteDataImpl } from './base/delete-data';
|
import { DeleteData, DeleteDataImpl } from './base/delete-data';
|
||||||
import { IdentifiableDataService } from './base/identifiable-data.service';
|
import { IdentifiableDataService } from './base/identifiable-data.service';
|
||||||
import { dataService } from './base/data-service.decorator';
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A service responsible for fetching/sending data from/to the REST API on the metadatafields endpoint
|
* A service responsible for fetching/sending data from/to the REST API on the metadatafields endpoint
|
||||||
*/
|
*/
|
||||||
@Injectable()
|
@Injectable({ providedIn: 'root' })
|
||||||
@dataService(METADATA_FIELD)
|
|
||||||
export class MetadataFieldDataService extends IdentifiableDataService<MetadataField> implements CreateData<MetadataField>, PutData<MetadataField>, DeleteData<MetadataField>, SearchData<MetadataField> {
|
export class MetadataFieldDataService extends IdentifiableDataService<MetadataField> implements CreateData<MetadataField>, PutData<MetadataField>, DeleteData<MetadataField>, SearchData<MetadataField> {
|
||||||
private createData: CreateData<MetadataField>;
|
private createData: CreateData<MetadataField>;
|
||||||
private searchData: SearchData<MetadataField>;
|
private searchData: SearchData<MetadataField>;
|
||||||
|
@@ -3,7 +3,6 @@ import { NotificationsService } from '../../shared/notifications/notifications.s
|
|||||||
import { RemoteDataBuildService } from '../cache/builders/remote-data-build.service';
|
import { RemoteDataBuildService } from '../cache/builders/remote-data-build.service';
|
||||||
import { ObjectCacheService } from '../cache/object-cache.service';
|
import { ObjectCacheService } from '../cache/object-cache.service';
|
||||||
import { MetadataSchema } from '../metadata/metadata-schema.model';
|
import { MetadataSchema } from '../metadata/metadata-schema.model';
|
||||||
import { METADATA_SCHEMA } from '../metadata/metadata-schema.resource-type';
|
|
||||||
import { HALEndpointService } from '../shared/hal-endpoint.service';
|
import { HALEndpointService } from '../shared/hal-endpoint.service';
|
||||||
import { RequestService } from './request.service';
|
import { RequestService } from './request.service';
|
||||||
import { Observable } from 'rxjs';
|
import { Observable } from 'rxjs';
|
||||||
@@ -19,13 +18,11 @@ import { FollowLinkConfig } from '../../shared/utils/follow-link-config.model';
|
|||||||
import { PaginatedList } from './paginated-list.model';
|
import { PaginatedList } from './paginated-list.model';
|
||||||
import { IdentifiableDataService } from './base/identifiable-data.service';
|
import { IdentifiableDataService } from './base/identifiable-data.service';
|
||||||
import { DeleteData, DeleteDataImpl } from './base/delete-data';
|
import { DeleteData, DeleteDataImpl } from './base/delete-data';
|
||||||
import { dataService } from './base/data-service.decorator';
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A service responsible for fetching/sending data from/to the REST API on the metadataschemas endpoint
|
* A service responsible for fetching/sending data from/to the REST API on the metadataschemas endpoint
|
||||||
*/
|
*/
|
||||||
@Injectable()
|
@Injectable({ providedIn: 'root' })
|
||||||
@dataService(METADATA_SCHEMA)
|
|
||||||
export class MetadataSchemaDataService extends IdentifiableDataService<MetadataSchema> implements FindAllData<MetadataSchema>, DeleteData<MetadataSchema> {
|
export class MetadataSchemaDataService extends IdentifiableDataService<MetadataSchema> implements FindAllData<MetadataSchema>, DeleteData<MetadataSchema> {
|
||||||
private createData: CreateData<MetadataSchema>;
|
private createData: CreateData<MetadataSchema>;
|
||||||
private findAllData: FindAllData<MetadataSchema>;
|
private findAllData: FindAllData<MetadataSchema>;
|
||||||
|
@@ -8,7 +8,7 @@ import { MetadataMap, MetadataValue } from '../shared/metadata.models';
|
|||||||
import { DspaceRestResponseParsingService } from './dspace-rest-response-parsing.service';
|
import { DspaceRestResponseParsingService } from './dspace-rest-response-parsing.service';
|
||||||
import { RestRequest } from './rest-request.model';
|
import { RestRequest } from './rest-request.model';
|
||||||
|
|
||||||
@Injectable()
|
@Injectable({ providedIn: 'root' })
|
||||||
export class MyDSpaceResponseParsingService extends DspaceRestResponseParsingService {
|
export class MyDSpaceResponseParsingService extends DspaceRestResponseParsingService {
|
||||||
parse(request: RestRequest, data: RawRestResponse): ParsedResponse {
|
parse(request: RestRequest, data: RawRestResponse): ParsedResponse {
|
||||||
// fallback for unexpected empty response
|
// fallback for unexpected empty response
|
||||||
|
@@ -55,7 +55,7 @@ function virtualMetadataSourceSelector(url: string, source: string): MemoizedSel
|
|||||||
/**
|
/**
|
||||||
* Service that dispatches and reads from the ObjectUpdates' state in the store
|
* Service that dispatches and reads from the ObjectUpdates' state in the store
|
||||||
*/
|
*/
|
||||||
@Injectable()
|
@Injectable({ providedIn: 'root' })
|
||||||
export class ObjectUpdatesService {
|
export class ObjectUpdatesService {
|
||||||
constructor(private store: Store<CoreState>,
|
constructor(private store: Store<CoreState>,
|
||||||
private injector: Injector) {
|
private injector: Injector) {
|
||||||
|
@@ -4,7 +4,6 @@ import { RemoteDataBuildService } from '../../cache/builders/remote-data-build.s
|
|||||||
import { ObjectCacheService } from '../../cache/object-cache.service';
|
import { ObjectCacheService } from '../../cache/object-cache.service';
|
||||||
import { HALEndpointService } from '../../shared/hal-endpoint.service';
|
import { HALEndpointService } from '../../shared/hal-endpoint.service';
|
||||||
import { Process } from '../../../process-page/processes/process.model';
|
import { Process } from '../../../process-page/processes/process.model';
|
||||||
import { PROCESS } from '../../../process-page/processes/process.resource-type';
|
|
||||||
import { Observable } from 'rxjs';
|
import { Observable } from 'rxjs';
|
||||||
import { switchMap } from 'rxjs/operators';
|
import { switchMap } from 'rxjs/operators';
|
||||||
import { PaginatedList } from '../paginated-list.model';
|
import { PaginatedList } from '../paginated-list.model';
|
||||||
@@ -15,13 +14,11 @@ import { IdentifiableDataService } from '../base/identifiable-data.service';
|
|||||||
import { FollowLinkConfig } from '../../../shared/utils/follow-link-config.model';
|
import { FollowLinkConfig } from '../../../shared/utils/follow-link-config.model';
|
||||||
import { FindAllData, FindAllDataImpl } from '../base/find-all-data';
|
import { FindAllData, FindAllDataImpl } from '../base/find-all-data';
|
||||||
import { FindListOptions } from '../find-list-options.model';
|
import { FindListOptions } from '../find-list-options.model';
|
||||||
import { dataService } from '../base/data-service.decorator';
|
|
||||||
import { DeleteData, DeleteDataImpl } from '../base/delete-data';
|
import { DeleteData, DeleteDataImpl } from '../base/delete-data';
|
||||||
import { NotificationsService } from '../../../shared/notifications/notifications.service';
|
import { NotificationsService } from '../../../shared/notifications/notifications.service';
|
||||||
import { NoContent } from '../../shared/NoContent.model';
|
import { NoContent } from '../../shared/NoContent.model';
|
||||||
|
|
||||||
@Injectable()
|
@Injectable({ providedIn: 'root' })
|
||||||
@dataService(PROCESS)
|
|
||||||
export class ProcessDataService extends IdentifiableDataService<Process> implements FindAllData<Process>, DeleteData<Process> {
|
export class ProcessDataService extends IdentifiableDataService<Process> implements FindAllData<Process>, DeleteData<Process> {
|
||||||
private findAllData: FindAllData<Process>;
|
private findAllData: FindAllData<Process>;
|
||||||
private deleteData: DeleteData<Process>;
|
private deleteData: DeleteData<Process>;
|
||||||
|
@@ -10,7 +10,6 @@ import { RemoteData } from '../remote-data';
|
|||||||
import { MultipartPostRequest } from '../request.models';
|
import { MultipartPostRequest } from '../request.models';
|
||||||
import { RequestService } from '../request.service';
|
import { RequestService } from '../request.service';
|
||||||
import { Observable } from 'rxjs';
|
import { Observable } from 'rxjs';
|
||||||
import { SCRIPT } from '../../../process-page/scripts/script.resource-type';
|
|
||||||
import { Process } from '../../../process-page/processes/process.model';
|
import { Process } from '../../../process-page/processes/process.model';
|
||||||
import { hasValue } from '../../../shared/empty.util';
|
import { hasValue } from '../../../shared/empty.util';
|
||||||
import { getFirstCompletedRemoteData } from '../../shared/operators';
|
import { getFirstCompletedRemoteData } from '../../shared/operators';
|
||||||
@@ -20,15 +19,13 @@ import { FindAllData, FindAllDataImpl } from '../base/find-all-data';
|
|||||||
import { FindListOptions } from '../find-list-options.model';
|
import { FindListOptions } from '../find-list-options.model';
|
||||||
import { FollowLinkConfig } from '../../../shared/utils/follow-link-config.model';
|
import { FollowLinkConfig } from '../../../shared/utils/follow-link-config.model';
|
||||||
import { PaginatedList } from '../paginated-list.model';
|
import { PaginatedList } from '../paginated-list.model';
|
||||||
import { dataService } from '../base/data-service.decorator';
|
|
||||||
|
|
||||||
export const METADATA_IMPORT_SCRIPT_NAME = 'metadata-import';
|
export const METADATA_IMPORT_SCRIPT_NAME = 'metadata-import';
|
||||||
export const METADATA_EXPORT_SCRIPT_NAME = 'metadata-export';
|
export const METADATA_EXPORT_SCRIPT_NAME = 'metadata-export';
|
||||||
export const BATCH_IMPORT_SCRIPT_NAME = 'import';
|
export const BATCH_IMPORT_SCRIPT_NAME = 'import';
|
||||||
export const BATCH_EXPORT_SCRIPT_NAME = 'export';
|
export const BATCH_EXPORT_SCRIPT_NAME = 'export';
|
||||||
|
|
||||||
@Injectable()
|
@Injectable({ providedIn: 'root' })
|
||||||
@dataService(SCRIPT)
|
|
||||||
export class ScriptDataService extends IdentifiableDataService<Script> implements FindAllData<Script> {
|
export class ScriptDataService extends IdentifiableDataService<Script> implements FindAllData<Script> {
|
||||||
private findAllData: FindAllDataImpl<Script>;
|
private findAllData: FindAllDataImpl<Script>;
|
||||||
|
|
||||||
|
@@ -4,17 +4,22 @@ import { MemoizedSelector, select, Store } from '@ngrx/store';
|
|||||||
import { combineLatest as observableCombineLatest, Observable, of as observableOf } from 'rxjs';
|
import { combineLatest as observableCombineLatest, Observable, of as observableOf } from 'rxjs';
|
||||||
import { distinctUntilChanged, filter, map, mergeMap, startWith, switchMap, take, tap } from 'rxjs/operators';
|
import { distinctUntilChanged, filter, map, mergeMap, startWith, switchMap, take, tap } from 'rxjs/operators';
|
||||||
import {
|
import {
|
||||||
compareArraysUsingIds, PAGINATED_RELATIONS_TO_ITEMS_OPERATOR,
|
compareArraysUsingIds,
|
||||||
|
PAGINATED_RELATIONS_TO_ITEMS_OPERATOR,
|
||||||
relationsToItems
|
relationsToItems
|
||||||
} from '../../item-page/simple/item-types/shared/item-relationships-utils';
|
} from '../../item-page/simple/item-types/shared/item-relationships-utils';
|
||||||
import { AppState, keySelector } from '../../app.reducer';
|
import { AppState, keySelector } from '../../app.reducer';
|
||||||
import { hasValue, hasValueOperator, isNotEmpty, isNotEmptyOperator } from '../../shared/empty.util';
|
import { hasValue, hasValueOperator, isNotEmpty, isNotEmptyOperator } from '../../shared/empty.util';
|
||||||
import { ReorderableRelationship } from '../../shared/form/builder/ds-dynamic-form-ui/existing-metadata-list-element/existing-metadata-list-element.component';
|
import {
|
||||||
|
ReorderableRelationship
|
||||||
|
} from '../../shared/form/builder/ds-dynamic-form-ui/existing-metadata-list-element/existing-metadata-list-element.component';
|
||||||
import {
|
import {
|
||||||
RemoveNameVariantAction,
|
RemoveNameVariantAction,
|
||||||
SetNameVariantAction
|
SetNameVariantAction
|
||||||
} from '../../shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/name-variant.actions';
|
} from '../../shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/name-variant.actions';
|
||||||
import { NameVariantListState } from '../../shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/name-variant.reducer';
|
import {
|
||||||
|
NameVariantListState
|
||||||
|
} from '../../shared/form/builder/ds-dynamic-form-ui/relation-lookup-modal/name-variant.reducer';
|
||||||
import { followLink, FollowLinkConfig } from '../../shared/utils/follow-link-config.model';
|
import { followLink, FollowLinkConfig } from '../../shared/utils/follow-link-config.model';
|
||||||
import { RemoteDataBuildService } from '../cache/builders/remote-data-build.service';
|
import { RemoteDataBuildService } from '../cache/builders/remote-data-build.service';
|
||||||
import { RequestParam } from '../cache/models/request-param.model';
|
import { RequestParam } from '../cache/models/request-param.model';
|
||||||
@@ -23,7 +28,6 @@ import { HttpOptions } from '../dspace-rest/dspace-rest.service';
|
|||||||
import { HALEndpointService } from '../shared/hal-endpoint.service';
|
import { HALEndpointService } from '../shared/hal-endpoint.service';
|
||||||
import { RelationshipType } from '../shared/item-relationships/relationship-type.model';
|
import { RelationshipType } from '../shared/item-relationships/relationship-type.model';
|
||||||
import { Relationship } from '../shared/item-relationships/relationship.model';
|
import { Relationship } from '../shared/item-relationships/relationship.model';
|
||||||
import { RELATIONSHIP } from '../shared/item-relationships/relationship.resource-type';
|
|
||||||
import { Item } from '../shared/item.model';
|
import { Item } from '../shared/item.model';
|
||||||
import {
|
import {
|
||||||
getFirstCompletedRemoteData,
|
getFirstCompletedRemoteData,
|
||||||
@@ -44,7 +48,6 @@ import { FindListOptions } from './find-list-options.model';
|
|||||||
import { SearchData, SearchDataImpl } from './base/search-data';
|
import { SearchData, SearchDataImpl } from './base/search-data';
|
||||||
import { PutData, PutDataImpl } from './base/put-data';
|
import { PutData, PutDataImpl } from './base/put-data';
|
||||||
import { IdentifiableDataService } from './base/identifiable-data.service';
|
import { IdentifiableDataService } from './base/identifiable-data.service';
|
||||||
import { dataService } from './base/data-service.decorator';
|
|
||||||
import { itemLinksToFollow } from '../../shared/utils/relation-query.utils';
|
import { itemLinksToFollow } from '../../shared/utils/relation-query.utils';
|
||||||
import { MetadataValue } from '../shared/metadata.models';
|
import { MetadataValue } from '../shared/metadata.models';
|
||||||
import { MetadataRepresentation } from '../shared/metadata-representation/metadata-representation.model';
|
import { MetadataRepresentation } from '../shared/metadata-representation/metadata-representation.model';
|
||||||
@@ -78,8 +81,7 @@ const compareItemsByUUID = (itemCheck: Item) =>
|
|||||||
/**
|
/**
|
||||||
* The service handling all relationship requests
|
* The service handling all relationship requests
|
||||||
*/
|
*/
|
||||||
@Injectable()
|
@Injectable({ providedIn: 'root' })
|
||||||
@dataService(RELATIONSHIP)
|
|
||||||
export class RelationshipDataService extends IdentifiableDataService<Relationship> implements SearchData<Relationship> {
|
export class RelationshipDataService extends IdentifiableDataService<Relationship> implements SearchData<Relationship> {
|
||||||
private searchData: SearchData<Relationship>;
|
private searchData: SearchData<Relationship>;
|
||||||
private putData: PutData<Relationship>;
|
private putData: PutData<Relationship>;
|
||||||
|
@@ -7,7 +7,6 @@ import { RemoteDataBuildService } from '../cache/builders/remote-data-build.serv
|
|||||||
import { HALEndpointService } from '../shared/hal-endpoint.service';
|
import { HALEndpointService } from '../shared/hal-endpoint.service';
|
||||||
import { ItemType } from '../shared/item-relationships/item-type.model';
|
import { ItemType } from '../shared/item-relationships/item-type.model';
|
||||||
import { RelationshipType } from '../shared/item-relationships/relationship-type.model';
|
import { RelationshipType } from '../shared/item-relationships/relationship-type.model';
|
||||||
import { RELATIONSHIP_TYPE } from '../shared/item-relationships/relationship-type.resource-type';
|
|
||||||
import { getFirstCompletedRemoteData, getFirstSucceededRemoteData, getRemoteDataPayload } from '../shared/operators';
|
import { getFirstCompletedRemoteData, getFirstSucceededRemoteData, getRemoteDataPayload } from '../shared/operators';
|
||||||
import { PaginatedList } from './paginated-list.model';
|
import { PaginatedList } from './paginated-list.model';
|
||||||
import { RemoteData } from './remote-data';
|
import { RemoteData } from './remote-data';
|
||||||
@@ -16,7 +15,6 @@ import { BaseDataService } from './base/base-data.service';
|
|||||||
import { FindAllDataImpl } from './base/find-all-data';
|
import { FindAllDataImpl } from './base/find-all-data';
|
||||||
import { SearchDataImpl } from './base/search-data';
|
import { SearchDataImpl } from './base/search-data';
|
||||||
import { ObjectCacheService } from '../cache/object-cache.service';
|
import { ObjectCacheService } from '../cache/object-cache.service';
|
||||||
import { dataService } from './base/data-service.decorator';
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check if one side of a RelationshipType is the ItemType with the given label
|
* Check if one side of a RelationshipType is the ItemType with the given label
|
||||||
@@ -30,8 +28,7 @@ const checkSide = (typeRd: RemoteData<ItemType>, label: string): boolean =>
|
|||||||
/**
|
/**
|
||||||
* The service handling all relationship type requests
|
* The service handling all relationship type requests
|
||||||
*/
|
*/
|
||||||
@Injectable()
|
@Injectable({ providedIn: 'root' })
|
||||||
@dataService(RELATIONSHIP_TYPE)
|
|
||||||
export class RelationshipTypeDataService extends BaseDataService<RelationshipType> {
|
export class RelationshipTypeDataService extends BaseDataService<RelationshipType> {
|
||||||
private searchData: SearchDataImpl<RelationshipType>;
|
private searchData: SearchDataImpl<RelationshipType>;
|
||||||
private findAllData: FindAllDataImpl<RelationshipType>;
|
private findAllData: FindAllDataImpl<RelationshipType>;
|
||||||
|
@@ -1,6 +1,5 @@
|
|||||||
import { Root } from './root.model';
|
import { Root } from './root.model';
|
||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
import { ROOT } from './root.resource-type';
|
|
||||||
import { RequestService } from './request.service';
|
import { RequestService } from './request.service';
|
||||||
import { RemoteDataBuildService } from '../cache/builders/remote-data-build.service';
|
import { RemoteDataBuildService } from '../cache/builders/remote-data-build.service';
|
||||||
import { HALEndpointService } from '../shared/hal-endpoint.service';
|
import { HALEndpointService } from '../shared/hal-endpoint.service';
|
||||||
@@ -12,13 +11,11 @@ import { RawRestResponse } from '../dspace-rest/raw-rest-response.model';
|
|||||||
import { catchError, map } from 'rxjs/operators';
|
import { catchError, map } from 'rxjs/operators';
|
||||||
import { BaseDataService } from './base/base-data.service';
|
import { BaseDataService } from './base/base-data.service';
|
||||||
import { ObjectCacheService } from '../cache/object-cache.service';
|
import { ObjectCacheService } from '../cache/object-cache.service';
|
||||||
import { dataService } from './base/data-service.decorator';
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A service to retrieve the {@link Root} object from the REST API.
|
* A service to retrieve the {@link Root} object from the REST API.
|
||||||
*/
|
*/
|
||||||
@Injectable()
|
@Injectable({ providedIn: 'root' })
|
||||||
@dataService(ROOT)
|
|
||||||
export class RootDataService extends BaseDataService<Root> {
|
export class RootDataService extends BaseDataService<Root> {
|
||||||
constructor(
|
constructor(
|
||||||
protected requestService: RequestService,
|
protected requestService: RequestService,
|
||||||
|
@@ -8,7 +8,7 @@ import { MetadataMap, MetadataValue } from '../shared/metadata.models';
|
|||||||
import { DspaceRestResponseParsingService } from './dspace-rest-response-parsing.service';
|
import { DspaceRestResponseParsingService } from './dspace-rest-response-parsing.service';
|
||||||
import { RestRequest } from './rest-request.model';
|
import { RestRequest } from './rest-request.model';
|
||||||
|
|
||||||
@Injectable()
|
@Injectable({ providedIn: 'root' })
|
||||||
export class SearchResponseParsingService extends DspaceRestResponseParsingService {
|
export class SearchResponseParsingService extends DspaceRestResponseParsingService {
|
||||||
parse(request: RestRequest, data: RawRestResponse): ParsedResponse {
|
parse(request: RestRequest, data: RawRestResponse): ParsedResponse {
|
||||||
// fallback for unexpected empty response
|
// fallback for unexpected empty response
|
||||||
|
@@ -5,7 +5,6 @@ import { RemoteDataBuildService } from '../cache/builders/remote-data-build.serv
|
|||||||
import { HALEndpointService } from '../shared/hal-endpoint.service';
|
import { HALEndpointService } from '../shared/hal-endpoint.service';
|
||||||
import { getFirstSucceededRemoteData } from '../shared/operators';
|
import { getFirstSucceededRemoteData } from '../shared/operators';
|
||||||
import { Site } from '../shared/site.model';
|
import { Site } from '../shared/site.model';
|
||||||
import { SITE } from '../shared/site.resource-type';
|
|
||||||
import { PaginatedList } from './paginated-list.model';
|
import { PaginatedList } from './paginated-list.model';
|
||||||
import { RemoteData } from './remote-data';
|
import { RemoteData } from './remote-data';
|
||||||
import { RequestService } from './request.service';
|
import { RequestService } from './request.service';
|
||||||
@@ -14,13 +13,11 @@ import { FindAllData, FindAllDataImpl } from './base/find-all-data';
|
|||||||
import { FollowLinkConfig } from 'src/app/shared/utils/follow-link-config.model';
|
import { FollowLinkConfig } from 'src/app/shared/utils/follow-link-config.model';
|
||||||
import { FindListOptions } from './find-list-options.model';
|
import { FindListOptions } from './find-list-options.model';
|
||||||
import { ObjectCacheService } from '../cache/object-cache.service';
|
import { ObjectCacheService } from '../cache/object-cache.service';
|
||||||
import { dataService } from './base/data-service.decorator';
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Service responsible for handling requests related to the Site object
|
* Service responsible for handling requests related to the Site object
|
||||||
*/
|
*/
|
||||||
@Injectable()
|
@Injectable({ providedIn: 'root' })
|
||||||
@dataService(SITE)
|
|
||||||
export class SiteDataService extends BaseDataService<Site> implements FindAllData<Site> {
|
export class SiteDataService extends BaseDataService<Site> implements FindAllData<Site> {
|
||||||
private findAllData: FindAllData<Site>;
|
private findAllData: FindAllData<Site>;
|
||||||
|
|
||||||
|
@@ -10,10 +10,8 @@ import { IdentifiableDataService } from './base/identifiable-data.service';
|
|||||||
import { FollowLinkConfig } from '../../shared/utils/follow-link-config.model';
|
import { FollowLinkConfig } from '../../shared/utils/follow-link-config.model';
|
||||||
import { FindAllData, FindAllDataImpl } from './base/find-all-data';
|
import { FindAllData, FindAllDataImpl } from './base/find-all-data';
|
||||||
import { FindListOptions } from './find-list-options.model';
|
import { FindListOptions } from './find-list-options.model';
|
||||||
import { dataService } from './base/data-service.decorator';
|
|
||||||
import { NotificationsService } from '../../shared/notifications/notifications.service';
|
import { NotificationsService } from '../../shared/notifications/notifications.service';
|
||||||
import { CreateData, CreateDataImpl } from './base/create-data';
|
import { CreateData, CreateDataImpl } from './base/create-data';
|
||||||
import { SYSTEMWIDEALERT } from '../../system-wide-alert/system-wide-alert.resource-type';
|
|
||||||
import { SystemWideAlert } from '../../system-wide-alert/system-wide-alert.model';
|
import { SystemWideAlert } from '../../system-wide-alert/system-wide-alert.model';
|
||||||
import { PutData, PutDataImpl } from './base/put-data';
|
import { PutData, PutDataImpl } from './base/put-data';
|
||||||
import { RequestParam } from '../cache/models/request-param.model';
|
import { RequestParam } from '../cache/models/request-param.model';
|
||||||
@@ -23,7 +21,6 @@ import { SearchData, SearchDataImpl } from './base/search-data';
|
|||||||
* Dataservice representing a system-wide alert
|
* Dataservice representing a system-wide alert
|
||||||
*/
|
*/
|
||||||
@Injectable()
|
@Injectable()
|
||||||
@dataService(SYSTEMWIDEALERT)
|
|
||||||
export class SystemWideAlertDataService extends IdentifiableDataService<SystemWideAlert> implements FindAllData<SystemWideAlert>, CreateData<SystemWideAlert>, PutData<SystemWideAlert>, SearchData<SystemWideAlert> {
|
export class SystemWideAlertDataService extends IdentifiableDataService<SystemWideAlert> implements FindAllData<SystemWideAlert>, CreateData<SystemWideAlert>, PutData<SystemWideAlert>, SearchData<SystemWideAlert> {
|
||||||
private findAllData: FindAllDataImpl<SystemWideAlert>;
|
private findAllData: FindAllDataImpl<SystemWideAlert>;
|
||||||
private createData: CreateDataImpl<SystemWideAlert>;
|
private createData: CreateDataImpl<SystemWideAlert>;
|
||||||
|
@@ -5,7 +5,6 @@ import { RemoteDataBuildService } from '../cache/builders/remote-data-build.serv
|
|||||||
import { ObjectCacheService } from '../cache/object-cache.service';
|
import { ObjectCacheService } from '../cache/object-cache.service';
|
||||||
import { HALEndpointService } from '../shared/hal-endpoint.service';
|
import { HALEndpointService } from '../shared/hal-endpoint.service';
|
||||||
import { EMPTY, Observable } from 'rxjs';
|
import { EMPTY, Observable } from 'rxjs';
|
||||||
import { VERSION } from '../shared/version.resource-type';
|
|
||||||
import { VersionHistory } from '../shared/version-history.model';
|
import { VersionHistory } from '../shared/version-history.model';
|
||||||
import { followLink } from '../../shared/utils/follow-link-config.model';
|
import { followLink } from '../../shared/utils/follow-link-config.model';
|
||||||
import { getFirstSucceededRemoteDataPayload } from '../shared/operators';
|
import { getFirstSucceededRemoteDataPayload } from '../shared/operators';
|
||||||
@@ -16,14 +15,12 @@ import { PatchData, PatchDataImpl } from './base/patch-data';
|
|||||||
import { RestRequestMethod } from './rest-request-method';
|
import { RestRequestMethod } from './rest-request-method';
|
||||||
import { DefaultChangeAnalyzer } from './default-change-analyzer.service';
|
import { DefaultChangeAnalyzer } from './default-change-analyzer.service';
|
||||||
import { IdentifiableDataService } from './base/identifiable-data.service';
|
import { IdentifiableDataService } from './base/identifiable-data.service';
|
||||||
import { dataService } from './base/data-service.decorator';
|
|
||||||
import { Operation } from 'fast-json-patch';
|
import { Operation } from 'fast-json-patch';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Service responsible for handling requests related to the Version object
|
* Service responsible for handling requests related to the Version object
|
||||||
*/
|
*/
|
||||||
@Injectable()
|
@Injectable({ providedIn: 'root' })
|
||||||
@dataService(VERSION)
|
|
||||||
export class VersionDataService extends IdentifiableDataService<Version> implements PatchData<Version> {
|
export class VersionDataService extends IdentifiableDataService<Version> implements PatchData<Version> {
|
||||||
private patchData: PatchData<Version>;
|
private patchData: PatchData<Version>;
|
||||||
|
|
||||||
|
@@ -12,7 +12,6 @@ import { RemoteData } from './remote-data';
|
|||||||
import { PaginatedList } from './paginated-list.model';
|
import { PaginatedList } from './paginated-list.model';
|
||||||
import { Version } from '../shared/version.model';
|
import { Version } from '../shared/version.model';
|
||||||
import { filter, map, switchMap, take } from 'rxjs/operators';
|
import { filter, map, switchMap, take } from 'rxjs/operators';
|
||||||
import { VERSION_HISTORY } from '../shared/version-history.resource-type';
|
|
||||||
import { followLink, FollowLinkConfig } from '../../shared/utils/follow-link-config.model';
|
import { followLink, FollowLinkConfig } from '../../shared/utils/follow-link-config.model';
|
||||||
import { VersionDataService } from './version-data.service';
|
import { VersionDataService } from './version-data.service';
|
||||||
import { HttpOptions } from '../dspace-rest/dspace-rest.service';
|
import { HttpOptions } from '../dspace-rest/dspace-rest.service';
|
||||||
@@ -24,13 +23,11 @@ import { FindListOptions } from './find-list-options.model';
|
|||||||
import { sendRequest } from '../shared/request.operators';
|
import { sendRequest } from '../shared/request.operators';
|
||||||
import { RestRequest } from './rest-request.model';
|
import { RestRequest } from './rest-request.model';
|
||||||
import { IdentifiableDataService } from './base/identifiable-data.service';
|
import { IdentifiableDataService } from './base/identifiable-data.service';
|
||||||
import { dataService } from './base/data-service.decorator';
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Service responsible for handling requests related to the VersionHistory object
|
* Service responsible for handling requests related to the VersionHistory object
|
||||||
*/
|
*/
|
||||||
@Injectable()
|
@Injectable({ providedIn: 'root' })
|
||||||
@dataService(VERSION_HISTORY)
|
|
||||||
export class VersionHistoryDataService extends IdentifiableDataService<VersionHistory> {
|
export class VersionHistoryDataService extends IdentifiableDataService<VersionHistory> {
|
||||||
protected versionsEndpoint = 'versions';
|
protected versionsEndpoint = 'versions';
|
||||||
|
|
||||||
|
@@ -4,15 +4,12 @@ import { RemoteDataBuildService } from '../cache/builders/remote-data-build.serv
|
|||||||
import { ObjectCacheService } from '../cache/object-cache.service';
|
import { ObjectCacheService } from '../cache/object-cache.service';
|
||||||
import { HALEndpointService } from '../shared/hal-endpoint.service';
|
import { HALEndpointService } from '../shared/hal-endpoint.service';
|
||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
import { WORKFLOW_ACTION } from '../tasks/models/workflow-action-object.resource-type';
|
|
||||||
import { dataService } from './base/data-service.decorator';
|
|
||||||
import { IdentifiableDataService } from './base/identifiable-data.service';
|
import { IdentifiableDataService } from './base/identifiable-data.service';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A service responsible for fetching/sending data from/to the REST API on the workflowactions endpoint
|
* A service responsible for fetching/sending data from/to the REST API on the workflowactions endpoint
|
||||||
*/
|
*/
|
||||||
@Injectable()
|
@Injectable({ providedIn: 'root' })
|
||||||
@dataService(WORKFLOW_ACTION)
|
|
||||||
export class WorkflowActionDataService extends IdentifiableDataService<WorkflowAction> {
|
export class WorkflowActionDataService extends IdentifiableDataService<WorkflowAction> {
|
||||||
protected linkPath = 'workflowactions';
|
protected linkPath = 'workflowactions';
|
||||||
|
|
||||||
|
@@ -7,7 +7,7 @@ import { Router } from '@angular/router';
|
|||||||
/**
|
/**
|
||||||
* A guard redirecting users to the end agreement page when the user agreement cookie hasn't been accepted
|
* A guard redirecting users to the end agreement page when the user agreement cookie hasn't been accepted
|
||||||
*/
|
*/
|
||||||
@Injectable()
|
@Injectable({ providedIn: 'root' })
|
||||||
export class EndUserAgreementCookieGuard extends AbstractEndUserAgreementGuard {
|
export class EndUserAgreementCookieGuard extends AbstractEndUserAgreementGuard {
|
||||||
|
|
||||||
constructor(protected endUserAgreementService: EndUserAgreementService,
|
constructor(protected endUserAgreementService: EndUserAgreementService,
|
||||||
|
@@ -8,7 +8,7 @@ import { environment } from '../../../environments/environment';
|
|||||||
/**
|
/**
|
||||||
* A guard redirecting logged in users to the end agreement page when they haven't accepted the latest user agreement
|
* A guard redirecting logged in users to the end agreement page when they haven't accepted the latest user agreement
|
||||||
*/
|
*/
|
||||||
@Injectable()
|
@Injectable({ providedIn: 'root' })
|
||||||
export class EndUserAgreementCurrentUserGuard extends AbstractEndUserAgreementGuard {
|
export class EndUserAgreementCurrentUserGuard extends AbstractEndUserAgreementGuard {
|
||||||
|
|
||||||
constructor(protected endUserAgreementService: EndUserAgreementService,
|
constructor(protected endUserAgreementService: EndUserAgreementService,
|
||||||
|
@@ -13,7 +13,7 @@ export const END_USER_AGREEMENT_METADATA_FIELD = 'dspace.agreements.end-user';
|
|||||||
/**
|
/**
|
||||||
* Service for checking and managing the status of the current end user agreement
|
* Service for checking and managing the status of the current end user agreement
|
||||||
*/
|
*/
|
||||||
@Injectable()
|
@Injectable({ providedIn: 'root' })
|
||||||
export class EndUserAgreementService {
|
export class EndUserAgreementService {
|
||||||
|
|
||||||
constructor(protected cookie: CookieService,
|
constructor(protected cookie: CookieService,
|
||||||
|
@@ -23,7 +23,6 @@ import { RequestService } from '../data/request.service';
|
|||||||
import { HALEndpointService } from '../shared/hal-endpoint.service';
|
import { HALEndpointService } from '../shared/hal-endpoint.service';
|
||||||
import { getFirstSucceededRemoteData, getRemoteDataPayload } from '../shared/operators';
|
import { getFirstSucceededRemoteData, getRemoteDataPayload } from '../shared/operators';
|
||||||
import { EPerson } from './models/eperson.model';
|
import { EPerson } from './models/eperson.model';
|
||||||
import { EPERSON } from './models/eperson.resource-type';
|
|
||||||
import { NoContent } from '../shared/NoContent.model';
|
import { NoContent } from '../shared/NoContent.model';
|
||||||
import { PageInfo } from '../shared/page-info.model';
|
import { PageInfo } from '../shared/page-info.model';
|
||||||
import { FindListOptions } from '../data/find-list-options.model';
|
import { FindListOptions } from '../data/find-list-options.model';
|
||||||
@@ -33,7 +32,6 @@ import { SearchData, SearchDataImpl } from '../data/base/search-data';
|
|||||||
import { PatchData, PatchDataImpl } from '../data/base/patch-data';
|
import { PatchData, PatchDataImpl } from '../data/base/patch-data';
|
||||||
import { DeleteData, DeleteDataImpl } from '../data/base/delete-data';
|
import { DeleteData, DeleteDataImpl } from '../data/base/delete-data';
|
||||||
import { RestRequestMethod } from '../data/rest-request-method';
|
import { RestRequestMethod } from '../data/rest-request-method';
|
||||||
import { dataService } from '../data/base/data-service.decorator';
|
|
||||||
|
|
||||||
const ePeopleRegistryStateSelector = (state: AppState) => state.epeopleRegistry;
|
const ePeopleRegistryStateSelector = (state: AppState) => state.epeopleRegistry;
|
||||||
const editEPersonSelector = createSelector(ePeopleRegistryStateSelector, (ePeopleRegistryState: EPeopleRegistryState) => ePeopleRegistryState.editEPerson);
|
const editEPersonSelector = createSelector(ePeopleRegistryStateSelector, (ePeopleRegistryState: EPeopleRegistryState) => ePeopleRegistryState.editEPerson);
|
||||||
@@ -41,8 +39,7 @@ const editEPersonSelector = createSelector(ePeopleRegistryStateSelector, (ePeopl
|
|||||||
/**
|
/**
|
||||||
* A service to retrieve {@link EPerson}s from the REST API & EPerson related CRUD actions
|
* A service to retrieve {@link EPerson}s from the REST API & EPerson related CRUD actions
|
||||||
*/
|
*/
|
||||||
@Injectable()
|
@Injectable({ providedIn: 'root' })
|
||||||
@dataService(EPERSON)
|
|
||||||
export class EPersonDataService extends IdentifiableDataService<EPerson> implements CreateData<EPerson>, SearchData<EPerson>, PatchData<EPerson>, DeleteData<EPerson> {
|
export class EPersonDataService extends IdentifiableDataService<EPerson> implements CreateData<EPerson>, SearchData<EPerson>, PatchData<EPerson>, DeleteData<EPerson> {
|
||||||
protected searchByEmailPath = 'byEmail';
|
protected searchByEmailPath = 'byEmail';
|
||||||
protected searchByMetadataPath = 'byMetadata';
|
protected searchByMetadataPath = 'byMetadata';
|
||||||
|
@@ -26,7 +26,6 @@ import { HALEndpointService } from '../shared/hal-endpoint.service';
|
|||||||
import { getFirstCompletedRemoteData } from '../shared/operators';
|
import { getFirstCompletedRemoteData } from '../shared/operators';
|
||||||
import { EPerson } from './models/eperson.model';
|
import { EPerson } from './models/eperson.model';
|
||||||
import { Group } from './models/group.model';
|
import { Group } from './models/group.model';
|
||||||
import { GROUP } from './models/group.resource-type';
|
|
||||||
import { DSONameService } from '../breadcrumbs/dso-name.service';
|
import { DSONameService } from '../breadcrumbs/dso-name.service';
|
||||||
import { Community } from '../shared/community.model';
|
import { Community } from '../shared/community.model';
|
||||||
import { Collection } from '../shared/collection.model';
|
import { Collection } from '../shared/collection.model';
|
||||||
@@ -39,7 +38,6 @@ import { PatchData, PatchDataImpl } from '../data/base/patch-data';
|
|||||||
import { DeleteData, DeleteDataImpl } from '../data/base/delete-data';
|
import { DeleteData, DeleteDataImpl } from '../data/base/delete-data';
|
||||||
import { Operation } from 'fast-json-patch';
|
import { Operation } from 'fast-json-patch';
|
||||||
import { RestRequestMethod } from '../data/rest-request-method';
|
import { RestRequestMethod } from '../data/rest-request-method';
|
||||||
import { dataService } from '../data/base/data-service.decorator';
|
|
||||||
|
|
||||||
const groupRegistryStateSelector = (state: AppState) => state.groupRegistry;
|
const groupRegistryStateSelector = (state: AppState) => state.groupRegistry;
|
||||||
const editGroupSelector = createSelector(groupRegistryStateSelector, (groupRegistryState: GroupRegistryState) => groupRegistryState.editGroup);
|
const editGroupSelector = createSelector(groupRegistryStateSelector, (groupRegistryState: GroupRegistryState) => groupRegistryState.editGroup);
|
||||||
@@ -47,8 +45,7 @@ const editGroupSelector = createSelector(groupRegistryStateSelector, (groupRegis
|
|||||||
/**
|
/**
|
||||||
* Provides methods to retrieve eperson group resources from the REST API & Group related CRUD actions.
|
* Provides methods to retrieve eperson group resources from the REST API & Group related CRUD actions.
|
||||||
*/
|
*/
|
||||||
@Injectable()
|
@Injectable({ providedIn: 'root' })
|
||||||
@dataService(GROUP)
|
|
||||||
export class GroupDataService extends IdentifiableDataService<Group> implements CreateData<Group>, SearchData<Group>, PatchData<Group>, DeleteData<Group> {
|
export class GroupDataService extends IdentifiableDataService<Group> implements CreateData<Group>, SearchData<Group>, PatchData<Group>, DeleteData<Group> {
|
||||||
protected browseEndpoint = '';
|
protected browseEndpoint = '';
|
||||||
public ePersonsEndpoint = 'epersons';
|
public ePersonsEndpoint = 'epersons';
|
||||||
|
@@ -1,7 +1,6 @@
|
|||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
import { Observable } from 'rxjs';
|
import { Observable } from 'rxjs';
|
||||||
import { Feedback } from './models/feedback.model';
|
import { Feedback } from './models/feedback.model';
|
||||||
import { FEEDBACK } from './models/feedback.resource-type';
|
|
||||||
import { RequestService } from '../data/request.service';
|
import { RequestService } from '../data/request.service';
|
||||||
import { RemoteDataBuildService } from '../cache/builders/remote-data-build.service';
|
import { RemoteDataBuildService } from '../cache/builders/remote-data-build.service';
|
||||||
import { Store } from '@ngrx/store';
|
import { Store } from '@ngrx/store';
|
||||||
@@ -13,13 +12,11 @@ import { IdentifiableDataService } from '../data/base/identifiable-data.service'
|
|||||||
import { RemoteData } from '../data/remote-data';
|
import { RemoteData } from '../data/remote-data';
|
||||||
import { RequestParam } from '../cache/models/request-param.model';
|
import { RequestParam } from '../cache/models/request-param.model';
|
||||||
import { CreateData, CreateDataImpl } from '../data/base/create-data';
|
import { CreateData, CreateDataImpl } from '../data/base/create-data';
|
||||||
import { dataService } from '../data/base/data-service.decorator';
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Service for checking and managing the feedback
|
* Service for checking and managing the feedback
|
||||||
*/
|
*/
|
||||||
@Injectable()
|
@Injectable({ providedIn: 'root' })
|
||||||
@dataService(FEEDBACK)
|
|
||||||
export class FeedbackDataService extends IdentifiableDataService<Feedback> implements CreateData<Feedback> {
|
export class FeedbackDataService extends IdentifiableDataService<Feedback> implements CreateData<Feedback> {
|
||||||
private createData: CreateDataImpl<Feedback>;
|
private createData: CreateDataImpl<Feedback>;
|
||||||
|
|
||||||
|
@@ -17,7 +17,7 @@ import { CoreState } from '../../core-state.model';
|
|||||||
/**
|
/**
|
||||||
* Provides methods to dispatch JsonPatch Operations Actions
|
* Provides methods to dispatch JsonPatch Operations Actions
|
||||||
*/
|
*/
|
||||||
@Injectable()
|
@Injectable({ providedIn: 'root' })
|
||||||
export class JsonPatchOperationsBuilder {
|
export class JsonPatchOperationsBuilder {
|
||||||
|
|
||||||
constructor(private store: Store<CoreState>) {
|
constructor(private store: Store<CoreState>) {
|
||||||
|
34
src/app/core/lazy-service.ts
Normal file
34
src/app/core/lazy-service.ts
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
import { Injector, Type } from '@angular/core';
|
||||||
|
import { defer, Observable } from 'rxjs';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Loads a service lazily. The service is loaded when the observable is subscribed to.
|
||||||
|
*
|
||||||
|
* @param loader A function that returns a promise of the service to load.
|
||||||
|
* @param injector The injector to use to load the service. If not provided, the current injector is used.
|
||||||
|
* @returns An observable of the service.
|
||||||
|
*
|
||||||
|
* @example
|
||||||
|
* ```ts
|
||||||
|
* const dataService$ = lazyService(() => import('./data-service').then((m) => m.MyService), this.injector);
|
||||||
|
* or
|
||||||
|
* const dataService$ = lazyService(() => import('./data-service'), this.injector);
|
||||||
|
* ```
|
||||||
|
*/
|
||||||
|
export function lazyService<T>(
|
||||||
|
loader: () => Promise<Type<T>> | Promise<{ default: Type<T> }>,
|
||||||
|
injector: Injector
|
||||||
|
): Observable<T> {
|
||||||
|
return defer(() => {
|
||||||
|
return loader()
|
||||||
|
.then((serviceOrDefault) => {
|
||||||
|
if ('default' in serviceOrDefault) {
|
||||||
|
return injector!.get(serviceOrDefault.default);
|
||||||
|
}
|
||||||
|
return injector!.get(serviceOrDefault);
|
||||||
|
})
|
||||||
|
.catch((error) => {
|
||||||
|
throw error;
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
@@ -63,7 +63,7 @@ const tagsInUseSelector =
|
|||||||
(state: MetaTagState) => state.tagsInUse,
|
(state: MetaTagState) => state.tagsInUse,
|
||||||
);
|
);
|
||||||
|
|
||||||
@Injectable()
|
@Injectable({ providedIn: 'root' })
|
||||||
export class MetadataService {
|
export class MetadataService {
|
||||||
|
|
||||||
private currentObject: BehaviorSubject<DSpaceObject> = new BehaviorSubject<DSpaceObject>(undefined);
|
private currentObject: BehaviorSubject<DSpaceObject> = new BehaviorSubject<DSpaceObject>(undefined);
|
||||||
|
@@ -16,7 +16,7 @@ import { ResearcherProfile } from '../profile/model/researcher-profile.model';
|
|||||||
import { URLCombiner } from '../url-combiner/url-combiner';
|
import { URLCombiner } from '../url-combiner/url-combiner';
|
||||||
import { NativeWindowRef, NativeWindowService } from '../services/window.service';
|
import { NativeWindowRef, NativeWindowService } from '../services/window.service';
|
||||||
|
|
||||||
@Injectable()
|
@Injectable({ providedIn: 'root' })
|
||||||
export class OrcidAuthService {
|
export class OrcidAuthService {
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
|
@@ -9,19 +9,16 @@ import { PostRequest } from '../data/request.models';
|
|||||||
import { RequestService } from '../data/request.service';
|
import { RequestService } from '../data/request.service';
|
||||||
import { HALEndpointService } from '../shared/hal-endpoint.service';
|
import { HALEndpointService } from '../shared/hal-endpoint.service';
|
||||||
import { OrcidHistory } from './model/orcid-history.model';
|
import { OrcidHistory } from './model/orcid-history.model';
|
||||||
import { ORCID_HISTORY } from './model/orcid-history.resource-type';
|
|
||||||
import { OrcidQueue } from './model/orcid-queue.model';
|
import { OrcidQueue } from './model/orcid-queue.model';
|
||||||
import { HttpOptions } from '../dspace-rest/dspace-rest.service';
|
import { HttpOptions } from '../dspace-rest/dspace-rest.service';
|
||||||
import { RestRequest } from '../data/rest-request.model';
|
import { RestRequest } from '../data/rest-request.model';
|
||||||
import { sendRequest } from '../shared/request.operators';
|
import { sendRequest } from '../shared/request.operators';
|
||||||
import { IdentifiableDataService } from '../data/base/identifiable-data.service';
|
import { IdentifiableDataService } from '../data/base/identifiable-data.service';
|
||||||
import { dataService } from '../data/base/data-service.decorator';
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A service that provides methods to make REST requests with Orcid History endpoint.
|
* A service that provides methods to make REST requests with Orcid History endpoint.
|
||||||
*/
|
*/
|
||||||
@Injectable()
|
@Injectable({ providedIn: 'root' })
|
||||||
@dataService(ORCID_HISTORY)
|
|
||||||
export class OrcidHistoryDataService extends IdentifiableDataService<OrcidHistory> {
|
export class OrcidHistoryDataService extends IdentifiableDataService<OrcidHistory> {
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
|
@@ -5,7 +5,6 @@ import { ObjectCacheService } from '../cache/object-cache.service';
|
|||||||
import { HALEndpointService } from '../shared/hal-endpoint.service';
|
import { HALEndpointService } from '../shared/hal-endpoint.service';
|
||||||
import { NotificationsService } from '../../shared/notifications/notifications.service';
|
import { NotificationsService } from '../../shared/notifications/notifications.service';
|
||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
import { ORCID_QUEUE } from './model/orcid-queue.resource-type';
|
|
||||||
import { Observable } from 'rxjs';
|
import { Observable } from 'rxjs';
|
||||||
import { RemoteData } from '../data/remote-data';
|
import { RemoteData } from '../data/remote-data';
|
||||||
import { PaginatedList } from '../data/paginated-list.model';
|
import { PaginatedList } from '../data/paginated-list.model';
|
||||||
@@ -15,13 +14,11 @@ import { NoContent } from '../shared/NoContent.model';
|
|||||||
import { DeleteData, DeleteDataImpl } from '../data/base/delete-data';
|
import { DeleteData, DeleteDataImpl } from '../data/base/delete-data';
|
||||||
import { SearchData, SearchDataImpl } from '../data/base/search-data';
|
import { SearchData, SearchDataImpl } from '../data/base/search-data';
|
||||||
import { IdentifiableDataService } from '../data/base/identifiable-data.service';
|
import { IdentifiableDataService } from '../data/base/identifiable-data.service';
|
||||||
import { dataService } from '../data/base/data-service.decorator';
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A service that provides methods to make REST requests with Orcid Queue endpoint.
|
* A service that provides methods to make REST requests with Orcid Queue endpoint.
|
||||||
*/
|
*/
|
||||||
@Injectable()
|
@Injectable({ providedIn: 'root' })
|
||||||
@dataService(ORCID_QUEUE)
|
|
||||||
export class OrcidQueueDataService extends IdentifiableDataService<OrcidQueue> {
|
export class OrcidQueueDataService extends IdentifiableDataService<OrcidQueue> {
|
||||||
private searchData: SearchData<OrcidQueue>;
|
private searchData: SearchData<OrcidQueue>;
|
||||||
private deleteData: DeleteData<OrcidQueue>;
|
private deleteData: DeleteData<OrcidQueue>;
|
||||||
|
@@ -16,7 +16,6 @@ import { HALEndpointService } from '../shared/hal-endpoint.service';
|
|||||||
import { NoContent } from '../shared/NoContent.model';
|
import { NoContent } from '../shared/NoContent.model';
|
||||||
import { getFirstCompletedRemoteData } from '../shared/operators';
|
import { getFirstCompletedRemoteData } from '../shared/operators';
|
||||||
import { ResearcherProfile } from './model/researcher-profile.model';
|
import { ResearcherProfile } from './model/researcher-profile.model';
|
||||||
import { RESEARCHER_PROFILE } from './model/researcher-profile.resource-type';
|
|
||||||
import { HttpOptions } from '../dspace-rest/dspace-rest.service';
|
import { HttpOptions } from '../dspace-rest/dspace-rest.service';
|
||||||
import { PostRequest } from '../data/request.models';
|
import { PostRequest } from '../data/request.models';
|
||||||
import { hasValue, isEmpty } from '../../shared/empty.util';
|
import { hasValue, isEmpty } from '../../shared/empty.util';
|
||||||
@@ -32,13 +31,11 @@ import { RestRequestMethod } from '../data/rest-request-method';
|
|||||||
import { RequestParam } from '../cache/models/request-param.model';
|
import { RequestParam } from '../cache/models/request-param.model';
|
||||||
import { FindListOptions } from '../data/find-list-options.model';
|
import { FindListOptions } from '../data/find-list-options.model';
|
||||||
import { PaginatedList } from '../data/paginated-list.model';
|
import { PaginatedList } from '../data/paginated-list.model';
|
||||||
import { dataService } from '../data/base/data-service.decorator';
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A service that provides methods to make REST requests with researcher profile endpoint.
|
* A service that provides methods to make REST requests with researcher profile endpoint.
|
||||||
*/
|
*/
|
||||||
@Injectable()
|
@Injectable({ providedIn: 'root' })
|
||||||
@dataService(RESEARCHER_PROFILE)
|
|
||||||
export class ResearcherProfileDataService extends IdentifiableDataService<ResearcherProfile> implements CreateData<ResearcherProfile>, SearchData<ResearcherProfile>, PatchData<ResearcherProfile>, DeleteData<ResearcherProfile> {
|
export class ResearcherProfileDataService extends IdentifiableDataService<ResearcherProfile> implements CreateData<ResearcherProfile>, SearchData<ResearcherProfile>, PatchData<ResearcherProfile>, DeleteData<ResearcherProfile> {
|
||||||
private createData: CreateDataImpl<ResearcherProfile>;
|
private createData: CreateDataImpl<ResearcherProfile>;
|
||||||
private searchData: SearchDataImpl<ResearcherProfile>;
|
private searchData: SearchDataImpl<ResearcherProfile>;
|
||||||
|
179
src/app/core/provide-core.ts
Normal file
179
src/app/core/provide-core.ts
Normal file
@@ -0,0 +1,179 @@
|
|||||||
|
import { importProvidersFrom, makeEnvironmentProviders } from '@angular/core';
|
||||||
|
import { DspaceRestService } from './dspace-rest/dspace-rest.service';
|
||||||
|
import { MOCK_RESPONSE_MAP, ResponseMapMock } from '../shared/mocks/dspace-rest/mocks/response-map.mock';
|
||||||
|
import { HttpClient } from '@angular/common/http';
|
||||||
|
import { EndpointMockingRestService } from '../shared/mocks/dspace-rest/endpoint-mocking-rest.service';
|
||||||
|
import { AuthStatus } from './auth/models/auth-status.model';
|
||||||
|
import { SubmissionDefinitionsModel } from './config/models/config-submission-definitions.model';
|
||||||
|
import { SubmissionFormsModel } from './config/models/config-submission-forms.model';
|
||||||
|
import { SubmissionSectionModel } from './config/models/config-submission-section.model';
|
||||||
|
import { SubmissionUploadsModel } from './config/models/config-submission-uploads.model';
|
||||||
|
import { EPerson } from './eperson/models/eperson.model';
|
||||||
|
import { Group } from './eperson/models/group.model';
|
||||||
|
import { MetadataField } from './metadata/metadata-field.model';
|
||||||
|
import { MetadataSchema } from './metadata/metadata-schema.model';
|
||||||
|
import { BitstreamFormat } from './shared/bitstream-format.model';
|
||||||
|
import { Bitstream } from './shared/bitstream.model';
|
||||||
|
import { BrowseDefinition } from './shared/browse-definition.model';
|
||||||
|
import { BrowseEntry } from './shared/browse-entry.model';
|
||||||
|
import { Bundle } from './shared/bundle.model';
|
||||||
|
import { Collection } from './shared/collection.model';
|
||||||
|
import { Community } from './shared/community.model';
|
||||||
|
import { DSpaceObject } from './shared/dspace-object.model';
|
||||||
|
import { ExternalSourceEntry } from './shared/external-source-entry.model';
|
||||||
|
import { ExternalSource } from './shared/external-source.model';
|
||||||
|
import { ItemType } from './shared/item-relationships/item-type.model';
|
||||||
|
import { RelationshipType } from './shared/item-relationships/relationship-type.model';
|
||||||
|
import { Relationship } from './shared/item-relationships/relationship.model';
|
||||||
|
import { Item } from './shared/item.model';
|
||||||
|
import { License } from './shared/license.model';
|
||||||
|
import { ResourcePolicy } from './resource-policy/models/resource-policy.model';
|
||||||
|
import { Site } from './shared/site.model';
|
||||||
|
import { WorkflowItem } from './submission/models/workflowitem.model';
|
||||||
|
import { WorkspaceItem } from './submission/models/workspaceitem.model';
|
||||||
|
import { ClaimedTask } from './tasks/models/claimed-task-object.model';
|
||||||
|
import { PoolTask } from './tasks/models/pool-task-object.model';
|
||||||
|
import { TaskObject } from './tasks/models/task-object.model';
|
||||||
|
import { environment } from '../../environments/environment';
|
||||||
|
import { Version } from './shared/version.model';
|
||||||
|
import { VersionHistory } from './shared/version-history.model';
|
||||||
|
import { Script } from '../process-page/scripts/script.model';
|
||||||
|
import { Process } from '../process-page/processes/process.model';
|
||||||
|
import { WorkflowAction } from './tasks/models/workflow-action-object.model';
|
||||||
|
import { TemplateItem } from './shared/template-item.model';
|
||||||
|
import { Feature } from './shared/feature.model';
|
||||||
|
import { Authorization } from './shared/authorization.model';
|
||||||
|
import { Registration } from './shared/registration.model';
|
||||||
|
import { SubmissionCcLicence } from './submission/models/submission-cc-license.model';
|
||||||
|
import { SubmissionCcLicenceUrl } from './submission/models/submission-cc-license-url.model';
|
||||||
|
import { VocabularyEntry } from './submission/vocabularies/models/vocabulary-entry.model';
|
||||||
|
import { Vocabulary } from './submission/vocabularies/models/vocabulary.model';
|
||||||
|
import { VocabularyEntryDetail } from './submission/vocabularies/models/vocabulary-entry-detail.model';
|
||||||
|
import { ConfigurationProperty } from './shared/configuration-property.model';
|
||||||
|
import { ShortLivedToken } from './auth/models/short-lived-token.model';
|
||||||
|
import { UsageReport } from './statistics/models/usage-report.model';
|
||||||
|
import { Root } from './data/root.model';
|
||||||
|
import { SearchConfig } from './shared/search/search-filters/search-config.model';
|
||||||
|
import { SubmissionAccessesModel } from './config/models/config-submission-accesses.model';
|
||||||
|
import { RatingAdvancedWorkflowInfo } from './tasks/models/rating-advanced-workflow-info.model';
|
||||||
|
import { AdvancedWorkflowInfo } from './tasks/models/advanced-workflow-info.model';
|
||||||
|
import { SelectReviewerAdvancedWorkflowInfo } from './tasks/models/select-reviewer-advanced-workflow-info.model';
|
||||||
|
import { AccessStatusObject } from '../shared/object-collection/shared/badges/access-status-badge/access-status.model';
|
||||||
|
import { ResearcherProfile } from './profile/model/researcher-profile.model';
|
||||||
|
import { OrcidQueue } from './orcid/model/orcid-queue.model';
|
||||||
|
import { OrcidHistory } from './orcid/model/orcid-history.model';
|
||||||
|
import { IdentifierData } from '../shared/object-list/identifier-data/identifier-data.model';
|
||||||
|
import { Subscription } from '../shared/subscriptions/models/subscription.model';
|
||||||
|
import { ItemRequest } from './shared/item-request.model';
|
||||||
|
import { HierarchicalBrowseDefinition } from './shared/hierarchical-browse-definition.model';
|
||||||
|
import { FlatBrowseDefinition } from './shared/flat-browse-definition.model';
|
||||||
|
import { ValueListBrowseDefinition } from './shared/value-list-browse-definition.model';
|
||||||
|
import { NonHierarchicalBrowseDefinition } from './shared/non-hierarchical-browse-definition';
|
||||||
|
import { BulkAccessConditionOptions } from './config/models/bulk-access-condition-options.model';
|
||||||
|
import { Action, StoreConfig, StoreModule } from '@ngrx/store';
|
||||||
|
import { EffectsModule } from '@ngrx/effects';
|
||||||
|
import { coreReducers } from './core.reducers';
|
||||||
|
import { storeModuleConfig } from '../app.reducer';
|
||||||
|
import { CoreState } from './core-state.model';
|
||||||
|
import { coreEffects } from './core.effects';
|
||||||
|
|
||||||
|
|
||||||
|
export const provideCore = () => {
|
||||||
|
console.log('provideCore');
|
||||||
|
return makeEnvironmentProviders([
|
||||||
|
{ provide: DspaceRestService, useFactory: restServiceFactory, deps: [MOCK_RESPONSE_MAP, HttpClient] },
|
||||||
|
|
||||||
|
importProvidersFrom(
|
||||||
|
StoreModule.forFeature('core', coreReducers, storeModuleConfig as StoreConfig<CoreState, Action>),
|
||||||
|
EffectsModule.forFeature(coreEffects)
|
||||||
|
),
|
||||||
|
]);
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* When not in production, endpoint responses can be mocked for testing purposes
|
||||||
|
* If there is no mock version available for the endpoint, the actual REST response will be used just like in production mode
|
||||||
|
*/
|
||||||
|
export const restServiceFactory = (mocks: ResponseMapMock, http: HttpClient) => {
|
||||||
|
if (environment.production) {
|
||||||
|
return new DspaceRestService(http);
|
||||||
|
} else {
|
||||||
|
return new EndpointMockingRestService(mocks, http);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Declaration needed to make sure all decorator functions are called in time
|
||||||
|
*/
|
||||||
|
export const models =
|
||||||
|
[
|
||||||
|
Root,
|
||||||
|
DSpaceObject,
|
||||||
|
Bundle,
|
||||||
|
Bitstream,
|
||||||
|
BitstreamFormat,
|
||||||
|
Item,
|
||||||
|
Site,
|
||||||
|
Collection,
|
||||||
|
Community,
|
||||||
|
EPerson,
|
||||||
|
Group,
|
||||||
|
ResourcePolicy,
|
||||||
|
MetadataSchema,
|
||||||
|
MetadataField,
|
||||||
|
License,
|
||||||
|
WorkflowItem,
|
||||||
|
WorkspaceItem,
|
||||||
|
SubmissionCcLicence,
|
||||||
|
SubmissionCcLicenceUrl,
|
||||||
|
SubmissionDefinitionsModel,
|
||||||
|
SubmissionFormsModel,
|
||||||
|
SubmissionSectionModel,
|
||||||
|
SubmissionUploadsModel,
|
||||||
|
AuthStatus,
|
||||||
|
BrowseEntry,
|
||||||
|
BrowseDefinition,
|
||||||
|
NonHierarchicalBrowseDefinition,
|
||||||
|
FlatBrowseDefinition,
|
||||||
|
ValueListBrowseDefinition,
|
||||||
|
HierarchicalBrowseDefinition,
|
||||||
|
ClaimedTask,
|
||||||
|
TaskObject,
|
||||||
|
PoolTask,
|
||||||
|
Relationship,
|
||||||
|
RelationshipType,
|
||||||
|
ItemType,
|
||||||
|
ExternalSource,
|
||||||
|
ExternalSourceEntry,
|
||||||
|
Script,
|
||||||
|
Process,
|
||||||
|
Version,
|
||||||
|
VersionHistory,
|
||||||
|
WorkflowAction,
|
||||||
|
AdvancedWorkflowInfo,
|
||||||
|
RatingAdvancedWorkflowInfo,
|
||||||
|
SelectReviewerAdvancedWorkflowInfo,
|
||||||
|
TemplateItem,
|
||||||
|
Feature,
|
||||||
|
Authorization,
|
||||||
|
Registration,
|
||||||
|
Vocabulary,
|
||||||
|
VocabularyEntry,
|
||||||
|
VocabularyEntryDetail,
|
||||||
|
ConfigurationProperty,
|
||||||
|
ShortLivedToken,
|
||||||
|
Registration,
|
||||||
|
UsageReport,
|
||||||
|
Root,
|
||||||
|
SearchConfig,
|
||||||
|
SubmissionAccessesModel,
|
||||||
|
AccessStatusObject,
|
||||||
|
ResearcherProfile,
|
||||||
|
OrcidQueue,
|
||||||
|
OrcidHistory,
|
||||||
|
AccessStatusObject,
|
||||||
|
IdentifierData,
|
||||||
|
Subscription,
|
||||||
|
ItemRequest,
|
||||||
|
BulkAccessConditionOptions
|
||||||
|
];
|
@@ -40,7 +40,7 @@ const selectedMetadataFieldsSelector = createSelector(metadataRegistryStateSelec
|
|||||||
/**
|
/**
|
||||||
* Service for registry related CRUD actions such as metadata schema, metadata field and bitstream format
|
* Service for registry related CRUD actions such as metadata schema, metadata field and bitstream format
|
||||||
*/
|
*/
|
||||||
@Injectable()
|
@Injectable({ providedIn: 'root' })
|
||||||
export class RegistryService {
|
export class RegistryService {
|
||||||
|
|
||||||
constructor(private store: Store<AppState>,
|
constructor(private store: Store<AppState>,
|
||||||
|
@@ -7,7 +7,7 @@ import { isNotEmpty } from '../../shared/empty.util';
|
|||||||
* A guard redirecting the user to the URL provided in the route's query params
|
* A guard redirecting the user to the URL provided in the route's query params
|
||||||
* When no redirect url is found, the user is redirected to the homepage
|
* When no redirect url is found, the user is redirected to the homepage
|
||||||
*/
|
*/
|
||||||
@Injectable()
|
@Injectable({ providedIn: 'root' })
|
||||||
export class ReloadGuard implements CanActivate {
|
export class ReloadGuard implements CanActivate {
|
||||||
constructor(
|
constructor(
|
||||||
private router: Router,
|
private router: Router,
|
||||||
|
@@ -10,7 +10,6 @@ import { RemoteData } from '../data/remote-data';
|
|||||||
import { RemoteDataBuildService } from '../cache/builders/remote-data-build.service';
|
import { RemoteDataBuildService } from '../cache/builders/remote-data-build.service';
|
||||||
import { ObjectCacheService } from '../cache/object-cache.service';
|
import { ObjectCacheService } from '../cache/object-cache.service';
|
||||||
import { NotificationsService } from '../../shared/notifications/notifications.service';
|
import { NotificationsService } from '../../shared/notifications/notifications.service';
|
||||||
import { RESOURCE_POLICY } from './models/resource-policy.resource-type';
|
|
||||||
import { DefaultChangeAnalyzer } from '../data/default-change-analyzer.service';
|
import { DefaultChangeAnalyzer } from '../data/default-change-analyzer.service';
|
||||||
import { PaginatedList } from '../data/paginated-list.model';
|
import { PaginatedList } from '../data/paginated-list.model';
|
||||||
import { ActionType } from './models/action-type.model';
|
import { ActionType } from './models/action-type.model';
|
||||||
@@ -32,13 +31,11 @@ import { CreateDataImpl } from '../data/base/create-data';
|
|||||||
import { SearchDataImpl } from '../data/base/search-data';
|
import { SearchDataImpl } from '../data/base/search-data';
|
||||||
import { PatchDataImpl } from '../data/base/patch-data';
|
import { PatchDataImpl } from '../data/base/patch-data';
|
||||||
import { DeleteDataImpl } from '../data/base/delete-data';
|
import { DeleteDataImpl } from '../data/base/delete-data';
|
||||||
import { dataService } from '../data/base/data-service.decorator';
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A service responsible for fetching/sending data from/to the REST API on the resourcepolicies endpoint
|
* A service responsible for fetching/sending data from/to the REST API on the resourcepolicies endpoint
|
||||||
*/
|
*/
|
||||||
@Injectable()
|
@Injectable({ providedIn: 'root' })
|
||||||
@dataService(RESOURCE_POLICY)
|
|
||||||
export class ResourcePolicyDataService extends IdentifiableDataService<ResourcePolicy> {
|
export class ResourcePolicyDataService extends IdentifiableDataService<ResourcePolicy> {
|
||||||
protected searchByEPersonMethod = 'eperson';
|
protected searchByEPersonMethod = 'eperson';
|
||||||
protected searchByGroupMethod = 'group';
|
protected searchByGroupMethod = 'group';
|
||||||
|
@@ -9,7 +9,7 @@ import { CollectionDataService } from '../data/collection-data.service';
|
|||||||
/**
|
/**
|
||||||
* A service that provides methods to identify user role.
|
* A service that provides methods to identify user role.
|
||||||
*/
|
*/
|
||||||
@Injectable()
|
@Injectable({ providedIn: 'root' })
|
||||||
export class RoleService {
|
export class RoleService {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -4,7 +4,7 @@ import { DOCUMENT } from '@angular/common';
|
|||||||
/**
|
/**
|
||||||
* LinkHead Service injects <link> tag into the head element during runtime.
|
* LinkHead Service injects <link> tag into the head element during runtime.
|
||||||
*/
|
*/
|
||||||
@Injectable()
|
@Injectable({ providedIn: 'root' })
|
||||||
export class LinkHeadService {
|
export class LinkHeadService {
|
||||||
constructor(
|
constructor(
|
||||||
private rendererFactory: RendererFactory2,
|
private rendererFactory: RendererFactory2,
|
||||||
|
@@ -6,7 +6,7 @@ import { Response } from 'express';
|
|||||||
/**
|
/**
|
||||||
* Service responsible to provide method to manage the response object
|
* Service responsible to provide method to manage the response object
|
||||||
*/
|
*/
|
||||||
@Injectable()
|
@Injectable({ providedIn: 'root' })
|
||||||
export class ServerResponseService {
|
export class ServerResponseService {
|
||||||
private response: Response;
|
private response: Response;
|
||||||
|
|
||||||
|
@@ -1,6 +1,9 @@
|
|||||||
import { InjectionToken } from '@angular/core';
|
import { InjectionToken } from '@angular/core';
|
||||||
|
|
||||||
export const NativeWindowService = new InjectionToken('NativeWindowService');
|
export const NativeWindowService = new InjectionToken('NativeWindowService', {
|
||||||
|
providedIn: 'root',
|
||||||
|
factory: NativeWindowFactory
|
||||||
|
});
|
||||||
|
|
||||||
export class NativeWindowRef {
|
export class NativeWindowRef {
|
||||||
get nativeWindow(): any {
|
get nativeWindow(): any {
|
||||||
|
@@ -11,7 +11,7 @@ import { RemoteDataBuildService } from '../cache/builders/remote-data-build.serv
|
|||||||
import { RemoteData } from '../data/remote-data';
|
import { RemoteData } from '../data/remote-data';
|
||||||
import { UnCacheableObject } from './uncacheable-object.model';
|
import { UnCacheableObject } from './uncacheable-object.model';
|
||||||
|
|
||||||
@Injectable()
|
@Injectable({ providedIn: 'root' })
|
||||||
export class HALEndpointService {
|
export class HALEndpointService {
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
|
@@ -32,7 +32,7 @@ import { FacetConfigResponse } from '../../../shared/search/models/facet-config-
|
|||||||
/**
|
/**
|
||||||
* Service that performs all actions that have to do with the current search configuration
|
* Service that performs all actions that have to do with the current search configuration
|
||||||
*/
|
*/
|
||||||
@Injectable()
|
@Injectable({ providedIn: 'root' })
|
||||||
export class SearchConfigurationService implements OnDestroy {
|
export class SearchConfigurationService implements OnDestroy {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -31,7 +31,7 @@ export const REFRESH_FILTER: InjectionToken<BehaviorSubject<any>> = new Injectio
|
|||||||
/**
|
/**
|
||||||
* Service that performs all actions that have to do with search filters and facets
|
* Service that performs all actions that have to do with search filters and facets
|
||||||
*/
|
*/
|
||||||
@Injectable()
|
@Injectable({ providedIn: 'root' })
|
||||||
export class SearchFilterService {
|
export class SearchFilterService {
|
||||||
|
|
||||||
constructor(private store: Store<SearchFiltersState>,
|
constructor(private store: Store<SearchFiltersState>,
|
||||||
|
@@ -59,7 +59,7 @@ class SearchDataService extends BaseDataService<any> {
|
|||||||
/**
|
/**
|
||||||
* Service that performs all general actions that have to do with the search page
|
* Service that performs all general actions that have to do with the search page
|
||||||
*/
|
*/
|
||||||
@Injectable()
|
@Injectable({ providedIn: 'root' })
|
||||||
export class SearchService implements OnDestroy {
|
export class SearchService implements OnDestroy {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -7,7 +7,7 @@
|
|||||||
*/
|
*/
|
||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
|
|
||||||
@Injectable()
|
@Injectable({ providedIn: 'root' })
|
||||||
/**
|
/**
|
||||||
* Provides unique sequential numbers
|
* Provides unique sequential numbers
|
||||||
*/
|
*/
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
import { v4 as uuidv4 } from 'uuid';
|
import { v4 as uuidv4 } from 'uuid';
|
||||||
|
|
||||||
@Injectable()
|
@Injectable({ providedIn: 'root' })
|
||||||
export class UUIDService {
|
export class UUIDService {
|
||||||
generate(): string {
|
generate(): string {
|
||||||
return uuidv4();
|
return uuidv4();
|
||||||
|
@@ -3,7 +3,6 @@ import { RemoteDataBuildService } from '../cache/builders/remote-data-build.serv
|
|||||||
import { ObjectCacheService } from '../cache/object-cache.service';
|
import { ObjectCacheService } from '../cache/object-cache.service';
|
||||||
import { HALEndpointService } from '../shared/hal-endpoint.service';
|
import { HALEndpointService } from '../shared/hal-endpoint.service';
|
||||||
import { RequestService } from '../data/request.service';
|
import { RequestService } from '../data/request.service';
|
||||||
import { USAGE_REPORT } from './models/usage-report.resource-type';
|
|
||||||
import { UsageReport } from './models/usage-report.model';
|
import { UsageReport } from './models/usage-report.model';
|
||||||
import { Observable } from 'rxjs';
|
import { Observable } from 'rxjs';
|
||||||
import { getFirstSucceededRemoteData, getRemoteDataPayload } from '../shared/operators';
|
import { getFirstSucceededRemoteData, getRemoteDataPayload } from '../shared/operators';
|
||||||
@@ -14,13 +13,11 @@ import { FindListOptions } from '../data/find-list-options.model';
|
|||||||
import { FollowLinkConfig } from '../../shared/utils/follow-link-config.model';
|
import { FollowLinkConfig } from '../../shared/utils/follow-link-config.model';
|
||||||
import { RemoteData } from '../data/remote-data';
|
import { RemoteData } from '../data/remote-data';
|
||||||
import { PaginatedList } from '../data/paginated-list.model';
|
import { PaginatedList } from '../data/paginated-list.model';
|
||||||
import { dataService } from '../data/base/data-service.decorator';
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A service to retrieve {@link UsageReport}s from the REST API
|
* A service to retrieve {@link UsageReport}s from the REST API
|
||||||
*/
|
*/
|
||||||
@Injectable()
|
@Injectable({ providedIn: 'root' })
|
||||||
@dataService(USAGE_REPORT)
|
|
||||||
export class UsageReportDataService extends IdentifiableDataService<UsageReport> implements SearchData<UsageReport> {
|
export class UsageReportDataService extends IdentifiableDataService<UsageReport> implements SearchData<UsageReport> {
|
||||||
private searchData: SearchDataImpl<UsageReport>;
|
private searchData: SearchDataImpl<UsageReport>;
|
||||||
|
|
||||||
|
@@ -3,7 +3,6 @@ import { RemoteDataBuildService } from '../cache/builders/remote-data-build.serv
|
|||||||
import { ObjectCacheService } from '../cache/object-cache.service';
|
import { ObjectCacheService } from '../cache/object-cache.service';
|
||||||
import { HALEndpointService } from '../shared/hal-endpoint.service';
|
import { HALEndpointService } from '../shared/hal-endpoint.service';
|
||||||
import { RequestService } from '../data/request.service';
|
import { RequestService } from '../data/request.service';
|
||||||
import { SUBMISSION_CC_LICENSE } from './models/submission-cc-licence.resource-type';
|
|
||||||
import { SubmissionCcLicence } from './models/submission-cc-license.model';
|
import { SubmissionCcLicence } from './models/submission-cc-license.model';
|
||||||
import { BaseDataService } from '../data/base/base-data.service';
|
import { BaseDataService } from '../data/base/base-data.service';
|
||||||
import {FindAllData, FindAllDataImpl} from '../data/base/find-all-data';
|
import {FindAllData, FindAllDataImpl} from '../data/base/find-all-data';
|
||||||
@@ -12,10 +11,8 @@ import { FollowLinkConfig } from '../../shared/utils/follow-link-config.model';
|
|||||||
import { Observable } from 'rxjs';
|
import { Observable } from 'rxjs';
|
||||||
import { RemoteData } from '../data/remote-data';
|
import { RemoteData } from '../data/remote-data';
|
||||||
import { PaginatedList } from '../data/paginated-list.model';
|
import { PaginatedList } from '../data/paginated-list.model';
|
||||||
import { dataService } from '../data/base/data-service.decorator';
|
|
||||||
|
|
||||||
@Injectable()
|
@Injectable({ providedIn: 'root' })
|
||||||
@dataService(SUBMISSION_CC_LICENSE)
|
|
||||||
export class SubmissionCcLicenseDataService extends BaseDataService<SubmissionCcLicence> implements FindAllData<SubmissionCcLicence> {
|
export class SubmissionCcLicenseDataService extends BaseDataService<SubmissionCcLicence> implements FindAllData<SubmissionCcLicence> {
|
||||||
|
|
||||||
protected linkPath = 'submissioncclicenses';
|
protected linkPath = 'submissioncclicenses';
|
||||||
|
@@ -4,7 +4,6 @@ import { ObjectCacheService } from '../cache/object-cache.service';
|
|||||||
import { HALEndpointService } from '../shared/hal-endpoint.service';
|
import { HALEndpointService } from '../shared/hal-endpoint.service';
|
||||||
import { RequestService } from '../data/request.service';
|
import { RequestService } from '../data/request.service';
|
||||||
import { SubmissionCcLicenceUrl } from './models/submission-cc-license-url.model';
|
import { SubmissionCcLicenceUrl } from './models/submission-cc-license-url.model';
|
||||||
import { SUBMISSION_CC_LICENSE_URL } from './models/submission-cc-licence-link.resource-type';
|
|
||||||
import { Field, Option, SubmissionCcLicence } from './models/submission-cc-license.model';
|
import { Field, Option, SubmissionCcLicence } from './models/submission-cc-license.model';
|
||||||
import { Observable } from 'rxjs';
|
import { Observable } from 'rxjs';
|
||||||
import { map, switchMap } from 'rxjs/operators';
|
import { map, switchMap } from 'rxjs/operators';
|
||||||
@@ -15,10 +14,8 @@ import { FindListOptions } from '../data/find-list-options.model';
|
|||||||
import { FollowLinkConfig } from '../../shared/utils/follow-link-config.model';
|
import { FollowLinkConfig } from '../../shared/utils/follow-link-config.model';
|
||||||
import { RemoteData } from '../data/remote-data';
|
import { RemoteData } from '../data/remote-data';
|
||||||
import { PaginatedList } from '../data/paginated-list.model';
|
import { PaginatedList } from '../data/paginated-list.model';
|
||||||
import { dataService } from '../data/base/data-service.decorator';
|
|
||||||
|
|
||||||
@Injectable()
|
@Injectable({ providedIn: 'root' })
|
||||||
@dataService(SUBMISSION_CC_LICENSE_URL)
|
|
||||||
export class SubmissionCcLicenseUrlDataService extends BaseDataService<SubmissionCcLicenceUrl> implements SearchData<SubmissionCcLicenceUrl> {
|
export class SubmissionCcLicenseUrlDataService extends BaseDataService<SubmissionCcLicenceUrl> implements SearchData<SubmissionCcLicenceUrl> {
|
||||||
private searchData: SearchDataImpl<SubmissionCcLicenceUrl>;
|
private searchData: SearchDataImpl<SubmissionCcLicenceUrl>;
|
||||||
|
|
||||||
|
@@ -13,7 +13,7 @@ import { CoreState } from '../core-state.model';
|
|||||||
/**
|
/**
|
||||||
* A service that provides methods to make JSON Patch requests.
|
* A service that provides methods to make JSON Patch requests.
|
||||||
*/
|
*/
|
||||||
@Injectable()
|
@Injectable({ providedIn: 'root' })
|
||||||
export class SubmissionJsonPatchOperationsService extends JsonPatchOperationsService<SubmitDataResponseDefinitionObject, SubmissionPatchRequest> {
|
export class SubmissionJsonPatchOperationsService extends JsonPatchOperationsService<SubmitDataResponseDefinitionObject, SubmissionPatchRequest> {
|
||||||
protected linkPath = '';
|
protected linkPath = '';
|
||||||
protected patchRequestConstructor = SubmissionPatchRequest;
|
protected patchRequestConstructor = SubmissionPatchRequest;
|
||||||
|
@@ -70,7 +70,7 @@ export function normalizeSectionData(obj: any, objIndex?: number) {
|
|||||||
/**
|
/**
|
||||||
* Provides methods to parse response for a submission request.
|
* Provides methods to parse response for a submission request.
|
||||||
*/
|
*/
|
||||||
@Injectable()
|
@Injectable({ providedIn: 'root' })
|
||||||
export class SubmissionResponseParsingService extends BaseResponseParsingService implements ResponseParsingService {
|
export class SubmissionResponseParsingService extends BaseResponseParsingService implements ResponseParsingService {
|
||||||
|
|
||||||
protected toCache = false;
|
protected toCache = false;
|
||||||
|
@@ -26,7 +26,7 @@ import { RestRequest } from '../data/rest-request.model';
|
|||||||
/**
|
/**
|
||||||
* The service handling all submission REST requests
|
* The service handling all submission REST requests
|
||||||
*/
|
*/
|
||||||
@Injectable()
|
@Injectable({ providedIn: 'root' })
|
||||||
export class SubmissionRestService {
|
export class SubmissionRestService {
|
||||||
protected linkPath = 'workspaceitems';
|
protected linkPath = 'workspaceitems';
|
||||||
|
|
||||||
|
@@ -19,14 +19,11 @@ import { RemoteData } from '../../data/remote-data';
|
|||||||
import { PaginatedList } from '../../data/paginated-list.model';
|
import { PaginatedList } from '../../data/paginated-list.model';
|
||||||
import { SearchData, SearchDataImpl } from '../../data/base/search-data';
|
import { SearchData, SearchDataImpl } from '../../data/base/search-data';
|
||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
import { VOCABULARY_ENTRY_DETAIL } from './models/vocabularies.resource-type';
|
|
||||||
import { dataService } from '../../data/base/data-service.decorator';
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Data service to retrieve vocabulary entry details from the REST server.
|
* Data service to retrieve vocabulary entry details from the REST server.
|
||||||
*/
|
*/
|
||||||
@Injectable()
|
@Injectable({ providedIn: 'root' })
|
||||||
@dataService(VOCABULARY_ENTRY_DETAIL)
|
|
||||||
export class VocabularyEntryDetailsDataService extends IdentifiableDataService<VocabularyEntryDetail> implements FindAllData<VocabularyEntryDetail>, SearchData<VocabularyEntryDetail> {
|
export class VocabularyEntryDetailsDataService extends IdentifiableDataService<VocabularyEntryDetail> implements FindAllData<VocabularyEntryDetail>, SearchData<VocabularyEntryDetail> {
|
||||||
private findAllData: FindAllData<VocabularyEntryDetail>;
|
private findAllData: FindAllData<VocabularyEntryDetail>;
|
||||||
private searchData: SearchData<VocabularyEntryDetail>;
|
private searchData: SearchData<VocabularyEntryDetail>;
|
||||||
|
@@ -18,14 +18,11 @@ import { Observable } from 'rxjs';
|
|||||||
import { RemoteData } from '../../data/remote-data';
|
import { RemoteData } from '../../data/remote-data';
|
||||||
import { PaginatedList } from '../../data/paginated-list.model';
|
import { PaginatedList } from '../../data/paginated-list.model';
|
||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
import { VOCABULARY } from './models/vocabularies.resource-type';
|
|
||||||
import { dataService } from '../../data/base/data-service.decorator';
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Data service to retrieve vocabularies from the REST server.
|
* Data service to retrieve vocabularies from the REST server.
|
||||||
*/
|
*/
|
||||||
@Injectable()
|
@Injectable({ providedIn: 'root' })
|
||||||
@dataService(VOCABULARY)
|
|
||||||
export class VocabularyDataService extends IdentifiableDataService<Vocabulary> implements FindAllData<Vocabulary> {
|
export class VocabularyDataService extends IdentifiableDataService<Vocabulary> implements FindAllData<Vocabulary> {
|
||||||
private findAllData: FindAllData<Vocabulary>;
|
private findAllData: FindAllData<Vocabulary>;
|
||||||
|
|
||||||
|
@@ -24,7 +24,7 @@ import { VocabularyDataService } from './vocabulary.data.service';
|
|||||||
/**
|
/**
|
||||||
* A service responsible for fetching/sending data from/to the REST API on the vocabularies endpoint
|
* A service responsible for fetching/sending data from/to the REST API on the vocabularies endpoint
|
||||||
*/
|
*/
|
||||||
@Injectable()
|
@Injectable({ providedIn: 'root' })
|
||||||
export class VocabularyService {
|
export class VocabularyService {
|
||||||
protected searchTopMethod = 'top';
|
protected searchTopMethod = 'top';
|
||||||
|
|
||||||
|
@@ -20,13 +20,11 @@ import { IdentifiableDataService } from '../data/base/identifiable-data.service'
|
|||||||
import { SearchData, SearchDataImpl } from '../data/base/search-data';
|
import { SearchData, SearchDataImpl } from '../data/base/search-data';
|
||||||
import { DeleteData, DeleteDataImpl } from '../data/base/delete-data';
|
import { DeleteData, DeleteDataImpl } from '../data/base/delete-data';
|
||||||
import { PaginatedList } from '../data/paginated-list.model';
|
import { PaginatedList } from '../data/paginated-list.model';
|
||||||
import { dataService } from '../data/base/data-service.decorator';
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A service that provides methods to make REST requests with workflow items endpoint.
|
* A service that provides methods to make REST requests with workflow items endpoint.
|
||||||
*/
|
*/
|
||||||
@Injectable()
|
@Injectable({ providedIn: 'root' })
|
||||||
@dataService(WorkflowItem.type)
|
|
||||||
export class WorkflowItemDataService extends IdentifiableDataService<WorkflowItem> implements SearchData<WorkflowItem>, DeleteData<WorkflowItem> {
|
export class WorkflowItemDataService extends IdentifiableDataService<WorkflowItem> implements SearchData<WorkflowItem>, DeleteData<WorkflowItem> {
|
||||||
protected linkPath = 'workflowitems';
|
protected linkPath = 'workflowitems';
|
||||||
protected searchByItemLinkPath = 'item';
|
protected searchByItemLinkPath = 'item';
|
||||||
|
@@ -15,13 +15,11 @@ import { SearchData, SearchDataImpl } from '../data/base/search-data';
|
|||||||
import { PaginatedList } from '../data/paginated-list.model';
|
import { PaginatedList } from '../data/paginated-list.model';
|
||||||
import { DeleteData, DeleteDataImpl } from '../data/base/delete-data';
|
import { DeleteData, DeleteDataImpl } from '../data/base/delete-data';
|
||||||
import { NoContent } from '../shared/NoContent.model';
|
import { NoContent } from '../shared/NoContent.model';
|
||||||
import { dataService } from '../data/base/data-service.decorator';
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A service that provides methods to make REST requests with workspaceitems endpoint.
|
* A service that provides methods to make REST requests with workspaceitems endpoint.
|
||||||
*/
|
*/
|
||||||
@Injectable()
|
@Injectable({ providedIn: 'root' })
|
||||||
@dataService(WorkspaceItem.type)
|
|
||||||
export class WorkspaceitemDataService extends IdentifiableDataService<WorkspaceItem> implements SearchData<WorkspaceItem>, DeleteData<WorkspaceItem> {
|
export class WorkspaceitemDataService extends IdentifiableDataService<WorkspaceItem> implements SearchData<WorkspaceItem>, DeleteData<WorkspaceItem> {
|
||||||
protected searchByItemLinkPath = 'item';
|
protected searchByItemLinkPath = 'item';
|
||||||
|
|
||||||
|
@@ -9,7 +9,6 @@ import { RemoteData } from '../data/remote-data';
|
|||||||
import { RemoteDataBuildService } from '../cache/builders/remote-data-build.service';
|
import { RemoteDataBuildService } from '../cache/builders/remote-data-build.service';
|
||||||
import { ObjectCacheService } from '../cache/object-cache.service';
|
import { ObjectCacheService } from '../cache/object-cache.service';
|
||||||
import { NotificationsService } from '../../shared/notifications/notifications.service';
|
import { NotificationsService } from '../../shared/notifications/notifications.service';
|
||||||
import { SUPERVISION_ORDER } from './models/supervision-order.resource-type';
|
|
||||||
import { DefaultChangeAnalyzer } from '../data/default-change-analyzer.service';
|
import { DefaultChangeAnalyzer } from '../data/default-change-analyzer.service';
|
||||||
import { PaginatedList } from '../data/paginated-list.model';
|
import { PaginatedList } from '../data/paginated-list.model';
|
||||||
import { RequestParam } from '../cache/models/request-param.model';
|
import { RequestParam } from '../cache/models/request-param.model';
|
||||||
@@ -29,13 +28,11 @@ import { CreateDataImpl } from '../data/base/create-data';
|
|||||||
import { SearchDataImpl } from '../data/base/search-data';
|
import { SearchDataImpl } from '../data/base/search-data';
|
||||||
import { PatchDataImpl } from '../data/base/patch-data';
|
import { PatchDataImpl } from '../data/base/patch-data';
|
||||||
import { DeleteDataImpl } from '../data/base/delete-data';
|
import { DeleteDataImpl } from '../data/base/delete-data';
|
||||||
import { dataService } from '../data/base/data-service.decorator';
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A service responsible for fetching/sending data from/to the REST API on the supervisionorders endpoint
|
* A service responsible for fetching/sending data from/to the REST API on the supervisionorders endpoint
|
||||||
*/
|
*/
|
||||||
@Injectable()
|
@Injectable({ providedIn: 'root' })
|
||||||
@dataService(SUPERVISION_ORDER)
|
|
||||||
export class SupervisionOrderDataService extends IdentifiableDataService<SupervisionOrder> {
|
export class SupervisionOrderDataService extends IdentifiableDataService<SupervisionOrder> {
|
||||||
protected searchByGroupMethod = 'group';
|
protected searchByGroupMethod = 'group';
|
||||||
protected searchByItemMethod = 'byItem';
|
protected searchByItemMethod = 'byItem';
|
||||||
|
@@ -6,7 +6,6 @@ import { ObjectCacheService } from '../cache/object-cache.service';
|
|||||||
import { RequestService } from '../data/request.service';
|
import { RequestService } from '../data/request.service';
|
||||||
import { HALEndpointService } from '../shared/hal-endpoint.service';
|
import { HALEndpointService } from '../shared/hal-endpoint.service';
|
||||||
import { ClaimedTask } from './models/claimed-task-object.model';
|
import { ClaimedTask } from './models/claimed-task-object.model';
|
||||||
import { CLAIMED_TASK } from './models/claimed-task-object.resource-type';
|
|
||||||
import { ProcessTaskResponse } from './models/process-task-response';
|
import { ProcessTaskResponse } from './models/process-task-response';
|
||||||
import { TasksService } from './tasks.service';
|
import { TasksService } from './tasks.service';
|
||||||
import { RemoteData } from '../data/remote-data';
|
import { RemoteData } from '../data/remote-data';
|
||||||
@@ -14,13 +13,11 @@ import { RequestParam } from '../cache/models/request-param.model';
|
|||||||
import { HttpOptions } from '../dspace-rest/dspace-rest.service';
|
import { HttpOptions } from '../dspace-rest/dspace-rest.service';
|
||||||
import { getFirstSucceededRemoteData } from '../shared/operators';
|
import { getFirstSucceededRemoteData } from '../shared/operators';
|
||||||
import { FindListOptions } from '../data/find-list-options.model';
|
import { FindListOptions } from '../data/find-list-options.model';
|
||||||
import { dataService } from '../data/base/data-service.decorator';
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The service handling all REST requests for ClaimedTask
|
* The service handling all REST requests for ClaimedTask
|
||||||
*/
|
*/
|
||||||
@Injectable()
|
@Injectable({ providedIn: 'root' })
|
||||||
@dataService(CLAIMED_TASK)
|
|
||||||
export class ClaimedTaskDataService extends TasksService<ClaimedTask> {
|
export class ClaimedTaskDataService extends TasksService<ClaimedTask> {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user