[Trunk|Library]:

1. #4256: Organization Landing Page: Bug fix in request of "Project Publications CSV file" - use double quots instead of single.
2. Organization Landing Page: Projects section: Bug fix in "View all" link - link to projects advanced search page instead of publications.
3. htmlProjectReport.service & organization.component & project.component & 
   searchDataproviders.service & searchDatasets.service & searchOrps.service & searchPublications.service & searchSoftware.service:
	Add double quots in requests with "exact" matching.



git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-services-library/trunk/ng-openaire-library/src/app@55158 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
konstantina.galouni 2019-04-02 15:33:01 +00:00
parent 8a57af2865
commit 0095d9c832
10 changed files with 89 additions and 22 deletions

View File

@ -27,7 +27,7 @@ export class HtmlProjectReportService {
} }
let url = csvAPIURL; 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; let key = url;

View File

@ -69,7 +69,7 @@ export class SearchingProjectsTabComponent {
ngOnInit() { ngOnInit() {
if(this.organizationId) { 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) { if(this.fetchProjects.searchUtils.totalResults > 0) {
this.search(false,""); this.search(false,"");
} }

View File

@ -143,7 +143,7 @@
<!-- 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+"'))"-->
<!-- <a class="clickable" (click)="downloadFile(downloadURLAPI+'/organizations/'+organizationId+'?type=publications&format=csv')"> --> <!-- <a class="clickable" (click)="downloadFile(downloadURLAPI+'/organizations/'+organizationId+'?type=publications&format=csv')"> -->
<a class="clickable" (click)="downloadFile(downloadURLAPI+'?format=csv&type=publications&fq=(((oaftype exact result) and (resulttypeid exact publication)) and (relorganizationid exact '+organizationId+'))', 'organization-publications-report')"> <a class="clickable" (click)="downloadFile(csvAffiliatedPublications, 'organization-publications-report')">
<span class="uk-icon"><svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" icon="download" ratio="1"><polyline fill="none" stroke="#000" points="14,10 9.5,14.5 5,10"></polyline><rect x="3" y="17" width="13" height="1"></rect><line fill="none" stroke="#000" x1="9.5" y1="13.91" x2="9.5" y2="3"></line></svg></span> <span class="uk-icon"><svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" icon="download" ratio="1"><polyline fill="none" stroke="#000" points="14,10 9.5,14.5 5,10"></polyline><rect x="3" y="17" width="13" height="1"></rect><line fill="none" stroke="#000" x1="9.5" y1="13.91" x2="9.5" y2="3"></line></svg></span>
<span class="uk-icon-download"> Publications of organization (CSV) - based on the affiliation information.</span> <span class="uk-icon-download"> Publications of organization (CSV) - based on the affiliation information.</span>
</a> </a>

View File

@ -48,6 +48,7 @@ export class OrganizationComponent {
public csvProjectParamsHead: string; public csvProjectParamsHead: string;
public csvPublicationParamsHead: string; public csvPublicationParamsHead: string;
public csvParamsTail: string; public csvParamsTail: string;
public csvAffiliatedPublications: string;
// Active tab variable for responsiveness // Active tab variable for responsiveness
public activeTab: string = "Publications"; public activeTab: string = "Publications";
@ -150,6 +151,7 @@ export class OrganizationComponent {
}); });
this.downloadURLAPI =this.properties.csvAPIURL; 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.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 '; //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; let url: string;
if(!title) { if(!title) {
//url = this.downloadURLAPI+"projects/"+projects[index].id+"?type=publications&format=csv-special";//&size="+data; //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 { } else {
//url = this.downloadURLAPI+"projects/"+projects[index].id+"/publications?format=csv-special-notitle";//&size="+data; //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 if(data == 0 && (counter > 1 || title)) { // if no publications for this project

View File

@ -156,10 +156,10 @@ properties:EnvProperties;
this.downloadURLAPI = this.properties.csvAPIURL; this.downloadURLAPI = this.properties.csvAPIURL;
this.createClipboard(); this.createClipboard();
this.csvParams = "?format=csv-special&type=publications&fq=(((oaftype exact result) and (resulttypeid exact publication)) 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.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.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.csvParamsOrps = "?format=csv-special&type=other&fq=(((oaftype exact result) and (resulttypeid exact other)) and (relprojectid exact \""+this.projectId+"\"))";
if (typeof document !== 'undefined') { if (typeof document !== 'undefined') {
this.element.nativeElement.scrollIntoView(); this.element.nativeElement.scrollIntoView();

View File

@ -150,7 +150,7 @@ export class SearchDataprovidersService {
//compatibilities = " and (datasourcecompatibilityid <> UNKNOWN) and (datasourcecompatibilityid <> openaire2.0_data)" //compatibilities = " and (datasourcecompatibilityid <> UNKNOWN) and (datasourcecompatibilityid <> openaire2.0_data)"
compatibilities = " 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"; url += "&page="+(page-1)+"&size="+size+"&format=json";

View File

@ -6,7 +6,7 @@ import {RefineResultsUtils} from './servicesUtils/refineResults.class';
import 'rxjs/add/observable/of'; import 'rxjs/add/observable/of';
import 'rxjs/add/operator/do'; import 'rxjs/add/operator/do';
import 'rxjs/add/operator/share'; 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 { ParsingFunctions } from '../landingPages/landing-utils/parsingFunctions.class';
import{EnvProperties} from '../utils/properties/env-properties'; import{EnvProperties} from '../utils/properties/env-properties';
@ -361,9 +361,23 @@ export class SearchDatasetsService {
numOfSearchDatasets(params: string, properties:EnvProperties, refineParams:string=null):any { numOfSearchDatasets(params: string, properties:EnvProperties, refineParams:string=null):any {
let url = properties.searchAPIURLLAst+"datasets/count?format=json"; 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 != '' ) { if(refineParams!= null && refineParams != '' ) {
url += refineParams; url += refineParams;
} }

View File

@ -6,7 +6,7 @@ import {RefineResultsUtils} from './servicesUtils/refineResults.class';
import 'rxjs/add/observable/of'; import 'rxjs/add/observable/of';
import 'rxjs/add/operator/do'; import 'rxjs/add/operator/do';
import 'rxjs/add/operator/share'; 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 { ParsingFunctions } from '../landingPages/landing-utils/parsingFunctions.class';
import{EnvProperties} from '../utils/properties/env-properties'; 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) return this.http.get((properties.useCache)? (properties.cacheUrl+encodeURIComponent(url)): url)
.map(res => <any> res.json()) .map(res => <any> res.json())
//.do(res => console.info(res))
.map(res => [res['meta'].total, this.parseResults(res['results']),RefineResultsUtils.parse(res['refineResults'],refineFields, "other")]); .map(res => [res['meta'].total, this.parseResults(res['results']),RefineResultsUtils.parse(res['refineResults'],refineFields, "other")]);
} }
searchOrpById (id: string , properties:EnvProperties):any { searchOrpById (id: string , properties:EnvProperties):any {
@ -88,6 +89,8 @@ export class SearchOrpsService {
return this.http.get((properties.useCache)? (properties.cacheUrl+encodeURIComponent(url)): url) return this.http.get((properties.useCache)? (properties.cacheUrl+encodeURIComponent(url)): url)
.map(res => <any> res.json()) .map(res => <any> res.json())
//.do(res => console.info(res))
.map(res => [res['meta'].total, this.parseResults(res['results']),RefineResultsUtils.parse(res['refineResults'],refineFields, "other")]); .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 { 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) return this.http.get((properties.useCache)? (properties.cacheUrl+encodeURIComponent(url)): url)
.map(res => <any> res.json()) .map(res => <any> res.json())
//.do(res => console.info(res))
.map(res => [res['meta'].total, this.parseResults(res['results'])]); .map(res => [res['meta'].total, this.parseResults(res['results'])]);
} }
searchOrpsForEntity (params: string, page: number, size: number, properties:EnvProperties):any { 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 { numOfSearchOrps(params: string, properties:EnvProperties, refineParams:string=null):any {
let url = properties.searchAPIURLLAst+"other/count?format=json"; let url = properties.searchAPIURLLAst+"other/count?format=json";
if(params != "") { if(params.length > 0){
url += "&q=" + StringUtils.URIEncode(params); 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 != '' ) { if(refineParams!= null && refineParams != '' ) {
url += refineParams; url += refineParams;
} }

View File

@ -7,7 +7,7 @@ import 'rxjs/add/operator/share';
import {SearchResult} from '../utils/entities/searchResult'; import {SearchResult} from '../utils/entities/searchResult';
import {RefineResultsUtils} from './servicesUtils/refineResults.class'; 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 { ParsingFunctions } from '../landingPages/landing-utils/parsingFunctions.class';
import{EnvProperties} from '../utils/properties/env-properties'; 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) return this.http.get((properties.useCache)? (properties.cacheUrl+encodeURIComponent(url)): url)
.map(res => <any> res.json()) .map(res => <any> res.json())
// .do(res => console.info(res))
.map(res => [res['meta'].total, this.parseResults(res['results']),RefineResultsUtils.parse(res['refineResults'],refineFields, "publication")]); .map(res => [res['meta'].total, this.parseResults(res['results']),RefineResultsUtils.parse(res['refineResults'],refineFields, "publication")]);
} }
searchPublicationById (id: string, properties:EnvProperties ):any { searchPublicationById (id: string, properties:EnvProperties ):any {
@ -89,6 +90,7 @@ export class SearchPublicationsService {
return this.http.get((properties.useCache)? (properties.cacheUrl+encodeURIComponent(url)): url) return this.http.get((properties.useCache)? (properties.cacheUrl+encodeURIComponent(url)): url)
.map(res => <any> res.json()) .map(res => <any> res.json())
//.do(res => console.info(res))
.map(res => [res['meta'].total, this.parseResults(res['results']),RefineResultsUtils.parse(res['refineResults'],refineFields, "publication")]); .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) return this.http.get((properties.useCache)? (properties.cacheUrl+encodeURIComponent(url)): url)
.map(res => <any> res.json()) .map(res => <any> res.json())
//.do(res => console.info(res))
.map(res => [res['meta'].total, this.parseResults(res['results'])]); .map(res => [res['meta'].total, this.parseResults(res['results'])]);
} }
searchPublicationsForEntity (params: string, page: number, size: number, properties:EnvProperties):any { 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 { numOfSearchPublications(params: string, properties:EnvProperties, refineParams:string=null):any {
let url = properties.searchAPIURLLAst+"publications/count?format=json"; let url = properties.searchAPIURLLAst+"publications/count?format=json";
if(params != "") { if(params.length > 0){
url += "&q=" + StringUtils.URIEncode(params); 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 != '' ) { if(refineParams!= null && refineParams != '' ) {
url += refineParams; url += refineParams;
} }

View File

@ -8,7 +8,7 @@ import 'rxjs/add/operator/do';
import 'rxjs/add/operator/share'; import 'rxjs/add/operator/share';
import { ParsingFunctions } from '../landingPages/landing-utils/parsingFunctions.class'; import { ParsingFunctions } from '../landingPages/landing-utils/parsingFunctions.class';
import{EnvProperties} from '../utils/properties/env-properties'; import{EnvProperties} from '../utils/properties/env-properties';
import {StringUtils} from '../utils/string-utils.class'; import {DOI, StringUtils} from '../utils/string-utils.class';
@Injectable() @Injectable()
export class SearchSoftwareService { export class SearchSoftwareService {
private sizeOfDescription: number = 270; private sizeOfDescription: number = 270;
@ -35,6 +35,7 @@ export class SearchSoftwareService {
return this.http.get((properties.useCache)? (properties.cacheUrl+encodeURIComponent(url)): url) return this.http.get((properties.useCache)? (properties.cacheUrl+encodeURIComponent(url)): url)
.map(res => <any> res.json()) .map(res => <any> res.json())
//.do(res => console.info(res))
.map(res => [res['meta'].total, this.parseResults(res['results']),RefineResultsUtils.parse(res['refineResults'],refineFields, "software")]); .map(res => [res['meta'].total, this.parseResults(res['results']),RefineResultsUtils.parse(res['refineResults'],refineFields, "software")]);
} }
searchSoftwareById (id: string, properties:EnvProperties ):any { searchSoftwareById (id: string, properties:EnvProperties ):any {
@ -86,6 +87,7 @@ export class SearchSoftwareService {
return this.http.get((properties.useCache)? (properties.cacheUrl+encodeURIComponent(url)): url) return this.http.get((properties.useCache)? (properties.cacheUrl+encodeURIComponent(url)): url)
.map(res => <any> res.json()) .map(res => <any> res.json())
//.do(res => console.info(res))
.map(res => [res['meta'].total, this.parseResults(res['results']),RefineResultsUtils.parse(res['refineResults'],refineFields, "software")]); .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 { 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) return this.http.get((properties.useCache)? (properties.cacheUrl+encodeURIComponent(url)): url)
.map(res => <any> res.json()) .map(res => <any> res.json())
//.do(res => console.info(res))
.map(res => [res['meta'].total, this.parseResults(res['results'])]); .map(res => [res['meta'].total, this.parseResults(res['results'])]);
} }
searchSoftwareForEntity (params: string, page: number, size: number, properties:EnvProperties):any { 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 { numOfSearchSoftware(params: string, properties:EnvProperties, refineParams:string=null):any {
let url = properties.searchAPIURLLAst+"software/count?format=json"; 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 != '' ) { if(refineParams!= null && refineParams != '' ) {
url += refineParams; url += refineParams;
} }