diff --git a/landingPages/dataProvider/dataProvider.component.ts b/landingPages/dataProvider/dataProvider.component.ts index ed3be2e9..81f0b712 100644 --- a/landingPages/dataProvider/dataProvider.component.ts +++ b/landingPages/dataProvider/dataProvider.component.ts @@ -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; diff --git a/landingPages/dataset/dataset.component.html b/landingPages/dataset/dataset.component.html index 078e6300..b9e873b8 100644 --- a/landingPages/dataset/dataset.component.html +++ b/landingPages/dataset/dataset.component.html @@ -11,11 +11,13 @@
- - {{datasetInfo.types.join(", ")}} + + {{datasetInfo.types.join(", ")}} {{datasetInfo.languages.join(", ")}} + {{datasetInfo.countries.join(", ")}} - {{datasetInfo.title.accessMode}} + + {{datasetInfo.accessMode}} diff --git a/landingPages/dataset/dataset.component.ts b/landingPages/dataset/dataset.component.ts index 02f7d370..ec0ee922 100644 --- a/landingPages/dataset/dataset.component.ts +++ b/landingPages/dataset/dataset.component.ts @@ -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) { diff --git a/landingPages/dataset/dataset.service.ts b/landingPages/dataset/dataset.service.ts index acd35465..89576cc5 100644 --- a/landingPages/dataset/dataset.service.ts +++ b/landingPages/dataset/dataset.service.ts @@ -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; diff --git a/landingPages/landing-utils/availableOn.component.ts b/landingPages/landing-utils/availableOn.component.ts index 61408b5e..c2b87c2c 100644 --- a/landingPages/landing-utils/availableOn.component.ts +++ b/landingPages/landing-utils/availableOn.component.ts @@ -4,17 +4,19 @@ import {Component, Input, ElementRef} from '@angular/core'; selector: 'availableOn', template: `
-
Available On
+
Available on
-
+ +
{{available.downloadName}} + + attr.uk-tooltip="pos:right; delay:10" + [title]="available.accessMode[i] ? available.accessMode[i] : 'UNKNOWN ACCESSMODE'"> [{{(i+1) | number}}] @@ -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}} via diff --git a/landingPages/landing-utils/fundedBy.component.ts b/landingPages/landing-utils/fundedBy.component.ts index d378a02f..0cea1a8a 100644 --- a/landingPages/landing-utils/fundedBy.component.ts +++ b/landingPages/landing-utils/fundedBy.component.ts @@ -4,7 +4,7 @@ import {Component, Input, ElementRef} from '@angular/core'; selector: 'fundedBy', template: `
-
Funded By
+
Funded by
diff --git a/landingPages/landing-utils/parsingFunctions.class.ts b/landingPages/landing-utils/parsingFunctions.class.ts index 64f0f3a4..024214fb 100644 --- a/landingPages/landing-utils/parsingFunctions.class.ts +++ b/landingPages/landing-utils/parsingFunctions.class.ts @@ -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, title: { "name": string, "url": string, "accessMode": string}) { + identifiers: Map/*, 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(); 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(); + + if(!Array.isArray(_countries)) { + if(_countries.classname != "Undetermined" && _countries.classname) { + countries.push(_countries.classname); + } + } else { + for(let i=0; i(); + + 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; + } } diff --git a/landingPages/landing-utils/showIdentifiers.component.ts b/landingPages/landing-utils/showIdentifiers.component.ts index 19ed1113..7805ab76 100644 --- a/landingPages/landing-utils/showIdentifiers.component.ts +++ b/landingPages/landing-utils/showIdentifiers.component.ts @@ -4,6 +4,8 @@ import {Component, Input, ElementRef} from '@angular/core'; selector: 'showIdentifiers', template: ` + Related identifiers: + View less identifiers diff --git a/landingPages/landing-utils/showTitle.component.ts b/landingPages/landing-utils/showTitle.component.ts index a458aae9..608e4579 100644 --- a/landingPages/landing-utils/showTitle.component.ts +++ b/landingPages/landing-utils/showTitle.component.ts @@ -5,12 +5,9 @@ import {ActivatedRoute} from '@angular/router'; selector: 'showTitle', template: `

- - + @@ -19,7 +16,6 @@ import {ActivatedRoute} from '@angular/router'; href="{{title['url']}}" target="_blank"> [no title available] -

- +

+ +

+

+ [no title available] +

` }) 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'] = ""; - } } ); } diff --git a/landingPages/landing-utils/tabTable.component.ts b/landingPages/landing-utils/tabTable.component.ts index 951cf3c9..e51d0ade 100644 --- a/landingPages/landing-utils/tabTable.component.ts +++ b/landingPages/landing-utils/tabTable.component.ts @@ -49,7 +49,7 @@ import{EnvProperties} from '../../utils/properties/env-properties';

{{item['name']}}

- + ({{item['date']}}) diff --git a/landingPages/organization/organization.component.html b/landingPages/organization/organization.component.html index 393369e8..b59f530d 100644 --- a/landingPages/organization/organization.component.html +++ b/landingPages/organization/organization.component.html @@ -43,7 +43,7 @@
  • - Projetcs + Projects {{fetchProjects.searchUtils.totalResultsNoFilters | number}} diff --git a/landingPages/organization/organization.component.ts b/landingPages/organization/organization.component.ts index 9d15c055..9103d949 100644 --- a/landingPages/organization/organization.component.ts +++ b/landingPages/organization/organization.component.ts @@ -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) { diff --git a/landingPages/project/project.component.ts b/landingPages/project/project.component.ts index cff38756..901899da 100644 --- a/landingPages/project/project.component.ts +++ b/landingPages/project/project.component.ts @@ -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 =>{ diff --git a/landingPages/publication/publication.component.html b/landingPages/publication/publication.component.html index 63b323af..db3a0bd6 100644 --- a/landingPages/publication/publication.component.html +++ b/landingPages/publication/publication.component.html @@ -10,10 +10,12 @@
    - - {{publicationInfo.types.join(", ")}} - {{publicationInfo.languages.join(", ")}} - {{publicationInfo.title.accessMode}} + + {{publicationInfo.types.join(", ")}} + {{publicationInfo.languages.join(", ")}} + {{publicationInfo.countries.join(", ")}} + + {{publicationInfo.accessMode}} { 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')) { diff --git a/landingPages/publication/publication.service.ts b/landingPages/publication/publication.service.ts index 725308b0..d2ae86ee 100644 --- a/landingPages/publication/publication.service.ts +++ b/landingPages/publication/publication.service.ts @@ -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, Map] = 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]); diff --git a/landingPages/software/software.component.html b/landingPages/software/software.component.html index 14c8e629..79cac480 100644 --- a/landingPages/software/software.component.html +++ b/landingPages/software/software.component.html @@ -11,10 +11,13 @@
    - - {{softwareInfo.types.join(", ")}} + + {{softwareInfo.types.join(", ")}} + {{softwareInfo.programmingLanguages.join(", ")}} {{softwareInfo.languages.join(", ")}} - {{softwareInfo.title.accessMode}} + {{softwareInfo.countries.join(", ")}} + + {{softwareInfo.accessMode}} diff --git a/landingPages/software/software.component.ts b/landingPages/software/software.component.ts index d2ef8c80..a872c057 100644 --- a/landingPages/software/software.component.ts +++ b/landingPages/software/software.component.ts @@ -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) { diff --git a/landingPages/software/software.service.ts b/landingPages/software/software.service.ts index 14d66270..f73bc27c 100644 --- a/landingPages/software/software.service.ts +++ b/landingPages/software/software.service.ts @@ -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; diff --git a/searchPages/searchUtils/searchResult.component.html b/searchPages/searchUtils/searchResult.component.html index d9d3e777..267cffac 100644 --- a/searchPages/searchUtils/searchResult.component.html +++ b/searchPages/searchUtils/searchResult.component.html @@ -15,7 +15,9 @@ {{result.types.join(", ")}} + {{result.programmingLanguages.join(", ")}} {{result.languages.join(", ")}} + {{result.countriesForResults.join(", ")}} {{result.title.accessMode}}