1. Landing pages: before a request for the main content (e.g. publicationInfo) is executed, make this content null.

2. Landing pages: 'Available on' and 'Funded by' (Decapitalize first letter of second word).
3. Landing pages: Add 'Related identifiers' label for identifiers information.
4. Landing pages: 'OPEN', 'OPEN SOURCE', 'EMBARGO', 'RESTRICTED', 'Closed' accessmodes are acceptable for 'Available on' section. Otherwise show 'UNKNOWN ACCESSMODE'. 
5. Publication & Dataset & Software landing pages: remove url from title - use separate variable for best accessmode, add country information.
6. Software landing: Add 'programmingLanguage' information.
7. SearchResult & TabResult: Add country information for Publication & Dataset & Software type of results, add programmingLanguage for Software type. 
8. TabResult: Show language and types information.  
9. Bug fix in 'dateofacceptance' parsing for relates/similar research results (landing pages).


git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-services-library/trunk/ng-openaire-library/src/app@52606 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
konstantina.galouni 2018-06-28 14:52:45 +00:00
parent f648847e1a
commit 2220677d99
28 changed files with 335 additions and 109 deletions

View File

@ -157,6 +157,8 @@ export class DataProviderComponent {
this.errorMessage=""
this.showLoading = true;
this.dataProviderInfo = null;
this.showTabs = false ;
if(this.datasourceId==null || this.datasourceId==''){
this.showLoading = false;

View File

@ -11,11 +11,13 @@
<div *ngIf="datasetInfo != null" uk-grid class="uk-grid-large">
<div class="uk-width-expand@m uk-width-1-1@s">
<schema2jsonld *ngIf="datasetInfo.record" [data]=datasetInfo.record></schema2jsonld>
<showTitle [title]="datasetInfo.title"></showTitle>
<span *ngIf="datasetInfo.types.length > 0"class="uk-label custom-label label-dataset " title="Type">{{datasetInfo.types.join(", ")}}</span>
<showTitle [titleName]="datasetInfo.title"></showTitle>
<span *ngIf="datasetInfo.types && datasetInfo.types.length > 0"class="uk-label custom-label label-dataset " title="Type">{{datasetInfo.types.join(", ")}}</span>
<span *ngIf="datasetInfo.languages && datasetInfo.languages.length > 0" class="uk-label custom-label label-language " title="Language">{{datasetInfo.languages.join(", ")}}</span>
<span *ngIf="datasetInfo.countries && datasetInfo.countries.length > 0" class="uk-label custom-label label-country " title="Country">{{datasetInfo.countries.join(", ")}}</span>
<span *ngIf="datasetInfo.title && datasetInfo.title.accessMode" [class]="'uk-label custom-label label-'+ datasetInfo.title.accessMode " title="Access Mode">{{datasetInfo.title.accessMode}}</span>
<!-- <span *ngIf="datasetInfo.title && datasetInfo.title.accessMode" [class]="'uk-label custom-label label-'+ datasetInfo.title.accessMode " title="Access Mode">{{datasetInfo.title.accessMode}}</span> -->
<span *ngIf="datasetInfo.accessMode" [class]="'uk-label custom-label label-'+ datasetInfo.accessMode " title="Access Mode">{{datasetInfo.accessMode}}</span>
<span *ngIf="datasetInfo.underCurationMessage" class="uk-label custom-label label-underCuration " >
<span uk-tooltip="pos:right; delay:10"
title="{{buildCurationTooltip()}}">

View File

@ -115,19 +115,27 @@ export class DatasetComponent {
this.errorMessage=""
this.showLoading = true;
this.datasetInfo = null;
this.infoSub = this._datasetService.getDatasetInfo(id, this. properties).subscribe(
data => {
this.datasetInfo = data;
if(this.datasetInfo.title.name != undefined && this.datasetInfo.title.name!= ''){
/*
if(this.datasetInfo.title.name != undefined && this.datasetInfo.title.name!= ''){
this.updateTitle(this.datasetInfo.title.name);
this.updateDescription("Dataset, search, repositories, open access,"+this.datasetInfo.title.name);
}
*/
if(this.datasetInfo.title){
this.updateTitle(this.datasetInfo.title);
this.updateDescription("Dataset, search, repositories, open access,"+this.datasetInfo.title);
}
if(this.properties.enablePiwikTrack && (typeof document !== 'undefined')){
this.piwiksub = this._piwikService.trackView(this.properties, this.datasetInfo.title.name, this.piwikSiteId).subscribe();
this.piwiksub = this._piwikService.trackView(this.properties, this.datasetInfo.title/*.name*/, this.piwikSiteId).subscribe();
}
this.result = []
this.result = {id: id, type :"dataset", source : "openaire", title: this.datasetInfo.title,url: '', result: '', accessRights: this.datasetInfo.title.accessMode, embargoEndDate: ''};
this.result = {id: id, type :"dataset", source : "openaire", title: this.datasetInfo.title,url: '', result: '', accessRights: /*this.datasetInfo.title.accessMode*/ this.datasetInfo.accessMode, embargoEndDate: ''};
let relatedResearchResultsNum = 0;
if(this.datasetInfo.relatedResearchResults != undefined) {

View File

@ -43,6 +43,7 @@ export class DatasetService {
res[0],
res[1]['creator'],
res[1]['language'],
res[1]['country'],
res[2]
]).map(res => this.parseDatasetInfo(res));
}
@ -56,7 +57,7 @@ export class DatasetService {
parseDatasetInfo (data: any):any {
this.datasetInfo = new DatasetInfo();
this.datasetInfo.record = data[12];
this.datasetInfo.record = data[13];
if(data[0] != null) {
var date:string = (data[0].dateofacceptance)+""; // transform to string in case it is an integer
this.datasetInfo.date = (date && (date).indexOf('-') !== -1)?date.split('-')[0]:date;
@ -69,7 +70,7 @@ export class DatasetService {
}
this.datasetInfo.embargoEndDate = data[0].embargoenddate;
}
this.datasetInfo.title = {"name": "", "url": "", "accessMode": ""};
/*this.datasetInfo.title = {"name": "", "url": "", "accessMode": ""};
if(data[0]['bestaccessright'] && data[0]['bestaccessright'].hasOwnProperty("classid")) {
this.datasetInfo.title.accessMode = data[0]['bestaccessright'].classid;
}
@ -79,6 +80,16 @@ export class DatasetService {
} else {
this.datasetInfo.title['name'] = data[1].content;
}
}*/
if(data[0]['bestaccessright'] && data[0]['bestaccessright'].hasOwnProperty("classid")) {
this.datasetInfo.accessMode = data[0]['bestaccessright'].classid;
}
if(data[1] != null) {
if(Array.isArray(data[1])) {
this.datasetInfo.title = data[1][0].content;
} else {
this.datasetInfo.title = data[1].content;
}
}
if(data[2] != null) {
@ -136,7 +147,7 @@ export class DatasetService {
}
if(instance.hasOwnProperty("hostedby")) {
counter = this.parsingFunctions.parseHostedBy_collectedFrom(this.datasetInfo.hostedBy_collectedFrom, instance, data[0], url, counter, this.datasetInfo.title);
counter = this.parsingFunctions.parseHostedBy_collectedFrom(this.datasetInfo.hostedBy_collectedFrom, instance, data[0], url, counter/*, this.datasetInfo.title*/, this.datasetInfo.accessMode);
}
}
}
@ -156,7 +167,7 @@ export class DatasetService {
this.datasetInfo.hostedBy_collectedFrom = this.parsingFunctions.addPublisherToHostedBy_collectedFrom(
this.datasetInfo.hostedBy_collectedFrom, this.datasetInfo.publisher,
null, this.datasetInfo.identifiers, this.datasetInfo.title);
null, this.datasetInfo.identifiers/*, this.datasetInfo.title*/);
if(data[8] != null) {
this.datasetInfo.contexts = this.parsingFunctions.parseContexts(data[8]);
@ -195,6 +206,9 @@ export class DatasetService {
if(data[11] != null) {
this.datasetInfo.languages = this.parsingFunctions.parseLanguages(data[11]);
}
if(data[12] != null) {
this.datasetInfo.countries = this.parsingFunctions.parseCountries(data[12]);
}
if(this.datasetInfo.relatedResearchResults) {
let self = this;

View File

@ -4,17 +4,19 @@ import {Component, Input, ElementRef} from '@angular/core';
selector: 'availableOn',
template: `
<dl class="uk-description-list-line">
<dt class="title">Available On</dt>
<dt class="title">Available on</dt>
<dd class="line" *ngFor="let available of availableOn.slice(0, showNum) let i=index" >
<div>
<div class="{{available['bestAccessMode']}}">
<!--div class="{{available['bestAccessMode']}}"-->
<div [class]="available['bestAccessMode'] ? available['bestAccessMode'] : 'UNKNOWN ACCESSMODE'">
<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]">
attr.uk-tooltip="pos:right; delay:10"
[title]="available.accessMode[i] ? available.accessMode[i] : 'UNKNOWN ACCESSMODE'">
[{{(i+1) | number}}]
</a>
</span>
@ -23,8 +25,9 @@ import {Component, Input, ElementRef} from '@angular/core';
*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']">
attr.uk-tooltip="pos:right; delay:10"
[title]="available.bestAccessMode ? available.bestAccessMode : 'UNKNOWN ACCESSMODE'">
{{available.downloadName}}
</a>
<span *ngIf="available.collectedName" class="uk-text-bold">via</span>

View File

@ -4,7 +4,7 @@ import {Component, Input, ElementRef} from '@angular/core';
selector: 'fundedBy',
template: `
<dl class="uk-description-list-line">
<dt class="title">Funded By</dt>
<dt class="title">Funded by</dt>
<dd class="line"
*ngFor="let item of fundedByProjects.slice(0, showNum) let i=index">
<div><!-- *ngIf="i<5 || showAll"-->

View File

@ -142,7 +142,7 @@ export class ParsingFunctions {
// publication & dataset landing : for downloadFrom
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}) {
identifiers: Map<string, string[]>/*, title: { "name": string, "url": string, "accessMode": string}*/) {
if( publisher && identifiers != null && identifiers.has('doi')) {
if( hostedBy_collectedFrom == null) {
hostedBy_collectedFrom = new Array<{"downloadName": string, "downloadUrl": string[], "collectedName": string, "collectedId": string, "accessMode": string[], "bestAccessMode": string, "type": string, "year":string}>();
@ -162,10 +162,11 @@ export class ParsingFunctions {
available.accessMode = new Array<string>();
available.downloadUrl.push(url);
/*
if(title != undefined && title['url'] == "") {
title['url'] = url;
}
*/
hostedBy_collectedFrom.push(available);
}
return hostedBy_collectedFrom;
@ -238,8 +239,8 @@ export class ParsingFunctions {
"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 {
instance: any, data: any, url: string, counter: number/*,
title: { "name": string, "url": string, "accessMode": 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": ""};
@ -290,21 +291,25 @@ export class ParsingFunctions {
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(this.changeBestAccessMode(accessMode, instance['accessright'])) {
accessMode = instance['accessright'].classid;
}
}
/*
if(title != undefined) {
if(!title['url']) {
title['url'] = url;
}
}
*/
} else if(url) {
available['accessMode'].push("");
}
@ -324,9 +329,13 @@ export class ParsingFunctions {
switch (currentAccessMode) {
case null:
return true;
if(accessMode != "UNKNOWN") {
return true;
}
return false;
case "CLOSED":
if( accessMode == "OPEN" ||
accessMode == "OPEN SOURCE" ||
accessMode == "EMBARGO" ||
accessMode == "RESTRICTED") {
return true;
@ -334,15 +343,22 @@ export class ParsingFunctions {
return false;
case "RESTRICTED":
if( accessMode == "OPEN" ||
accessMode == "OPEN SOURCE" ||
accessMode == "EMBARGO") {
return true;
}
return false;
case "EMBARGO":
if(accessMode == "OPEN") {
if( accessMode == "OPEN" ||
accessMode == "OPEN SOURCE") {
return true;
}
return false;
}
return false;
case "OPEN SOURCE":
if( accessMode == "OPEN") {
return true;
}
return false;
}
return false;
}
@ -394,8 +410,10 @@ export class ParsingFunctions {
researchResult['id'] = relation['to'].content;
let titleName = Array.isArray(relation['title']) ? relation['title'][0].content : relation['title'].content;
researchResult['name'] = titleName;
var date:string = ((Array.isArray(relation.dateofacceptance))?(relation.dateofacceptance[0]):(relation.dateofacceptance))+""; // transform to string in case it is an integer
researchResult['date'] = (date && (date).indexOf('-') !== -1)?date.split('-')[0]:date;
if(relation.hasOwnProperty("dateofacceptance")) {
var date:string = ((Array.isArray(relation.dateofacceptance))?(relation.dateofacceptance[0]):(relation.dateofacceptance))+""; // transform to string in case it is an integer
researchResult['date'] = (date && (date).indexOf('-') !== -1)?date.split('-')[0]:date;
}
//researchResult['date'] = relation.dateofacceptance.substring(0,4);;
researchResult['percentage'] = Math.round(relation[percentageName]*100);
return researchResult;
@ -548,4 +566,38 @@ export class ParsingFunctions {
}
return languages;
}
parseCountries(_countries: any) {
var countries = new Array<string>();
if(!Array.isArray(_countries)) {
if(_countries.classname != "Undetermined" && _countries.classname) {
countries.push(_countries.classname);
}
} else {
for(let i=0; i<countries.length; i++) {
if(_countries[i].classname != "Undetermined" && _countries[i].classname) {
countries.push(_countries[i].classname);
}
}
}
return countries;
}
parseProgrammingLanguages(_pLanguages) {
var pLanguages = new Array<string>();
if(!Array.isArray(_pLanguages)) {
if(_pLanguages.classname != "Undetermined" && _pLanguages.classname) {
pLanguages.push(_pLanguages.classname);
}
} else {
for(let i=0; i<_pLanguages.length; i++) {
if(_pLanguages[i].classname != "Undetermined" && _pLanguages[i].classname) {
pLanguages.push(_pLanguages[i].classname);
}
}
}
return pLanguages;
}
}

View File

@ -4,6 +4,8 @@ import {Component, Input, ElementRef} from '@angular/core';
selector: 'showIdentifiers',
template: `
<span *ngIf="countIdentifiers() > 0" class="uk-text-bold">Related identifiers:</span>
<span *ngIf="showAll && countIdentifiers() > pageSize">
<a (click)="showAll = !showAll;">View less identifiers</a>
</span>

View File

@ -5,12 +5,9 @@ import {ActivatedRoute} from '@angular/router';
selector: 'showTitle',
template: `
<h2 *ngIf="title != undefined">
<!--span [class]="'entityTitleIcon '+iconClass"></span-->
<span *ngIf="title['url'] != undefined && title['url'] != null && title['url'] != ''"
class="custom-external">
<!--span class=" custom-icon {{title['accessMode']}}"
uk-tooltip="pos:bottom-right"
[title]="title['accessMode']"-->
<a *ngIf="title['name'] != undefined && title['name'] != ''"
href="{{title['url']}}" target="_blank"
[innerHTML]="title['name']">
@ -19,7 +16,6 @@ import {ActivatedRoute} from '@angular/router';
href="{{title['url']}}" target="_blank">
[no title available]
</a>
<!--/span-->
</span>
<span *ngIf="(title['name'] != undefined && title['name'] != '') &&
(title['url'] == undefined || title['url'] == null || title['url'] == '')"
@ -31,15 +27,18 @@ import {ActivatedRoute} from '@angular/router';
[no title available]
</span>
</h2>
<!--[class]="title['accessMode']"
uk-tooltip="pos:bottom-right"
[title]="title['accessMode']"
[innerHTML]="title['name']" -->
<h2 *ngIf="titleName">
<span [innerHTML]="titleName"></span>
</h2>
<h2 *ngIf="!titleName && !title">
<span>[no title available]</span>
</h2>
`
})
export class ShowTitleComponent {
@Input() titleName: string;
@Input() title: { [key: string]: string };
@Input() iconClass:string;
@ -51,10 +50,6 @@ export class ShowTitleComponent {
this.sub = this.route.queryParams.subscribe(
params => {
console.info("onInit showTitle");
if(this.title['accessMode'] == undefined) {
this.title['accessMode'] = "";
}
}
);
}

View File

@ -49,7 +49,7 @@ import{EnvProperties} from '../../utils/properties/env-properties';
</a>
<p *ngIf="item['id'] == '' && item['name'] != ''">{{item['name']}}</p>
<span *ngIf="item['date'] != ''">
<span *ngIf="item['date']">
({{item['date']}})
</span>
</td>

View File

@ -43,7 +43,7 @@
<li (click)="activeTab='Projects'; projectsClicked=true;">
<a class="uk-accordion-title" href="#">
Projetcs
Projects
<span class="uk-badge uk-badge-notification">
{{fetchProjects.searchUtils.totalResultsNoFilters | number}}
</span>

View File

@ -184,6 +184,8 @@ export class OrganizationComponent {
this.errorMessage=""
this.showLoading = true;
this.organizationInfo = null;
this.infoSub = this._organizationService.getOrganizationInfo(this.organizationId, this.properties).subscribe(
data => {
if(data == null) {

View File

@ -273,8 +273,8 @@ actionsAfterLoadId(){
this.warningMessage = '';
this.errorMessage=""
this.showLoading = true;
var funder = "EC";
var grantId ="654142";
this.projectInfo = null;
this.infoSub = this._projectService.getProjectInfo(id, this.properties).subscribe(
data => {
@ -290,10 +290,12 @@ actionsAfterLoadId(){
);
}
private getProjectInfoByGrantId (grantId:string, funder:string) {
this.warningMessage = '';
this.warningMessage = '';
this.errorMessage=""
this.showLoading = true;
this.projectInfo = null;
this._projectService.getProjectInfoByGrantId(grantId,funder,this.properties).subscribe(
data =>{

View File

@ -10,10 +10,12 @@
<div *ngIf="publicationInfo != null" uk-grid class="uk-grid-large">
<div class="uk-width-expand@m uk-width-1-1@s">
<schema2jsonld *ngIf="publicationInfo.record" [data]=publicationInfo.record></schema2jsonld>
<showTitle [title]="publicationInfo.title"></showTitle>
<span *ngIf="publicationInfo.types.length > 0"class="uk-label custom-label label-blue label-publication" title="Type">{{publicationInfo.types.join(", ")}}</span>
<span *ngIf="publicationInfo.languages.length > 0" class="uk-label custom-label label-language " title="Language">{{publicationInfo.languages.join(", ")}}</span>
<span *ngIf="publicationInfo.title && publicationInfo.title.accessMode" [class]="'uk-label custom-label label-'+ publicationInfo.title.accessMode "><!--span [class]="publicationInfo.title.accessMode" -->{{publicationInfo.title.accessMode}}<!--/span--></span>
<showTitle [titleName]="publicationInfo.title"></showTitle>
<span *ngIf="publicationInfo.types && publicationInfo.types.length > 0"class="uk-label custom-label label-blue label-publication" title="Type">{{publicationInfo.types.join(", ")}}</span>
<span *ngIf="publicationInfo.languages && publicationInfo.languages.length > 0" class="uk-label custom-label label-language " title="Language">{{publicationInfo.languages.join(", ")}}</span>
<span *ngIf="publicationInfo.countries && publicationInfo.countries.length > 0" class="uk-label custom-label label-country " title="Country">{{publicationInfo.countries.join(", ")}}</span>
<!-- <span *ngIf="publicationInfo.title && publicationInfo.title.accessMode" [class]="'uk-label custom-label label-'+ publicationInfo.title.accessMode ">{{publicationInfo.title.accessMode}}</span> -->
<span *ngIf="publicationInfo.accessMode" [class]="'uk-label custom-label label-'+ publicationInfo.accessMode " title="Access Mode">{{publicationInfo.accessMode}}</span>
<span *ngIf="publicationInfo.underCurationMessage" class="uk-label custom-label label-underCuration" >
<span uk-tooltip="pos:right; delay:10"

View File

@ -128,18 +128,24 @@ export class PublicationComponent {
this.errorMessage=""
this.showLoading = true;
this.publicationInfo = null;
this.infoSub = this._publicationService.getPublicationInfo(this.articleId, this.properties).subscribe(
data => {
this.publicationInfo = data;
// this.result = []
// this.result = {id: id, type :"dataset", source : "openaire", title: this.publicationInfo.title,url: '', result: '', accessRights: this.publicationInfo.bestaccessright, embargoEndDate: ''};
if(this.publicationInfo.title.name != undefined && this.publicationInfo.title.name!= ''){
/*if(this.publicationInfo.title.name != undefined && this.publicationInfo.title.name!= ''){
this.updateTitle(this.publicationInfo.title.name);
this.updateDescription("Dataset, search, repositories, open access,"+this.publicationInfo.title.name);
}*/
if(this.publicationInfo.title){
this.updateTitle(this.publicationInfo.title);
this.updateDescription("Dataset, search, repositories, open access,"+this.publicationInfo.title);
}
if(this.properties.enablePiwikTrack && (typeof document !== 'undefined')){
this.piwiksub = this._piwikService.trackView(this.properties, this.publicationInfo.title.name, this.piwikSiteId).subscribe();
this.piwiksub = this._piwikService.trackView(this.properties, this.publicationInfo.title/*.name*/, this.piwikSiteId).subscribe();
}
let bioentitiesNum = 0;
@ -158,7 +164,7 @@ export class PublicationComponent {
}
this.relatedResearchResultsNum = relatedResearchResultsNum;
this.result = {id: this.articleId, type :"publication", source : "openaire", title: this.publicationInfo.title,url: '', result: '', accessRights: this.publicationInfo.title.accessMode, embargoEndDate: ''};
this.result = {id: this.articleId, type :"publication", source : "openaire", title: this.publicationInfo.title,url: '', result: '', accessRights: /*this.publicationInfo.title.accessMode*/this.publicationInfo.accessMode, embargoEndDate: ''};
// this.result.push(result_);
if(this.publicationInfo.identifiers != undefined && this.publicationInfo.identifiers.has('doi')) {

View File

@ -44,7 +44,8 @@ export class PublicationService {
res[1]['oaf:result']['context'],
res[0],
res[1]['oaf:result']['creator'],
res[2]
res[2],
res[1]['oaf:result']['country'],
])
.map(res => this.parsePublicationInfo(res));
}
@ -72,6 +73,7 @@ export class PublicationService {
this.publicationInfo.embargoEndDate = data[0].embargoenddate;
}
/*
this.publicationInfo.title = {"name": "", "url": "", "accessMode": ""};
if(data[0]['bestaccessright'] && data[0]['bestaccessright'].hasOwnProperty("classid")) {
this.publicationInfo.title.accessMode = data[0]['bestaccessright'].classid;
@ -84,6 +86,17 @@ export class PublicationService {
this.publicationInfo.title['name'] = data[1].content;
}
}
*/
if(data[0]['bestaccessright'] && data[0]['bestaccessright'].hasOwnProperty("classid")) {
this.publicationInfo.accessMode = data[0]['bestaccessright'].classid;
}
if(data[1] != null) {
if(Array.isArray(data[1])) {
this.publicationInfo.title = data[1][0].content;
} else {
this.publicationInfo.title = data[1].content;
}
}
if(data[2] != null) {
let relation;
@ -145,7 +158,7 @@ export class PublicationService {
/**********************************************************/
if(instance.hasOwnProperty("hostedby")) {
counter = this.parsingFunctions.parseHostedBy_collectedFrom(this.publicationInfo.hostedBy_collectedFrom, instance, data[0], url, counter, this.publicationInfo.title);
counter = this.parsingFunctions.parseHostedBy_collectedFrom(this.publicationInfo.hostedBy_collectedFrom, instance, data[0], url, counter/*, this.publicationInfo.title*/, this.publicationInfo.accessMode);
}
/**********************************************************/
}
@ -177,6 +190,9 @@ export class PublicationService {
if(data[6] != null) {
this.publicationInfo.languages = this.parsingFunctions.parseLanguages(data[6]);
}
if(data[15] != null) {
this.publicationInfo.countries = this.parsingFunctions.parseCountries(data[15]);
}
if(data[7] != null) {
let subjectResults: [string[], Map<string, string[]>, Map<string, string[]>] = this.parsingFunctions.parseAllSubjects(data[7]);
@ -195,8 +211,8 @@ export class PublicationService {
this.publicationInfo.hostedBy_collectedFrom = this.parsingFunctions.addPublisherToHostedBy_collectedFrom(
this.publicationInfo.hostedBy_collectedFrom, this.publicationInfo.publisher,
this.publicationInfo.journal, this.publicationInfo.identifiers,
this.publicationInfo.title);
this.publicationInfo.journal, this.publicationInfo.identifiers/*,
this.publicationInfo.title*/);
if(data[10] != null) {
this.publicationInfo.references = this.parseReferences(data[10]);

View File

@ -11,10 +11,13 @@
<div *ngIf="softwareInfo != null" uk-grid class="uk-grid-large">
<div class="uk-width-expand@m uk-width-1-1@s">
<schema2jsonld *ngIf="softwareInfo.record" [data]=softwareInfo.record></schema2jsonld>
<showTitle [title]="softwareInfo.title"></showTitle>
<span *ngIf="softwareInfo.types.length > 0"class="uk-label custom-label label-software " title="Type">{{softwareInfo.types.join(", ")}}</span>
<showTitle [titleName]="softwareInfo.title"></showTitle>
<span *ngIf="softwareInfo.types && softwareInfo.types.length > 0"class="uk-label custom-label label-software " title="Type">{{softwareInfo.types.join(", ")}}</span>
<span *ngIf="softwareInfo.programmingLanguages && softwareInfo.programmingLanguages.length > 0" class="uk-label custom-label label-progrLanguage " title="Programming Language">{{softwareInfo.programmingLanguages.join(", ")}}</span>
<span *ngIf="softwareInfo.languages && softwareInfo.languages.length > 0" class="uk-label custom-label label-language " title="Language">{{softwareInfo.languages.join(", ")}}</span>
<span *ngIf="softwareInfo.title && softwareInfo.title.accessMode" [class]="'uk-label custom-label label-'+ softwareInfo.title.accessMode " title="Access Mode">{{softwareInfo.title.accessMode}}</span>
<span *ngIf="softwareInfo.countries && softwareInfo.countries.length > 0" class="uk-label custom-label label-country " title="Country">{{softwareInfo.countries.join(", ")}}</span>
<!-- <span *ngIf="softwareInfo.title && softwareInfo.title.accessMode" [class]="'uk-label custom-label label-'+ softwareInfo.title.accessMode " title="Access Mode">{{softwareInfo.title.accessMode}}</span> -->
<span *ngIf="softwareInfo.accessMode" [class]="'uk-label custom-label label-'+ softwareInfo.accessMode " title="Access Mode">{{softwareInfo.accessMode}}</span>
<span *ngIf="softwareInfo.underCurationMessage" class="uk-label custom-label label-underCuration " >
<span uk-tooltip="pos:right; delay:10"
title="{{buildCurationTooltip()}}">

View File

@ -114,19 +114,25 @@ export class SoftwareComponent {
this.errorMessage=""
this.showLoading = true;
this.softwareInfo = null;
this.infoSub = this._softwareService.getSoftwareInfo(id, this.properties).subscribe(
data => {
this.softwareInfo = data;
if(this.softwareInfo.title.name != undefined && this.softwareInfo.title.name!= ''){
/*if(this.softwareInfo.title.name != undefined && this.softwareInfo.title.name!= ''){
this.updateTitle(this.softwareInfo.title.name);
this.updateDescription("Software, search, repositories, open access,"+this.softwareInfo.title.name);
}*/
if(this.softwareInfo.title){
this.updateTitle(this.softwareInfo.title);
this.updateDescription("Software, search, repositories, open access,"+this.softwareInfo.title);
}
if( this.properties.enablePiwikTrack && (typeof document !== 'undefined')){
this.piwiksub = this._piwikService.trackView(this.properties, this.softwareInfo.title.name, this.piwikSiteId).subscribe();
this.piwiksub = this._piwikService.trackView(this.properties, this.softwareInfo.title/*.name*/, this.piwikSiteId).subscribe();
}
this.result = []
this.result = {id: id, type :"software", source : "openaire", title: this.softwareInfo.title,url: '', result: '', accessRights: this.softwareInfo.title.accessMode, embargoEndDate: ''};
this.result = {id: id, type :"software", source : "openaire", title: this.softwareInfo.title,url: '', result: '', accessRights: /*this.softwareInfo.title.accessMode*/this.softwareInfo.accessMode, embargoEndDate: ''};
let relatedResearchResultsNum = 0;
if(this.softwareInfo.relatedResearchResults != undefined) {

View File

@ -43,6 +43,8 @@ export class SoftwareService {
res[0],
res[1]['creator'],
res[1]['language'],
res[1]['country'],
res[1]['programmingLanguage'],
res[2]
]).map(res => this.parseSoftwareInfo(res));
}
@ -56,7 +58,7 @@ export class SoftwareService {
parseSoftwareInfo (data: any):any {
this.softwareInfo = new SoftwareInfo();
this.softwareInfo.record = data[12];
this.softwareInfo.record = data[14];
if(data[0] != null) {
var date:string = (data[0].dateofacceptance)+""; // transform to string in case it is an integer
this.softwareInfo.date = (date && (date).indexOf('-') !== -1)?date.split('-')[0]:date;
@ -69,6 +71,7 @@ export class SoftwareService {
}
this.softwareInfo.embargoEndDate = data[0].embargoenddate;
}
/*
this.softwareInfo.title = {"name": "", "url": "", "accessMode": ""};
if(data[0]['bestaccessright'] && data[0]['bestaccessright'] && data[0]['bestaccessright'].hasOwnProperty("classid")) {
this.softwareInfo.title.accessMode = data[0]['bestaccessright'].classid;
@ -80,6 +83,17 @@ export class SoftwareService {
this.softwareInfo.title['name'] = data[1].content;
}
}
*/
if(data[0]['bestaccessright'] && data[0]['bestaccessright'] && data[0]['bestaccessright'].hasOwnProperty("classid")) {
this.softwareInfo.accessMode = data[0]['bestaccessright'].classid;
}
if(data[1] != null) {
if(Array.isArray(data[1])) {
this.softwareInfo.title = data[1][0].content;
} else {
this.softwareInfo.title = data[1].content;
}
}
if(data[2] != null) {
let relation;
@ -136,7 +150,7 @@ export class SoftwareService {
}
if(instance.hasOwnProperty("hostedby")) {
counter = this.parsingFunctions.parseHostedBy_collectedFrom(this.softwareInfo.hostedBy_collectedFrom, instance, data[0], url, counter, this.softwareInfo.title);
counter = this.parsingFunctions.parseHostedBy_collectedFrom(this.softwareInfo.hostedBy_collectedFrom, instance, data[0], url, counter/*, this.softwareInfo.title*/, this.softwareInfo.accessMode);
}
}
}
@ -157,7 +171,7 @@ export class SoftwareService {
// null argument is for journal
this.softwareInfo.hostedBy_collectedFrom = this.parsingFunctions.addPublisherToHostedBy_collectedFrom(
this.softwareInfo.hostedBy_collectedFrom, this.softwareInfo.publisher,
null, this.softwareInfo.identifiers, this.softwareInfo.title);
null, this.softwareInfo.identifiers/*, this.softwareInfo.title*/);
if(data[8] != null) {
this.softwareInfo.contexts = this.parsingFunctions.parseContexts(data[8]);
@ -196,6 +210,13 @@ export class SoftwareService {
if(data[11] != null) {
this.softwareInfo.languages = this.parsingFunctions.parseLanguages(data[11]);
}
if(data[12] != null) {
this.softwareInfo.countries = this.parsingFunctions.parseCountries(data[12]);
}
if(data[13] != null) {
this.softwareInfo.programmingLanguages = this.parsingFunctions.parseProgrammingLanguages(data[13]);
}
if(this.softwareInfo.relatedResearchResults) {
let self = this;

View File

@ -15,7 +15,9 @@
</a>
</h4>
<span *ngIf="result.types && result.types.length > 0" [class]="'uk-label custom-label label-blue label-'+result.entityType" title="Type">{{result.types.join(", ")}}</span>
<span *ngIf="result.programmingLanguages && result.programmingLanguages.length > 0" class="uk-label custom-label label-progrLanguage " title="Programming Language">{{result.programmingLanguages.join(", ")}}</span>
<span *ngIf="result.languages && result.languages.length > 0" class="uk-label custom-label label-language " title="Language">{{result.languages.join(", ")}}</span>
<span *ngIf="result.countriesForResults && result.countriesForResults.length > 0" class="uk-label custom-label label-country " title="Country">{{result.countriesForResults.join(", ")}}</span>
<span *ngIf="result.title && result.title.accessMode" [class]="'uk-label custom-label label-'+ result.title.accessMode " title="Access Mode">{{result.title.accessMode}}</span>
<!-- <span *ngIf="result['funders'] && result['funders'].length > 0" class="uk-label custom-label label-funder " title="Funder"><span *ngFor="let funder of result['funders'] let i=index">
@ -72,7 +74,7 @@
<span *ngIf="result['projects'].length > 15">...</span>
</div>
<div *ngIf="result.description != undefined && result.description != ''">
<div *ngIf="result.description">
<div class="text-justify descriptionText">
{{result.description}}
</div>

View File

@ -33,6 +33,10 @@
</span>
</div>
<span *ngIf="result.types && result.types.length > 0" [class]="'uk-label custom-label label-blue label-'+result.entityType" title="Type">{{result.types.join(", ")}}</span>
<span *ngIf="result.programmingLanguages && result.programmingLanguages.length > 0" class="uk-label custom-label label-progrLanguage " title="Programming Language">{{result.programmingLanguages.join(", ")}}</span>
<span *ngIf="result.languages && result.languages.length > 0" class="uk-label custom-label label-language " title="Language">{{result.languages.join(", ")}}</span>
<span *ngIf="result.countriesForResults && result.countriesForResults.length > 0" class="uk-label custom-label label-country " title="Country">{{result.countriesForResults.join(", ")}}</span>
<span *ngIf="result.title && result.title.accessMode" [class]="'uk-label custom-label label-'+ result.title.accessMode " title="Access Mode">{{result.title.accessMode}}</span>
<span *ngIf="result['funderShortname']" class="uk-label custom-label label-funder " title="Funder">{{result['funderShortname']}}</span>
<span *ngIf="result.openAccessMandate != undefined && result.openAccessMandate " class="uk-label custom-label label-openaccessmandate " title="Open Access mandate">Open Access mandate</span>

View File

@ -133,20 +133,20 @@ export class SearchDatasetsService {
var result: SearchResult = new SearchResult();
result.entityType = "dataset";
result.types = new Array<string>();
let types = new Set<string>();
let length = Array.isArray(resData['children']['instance']) ? resData['children']['instance'].length : 1;
let instance;
for(let i=0; i<length; i++) {
instance = Array.isArray(resData['children']['instance']) ? resData['children']['instance'][i] : resData['children']['instance'];
this.parsingFunctions.parseTypes(result.types, types, instance);
}
if(resData['language'] && resData['language'] != null) {
result.languages = new Array<string>();
result.types = new Array<string>();
let types = new Set<string>();
let counter = 0;
let instance;
let length = Array.isArray(resData['children']['instance']) ? resData['children']['instance'].length : 1;
for(let i=0; i<length; i++) {
instance = Array.isArray(resData['children']['instance']) ? resData['children']['instance'][i] : resData['children']['instance'];
this.parsingFunctions.parseTypes(result.types, types, instance);
}
if(!Array.isArray(resData['language'])) {
if(resData['language'].classname != "Undetermined" && resData['language'].classname) {
result.languages.push(resData['language'].classname);
@ -159,6 +159,22 @@ export class SearchDatasetsService {
}
}
}
if(resData['country'] && resData['country'] != null) {
result.countriesForResults = new Array<string>();
if(!Array.isArray(resData['country'])) {
if(resData['country'].classname != "Undetermined" && resData['country'].classname) {
result.countriesForResults.push(resData['country'].classname);
}
} else {
for(let i=0; i<resData['country'].length; i++) {
if(resData['country'][i].classname != "Undetermined" && resData['country'][i].classname) {
result.countriesForResults.push(resData['country'][i].classname);
}
}
}
}
result['title'] = {"name": '', "accessMode": '', "sc39": ''};
if(Array.isArray(resData['title'])) {
@ -218,7 +234,7 @@ export class SearchDatasetsService {
} else {
result.description = resData.description[0];
}
if(result.description.length > this.sizeOfDescription) {
if(result.description && result.description.length > this.sizeOfDescription) {
result.description = result.description.substring(0, this.sizeOfDescription)+"...";
}

View File

@ -163,20 +163,21 @@ export class SearchPublicationsService {
var result: SearchResult = new SearchResult();
result.entityType = "publication";
result.types = new Array<string>();
let types = new Set<string>();
let instance;
let length = Array.isArray(resData['children']['instance']) ? resData['children']['instance'].length : 1;
for(let i=0; i<length; i++) {
instance = Array.isArray(resData['children']['instance']) ? resData['children']['instance'][i] : resData['children']['instance'];
this.parsingFunctions.parseTypes(result.types, types, instance);
}
if(resData['language'] && resData['language'] != null) {
result.languages = new Array<string>();
result.types = new Array<string>();
let types = new Set<string>();
let counter = 0;
let instance;
let length = Array.isArray(resData['children']['instance']) ? resData['children']['instance'].length : 1;
for(let i=0; i<length; i++) {
instance = Array.isArray(resData['children']['instance']) ? resData['children']['instance'][i] : resData['children']['instance'];
this.parsingFunctions.parseTypes(result.types, types, instance);
}
if(!Array.isArray(resData['language'])) {
if(resData['language'].classname != "Undetermined" && resData['language'].classname) {
result.languages.push(resData['language'].classname);
@ -189,6 +190,23 @@ export class SearchPublicationsService {
}
}
}
if(resData['country'] && resData['country'] != null) {
result.countriesForResults = new Array<string>();
if(!Array.isArray(resData['country'])) {
if(resData['country'].classname != "Undetermined" && resData['country'].classname) {
result.countriesForResults.push(resData['country'].classname);
}
} else {
for(let i=0; i<resData['country'].length; i++) {
if(resData['country'][i].classname != "Undetermined" && resData['country'][i].classname) {
result.countriesForResults.push(resData['country'][i].classname);
}
}
}
}
result['title'] = {"name": '', "accessMode": '', "sc39": ''};
if(Array.isArray(resData['title'])) {
@ -254,7 +272,7 @@ export class SearchPublicationsService {
result.description = resData.description[0];
}
if(result.description.length > this.sizeOfDescription) {
if(result.description && result.description.length > this.sizeOfDescription) {
result.description = result.description.substring(0, this.sizeOfDescription) + "...";
}

View File

@ -133,20 +133,37 @@ export class SearchSoftwareService {
var result: SearchResult = new SearchResult();
result.entityType = "software";
result.types = new Array<string>();
let types = new Set<string>();
let instance;
let length = Array.isArray(resData['children']['instance']) ? resData['children']['instance'].length : 1;
for(let i=0; i<length; i++) {
instance = Array.isArray(resData['children']['instance']) ? resData['children']['instance'][i] : resData['children']['instance'];
this.parsingFunctions.parseTypes(result.types, types, instance);
}
if(resData['programmingLanguage'] && resData['programmingLanguage'] != null) {
result.programmingLanguages = new Array<string>();
if(!Array.isArray(resData['programmingLanguage'])) {
if(resData['programmingLanguage'].classname != "Undetermined" && resData['programmingLanguage'].classname) {
result.programmingLanguages.push(resData['programmingLanguage'].classname);
}
} else {
for(let i=0; i<resData['programmingLanguage'].length; i++) {
if(resData['programmingLanguage'][i].classname != "Undetermined" && resData['programmingLanguage'][i].classname) {
result.programmingLanguages.push(resData['programmingLanguage'][i].classname);
}
}
}
}
if(resData['language'] && resData['language'] != null) {
result.languages = new Array<string>();
result.types = new Array<string>();
let types = new Set<string>();
let counter = 0;
let instance;
let length = Array.isArray(resData['children']['instance']) ? resData['children']['instance'].length : 1;
for(let i=0; i<length; i++) {
instance = Array.isArray(resData['children']['instance']) ? resData['children']['instance'][i] : resData['children']['instance'];
this.parsingFunctions.parseTypes(result.types, types, instance);
}
if(!Array.isArray(resData['language'])) {
if(resData['language'].classname != "Undetermined" && resData['language'].classname) {
result.languages.push(resData['language'].classname);
@ -159,6 +176,22 @@ export class SearchSoftwareService {
}
}
}
if(resData['country'] && resData['country'] != null) {
result.countriesForResults = new Array<string>();
if(!Array.isArray(resData['country'])) {
if(resData['country'].classname != "Undetermined" && resData['country'].classname) {
result.countriesForResults.push(resData['country'].classname);
}
} else {
for(let i=0; i<resData['country'].length; i++) {
if(resData['country'][i].classname != "Undetermined" && resData['country'][i].classname) {
result.countriesForResults.push(resData['country'][i].classname);
}
}
}
}
result['title'] = {"name": '', "accessMode": '', "sc39": ''};
if(Array.isArray(resData['title'])) {
@ -218,7 +251,7 @@ export class SearchSoftwareService {
} else {
result.description = resData.description[0];
}
if(result.description.length > this.sizeOfDescription) {
if(result.description && result.description.length > this.sizeOfDescription) {
result.description = result.description.substring(0, this.sizeOfDescription)+"...";
}

View File

@ -1,6 +1,8 @@
export class DatasetInfo {
underCurationMessage: boolean;
title: { "name": string, "url": string, "accessMode": string};
//title: { "name": string, "url": string, "accessMode": string};
title: string;
accessMode: string;
authors: string[];
date: string;
dateofacceptance: string;
@ -13,6 +15,7 @@ export class DatasetInfo {
identifiers: Map<string, string[]>;
publisher: string;
languages: string[];
countries: string[];
subjects: string[];
otherSubjects: Map<string, string[]>;
classifiedSubjects: Map<string, string[]>;

View File

@ -1,6 +1,8 @@
export class PublicationInfo {
underCurationMessage: boolean;
title: { "name": string, "url": string, "accessMode": string};
//title: { "name": string, "url": string, "accessMode": string};
title: string;
accessMode: string;
authors: string[];
date: string;
dateofacceptance: string;
@ -15,6 +17,7 @@ export class PublicationInfo {
publisher: string;
journal: {"journal": string, "issn": string, "lissn": string, "volume": string, "start_page": string, "end_page": string};
languages: string[];
countries: string[];
subjects: string[];
otherSubjects: Map<string, string[]>;
classifiedSubjects: Map<string, string[]>; //<class of subject, subjects>

View File

@ -31,8 +31,14 @@ export class SearchResult {
countries: string[];
subjects: string[];
entityType: string;
//publications & datasets & software
countriesForResults: string[];
languages: string[];
//software
programmingLanguages: string[];
entityType: string;
types: string[];
openAccessMandate: boolean;
constructor(){}

View File

@ -1,6 +1,8 @@
export class SoftwareInfo {
underCurationMessage: boolean;
title: { "name": string, "url": string, "accessMode": string};
//title: { "name": string, "url": string, "accessMode": string};
title: string;
accessMode: string;
authors: string[];
date: string;
dateofacceptance: string;
@ -13,6 +15,7 @@ export class SoftwareInfo {
identifiers: Map<string, string[]>;
publisher: string;
languages: string[];
countries: string[];
subjects: string[];
otherSubjects: Map<string, string[]>;
classifiedSubjects: Map<string, string[]>;
@ -43,4 +46,6 @@ export class SoftwareInfo {
similarResearchResults: { "name": string, "id": string, "date": string, "percentage": number, "class": string}[]; // percentage is for similarity
contexts: { "labelContext": string, "labelCategory": string, "labelConcept": string, "inline": boolean}[];
record;
//softwareType: string;
programmingLanguages: string[];
}