diff --git a/landingPages/htmlProjectReport/htmlProjectReport.service.ts b/landingPages/htmlProjectReport/htmlProjectReport.service.ts index 5f5f2d6f..f63a3477 100644 --- a/landingPages/htmlProjectReport/htmlProjectReport.service.ts +++ b/landingPages/htmlProjectReport/htmlProjectReport.service.ts @@ -27,7 +27,7 @@ export class HtmlProjectReportService { } let url = csvAPIURL; - url += '?format=html&type='+requestType+'&fq=(((oaftype exact result) and (resulttypeid exact '+resultTypeId+')) and (relprojectid exact "'+id+'"))'; + url += '?format=html&type='+requestType+'&fq=(((oaftype exact result) and (resulttypeid exact "'+resultTypeId+'")) and (relprojectid exact "'+id+'"))'; let key = url; diff --git a/landingPages/landing-utils/searchingProjectsInTab.component.ts b/landingPages/landing-utils/searchingProjectsInTab.component.ts index 5ec282cf..88704b94 100644 --- a/landingPages/landing-utils/searchingProjectsInTab.component.ts +++ b/landingPages/landing-utils/searchingProjectsInTab.component.ts @@ -69,7 +69,7 @@ export class SearchingProjectsTabComponent { ngOnInit() { if(this.organizationId) { - this.linkToSearchProjects = this.properties.searchLinkToAdvancedPublications;//+"?organization="+this.organizationId+"or=and";; + this.linkToSearchProjects = this.properties.searchLinkToAdvancedProjects;//+"?organization="+this.organizationId+"or=and";; if(this.fetchProjects.searchUtils.totalResults > 0) { this.search(false,""); } diff --git a/landingPages/organization/organization.component.html b/landingPages/organization/organization.component.html index ffa42980..e37330e8 100644 --- a/landingPages/organization/organization.component.html +++ b/landingPages/organization/organization.component.html @@ -143,7 +143,7 @@ - + Publications of organization (CSV) - based on the affiliation information. diff --git a/landingPages/organization/organization.component.ts b/landingPages/organization/organization.component.ts index 070d7013..9a6665af 100644 --- a/landingPages/organization/organization.component.ts +++ b/landingPages/organization/organization.component.ts @@ -48,6 +48,7 @@ export class OrganizationComponent { public csvProjectParamsHead: string; public csvPublicationParamsHead: string; public csvParamsTail: string; + public csvAffiliatedPublications: string; // Active tab variable for responsiveness public activeTab: string = "Publications"; @@ -150,6 +151,7 @@ export class OrganizationComponent { }); this.downloadURLAPI =this.properties.csvAPIURL; + this.csvAffiliatedPublications = this.downloadURLAPI+"?format=csv&type=publications&fq=(((oaftype exact result) and (resulttypeid exact publication)) and (relorganizationid exact \""+this.organizationId+"\"))"; this.csvProjectParamsHead = 'format=csv&type=projects&fq=( (oaftype exact project)and (funder exact "'; //this.csvPublicationParamsHead = 'format=csv-special&type=publications&page=0&query=((((oaftype exact result) and (resulttypeid exact publication)) and (funderid exact '; } @@ -376,10 +378,10 @@ export class OrganizationComponent { let url: string; if(!title) { //url = this.downloadURLAPI+"projects/"+projects[index].id+"?type=publications&format=csv-special";//&size="+data; - url = this.downloadURLAPI+"?format=csv-special&type=publications&fq=(((oaftype exact result) and (resulttypeid exact publication)) and (relprojectid exact '"+projects[index].id+"'))" + url = this.downloadURLAPI+"?format=csv-special&type=publications&fq=(((oaftype exact result) and (resulttypeid exact publication)) and (relprojectid exact \""+projects[index].id+"\"))" } else { //url = this.downloadURLAPI+"projects/"+projects[index].id+"/publications?format=csv-special-notitle";//&size="+data; - url = this.downloadURLAPI+"?format=csv-special-notitle&type=publications&fq=(((oaftype exact result) and (resulttypeid exact publication)) and (relprojectid exact '"+projects[index].id+"'))" + url = this.downloadURLAPI+"?format=csv-special-notitle&type=publications&fq=(((oaftype exact result) and (resulttypeid exact publication)) and (relprojectid exact \""+projects[index].id+"\"))" } if(data == 0 && (counter > 1 || title)) { // if no publications for this project diff --git a/landingPages/project/project.component.ts b/landingPages/project/project.component.ts index 56c9fdec..a0f69f04 100644 --- a/landingPages/project/project.component.ts +++ b/landingPages/project/project.component.ts @@ -156,10 +156,10 @@ properties:EnvProperties; this.downloadURLAPI = this.properties.csvAPIURL; this.createClipboard(); - this.csvParams = "?format=csv-special&type=publications&fq=(((oaftype exact result) and (resulttypeid exact publication)) and (relprojectid exact "+this.projectId+"))"; - this.csvParamsDatasets = "?format=csv-special&type=datasets&fq=(((oaftype exact result) and (resulttypeid exact dataset)) and (relprojectid exact "+this.projectId+"))"; - this.csvParamsSoftware = "?format=csv-special&type=software&fq=(((oaftype exact result) and (resulttypeid exact software)) and (relprojectid exact "+this.projectId+"))"; - this.csvParamsOrps = "?format=csv-special&type=other&fq=(((oaftype exact result) and (resulttypeid exact other)) and (relprojectid exact "+this.projectId+"))"; + this.csvParams = "?format=csv-special&type=publications&fq=(((oaftype exact result) and (resulttypeid exact publication)) and (relprojectid exact \""+this.projectId+"\"))"; + this.csvParamsDatasets = "?format=csv-special&type=datasets&fq=(((oaftype exact result) and (resulttypeid exact dataset)) and (relprojectid exact \""+this.projectId+"\"))"; + this.csvParamsSoftware = "?format=csv-special&type=software&fq=(((oaftype exact result) and (resulttypeid exact software)) and (relprojectid exact \""+this.projectId+"\"))"; + this.csvParamsOrps = "?format=csv-special&type=other&fq=(((oaftype exact result) and (resulttypeid exact other)) and (relprojectid exact \""+this.projectId+"\"))"; if (typeof document !== 'undefined') { this.element.nativeElement.scrollIntoView(); diff --git a/services/searchDataproviders.service.ts b/services/searchDataproviders.service.ts index b564fbe2..992c7578 100644 --- a/services/searchDataproviders.service.ts +++ b/services/searchDataproviders.service.ts @@ -150,7 +150,7 @@ export class SearchDataprovidersService { //compatibilities = " and (datasourcecompatibilityid <> UNKNOWN) and (datasourcecompatibilityid <> openaire2.0_data)" compatibilities = " and (datasourcecompatibilityid <> openaire2.0_data)"; } - let url = link+"?query=(((deletedbyinference = false) AND (oaftype exact datasource)) "+((compatibilities && compatibilities.length > 0)?" "+compatibilities+" ":"")+") and (relorganizationid exact "+id+")"; + let url = link+"?query=(((deletedbyinference = false) AND (oaftype exact datasource)) "+((compatibilities && compatibilities.length > 0)?" "+compatibilities+" ":"")+") and (relorganizationid exact \""+id+"\")"; url += "&page="+(page-1)+"&size="+size+"&format=json"; diff --git a/services/searchDatasets.service.ts b/services/searchDatasets.service.ts index d03d0b60..15c72287 100644 --- a/services/searchDatasets.service.ts +++ b/services/searchDatasets.service.ts @@ -6,7 +6,7 @@ import {RefineResultsUtils} from './servicesUtils/refineResults.class'; import 'rxjs/add/observable/of'; import 'rxjs/add/operator/do'; import 'rxjs/add/operator/share'; -import {StringUtils} from '../utils/string-utils.class'; +import {DOI, StringUtils} from '../utils/string-utils.class'; import { ParsingFunctions } from '../landingPages/landing-utils/parsingFunctions.class'; import{EnvProperties} from '../utils/properties/env-properties'; @@ -361,9 +361,23 @@ export class SearchDatasetsService { numOfSearchDatasets(params: string, properties:EnvProperties, refineParams:string=null):any { let url = properties.searchAPIURLLAst+"datasets/count?format=json"; - if(params != "") { - url += "&q=" + StringUtils.URIEncode(params); + + if(params.length > 0){ + var DOIs:string[] = DOI.getDOIsFromString(params); + var doisParams = ""; + + for(var i =0 ;i < DOIs.length; i++){ + doisParams+=(doisParams.length > 0?"&":"")+'doi="'+ DOIs[i]+'"'; + } + if(doisParams.length > 0){ + url += "&"+doisParams; + }else{ + url += "&q=" + StringUtils.URIEncode(params); + } } + // if(params != "") { + // url += "&q=" + StringUtils.URIEncode(params); + // } if(refineParams!= null && refineParams != '' ) { url += refineParams; } diff --git a/services/searchOrps.service.ts b/services/searchOrps.service.ts index a9b8ca98..bff49d75 100644 --- a/services/searchOrps.service.ts +++ b/services/searchOrps.service.ts @@ -6,7 +6,7 @@ import {RefineResultsUtils} from './servicesUtils/refineResults.class'; import 'rxjs/add/observable/of'; import 'rxjs/add/operator/do'; import 'rxjs/add/operator/share'; -import {StringUtils} from '../utils/string-utils.class'; +import {DOI, StringUtils} from '../utils/string-utils.class'; import { ParsingFunctions } from '../landingPages/landing-utils/parsingFunctions.class'; import{EnvProperties} from '../utils/properties/env-properties'; @@ -36,6 +36,7 @@ export class SearchOrpsService { return this.http.get((properties.useCache)? (properties.cacheUrl+encodeURIComponent(url)): url) .map(res => res.json()) + //.do(res => console.info(res)) .map(res => [res['meta'].total, this.parseResults(res['results']),RefineResultsUtils.parse(res['refineResults'],refineFields, "other")]); } searchOrpById (id: string , properties:EnvProperties):any { @@ -88,6 +89,8 @@ export class SearchOrpsService { return this.http.get((properties.useCache)? (properties.cacheUrl+encodeURIComponent(url)): url) .map(res => res.json()) + //.do(res => console.info(res)) + .map(res => [res['meta'].total, this.parseResults(res['results']),RefineResultsUtils.parse(res['refineResults'],refineFields, "other")]); } advancedSearchOrps (params: string, page: number, size: number, sortBy: string, properties:EnvProperties ):any { @@ -111,6 +114,7 @@ export class SearchOrpsService { return this.http.get((properties.useCache)? (properties.cacheUrl+encodeURIComponent(url)): url) .map(res => res.json()) + //.do(res => console.info(res)) .map(res => [res['meta'].total, this.parseResults(res['results'])]); } searchOrpsForEntity (params: string, page: number, size: number, properties:EnvProperties):any { @@ -362,9 +366,22 @@ export class SearchOrpsService { numOfSearchOrps(params: string, properties:EnvProperties, refineParams:string=null):any { let url = properties.searchAPIURLLAst+"other/count?format=json"; - if(params != "") { - url += "&q=" + StringUtils.URIEncode(params); + if(params.length > 0){ + var DOIs:string[] = DOI.getDOIsFromString(params); + var doisParams = ""; + + for(var i =0 ;i < DOIs.length; i++){ + doisParams+=(doisParams.length > 0?"&":"")+'doi="'+ DOIs[i]+'"'; + } + if(doisParams.length > 0){ + url += "&"+doisParams; + }else{ + url += "&q=" + StringUtils.URIEncode(params); + } } + // if(params != "") { + // url += "&q=" + StringUtils.URIEncode(params); + // } if(refineParams!= null && refineParams != '' ) { url += refineParams; } diff --git a/services/searchPublications.service.ts b/services/searchPublications.service.ts index 8a6dc096..a4f2d3a7 100644 --- a/services/searchPublications.service.ts +++ b/services/searchPublications.service.ts @@ -7,7 +7,7 @@ import 'rxjs/add/operator/share'; import {SearchResult} from '../utils/entities/searchResult'; import {RefineResultsUtils} from './servicesUtils/refineResults.class'; -import {StringUtils} from '../utils/string-utils.class'; +import {DOI, StringUtils} from '../utils/string-utils.class'; import { ParsingFunctions } from '../landingPages/landing-utils/parsingFunctions.class'; import{EnvProperties} from '../utils/properties/env-properties'; @@ -37,6 +37,7 @@ export class SearchPublicationsService { return this.http.get((properties.useCache)? (properties.cacheUrl+encodeURIComponent(url)): url) .map(res => res.json()) + // .do(res => console.info(res)) .map(res => [res['meta'].total, this.parseResults(res['results']),RefineResultsUtils.parse(res['refineResults'],refineFields, "publication")]); } searchPublicationById (id: string, properties:EnvProperties ):any { @@ -89,6 +90,7 @@ export class SearchPublicationsService { return this.http.get((properties.useCache)? (properties.cacheUrl+encodeURIComponent(url)): url) .map(res => res.json()) + //.do(res => console.info(res)) .map(res => [res['meta'].total, this.parseResults(res['results']),RefineResultsUtils.parse(res['refineResults'],refineFields, "publication")]); } @@ -112,6 +114,8 @@ export class SearchPublicationsService { return this.http.get((properties.useCache)? (properties.cacheUrl+encodeURIComponent(url)): url) .map(res => res.json()) + //.do(res => console.info(res)) + .map(res => [res['meta'].total, this.parseResults(res['results'])]); } searchPublicationsForEntity (params: string, page: number, size: number, properties:EnvProperties):any { @@ -471,9 +475,22 @@ export class SearchPublicationsService { numOfSearchPublications(params: string, properties:EnvProperties, refineParams:string=null):any { let url = properties.searchAPIURLLAst+"publications/count?format=json"; - if(params != "") { - url += "&q=" + StringUtils.URIEncode(params); + if(params.length > 0){ + var DOIs:string[] = DOI.getDOIsFromString(params); + var doisParams = ""; + + for(var i =0 ;i < DOIs.length; i++){ + doisParams+=(doisParams.length > 0?"&":"")+'doi="'+ DOIs[i]+'"'; + } + if(doisParams.length > 0){ + url += "&"+doisParams; + }else{ + url += "&q=" + StringUtils.URIEncode(params); + } } + // if(params != "") { + // url += "&q=" + StringUtils.URIEncode(params); + // } if(refineParams!= null && refineParams != '' ) { url += refineParams; } diff --git a/services/searchSoftware.service.ts b/services/searchSoftware.service.ts index 979018f3..ab27608c 100644 --- a/services/searchSoftware.service.ts +++ b/services/searchSoftware.service.ts @@ -8,7 +8,7 @@ import 'rxjs/add/operator/do'; import 'rxjs/add/operator/share'; import { ParsingFunctions } from '../landingPages/landing-utils/parsingFunctions.class'; import{EnvProperties} from '../utils/properties/env-properties'; -import {StringUtils} from '../utils/string-utils.class'; +import {DOI, StringUtils} from '../utils/string-utils.class'; @Injectable() export class SearchSoftwareService { private sizeOfDescription: number = 270; @@ -35,6 +35,7 @@ export class SearchSoftwareService { return this.http.get((properties.useCache)? (properties.cacheUrl+encodeURIComponent(url)): url) .map(res => res.json()) + //.do(res => console.info(res)) .map(res => [res['meta'].total, this.parseResults(res['results']),RefineResultsUtils.parse(res['refineResults'],refineFields, "software")]); } searchSoftwareById (id: string, properties:EnvProperties ):any { @@ -86,6 +87,7 @@ export class SearchSoftwareService { return this.http.get((properties.useCache)? (properties.cacheUrl+encodeURIComponent(url)): url) .map(res => res.json()) + //.do(res => console.info(res)) .map(res => [res['meta'].total, this.parseResults(res['results']),RefineResultsUtils.parse(res['refineResults'],refineFields, "software")]); } advancedSearchSoftware (params: string, page: number, size: number, sortBy: string, properties:EnvProperties ):any { @@ -108,6 +110,7 @@ export class SearchSoftwareService { return this.http.get((properties.useCache)? (properties.cacheUrl+encodeURIComponent(url)): url) .map(res => res.json()) + //.do(res => console.info(res)) .map(res => [res['meta'].total, this.parseResults(res['results'])]); } searchSoftwareForEntity (params: string, page: number, size: number, properties:EnvProperties):any { @@ -369,9 +372,23 @@ export class SearchSoftwareService { numOfSearchSoftware(params: string, properties:EnvProperties, refineParams:string=null):any { let url = properties.searchAPIURLLAst+"software/count?format=json"; - if(params != "") { - url += "&q=" + StringUtils.URIEncode(params); + + if(params.length > 0){ + var DOIs:string[] = DOI.getDOIsFromString(params); + var doisParams = ""; + + for(var i =0 ;i < DOIs.length; i++){ + doisParams+=(doisParams.length > 0?"&":"")+'doi="'+ DOIs[i]+'"'; + } + if(doisParams.length > 0){ + url += "&"+doisParams; + }else{ + url += "&q=" + StringUtils.URIEncode(params); + } } + // if(params != "") { + // url += "&q=" + StringUtils.URIEncode(params); + // } if(refineParams!= null && refineParams != '' ) { url += refineParams; }