[Library|Trunk]

For connect search pages, replace  community Id with customFilter



git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-services-library/trunk/ng-openaire-library/src/app@56070 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
argiro.kokogiannaki 2019-06-13 12:31:39 +00:00
parent c30ccd8ce3
commit f1a97a93a4
19 changed files with 39 additions and 97 deletions

View File

@ -24,7 +24,7 @@ import{EnvProperties} from '../../utils/properties/env-properties';
[csvParams]="csvParams" csvPath="datasets" simpleSearchLink="/search/find/datasets" [csvParams]="csvParams" csvPath="datasets" simpleSearchLink="/search/find/datasets"
[disableForms]="disableForms" [disableForms]="disableForms"
[loadPaging]="loadPaging" [loadPaging]="loadPaging"
[oldTotalResults]="oldTotalResults" [(connectCommunityId)]=connectCommunityId [piwikSiteId]=piwikSiteId [oldTotalResults]="oldTotalResults" [piwikSiteId]=piwikSiteId
searchFormClass="datasetsSearchForm" searchFormClass="datasetsSearchForm"
[(sort)]=sort > [(sort)]=sort >
</advanced-search-page> </advanced-search-page>
@ -37,7 +37,6 @@ export class AdvancedSearchDatasetsComponent {
private errorMessages: ErrorMessagesComponent; private errorMessages: ErrorMessagesComponent;
properties:EnvProperties; properties:EnvProperties;
@Input() piwikSiteId = null; @Input() piwikSiteId = null;
@Input() connectCommunityId: string;
@Input() customFilter:SearchCustomFilter= null; @Input() customFilter:SearchCustomFilter= null;
public results =[]; public results =[];
@ -101,7 +100,6 @@ export class AdvancedSearchDatasetsComponent {
this.selectedFields =[]; this.selectedFields =[];
this.searchPage.selectedFields = this.selectedFields; this.searchPage.selectedFields = this.selectedFields;
this.searchPage.fieldIdsMap = this.fieldIdsMap; this.searchPage.fieldIdsMap = this.fieldIdsMap;
this.searchPage.connectCommunityId = this.connectCommunityId;
this.searchPage.customFilter = this.customFilter; this.searchPage.customFilter = this.customFilter;
this.searchPage.getSelectedFiltersFromUrl(params); this.searchPage.getSelectedFiltersFromUrl(params);
this.getResults(this.searchPage.createQueryParameters(), this.searchUtils.page, this.searchUtils.size, this.searchUtils.sortBy); this.getResults(this.searchPage.createQueryParameters(), this.searchUtils.page, this.searchUtils.size, this.searchUtils.sortBy);

View File

@ -24,7 +24,7 @@ import{EnvProperties} from '../../utils/properties/env-properties';
[csvParams]="csvParams" csvPath="other" simpleSearchLink="/search/find/other" [csvParams]="csvParams" csvPath="other" simpleSearchLink="/search/find/other"
[disableForms]="disableForms" [disableForms]="disableForms"
[loadPaging]="loadPaging" [loadPaging]="loadPaging"
[oldTotalResults]="oldTotalResults" [(connectCommunityId)]=connectCommunityId [piwikSiteId]=piwikSiteId [oldTotalResults]="oldTotalResults" [piwikSiteId]=piwikSiteId
searchFormClass="orpsSearchForm" searchFormClass="orpsSearchForm"
[(sort)]=sort > [(sort)]=sort >
</advanced-search-page> </advanced-search-page>
@ -37,7 +37,6 @@ export class AdvancedSearchOrpsComponent {
private errorMessages: ErrorMessagesComponent; private errorMessages: ErrorMessagesComponent;
properties:EnvProperties; properties:EnvProperties;
@Input() piwikSiteId = null; @Input() piwikSiteId = null;
@Input() connectCommunityId: string;
@Input() customFilter:SearchCustomFilter= null; @Input() customFilter:SearchCustomFilter= null;
public results =[]; public results =[];
@ -101,7 +100,6 @@ export class AdvancedSearchOrpsComponent {
this.selectedFields =[]; this.selectedFields =[];
this.searchPage.selectedFields = this.selectedFields; this.searchPage.selectedFields = this.selectedFields;
this.searchPage.fieldIdsMap = this.fieldIdsMap; this.searchPage.fieldIdsMap = this.fieldIdsMap;
this.searchPage.connectCommunityId = this.connectCommunityId;
this.searchPage.customFilter = this.customFilter; this.searchPage.customFilter = this.customFilter;
this.searchPage.getSelectedFiltersFromUrl(params); this.searchPage.getSelectedFiltersFromUrl(params);
this.getResults(this.searchPage.createQueryParameters(), this.searchUtils.page, this.searchUtils.size, this.searchUtils.sortBy); this.getResults(this.searchPage.createQueryParameters(), this.searchUtils.page, this.searchUtils.size, this.searchUtils.sortBy);

View File

@ -26,7 +26,7 @@ import{EnvProperties} from '../../utils/properties/env-properties';
[loadPaging]="loadPaging" [loadPaging]="loadPaging"
[oldTotalResults]="oldTotalResults" [oldTotalResults]="oldTotalResults"
[(openaireLink)]=openaireLink [(openaireLink)]=openaireLink
[(connectCommunityId)]=connectCommunityId [piwikSiteId]=piwikSiteId [piwikSiteId]=piwikSiteId
searchFormClass="publicationsSearchForm" searchFormClass="publicationsSearchForm"
[(sort)]=sort > [(sort)]=sort >
</advanced-search-page> </advanced-search-page>
@ -52,7 +52,6 @@ export class AdvancedSearchPublicationsComponent {
public loadPaging: boolean = true; public loadPaging: boolean = true;
public oldTotalResults: number = 0; public oldTotalResults: number = 0;
@Input() openaireLink: string ; @Input() openaireLink: string ;
@Input() connectCommunityId: string;
@Input() customFilter:SearchCustomFilter= null; @Input() customFilter:SearchCustomFilter= null;
public pagingLimit: number = 0; public pagingLimit: number = 0;
public isPiwikEnabled; public isPiwikEnabled;
@ -105,7 +104,6 @@ export class AdvancedSearchPublicationsComponent {
this.selectedFields =[]; this.selectedFields =[];
this.searchPage.selectedFields = this.selectedFields; this.searchPage.selectedFields = this.selectedFields;
this.searchPage.fieldIdsMap = this.fieldIdsMap; this.searchPage.fieldIdsMap = this.fieldIdsMap;
this.searchPage.connectCommunityId = this.connectCommunityId;
this.searchPage.customFilter = this.customFilter; this.searchPage.customFilter = this.customFilter;
this.searchPage.getSelectedFiltersFromUrl(params); this.searchPage.getSelectedFiltersFromUrl(params);
this.getResults(this.searchPage.createQueryParameters(), this.searchUtils.page, this.searchUtils.size, this.searchUtils.sortBy); this.getResults(this.searchPage.createQueryParameters(), this.searchUtils.page, this.searchUtils.size, this.searchUtils.sortBy);

View File

@ -24,7 +24,7 @@ import{EnvProperties} from '../../utils/properties/env-properties';
[csvParams]="csvParams" csvPath="software" simpleSearchLink="/search/find/software" [csvParams]="csvParams" csvPath="software" simpleSearchLink="/search/find/software"
[disableForms]="disableForms" [disableForms]="disableForms"
[loadPaging]="loadPaging" [loadPaging]="loadPaging"
[oldTotalResults]="oldTotalResults" [(connectCommunityId)]=connectCommunityId [piwikSiteId]=piwikSiteId [oldTotalResults]="oldTotalResults" [piwikSiteId]=piwikSiteId
searchFormClass="softwareSearchForm" searchFormClass="softwareSearchForm"
[(sort)]=sort > [(sort)]=sort >
</advanced-search-page> </advanced-search-page>
@ -36,7 +36,6 @@ export class AdvancedSearchSoftwareComponent {
private errorCodes: ErrorCodes; private errorCodes: ErrorCodes;
private errorMessages: ErrorMessagesComponent; private errorMessages: ErrorMessagesComponent;
@Input() piwikSiteId = null; @Input() piwikSiteId = null;
@Input() connectCommunityId: string;
@Input() customFilter:SearchCustomFilter= null; @Input() customFilter:SearchCustomFilter= null;
public results =[]; public results =[];
public filters =[]; public filters =[];
@ -101,7 +100,6 @@ export class AdvancedSearchSoftwareComponent {
this.selectedFields =[]; this.selectedFields =[];
this.searchPage.selectedFields = this.selectedFields; this.searchPage.selectedFields = this.selectedFields;
this.searchPage.fieldIdsMap = this.fieldIdsMap; this.searchPage.fieldIdsMap = this.fieldIdsMap;
this.searchPage.connectCommunityId = this.connectCommunityId;
this.searchPage.customFilter = this.customFilter; this.searchPage.customFilter = this.customFilter;
this.searchPage.getSelectedFiltersFromUrl(params); this.searchPage.getSelectedFiltersFromUrl(params);
this.getResults(this.searchPage.createQueryParameters(), this.searchUtils.page, this.searchUtils.size, this.searchUtils.sortBy); this.getResults(this.searchPage.createQueryParameters(), this.searchUtils.page, this.searchUtils.size, this.searchUtils.sortBy);

View File

@ -155,7 +155,8 @@
</search-result> </search-result>
</div> </div>
<div *ngIf = "keyword.length == 0 && activeTab=='publications'" class ="uk-animation-fade" > <div *ngIf = "keyword.length == 0 && activeTab=='publications'" class ="uk-animation-fade" >
<browse-entities [(properties)]=properties entityName="publication" baseUrl="/search/find/publications" [refineFields]=searchFields.RESULT_REFINE_FIELDS [connectCommunityId]=connectCommunityId [customFilter]="customFilter"></browse-entities> <browse-entities [(properties)]=properties entityName="publication"
baseUrl="/search/find/publications" [refineFields]=searchFields.RESULT_REFINE_FIELDS [customFilter]="customFilter"></browse-entities>
</div> </div>
<!--/li> <!--/li>
<li--> <li-->
@ -175,7 +176,7 @@
</search-result> </search-result>
</div> </div>
<div *ngIf = "keyword.length == 0 && activeTab=='research data'" class ="uk-animation-fade"> <div *ngIf = "keyword.length == 0 && activeTab=='research data'" class ="uk-animation-fade">
<browse-entities [(properties)]=properties entityName="dataset" baseUrl="/search/find/datasets" [refineFields]=searchFields.RESULT_REFINE_FIELDS [connectCommunityId]=connectCommunityId [customFilter]="customFilter"></browse-entities> <browse-entities [(properties)]=properties entityName="dataset" baseUrl="/search/find/datasets" [refineFields]=searchFields.RESULT_REFINE_FIELDS [customFilter]="customFilter"></browse-entities>
</div> </div>
<!--/li> <!--/li>
<li--> <li-->
@ -194,7 +195,7 @@
</search-result> </search-result>
</div> </div>
<div *ngIf = "keyword.length == 0 && activeTab=='software'" class ="uk-animation-fade"> <div *ngIf = "keyword.length == 0 && activeTab=='software'" class ="uk-animation-fade">
<browse-entities [(properties)]=properties entityName="software" baseUrl="/search/find/software" [refineFields]=searchFields.RESULT_REFINE_FIELDS [connectCommunityId]=connectCommunityId [customFilter]="customFilter"></browse-entities> <browse-entities [(properties)]=properties entityName="software" baseUrl="/search/find/software" [refineFields]=searchFields.RESULT_REFINE_FIELDS [customFilter]="customFilter"></browse-entities>
</div> </div>
<!--/li> <!--/li>
<li--> <li-->
@ -213,7 +214,7 @@
</search-result> </search-result>
</div> </div>
<div *ngIf = "keyword.length == 0 && activeTab=='other research products'" class ="uk-animation-fade"> <div *ngIf = "keyword.length == 0 && activeTab=='other research products'" class ="uk-animation-fade">
<browse-entities [(properties)]=properties entityName="other" baseUrl="/search/find/other" [refineFields]=searchFields.RESULT_REFINE_FIELDS [connectCommunityId]=connectCommunityId [customFilter]="customFilter"></browse-entities> <browse-entities [(properties)]=properties entityName="other" baseUrl="/search/find/other" [refineFields]=searchFields.RESULT_REFINE_FIELDS [customFilter]="customFilter"></browse-entities>
</div> </div>
<!--/li> <!--/li>
<li--> <li-->

View File

@ -101,7 +101,6 @@ export class SearchComponent {
properties: EnvProperties; properties: EnvProperties;
@Input() logoURL; @Input() logoURL;
@Input() name; @Input() name;
@Input() connectCommunityId =null;
@Input() customFilter:SearchCustomFilter= null; @Input() customFilter:SearchCustomFilter= null;
@Input() piwikSiteId = null; @Input() piwikSiteId = null;
@Input() formPlaceholderText = "Search for research results, projects, content providers & organizations in OpenAIRE"; @Input() formPlaceholderText = "Search for research results, projects, content providers & organizations in OpenAIRE";
@ -155,7 +154,7 @@ public subPub;public subData; public subSoftware; public subOrps; public subProj
this.config.getCommunityInformation(this.properties, (this.connectCommunityId)?this.connectCommunityId:this.properties.adminToolsCommunity ).subscribe(data => { this.config.getCommunityInformation(this.properties, (this.customFilter)?this.customFilter.valueId :this.properties.adminToolsCommunity ).subscribe(data => {
var showEntity = {}; var showEntity = {};
for(var i=0; i< data['entities'].length; i++){ for(var i=0; i< data['entities'].length; i++){
@ -168,7 +167,8 @@ public subPub;public subData; public subSoftware; public subOrps; public subProj
this.showDataProviders = showEntity["datasource"]; this.showDataProviders = showEntity["datasource"];
this.showSoftware = showEntity["software"]; this.showSoftware = showEntity["software"];
this.showOrps = showEntity["orp"]; this.showOrps = showEntity["orp"];
if(this.connectCommunityId){ console.log(this.customFilter)
if(this.customFilter && this.customFilter.queryFieldName=="communityId"){
this.showProjects = false; this.showProjects = false;
this.showOrganizations = false; this.showOrganizations = false;
this.showDataProviders = false; this.showDataProviders = false;
@ -256,7 +256,7 @@ public subPub;public subData; public subSoftware; public subOrps; public subProj
this.fetchPublications.searchUtils.status != this.errorCodes.NONE /*&& this.fetchPublications.searchUtils.status != this.errorCodes.NONE /*&&
this.fetchPublications.searchUtils.status != this.errorCodes.ERROR*/) { this.fetchPublications.searchUtils.status != this.errorCodes.ERROR*/) {
this.reloadPublications = false; this.reloadPublications = false;
this.fetchPublications.getResultsByKeyword(this.keyword, 1, 10,this.properties, this.connectCommunityId, this.customFilter); this.fetchPublications.getResultsByKeyword(this.keyword, 1, 10,this.properties, this.customFilter);
this.linkToSearchPublications = this.properties.searchLinkToPublications;// + "?keyword=" + this.keyword; this.linkToSearchPublications = this.properties.searchLinkToPublications;// + "?keyword=" + this.keyword;
} }
} }
@ -267,7 +267,7 @@ public subPub;public subData; public subSoftware; public subOrps; public subProj
this.fetchDatasets.searchUtils.status != this.errorCodes.NONE /*&& this.fetchDatasets.searchUtils.status != this.errorCodes.NONE /*&&
this.fetchDatasets.searchUtils.status != this.errorCodes.ERROR*/) { this.fetchDatasets.searchUtils.status != this.errorCodes.ERROR*/) {
this.reloadDatasets = false; this.reloadDatasets = false;
this.fetchDatasets.getResultsByKeyword(this.keyword, 1, 10,this.properties, this.connectCommunityId, this.customFilter); this.fetchDatasets.getResultsByKeyword(this.keyword, 1, 10,this.properties, this.customFilter);
this.linkToSearchDatasets =this.properties.searchLinkToDatasets;// + "?keyword=" + this.keyword; this.linkToSearchDatasets =this.properties.searchLinkToDatasets;// + "?keyword=" + this.keyword;
} }
} }
@ -280,7 +280,7 @@ public subPub;public subData; public subSoftware; public subOrps; public subProj
( this.fetchSoftware.searchUtils.status == this.errorCodes.LOADING || ( this.fetchSoftware.searchUtils.status == this.errorCodes.LOADING ||
this.fetchSoftware.searchUtils.status == this.errorCodes.DONE )*/) { this.fetchSoftware.searchUtils.status == this.errorCodes.DONE )*/) {
this.reloadSoftware = false; this.reloadSoftware = false;
this.fetchSoftware.getResultsByKeyword(this.keyword, 1, 10,this.properties, this.connectCommunityId, this.customFilter); this.fetchSoftware.getResultsByKeyword(this.keyword, 1, 10,this.properties, this.customFilter);
this.linkToSearchSoftware = this.properties.searchLinkToSoftware;// + "?keyword=" + this.keyword; this.linkToSearchSoftware = this.properties.searchLinkToSoftware;// + "?keyword=" + this.keyword;
} }
} }
@ -291,7 +291,7 @@ public subPub;public subData; public subSoftware; public subOrps; public subProj
this.fetchOrps.searchUtils.status != this.errorCodes.NONE /*&& this.fetchOrps.searchUtils.status != this.errorCodes.NONE /*&&
this.fetchOrps.searchUtils.status != this.errorCodes.ERROR*/) { this.fetchOrps.searchUtils.status != this.errorCodes.ERROR*/) {
this.reloadOrps = false; this.reloadOrps = false;
this.fetchOrps.getResultsByKeyword(this.keyword, 1, 10,this.properties, this.connectCommunityId, this.customFilter); this.fetchOrps.getResultsByKeyword(this.keyword, 1, 10,this.properties, this.customFilter);
this.linkToSearchOrps =this.properties.searchLinkToOrps; this.linkToSearchOrps =this.properties.searchLinkToOrps;
} }
} }
@ -362,7 +362,7 @@ public subPub;public subData; public subSoftware; public subOrps; public subProj
} }
private count() { private count() {
var refineParams = this.connectCommunityId?("&fq="+StringUtils.URIEncode("communityId exact " + StringUtils.quote((this.connectCommunityId )))):null; var refineParams = null;
if(this.customFilter){ if(this.customFilter){
refineParams = (refineParams?(refineParams+'&'):'')+"&fq="+StringUtils.URIEncode(this.customFilter.queryFieldName + " exact " + StringUtils.quote((this.customFilter.valueId ))); refineParams = (refineParams?(refineParams+'&'):'')+"&fq="+StringUtils.URIEncode(this.customFilter.queryFieldName + " exact " + StringUtils.quote((this.customFilter.valueId )));
} }

View File

@ -42,7 +42,6 @@ export class AdvancedSearchPageComponent {
@Input() loadPaging: boolean = true; @Input() loadPaging: boolean = true;
@Input() oldTotalResults: number = 0; @Input() oldTotalResults: number = 0;
@Input() openaireLink: string; @Input() openaireLink: string;
@Input() connectCommunityId: string;
@Input() customFilter:SearchCustomFilter= null; @Input() customFilter:SearchCustomFilter= null;
@Input() sort: boolean = false; @Input() sort: boolean = false;
@Input() searchFormClass: string = "searchForm"; @Input() searchFormClass: string = "searchForm";
@ -254,11 +253,6 @@ export class AdvancedSearchPageComponent {
} }
} }
//community
if(this.connectCommunityId ){
params += (countParams == 0 ? "" : " and " ) + "communityId exact "+'"' + this.connectCommunityId +'"' + " ";
countParams++;
}
if(this.customFilter){ if(this.customFilter){
params+= (countParams == 0 ? "" : " and " ) + this.customFilter.queryFieldName + " exact " + StringUtils.quote((this.customFilter.valueId )); params+= (countParams == 0 ? "" : " and " ) + this.customFilter.queryFieldName + " exact " + StringUtils.quote((this.customFilter.valueId ));
} }

View File

@ -40,7 +40,6 @@ export class BrowseEntitiesComponent {
@Input() public entityName:string = ""; @Input() public entityName:string = "";
@Input() public refineFields: string[] ;//= this.searchFields.RESULT_REFINE_FIELDS; @Input() public refineFields: string[] ;//= this.searchFields.RESULT_REFINE_FIELDS;
@Input() properties:EnvProperties; @Input() properties:EnvProperties;
@Input() connectCommunityId =null;
@Input() customFilter:SearchCustomFilter= null; @Input() customFilter:SearchCustomFilter= null;
public sub: any; public sub: any;
@ -74,7 +73,7 @@ export class BrowseEntitiesComponent {
private getStats(){ private getStats(){
this.status = this.errorCodes.LOADING; this.status = this.errorCodes.LOADING;
var refineParams = this.connectCommunityId?("&fq="+StringUtils.URIEncode("communityId exact " + StringUtils.quote((this.connectCommunityId )))):null; var refineParams = null;
if(this.customFilter){ if(this.customFilter){
refineParams = (refineParams?(refineParams+'&'):'')+"&fq="+StringUtils.URIEncode(this.customFilter.queryFieldName + " exact " + StringUtils.quote((this.customFilter.valueId ))); refineParams = (refineParams?(refineParams+'&'):'')+"&fq="+StringUtils.URIEncode(this.customFilter.queryFieldName + " exact " + StringUtils.quote((this.customFilter.valueId )));
} }

View File

@ -15,7 +15,6 @@ export class SearchFilterComponent {
@Input() showResultCount:boolean = true; @Input() showResultCount:boolean = true;
@Input() isDisabled:boolean = false; @Input() isDisabled:boolean = false;
@Input() addShowMore:boolean = true; @Input() addShowMore:boolean = true;
@Input() connectCommunityId:string
public showAll:boolean = false; public showAll:boolean = false;
public _maxCharacters:number =28; public _maxCharacters:number =28;

View File

@ -82,7 +82,7 @@
</div> </div>
<div class="uk-text-large">Filter By:</div> <div class="uk-text-large">Filter By:</div>
<search-filter *ngFor="let filter of filters " [addShowMore]=false [isDisabled]="disableForms" [filter]="filter" [showResultCount]=showResultCount (onFilterChange)="filterChanged($event)" [(connectCommunityId)]=connectCommunityId></search-filter> <search-filter *ngFor="let filter of filters " [addShowMore]=false [isDisabled]="disableForms" [filter]="filter" [showResultCount]=showResultCount (onFilterChange)="filterChanged($event)" ></search-filter>
</div> </div>
</div> </div>
@ -139,7 +139,7 @@
<search-download *ngIf= "!showUnknownFilters && searchUtils.totalResults > 0 && entityType != 'community'" class="uk-width-1-2" [loadPaging]="loadPaging" [oldTotalResults]="oldTotalResults" [(searchUtils)] = "searchUtils" [type]="csvPath" [csvParams]="csvParams" [totalResults]="searchUtils.totalResults"></search-download> <search-download *ngIf= "!showUnknownFilters && searchUtils.totalResults > 0 && entityType != 'community'" class="uk-width-1-2" [loadPaging]="loadPaging" [oldTotalResults]="oldTotalResults" [(searchUtils)] = "searchUtils" [type]="csvPath" [csvParams]="csvParams" [totalResults]="searchUtils.totalResults"></search-download>
</div> </div>
</div> </div>
<search-filter *ngFor="let filter of filters " [isDisabled]="disableForms" [filter]="filter" [showResultCount]=showResultCount (onFilterChange)="filterChanged($event)" [(connectCommunityId)]=connectCommunityId></search-filter> <search-filter *ngFor="let filter of filters " [isDisabled]="disableForms" [filter]="filter" [showResultCount]=showResultCount (onFilterChange)="filterChanged($event)" ></search-filter>
<helper position="left" before="false"></helper> <helper position="left" before="false"></helper>
</div> </div>
<!-- </div> --> <!-- </div> -->

View File

@ -47,7 +47,6 @@ export class SearchPageComponent {
@Input() tableView: boolean = false; @Input() tableView: boolean = false;
@Input() searchFormClass: string = "searchForm"; @Input() searchFormClass: string = "searchForm";
@Input() openaireLink: string; @Input() openaireLink: string;
@Input() connectCommunityId: string;
@Input() customFilter:SearchCustomFilter= null; @Input() customFilter:SearchCustomFilter= null;
@Input() sort: boolean = false; @Input() sort: boolean = false;
@Input() mapUrl: string = ""; @Input() mapUrl: string = "";
@ -172,9 +171,6 @@ export class SearchPageComponent {
} }
allFqs += fq; allFqs += fq;
} }
}
if(this.connectCommunityId ){
allFqs+= "&fq="+StringUtils.URIEncode("communityId exact " + StringUtils.quote((this.connectCommunityId )));
} }
if(this.customFilter){ if(this.customFilter){
allFqs+= "&fq="+StringUtils.URIEncode(this.customFilter.queryFieldName + " exact " + StringUtils.quote((this.customFilter.valueId ))); allFqs+= "&fq="+StringUtils.URIEncode(this.customFilter.queryFieldName + " exact " + StringUtils.quote((this.customFilter.valueId )));
@ -226,9 +222,6 @@ export class SearchPageComponent {
} }
} }
if(this.connectCommunityId ){
allFqs+= "&fq="+StringUtils.URIEncode("communityId exact " + StringUtils.quote(this.connectCommunityId ));
}
var keyword = params['keyword']; var keyword = params['keyword'];
var doiQuery = ""; var doiQuery = "";
var keywordQuery = ""; var keywordQuery = "";
@ -311,19 +304,7 @@ export class SearchPageComponent {
filter.values = filteredValues; filter.values = filteredValues;
} }
} }
// else if(this.connectCommunityId && filter.filterId.indexOf("community")!=-1 ){
// var filteredValues = [];
// for(let filterValue of filter.values) {
// if(this.connectCommunityId != filterValue.id){
// filteredValues.push(filterValue);
// }else{
// filter.countSelectedValues-- ;
// }
// }
// if(filteredValues.length > 0){
// filter.values = filteredValues;
// }
// }
} }
return filters; return filters;
@ -347,15 +328,12 @@ export class SearchPageComponent {
for (let filter of filters){ for (let filter of filters){
var filterLimits=""; var filterLimits="";
if(filter.countSelectedValues > 0 ){//|| (this.connectCommunityId && filter.filterId.indexOf("community")!=-1)){ if(filter.countSelectedValues > 0 ){
for (let value of filter.values){ for (let value of filter.values){
if(value.selected == true){ if(value.selected == true){
filterLimits+=((filterLimits.length == 0)?'':',') +'"'+ (value.id)+'"'; filterLimits+=((filterLimits.length == 0)?'':',') +'"'+ (value.id)+'"';
} }
} }
// if(this.connectCommunityId && filter.filterId.indexOf("community")!=-1 ){
// filterLimits+=((filterLimits.length == 0)?'':',') +'"'+ StringUtils.URIEncode(this.connectCommunityId)+'"';
// }
this.queryParameters.set(filter.filterId,filterLimits); this.queryParameters.set(filter.filterId,filterLimits);
if(filterLimits.length > 0){ if(filterLimits.length > 0){
this.parameterNames.push(filter.filterId); this.parameterNames.push(filter.filterId);
@ -401,7 +379,7 @@ export class SearchPageComponent {
private createSearchQueryParameters(filters:Filter[]){ // called by goTo, result emited to and used by search find pages private createSearchQueryParameters(filters:Filter[]){ // called by goTo, result emited to and used by search find pages
var allFqs = ""; var allFqs = "";
for (let filter of filters){ for (let filter of filters){
if(filter.countSelectedValues > 0 ){//|| (this.connectCommunityId && filter.filterId.indexOf("community")!=-1)){ if(filter.countSelectedValues > 0 ){
var fq = ""; var fq = "";
var count_selected=0; var count_selected=0;
for (let value of filter.values){ for (let value of filter.values){
@ -410,18 +388,12 @@ export class SearchPageComponent {
fq+=(fq.length > 0 ? " " + filter.filterOperator + " ":"" ) + filter.filterId + " exact " + StringUtils.quote((value.id)); fq+=(fq.length > 0 ? " " + filter.filterOperator + " ":"" ) + filter.filterId + " exact " + StringUtils.quote((value.id));
} }
} }
// if(this.connectCommunityId && filter.filterId.indexOf("community")!=-1){
// count_selected++;
// fq+=(fq.length > 0 ? " " + filter.filterOperator + " ":"" ) + filter.filterId + " exact " + StringUtils.quote(StringUtils.URIEncode(this.connectCommunityId));
// }
fq="&fq="+StringUtils.URIEncode(fq); fq="&fq="+StringUtils.URIEncode(fq);
allFqs += fq; allFqs += fq;
} }
} }
if(this.connectCommunityId ){
allFqs+= "&fq="+StringUtils.URIEncode("communityId exact " + StringUtils.quote(this.connectCommunityId ));
}
//TODO --
var doiQuery = ""; var doiQuery = "";
var keywordQuery = ""; var keywordQuery = "";
if((this.searchUtils.keyword && this.searchUtils.keyword.length > 0)){ if((this.searchUtils.keyword && this.searchUtils.keyword.length > 0)){

View File

@ -30,7 +30,6 @@ import{EnvProperties} from '../../utils/properties/env-properties';
[(openaireLink)]=openaireLink [(openaireLink)]=openaireLink
[(advancedSearchParameters)]=advancedSearchParameters [(advancedSearchParameters)]=advancedSearchParameters
[piwikSiteId]=piwikSiteId [piwikSiteId]=piwikSiteId
[(connectCommunityId)]=connectCommunityId
[(sort)]=sort > [(sort)]=sort >
</search-page> </search-page>
<!--[(sortBy)]="sortBy"--> <!--[(sortBy)]="sortBy"-->
@ -46,7 +45,6 @@ export class SearchDatasetsComponent {
// public totalResults:number = 0 ; // public totalResults:number = 0 ;
public baseUrl:string; public baseUrl:string;
@Input() openaireLink: string ; @Input() openaireLink: string ;
@Input() connectCommunityId: string;
@Input() customFilter:SearchCustomFilter= null; @Input() customFilter:SearchCustomFilter= null;
@Input() advancedSearchParameters ; @Input() advancedSearchParameters ;
public searchUtils:SearchUtilsClass = new SearchUtilsClass(); public searchUtils:SearchUtilsClass = new SearchUtilsClass();
@ -109,7 +107,6 @@ properties: EnvProperties;
this.searchUtils.sortBy = ""; this.searchUtils.sortBy = "";
} }
this.searchPage.connectCommunityId = this.connectCommunityId;
this.searchPage.customFilter = this.customFilter; this.searchPage.customFilter = this.customFilter;
var queryParameters = this.searchPage.getQueryParametersFromUrl(params); var queryParameters = this.searchPage.getQueryParametersFromUrl(params);
this._getResults(queryParameters, refine, this.searchUtils.page, this.searchUtils.size, this.searchUtils.sortBy); this._getResults(queryParameters, refine, this.searchUtils.page, this.searchUtils.size, this.searchUtils.sortBy);

View File

@ -30,7 +30,6 @@ import{EnvProperties} from '../../utils/properties/env-properties';
[(openaireLink)]=openaireLink [(openaireLink)]=openaireLink
[(advancedSearchParameters)]=advancedSearchParameters [(advancedSearchParameters)]=advancedSearchParameters
[piwikSiteId]=piwikSiteId [piwikSiteId]=piwikSiteId
[(connectCommunityId)]=connectCommunityId
[(sort)]=sort > [(sort)]=sort >
</search-page> </search-page>
` `
@ -44,7 +43,6 @@ export class SearchOrpsComponent {
public filters: Filter[] =[]; public filters: Filter[] =[];
public baseUrl:string; public baseUrl:string;
@Input() openaireLink: string ; @Input() openaireLink: string ;
@Input() connectCommunityId: string;
@Input() customFilter:SearchCustomFilter= null; @Input() customFilter:SearchCustomFilter= null;
@Input() advancedSearchParameters ; @Input() advancedSearchParameters ;
public searchUtils:SearchUtilsClass = new SearchUtilsClass(); public searchUtils:SearchUtilsClass = new SearchUtilsClass();
@ -106,7 +104,6 @@ properties: EnvProperties;
this.searchUtils.sortBy = ""; this.searchUtils.sortBy = "";
} }
this.searchPage.connectCommunityId = this.connectCommunityId;
this.searchPage.customFilter = this.customFilter; this.searchPage.customFilter = this.customFilter;
var queryParameters = this.searchPage.getQueryParametersFromUrl(params); var queryParameters = this.searchPage.getQueryParametersFromUrl(params);
this._getResults(queryParameters, refine, this.searchUtils.page, this.searchUtils.size, this.searchUtils.sortBy); this._getResults(queryParameters, refine, this.searchUtils.page, this.searchUtils.size, this.searchUtils.sortBy);

View File

@ -2,13 +2,10 @@ import {Component, Input, ViewChild} from '@angular/core';
import {ActivatedRoute} from '@angular/router'; import {ActivatedRoute} from '@angular/router';
import {Location} from '@angular/common'; import {Location} from '@angular/common';
import { Filter, Value} from '../searchUtils/searchHelperClasses.class';
import {SearchPublicationsService} from '../../services/searchPublications.service'; import {SearchPublicationsService} from '../../services/searchPublications.service';
import {SearchResult} from '../../utils/entities/searchResult';
import {ErrorCodes} from '../../utils/properties/errorCodes'; import {ErrorCodes} from '../../utils/properties/errorCodes';
import {ErrorMessagesComponent} from '../../utils/errorMessages.component'; import {ErrorMessagesComponent} from '../../utils/errorMessages.component';
import {SearchFields, FieldDetails} from '../../utils/properties/searchFields'; import {SearchFields} from '../../utils/properties/searchFields';
import {SearchPageComponent} from '../searchUtils/searchPage.component'; import {SearchPageComponent} from '../searchUtils/searchPage.component';
import {SearchCustomFilter, SearchUtilsClass} from '../searchUtils/searchUtils.class'; import {SearchCustomFilter, SearchUtilsClass} from '../searchUtils/searchUtils.class';
import {DOI} from '../../utils/string-utils.class'; import {DOI} from '../../utils/string-utils.class';
@ -33,7 +30,6 @@ import{EnvProperties} from '../../utils/properties/env-properties';
[(openaireLink)]=openaireLink [(openaireLink)]=openaireLink
[(advancedSearchParameters)]=advancedSearchParameters [(advancedSearchParameters)]=advancedSearchParameters
[piwikSiteId]=piwikSiteId [piwikSiteId]=piwikSiteId
[(connectCommunityId)]=connectCommunityId
[(sort)]=sort > [(sort)]=sort >
</search-page> </search-page>
@ -69,7 +65,6 @@ export class SearchPublicationsComponent {
public loadPaging: boolean = true; public loadPaging: boolean = true;
public oldTotalResults: number = 0; public oldTotalResults: number = 0;
@Input() openaireLink: string; @Input() openaireLink: string;
@Input() connectCommunityId: string;
@Input() customFilter:SearchCustomFilter= null; @Input() customFilter:SearchCustomFilter= null;
@Input() advancedSearchParameters ; @Input() advancedSearchParameters ;
pagingLimit = 0; pagingLimit = 0;
@ -118,7 +113,6 @@ properties: EnvProperties;
this.searchUtils.sortBy = ""; this.searchUtils.sortBy = "";
} }
this.searchPage.connectCommunityId = this.connectCommunityId;
this.searchPage.customFilter = this.customFilter; this.searchPage.customFilter = this.customFilter;
var queryParameters = this.searchPage.getQueryParametersFromUrl(params); var queryParameters = this.searchPage.getQueryParametersFromUrl(params);
this._getResults(queryParameters, refine, this.searchUtils.page, this.searchUtils.size, this.searchUtils.sortBy); this._getResults(queryParameters, refine, this.searchUtils.page, this.searchUtils.size, this.searchUtils.sortBy);

View File

@ -27,10 +27,9 @@ import{EnvProperties} from '../../utils/properties/env-properties';
[loadPaging]="loadPaging" [loadPaging]="loadPaging"
[oldTotalResults]="oldTotalResults" [oldTotalResults]="oldTotalResults"
searchFormClass="softwareSearchForm" searchFormClass="softwareSearchForm"
[(openaireLink)]=openaireLinks [(openaireLink)]=openaireLink
[(advancedSearchParameters)]=advancedSearchParameters [(advancedSearchParameters)]=advancedSearchParameters
[piwikSiteId]=piwikSiteId [piwikSiteId]=piwikSiteId
[(connectCommunityId)]=connectCommunityId
[(sort)]=sort > [(sort)]=sort >
</search-page> </search-page>
` `
@ -40,7 +39,6 @@ export class SearchSoftwareComponent {
private errorCodes: ErrorCodes; private errorCodes: ErrorCodes;
private errorMessages: ErrorMessagesComponent; private errorMessages: ErrorMessagesComponent;
@Input() openaireLink: string ; @Input() openaireLink: string ;
@Input() connectCommunityId: string;
@Input() customFilter:SearchCustomFilter= null; @Input() customFilter:SearchCustomFilter= null;
@Input() advancedSearchParameters ; @Input() advancedSearchParameters ;
@Input() piwikSiteId = null; @Input() piwikSiteId = null;
@ -108,7 +106,6 @@ properties: EnvProperties;
this.searchUtils.sortBy = ""; this.searchUtils.sortBy = "";
} }
this.searchPage.connectCommunityId = this.connectCommunityId;
this.searchPage.customFilter = this.customFilter; this.searchPage.customFilter = this.customFilter;
var queryParameters = this.searchPage.getQueryParametersFromUrl(params); var queryParameters = this.searchPage.getQueryParametersFromUrl(params);
this._getResults(queryParameters, refine, this.searchUtils.page, this.searchUtils.size, this.searchUtils.sortBy); this._getResults(queryParameters, refine, this.searchUtils.page, this.searchUtils.size, this.searchUtils.sortBy);

View File

@ -40,7 +40,7 @@ export class FetchDatasets{
} }
public getResultsByKeyword(keyword:string, page: number, size: number, properties:EnvProperties, connectCommunityId=null, customFilter:SearchCustomFilter=null){ public getResultsByKeyword(keyword:string, page: number, size: number, properties:EnvProperties, customFilter:SearchCustomFilter=null){
var parameters = ""; var parameters = "";
if(keyword.length > 0){ if(keyword.length > 0){
var DOIs:string[] = DOI.getDOIsFromString(keyword); var DOIs:string[] = DOI.getDOIsFromString(keyword);
@ -58,7 +58,7 @@ export class FetchDatasets{
//var errorCodes:ErrorCodes = new ErrorCodes(); //var errorCodes:ErrorCodes = new ErrorCodes();
this.searchUtils.status = this.errorCodes.LOADING; this.searchUtils.status = this.errorCodes.LOADING;
var refineParams = (connectCommunityId)?("&fq="+StringUtils.URIEncode("communityId exact " + StringUtils.quote((connectCommunityId )))):null; var refineParams = null;
if(customFilter){ if(customFilter){
refineParams = (refineParams?(refineParams+'&'):'')+"&fq="+StringUtils.URIEncode(customFilter.queryFieldName + " exact " + StringUtils.quote((customFilter.valueId ))); refineParams = (refineParams?(refineParams+'&'):'')+"&fq="+StringUtils.URIEncode(customFilter.queryFieldName + " exact " + StringUtils.quote((customFilter.valueId )));
} }

View File

@ -41,7 +41,7 @@ export class FetchOrps{
} }
public getResultsByKeyword(keyword:string, page: number, size: number, properties:EnvProperties, connectCommunityId=null, customFilter:SearchCustomFilter=null){ public getResultsByKeyword(keyword:string, page: number, size: number, properties:EnvProperties, customFilter:SearchCustomFilter=null){
var parameters = ""; var parameters = "";
if(keyword.length > 0){ if(keyword.length > 0){
var DOIs:string[] = DOI.getDOIsFromString(keyword); var DOIs:string[] = DOI.getDOIsFromString(keyword);
@ -58,7 +58,7 @@ export class FetchOrps{
} }
this.searchUtils.status = this.errorCodes.LOADING; this.searchUtils.status = this.errorCodes.LOADING;
var refineParams = (connectCommunityId)?("&fq="+StringUtils.URIEncode("communityId exact " + StringUtils.quote((connectCommunityId )))):null; var refineParams = null;
if(customFilter){ if(customFilter){
refineParams = (refineParams?(refineParams+'&'):'')+"&fq="+StringUtils.URIEncode(customFilter.queryFieldName + " exact " + StringUtils.quote((customFilter.valueId ))); refineParams = (refineParams?(refineParams+'&'):'')+"&fq="+StringUtils.URIEncode(customFilter.queryFieldName + " exact " + StringUtils.quote((customFilter.valueId )));
} }

View File

@ -52,7 +52,7 @@ export class FetchPublications {
} }
} }
public getResultsByKeyword(keyword:string, page: number, size: number, properties:EnvProperties, connectCommunityId=null, customFilter:SearchCustomFilter=null){ public getResultsByKeyword(keyword:string, page: number, size: number, properties:EnvProperties, customFilter:SearchCustomFilter=null){
var parameters = ""; var parameters = "";
if(keyword.length > 0){ if(keyword.length > 0){
var DOIs:string[] = DOI.getDOIsFromString(keyword); var DOIs:string[] = DOI.getDOIsFromString(keyword);
@ -71,7 +71,7 @@ export class FetchPublications {
//var errorCodes:ErrorCodes = new ErrorCodes(); //var errorCodes:ErrorCodes = new ErrorCodes();
this.searchUtils.status = this.errorCodes.LOADING; this.searchUtils.status = this.errorCodes.LOADING;
var refineParams = (connectCommunityId)?("&fq="+StringUtils.URIEncode("communityId exact " + StringUtils.quote((connectCommunityId )))):null; var refineParams = null;
if(customFilter){ if(customFilter){
refineParams = (refineParams?(refineParams+'&'):'')+"&fq="+StringUtils.URIEncode(customFilter.queryFieldName + " exact " + StringUtils.quote((customFilter.valueId ))); refineParams = (refineParams?(refineParams+'&'):'')+"&fq="+StringUtils.URIEncode(customFilter.queryFieldName + " exact " + StringUtils.quote((customFilter.valueId )));
} }

View File

@ -41,7 +41,7 @@ export class FetchSoftware{
} }
public getResultsByKeyword(keyword:string, page: number, size: number, properties:EnvProperties, connectCommunityId=null, customFilter:SearchCustomFilter=null){ public getResultsByKeyword(keyword:string, page: number, size: number, properties:EnvProperties, customFilter:SearchCustomFilter=null){
var parameters = ""; var parameters = "";
if(keyword.length > 0){ if(keyword.length > 0){
var DOIs:string[] = DOI.getDOIsFromString(keyword); var DOIs:string[] = DOI.getDOIsFromString(keyword);
@ -59,7 +59,7 @@ export class FetchSoftware{
//var errorCodes:ErrorCodes = new ErrorCodes(); //var errorCodes:ErrorCodes = new ErrorCodes();
this.searchUtils.status = this.errorCodes.LOADING; this.searchUtils.status = this.errorCodes.LOADING;
var refineParams = (connectCommunityId)?("&fq="+StringUtils.URIEncode("communityId exact " + StringUtils.quote((connectCommunityId )))):null; var refineParams = null;
if(customFilter){ if(customFilter){
refineParams = (refineParams?(refineParams+'&'):'')+"&fq="+StringUtils.URIEncode(customFilter.queryFieldName + " exact " + StringUtils.quote((customFilter.valueId ))); refineParams = (refineParams?(refineParams+'&'):'')+"&fq="+StringUtils.URIEncode(customFilter.queryFieldName + " exact " + StringUtils.quote((customFilter.valueId )));
} }