'View more' links in landing pages are not muted | 'Download from', 'Collected from' and 'Published in' sections of appbox merged into 'Available on' section. {{hostedby}} via {{collectedfrom}} and when {{hostedby}} is 'Unknown Repository' its name is from 'source' field

git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-services-portal/trunk@50013 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
konstantina.galouni 2017-11-28 15:55:36 +00:00
parent 286d8db639
commit 890a971e39
15 changed files with 242 additions and 323 deletions

View File

@ -194,54 +194,8 @@
</altmetrics >
<ul class="uk-list ">
<li *ngIf="datasetInfo.downloadFrom && datasetInfo.downloadFrom.size > 0">
<dl class="uk-description-list-line">
<dt class="title">Download from</dt>
<dd class="line"
*ngFor="let key of getKeys(datasetInfo.downloadFrom) let i=index" >
<div *ngIf="i<5 || showAllDownloadFrom"
class="{{datasetInfo.downloadFrom.get(key)['bestAccessMode']}}">
<span [class]="datasetInfo.downloadFrom.get(key)['url'].length > 0 ? 'custom-external custom-icon' : ''">
<span *ngIf="datasetInfo.downloadFrom.get(key)['url'].length > 1">
{{key}}
<span *ngFor="let url of datasetInfo.downloadFrom.get(key)['url']; let i=index;">
<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}}]
</a>
</span>
</span>
<a *ngIf="datasetInfo.downloadFrom.get(key)['url'].length == 1"
href="{{datasetInfo.downloadFrom.get(key)['url']}}"
target="_blank"
[attr.uk-tooltip]="datasetInfo.downloadFrom.get(key)['bestAccessMode'] ? 'pos:right; delay:10' : 'cls: uk-invisible'"
[title]="datasetInfo.downloadFrom.get(key)['bestAccessMode']">
{{key}}
</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>
</div>
</dd>
<dd *ngIf="showAllDownloadFrom" class="uk-text-right">
<a class="uk-text-muted" (click)="showAllDownloadFrom = !showAllDownloadFrom;">
View less
</a>
</dd>
<dd *ngIf="!showAllDownloadFrom && datasetInfo.downloadFrom.size > 5">...</dd>
<dd *ngIf="!showAllDownloadFrom && datasetInfo.downloadFrom.size > 5" class="uk-text-right">
<a class="uk-text-muted" (click)="showAllDownloadFrom = !showAllDownloadFrom;">
View more
</a>
</dd>
</dl>
</li>
<li *ngIf="datasetInfo.publishedIn && datasetInfo.publishedIn.size > 0">
<publishedIn [publishedIn]="datasetInfo.publishedIn"></publishedIn>
<li *ngIf="datasetInfo.hostedBy_collectedFrom && datasetInfo.hostedBy_collectedFrom.length > 0">
<availableOn [availableOn]="datasetInfo.hostedBy_collectedFrom"></availableOn>
</li>
<li *ngIf="datasetInfo.fundedByProjects != undefined && datasetInfo.fundedByProjects.length > 0">
<fundedBy [fundedByProjects]="datasetInfo.fundedByProjects"></fundedBy>
@ -303,31 +257,6 @@
</li>
<li *ngIf="datasetInfo.collectedFrom && datasetInfo.collectedFrom.length > 0">
<dl class="uk-description-list-line">
<dt>Collected from</dt>
<dd *ngFor="let item of datasetInfo.collectedFrom let i=index">
<!--a href="{{item['url']}}"-->
<a *ngIf="i<5 || showAllCollectedFrom"
[queryParams]="{datasourceId: item.id}" routerLinkActive="router-link-active" routerLink="/search/dataprovider">
{{item['name']}}
</a>
</dd>
<dd *ngIf="showAllCollectedFrom" class="uk-text-right">
<a class="uk-text-muted" (click)="showAllCollectedFrom = !showAllCollectedFrom;">
View less
</a>
</dd>
<dd *ngIf="!showAllCollectedFrom && datasetInfo.collectedFrom.length > 5">...</dd>
<dd *ngIf="!showAllCollectedFrom && datasetInfo.collectedFrom.length > 5" class="uk-text-right">
<a class="uk-text-muted" (click)="showAllCollectedFrom = !showAllCollectedFrom;">
View more
</a>
</dd>
</dl>
</li>
</ul>
<!--div class="uk-card uk-card-default uk-padding-small uk-card-body">

View File

@ -107,8 +107,10 @@ export class DatasetService {
if(data[3] != null) {
if(data[3].hasOwnProperty("instance")) {
this.datasetInfo.downloadFrom = new Map<string, {"url": string[], "accessMode": string[], "bestAccessMode": string}>();
this.datasetInfo.publishedIn = new Map<string, {"url": string[], "accessMode": string[], "bestAccessMode": string}>()
this.datasetInfo.hostedBy_collectedFrom = new Array<{ "downloadName": string, "downloadUrl": string[],
"collectedName": string, "collectedId": string,
"accessMode": string[], "bestAccessMode": string,
"type": string, "year":string}>();
this.datasetInfo.types = new Array<string>();
let types = new Set<string>();
@ -131,26 +133,8 @@ export class DatasetService {
url = instance['webresource'][0].url;
}
if(instance.hasOwnProperty("collectedfrom")) {
this.datasetInfo.collectedFrom = this.parsingFunctions.parseCollectedFrom(instance['collectedfrom']);
}
if(instance.hasOwnProperty("hostedby")) {
if(instance['hostedby'].name != "other resources" && instance['hostedby'].name != "Unknown Repository") {
this.parsingFunctions.parseDownloadFrom(this.datasetInfo.downloadFrom, instance, url);
} else {
counter = this.parsingFunctions.parsePublishedIn(this.datasetInfo.publishedIn, instance, data[0], url, counter);
}
if(this.datasetInfo.title != undefined) {
if(!this.datasetInfo.title['url']) {
this.datasetInfo.title['url'] = url;
}
if(this.parsingFunctions.changeBestAccessMode(this.datasetInfo.title['accessMode'], instance['licence'])) {
this.datasetInfo.title['accessMode'] = instance['licence'].classid;
this.datasetInfo.title['url'] = url;
}
}
counter = this.parsingFunctions.parseHostedBy_collectedFrom(this.datasetInfo.hostedBy_collectedFrom, instance, data[0], url, counter, this.datasetInfo.title);
}
}
}
@ -168,17 +152,8 @@ export class DatasetService {
this.datasetInfo.classifiedSubjects = subjectResults[2];
}
// if(data[6] != null) {
// this.datasetInfo.bestaccessright = data[6].classid;
// }
// if(data[7] != null) {
// this.datasetInfo.collectedFrom = this.parsingFunctions.parseCollectedFrom(data[7]);
// }
// null argument is for journal
this.datasetInfo.downloadFrom = this.parsingFunctions.addPublisherToDownloadFrom(
this.datasetInfo.downloadFrom, this.datasetInfo.publisher,
this.datasetInfo.hostedBy_collectedFrom = this.parsingFunctions.addPublisherToHostedBy_collectedFrom(
this.datasetInfo.hostedBy_collectedFrom, this.datasetInfo.publisher,
null, this.datasetInfo.identifiers, this.datasetInfo.title);
if(data[8] != null) {

View File

@ -0,0 +1,73 @@
import {Component, Input, ElementRef} from '@angular/core';
import {OpenaireProperties} from '../../utils/properties/openaireProperties';
@Component({
selector: 'availableOn',
template: `
<dl class="uk-description-list-line">
<dt class="title">Available On</dt>
<dd class="line" *ngFor="let available of availableOn let i=index" >
<div *ngIf="i<5 || showAll">
<div class="{{available['bestAccessMode']}}">
<span *ngIf="available.downloadUrl.length > 1"
class="custom-external custom-icon">
{{available.downloadName}}
<span *ngFor="let url of available.downloadUrl; let i=index;">
<a href="{{url}}" target="_blank"
[attr.uk-tooltip]="available.accessMode[i] ? 'pos:right; delay:10' : 'cls: uk-invisible'"
[title]="available.accessMode[i]">
[{{i+1}}]
</a>
</span>
</span>
<a class="custom-external custom-icon"
*ngIf="available['downloadUrl'].length == 1"
href="{{available['downloadUrl']}}"
target="_blank"
[attr.uk-tooltip]="available['bestAccessMode'] ? 'pos:right; delay:10' : 'cls: uk-invisible'"
[title]="available['bestAccessMode']">
{{available.downloadName}}
</a>
<span *ngIf="available.collectedName" class="uk-text-bold">via</span>
<a *ngIf="available.collectedName"
[queryParams]="{datasourceId: available.collectedId}" routerLinkActive="router-link-active" routerLink="/search/dataprovider">
{{available.collectedName}}
</a>
<span *ngIf="available.type || available.year">(<span *ngIf="available.type">{{available.type}}, </span><span *ngIf="available.year">{{available.year}}</span>)</span>
</div>
</div>
</dd>
<dd *ngIf="showAll" class="uk-text-right">
<a (click)="showAll = !showAll; scroll()">
View less
</a>
</dd>
<dd *ngIf="!showAll && availableOn.length > 5">...</dd>
<dd *ngIf="!showAll && availableOn.length > 5" class="uk-text-right">
<a (click)="showAll = !showAll;">
View more
</a>
</dd>
</dl>
`
})
export class AvailableOnComponent {
@Input() availableOn: { "downloadName": string, "downloadUrl": string[],
"collectedName": string, "collectedId": string,
"accessMode": string[], "bestAccessMode": string,
"type": string, "year":string }[];
public showAll: boolean = false;
constructor (private element: ElementRef) {}
ngOnInit() {}
public scroll() {
console.info("scroll into view");
if (typeof document !== 'undefined') {
this.element.nativeElement.scrollIntoView();
}
}
}

View File

@ -49,13 +49,13 @@ import {OpenaireProperties} from '../../utils/properties/openaireProperties';
</div>
</dd>
<dd *ngIf="showAll" class="uk-text-right">
<a class="uk-text-muted" (click)="showAll = !showAll; scroll()">
<a (click)="showAll = !showAll; scroll()">
View less
</a>
</dd>
<dd *ngIf="!showAll && fundedByProjects && fundedByProjects.length > 5">...</dd>
<dd *ngIf="!showAll && fundedByProjects && fundedByProjects.length > 5" class="uk-text-right">
<a class="uk-text-muted" (click)="showAll = !showAll;">
<a (click)="showAll = !showAll;">
View more
</a>
</dd>

View File

@ -132,51 +132,44 @@ export class ParsingFunctions {
}
// publication & dataset landing : for collectedFrom
parseCollectedFrom(_collectedFrom: any): {"name": string, "id": string}[] {
let collectedFrom = new Array<{"name": string, "id": string}>();
let collected;
let length = Array.isArray(_collectedFrom) ? _collectedFrom.length : 1;
for(let i=0; i<length; i++) {
collected = Array.isArray(_collectedFrom) ? _collectedFrom[i] : _collectedFrom;
collectedFrom[i] = {"name": "", "id": ""};
collectedFrom[i]['name'] = collected.name;
collectedFrom[i]['id'] = collected.id;
}
return collectedFrom;
parseCollectedFrom( collectedFrom: {"name": string, "id": string}[],
_collectedFrom: any) {
let length: number = collectedFrom.length;
collectedFrom[length] = {"name": "", "id": ""};
collectedFrom[length]['name'] = _collectedFrom.name;
collectedFrom[length]['id'] = _collectedFrom.id;
}
// publication & dataset landing : for downloadFrom
addPublisherToDownloadFrom( downloadFrom: Map<string, {"url": string[], "accessMode": string[], "bestAccessMode": string}>,
addPublisherToHostedBy_collectedFrom( hostedBy_collectedFrom: {"downloadName": string, "downloadUrl": string[], "collectedName": string, "collectedId": string, "accessMode": string[], "bestAccessMode": string, "type": string, "year":string}[],
publisher: string, journal:{"journal": string, "issn": string, "lissn": string},
identifiers: Map<string, string[]>, title: { "name": string, "url": string, "accessMode": string}) {
if( publisher && identifiers != null && identifiers.has('doi')) {
if( downloadFrom == null) {
downloadFrom = new Map<string, {"url": string[], "accessMode": string[], "bestAccessMode": string}>();
if( hostedBy_collectedFrom == null) {
hostedBy_collectedFrom = new Array<{"downloadName": string, "downloadUrl": string[], "collectedName": string, "collectedId": string, "accessMode": string[], "bestAccessMode": string, "type": string, "year":string}>();
}
let available: {"downloadName": string, "downloadUrl": string[], "collectedName": string, "collectedId": string, "accessMode": string[], "bestAccessMode": string, "type": string, "year":string};
available = {"downloadName": "", "downloadUrl": null, "collectedName": "", "collectedId": "", "accessMode": null, "bestAccessMode": null, "type": "", "year": ""};
let key: string;
if(journal && journal.journal) {
key = publisher + "/ "+journal['journal'];
available.downloadName = publisher + "/ "+journal['journal'];
} else {
key = publisher;
available.downloadName = publisher;
}
downloadFrom.set(key, {"url": null, "accessMode": null, "bestAccessMode": null});
let url = OpenaireProperties.getDoiURL()+identifiers.get("doi")[0];
downloadFrom.get(key)['url'] = new Array<string>();
downloadFrom.get(key)['accessMode'] = new Array<string>();
available.downloadUrl = new Array<string>();
available.accessMode = new Array<string>();
downloadFrom.get(key)['url'][0] = url;
downloadFrom.get(key)['accessMode'][0] = "";
available.downloadUrl.push(url);
if(title != undefined && title['url'] == "") {
title['url'] = url;
}
hostedBy_collectedFrom.push(available);
}
return downloadFrom;
return hostedBy_collectedFrom;
}
// publication & dataset landing : for downloadFrom
@ -228,19 +221,101 @@ export class ParsingFunctions {
mapStructure.get(key)['accessMode'] = new Array<string>();
}
if(instance.hasOwnProperty("licence")) {
if(instance.hasOwnProperty("accessright")) {
if(url) {
mapStructure.get(key)['accessMode'].push(instance['licence'].classid);
mapStructure.get(key)['accessMode'].push(instance['accessright'].classid);
}
if(this.changeBestAccessMode(mapStructure.get(key)['bestAccessMode'], instance['licence'])) {
mapStructure.get(key)['bestAccessMode'] = instance['licence'].classid;
if(this.changeBestAccessMode(mapStructure.get(key)['bestAccessMode'], instance['accessright'])) {
mapStructure.get(key)['bestAccessMode'] = instance['accessright'].classid;
}
} else if(url) {
mapStructure.get(key)['accessMode'].push("");
}
}
parseHostedBy_collectedFrom(hostedBy_collectedFrom: { "downloadName": string, "downloadUrl": string[],
"collectedName": string, "collectedId": string,
"accessMode": string[], "bestAccessMode": string,
"type": string, "year":string }[],
instance: any, data: any, url: string, counter: number,
title: { "name": string, "url": string, "accessMode": string}): number {
let available: {"downloadName": string, "downloadUrl": string[], "collectedName": string, "collectedId": string, "accessMode": string[], "bestAccessMode": string, "type": string, "year":string};
available = {"downloadName": "", "downloadUrl": null, "collectedName": "", "collectedId": "", "accessMode": null, "bestAccessMode": null, "type": "", "year": ""};
if(instance['hostedby'].name && instance['hostedby'].name != "other resources" && instance['hostedby'].name != "Unknown Repository") {
available.downloadName = instance['hostedby'].name;
} else {
if(data != null && data.hasOwnProperty("source")) {
let downloadName: string;
if(Array.isArray(data.source)) {
if(counter==data.source.length) {
counter--;
}
downloadName = data['source'][counter];
} else {
downloadName = data['source'];
}
if(downloadName) {
counter++;
available.downloadName = downloadName;
}
}
}
if(available.downloadName) {
if(instance.hasOwnProperty("collectedfrom")) {
available.collectedId = instance['collectedfrom'].id;
available.collectedName = instance['collectedfrom'].name;
}
if(instance.hasOwnProperty("instancetype") && instance['instancetype'].classname) {
available.type = instance['instancetype'].classname;
}
if(instance.hasOwnProperty("dateofacceptance")) {
var date:string = (instance.dateofacceptance)+""; // transform to string in case it is an integer
available.year = (date && (date).indexOf('-') !== -1)?date.split('-')[0]:date;
}
available.accessMode = new Array<string>();
available.downloadUrl = new Array<string>();
available['downloadUrl'].push(url);
if(instance.hasOwnProperty("accessright")) {
if(url) {
available['accessMode'].push(instance['accessright'].classid);
}
if(this.changeBestAccessMode(available.bestAccessMode, instance['accessright'])) {
available.bestAccessMode = instance['accessright'].classid;
if(title != undefined) {
if(this.changeBestAccessMode(title['accessMode'], instance['accessright'])) {
title['accessMode'] = instance['accessright'].classid;
title['url'] = url;
}
}
}
if(title != undefined) {
if(!title['url']) {
title['url'] = url;
}
}
} else if(url) {
available['accessMode'].push("");
}
hostedBy_collectedFrom.push(available);
}
return counter;
}
// publication & dataset landing : for downloadFrom and publishedIn
changeBestAccessMode(currentAccessMode: string, accessMode: any): boolean {
if(!accessMode) {

View File

@ -10,6 +10,7 @@ import {ShowIdentifiersComponent} from './showIdentifiers.component';
import {ShowSubjectsComponent} from './showSubjects.component';
import {FundedByComponent} from './fundedBy.component';
import {PublishedInComponent} from './publishedIn.component';
import {AvailableOnComponent} from './availableOn.component';
import {TabTableComponent} from './tabTable.component';
@NgModule({
@ -17,12 +18,14 @@ import {TabTableComponent} from './tabTable.component';
CommonModule, FormsModule, RouterModule, PagingModule
],
declarations: [
ShowAuthorsComponent,ShowIdentifiersComponent,ShowSubjectsComponent,FundedByComponent,PublishedInComponent,TabTableComponent
ShowAuthorsComponent,ShowIdentifiersComponent,ShowSubjectsComponent,
FundedByComponent,PublishedInComponent,AvailableOnComponent,TabTableComponent
],
providers:[
],
],
exports: [
ShowAuthorsComponent,ShowIdentifiersComponent,ShowSubjectsComponent,FundedByComponent,PublishedInComponent,TabTableComponent
]
ShowAuthorsComponent,ShowIdentifiersComponent,ShowSubjectsComponent,
FundedByComponent,PublishedInComponent,AvailableOnComponent,TabTableComponent
]
})
export class ResultLandingModule { }

View File

@ -6,7 +6,7 @@ import {RouterHelper} from '../../utils/routerHelper.class';
template: `
<span *ngIf="authors != undefined">
<div *ngIf="showAll">
<a class="uk-text-muted" (click)="showAll = !showAll;">View less authors</a>
<a (click)="showAll = !showAll;">View less authors</a>
</div>
<span *ngFor="let author of authors.slice(0,30) let i=index">
<!--a [queryParams]="routerHelper.createQueryParams(['author','au'],[quote(author['name']),'and'])" routerLinkActive="router-link-active" [routerLink]="'/search/advanced/'+searchPage">
@ -26,12 +26,12 @@ import {RouterHelper} from '../../utils/routerHelper.class';
</span>
</span>
<span *ngIf="!showAll && authors.length > 30">
<a class="uk-text-muted" (click)="showAll = !showAll;">
<a (click)="showAll = !showAll;">
view all {{authors.length}} authors
</a>
</span>
<span *ngIf="showAll">
<a class="uk-text-muted" (click)="showAll = !showAll; scroll()">View less authors</a>
<a (click)="showAll = !showAll; scroll()">View less authors</a>
</span>
</span>

View File

@ -6,7 +6,7 @@ import {OpenaireProperties} from '../../utils/properties/openaireProperties';
template: `
<span *ngIf="showAll && countIdentifiers() > pageSize">
<a class="uk-text-muted" (click)="showAll = !showAll;">View less identifiers</a>
<a (click)="showAll = !showAll;">View less identifiers</a>
</span>
<ng-container *ngFor="let key of getKeys(identifiers) let i=index">
@ -24,12 +24,12 @@ import {OpenaireProperties} from '../../utils/properties/openaireProperties';
</ng-container>
<span *ngIf="!showAll && countIdentifiers() > pageSize">
<a class="uk-text-muted" (click)="showAll = !showAll;">
<a (click)="showAll = !showAll;">
view all {{countIdentifiers()}} identifiers
</a>
</span>
<span *ngIf="showAll && countIdentifiers() > pageSize">
<a class="uk-text-muted" (click)="showAll = !showAll; scroll()">View less identifiers</a>
<a (click)="showAll = !showAll; scroll()">View less identifiers</a>
</span>

View File

@ -443,15 +443,13 @@
id="{{publicationInfo.identifiers.get('doi')[0]}}" type="doi">
</altmetrics>
<ul class="uk-list">
<li *ngIf="publicationInfo.downloadFrom && publicationInfo.downloadFrom.size > 0">
<!-- <li *ngIf="publicationInfo.downloadFrom && publicationInfo.downloadFrom.size > 0">
<dl class="uk-description-list-line">
<dt class="title">Download from</dt>
<dd class="line"
*ngFor="let key of getKeys(publicationInfo.downloadFrom) let i=index" >
<div *ngIf="i<5 || showAllDownloadFrom"
class="{{publicationInfo.downloadFrom.get(key)['bestAccessMode']}}">
<!--span class="custom-external custom-icon" uk-tooltip="pos:right; delay:10"
[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">
{{key}}
@ -490,9 +488,13 @@
</a>
</dd>
</dl>
</li>
<li *ngIf="publicationInfo.publishedIn && publicationInfo.publishedIn.size > 0">
</li> -->
<!-- <li *ngIf="publicationInfo.publishedIn && publicationInfo.publishedIn.size > 0">
<publishedIn [publishedIn]="publicationInfo.publishedIn"></publishedIn>
</li> -->
<li *ngIf="publicationInfo.hostedBy_collectedFrom && publicationInfo.hostedBy_collectedFrom.length > 0">
<availableOn [availableOn]="publicationInfo.hostedBy_collectedFrom"></availableOn>
</li>
<li *ngIf="publicationInfo.fundedByProjects != undefined && publicationInfo.fundedByProjects.length > 0">
<fundedBy [fundedByProjects]="publicationInfo.fundedByProjects"></fundedBy>
@ -573,30 +575,6 @@
</ul>
</li>
<li *ngIf="publicationInfo.collectedFrom && publicationInfo.collectedFrom.length > 0">
<dl class="uk-description-list-line">
<dt>Collected from</dt>
<dd *ngFor="let item of publicationInfo.collectedFrom let i=index">
<!--a *ngIf="i<5 || showAllCollectedFrom" href="{{item['url']}}"-->
<a *ngIf="i<5 || showAllCollectedFrom"
[queryParams]="{datasourceId: item.id}" routerLinkActive="router-link-active" routerLink="/search/dataprovider">
{{item['name']}}
</a>
</dd>
<dd *ngIf="showAllCollectedFrom" class="uk-text-right">
<a class="uk-text-muted" (click)="showAllCollectedFrom = !showAllCollectedFrom;">
View less
</a>
</dd>
<dd *ngIf="!showAllCollectedFrom && publicationInfo.collectedFrom.length > 5">...</dd>
<dd *ngIf="!showAllCollectedFrom && publicationInfo.collectedFrom.length > 5" class="uk-text-right">
<a class="uk-text-muted" (click)="showAllCollectedFrom = !showAllCollectedFrom;">
View more
</a>
</dd>
</dl>
</li>
</ul>
</div>
</div>

View File

@ -90,14 +90,7 @@ export class PublicationService {
for(let i=0; i<length; i++) {
relation = Array.isArray(data[2]) ? data[2][i] : data[2];
if(relation.hasOwnProperty("to")) {
// if(relation['to'].class == "hasAuthor") {
// if(this.publicationInfo.authors == undefined) {
// this.publicationInfo.authors = new Array<{"name": string, "id": string}>();
// }
//
// this.publicationInfo.authors[relation.ranking-1] = {"name": "", "id": ""};
// this.publicationInfo.authors[relation.ranking-1]['name'] = relation.fullname;
/*} else*/ if(relation['to'].class == "isProducedBy") {
if(relation['to'].class == "isProducedBy") {
this.publicationInfo.fundedByProjects = this.parsingFunctions.parseFundingByProjects(this.publicationInfo.fundedByProjects, relation, this.publicationInfo.projectsProvenanceVocabulary);
} else if(relation['to'].class == "isRelatedTo") {
let provenanceAction: string;
@ -119,8 +112,13 @@ export class PublicationService {
if(data[3] != null) {
if(data[3].hasOwnProperty("instance")) {
this.publicationInfo.downloadFrom = new Map<string, {"url": string[], "accessMode": string[], "bestAccessMode": string}>();
this.publicationInfo.publishedIn = new Map<string, {"url": string[], "accessMode": string[], "bestAccessMode": string}>();
//this.publicationInfo.collectedFrom = new Array<{"name": string, "id": string}>();
//this.publicationInfo.downloadFrom = new Map<string, {"url": string[], "accessMode": string[], "bestAccessMode": string}>();
//this.publicationInfo.publishedIn = new Map<string, {"url": string[], "accessMode": string[], "bestAccessMode": string}>();
this.publicationInfo.hostedBy_collectedFrom = new Array<{"downloadName": string, "downloadUrl": string[], "collectedName": string, "collectedId": string, "accessMode": string[], "bestAccessMode": string, "type": string, "year":string}>();
this.publicationInfo.types = new Array<string>();
let types = new Set<string>();
@ -143,28 +141,11 @@ export class PublicationService {
url = instance['webresource'][0].url;
}
if(instance.hasOwnProperty("collectedfrom")) {
this.publicationInfo.collectedFrom = this.parsingFunctions.parseCollectedFrom(instance['collectedfrom']);
}
/**********************************************************/
if(instance.hasOwnProperty("hostedby")) {
if(instance['hostedby'].name != "other resources" && instance['hostedby'].name != "Unknown Repository") {
this.parsingFunctions.parseDownloadFrom(this.publicationInfo.downloadFrom, instance, url);
} else {
counter = this.parsingFunctions.parsePublishedIn(this.publicationInfo.publishedIn, instance, data[0], url, counter);
}
if(this.publicationInfo.title != undefined) {
if(!this.publicationInfo.title['url']) {
this.publicationInfo.title['url'] = url;
}
if(this.parsingFunctions.changeBestAccessMode(this.publicationInfo.title['accessMode'], instance['licence'])) {
this.publicationInfo.title['accessMode'] = instance['licence'].classid;
this.publicationInfo.title['url'] = url;
}
}
counter = this.parsingFunctions.parseHostedBy_collectedFrom(this.publicationInfo.hostedBy_collectedFrom, instance, data[0], url, counter, this.publicationInfo.title);
}
/**********************************************************/
}
}
}
@ -219,8 +200,8 @@ export class PublicationService {
// this.publicationInfo.collectedFrom = this.parsingFunctions.parseCollectedFrom(data[9]);
// }
this.publicationInfo.downloadFrom = this.parsingFunctions.addPublisherToDownloadFrom(
this.publicationInfo.downloadFrom, this.publicationInfo.publisher,
this.publicationInfo.hostedBy_collectedFrom = this.parsingFunctions.addPublisherToHostedBy_collectedFrom(
this.publicationInfo.hostedBy_collectedFrom, this.publicationInfo.publisher,
this.publicationInfo.journal, this.publicationInfo.identifiers,
this.publicationInfo.title);

View File

@ -196,54 +196,8 @@
</altmetrics >
<ul class="uk-list ">
<li *ngIf="softwareInfo.downloadFrom && softwareInfo.downloadFrom.size > 0">
<dl class="uk-description-list-line">
<dt class="title">Download from</dt>
<dd class="line"
*ngFor="let key of getKeys(softwareInfo.downloadFrom) let i=index" >
<div *ngIf="i<5 || showAllDownloadFrom"
class="{{softwareInfo.downloadFrom.get(key)['bestAccessMode']}}">
<span [class]="softwareInfo.downloadFrom.get(key)['url'].length > 0 ? 'custom-external custom-icon' : ''">
<span *ngIf="softwareInfo.downloadFrom.get(key)['url'].length > 1">
{{key}}
<span *ngFor="let url of softwareInfo.downloadFrom.get(key)['url']; let i=index;">
<a href="{{url}}" target="_blank"
[attr.uk-tooltip]="softwareInfo.downloadFrom.get(key)['accessMode'][i] ? 'pos:right; delay:10' : 'cls: uk-invisible'"
[title]="softwareInfo.downloadFrom.get(key)['accessMode'][i]">
[{{i+1}}]
</a>
</span>
</span>
<a *ngIf="softwareInfo.downloadFrom.get(key)['url'].length == 1"
href="{{softwareInfo.downloadFrom.get(key)['url']}}"
target="_blank"
[attr.uk-tooltip]="softwareInfo.downloadFrom.get(key)['bestAccessMode'] ? 'pos:right; delay:10' : 'cls: uk-invisible'"
[title]="softwareInfo.downloadFrom.get(key)['bestAccessMode']">
{{key}}
</a>
<span *ngIf="softwareInfo.downloadFrom.get(key)['url'].length == 0"
[attr.uk-tooltip]="softwareInfo.downloadFrom.get(key)['bestAccessMode'] ? 'pos:right; delay:10' : 'cls: uk-invisible'"
[title]="softwareInfo.downloadFrom.get(key)['bestAccessMode']">
{{key}}
</span>
</span>
</div>
</dd>
<dd *ngIf="showAllDownloadFrom" class="uk-text-right">
<a class="uk-text-muted" (click)="showAllDownloadFrom = !showAllDownloadFrom;">
View less
</a>
</dd>
<dd *ngIf="!showAllDownloadFrom && softwareInfo.downloadFrom.size > 5">...</dd>
<dd *ngIf="!showAllDownloadFrom && softwareInfo.downloadFrom.size > 5" class="uk-text-right">
<a class="uk-text-muted" (click)="showAllDownloadFrom = !showAllDownloadFrom;">
View more
</a>
</dd>
</dl>
</li>
<li *ngIf="softwareInfo.publishedIn && softwareInfo.publishedIn.size > 0">
<publishedIn [publishedIn]="softwareInfo.publishedIn"></publishedIn>
<li *ngIf="softwareInfo.hostedBy_collectedFrom && softwareInfo.hostedBy_collectedFrom.length > 0">
<availableOn [availableOn]="softwareInfo.hostedBy_collectedFrom"></availableOn>
</li>
<li *ngIf="softwareInfo.fundedByProjects != undefined && softwareInfo.fundedByProjects.length > 0">
<fundedBy [fundedByProjects]="softwareInfo.fundedByProjects"></fundedBy>
@ -304,31 +258,6 @@
</ul>
</li>
<li *ngIf="softwareInfo.collectedFrom && softwareInfo.collectedFrom.length > 0">
<dl class="uk-description-list-line">
<dt>Collected from</dt>
<dd *ngFor="let item of softwareInfo.collectedFrom let i=index">
<!--a href="{{item['url']}}"-->
<a *ngIf="i<5 || showAllCollectedFrom"
[queryParams]="{datasourceId: item.id}" routerLinkActive="router-link-active" routerLink="/search/dataprovider">
{{item['name']}}
</a>
</dd>
<dd *ngIf="showAllCollectedFrom" class="uk-text-right">
<a class="uk-text-muted" (click)="showAllCollectedFrom = !showAllCollectedFrom;">
View less
</a>
</dd>
<dd *ngIf="!showAllCollectedFrom && softwareInfo.collectedFrom.length > 5">...</dd>
<dd *ngIf="!showAllCollectedFrom && softwareInfo.collectedFrom.length > 5" class="uk-text-right">
<a class="uk-text-muted" (click)="showAllCollectedFrom = !showAllCollectedFrom;">
View more
</a>
</dd>
</dl>
</li>
</ul>
</div>

View File

@ -107,8 +107,10 @@ export class SoftwareService {
if(data[3] != null) {
if(data[3].hasOwnProperty("instance")) {
this.softwareInfo.downloadFrom = new Map<string, {"url": string[], "accessMode": string[], "bestAccessMode": string}>();
this.softwareInfo.publishedIn = new Map<string, {"url": string[], "accessMode": string[], "bestAccessMode": string}>()
this.softwareInfo.hostedBy_collectedFrom = new Array<{ "downloadName": string, "downloadUrl": string[],
"collectedName": string, "collectedId": string,
"accessMode": string[], "bestAccessMode": string,
"type": string, "year":string}>();
this.softwareInfo.types = new Array<string>();
let types = new Set<string>();
@ -131,26 +133,8 @@ export class SoftwareService {
url = instance['webresource'][0].url;
}
if(instance.hasOwnProperty("collectedfrom")) {
this.softwareInfo.collectedFrom = this.parsingFunctions.parseCollectedFrom(instance['collectedfrom']);
}
if(instance.hasOwnProperty("hostedby")) {
if(instance['hostedby'].name != "other resources" && instance['hostedby'].name != "Unknown Repository") {
this.parsingFunctions.parseDownloadFrom(this.softwareInfo.downloadFrom, instance, url);
} else {
counter = this.parsingFunctions.parsePublishedIn(this.softwareInfo.publishedIn, instance, data[0], url, counter);
}
if(this.softwareInfo.title != undefined) {
if(!this.softwareInfo.title['url']) {
this.softwareInfo.title['url'] = url;
}
if(this.parsingFunctions.changeBestAccessMode(this.softwareInfo.title['accessMode'], instance['licence'])) {
this.softwareInfo.title['accessMode'] = instance['licence'].classid;
this.softwareInfo.title['url'] = url;
}
}
counter = this.parsingFunctions.parseHostedBy_collectedFrom(this.softwareInfo.hostedBy_collectedFrom, instance, data[0], url, counter, this.softwareInfo.title);
}
}
}
@ -168,17 +152,9 @@ export class SoftwareService {
this.softwareInfo.classifiedSubjects = subjectResults[2];
}
// if(data[6] != null) {
// this.softwareInfo.bestaccessright = data[6].classid;
// }
// if(data[7] != null) {
// this.softwareInfo.collectedFrom = this.parsingFunctions.parseCollectedFrom(data[7]);
// }
// null argument is for journal
this.softwareInfo.downloadFrom = this.parsingFunctions.addPublisherToDownloadFrom(
this.softwareInfo.downloadFrom, this.softwareInfo.publisher,
this.softwareInfo.hostedBy_collectedFrom = this.parsingFunctions.addPublisherToHostedBy_collectedFrom(
this.softwareInfo.hostedBy_collectedFrom, this.softwareInfo.publisher,
null, this.softwareInfo.identifiers, this.softwareInfo.title);
if(data[8] != null) {

View File

@ -6,16 +6,16 @@ export class DatasetInfo {
dateofacceptance: string;
embargoEndDate: string;
types: string[];
downloadFrom: Map<string, {"url": string[], "accessMode": string[], "bestAccessMode": string}>; //key is name
publishedIn: Map<string, {"url": string[], "accessMode": string[], "bestAccessMode": string}>; //key is name
hostedBy_collectedFrom: { "downloadName": string, "downloadUrl": string[],
"collectedName": string, "collectedId": string,
"accessMode": string[], "bestAccessMode": string,
"type": string, "year":string}[];
identifiers: Map<string, string[]>;
publisher: string;
subjects: string[];
otherSubjects: Map<string, string[]>;
classifiedSubjects: Map<string, string[]>;
description: string;
//bestaccessright: string;
collectedFrom: { "name": string, "id": string}[];
projectsProvenanceVocabulary: { "sysimport:crosswalk:repository": string,
"sysimport:crosswalk:entityregistry": string,
"sysimport:crosswalk:datasetarchive": string,

View File

@ -6,10 +6,10 @@ export class PublicationInfo {
dateofacceptance: string;
embargoEndDate: string;
types: string[];
downloadFrom: Map<string, {"url": string[], "accessMode": string[], "bestAccessMode": string}>; //key is name
publishedIn: Map<string, {"url": string[], "accessMode": string[], "bestAccessMode": string}>; //key is name
//downloadFrom: Map<string, {"url": string[], "accessMode": string[], "bestAccessMode": string}>; //key is name
//publishedIn: Map<string, {"url": string[], "accessMode": string[], "bestAccessMode": string}>; //key is name
downloadAndCollectedFrom: {"downloadName":string, "url": string[], "downloadAccessMode": string[], "bestAccessMode": string, "collectedName": string, "id": string}[];
hostedBy_collectedFrom: {"downloadName": string, "downloadUrl": string[], "collectedName": string, "collectedId": string, "accessMode": string[], "bestAccessMode": string, "type": string, "year":string}[];
identifiers: Map<string, string[]>; //key is the classname
publisher: string;
@ -20,7 +20,7 @@ export class PublicationInfo {
classifiedSubjects: Map<string, string[]>; //<class of subject, subjects>
description: string;
//bestaccessright: string;
collectedFrom: { "name": string, "id": string}[];
//collectedFrom: { "name": string, "id": string}[];
projectsProvenanceVocabulary: { "sysimport:crosswalk:repository": string,
"sysimport:crosswalk:entityregistry": string,
"sysimport:crosswalk:datasetarchive": string,

View File

@ -6,16 +6,16 @@ export class SoftwareInfo {
dateofacceptance: string;
embargoEndDate: string;
types: string[];
downloadFrom: Map<string, {"url": string[], "accessMode": string[], "bestAccessMode": string}>; //key is name
publishedIn: Map<string, {"url": string[], "accessMode": string[], "bestAccessMode": string}>; //key is name
hostedBy_collectedFrom: { "downloadName": string, "downloadUrl": string[],
"collectedName": string, "collectedId": string,
"accessMode": string[], "bestAccessMode": string,
"type": string, "year":string}[];
identifiers: Map<string, string[]>;
publisher: string;
subjects: string[];
otherSubjects: Map<string, string[]>;
classifiedSubjects: Map<string, string[]>;
description: string;
//bestaccessright: string;
collectedFrom: { "name": string, "id": string}[];
projectsProvenanceVocabulary: { "sysimport:crosswalk:repository": string,
"sysimport:crosswalk:entityregistry": string,
"sysimport:crosswalk:datasetarchive": string,