diff --git a/searchPages/dataProviders/compatibleDataProviders.component.ts b/searchPages/dataProviders/compatibleDataProviders.component.ts
index baf3ddfd..6a552333 100644
--- a/searchPages/dataProviders/compatibleDataProviders.component.ts
+++ b/searchPages/dataProviders/compatibleDataProviders.component.ts
@@ -203,7 +203,7 @@ properties:EnvProperties;
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', valueIsExact: true };
+ var filter:Filter = {title: filter_names[i], filterId: filter_ids[i], originalFilterId: filter_original_ids[i], values : values, countSelectedValues:0, "filterOperator": 'or', valueIsExact: true, valueIsUnique: false };
filters.push(filter);
}
return filters;
diff --git a/searchPages/dataProviders/compatibleDataProvidersTable.component.ts b/searchPages/dataProviders/compatibleDataProvidersTable.component.ts
index 67cd1dcb..7002d552 100644
--- a/searchPages/dataProviders/compatibleDataProvidersTable.component.ts
+++ b/searchPages/dataProviders/compatibleDataProvidersTable.component.ts
@@ -250,7 +250,7 @@ properties:EnvProperties;
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', valueIsExact: filter_valueIsExact[i] };
+ var filter:Filter = {title: filter_names[i], filterId: filter_ids[i], originalFilterId: filter_original_ids[i], values : values, countSelectedValues:0, "filterOperator": 'or', valueIsExact: filter_valueIsExact[i], valueIsUnique: false };
filters.push(filter);
}
return filters;
diff --git a/searchPages/dataProviders/entityRegistries.component.ts b/searchPages/dataProviders/entityRegistries.component.ts
index 9cbd4e08..766cca46 100644
--- a/searchPages/dataProviders/entityRegistries.component.ts
+++ b/searchPages/dataProviders/entityRegistries.component.ts
@@ -193,7 +193,7 @@ properties:EnvProperties;
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', valueIsExact: true };
+ var filter:Filter = {title: filter_names[i], filterId: filter_ids[i], originalFilterId: filter_original_ids[i], values : values, countSelectedValues:0, "filterOperator": 'or', valueIsExact: true, valueIsUnique: false };
filters.push(filter);
}
return filters;
diff --git a/searchPages/dataProviders/entityRegistriesTable.component.ts b/searchPages/dataProviders/entityRegistriesTable.component.ts
index 821eb75c..32ed60eb 100644
--- a/searchPages/dataProviders/entityRegistriesTable.component.ts
+++ b/searchPages/dataProviders/entityRegistriesTable.component.ts
@@ -255,7 +255,7 @@ properties:EnvProperties;
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', valueIsExact: filter_valueIsExact[i] };
+ var filter:Filter = {title: filter_names[i], filterId: filter_ids[i], originalFilterId: filter_original_ids[i], values : values, countSelectedValues:0, "filterOperator": 'or', valueIsExact: filter_valueIsExact[i], valueIsUnique: false };
filters.push(filter);
}
return filters;
diff --git a/searchPages/dataProviders/journals.component.ts b/searchPages/dataProviders/journals.component.ts
index 4f136cef..5db4ae59 100644
--- a/searchPages/dataProviders/journals.component.ts
+++ b/searchPages/dataProviders/journals.component.ts
@@ -196,7 +196,7 @@ properties:EnvProperties;
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', valueIsExact: true };
+ var filter:Filter = {title: filter_names[i], filterId: filter_ids[i], originalFilterId: filter_original_ids[i], values : values, countSelectedValues:0, "filterOperator": 'or', valueIsExact: true, valueIsUnique: false };
filters.push(filter);
}
return filters;
diff --git a/searchPages/dataProviders/journalsTable.component.ts b/searchPages/dataProviders/journalsTable.component.ts
index 98e621da..106fd74d 100644
--- a/searchPages/dataProviders/journalsTable.component.ts
+++ b/searchPages/dataProviders/journalsTable.component.ts
@@ -210,7 +210,7 @@ properties:EnvProperties;
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', valueIsExact: true };
+ var filter:Filter = {title: filter_names[i], filterId: filter_ids[i], originalFilterId: filter_original_ids[i], values : values, countSelectedValues:0, "filterOperator": 'or', valueIsExact: true, valueIsUnique: false };
filters.push(filter);
}
return filters;
diff --git a/searchPages/searchUtils/searchFilter.component.html b/searchPages/searchUtils/searchFilter.component.html
index dde58170..58571805 100644
--- a/searchPages/searchUtils/searchFilter.component.html
+++ b/searchPages/searchUtils/searchFilter.component.html
@@ -4,27 +4,107 @@
{{_formatTitle(filter.title,filter.values.length)}}
-
+
-
-
+
-
- {{_formatName(value)}}
-
({{value.number|number}})
+
-
5" (click)="open()"
+ filterValuesNum">
+
View
+ = 99">more
+ all
+
+
+
+
+
+
+
+
+
+
+
+
+
0 && (filter.values.length-filter.countSelectedValues ) > 0 " class="uk-grid-divider uk-margin-small">
+
+
+
+
+
+
+
+ filterValuesNum" (click)="open()"
[class]="(isDisabled)?'uk-disabled uk-link-muted uk-text-secondary':' uk-text-secondary'">View more
-
+
@@ -44,19 +124,34 @@
uk-margin-medium-left uk-margin-medium-right uk-margin-small-top uk-margin-bottom">
0 && (filter.values.length-filter.countSelectedValues ) > 0 " class="uk-grid-divider uk-margin-small">
diff --git a/searchPages/searchUtils/searchFilter.component.ts b/searchPages/searchUtils/searchFilter.component.ts
index eee33cff..7c1d11dc 100644
--- a/searchPages/searchUtils/searchFilter.component.ts
+++ b/searchPages/searchUtils/searchFilter.component.ts
@@ -15,6 +15,8 @@ export class SearchFilterComponent {
@Input() showResultCount:boolean = true;
@Input() isDisabled:boolean = false;
@Input() addShowMore:boolean = true;
+ @Input() showMoreInline: boolean = false;
+ @Input() filterValuesNum: number = 5;
public showAll:boolean = false;
public _maxCharacters:number =28;
@@ -77,6 +79,20 @@ export class SearchFilterComponent {
value: this.filter
});
}
+ uniqueFilterChange(value: Value) {
+ let tmp = value.selected;
+ value.selected = !tmp;
+
+ if(value.selected){
+ this.filter.countSelectedValues++;
+ }else{
+ this.filter.countSelectedValues--;
+ }
+
+ this.onFilterChange.emit({
+ value: this.filter
+ });
+ }
getSelectedValues(filter, sortBy:string = "num"):any{
var selected = [];
if(filter.countSelectedValues >0){
diff --git a/searchPages/searchUtils/searchHelperClasses.class.ts b/searchPages/searchUtils/searchHelperClasses.class.ts
index 2d66e964..14285210 100644
--- a/searchPages/searchUtils/searchHelperClasses.class.ts
+++ b/searchPages/searchUtils/searchHelperClasses.class.ts
@@ -7,7 +7,8 @@ export class Filter{
public values: Value[] = [];
public filterOperator: string ='or';
public valueIsExact: boolean = true; // for search table view, if value is contained or is equal with column entry
-
+ public valueIsUnique: boolean = false;
+// public uniqueValueIdSelected: string;
}
export class Value{
diff --git a/searchPages/searchUtils/searchPage.component.html b/searchPages/searchUtils/searchPage.component.html
index 12ef1b38..c441cee4 100644
--- a/searchPages/searchUtils/searchPage.component.html
+++ b/searchPages/searchUtils/searchPage.component.html
@@ -1,6 +1,6 @@
-
-
-
+
+
+
0" routerLinkActive="router-link-active" [class]="((disableForms)?'uk-float-right uk-disabled uk-link-muted uk-light ':'uk-float-right uk-light') +' portal-color uk-margin-small-bottom'" [routerLink]=advancedSearchLink [queryParams]=advancedSearchParameters >
@@ -22,7 +22,7 @@
-
+
@@ -34,7 +34,26 @@
+
+
+
+
+
+
+
+
+
+
0 && entityType != 'community' && usedBy == 'search'"
+ class="uk-width-1-2" [loadPaging]="loadPaging" [oldTotalResults]="oldTotalResults" [(searchUtils)] = "searchUtils" [type]="csvPath" [csvParams]="csvParams" [totalResults]="searchUtils.totalResults">
+
+
Filter By:
@@ -91,7 +97,26 @@
+
+
+
+
+
+
+
+
+
+
0 && entityType != 'community' && usedBy == 'search'"
+ class="uk-width-1-2" [loadPaging]="loadPaging" [oldTotalResults]="oldTotalResults" [(searchUtils)] = "searchUtils" [type]="csvPath" [csvParams]="csvParams" [totalResults]="searchUtils.totalResults">
+
+
+
0" class="uk-margin-small-bottom">
@@ -104,36 +129,23 @@
-
-
-
-
+
@@ -154,13 +166,19 @@
-
-
+
+ = new Map();
private baseURLWithParameters:string = '';
@@ -192,7 +196,21 @@ export class SearchPageComponent {
keywordQuery += "&q="+StringUtils.URIEncode(keyword);
}
}else{
- keywordQuery += "&q="+StringUtils.URIEncode(keyword);
+ if(this.usedBy == "deposit") {
+ if(this.keywordFields.length > 0) {
+ keywordQuery = "&fq=";
+ }
+
+ for(let i=0; i< this.keywordFields.length ; i++) {
+ if(i > 0) {
+ keywordQuery += " or ";
+ }
+ let field = this.keywordFields[i];
+ keywordQuery += field.name+field.equalityOperator+StringUtils.URIEncode(keyword);
+ }
+ } else {
+ keywordQuery += "&q=" + StringUtils.URIEncode(keyword);
+ }
}
}
@@ -410,7 +428,21 @@ export class SearchPageComponent {
keywordQuery += "&q="+StringUtils.URIEncode(this.searchUtils.keyword);
}
}else{
- keywordQuery += "&q="+StringUtils.URIEncode(this.searchUtils.keyword);
+ if(this.usedBy == "deposit") {
+ if(this.keywordFields.length > 0) {
+ keywordQuery = "&fq=";
+ }
+
+ for(let i=0; i< this.keywordFields.length ; i++) {
+ if(i > 0) {
+ keywordQuery += " or ";
+ }
+ let field = this.keywordFields[i];
+ keywordQuery += field.name+field.equalityOperator+StringUtils.URIEncode(this.searchUtils.keyword);
+ }
+ } else {
+ keywordQuery += "&q=" + StringUtils.URIEncode(this.searchUtils.keyword);
+ }
}
}
return (doiQuery.length > 0 ? doiQuery:keywordQuery) + allFqs;
diff --git a/searchPages/searchUtils/searchPage.module.ts b/searchPages/searchUtils/searchPage.module.ts
index 1df3f0da..78050515 100644
--- a/searchPages/searchUtils/searchPage.module.ts
+++ b/searchPages/searchUtils/searchPage.module.ts
@@ -21,12 +21,14 @@ import { SEOServiceModule } from '../../sharedComponents/SEO/SEOService.module';
import { SearchDataproviderMapModule } from './searchDataproviderMap.module';
import {CommunitySearchResultsModule} from "./communitySearchResults.module";
import {SearchResultsModule} from "./searchResults.module";
+import {SearchResultsInDepositModule} from "../../deposit/searchResultsInDeposit.module";
@NgModule({
imports: [
CommonModule, FormsModule, RouterModule, SearchFormModule, SearchResultsModule, CommunitySearchResultsModule,
LoadingModalModule, ReportsServiceModule, SearchDataproviderMapModule,
- SearchPagingModule, SearchResultsPerPageModule, SearchSortingModule, SearchDownloadModule, ModalModule, SearchFilterModule, PiwikServiceModule, HelperModule, Schema2jsonldModule, SEOServiceModule, SearchResultsModule
+ SearchPagingModule, SearchResultsPerPageModule, SearchSortingModule, SearchDownloadModule, ModalModule, SearchFilterModule, PiwikServiceModule, HelperModule, Schema2jsonldModule, SEOServiceModule, SearchResultsModule,
+ SearchResultsInDepositModule
],
declarations: [
SearchPageComponent
diff --git a/services/searchDataproviders.service.ts b/services/searchDataproviders.service.ts
index 8a732074..010a6cc9 100644
--- a/services/searchDataproviders.service.ts
+++ b/services/searchDataproviders.service.ts
@@ -15,8 +15,7 @@ import {map} from "rxjs/operators";
export class SearchDataprovidersService {
constructor(private http: HttpClient ) {}
- searchDataproviders (params: string, refineParams:string, page: number, size: number, refineFields:string[], properties:EnvProperties ):any {
-
+ searchDataproviders (params: string, refineParams:string, page: number, size: number, refineFields:string[], properties:EnvProperties, usedBy: string="search" ):any {
let link = properties.searchAPIURLLAst+"datasources";
let url = link+"?";
@@ -32,7 +31,7 @@ export class SearchDataprovidersService {
return this.http.get((properties.useCache)? (properties.cacheUrl+encodeURIComponent(url)): url)
//.map(res => res.json())
//.do(res => console.info(res))
- .pipe(map(res => [res['meta'].total, this.parseResults(res['results']),RefineResultsUtils.parse(res['refineResults'],refineFields, "datasource")]));
+ .pipe(map(res => [res['meta'].total, this.parseResults(res['results']),RefineResultsUtils.parse(res['refineResults'],refineFields, "datasource", usedBy)]));
}
//((oaftype exact datasource) and(collectedfromdatasourceid exact "openaire____::47ce9e9f4fad46e732cff06419ecaabb"))
advancedSearchDataproviders (params: string, page: number, size: number, properties: EnvProperties ):any {
@@ -161,6 +160,20 @@ export class SearchDataprovidersService {
//.map(res => res.json())
.pipe(map(res => [res['meta'].total, this.parseResults(res['results'])]));
}
+
+ searchDataprovidersForDepositSearch(params: string, refineParams:string, page: number, size: number, refineFields:string[], properties:EnvProperties, usedBy: string="search" ):any {
+ let link = properties.searchResourcesAPIURL;
+ let url = link+"?query=((deletedbyinference = false) AND (oaftype exact datasource)) "+params;
+ if(refineParams!= null && refineParams != '' ) {
+ url += refineParams;
+ }
+ url += "&page="+(page-1)+"&size="+size+"&format=json";
+
+ return this.http.get((properties.useCache)? (properties.cacheUrl+encodeURIComponent(url)): url)
+ .pipe(map(res => [res['meta'].total, this.parseResults(res['results']), RefineResultsUtils.parse(res['refineResults'],
+ refineFields, "datasource", usedBy)]));
+ }
+
searchDataProvidersBySubjects(keyword:string, type:string, page: number, size: number, properties:EnvProperties):any {
let link = properties.searchResourcesAPIURL;
var compatibilities = "";
diff --git a/services/servicesUtils/refineResults.class.ts b/services/servicesUtils/refineResults.class.ts
index 19cf28d1..8d96d816 100644
--- a/services/servicesUtils/refineResults.class.ts
+++ b/services/servicesUtils/refineResults.class.ts
@@ -6,7 +6,7 @@ import { SearchFields, FieldDetails} from '../../utils/properties/searchFields';
export class RefineResultsUtils {
- public static parse (data, fields:string[], entityType:string):Filter[] {
+ public static parse (data, fields:string[], entityType:string, usedBy: string="search"):Filter[] {
// var data = this.json.refineReuslts;
var searchFields:SearchFields = new SearchFields();
@@ -18,6 +18,9 @@ export class RefineResultsUtils {
filter.title = searchFields.getFieldName(fields[j],entityType);
filter.filterId = fields[j];
filter.originalFilterId = fields[j];
+ filter.valueIsUnique = searchFields.fieldHasUniqueValue(fields[j], entityType, usedBy);
+ //console.info("filter.title: "+filter.title+" filter.valueIsUnique: "+filter.valueIsUnique);
+
let field = data[fields[j]];
if(field){
for(let i=0; i