Dataset landing: 'Published In' information was parsed but not displayed. Now it's added in html too | Publication & Dataset landing: fixed tooltips for access mode in 'Download From' and 'Published In' sections | parsing for 'Download From' and 'Published In' of publication & dataset landing moved to parseDownloadFrom, parsePublishedIn functions of parsingFunctions.class
git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-services-portal/trunk@48347 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
parent
12dad9a0c0
commit
cc740847f3
|
@ -171,21 +171,29 @@
|
||||||
*ngFor="let key of datasetInfo.downloadFrom.keys() let i=index" >
|
*ngFor="let key of datasetInfo.downloadFrom.keys() let i=index" >
|
||||||
<div *ngIf="i<5 || showAllDownloadFrom"
|
<div *ngIf="i<5 || showAllDownloadFrom"
|
||||||
class="{{datasetInfo.downloadFrom.get(key)['bestAccessMode']}}">
|
class="{{datasetInfo.downloadFrom.get(key)['bestAccessMode']}}">
|
||||||
<span class="custom-external custom-icon" uk-tooltip="pos:right; delay:10"
|
<span [class]="datasetInfo.downloadFrom.get(key)['url'].length > 0 ? 'custom-external custom-icon' : ''">
|
||||||
[title]="datasetInfo.downloadFrom.get(key)['accessMode']">
|
|
||||||
<span *ngIf="datasetInfo.downloadFrom.get(key)['url'].length > 1">
|
<span *ngIf="datasetInfo.downloadFrom.get(key)['url'].length > 1">
|
||||||
{{key}}
|
{{key}}
|
||||||
<span *ngFor="let url of datasetInfo.downloadFrom.get(key)['url']; let i=index;">
|
<span *ngFor="let url of datasetInfo.downloadFrom.get(key)['url']; let i=index;">
|
||||||
<a href="{{url}}" target="_blank">
|
<a href="{{url}}" target="_blank"
|
||||||
|
[attr.uk-tooltip]="datasetInfo.downloadFrom.get(key)['accessMode'][i] ? 'pos:right; delay:10' : 'cls: uk-invisible'"
|
||||||
|
[title]="datasetInfo.downloadFrom.get(key)['accessMode'][i]">
|
||||||
[{{i+1}}]
|
[{{i+1}}]
|
||||||
</a>
|
</a>
|
||||||
</span>
|
</span>
|
||||||
</span>
|
</span>
|
||||||
<a *ngIf="datasetInfo.downloadFrom.get(key)['url'].length == 1"
|
<a *ngIf="datasetInfo.downloadFrom.get(key)['url'].length == 1"
|
||||||
href="{{datasetInfo.downloadFrom.get(key)['url']}}"
|
href="{{datasetInfo.downloadFrom.get(key)['url']}}"
|
||||||
target="_blank">
|
target="_blank"
|
||||||
|
[attr.uk-tooltip]="datasetInfo.downloadFrom.get(key)['bestAccessMode'] ? 'pos:right; delay:10' : 'cls: uk-invisible'"
|
||||||
|
[title]="datasetInfo.downloadFrom.get(key)['bestAccessMode']">
|
||||||
{{key}}
|
{{key}}
|
||||||
</a>
|
</a>
|
||||||
|
<span *ngIf="datasetInfo.downloadFrom.get(key)['url'].length == 0"
|
||||||
|
[attr.uk-tooltip]="datasetInfo.downloadFrom.get(key)['bestAccessMode'] ? 'pos:right; delay:10' : 'cls: uk-invisible'"
|
||||||
|
[title]="datasetInfo.downloadFrom.get(key)['bestAccessMode']">
|
||||||
|
{{key}}
|
||||||
|
</span>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</dd>
|
</dd>
|
||||||
|
@ -202,13 +210,57 @@
|
||||||
</dd>
|
</dd>
|
||||||
</dl>
|
</dl>
|
||||||
</li>
|
</li>
|
||||||
|
<li *ngIf="datasetInfo.publishedIn && datasetInfo.publishedIn.size > 0">
|
||||||
|
<dl class="uk-description-list-line">
|
||||||
|
<dt class="title">Published in</dt>
|
||||||
|
<dd class="line" *ngFor="let key of datasetInfo.publishedIn.keys() let i=index">
|
||||||
|
<div *ngIf="i<5 || showAllPublishedIn" class="{{datasetInfo.publishedIn.get(key)['bestAccessMode']}}">
|
||||||
|
<span [class]="datasetInfo.publishedIn.get(key)['url'].length > 0 ? 'custom-external custom-icon' : ''">
|
||||||
|
<span *ngIf="datasetInfo.publishedIn.get(key)['url'].length > 1">
|
||||||
|
{{key}}
|
||||||
|
<span *ngFor="let url of datasetInfo.publishedIn.get(key)['url']; let i=index">
|
||||||
|
<a href="{{url}}" target="_blank"
|
||||||
|
[attr.uk-tooltip]="datasetInfo.publishedIn.get(key)['accessMode'][i] ? 'pos:right; delay:10' : 'cls: uk-invisible'"
|
||||||
|
[title]="datasetInfo.publishedIn.get(key)['accessMode'][i]">
|
||||||
|
[{{i+1}}]
|
||||||
|
</a>
|
||||||
|
</span>
|
||||||
|
</span>
|
||||||
|
<a *ngIf="datasetInfo.publishedIn.get(key)['url'].length == 1"
|
||||||
|
href="{{datasetInfo.publishedIn.get(key)['url']}}"
|
||||||
|
target="_blank"
|
||||||
|
[attr.uk-tooltip]="datasetInfo.publishedIn.get(key)['bestAccessMode'] ? 'pos:right; delay:10' : 'cls: uk-invisible'"
|
||||||
|
[title]="datasetInfo.publishedIn.get(key)['bestAccessMode']">
|
||||||
|
{{key}}
|
||||||
|
</a>
|
||||||
|
<span *ngIf="datasetInfo.publishedIn.get(key)['url'].length == 0"
|
||||||
|
[attr.uk-tooltip]="datasetInfo.publishedIn.get(key)['bestAccessMode'] ? 'pos:right; delay:10' : 'cls: uk-invisible'"
|
||||||
|
[title]="datasetInfo.publishedIn.get(key)['bestAccessMode']">
|
||||||
|
{{key}}
|
||||||
|
</span>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</dd>
|
||||||
|
<dd *ngIf="showAllPublishedIn" class="uk-text-right">
|
||||||
|
<a class="uk-text-muted" (click)="showAllPublishedIn = !showAllPublishedIn;">
|
||||||
|
View less
|
||||||
|
</a>
|
||||||
|
</dd>
|
||||||
|
<dd *ngIf="!showAllPublishedIn && datasetInfo.publishedIn.size > 5">...</dd>
|
||||||
|
<dd *ngIf="!showAllPublishedIn && datasetInfo.publishedIn.length > 5" class="uk-text-right">
|
||||||
|
<a class="uk-text-muted" (click)="showAllPublishedIn = !showAllPublishedIn;">
|
||||||
|
View more
|
||||||
|
</a>
|
||||||
|
</dd>
|
||||||
|
</dl>
|
||||||
|
</li>
|
||||||
<li *ngIf="datasetInfo.fundedByProjects != undefined && datasetInfo.fundedByProjects.length > 0">
|
<li *ngIf="datasetInfo.fundedByProjects != undefined && datasetInfo.fundedByProjects.length > 0">
|
||||||
<dl class="uk-description-list-line" >
|
<dl class="uk-description-list-line" >
|
||||||
<dt class="title">Funded By</dt>
|
<dt class="title">Funded By</dt>
|
||||||
<dd class="line"
|
<dd class="line"
|
||||||
*ngFor="let item of datasetInfo.fundedByProjects let i=index">
|
*ngFor="let item of datasetInfo.fundedByProjects let i=index">
|
||||||
<div *ngIf="i<5 || showAllFundedBy">
|
<div *ngIf="i<5 || showAllFundedBy">
|
||||||
<span data-uk-tooltip="pos:right; delay:10"
|
<span uk-tooltip="pos:right; delay:10"
|
||||||
title="{{buildFundingTooltip(item)}}">
|
title="{{buildFundingTooltip(item)}}">
|
||||||
|
|
||||||
<a *ngIf="!item['inline'] && item.id"
|
<a *ngIf="!item['inline'] && item.id"
|
||||||
|
|
|
@ -17,6 +17,7 @@ export class DatasetComponent {
|
||||||
|
|
||||||
public showAllCollectedFrom: boolean = false;
|
public showAllCollectedFrom: boolean = false;
|
||||||
public showAllDownloadFrom: boolean = false;
|
public showAllDownloadFrom: boolean = false;
|
||||||
|
public showAllPublishedIn: boolean = false;
|
||||||
public showAllFundedBy: boolean = false;
|
public showAllFundedBy: boolean = false;
|
||||||
|
|
||||||
private showStyle: boolean = false;
|
private showStyle: boolean = false;
|
||||||
|
|
|
@ -310,114 +310,11 @@ export class DatasetService {
|
||||||
url = mydata['webresource'][0].url;
|
url = mydata['webresource'][0].url;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!this.datasetInfo.downloadFrom.has(url) && mydata.hasOwnProperty("hostedby")) {
|
if(mydata.hasOwnProperty("hostedby")) {
|
||||||
if(mydata['hostedby'].name != "other resources" && mydata['hostedby'].name != "Unknown Repository") {
|
if(mydata['hostedby'].name != "other resources" && mydata['hostedby'].name != "Unknown Repository") {
|
||||||
let key: string = mydata['hostedby'].name;
|
this.parsingFunctions.parseDownloadFrom(this.datasetInfo.downloadFrom, mydata, url);
|
||||||
|
|
||||||
if(!this.datasetInfo.downloadFrom.has(key)) {
|
|
||||||
this.datasetInfo.downloadFrom.set(key, {"url": null, "accessMode": null, "bestAccessMode": null});
|
|
||||||
}
|
|
||||||
|
|
||||||
if(this.datasetInfo.downloadFrom.get(key)['url'] == null) {
|
|
||||||
this.datasetInfo.downloadFrom.get(key)['url'] = new Array<string>();
|
|
||||||
}
|
|
||||||
|
|
||||||
counter2 = this.datasetInfo.downloadFrom.get(key)['url'].length;
|
|
||||||
this.datasetInfo.downloadFrom.get(key)['url'][counter2] = url;
|
|
||||||
|
|
||||||
if(this.datasetInfo.downloadFrom.get(key)['accessMode'] == null) {
|
|
||||||
this.datasetInfo.downloadFrom.get(key)['accessMode'] = new Array<string>();
|
|
||||||
}
|
|
||||||
|
|
||||||
if(mydata.hasOwnProperty("licence")) {
|
|
||||||
this.datasetInfo.downloadFrom.get(key)['accessMode'].push(mydata['licence'].classid);
|
|
||||||
//this.datasetInfo.downloadFrom.get(mydata['hostedby'].name)['accessMode'][counter2] = mydata['licence'].classid;
|
|
||||||
|
|
||||||
switch (this.datasetInfo.downloadFrom.get(key)['bestAccessMode']) {
|
|
||||||
case null:
|
|
||||||
this.datasetInfo.downloadFrom.get(key)['bestAccessMode'] = mydata['licence'].classid;
|
|
||||||
break;
|
|
||||||
case "CLOSED":
|
|
||||||
if(mydata['licence'].classid == "OPEN" ||
|
|
||||||
mydata['licence'].classid == "EMBARGO" ||
|
|
||||||
mydata['licence'].classid == "RESTRICTED") {
|
|
||||||
this.datasetInfo.downloadFrom.get(key)['bestAccessMode'] = mydata['licence'].classid;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case "RESTRICTED":
|
|
||||||
if(mydata['licence'].classid == "OPEN" ||
|
|
||||||
mydata['licence'].classid == "EMBARGO") {
|
|
||||||
this.datasetInfo.downloadFrom.get(key)['bestAccessMode'] = mydata['licence'].classid;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case "EMBARGO":
|
|
||||||
if(mydata['licence'].classid == "OPEN") {
|
|
||||||
this.datasetInfo.downloadFrom.get(key)['bestAccessMode'] = mydata['licence'].classid;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
//this.datasetInfo.downloadFrom.get(mydata['hostedby'].name)['accessMode'][counter2] = "";
|
|
||||||
this.datasetInfo.downloadFrom.get(key)['accessMode'].push("");
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
if(data[0] != null && data[0].hasOwnProperty("source")) {
|
counter1 = this.parsingFunctions.parsePublishedIn(this.datasetInfo.publishedIn, mydata, data[0], url, counter1);
|
||||||
let key: string;
|
|
||||||
if(Array.isArray(data[0].source)) {
|
|
||||||
if(!this.datasetInfo.publishedIn.has(data[0]['source'][counter1])) {
|
|
||||||
key = data[0]['source'][counter1];
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if(!this.datasetInfo.publishedIn.has(data[0]['source'])) {
|
|
||||||
key = data[0]['source'];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
this.datasetInfo.publishedIn.set(key, {"url": null, "accessMode": null, "bestAccessMode": null});
|
|
||||||
|
|
||||||
if(this.datasetInfo.publishedIn.get(key)['url'] == null) {
|
|
||||||
this.datasetInfo.publishedIn.get(key)['url'] = new Array<string>();
|
|
||||||
}
|
|
||||||
|
|
||||||
counter2 = this.datasetInfo.publishedIn.get(key)['url'].length;
|
|
||||||
this.datasetInfo.publishedIn.get(key)['url'][counter2] = url;
|
|
||||||
|
|
||||||
if(this.datasetInfo.publishedIn.get(key)['accessMode'] == null) {
|
|
||||||
this.datasetInfo.publishedIn.get(key)['accessMode'] = new Array<string>();
|
|
||||||
}
|
|
||||||
|
|
||||||
if(mydata.hasOwnProperty("licence")) {
|
|
||||||
//this.datasetInfo.publishedIn.get(key)['accessMode'][counter2] = mydata['licence'].classid;
|
|
||||||
this.datasetInfo.publishedIn.get(key)['accessMode'].push(mydata['licence'].classid);
|
|
||||||
switch (this.datasetInfo.publishedIn.get(key)['bestAccessMode']) {
|
|
||||||
case null:
|
|
||||||
this.datasetInfo.publishedIn.get(key)['bestAccessMode'] = mydata['licence'].classid;
|
|
||||||
break;
|
|
||||||
case "CLOSED":
|
|
||||||
if(mydata['licence'].classid == "OPEN" ||
|
|
||||||
mydata['licence'].classid == "EMBARGO" ||
|
|
||||||
mydata['licence'].classid == "RESTRICTED") {
|
|
||||||
this.datasetInfo.publishedIn.get(key)['bestAccessMode'] = mydata['licence'].classid;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case "RESTRICTED":
|
|
||||||
if(mydata['licence'].classid == "OPEN" ||
|
|
||||||
mydata['licence'].classid == "EMBARGO") {
|
|
||||||
this.datasetInfo.publishedIn.get(key)['bestAccessMode'] = mydata['licence'].classid;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case "EMBARGO":
|
|
||||||
if(mydata['licence'].classid == "OPEN") {
|
|
||||||
this.datasetInfo.publishedIn.get(key)['bestAccessMode'] = mydata['licence'].classid;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
//this.datasetInfo.publishedIn.get(key)['accessMode'][counter2] = "";
|
|
||||||
this.datasetInfo.publishedIn.get(key)['accessMode'].push("");
|
|
||||||
}
|
|
||||||
counter1++;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if(this.datasetInfo.title != undefined) {
|
if(this.datasetInfo.title != undefined) {
|
||||||
if(this.datasetInfo.title['url'] == undefined) {
|
if(this.datasetInfo.title['url'] == undefined) {
|
||||||
|
|
|
@ -5,6 +5,7 @@ export class ParsingFunctions {
|
||||||
|
|
||||||
public ngOnDestroy() {}
|
public ngOnDestroy() {}
|
||||||
|
|
||||||
|
// publication & dataset : for fundedByProjects | project landing : for funding
|
||||||
public parseFundingTrees(fundingTree: any): {"funderName": string, "funderShortname": string, "stream": string} {
|
public parseFundingTrees(fundingTree: any): {"funderName": string, "funderShortname": string, "stream": string} {
|
||||||
let funding: {"funderName": string, "funderShortname": string, "stream": string} = {"funderName": "", "funderShortname": "", "stream": ""};
|
let funding: {"funderName": string, "funderShortname": string, "stream": string} = {"funderName": "", "funderShortname": "", "stream": ""};
|
||||||
let length = Array.isArray(fundingTree) ? fundingTree.length : 1;
|
let length = Array.isArray(fundingTree) ? fundingTree.length : 1;
|
||||||
|
@ -66,4 +67,94 @@ export class ParsingFunctions {
|
||||||
return fundingStream;
|
return fundingStream;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// publication & dataset landing : for downloadFrom
|
||||||
|
parseDownloadFrom(downloadFrom: Map<string, {"url": string[], "accessMode": string[], "bestAccessMode": string}>, instance: any, url: string)
|
||||||
|
{
|
||||||
|
let key: string = instance['hostedby'].name;
|
||||||
|
|
||||||
|
if(key) {
|
||||||
|
this.addUrlAndAccessMode(downloadFrom, instance, key, url);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// publication & dataset landing : for publishedIn
|
||||||
|
parsePublishedIn(publishedIn: Map<string, {"url": string[], "accessMode": string[], "bestAccessMode": string}>, instance: any, result: any, url: string, counter: number): number {
|
||||||
|
if(result != null && result.hasOwnProperty("source")) {
|
||||||
|
let key: string;
|
||||||
|
if(Array.isArray(result.source)) {
|
||||||
|
if(counter==result.source.length) {
|
||||||
|
counter--;
|
||||||
|
}
|
||||||
|
key = result['source'][counter];
|
||||||
|
} else {
|
||||||
|
key = result['source'];
|
||||||
|
}
|
||||||
|
|
||||||
|
if(key) {
|
||||||
|
this.addUrlAndAccessMode(publishedIn, instance, key, url);
|
||||||
|
counter++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return counter;
|
||||||
|
}
|
||||||
|
|
||||||
|
// publication & dataset landing : for downloadFrom and publishedIn
|
||||||
|
addUrlAndAccessMode(mapStructure: Map<string, {"url": string[], "accessMode": string[], "bestAccessMode": string}>, instance: any, key: string, url: string) {
|
||||||
|
if(!mapStructure.has(key)) {
|
||||||
|
mapStructure.set(key, {"url": null, "accessMode": null, "bestAccessMode": null});
|
||||||
|
}
|
||||||
|
|
||||||
|
if(mapStructure.get(key)['url'] == null) {
|
||||||
|
mapStructure.get(key)['url'] = new Array<string>();
|
||||||
|
}
|
||||||
|
|
||||||
|
if(url) {
|
||||||
|
mapStructure.get(key)['url'].push(url);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(mapStructure.get(key)['accessMode'] == null) {
|
||||||
|
mapStructure.get(key)['accessMode'] = new Array<string>();
|
||||||
|
}
|
||||||
|
|
||||||
|
if(instance.hasOwnProperty("licence")) {
|
||||||
|
if(url) {
|
||||||
|
mapStructure.get(key)['accessMode'].push(instance['licence'].classid);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(this.changeBestAccessMode(mapStructure.get(key)['bestAccessMode'], instance['licence'].classid)) {
|
||||||
|
mapStructure.get(key)['bestAccessMode'] = instance['licence'].classid;
|
||||||
|
}
|
||||||
|
|
||||||
|
} else if(url) {
|
||||||
|
mapStructure.get(key)['accessMode'].push("");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// publication & dataset landing : for downloadFrom and publishedIn
|
||||||
|
changeBestAccessMode(currentAccessMode: string, accessMode: string): boolean {
|
||||||
|
switch (currentAccessMode) {
|
||||||
|
case null:
|
||||||
|
return true;
|
||||||
|
case "CLOSED":
|
||||||
|
if(accessMode == "OPEN" ||
|
||||||
|
accessMode == "EMBARGO" ||
|
||||||
|
accessMode == "RESTRICTED") {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
case "RESTRICTED":
|
||||||
|
if(accessMode == "OPEN" ||
|
||||||
|
accessMode == "EMBARGO") {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
case "EMBARGO":
|
||||||
|
if(accessMode == "OPEN") {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -382,21 +382,31 @@
|
||||||
*ngFor="let key of publicationInfo.downloadFrom.keys() let i=index" >
|
*ngFor="let key of publicationInfo.downloadFrom.keys() let i=index" >
|
||||||
<div *ngIf="i<5 || showAllDownloadFrom"
|
<div *ngIf="i<5 || showAllDownloadFrom"
|
||||||
class="{{publicationInfo.downloadFrom.get(key)['bestAccessMode']}}">
|
class="{{publicationInfo.downloadFrom.get(key)['bestAccessMode']}}">
|
||||||
<span class="custom-external custom-icon" uk-tooltip="pos:right; delay:10"
|
<!--span class="custom-external custom-icon" uk-tooltip="pos:right; delay:10"
|
||||||
[title]="publicationInfo.downloadFrom.get(key)['accessMode']">
|
[title]="publicationInfo.downloadFrom.get(key)['accessMode']"-->
|
||||||
|
<span [class]="publicationInfo.downloadFrom.get(key)['url'].length > 0 ? 'custom-external custom-icon' : ''">
|
||||||
<span *ngIf="publicationInfo.downloadFrom.get(key)['url'].length > 1">
|
<span *ngIf="publicationInfo.downloadFrom.get(key)['url'].length > 1">
|
||||||
{{key}}
|
{{key}}
|
||||||
<span *ngFor="let url of publicationInfo.downloadFrom.get(key)['url']; let i=index;">
|
<span *ngFor="let url of publicationInfo.downloadFrom.get(key)['url']; let i=index;">
|
||||||
<a href="{{url}}" target="_blank">
|
<a href="{{url}}" target="_blank"
|
||||||
|
[attr.uk-tooltip]="publicationInfo.downloadFrom.get(key)['accessMode'][i] ? 'pos:right; delay:10' : 'cls: uk-invisible'"
|
||||||
|
[title]="publicationInfo.downloadFrom.get(key)['accessMode'][i]">
|
||||||
[{{i+1}}]
|
[{{i+1}}]
|
||||||
</a>
|
</a>
|
||||||
</span>
|
</span>
|
||||||
</span>
|
</span>
|
||||||
<a *ngIf="publicationInfo.downloadFrom.get(key)['url'].length == 1"
|
<a *ngIf="publicationInfo.downloadFrom.get(key)['url'].length == 1"
|
||||||
href="{{publicationInfo.downloadFrom.get(key)['url']}}"
|
href="{{publicationInfo.downloadFrom.get(key)['url']}}"
|
||||||
target="_blank">
|
target="_blank"
|
||||||
|
[attr.uk-tooltip]="publicationInfo.downloadFrom.get(key)['bestAccessMode'] ? 'pos:right; delay:10' : 'cls: uk-invisible'"
|
||||||
|
[title]="publicationInfo.downloadFrom.get(key)['bestAccessMode']">
|
||||||
{{key}}
|
{{key}}
|
||||||
</a>
|
</a>
|
||||||
|
<span *ngIf="publicationInfo.downloadFrom.get(key)['url'].length == 0"
|
||||||
|
[attr.uk-tooltip]="publicationInfo.downloadFrom.get(key)['bestAccessMode'] ? 'pos:right; delay:10' : 'cls: uk-invisible'"
|
||||||
|
[title]="publicationInfo.downloadFrom.get(key)['bestAccessMode']">
|
||||||
|
{{key}}
|
||||||
|
</span>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</dd>
|
</dd>
|
||||||
|
@ -416,24 +426,31 @@
|
||||||
<li *ngIf="publicationInfo.publishedIn && publicationInfo.publishedIn.size > 0">
|
<li *ngIf="publicationInfo.publishedIn && publicationInfo.publishedIn.size > 0">
|
||||||
<dl class="uk-description-list-line">
|
<dl class="uk-description-list-line">
|
||||||
<dt class="title">Published in</dt>
|
<dt class="title">Published in</dt>
|
||||||
<dd class="line" *ngFor="let key of publicationInfo.publishedIn.keys() let i=index"
|
<dd class="line" *ngFor="let key of publicationInfo.publishedIn.keys() let i=index">
|
||||||
>
|
|
||||||
<div *ngIf="i<5 || showAllPublishedIn" class="{{publicationInfo.publishedIn.get(key)['bestAccessMode']}}">
|
<div *ngIf="i<5 || showAllPublishedIn" class="{{publicationInfo.publishedIn.get(key)['bestAccessMode']}}">
|
||||||
<span class="custom-external custom-icon" uk-tooltip="pos:right; delay:10"
|
<span [class]="publicationInfo.publishedIn.get(key)['url'].length > 0 ? 'custom-external custom-icon' : ''">
|
||||||
[title]="publicationInfo.publishedIn.get(key)['accessMode']">
|
|
||||||
<span *ngIf="publicationInfo.publishedIn.get(key)['url'].length > 1">
|
<span *ngIf="publicationInfo.publishedIn.get(key)['url'].length > 1">
|
||||||
{{key}}
|
{{key}}
|
||||||
<span *ngFor="let url of publicationInfo.publishedIn.get(key)['url']; let i=index">
|
<span *ngFor="let url of publicationInfo.publishedIn.get(key)['url']; let i=index">
|
||||||
<a href="{{url}}" target="_blank">
|
<a href="{{url}}" target="_blank"
|
||||||
|
[attr.uk-tooltip]="publicationInfo.publishedIn.get(key)['accessMode'][i] ? 'pos:right; delay:10' : 'cls: uk-invisible'"
|
||||||
|
[title]="publicationInfo.publishedIn.get(key)['accessMode'][i]">
|
||||||
[{{i+1}}]
|
[{{i+1}}]
|
||||||
</a>
|
</a>
|
||||||
</span>
|
</span>
|
||||||
</span>
|
</span>
|
||||||
<a *ngIf="publicationInfo.publishedIn.get(key)['url'].length == 1"
|
<a *ngIf="publicationInfo.publishedIn.get(key)['url'].length == 1"
|
||||||
href="{{publicationInfo.publishedIn.get(key)['url']}}"
|
href="{{publicationInfo.publishedIn.get(key)['url']}}"
|
||||||
target="_blank">
|
target="_blank"
|
||||||
|
[attr.uk-tooltip]="publicationInfo.publishedIn.get(key)['bestAccessMode'] ? 'pos:right; delay:10' : 'cls: uk-invisible'"
|
||||||
|
[title]="publicationInfo.publishedIn.get(key)['bestAccessMode']">
|
||||||
{{key}}
|
{{key}}
|
||||||
</a>
|
</a>
|
||||||
|
<span *ngIf="publicationInfo.publishedIn.get(key)['url'].length == 0"
|
||||||
|
[attr.uk-tooltip]="publicationInfo.publishedIn.get(key)['bestAccessMode'] ? 'pos:right; delay:10' : 'cls: uk-invisible'"
|
||||||
|
[title]="publicationInfo.publishedIn.get(key)['bestAccessMode']">
|
||||||
|
{{key}}
|
||||||
|
</span>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</dd>
|
</dd>
|
||||||
|
|
|
@ -76,7 +76,6 @@ export class PublicationService {
|
||||||
this.publicationInfo.title = {"name": "", "url": "", "accessMode": ""};
|
this.publicationInfo.title = {"name": "", "url": "", "accessMode": ""};
|
||||||
if(data[0]['bestlicense'].hasOwnProperty("classid")) {
|
if(data[0]['bestlicense'].hasOwnProperty("classid")) {
|
||||||
this.publicationInfo.title.accessMode = data[0]['bestlicense'].classid;
|
this.publicationInfo.title.accessMode = data[0]['bestlicense'].classid;
|
||||||
console.info("accessmode by bestlicence = "+data[0]['bestlicense'].classid);
|
|
||||||
}
|
}
|
||||||
if(data[1] != null) {
|
if(data[1] != null) {
|
||||||
|
|
||||||
|
@ -309,114 +308,15 @@ export class PublicationService {
|
||||||
|
|
||||||
if(instance.hasOwnProperty("hostedby")) {
|
if(instance.hasOwnProperty("hostedby")) {
|
||||||
if(instance['hostedby'].name != "other resources" && instance['hostedby'].name != "Unknown Repository") {
|
if(instance['hostedby'].name != "other resources" && instance['hostedby'].name != "Unknown Repository") {
|
||||||
let key: string = instance['hostedby'].name;
|
this.parsingFunctions.parseDownloadFrom(this.publicationInfo.downloadFrom, instance, url);
|
||||||
|
|
||||||
if(!this.publicationInfo.downloadFrom.has(key)) {
|
|
||||||
this.publicationInfo.downloadFrom.set(key, {"url": null, "accessMode": null, "bestAccessMode": null});
|
|
||||||
}
|
|
||||||
if(this.publicationInfo.downloadFrom.get(key)['url'] == null) {
|
|
||||||
this.publicationInfo.downloadFrom.get(key)['url'] = new Array<string>();
|
|
||||||
}
|
|
||||||
|
|
||||||
this.publicationInfo.downloadFrom.get(key)['url'].push(url);
|
|
||||||
|
|
||||||
if(this.publicationInfo.downloadFrom.get(key)['accessMode'] == null) {
|
|
||||||
this.publicationInfo.downloadFrom.get(key)['accessMode'] = new Array<string>();
|
|
||||||
}
|
|
||||||
|
|
||||||
if(instance.hasOwnProperty("licence")) {
|
|
||||||
this.publicationInfo.downloadFrom.get(key)['accessMode'].push(instance['licence'].classid);
|
|
||||||
|
|
||||||
switch (this.publicationInfo.downloadFrom.get(key)['bestAccessMode']) {
|
|
||||||
case null:
|
|
||||||
this.publicationInfo.downloadFrom.get(key)['bestAccessMode'] = instance['licence'].classid;
|
|
||||||
break;
|
|
||||||
case "CLOSED":
|
|
||||||
if(instance['licence'].classid == "OPEN" ||
|
|
||||||
instance['licence'].classid == "EMBARGO" ||
|
|
||||||
instance['licence'].classid == "RESTRICTED") {
|
|
||||||
this.publicationInfo.downloadFrom.get(key)['bestAccessMode'] = instance['licence'].classid;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case "RESTRICTED":
|
|
||||||
if(instance['licence'].classid == "OPEN" ||
|
|
||||||
instance['licence'].classid == "EMBARGO") {
|
|
||||||
this.publicationInfo.downloadFrom.get(key)['bestAccessMode'] = instance['licence'].classid;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case "EMBARGO":
|
|
||||||
if(instance['licence'].classid == "OPEN") {
|
|
||||||
this.publicationInfo.downloadFrom.get(key)['bestAccessMode'] = instance['licence'].classid;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
this.publicationInfo.downloadFrom.get(key)['accessMode'].push("");
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
if(data[0] != null && data[0].hasOwnProperty("source")) {
|
counter1 = this.parsingFunctions.parsePublishedIn(this.publicationInfo.publishedIn, instance, data[0], url, counter1);
|
||||||
let key: string;
|
|
||||||
if(Array.isArray(data[0].source)) {
|
|
||||||
if(counter1==data[0].source.length) {
|
|
||||||
counter1--;
|
|
||||||
}
|
|
||||||
key = data[0]['source'][counter1];
|
|
||||||
} else {
|
|
||||||
key = data[0]['source'];
|
|
||||||
}
|
|
||||||
if(key != "") {
|
|
||||||
if(!this.publicationInfo.publishedIn.has(key)) {
|
|
||||||
this.publicationInfo.publishedIn.set(key, {"url": null, "accessMode": null, "bestAccessMode": null});
|
|
||||||
}
|
|
||||||
|
|
||||||
if(this.publicationInfo.publishedIn.get(key)['url'] == null) {
|
|
||||||
this.publicationInfo.publishedIn.get(key)['url'] = new Array<string>();
|
|
||||||
}
|
|
||||||
|
|
||||||
this.publicationInfo.publishedIn.get(key)['url'].push(url);
|
|
||||||
|
|
||||||
if(this.publicationInfo.publishedIn.get(key)['accessMode'] == null) {
|
|
||||||
this.publicationInfo.publishedIn.get(key)['accessMode'] = new Array<string>();
|
|
||||||
}
|
|
||||||
|
|
||||||
if(instance.hasOwnProperty("licence")) {
|
|
||||||
this.publicationInfo.publishedIn.get(key)['accessMode'].push(instance['licence'].classid);
|
|
||||||
switch (this.publicationInfo.publishedIn.get(key)['bestAccessMode']) {
|
|
||||||
case null:
|
|
||||||
this.publicationInfo.publishedIn.get(key)['bestAccessMode'] = instance['licence'].classid;
|
|
||||||
break;
|
|
||||||
case "CLOSED":
|
|
||||||
if(instance['licence'].classid == "OPEN" ||
|
|
||||||
instance['licence'].classid == "EMBARGO" ||
|
|
||||||
instance['licence'].classid == "RESTRICTED") {
|
|
||||||
this.publicationInfo.publishedIn.get(key)['bestAccessMode'] = instance['licence'].classid;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case "RESTRICTED":
|
|
||||||
if(instance['licence'].classid == "OPEN" ||
|
|
||||||
instance['licence'].classid == "EMBARGO") {
|
|
||||||
this.publicationInfo.publishedIn.get(key)['bestAccessMode'] = instance['licence'].classid;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case "EMBARGO":
|
|
||||||
if(instance['licence'].classid == "OPEN") {
|
|
||||||
this.publicationInfo.publishedIn.get(key)['bestAccessMode'] = instance['licence'].classid;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
this.publicationInfo.publishedIn.get(key)['accessMode'].push("");
|
|
||||||
}
|
|
||||||
counter1++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if(this.publicationInfo.title != undefined) {
|
if(this.publicationInfo.title != undefined) {
|
||||||
switch (this.publicationInfo.title['accessMode']) {
|
switch (this.publicationInfo.title['accessMode']) {
|
||||||
case undefined:
|
case undefined:
|
||||||
this.publicationInfo.title['accessMode'] = instance['licence'].classid;
|
this.publicationInfo.title['accessMode'] = instance['licence'].classid;
|
||||||
this.publicationInfo.title['url'] = url;
|
this.publicationInfo.title['url'] = url;
|
||||||
console.info("accessmode by undefined = "+this.publicationInfo.title.accessMode);
|
|
||||||
break;
|
break;
|
||||||
case "CLOSED":
|
case "CLOSED":
|
||||||
if(instance['licence'].classid == "OPEN" ||
|
if(instance['licence'].classid == "OPEN" ||
|
||||||
|
@ -424,7 +324,6 @@ export class PublicationService {
|
||||||
instance['licence'].classid == "RESTRICTED") {
|
instance['licence'].classid == "RESTRICTED") {
|
||||||
this.publicationInfo.title['accessMode'] = instance['licence'].classid;
|
this.publicationInfo.title['accessMode'] = instance['licence'].classid;
|
||||||
this.publicationInfo.title['url'] = url;
|
this.publicationInfo.title['url'] = url;
|
||||||
console.info("accessmode by closed = "+this.publicationInfo.title.accessMode);
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case "RESTRICTED":
|
case "RESTRICTED":
|
||||||
|
@ -432,21 +331,18 @@ export class PublicationService {
|
||||||
instance['licence'].classid == "EMBARGO") {
|
instance['licence'].classid == "EMBARGO") {
|
||||||
this.publicationInfo.title['accessMode'] = instance['licence'].classid;
|
this.publicationInfo.title['accessMode'] = instance['licence'].classid;
|
||||||
this.publicationInfo.title['url'] = url;
|
this.publicationInfo.title['url'] = url;
|
||||||
console.info("accessmode by restricted = "+this.publicationInfo.title.accessMode);
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case "EMBARGO":
|
case "EMBARGO":
|
||||||
if(instance['licence'].classid == "OPEN") {
|
if(instance['licence'].classid == "OPEN") {
|
||||||
this.publicationInfo.title['accessMode'] = instance['licence'].classid;
|
this.publicationInfo.title['accessMode'] = instance['licence'].classid;
|
||||||
this.publicationInfo.title['url'] = url;
|
this.publicationInfo.title['url'] = url;
|
||||||
console.info("accessmode by embargo= "+this.publicationInfo.title.accessMode);
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case "OPEN":
|
case "OPEN":
|
||||||
if(instance['licence'].classid == "OPEN" &&
|
if(instance['licence'].classid == "OPEN" &&
|
||||||
this.publicationInfo.title['url'] == "") {
|
this.publicationInfo.title['url'] == "") {
|
||||||
this.publicationInfo.title['url'] = url;
|
this.publicationInfo.title['url'] = url;
|
||||||
console.info("title url by empty = "+this.publicationInfo.title.url);
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue