diff --git a/src/app/views/data-view/data-outlets/resource-detail/resource-detail-html/resource-detail-html-content/resource-detail-html-content.component.spec.ts b/src/app/views/data-view/data-outlets/resource-detail/resource-detail-html/resource-detail-html-content/resource-detail-html-content.component.spec.ts
index 4b9583c253..cc9cba6d8b 100644
--- a/src/app/views/data-view/data-outlets/resource-detail/resource-detail-html/resource-detail-html-content/resource-detail-html-content.component.spec.ts
+++ b/src/app/views/data-view/data-outlets/resource-detail/resource-detail-html/resource-detail-html-content/resource-detail-html-content.component.spec.ts
@@ -12,6 +12,7 @@ import {
} from '@testing/expect-helper';
import { mockContextJson } from '@testing/mock-data';
+import { GndEvent } from '@awg-core/services/gnd-service';
import { ContextJson } from '@awg-shared/api-objects';
import {
ResourceDetailContent,
@@ -28,6 +29,8 @@ class ResourceDetailHtmlContentPropsStubComponent {
@Input()
props: ResourceDetailProperty[];
@Output()
+ gndRequest: EventEmitter
= new EventEmitter();
+ @Output()
resourceRequest: EventEmitter = new EventEmitter();
}
diff --git a/src/app/views/data-view/data-outlets/resource-detail/resource-detail-html/resource-detail-html-content/resource-detail-html-content.component.ts b/src/app/views/data-view/data-outlets/resource-detail/resource-detail-html/resource-detail-html-content/resource-detail-html-content.component.ts
index aef9274aa7..e4b5dc272e 100644
--- a/src/app/views/data-view/data-outlets/resource-detail/resource-detail-html/resource-detail-html-content/resource-detail-html-content.component.ts
+++ b/src/app/views/data-view/data-outlets/resource-detail/resource-detail-html/resource-detail-html-content/resource-detail-html-content.component.ts
@@ -1,6 +1,7 @@
import { ChangeDetectionStrategy, Component, EventEmitter, Input, OnInit, Output } from '@angular/core';
import { ResourceDetailContent } from '@awg-views/data-view/models';
+import { GndEvent } from '@awg-core/services/gnd-service';
/**
* The ResourceDetailHtmlContent component.
@@ -26,6 +27,14 @@ export class ResourceDetailHtmlContentComponent implements OnInit {
@Input()
content: ResourceDetailContent;
+ /**
+ * Output variable: gndRequest.
+ *
+ * It keeps an event emitter for the exposition of a GND value.
+ */
+ @Output()
+ gndRequest: EventEmitter = new EventEmitter();
+
/**
* Output variable: resourceRequest.
*
@@ -42,6 +51,23 @@ export class ResourceDetailHtmlContentComponent implements OnInit {
*/
ngOnInit() {}
+ /**
+ * Public method: exposeGnd.
+ *
+ * It emits a given gnd event (type, value)
+ * to the {@link gndRequest}.
+ *
+ * @param {{type: string, value: string}} gndEvent The given event.
+ *
+ * @returns {void} Emits the event.
+ */
+ exposeGnd(gndEvent: GndEvent): void {
+ if (!gndEvent) {
+ return;
+ }
+ this.gndRequest.emit(gndEvent);
+ }
+
/**
* Public method: navigateToResource.
*
diff --git a/src/app/views/data-view/data-outlets/resource-detail/resource-detail-html/resource-detail-html.component.html b/src/app/views/data-view/data-outlets/resource-detail/resource-detail-html/resource-detail-html.component.html
index e5956ea95f..2e2215dd4f 100644
--- a/src/app/views/data-view/data-outlets/resource-detail/resource-detail-html/resource-detail-html.component.html
+++ b/src/app/views/data-view/data-outlets/resource-detail/resource-detail-html/resource-detail-html.component.html
@@ -2,6 +2,7 @@
diff --git a/src/app/views/data-view/data-outlets/resource-detail/resource-detail-html/resource-detail-html.component.spec.ts b/src/app/views/data-view/data-outlets/resource-detail/resource-detail-html/resource-detail-html.component.spec.ts
index eba549fd2c..a2a022d207 100644
--- a/src/app/views/data-view/data-outlets/resource-detail/resource-detail-html/resource-detail-html.component.spec.ts
+++ b/src/app/views/data-view/data-outlets/resource-detail/resource-detail-html/resource-detail-html.component.spec.ts
@@ -13,6 +13,7 @@ import {
ResourceDetailImage,
ResourceDetailProperty
} from '@awg-views/data-view/models';
+import { GndEvent } from '@awg-core/services/gnd-service';
import { ResourceDetailHtmlComponent } from './resource-detail-html.component';
@@ -22,6 +23,8 @@ class ResourceDetailHtmlContentStubComponent {
@Input()
content: ResourceDetailContent;
@Output()
+ gndRequest: EventEmitter = new EventEmitter();
+ @Output()
resourceRequest: EventEmitter = new EventEmitter();
}
diff --git a/src/app/views/data-view/data-outlets/resource-detail/resource-detail-html/resource-detail-html.component.ts b/src/app/views/data-view/data-outlets/resource-detail/resource-detail-html/resource-detail-html.component.ts
index fc9ea6dbaf..0b4aff42e0 100644
--- a/src/app/views/data-view/data-outlets/resource-detail/resource-detail-html/resource-detail-html.component.ts
+++ b/src/app/views/data-view/data-outlets/resource-detail/resource-detail-html/resource-detail-html.component.ts
@@ -1,6 +1,7 @@
import { ChangeDetectionStrategy, Component, EventEmitter, Input, OnInit, Output } from '@angular/core';
import { ResourceDetail } from '@awg-views/data-view/models';
+import { GndEvent } from '@awg-core/services/gnd-service';
/**
* The ResourceDetailHtml component.
@@ -24,6 +25,14 @@ export class ResourceDetailHtmlComponent implements OnInit {
@Input()
resourceDetailData: ResourceDetail;
+ /**
+ * Output variable: gndRequest.
+ *
+ * It keeps an event emitter for the exposition of a GND value.
+ */
+ @Output()
+ gndRequest: EventEmitter = new EventEmitter();
+
/**
* Output variable: resourceRequest.
*
@@ -40,6 +49,23 @@ export class ResourceDetailHtmlComponent implements OnInit {
*/
ngOnInit() {}
+ /**
+ * Public method: exposeGnd.
+ *
+ * It emits a given gnd event (type, value)
+ * to the {@link gndRequest}.
+ *
+ * @param {{type: string, value: string}} gndEvent The given event.
+ *
+ * @returns {void} Emits the event.
+ */
+ exposeGnd(gndEvent: GndEvent): void {
+ if (!gndEvent) {
+ return;
+ }
+ this.gndRequest.emit(gndEvent);
+ }
+
/**
* Public method: navigateToResource.
*
diff --git a/src/app/views/data-view/data-outlets/resource-detail/resource-detail.component.html b/src/app/views/data-view/data-outlets/resource-detail/resource-detail.component.html
index 2af6044f38..6795a59c6c 100644
--- a/src/app/views/data-view/data-outlets/resource-detail/resource-detail.component.html
+++ b/src/app/views/data-view/data-outlets/resource-detail/resource-detail.component.html
@@ -33,6 +33,7 @@
diff --git a/src/app/views/data-view/data-outlets/resource-detail/resource-detail.component.spec.ts b/src/app/views/data-view/data-outlets/resource-detail/resource-detail.component.spec.ts
index 081ec14865..34734a6ad2 100644
--- a/src/app/views/data-view/data-outlets/resource-detail/resource-detail.component.spec.ts
+++ b/src/app/views/data-view/data-outlets/resource-detail/resource-detail.component.spec.ts
@@ -11,6 +11,7 @@ import { NgbTabsetModule } from '@ng-bootstrap/ng-bootstrap';
import Spy = jasmine.Spy;
import { DataStreamerService, LoadingService } from '@awg-core/services';
+import { GndEvent } from '@awg-core/services/gnd-service';
import { DataApiService } from '@awg-views/data-view/services';
import { ResourceFullResponseJson } from '@awg-shared/api-objects';
@@ -34,6 +35,8 @@ class ResourceDetailHtmlStubComponent {
@Input()
resourceDetailData: ResourceDetail;
@Output()
+ gndRequest: EventEmitter = new EventEmitter();
+ @Output()
resourceRequest: EventEmitter = new EventEmitter();
}
diff --git a/src/app/views/data-view/data-outlets/resource-detail/resource-detail.component.ts b/src/app/views/data-view/data-outlets/resource-detail/resource-detail.component.ts
index 97af269869..1161799bed 100644
--- a/src/app/views/data-view/data-outlets/resource-detail/resource-detail.component.ts
+++ b/src/app/views/data-view/data-outlets/resource-detail/resource-detail.component.ts
@@ -6,7 +6,8 @@ import { switchMap, takeUntil } from 'rxjs/operators';
import { NgbTabsetConfig } from '@ng-bootstrap/ng-bootstrap';
-import { DataStreamerService, LoadingService } from '@awg-core/services';
+import { DataStreamerService, GndService, LoadingService } from '@awg-core/services';
+import { GndEvent, GndEventType } from '@awg-core/services/gnd-service';
import { DataApiService } from '@awg-views/data-view/services';
import { ResourceData } from '@awg-views/data-view/models';
@@ -96,13 +97,14 @@ export class ResourceDetailComponent implements OnInit, OnDestroy {
*
* It declares private instances of the Angular ActivatedRoute,
* the Angular Router, the DataApiService, the DataStreamerService,
- * the LoadingService, and a configuration object for the
+ * the GndService, the LoadingService, and a configuration object for the
* ng-bootstrap tabset.
*
* @param {ActivatedRoute} route Instance of the Angular ActivatedRoute.
* @param {Router} router Instance of the Angular Router.
* @param {DataApiService} dataApiService Instance of the DataApiService.
* @param {DataStreamerService} dataStreamerService Instance of the DataStreamerService.
+ * @param {GndService} gndService Instance of the GndService.
* @param {LoadingService} loadingService Instance of the LoadingService.
* @param {NgbTabsetConfig} config Instance of the NgbTabsetConfig.
*/
@@ -111,6 +113,7 @@ export class ResourceDetailComponent implements OnInit, OnDestroy {
private router: Router,
private dataApiService: DataApiService,
private dataStreamerService: DataStreamerService,
+ private gndService: GndService,
private loadingService: LoadingService,
config: NgbTabsetConfig
) {
@@ -203,6 +206,38 @@ export class ResourceDetailComponent implements OnInit, OnDestroy {
this.router.navigate(['/data/resource', +nextId]);
}
+ /**
+ * Public method: exposeGnd.
+ *
+ * It delegates a given gnd event type ('set', 'get', 'remove')
+ * with a given value to the {@link GndService}.
+ * The gnd event is emitted from the {@link ResourceDetailHtmlContentPropsComponent}.
+ *
+ * @param {{type: string, value: string}} gndEvent The given event.
+ *
+ * @returns {void} Delegates the event to the GndService.
+ */
+ exposeGnd(gndEvent: GndEvent): void {
+ if (!gndEvent) {
+ return;
+ }
+ switch (gndEvent.type) {
+ case GndEventType.set: {
+ // statements
+ this.gndService.setGndToSessionStorage(gndEvent.value);
+ break;
+ }
+ case GndEventType.remove: {
+ // statements
+ this.gndService.removeGndFromSessionStorage();
+ break;
+ }
+ default: {
+ console.log('got an uncatched GND event', gndEvent);
+ }
+ }
+ }
+
/**
* Public method: routeToSidenav.
*
diff --git a/src/app/views/edition-view/edition-outlets/edition-detail/edition-accolade/edition-accolade.component.html b/src/app/views/edition-view/edition-outlets/edition-detail/edition-accolade/edition-accolade.component.html
index 9cd3807368..a2e3f4b6ec 100644
--- a/src/app/views/edition-view/edition-outlets/edition-detail/edition-accolade/edition-accolade.component.html
+++ b/src/app/views/edition-view/edition-outlets/edition-detail/edition-accolade/edition-accolade.component.html
@@ -15,7 +15,8 @@