From b4867133826d2930707de854f8c20732489bfc4a Mon Sep 17 00:00:00 2001 From: "argiro.kokogiannaki" Date: Mon, 6 Mar 2017 17:20:06 +0000 Subject: [PATCH] altmetrics| mail for feedback | remove quotes from keyword queries q= | change doi queries in pubs , data use parameter doi| date range queries for advanced search of pubs, data, projects | change order of filters in pubs, data git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-services-portal/trunk@46163 d315682c-612b-4755-9ff5-7f18f6832af3 --- portal-2/package.json | 1 + .../claim-utils/claimDataset.component.ts | 2 +- .../claim-utils/claimPublication.component.ts | 2 +- .../dataProvider/dataProvider.component.html | 8 +- .../dataProvider/datasetsTab.component.ts | 2 +- .../dataProvider/datasourcesTab.component.ts | 2 +- .../organizationsTab.component.ts | 2 +- .../dataProvider/projectsTab.component.ts | 2 +- .../dataProvider/publicationsTab.component.ts | 2 +- .../relatedDatasourcesTab.component.ts | 2 +- .../dataProvider/statisticsTab.component.ts | 2 +- .../dataProvider/tabs.component.ts | 4 +- .../dataset/dataset.component.html | 16 +-- .../organization/organization.component.html | 12 +- .../landingPages/person/person.component.html | 12 +- .../project/project.component.html | 14 ++- .../publication/publication.component.html | 21 ++-- .../compatibleDataProviders.component.ts | 2 +- .../entityRegistries.component.ts | 2 +- .../app/searchPages/find/search.component.ts | 119 ++++++++++-------- .../advancedSearchForm.component.ts | 34 ++--- .../searchUtils/advancedSearchForm.module.ts | 3 +- .../advancedSearchPage.component.ts | 99 +++++++++------ .../searchUtils/dateFilter.module.ts | 20 +++ .../searchUtils/searchHelperClasses.class.ts | 42 ++++++- .../searchUtils/searchPage.component.ts | 22 ++-- .../searchUtils/searchResult.component.ts | 3 +- .../simple/searchDataproviders.component.ts | 4 +- .../simple/searchDatasets.component.ts | 7 +- .../simple/searchOrganizations.component.ts | 2 +- .../simple/searchPeople.component.ts | 4 +- .../simple/searchProjects.component.ts | 2 +- .../simple/searchPublications.component.ts | 6 +- .../app/services/searchDatasets.service.ts | 7 +- .../services/searchOrganizations.service.ts | 2 +- .../src/app/services/searchPeople.service.ts | 2 +- .../app/services/searchProjects.service.ts | 2 +- .../services/searchPublications.service.ts | 7 +- .../fetchDataproviders.class.ts | 7 +- .../fetchDatasets.class.ts | 6 +- .../fetchOrganizations.class.ts | 2 +- .../fetchEntitiesClasses/fetchPeople.class.ts | 2 +- .../fetchProjects.class.ts | 2 +- .../fetchPublications.class.ts | 6 +- .../src/app/utils/properties/searchFields.ts | 19 +-- portal-2/src/app/utils/routerHelper.class.ts | 5 +- .../app/utils/showDataProviders.component.ts | 2 +- portal-2/src/app/utils/string-utils.class.ts | 36 +++++- portal-2/src/index.html | 8 +- 49 files changed, 388 insertions(+), 204 deletions(-) create mode 100644 portal-2/src/app/searchPages/searchUtils/dateFilter.module.ts diff --git a/portal-2/package.json b/portal-2/package.json index 408753b3..272fe575 100644 --- a/portal-2/package.json +++ b/portal-2/package.json @@ -64,6 +64,7 @@ "js.clone": "0.0.3", "methods": "~1.1.2", "morgan": "^1.7.0", + "mydatepicker": "^1.7.3", "preboot": "~4.5.2", "rxjs": "5.0.0-beta.12", "webfontloader": "^1.6.26", diff --git a/portal-2/src/app/claims/claim-utils/claimDataset.component.ts b/portal-2/src/app/claims/claim-utils/claimDataset.component.ts index 319ee7db..5b472cf5 100644 --- a/portal-2/src/app/claims/claim-utils/claimDataset.component.ts +++ b/portal-2/src/app/claims/claim-utils/claimDataset.component.ts @@ -152,7 +152,7 @@ export class ClaimDatasetComponent { } ); }else{ - this._searchDatasetsService.searchDatasets('q="'+term+'"', null, page, size, []).subscribe( + this._searchDatasetsService.searchDatasets('q='+term+'', null, page, size, []).subscribe( data => { if(data != null) { this.openairePage=page; diff --git a/portal-2/src/app/claims/claim-utils/claimPublication.component.ts b/portal-2/src/app/claims/claim-utils/claimPublication.component.ts index b01b205d..4e7428f4 100644 --- a/portal-2/src/app/claims/claim-utils/claimPublication.component.ts +++ b/portal-2/src/app/claims/claim-utils/claimPublication.component.ts @@ -184,7 +184,7 @@ private getCrossrefResults (term: string, size : number, page : number) { ); }else{ this.openaireStatus = this.errorCodes.LOADING; - this._searchPublicationsService.searchPublications('q="'+term+'"', null, page, size, []).subscribe( + this._searchPublicationsService.searchPublications('q='+term, null, page, size, []).subscribe( data => { if(data != null) { this.openairePage=page; diff --git a/portal-2/src/app/landingPages/dataProvider/dataProvider.component.html b/portal-2/src/app/landingPages/dataProvider/dataProvider.component.html index f0165940..6cca6771 100644 --- a/portal-2/src/app/landingPages/dataProvider/dataProvider.component.html +++ b/portal-2/src/app/landingPages/dataProvider/dataProvider.component.html @@ -47,7 +47,13 @@
diff --git a/portal-2/src/app/landingPages/dataProvider/datasetsTab.component.ts b/portal-2/src/app/landingPages/dataProvider/datasetsTab.component.ts index fc7810a1..4ab93259 100644 --- a/portal-2/src/app/landingPages/dataProvider/datasetsTab.component.ts +++ b/portal-2/src/app/landingPages/dataProvider/datasetsTab.component.ts @@ -13,7 +13,7 @@ import {OpenaireProperties} from '../../utils/properties/openaireProperties';

The results below are discovered through our pilot algorithms. - Let us know how we are doing! + Let us know how we are doing!

diff --git a/portal-2/src/app/landingPages/dataProvider/datasourcesTab.component.ts b/portal-2/src/app/landingPages/dataProvider/datasourcesTab.component.ts index fe9007fe..bb19d0f8 100644 --- a/portal-2/src/app/landingPages/dataProvider/datasourcesTab.component.ts +++ b/portal-2/src/app/landingPages/dataProvider/datasourcesTab.component.ts @@ -13,7 +13,7 @@ import {OpenaireProperties} from '../../utils/properties/openaireProperties';

The results below are discovered through our pilot algorithms. - Let us know how we are doing! + Let us know how we are doing!

diff --git a/portal-2/src/app/landingPages/dataProvider/organizationsTab.component.ts b/portal-2/src/app/landingPages/dataProvider/organizationsTab.component.ts index a5fd2303..fa694004 100644 --- a/portal-2/src/app/landingPages/dataProvider/organizationsTab.component.ts +++ b/portal-2/src/app/landingPages/dataProvider/organizationsTab.component.ts @@ -10,7 +10,7 @@ import {Component, Input} from '@angular/core';

The results below are discovered through our pilot algorithms. - Let us know how we are doing! + Let us know how we are doing!

diff --git a/portal-2/src/app/landingPages/dataProvider/projectsTab.component.ts b/portal-2/src/app/landingPages/dataProvider/projectsTab.component.ts index d113dbb7..8ca4856f 100644 --- a/portal-2/src/app/landingPages/dataProvider/projectsTab.component.ts +++ b/portal-2/src/app/landingPages/dataProvider/projectsTab.component.ts @@ -14,7 +14,7 @@ import {OpenaireProperties} from '../../utils/properties/openaireProperties';

The results below are discovered through our pilot algorithms. - Let us know how we are doing! + Let us know how we are doing!

diff --git a/portal-2/src/app/landingPages/dataProvider/publicationsTab.component.ts b/portal-2/src/app/landingPages/dataProvider/publicationsTab.component.ts index d63c49b4..242364bc 100644 --- a/portal-2/src/app/landingPages/dataProvider/publicationsTab.component.ts +++ b/portal-2/src/app/landingPages/dataProvider/publicationsTab.component.ts @@ -13,7 +13,7 @@ import {OpenaireProperties} from '../../utils/properties/openaireProperties';

The results below are discovered through our pilot algorithms. - Let us know how we are doing! + Let us know how we are doing!

diff --git a/portal-2/src/app/landingPages/dataProvider/relatedDatasourcesTab.component.ts b/portal-2/src/app/landingPages/dataProvider/relatedDatasourcesTab.component.ts index 2607817c..47bb5ffd 100644 --- a/portal-2/src/app/landingPages/dataProvider/relatedDatasourcesTab.component.ts +++ b/portal-2/src/app/landingPages/dataProvider/relatedDatasourcesTab.component.ts @@ -16,7 +16,7 @@ import {RouterHelper} from '../../utils/routerHelper.class';

The results below are discovered through our pilot algorithms. - Let us know how we are doing! + Let us know how we are doing!

diff --git a/portal-2/src/app/landingPages/dataProvider/statisticsTab.component.ts b/portal-2/src/app/landingPages/dataProvider/statisticsTab.component.ts index 40ca1e19..6558fa4c 100644 --- a/portal-2/src/app/landingPages/dataProvider/statisticsTab.component.ts +++ b/portal-2/src/app/landingPages/dataProvider/statisticsTab.component.ts @@ -13,7 +13,7 @@ import {OpenaireProperties} from '../../utils/properties/openaireProperties';

The results below are discovered through our pilot algorithms. - Let us know how we are doing! + Let us know how we are doing!

Latest Documents Timeline

diff --git a/portal-2/src/app/landingPages/dataProvider/tabs.component.ts b/portal-2/src/app/landingPages/dataProvider/tabs.component.ts index 476e2ecb..7180e9e8 100644 --- a/portal-2/src/app/landingPages/dataProvider/tabs.component.ts +++ b/portal-2/src/app/landingPages/dataProvider/tabs.component.ts @@ -104,7 +104,7 @@ import {OpenaireProperties} from '../../utils/properties/openaireProperties';

The results below are discovered through our pilot algorithms. - Let us know how we are doing! + Let us know how we are doing!

Latest Documents Timeline

@@ -198,7 +198,7 @@ import {OpenaireProperties} from '../../utils/properties/openaireProperties';

The results below are discovered through our pilot algorithms. - Let us know how we are doing! + Let us know how we are doing!

Latest Documents Timeline

diff --git a/portal-2/src/app/landingPages/dataset/dataset.component.html b/portal-2/src/app/landingPages/dataset/dataset.component.html index 7d110bf8..bfbbc3b1 100644 --- a/portal-2/src/app/landingPages/dataset/dataset.component.html +++ b/portal-2/src/app/landingPages/dataset/dataset.component.html @@ -74,7 +74,7 @@

The results below are discovered through our pilot algorithms. - Let us know how we are doing! + Let us know how we are doing!

@@ -87,7 +87,7 @@

The results below are discovered through our pilot algorithms. - Let us know how we are doing! + Let us know how we are doing!

@@ -110,11 +110,13 @@
@@ -205,7 +210,7 @@
  • The results below are discovered through our pilot algorithms. - Let us know how we are doing! + Let us know how we are doing!

  • @@ -243,8 +248,10 @@
    • -
      Share - Bookmark
      +
      Share - Bookmark +
      +
    • diff --git a/portal-2/src/app/searchPages/dataProviders/compatibleDataProviders.component.ts b/portal-2/src/app/searchPages/dataProviders/compatibleDataProviders.component.ts index 2b782abe..3d51fbe9 100644 --- a/portal-2/src/app/searchPages/dataProviders/compatibleDataProviders.component.ts +++ b/portal-2/src/app/searchPages/dataProviders/compatibleDataProviders.component.ts @@ -154,7 +154,7 @@ export class SearchCompatibleDataprovidersComponent { var value:Value = {name: value_names[i][j], id: value_original_ids[i][j], number:j, selected:false} values.push(value); } - var filter:Filter = {title: filter_names[i], filterId: filter_ids[i], originalFilterId: filter_original_ids[i], values : values, countSelectedValues:0, "filterOperator": 'or'} + var filter:Filter = {title: filter_names[i], filterId: filter_ids[i], originalFilterId: filter_original_ids[i], values : values, countSelectedValues:0, "filterOperator": 'or' }; filters.push(filter); } return filters; diff --git a/portal-2/src/app/searchPages/dataProviders/entityRegistries.component.ts b/portal-2/src/app/searchPages/dataProviders/entityRegistries.component.ts index 1cc2883b..167f5741 100644 --- a/portal-2/src/app/searchPages/dataProviders/entityRegistries.component.ts +++ b/portal-2/src/app/searchPages/dataProviders/entityRegistries.component.ts @@ -152,7 +152,7 @@ export class SearchEntityRegistriesComponent { var value:Value = {name: value_names[i][j], id: value_original_ids[i][j], number:j, selected:false} values.push(value); } - var filter:Filter = {title: filter_names[i], filterId: filter_ids[i], originalFilterId: filter_original_ids[i], values : values, countSelectedValues:0, "filterOperator": 'or'} + var filter:Filter = {title: filter_names[i], filterId: filter_ids[i], originalFilterId: filter_original_ids[i], values : values, countSelectedValues:0, "filterOperator": 'or' }; filters.push(filter); } return filters; diff --git a/portal-2/src/app/searchPages/find/search.component.ts b/portal-2/src/app/searchPages/find/search.component.ts index 3902a012..73d693cc 100644 --- a/portal-2/src/app/searchPages/find/search.component.ts +++ b/portal-2/src/app/searchPages/find/search.component.ts @@ -20,6 +20,7 @@ import {SearchOrganizationsService} from '../../services/searchOrganizations.ser import {OpenaireProperties} from '../../utils/properties/openaireProperties'; import {SearchFields} from '../../utils/properties/searchFields'; +import { ErrorCodes} from '../../utils/properties/openaireProperties'; @Component({ changeDetection: ChangeDetectionStrategy.Default, @@ -40,32 +41,44 @@ import {SearchFields} from '../../utils/properties/searchFields';
    +
    - + - - - - - + + - - - - - @@ -79,11 +83,9 @@ export class AdvancedSearchFormComponent { public operators: [{name:string, id:string}] = this.searchFields.ADVANCED_SEARCH_OPERATORS; constructor () { - console.log("Constr: Advanced search form"); } ngOnInit() { - console.log("Init: Advanced search form"); for(var i = 0; i < this.fieldIds.length; i++){ this.fieldList[this.fieldIds[i]]=[]; } @@ -100,7 +102,6 @@ export class AdvancedSearchFormComponent { } addField() { - console.info("add filter"+this.fieldIds[0]+this.fieldIdsMap[this.fieldIds[0]].name+this.fieldIdsMap[this.fieldIds[0]].type); this.newFieldId = this.fieldIds[0]; var type = this.fieldIdsMap[this.newFieldId].type; if(type == "boolean"){ @@ -112,7 +113,6 @@ export class AdvancedSearchFormComponent { } removeField(index: number) { - console.info("remove filter"); this.selectedFields.splice(index, 1); } diff --git a/portal-2/src/app/searchPages/searchUtils/advancedSearchForm.module.ts b/portal-2/src/app/searchPages/searchUtils/advancedSearchForm.module.ts index 129a285b..1ee2f437 100644 --- a/portal-2/src/app/searchPages/searchUtils/advancedSearchForm.module.ts +++ b/portal-2/src/app/searchPages/searchUtils/advancedSearchForm.module.ts @@ -5,11 +5,12 @@ import { FormsModule } from '@angular/forms'; import{AdvancedSearchFormComponent} from './advancedSearchForm.component'; import {EntitiesAutocompleteModule} from '../../utils/entitiesAutoComplete/entitiesAutoComplete.module'; import {StaticAutocompleteModule} from '../../utils/staticAutoComplete/staticAutoComplete.module'; +import {DateFilterModule} from './dateFilter.module'; @NgModule({ imports: [ - CommonModule, FormsModule, EntitiesAutocompleteModule, StaticAutocompleteModule + CommonModule, FormsModule, EntitiesAutocompleteModule, StaticAutocompleteModule, DateFilterModule ], declarations: [ AdvancedSearchFormComponent, diff --git a/portal-2/src/app/searchPages/searchUtils/advancedSearchPage.component.ts b/portal-2/src/app/searchPages/searchUtils/advancedSearchPage.component.ts index dc5d40a0..f5e85f5d 100644 --- a/portal-2/src/app/searchPages/searchUtils/advancedSearchPage.component.ts +++ b/portal-2/src/app/searchPages/searchUtils/advancedSearchPage.component.ts @@ -6,7 +6,8 @@ import {SearchResult} from '../../utils/entities/searchResult'; import {SearchFields} from '../../utils/properties/searchFields'; import {SearchUtilsClass} from './searchUtils.class'; import {ModalLoading} from '../../utils/modal/loading.component'; -import {StringUtils} from '../../utils/string-utils.class'; +import {StringUtils, Dates} from '../../utils/string-utils.class'; + @Component({ selector: 'advanced-search-page', @@ -17,19 +18,6 @@ import {StringUtils} from '../../utils/string-utils.class';

    {{pageTitle}}

    - - -
    - +
    @@ -82,11 +67,9 @@ export class AdvancedSearchPageComponent { } ngOnInit() { - console.log("ASP init!"); - this.searchUtils.baseUrl = "/" + this.searchUtils.baseUrl; + this.searchUtils.baseUrl = "/" + this.searchUtils.baseUrl; this.updateBaseUrlWithParameters(); this.defineUrlParam(); - // this.searchUtils.totalResults = this.results.length; } private defineUrlParam() { @@ -106,7 +89,6 @@ export class AdvancedSearchPageComponent { } public getSelectedFiltersFromUrl(params){ - // this.selectedFields =[]; for(var i=0; i< this.fieldIds.length ; i++){ var fieldId = this.fieldIds[i]; @@ -122,7 +104,33 @@ export class AdvancedSearchPageComponent { var operators:string [] = (StringUtils.URIDecode(params[operatorId])).split(/,(?=(?:[^\"]*\"[^\"]*\")*[^\"]*$)/,-1); if(values.length == operators.length){ for(var j=0; j< values.length ; j++){ - this.selectedFields.push(new AdvancedField(fieldId,fieldparam,this.fieldIdsMap[fieldId].name,this.fieldIdsMap[fieldId].type,StringUtils.unquote(values[j]),operators[j]) ) + if(this.fieldIdsMap[fieldId].type == "date"){ + var value:string =StringUtils.unquote(values[j]); + var validDates:boolean = true; + var dateField:AdvancedField = new AdvancedField(fieldId,fieldparam,this.fieldIdsMap[fieldId].name,this.fieldIdsMap[fieldId].type,value,operators[j]) ; + if(value.indexOf("range") != -1){ + dateField.dateValue.type="range"; + if(value.length < 26 ){ + validDates =false; + }else{ + if(!Dates.isValidDate(value.substring(5,15)) || !Dates.isValidDate(value.substring(16,26))){ + validDates =false; + }else { + dateField.dateValue.from = Dates.getDateFromString(value.substring(5,15)); + dateField.dateValue.to = Dates.getDateFromString(value.substring(16,26)); + } + } + // "rangeYYYY-MM-DD:YYYY-MM-DD" + }else{ + dateField.dateValue.setDatesByType(value); + } + if(validDates){ + this.selectedFields.push(dateField); + } + + }else{ + this.selectedFields.push(new AdvancedField(fieldId,fieldparam,this.fieldIdsMap[fieldId].name,this.fieldIdsMap[fieldId].type,StringUtils.unquote(values[j]),operators[j]) ); + } } } } @@ -136,15 +144,22 @@ export class AdvancedSearchPageComponent { this.parameterNames.splice(0,this.parameterNames.length); this.parameterValues.splice(0,this.parameterValues.length); var fields: { [key:string]:{ values:string[], operators:string[] }}={}; - console.log("In createUrlParameters :"+ this.selectedFields.length); - for(var i = 0; i< this.selectedFields.length; i++){ - if(this.fieldIdsMap[this.selectedFields[i].id] != undefined && this.selectedFields[i].value.length > 0){ + for(var i = 0; i< this.selectedFields.length; i++){ + if(this.fieldIdsMap[this.selectedFields[i].id] != undefined && (this.selectedFields[i].value.length > 0 || this.selectedFields[i].type == "date" )){ if(!fields[this.selectedFields[i].id]){ fields[this.selectedFields[i].id] = {values:[], operators:[]}; fields[this.selectedFields[i].id].values =[]; fields[this.selectedFields[i].id].operators =[]; } - fields[this.selectedFields[i].id].values.push(StringUtils.quote(StringUtils.URIEncode(this.selectedFields[i].value))); + if(this.selectedFields[i].type == "date"){ + if(this.selectedFields[i].dateValue.type == "range"){ + fields[this.selectedFields[i].id].values.push(StringUtils.quote(StringUtils.URIEncode("range"+Dates.getDateToString(this.selectedFields[i].dateValue.from)+":"+Dates.getDateToString(this.selectedFields[i].dateValue.to)))); + }else{ + fields[this.selectedFields[i].id].values.push(StringUtils.quote(StringUtils.URIEncode(this.selectedFields[i].dateValue.type))); + } + }else{ + fields[this.selectedFields[i].id].values.push(StringUtils.quote(StringUtils.URIEncode(this.selectedFields[i].value))); + } fields[this.selectedFields[i].id].operators.push(this.selectedFields[i].operatorId); } @@ -163,25 +178,31 @@ export class AdvancedSearchPageComponent { if(includePage && this.searchUtils.page != 1){ params += "&page="+this.searchUtils.page; } - console.log("In end of createUrlParameters :"+ this.selectedFields.length); - return '?'+params; + return '?'+params; } public createQueryParameters(){ var params=""; var countParams = 0; for(var i = 0; i< this.selectedFields.length; i++){ - if(this.fieldIdsMap[this.selectedFields[i].id] != undefined && this.selectedFields[i].value != ""){ - if(this.selectedFields[i].id == "q"){ - var op = ""; - // if() - params += (countParams == 0 ? "" : this.selectedFields[i].operatorId) + " " + '"' + StringUtils.URIEncode(this.selectedFields[i].value) + '"' + " "; - }else if(countParams == 0 && this.selectedFields[i].operatorId == "not"){ - params += " "+ this.selectedFields[i].id + " <> "+'"' + StringUtils.URIEncode(this.selectedFields[i].value) +'"' + " "; + if(this.fieldIdsMap[this.selectedFields[i].id] != undefined && (this.selectedFields[i].value != "" ||this.selectedFields[i].type == "date")){ + console.log("createQueryParameters::"+this.selectedFields[i].type); + if(this.selectedFields[i].type == "date"){ + if(this.selectedFields[i].dateValue.type != "any"){ + params += (countParams == 0 ? "" : this.selectedFields[i].operatorId) + " " + this.selectedFields[i].id + this.fieldIdsMap[this.selectedFields[i].id].equalityOperator+ '"' + StringUtils.URIEncode(Dates.getDateToString(this.selectedFields[i].dateValue.from)) + " " + + StringUtils.URIEncode(Dates.getDateToString(this.selectedFields[i].dateValue.to)) + '"' + " "; + } }else{ - params += (countParams == 0 ? "" : this.selectedFields[i].operatorId + " " ) + this.selectedFields[i].id + this.fieldIdsMap[this.selectedFields[i].id].equalityOperator+'"' + encodeURIComponent(this.selectedFields[i].value) +'"' + " "; - - } + if(this.selectedFields[i].id == "q"){ + var op = ""; + // if() + params += (countParams == 0 ? "" : this.selectedFields[i].operatorId) + " " + '"' + StringUtils.URIEncode(this.selectedFields[i].value) + '"' + " "; + }else if(countParams == 0 && this.selectedFields[i].operatorId == "not"){ + params += " "+ this.selectedFields[i].id + " <> "+'"' + StringUtils.URIEncode(this.selectedFields[i].value) +'"' + " "; + }else{ + params += (countParams == 0 ? "" : this.selectedFields[i].operatorId + " " ) + this.selectedFields[i].id + this.fieldIdsMap[this.selectedFields[i].id].equalityOperator+'"' + encodeURIComponent(this.selectedFields[i].value) +'"' + " "; + } + } countParams++; } } diff --git a/portal-2/src/app/searchPages/searchUtils/dateFilter.module.ts b/portal-2/src/app/searchPages/searchUtils/dateFilter.module.ts new file mode 100644 index 00000000..ea3a24e8 --- /dev/null +++ b/portal-2/src/app/searchPages/searchUtils/dateFilter.module.ts @@ -0,0 +1,20 @@ +import { NgModule} from '@angular/core'; +import { CommonModule } from '@angular/common'; +import { FormsModule } from '@angular/forms'; + import { MyDatePickerModule } from 'mydatepicker'; +import {DateFilterComponent} from './dateFilter.component'; +@NgModule({ + imports: [ + CommonModule, FormsModule, MyDatePickerModule + ], + declarations: [ + DateFilterComponent +], + + providers:[ + ], + exports: [ + DateFilterComponent + ] +}) +export class DateFilterModule { } diff --git a/portal-2/src/app/searchPages/searchUtils/searchHelperClasses.class.ts b/portal-2/src/app/searchPages/searchUtils/searchHelperClasses.class.ts index 971d5f1a..c09b3440 100644 --- a/portal-2/src/app/searchPages/searchUtils/searchHelperClasses.class.ts +++ b/portal-2/src/app/searchPages/searchUtils/searchHelperClasses.class.ts @@ -1,3 +1,4 @@ +import {Dates} from '../../utils/string-utils.class'; export class Filter{ public title: string; // eg Type public filterId: string; // type (name in url parameter) @@ -5,7 +6,10 @@ export class Filter{ public countSelectedValues: number = 0; public values: Value[] = []; public filterOperator: string ='or'; + + } + export class Value{ public name: string; //eg Article, Journal public id: string; //0001 @@ -22,7 +26,7 @@ export class AdvancedField{ public operatorId: string; public operatorName: string =""; public valid: boolean = true; - + public dateValue:DateValue = new DateValue("any"); constructor(id:string,param:string,name:string, type:string, value:string,operator:string){ this.id = id; @@ -35,7 +39,43 @@ export class AdvancedField{ } } +export class DateValue{ + public types = ["any","range","1mon","2mon","3mon","6mon","12mon","2year","5year","10year"]; + public typesTitle = ["any","in the specified date range","in the last month","in the last 2 months","in the last 3 months","in the last 6 months","in the last year","in the last 2 years","in the last 5 years","in the last 10 years"]; + public type: string ; + public from:Date = new Date(); + public to:Date = new Date(); + constructor(type:string = "any"){ + this.setDatesByType(type); + } + public setDatesByType(type:string){ + if(this.types.indexOf(type) == -1){ + type=this.types[0]; + } + this.type = type; + this.to = Dates.getDateToday(); + if(this.type == "range" || this.type == "any"){ // for type "any" just to initiate with values + this.from = Dates.getDateXMonthsAgo(1); + }else if(this.type == "1mon"){ + this.from = Dates.getDateXMonthsAgo(1); + }else if(this.type == "2mon"){ + this.from = Dates.getDateXMonthsAgo(2); + }else if(this.type == "3mon"){ + this.from = Dates.getDateXMonthsAgo(3); + }else if(this.type == "6mon"){ + this.from = Dates.getDateXMonthsAgo(6); + }else if(this.type == "12mon"){ + this.from = Dates.getDateXMonthsAgo(12); + }else if(this.type == "2year"){ + this.from = Dates.getDateXYearsAgo(2); + }else if(this.type == "5year"){ + this.from = Dates.getDateXYearsAgo(5); + }else if(this.type == "10year"){ + this.from = Dates.getDateXYearsAgo(10); + } + } +} export class OPERATOR{ public static AND: string ="and"; public static OR: string ="or"; diff --git a/portal-2/src/app/searchPages/searchUtils/searchPage.component.ts b/portal-2/src/app/searchPages/searchUtils/searchPage.component.ts index 52a34cc4..8a1973f2 100644 --- a/portal-2/src/app/searchPages/searchUtils/searchPage.component.ts +++ b/portal-2/src/app/searchPages/searchUtils/searchPage.component.ts @@ -164,13 +164,13 @@ export class SearchPageComponent { var doisParams = ""; for(var i =0 ;i < DOIs.length; i++){ - doisParams+=(doisParams.length > 0?" or ":"")+'((pidclassid exact doi) and (pid exact "'+ DOIs[i]+'"))'; + doisParams+=(doisParams.length > 0?"&":"")+'doi="'+ DOIs[i]+'"'; } if(doisParams.length > 0){ - doiQuery += "&q=("+doisParams+")" + doiQuery += "&"+doisParams; } }else{ - keywordQuery += "&q=("+StringUtils.quote(StringUtils.URIEncode(keyword)) +")"; + keywordQuery += "&q="+StringUtils.URIEncode(keyword); } } @@ -212,10 +212,10 @@ export class SearchPageComponent { var doisParams = ""; for(var i =0 ;i < DOIs.length; i++){ - doisParams+=(doisParams.length > 0?" or ":"")+'((pidclassid exact doi) and (pid exact "'+ DOIs[i]+'"))'; + doisParams+=(doisParams.length > 0?"&":"")+'doi="'+ DOIs[i]+'"'; } if(doisParams.length > 0){ - doiQuery += "and ("+doisParams+")" + doiQuery += "&"+doisParams; } }else{ keywordQuery += "and ("+StringUtils.quote(StringUtils.URIEncode(keyword)) +")"; @@ -321,15 +321,15 @@ export class SearchPageComponent { var doisParams = ""; for(var i =0 ;i < DOIs.length; i++){ - doisParams+=(doisParams.length > 0?" or ":"")+'((pidclassid exact doi) and (pid exact "'+ DOIs[i]+'"))'; + doisParams+=(doisParams.length > 0?"&":"")+'doi="'+ DOIs[i]+'"'; } if(doisParams.length > 0){ - doiQuery += "&q=("+doisParams+")" + doiQuery += "&"+doisParams; }else{ - keywordQuery += "&q=("+StringUtils.quote(StringUtils.URIEncode(this.searchUtils.keyword)) +")" + keywordQuery += "&q="+StringUtils.URIEncode(this.searchUtils.keyword); } }else{ - keywordQuery += "&q=("+StringUtils.quote(StringUtils.URIEncode(this.searchUtils.keyword)) +")" + keywordQuery += "&q="+StringUtils.URIEncode(this.searchUtils.keyword); } } @@ -361,10 +361,10 @@ export class SearchPageComponent { var DOIs:string[] = DOI.getDOIsFromString(this.searchUtils.keyword); var doisParams = ""; for(var i =0 ;i < DOIs.length; i++){ - doisParams+=(doisParams.length > 0?" or ":"")+'((pidclassid exact doi) and (pid exact "'+ DOIs[i]+'"))'; + doisParams+=(doisParams.length > 0?"&":"")+'doi="'+ DOIs[i]+'"'; } if(doisParams.length > 0){ - doiQuery += " and ("+doisParams+")" + doiQuery += "&"+doisParams; } }else{ keywordQuery += " and ("+StringUtils.quote(StringUtils.URIEncode(this.searchUtils.keyword)) +")" diff --git a/portal-2/src/app/searchPages/searchUtils/searchResult.component.ts b/portal-2/src/app/searchPages/searchUtils/searchResult.component.ts index dedf7ade..fb4e48f4 100644 --- a/portal-2/src/app/searchPages/searchUtils/searchResult.component.ts +++ b/portal-2/src/app/searchPages/searchUtils/searchResult.component.ts @@ -6,11 +6,11 @@ import {RouterHelper} from '../../utils/routerHelper.class'; @Component({ selector: 'search-result', template: ` -
      +
    • @@ -134,6 +134,7 @@ export class SearchResultComponent { @Input() status: number; @Input() type: string; @Input() urlParam: string; + @Input() showLoading: boolean = false; public errorCodes:ErrorCodes = new ErrorCodes(); public routerHelper:RouterHelper = new RouterHelper(); diff --git a/portal-2/src/app/searchPages/simple/searchDataproviders.component.ts b/portal-2/src/app/searchPages/simple/searchDataproviders.component.ts index 33e82484..f6327adf 100644 --- a/portal-2/src/app/searchPages/simple/searchDataproviders.component.ts +++ b/portal-2/src/app/searchPages/simple/searchDataproviders.component.ts @@ -108,7 +108,7 @@ export class SearchDataprovidersComponent { public getNumForSearch(keyword: string) { var parameters="datasources/count"; if(keyword != "") { - parameters += "?q="+'"'+keyword+'"'; + parameters += "?q="+keyword; } this._searchDataprovidersService.numOfDataproviders(parameters).subscribe( data => { @@ -218,7 +218,7 @@ public getResultsForDeposit(id:string, type:string, page: number, size: number) public getResults(keyword:string,refine:boolean, page: number, size: number){ var parameters = ""; if(keyword.length > 0){ - parameters = "q="+'"' + keyword + '"'; + parameters = "q="+ keyword; } this._getResults(parameters,refine,page,this.searchUtils.size); } diff --git a/portal-2/src/app/searchPages/simple/searchDatasets.component.ts b/portal-2/src/app/searchPages/simple/searchDatasets.component.ts index 09eda275..491dd27e 100644 --- a/portal-2/src/app/searchPages/simple/searchDatasets.component.ts +++ b/portal-2/src/app/searchPages/simple/searchDatasets.component.ts @@ -155,14 +155,13 @@ public getResults(keyword:string,refine:boolean, page: number, size: number){ if(keyword.length > 0){ var DOIs:string[] = DOI.getDOIsFromString(keyword); var doisParams = ""; - for(var i =0 ;i < DOIs.length; i++){ - doisParams+=(doisParams.length > 0?" or ":"")+'((pidclassid exact doi) and (pid exact "'+ DOIs[i]+'"))'; + doisParams+=(doisParams.length > 0?"&":"")+'doi="'+ DOIs[i]+'"'; } if(doisParams.length > 0){ - parameters += "q=("+doisParams+")" + parameters += "&"+doisParams; }else{ - parameters = "q="+'"' + keyword + '"'; + parameters = "q=" + keyword; } } this._getResults(parameters,refine,page,size); diff --git a/portal-2/src/app/searchPages/simple/searchOrganizations.component.ts b/portal-2/src/app/searchPages/simple/searchOrganizations.component.ts index 055f2c7b..46d693ba 100644 --- a/portal-2/src/app/searchPages/simple/searchOrganizations.component.ts +++ b/portal-2/src/app/searchPages/simple/searchOrganizations.component.ts @@ -80,7 +80,7 @@ export class SearchOrganizationsComponent { public getResults(keyword:string,refine:boolean, page: number, size: number){ var parameters = ""; if(keyword.length > 0){ - parameters = "q="+'"' + keyword + '"'; + parameters = "q=" + keyword; } this._getResults(parameters,refine,page,this.searchUtils.size); } diff --git a/portal-2/src/app/searchPages/simple/searchPeople.component.ts b/portal-2/src/app/searchPages/simple/searchPeople.component.ts index 65468b85..e714a024 100644 --- a/portal-2/src/app/searchPages/simple/searchPeople.component.ts +++ b/portal-2/src/app/searchPages/simple/searchPeople.component.ts @@ -64,12 +64,12 @@ export class SearchPeopleComponent { public ngOnDestroy() { this.sub.unsubscribe(); - } + } public getResults(keyword:string,refine:boolean, page: number, size: number){ var parameters = ""; if(keyword.length > 0){ - parameters = "q="+'"' + keyword + '"'; + parameters = "q="+ keyword; } this._getResults(parameters,refine,page,this.searchUtils.size); } diff --git a/portal-2/src/app/searchPages/simple/searchProjects.component.ts b/portal-2/src/app/searchPages/simple/searchProjects.component.ts index bc70b0d8..104b4785 100644 --- a/portal-2/src/app/searchPages/simple/searchProjects.component.ts +++ b/portal-2/src/app/searchPages/simple/searchProjects.component.ts @@ -84,7 +84,7 @@ export class SearchProjectsComponent { public getResults(keyword:string,refine:boolean, page: number, size: number){ var parameters = ""; if(keyword.length > 0){ - parameters = "q="+'"' + keyword + '"'; + parameters = "q="+keyword; } this._getResults(parameters,refine,page,this.searchUtils.size); } diff --git a/portal-2/src/app/searchPages/simple/searchPublications.component.ts b/portal-2/src/app/searchPages/simple/searchPublications.component.ts index 790f9039..a60830b0 100644 --- a/portal-2/src/app/searchPages/simple/searchPublications.component.ts +++ b/portal-2/src/app/searchPages/simple/searchPublications.component.ts @@ -190,12 +190,12 @@ public getResults(keyword:string,refine:boolean, page: number, size: number){ var doisParams = ""; for(var i =0 ;i < DOIs.length; i++){ - doisParams+=(doisParams.length > 0?" or ":"")+'((pidclassid exact doi) and (pid exact "'+ DOIs[i]+'"))'; + doisParams+=(doisParams.length > 0?"&":"")+'doi="'+ DOIs[i]+'"'; } if(doisParams.length > 0){ - parameters += "q=("+doisParams+")" + parameters += "&"+doisParams; }else{ - parameters = "q="+'"' + keyword + '"'; + parameters = "q=" + keyword; } } this._getResults(parameters,refine,page,size); diff --git a/portal-2/src/app/services/searchDatasets.service.ts b/portal-2/src/app/services/searchDatasets.service.ts index 3fca63f6..d84b2293 100644 --- a/portal-2/src/app/services/searchDatasets.service.ts +++ b/portal-2/src/app/services/searchDatasets.service.ts @@ -60,10 +60,11 @@ export class SearchDatasetsService { var doisParams = ""; for(var i =0 ;i < DOIs.length; i++){ - doisParams+=(doisParams.length > 0?" or ":"")+'((pidclassid exact doi) and (pid exact "'+ DOIs[i]+'"))'; + doisParams+=(doisParams.length > 0?"&":"")+'doi="'+ DOIs[i]+'"'; } if(doisParams.length > 0){ - url += "q=("+doisParams+")" + url += "&"+doisParams; + } if(refineParams!= null && refineParams != '' ) { url += refineParams; @@ -267,7 +268,7 @@ export class SearchDatasetsService { //OpenaireProperties.getSearchAPIURLLast() //"http://rudie.di.uoa.gr:8080/dnet-functionality-services-2.0.0-SNAPSHOT/rest/v2/api/" - let url = OpenaireProperties.getSearchAPIURLLast()+"datasets/count?q="+'"' + params + '"'+"&format=json"; + let url = OpenaireProperties.getSearchAPIURLLast()+"datasets/count?q=" + params + "&format=json"; let key = url; if (this._cache.has(key)) { return Observable.of(this._cache.get(key)); diff --git a/portal-2/src/app/services/searchOrganizations.service.ts b/portal-2/src/app/services/searchOrganizations.service.ts index 1d016376..5e539555 100644 --- a/portal-2/src/app/services/searchOrganizations.service.ts +++ b/portal-2/src/app/services/searchOrganizations.service.ts @@ -187,7 +187,7 @@ export class SearchOrganizationsService { //OpenaireProperties.getSearchAPIURLLast() //"http://rudie.di.uoa.gr:8080/dnet-functionality-services-2.0.0-SNAPSHOT/rest/v2/api/" - let url = OpenaireProperties.getSearchAPIURLLast()+"organizations/count?q="+'"' + params + '"'+ "&format=json"; + let url = OpenaireProperties.getSearchAPIURLLast()+"organizations/count?q=" + params + "&format=json"; let key = url; if (this._cache.has(key)) { diff --git a/portal-2/src/app/services/searchPeople.service.ts b/portal-2/src/app/services/searchPeople.service.ts index 1162a78f..9d2aeac0 100644 --- a/portal-2/src/app/services/searchPeople.service.ts +++ b/portal-2/src/app/services/searchPeople.service.ts @@ -110,7 +110,7 @@ export class SearchPeopleService { //OpenaireProperties.getSearchAPIURLLast() //"http://rudie.di.uoa.gr:8080/dnet-functionality-services-2.0.0-SNAPSHOT/rest/v2/api/" - let url = OpenaireProperties.getSearchAPIURLLast()+"people/count?q="+'"' + params + '"'+ "&format=json"; + let url = OpenaireProperties.getSearchAPIURLLast()+"people/count?q=" + params + "&format=json"; let key = url; if (this._cache.has(key)) { return Observable.of(this._cache.get(key)); diff --git a/portal-2/src/app/services/searchProjects.service.ts b/portal-2/src/app/services/searchProjects.service.ts index 50227032..4b3ace52 100644 --- a/portal-2/src/app/services/searchProjects.service.ts +++ b/portal-2/src/app/services/searchProjects.service.ts @@ -235,7 +235,7 @@ export class SearchProjectsService { //OpenaireProperties.getSearchAPIURLLast() //"http://rudie.di.uoa.gr:8080/dnet-functionality-services-2.0.0-SNAPSHOT/rest/v2/api/" - let url = OpenaireProperties.getSearchAPIURLLast()+"projects/count?q="+'"' + params + '"'+ "&format=json"; + let url = OpenaireProperties.getSearchAPIURLLast()+"projects/count?q=" + params + "&format=json"; let key = url; if (this._cache.has(key)) { return Observable.of(this._cache.get(key)); diff --git a/portal-2/src/app/services/searchPublications.service.ts b/portal-2/src/app/services/searchPublications.service.ts index 0c96d81f..ab42b132 100644 --- a/portal-2/src/app/services/searchPublications.service.ts +++ b/portal-2/src/app/services/searchPublications.service.ts @@ -91,10 +91,11 @@ export class SearchPublicationsService { var doisParams = ""; for(var i =0 ;i < DOIs.length; i++){ - doisParams+=(doisParams.length > 0?" or ":"")+'((pidclassid exact doi) and (pid exact "'+ DOIs[i]+'"))'; + doisParams+=(doisParams.length > 0?"&":"")+'doi="'+ DOIs[i]+'"'; } if(doisParams.length > 0){ - url += "q=("+doisParams+")" + url +="&"+doisParams; + } if(refineParams!= null && refineParams != '' ) { url += refineParams; @@ -434,7 +435,7 @@ export class SearchPublicationsService { //OpenaireProperties.getSearchAPIURLLast() //"http://rudie.di.uoa.gr:8080/dnet-functionality-services-2.0.0-SNAPSHOT/rest/v2/api/" - let url = OpenaireProperties.getSearchAPIURLLast()+"publications/count?q="+ '"' + params + '"' +"&format=json"; + let url = OpenaireProperties.getSearchAPIURLLast()+"publications/count?q="+ params +"&format=json"; let key = url; if (this._cache.has(key)) { return Observable.of(this._cache.get(key)); diff --git a/portal-2/src/app/utils/fetchEntitiesClasses/fetchDataproviders.class.ts b/portal-2/src/app/utils/fetchEntitiesClasses/fetchDataproviders.class.ts index 6ae3abe9..5a23ea70 100644 --- a/portal-2/src/app/utils/fetchEntitiesClasses/fetchDataproviders.class.ts +++ b/portal-2/src/app/utils/fetchEntitiesClasses/fetchDataproviders.class.ts @@ -32,7 +32,7 @@ export class FetchDataproviders { public getResultsByKeyword(keyword:string, page: number, size: number){ var parameters = ""; if(keyword.length > 0){ - parameters = "q="+'"' + keyword + '"'; + parameters = "q=" + keyword; } var errorCodes:ErrorCodes = new ErrorCodes(); @@ -91,13 +91,16 @@ export class FetchDataproviders { } public getNumForSearch(keyword: string) { + var errorCodes:ErrorCodes = new ErrorCodes(); + this.searchUtils.status = errorCodes.LOADING; var parameters="datasources/count"; if(keyword != "") { - parameters += "?q="+'"'+keyword+'"'; + parameters += "?q=" +keyword ; } this._searchDataprovidersService.numOfDataproviders(parameters).subscribe( data => { this.searchUtils.totalResults = data; + this.searchUtils.status = errorCodes.DONE; }, err => { console.log(err); diff --git a/portal-2/src/app/utils/fetchEntitiesClasses/fetchDatasets.class.ts b/portal-2/src/app/utils/fetchEntitiesClasses/fetchDatasets.class.ts index 8bbb7cfb..29e29462 100644 --- a/portal-2/src/app/utils/fetchEntitiesClasses/fetchDatasets.class.ts +++ b/portal-2/src/app/utils/fetchEntitiesClasses/fetchDatasets.class.ts @@ -38,12 +38,12 @@ export class FetchDatasets{ var doisParams = ""; for(var i =0 ;i < DOIs.length; i++){ - doisParams+=(doisParams.length > 0?" or ":"")+'((pidclassid exact doi) and (pid exact "'+ DOIs[i]+'"))'; + doisParams+=(doisParams.length > 0?"&":"")+'doi="'+ DOIs[i]+'"'; } if(doisParams.length > 0){ - parameters += "q=("+doisParams+")" + parameters += "&"+doisParams; }else{ - parameters = "q="+'"' + keyword + '"'; + parameters = "q=" + keyword; } } diff --git a/portal-2/src/app/utils/fetchEntitiesClasses/fetchOrganizations.class.ts b/portal-2/src/app/utils/fetchEntitiesClasses/fetchOrganizations.class.ts index a75e20fc..0124ce01 100644 --- a/portal-2/src/app/utils/fetchEntitiesClasses/fetchOrganizations.class.ts +++ b/portal-2/src/app/utils/fetchEntitiesClasses/fetchOrganizations.class.ts @@ -32,7 +32,7 @@ export class FetchOrganizations { public getResultsByKeyword(keyword:string , page: number, size: number){ var parameters = ""; if(keyword.length > 0){ - parameters = "q="+'"' + keyword + '"'; + parameters = "q=" + keyword; } var errorCodes:ErrorCodes = new ErrorCodes(); diff --git a/portal-2/src/app/utils/fetchEntitiesClasses/fetchPeople.class.ts b/portal-2/src/app/utils/fetchEntitiesClasses/fetchPeople.class.ts index 56259b27..9ea61959 100644 --- a/portal-2/src/app/utils/fetchEntitiesClasses/fetchPeople.class.ts +++ b/portal-2/src/app/utils/fetchEntitiesClasses/fetchPeople.class.ts @@ -25,7 +25,7 @@ export class FetchPeople { public getResultsByKeyword(keyword:string, page: number, size: number){ var parameters = ""; if(keyword.length > 0){ - parameters = "q="+'"' + keyword + '"'; + parameters = "q=" + keyword; } var errorCodes:ErrorCodes = new ErrorCodes(); diff --git a/portal-2/src/app/utils/fetchEntitiesClasses/fetchProjects.class.ts b/portal-2/src/app/utils/fetchEntitiesClasses/fetchProjects.class.ts index 064e0e21..0397f84e 100644 --- a/portal-2/src/app/utils/fetchEntitiesClasses/fetchProjects.class.ts +++ b/portal-2/src/app/utils/fetchEntitiesClasses/fetchProjects.class.ts @@ -27,7 +27,7 @@ export class FetchProjects{ public getResultsByKeyword(keyword:string, page: number, size: number){ var parameters = ""; if(keyword.length > 0){ - parameters = "q="+'"' + keyword + '"'; + parameters = "q=" + keyword; } var errorCodes:ErrorCodes = new ErrorCodes(); diff --git a/portal-2/src/app/utils/fetchEntitiesClasses/fetchPublications.class.ts b/portal-2/src/app/utils/fetchEntitiesClasses/fetchPublications.class.ts index fbea36ac..ef23f3fd 100644 --- a/portal-2/src/app/utils/fetchEntitiesClasses/fetchPublications.class.ts +++ b/portal-2/src/app/utils/fetchEntitiesClasses/fetchPublications.class.ts @@ -50,12 +50,12 @@ export class FetchPublications { var doisParams = ""; for(var i =0 ;i < DOIs.length; i++){ - doisParams+=(doisParams.length > 0?" or ":"")+'((pidclassid exact doi) and (pid exact "'+ DOIs[i]+'"))'; + doisParams+=(doisParams.length > 0?"&":"")+'doi="'+ DOIs[i]+'"'; } if(doisParams.length > 0){ - parameters += "q=("+doisParams+")" + parameters += "&"+doisParams; }else{ - parameters = "q="+'"' + keyword + '"'; + parameters = "q=" + keyword; } } diff --git a/portal-2/src/app/utils/properties/searchFields.ts b/portal-2/src/app/utils/properties/searchFields.ts index f9b0ec86..3d89a497 100644 --- a/portal-2/src/app/utils/properties/searchFields.ts +++ b/portal-2/src/app/utils/properties/searchFields.ts @@ -3,14 +3,17 @@ export class SearchFields { //RESULTS //Used for datasets and publications //In case Datasets should display different fields, use seperate tables for fields - public RESULT_REFINE_FIELDS = ["instancetypename", "resultlanguagename", "community","relproject", "relfunderid", - "relfundinglevel0_id","relfundinglevel1_id","relfundinglevel2_id", - "resultacceptanceyear","resultbestlicense"];//,"collectedfrom"]; + public RESULT_REFINE_FIELDS = [ + "relfunderid", + "relfundinglevel0_id","relfundinglevel1_id","relfundinglevel2_id", + "relproject","resultacceptanceyear", + + "resultbestlicense", "instancetypename", "resultlanguagename", "community","collectedfrom"]; public RESULT_ADVANCED_FIELDS:string[] = ["q","resulttitle","relperson","resultpublisher","instancetypename", "resultlanguagename", "community","relprojectid", "relfunderid", "relfundinglevel0_id","relfundinglevel1_id","relfundinglevel2_id", - "resultacceptanceyear","resultbestlicense","pid","resulthostingdatasourceid","collectedfromdatasourceid","relpersonid"]; + "resultdateofacceptance","resultbestlicense","pid","resulthostingdatasourceid","collectedfromdatasourceid","relpersonid"]; public RESULT_FIELDS: { [key:string]:FieldDetails}={ ["q"]:{name:"All fields", type:"keyword", param:"q", equalityOperator: "="}, ["resulttitle"]:{name:"Title", type:"keyword", param:"title", equalityOperator: "="}, @@ -30,7 +33,8 @@ export class SearchFields { ["relfundinglevel0_id"]:{name:"Funding Stream", type:"refine", param:"funderlv0", equalityOperator: " exact "}, ["relfundinglevel1_id"]:{name:"Funding Substream level 1", type:"refine", param:"funderlv1", equalityOperator: " exact "}, ["relfundinglevel2_id"]:{name:"Funding Substream level 2", type:"refine", param:"funderlv2", equalityOperator: " exact "}, - ["resultacceptanceyear"]:{name:"Year", type:"year", param:"year", equalityOperator: " exact "}, + ["resultacceptanceyear"]:{name:"Publication Date", type:"keyword", param:"year", equalityOperator: " exact "}, + ["resultdateofacceptance"]:{name:"Publication Date", type:"date", param:"date", equalityOperator: " within "}, ["resultbestlicense"]:{name:"Access Mode", type:"vocabulary", param:"access", equalityOperator: " exact "}, // ["resultbestlicenseid"]:{name:"Access Mode", type:"refine", param:"access", equalityOperator: " exact "}, ["collectedfrom"]:{name:"Datasource", type:"refine", param:"datasource", equalityOperator: " exact "}, @@ -43,7 +47,7 @@ export class SearchFields { "fundinglevel2_id","projectstartyear","projectendyear","projectecsc39"]; public PROJECT_ADVANCED_FIELDS:string[] = ["q","projectacronym","projecttitle","projectkeywords", "funderid", "fundinglevel0_id","fundinglevel1_id", "fundinglevel2_id", - "projectstartyear","projectendyear","projectecsc39", + "projectstartdate","projectenddate","projectecsc39", "projectcode","relorganizationid", "collectedfromdatasourceid"]; public PROJECT_FIELDS: { [key:string]:FieldDetails}={ ["q"]:{name:"All fields", type:"keyword", param:"q", equalityOperator: "="}, @@ -57,7 +61,8 @@ export class SearchFields { ["fundinglevel2_id"]:{name:"Funding Substream level 2", type:"refine", param:"funderlv2", equalityOperator: " exact "}, ["projectstartyear"]:{name:"Start Year", type:"year", param:"startyear", equalityOperator: " exact "}, ["projectendyear"]:{name:"End Year", type:"year", param:"endyear", equalityOperator: " exact "}, - + ["projectstartdate"]:{name:"Start Date", type:"date", param:"startdate", equalityOperator: " within "}, + ["projectenddate"]:{name:"End Date", type:"date", param:"enddate", equalityOperator: " within "}, ["projectecsc39"]:{name:"Special Clause 39", type:"boolean", param:"sc39", equalityOperator: " exact "}, ["projectcode"]:{name:"Project Code", type:"keyword", param:"code", equalityOperator: " exact "}, ["relorganizationid"]:{name:"Organization", type:"entity", param:"organization", equalityOperator: " exact "}, diff --git a/portal-2/src/app/utils/routerHelper.class.ts b/portal-2/src/app/utils/routerHelper.class.ts index dc0ee61b..fecaf296 100644 --- a/portal-2/src/app/utils/routerHelper.class.ts +++ b/portal-2/src/app/utils/routerHelper.class.ts @@ -3,6 +3,7 @@ export class RouterHelper { //Use this class function to create queryParams Objects in format {key1:value1} or {key1:value1,key2:value2,key3:value3,...} for multiple parameters + constructor(){} // Link public createQueryParam(key:string,value:string){ var obj ={}; @@ -10,9 +11,9 @@ export class RouterHelper { return obj; } - public createQueryParamsPaging(keys:string[],values:string[],key:string,value:number){ + public createQueryParamsPaging(keys:string[],values:string[],pageParameter:string,pageValue:number){ var obj = this.createQueryParams(keys, values); - obj[key] = ""+value; + obj[pageParameter] = ""+pageValue; return obj; } diff --git a/portal-2/src/app/utils/showDataProviders.component.ts b/portal-2/src/app/utils/showDataProviders.component.ts index fae52afb..36c3897e 100644 --- a/portal-2/src/app/utils/showDataProviders.component.ts +++ b/portal-2/src/app/utils/showDataProviders.component.ts @@ -10,7 +10,7 @@ import {Component, Input} from '@angular/core';

      The results below are discovered through our pilot algorithms. - Let us know how we are doing! + Let us know how we are doing!

    + + +
    Search for:Search for: + + + + + + Yes
    @@ -45,7 +49,7 @@ import {Dates} from '../../utils/string-utils.class'; No
    + @@ -53,7 +57,7 @@ import {Dates} from '../../utils/string-utils.class';