From 7cf27a206c5e6577db3c0ac90ed01ef8add0ea97 Mon Sep 17 00:00:00 2001 From: Shay Hadar Date: Thu, 16 Dec 2021 14:37:01 +0200 Subject: [PATCH] Graphical representation display of record life cycle --- .../full-view-display.component.html | 20 +++++++---- .../full-view-display.component.ts | 2 ++ .../catalog/results-types/results-common.ts | 35 +++++++++++++++++-- .../src/app/catalog/results-types/serials.ts | 10 +++++- .../result-card/result-card.component.html | 2 +- 5 files changed, 58 insertions(+), 11 deletions(-) diff --git a/cloudapp/src/app/catalog/full-view-display/full-view-display.component.html b/cloudapp/src/app/catalog/full-view-display/full-view-display.component.html index d7492aa..273d3bf 100644 --- a/cloudapp/src/app/catalog/full-view-display/full-view-display.component.html +++ b/cloudapp/src/app/catalog/full-view-display/full-view-display.component.html @@ -8,12 +8,20 @@
{{field.getLabel()}}
- - {{field.getContent()}} - - - {{field.getContent()}} - + +
+
+ {{field.getContent()}} +
+ + {{field.getContent()}} + + + {{field.getContent()}} + + +
+ diff --git a/cloudapp/src/app/catalog/full-view-display/full-view-display.component.ts b/cloudapp/src/app/catalog/full-view-display/full-view-display.component.ts index 69369b2..cd7d92d 100644 --- a/cloudapp/src/app/catalog/full-view-display/full-view-display.component.ts +++ b/cloudapp/src/app/catalog/full-view-display/full-view-display.component.ts @@ -1,5 +1,6 @@ import { Component, Input, Output, EventEmitter } from '@angular/core'; import { SearchType } from '../../user-controls/search-form/search-form-utils'; +import { LinkState } from '../results-types/results-common'; @Component({ @@ -13,6 +14,7 @@ export class FullviewDisplayComponent { @Input() resultFullDisplay; @Output() onFullViewLinkSelected = new EventEmitter(); + linkState: typeof LinkState = LinkState; constructor() { } diff --git a/cloudapp/src/app/catalog/results-types/results-common.ts b/cloudapp/src/app/catalog/results-types/results-common.ts index 612652a..f3f7ce3 100644 --- a/cloudapp/src/app/catalog/results-types/results-common.ts +++ b/cloudapp/src/app/catalog/results-types/results-common.ts @@ -176,19 +176,26 @@ export class ViewLine { } } +export enum LinkState { + NoLink, + InternalLink, + ExternalLink +} + export class ViewField { private label: string; private content: string; private link: string; private onlyLabel: boolean; - + private externalLink: string; constructor(ViewFieldBuilder: ViewFieldBuilder) { this.label = ViewFieldBuilder.getLabel(); this.content = ViewFieldBuilder.getContent(); this.link = ViewFieldBuilder.getLink(); this.onlyLabel = ViewFieldBuilder.isOnlyLabel()? true : false; + this.externalLink = ViewFieldBuilder.getExternalLink(); } getLabel() { @@ -207,17 +214,30 @@ export class ViewField { return this.link; } + getExternalLink() { + return this.externalLink; + } + hasContent() { return (this.content != "" && this.content != undefined); } - isLinkable() { + isInternalLink() { return (this.link != null); } isOnlyLabel() { return this.onlyLabel; } + + getLinkState() : LinkState { + + if(this.link != null) + return LinkState.InternalLink; + if(this.externalLink != null) + return LinkState.ExternalLink; + return LinkState.NoLink; + } } export class ViewFieldBuilder { @@ -226,10 +246,10 @@ export class ViewFieldBuilder { private _content: string; private _link: string; private _onlyLabel: boolean = true; + private _externalLink: string; constructor() { } - getLabel() { return this._label; } @@ -262,6 +282,15 @@ export class ViewFieldBuilder { return this; } + externalLink(externalLink: string) { + this._externalLink = externalLink; + return this; + } + + getExternalLink() { + return this._externalLink; + } + build() { return new ViewField(this); } diff --git a/cloudapp/src/app/catalog/results-types/serials.ts b/cloudapp/src/app/catalog/results-types/serials.ts index 830a49d..542da42 100644 --- a/cloudapp/src/app/catalog/results-types/serials.ts +++ b/cloudapp/src/app/catalog/results-types/serials.ts @@ -296,8 +296,16 @@ export class SerialFullDisplay extends IDisplayLines { fieldsArray = new Array(); fieldsArray.push(new ViewFieldBuilder().content(this.record.PRICE).build()); this.addLine(new ViewFieldBuilder().label("PRICE").build(), fieldsArray); + + // FID external link + let externalLink = "https://mokuren.nii.ac.jp/cgi-bin/map/map-frame.cgi?encode=UTF-8"; + externalLink += "&ncid=" + this.record.ID; + externalLink += "&fid=" + this.record.FID; + externalLink += "&cgi=http://ci.nii.ac.jp/ncid/"; + fieldsArray = new Array(); - fieldsArray.push(new ViewFieldBuilder().content(this.record.FID).build()); + fieldsArray.push(new ViewFieldBuilder().content(this.record.FID).externalLink(externalLink).build()); + this.addLine(new ViewFieldBuilder().label("FID").build(), fieldsArray); this.record.BHNT?.forEach(bhnt=>{ fieldsArray = new Array(); diff --git a/cloudapp/src/app/user-controls/result-card/result-card.component.html b/cloudapp/src/app/user-controls/result-card/result-card.component.html index 4a2696e..4ac1dc3 100644 --- a/cloudapp/src/app/user-controls/result-card/result-card.component.html +++ b/cloudapp/src/app/user-controls/result-card/result-card.component.html @@ -16,7 +16,7 @@
-