From 478b2c87140803f4f09aefd08d06b7ec68c899ab Mon Sep 17 00:00:00 2001 From: "argiro.kokogiannaki" Date: Wed, 30 Nov 2016 10:57:38 +0000 Subject: [PATCH] In Search pubs/ data add Project filter | in creation of search query use quotes for fq values | in project LP add link to search page of pubs/data filtered by project git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-services-portal/trunk@44738 d315682c-612b-4755-9ff5-7f18f6832af3 --- .../app/landingPages/project/project.component.ts | 4 ++-- .../publication/publication.component.ts | 4 ++-- .../searchUtils/searchPage.component.ts | 3 +-- portal-2/src/app/utils/properties/searchFields.ts | 14 ++++++++------ 4 files changed, 13 insertions(+), 12 deletions(-) diff --git a/portal-2/src/app/landingPages/project/project.component.ts b/portal-2/src/app/landingPages/project/project.component.ts index 31c8755a..7d2b9031 100644 --- a/portal-2/src/app/landingPages/project/project.component.ts +++ b/portal-2/src/app/landingPages/project/project.component.ts @@ -90,12 +90,12 @@ export class ProjectComponent{ private searchPublications() { this.searchPublicationsComponent.getResultsForEntity("project", this.projectId, 1, 10); - this.linkToSearchPublications = OpenaireProperties.getLinkToSearchPublications(); + this.linkToSearchPublications = OpenaireProperties.getLinkToSearchPublications() + "?relprojectid=" + this.projectId; } private searchDatasets() { this.searchDatasetsComponent.getResultsForEntity("project", this.projectId, 1, 10); - this.linkToSearchDatasets = OpenaireProperties.getLinkToSearchDatasets(); + this.linkToSearchDatasets = OpenaireProperties.getLinkToSearchDatasets() + "?relprojectid=" + this.projectId;; } private searchDatasetsInit() { diff --git a/portal-2/src/app/landingPages/publication/publication.component.ts b/portal-2/src/app/landingPages/publication/publication.component.ts index 15157d5c..4087ac59 100644 --- a/portal-2/src/app/landingPages/publication/publication.component.ts +++ b/portal-2/src/app/landingPages/publication/publication.component.ts @@ -77,8 +77,8 @@ export class PublicationComponent { this._publicationService.getPublicationInfo(this.articleId).subscribe( data => { this.publicationInfo = data; - this.result = [] - this.result = {id: id, type :"dataset", source : "openaire", title: this.publicationInfo.title,url: '', result: '', accessRights: this.publicationInfo.bestlicense, embargoEndDate: ''}; + // this.result = [] + // this.result = {id: id, type :"dataset", source : "openaire", title: this.publicationInfo.title,url: '', result: '', accessRights: this.publicationInfo.bestlicense, embargoEndDate: ''}; let bioentitiesNum = 0; if(this.publicationInfo.bioentities != undefined) { diff --git a/portal-2/src/app/searchPages/searchUtils/searchPage.component.ts b/portal-2/src/app/searchPages/searchUtils/searchPage.component.ts index f4f3e167..61965f18 100644 --- a/portal-2/src/app/searchPages/searchUtils/searchPage.component.ts +++ b/portal-2/src/app/searchPages/searchUtils/searchPage.component.ts @@ -414,8 +414,7 @@ export class SearchPageComponent { return "&refine=true"+fieldsStr; } private quote(params: string):string { - // return encodeURIComponent('"'+params+'"'); - return encodeURIComponent(''+params+''); + return encodeURIComponent('"'+params+'"'); } } diff --git a/portal-2/src/app/utils/properties/searchFields.ts b/portal-2/src/app/utils/properties/searchFields.ts index 35a3b073..a031a016 100644 --- a/portal-2/src/app/utils/properties/searchFields.ts +++ b/portal-2/src/app/utils/properties/searchFields.ts @@ -1,13 +1,13 @@ export class SearchFields { //main Entities //PUBLICATIONS - public PUBLICATION_INDEX:string[] = ["instancetypenameid", "resultlanguageid", "communityid", "relfunderid", + public PUBLICATION_INDEX:string[] = ["instancetypenameid", "resultlanguageid", "communityid","relprojectid", "relfunderid", "relfundinglevel0_id","relfundinglevel1_id","relfundinglevel2_id", "resultacceptanceyear","resultbestlicenseid","resulthostingdatasourceid","collectedfromdatasourceid"]; - public ADVANCED_SEARCH_PUBLICATIONS_PARAM:string[] = ["q","title","author","publisher","type", "lang", "funder", "funderlv0", + public ADVANCED_SEARCH_PUBLICATIONS_PARAM:string[] = ["q","title","author","publisher","type", "lang","project", "funder", "funderlv0", "funderlv1","funderlv2","community","access","hostedBy","collectedFrom"]; public PUBLICATION_INDEX_PARAM_MAP:{ [key:string]:string } = {["instancetypenameid"]:"type", ["resultlanguageid"]:"lang",["communityid"]:"community", - [ "relfunderid"]:"funder", + [ "relprojectid"]:"project",[ "relfunderid"]:"funder", ["relfundinglevel0_id"]:"funderlv0",["relfundinglevel1_id"]:"funderlv1",["relfundinglevel2_id"]:"funderlv2", ["resultacceptanceyear"]:"year",["resultbestlicenseid"]:"access",["resulthostingdatasourceid"]:"hostedBy",["collectedfromdatasourceid"]:"collectedFrom"}; public PUBLICATION_FIELDS_MAP: { [key:string]:{ name:string, operator:string, type:string, indexField:string, equalityOperator:string }} ={ @@ -15,6 +15,7 @@ export class SearchFields { ["title"]:{name:"Title",operator:"tt", type:"keyword" , indexField:"resulttitle", equalityOperator: "="}, ["author"]:{name:"Author",operator:"at", type:"keyword", indexField:"relperson", equalityOperator: "="}, ["publisher"]:{name:"Publisher",operator:"pb", type:"keyword", indexField:"resultpublisher", equalityOperator: "="}, + ["project"]:{name:"Project",operator:"po", type:"refine", indexField:"relprojectid", equalityOperator: " exact "}, ["funder"]:{name:"Funder",operator:"fn", type:"refine", indexField:"relfunderid", equalityOperator: " exact "}, ["funderlv0"]:{name:"Funding Stream",operator:"fn0", type:"refine", indexField:"relfundinglevel0_id", equalityOperator: " exact "}, ["funderlv1"]:{name:"Funding Substream Level 1",operator:"fn1", type:"refine", indexField:"relfundinglevel1_id", equalityOperator: " exact "}, @@ -77,13 +78,13 @@ export class SearchFields { //DATASET - public DATASET_INDEX:string[] = ["instancetypenameid", "resultlanguageid", //"communityid", + public DATASET_INDEX:string[] = ["instancetypenameid", "resultlanguageid","relprojectid", //"communityid", "relfunderid", "relfundinglevel0_id","relfundinglevel1_id","relfundinglevel2_id", "resultacceptanceyear","resultbestlicenseid","resulthostingdatasourceid","collectedfromdatasourceid"]; public ADVANCED_SEARCH_DATASET_PARAM:string[] = ["q","title","author","publisher","type", "lang", "funder", "funderlv0", "funderlv1","funderlv2","community","access","hostedBy","collectedFrom"]; public DATASET_INDEX_PARAM_MAP:{ [key:string]:string } = {["instancetypenameid"]:"type", ["resultlanguageid"]:"lang",["communityid"]:"community", - [ "relfunderid"]:"funder", + [ "relprojectid"]:"project", [ "relfunderid"]:"funder", ["relfundinglevel0_id"]:"funderlv0",["relfundinglevel1_id"]:"funderlv1",["relfundinglevel2_id"]:"funderlv2", ["resultacceptanceyear"]:"year",["resultbestlicenseid"]:"access",["resulthostingdatasourceid"]:"hostedBy",["collectedfromdatasourceid"]:"collectedFrom"}; public DATASET_FIELDS_MAP: { [key:string]:{ name:string, operator:string, type:string, indexField:string, equalityOperator:string }} ={ @@ -91,6 +92,7 @@ export class SearchFields { ["title"]:{name:"Title",operator:"tt", type:"keyword" , indexField:"resulttitle", equalityOperator: "="}, ["author"]:{name:"Author",operator:"at", type:"keyword", indexField:"relperson", equalityOperator: "="}, ["publisher"]:{name:"Publisher",operator:"pb", type:"keyword", indexField:"resultpublisher", equalityOperator: "="}, + ["project"]:{name:"Project",operator:"po", type:"refine", indexField:"relprojectid", equalityOperator: " exact "}, ["funder"]:{name:"Funder",operator:"fn", type:"refine", indexField:"relfunderid", equalityOperator: " exact "}, ["funderlv0"]:{name:"Funding Stream",operator:"fn0", type:"refine", indexField:"relfundinglevel0_id", equalityOperator: " exact "}, ["funderlv1"]:{name:"Funding Substream Level 1",operator:"fn1", type:"refine", indexField:"relfundinglevel1_id", equalityOperator: " exact "}, @@ -141,7 +143,7 @@ export class SearchFields { // public PROJECT_PARAM_FIELDS:string[] = ["funder","fl0","fl1", "fl2", "start","end","sc39"]; - public FIELDS_NAMES: { [key:string]:string } = {["funderid"]:"Funder",["fundinglevel0_id"]:"Funding Stream", + public FIELDS_NAMES: { [key:string]:string } = {["relprojectid"]:"Project",["funderid"]:"Funder",["fundinglevel0_id"]:"Funding Stream", ["fundinglevel1_id"]:"Funding Substream Level 1", ["fundinglevel2_id"]:"Funding Substream Level 2", ["relfunderid"]:"Funder", ["relfundinglevel0_id"]:"Funding Stream",["relfundinglevel1_id"]:"Funding Substream Level 1", ["relfundinglevel2_id"]:"Funding Substream Level 2", ["instancetypenameid"]:"Type",["resultlanguageid"]: "Language",["communityid"]: "Context",["resultacceptanceyear"]:"Year",