[Trunk | Library]:

1. searchDataproviders.service.ts & searchOrganizations.service.ts & searchProjects.service.ts: Remove 'type' parameter from request.
2. newSearchPage.component.ts: 'type' parameter is added for every type (not only for results).
3. entitiesSelection.component.ts: [Bug fix] For content providers: value="dataprovider".
4. searchDataProviders.component.ts & searchOrganizations.component.ts & searchProjects.component.ts: Initialize "csvParams" correctly according to queries built in search pages (search redesign).


git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-services-library/trunk/ng-openaire-library/src/app@58132 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
konstantina.galouni 2020-02-24 13:45:22 +00:00
parent 3fd4253ebc
commit d292a3e1ed
9 changed files with 56 additions and 34 deletions

View File

@ -17,12 +17,12 @@ import {NewSearchPageComponent} from "./searchUtils/newSearchPage.component";
<new-search-page <new-search-page
pageTitle="{{(simpleView?'':'Advanced ')}} Search for {{ 'content providers' | titlecase }}" pageTitle="{{(simpleView?'':'Advanced ')}} Search for {{ 'content providers' | titlecase }}"
entityType="content provider" entityType="dataprovider"
type="content providers" type="content providers"
[results]="results" [results]="results"
[searchUtils]="searchUtils" [searchUtils]="searchUtils"
[fieldIds]="fieldIds" [fieldIdsMap]="fieldIdsMap" [selectedFields]="selectedFields" [fieldIds]="fieldIds" [fieldIdsMap]="fieldIdsMap" [selectedFields]="selectedFields"
[csvParams]="csvParams" csvPath="projects" [csvParams]="csvParams" csvPath="datasources"
[simpleSearchLink]="simpleSearchLink" [advancedSearchLink]="advancedSearchLink" [simpleSearchLink]="simpleSearchLink" [advancedSearchLink]="advancedSearchLink"
[disableForms]="disableForms" [disableForms]="disableForms"
[loadPaging]="loadPaging" [loadPaging]="loadPaging"
@ -116,7 +116,7 @@ export class SearchDataProvidersComponent {
this.searchPage.fieldIds = this.fieldIds; this.searchPage.fieldIds = this.fieldIds;
this.selectedFields =[]; this.selectedFields =[];
this.searchPage.prepareSearchPage(this.fieldIds, this.selectedFields, this.refineFields, [], this.fieldIdsMap,this.customFilter,params, "datasource"); this.searchPage.prepareSearchPage(this.fieldIds, this.selectedFields, this.refineFields, [], this.fieldIdsMap,this.customFilter,params, "dataprovider");
// this.searchPage.selectedFields = this.selectedFields; // this.searchPage.selectedFields = this.selectedFields;
// this.searchPage.fieldIdsMap = this.fieldIdsMap; // this.searchPage.fieldIdsMap = this.fieldIdsMap;
@ -134,12 +134,15 @@ export class SearchDataProvidersComponent {
size=0; size=0;
} }
if(page <= this.pagingLimit || this.searchUtils.status == this.errorCodes.LOADING) { if(page <= this.pagingLimit || this.searchUtils.status == this.errorCodes.LOADING) {
if(parameters!= null && parameters != '' ) { // if(parameters!= null && parameters != '' ) {
this.csvParams ="&fq=( "+this.resourcesQuery + "and (" + parameters + "))"; // this.csvParams ="&fq=( "+this.resourcesQuery + "and (" + parameters + "))";
}else{ // }else{
this.csvParams ="&fq="+this.resourcesQuery; // this.csvParams ="&fq="+this.resourcesQuery;
} // }
this.csvParams += (refineFieldsFilterQuery?refineFieldsFilterQuery:''); // this.csvParams += (refineFieldsFilterQuery?refineFieldsFilterQuery:'');
this.csvParams = (parameters ? ("&fq=("+parameters) : "") + (parameters ? ")" : "");
this.csvParams += (refineFieldsFilterQuery ? refineFieldsFilterQuery : "");
//var errorCodes:ErrorCodes = new ErrorCodes(); //var errorCodes:ErrorCodes = new ErrorCodes();
this.searchUtils.status = this.errorCodes.LOADING; this.searchUtils.status = this.errorCodes.LOADING;

View File

@ -133,11 +133,14 @@ public resourcesQuery = "(oaftype exact organization)";
size=0; size=0;
} }
if(page <= this.pagingLimit || this.searchUtils.status == this.errorCodes.LOADING) { if(page <= this.pagingLimit || this.searchUtils.status == this.errorCodes.LOADING) {
if(parameters!= null && parameters != '' ) { // if(parameters!= null && parameters != '' ) {
this.csvParams ="&fq=( "+this.resourcesQuery + "and (" + parameters + "))"; // this.csvParams ="&fq=( "+this.resourcesQuery + "and (" + parameters + "))";
}else{ // }else{
this.csvParams ="&fq="+this.resourcesQuery; // this.csvParams ="&fq="+this.resourcesQuery;
} // }
this.csvParams = (parameters ? ("&fq=("+parameters) : "") + (parameters ? ")" : "");
this.csvParams += (refineFieldsFilterQuery ? refineFieldsFilterQuery : "");
//var errorCodes:ErrorCodes = new ErrorCodes(); //var errorCodes:ErrorCodes = new ErrorCodes();
this.searchUtils.status = this.errorCodes.LOADING; this.searchUtils.status = this.errorCodes.LOADING;

View File

@ -135,14 +135,18 @@ export class SearchProjectsComponent {
size=0; size=0;
} }
if(page <= this.pagingLimit || this.searchUtils.status == this.errorCodes.LOADING) { if(page <= this.pagingLimit || this.searchUtils.status == this.errorCodes.LOADING) {
if(parameters!= null && parameters != '' ) { // if(parameters!= null && parameters != '' ) {
this.csvParams ="&fq=( "+this.resourcesQuery + "and (" + parameters + "))"; // this.csvParams ="&fq=( "+this.resourcesQuery + "and (" + parameters + "))";
}else{ // }else{
this.csvParams ="&fq="+this.resourcesQuery; // this.csvParams ="&fq="+this.resourcesQuery;
} // }
this.csvParams += (refineFieldsFilterQuery?refineFieldsFilterQuery:''); // this.csvParams += (refineFieldsFilterQuery?refineFieldsFilterQuery:'');
//
// //var errorCodes:ErrorCodes = new ErrorCodes();
this.csvParams = (parameters ? ("&fq=("+parameters) : "") + (parameters ? ")" : "");
this.csvParams += (refineFieldsFilterQuery ? refineFieldsFilterQuery : "");
//var errorCodes:ErrorCodes = new ErrorCodes();
this.searchUtils.status = this.errorCodes.LOADING; this.searchUtils.status = this.errorCodes.LOADING;
//this.searchPage.openLoading(); //this.searchPage.openLoading();
this.disableForms = true; this.disableForms = true;

View File

@ -13,7 +13,7 @@ import {RangeFilter} from "../utils/rangeFilter/rangeFilterHelperClasses.class";
@Component({ @Component({
selector: 'search-research-results', selector: 'search-research-results',
template: ` template: `
<new-search-page <new-search-page
pageTitle="{{(simpleView?'':'Advanced ')}} Search for {{ getEntityName(resultType, true, true) | titlecase }}" pageTitle="{{(simpleView?'':'Advanced ')}} Search for {{ getEntityName(resultType, true, true) | titlecase }}"
[entityType]="resultType" [entityType]="resultType"
@ -149,12 +149,13 @@ export class SearchResearchResultsComponent {
size = 0; size = 0;
} }
if (page <= this.pagingLimit || this.searchUtils.status == this.errorCodes.LOADING) { if (page <= this.pagingLimit || this.searchUtils.status == this.errorCodes.LOADING) {
if (parameters != null && parameters != '') { // if (parameters != null && parameters != '') {
this.csvParams = "&fq=(" + this.resourcesQuery + " and (" + parameters + "))"; // this.csvParams = "&fq=(" + this.resourcesQuery + " and (" + parameters + "))";
} else { // } else {
this.csvParams = "&fq=" + this.resourcesQuery; // this.csvParams = "&fq=" + this.resourcesQuery;
} // }
this.csvParams += (refineFieldsFilterQuery ? refineFieldsFilterQuery : ''); this.csvParams = (parameters ? ("&fq=("+parameters) : "") + (parameters ? ")" : "");
this.csvParams += (refineFieldsFilterQuery ? refineFieldsFilterQuery : "");
this.searchUtils.status = this.errorCodes.LOADING; this.searchUtils.status = this.errorCodes.LOADING;
this.disableForms = true; this.disableForms = true;

View File

@ -13,7 +13,7 @@ import {Router} from "@angular/router";
<option *ngIf="simpleView && (showResearchOutcomes + showDataProviders + showOrganizations + showProjects )>1 " value="all">All content</option> <option *ngIf="simpleView && (showResearchOutcomes + showDataProviders + showOrganizations + showProjects )>1 " value="all">All content</option>
<option *ngIf="showResearchOutcomes" value="result">Research outcomes</option> <option *ngIf="showResearchOutcomes" value="result">Research outcomes</option>
<option *ngIf="showProjects" value="project">Projects</option> <option *ngIf="showProjects" value="project">Projects</option>
<option *ngIf="showDataProviders" value="content provider">Content providers</option> <option *ngIf="showDataProviders" value="dataprovider">Content providers</option>
<option *ngIf="showOrganizations" value="organization">Organizations</option> <option *ngIf="showOrganizations" value="organization">Organizations</option>
</select> </select>
<button *ngIf="!show && currentEntity" class="uk-select uk-width-auto portal-box uk-text-small"> <button *ngIf="!show && currentEntity" class="uk-select uk-width-auto portal-box uk-text-small">
@ -92,7 +92,7 @@ export class EntitiesSelectionComponent {
url = (simpleView?this.properties.searchLinkToResults:this.properties.searchLinkToAdvancedResults); url = (simpleView?this.properties.searchLinkToResults:this.properties.searchLinkToAdvancedResults);
}else if(this.selectedEntity == "project"){ }else if(this.selectedEntity == "project"){
url = (simpleView?this.properties.searchLinkToProjects:this.properties.searchLinkToAdvancedProjects); url = (simpleView?this.properties.searchLinkToProjects:this.properties.searchLinkToAdvancedProjects);
}else if(this.selectedEntity == "content provider"){ }else if(this.selectedEntity == "dataprovider"){
url = (simpleView?this.properties.searchLinkToDataProviders:this.properties.searchLinkToAdvancedDataProviders); url = (simpleView?this.properties.searchLinkToDataProviders:this.properties.searchLinkToAdvancedDataProviders);
}else if(this.selectedEntity == "organization"){ }else if(this.selectedEntity == "organization"){
url = (simpleView?this.properties.searchLinkToOrganizations:this.properties.searchLinkToAdvancedOrganizations); url = (simpleView?this.properties.searchLinkToOrganizations:this.properties.searchLinkToAdvancedOrganizations);

View File

@ -62,7 +62,7 @@ export class NewSearchPageComponent {
@Input() usedBy: string = "search"; @Input() usedBy: string = "search";
@Input() showResultCount: boolean = true; @Input() showResultCount: boolean = true;
@Input() showMoreFilterValuesInline: boolean = true; @Input() showMoreFilterValuesInline: boolean = true;
@Input() filterValuesNum: number = 5; @Input() filterValuesNum: number = 6;
@Input() keywordFields = []; @Input() keywordFields = [];
@Input() simpleView: boolean = true; @Input() simpleView: boolean = true;
@Input() formPlaceholderText = "Type Keywords..."; @Input() formPlaceholderText = "Type Keywords...";
@ -695,7 +695,15 @@ export class NewSearchPageComponent {
allFqs += "&type=software"; allFqs += "&type=software";
} else if (this.entityType == "other") { } else if (this.entityType == "other") {
allFqs += "&type=other"; allFqs += "&type=other";
} else if(this.entityType == "project") {
allFqs += "&type=projects";
} else if(this.entityType == "organization") {
allFqs += "&type=organizations";
} else if(this.entityType == "dataprovider") {
allFqs += "&type=datasources";
} }
console.log("AllFqs (check type): "+allFqs);
console.log("type: "+this.entityType);
// var keyword = URLparams['keyword']; // var keyword = URLparams['keyword'];
// var doiQuery = ""; // var doiQuery = "";
// var keywordQuery = ""; // var keywordQuery = "";

View File

@ -35,7 +35,8 @@ export class SearchDataprovidersService {
} }
//((oaftype exact datasource) and(collectedfromdatasourceid exact "openaire____::47ce9e9f4fad46e732cff06419ecaabb")) //((oaftype exact datasource) and(collectedfromdatasourceid exact "openaire____::47ce9e9f4fad46e732cff06419ecaabb"))
advancedSearchDataproviders (params: string, page: number, size: number, properties: EnvProperties, refineParams:string=null, refineFields:string[] =null, refineQuery:string = null ):any { advancedSearchDataproviders (params: string, page: number, size: number, properties: EnvProperties, refineParams:string=null, refineFields:string[] =null, refineQuery:string = null ):any {
let url = properties.searchAPIURLLAst+"resources2/?format=json&type=datasources"; // &type=datasources
let url = properties.searchAPIURLLAst+"resources2/?format=json";
if(params!= null && params != '' ) { if(params!= null && params != '' ) {
url +="&query=(" + params + ")"; url +="&query=(" + params + ")";

View File

@ -57,7 +57,8 @@ export class SearchOrganizationsService {
.pipe(map(res => [res['meta'].total, this.parseResults(res['results']),RefineResultsUtils.parse(res['refineResults'],refineFields, "organization")])); .pipe(map(res => [res['meta'].total, this.parseResults(res['results']),RefineResultsUtils.parse(res['refineResults'],refineFields, "organization")]));
} }
advancedSearchOrganizations (params: string, page: number, size: number, properties:EnvProperties, refineParams:string=null, refineFields:string[] =null, refineQuery:string = null ):any { advancedSearchOrganizations (params: string, page: number, size: number, properties:EnvProperties, refineParams:string=null, refineFields:string[] =null, refineQuery:string = null ):any {
let url = properties.searchAPIURLLAst+"resources2/?format=json&type=organizations"; // &type=organizations
let url = properties.searchAPIURLLAst+"resources2/?format=json";
var basicQuery = "(reldatasourcecompatibilityid exact driver or reldatasourcecompatibilityid exact driver-openaire2.0 or " + var basicQuery = "(reldatasourcecompatibilityid exact driver or reldatasourcecompatibilityid exact driver-openaire2.0 or " +
"reldatasourcecompatibilityid exact openaire2.0 or reldatasourcecompatibilityid exact openaire3.0 or " + "reldatasourcecompatibilityid exact openaire2.0 or reldatasourcecompatibilityid exact openaire3.0 or " +
"reldatasourcecompatibilityid exact openaire2.0_data or reldatasourcecompatibilityid exact hostedBy or relproject=*)"; "reldatasourcecompatibilityid exact openaire2.0_data or reldatasourcecompatibilityid exact hostedBy or relproject=*)";

View File

@ -52,7 +52,8 @@ export class SearchProjectsService {
.pipe(map(res => [res['meta'].total, this.parseResults(res['results'])])); .pipe(map(res => [res['meta'].total, this.parseResults(res['results'])]));
} }
advancedSearchProjects (params: string, page: number, size: number, properties:EnvProperties, refineParams:string=null, refineFields:string[] =null, refineQuery:string = null ):any { advancedSearchProjects (params: string, page: number, size: number, properties:EnvProperties, refineParams:string=null, refineFields:string[] =null, refineQuery:string = null ):any {
let url = properties.searchAPIURLLAst+"resources2/?format=json&type=projects"; // &type=projects
let url = properties.searchAPIURLLAst+"resources2/?format=json";
// var basicQuery = "(oaftype exact project) " // var basicQuery = "(oaftype exact project) "
// url += "?query="; // url += "?query=";
if(params!= null && params != '' ) { if(params!= null && params != '' ) {