diff --git a/portal-2/src/app/app-routing.module.ts b/portal-2/src/app/app-routing.module.ts
index 324c59b5..d01b137b 100644
--- a/portal-2/src/app/app-routing.module.ts
+++ b/portal-2/src/app/app-routing.module.ts
@@ -77,10 +77,18 @@ export function getCompatibleDataProvidersModule() {
return System.import('./searchPages/dataProviders/compatibleDataProviders.module' + (process.env.AOT ? '.ngfactory' : ''))
.then(mod => mod[(process.env.AOT ? 'CompatibleDataProvidersModuleNgFactory' : 'CompatibleDataProvidersModule')]);
}
+export function getCompatibleDataProvidersTableModule() {
+ return System.import('./searchPages/dataProviders/compatibleDataProvidersTable.module' + (process.env.AOT ? '.ngfactory' : ''))
+ .then(mod => mod[(process.env.AOT ? 'CompatibleDataProvidersTableModuleNgFactory' : 'CompatibleDataProvidersTableModule')]);
+}
export function getEntityRegistriesModule() {
return System.import('./searchPages/dataProviders/entityRegistries.module' + (process.env.AOT ? '.ngfactory' : ''))
.then(mod => mod[(process.env.AOT ? 'EntityRegistriesModuleNgFactory' : 'EntityRegistriesModule')]);
}
+export function getEntityRegistriesTableModule() {
+ return System.import('./searchPages/dataProviders/entityRegistriesTable.module' + (process.env.AOT ? '.ngfactory' : ''))
+ .then(mod => mod[(process.env.AOT ? 'EntityRegistriesTableModuleNgFactory' : 'EntityRegistriesTableModule')]);
+}
export function getAdvancedSearchPublicationsModule() {
return System.import('./searchPages/advanced/advancedSearchPublications.module' + (process.env.AOT ? '.ngfactory' : ''))
.then(mod => mod[(process.env.AOT ? 'AdvancedSearchPublicationsModuleNgFactory' : 'AdvancedSearchPublicationsModule')]);
@@ -160,7 +168,9 @@ export function getUserModule() {
{ path: 'search/find/organizations', loadChildren: getSearchOrganizationsModule },
{ path: 'search/find/people', loadChildren: getSearchPeopleModule },
{ path: 'search/data-providers', loadChildren: getCompatibleDataProvidersModule },
+ { path: 'search/data-providers-table', loadChildren: getCompatibleDataProvidersTableModule },
{ path: 'search/entity-registries', loadChildren: getEntityRegistriesModule },
+ { path: 'search/entity-registries-table', loadChildren: getEntityRegistriesTableModule },
{ path: 'search/advanced/publications', loadChildren: getAdvancedSearchPublicationsModule },
{ path: 'search/advanced/datasets', loadChildren: getAdvancedSearchDatasetsModule },
{ path: 'search/advanced/organizations', loadChildren: getAdvancedSearchOrganizationsModule },
diff --git a/portal-2/src/app/searchPages/dataProviders/compatibleDataProviders.component.ts b/portal-2/src/app/searchPages/dataProviders/compatibleDataProviders.component.ts
index 26dbde99..1ccf16a2 100644
--- a/portal-2/src/app/searchPages/dataProviders/compatibleDataProviders.component.ts
+++ b/portal-2/src/app/searchPages/dataProviders/compatibleDataProviders.component.ts
@@ -22,7 +22,8 @@ import {ExportCSVComponent} from '../../utils/exportCSV.class';
(queryChange)="queryChanged($event)"
(downloadClick)="downloadClicked($event)"
[csvParams]="csvParams" csvPath="resources"
- [disableForms]="disableForms">
+ [disableForms]="disableForms"
+ [tableViewLink]="'/search/data-providers-table'">
diff --git a/portal-2/src/app/searchPages/dataProviders/compatibleDataProviders.module.ts b/portal-2/src/app/searchPages/dataProviders/compatibleDataProviders.module.ts
index ecf4518f..7de68c96 100644
--- a/portal-2/src/app/searchPages/dataProviders/compatibleDataProviders.module.ts
+++ b/portal-2/src/app/searchPages/dataProviders/compatibleDataProviders.module.ts
@@ -9,6 +9,7 @@ import {SearchResultsModule } from '../searchUtils/searchResults.module';
import {DataProvidersServiceModule} from '../../services/dataProvidersService.module';
import {SearchFormModule} from '../searchUtils/searchForm.module';
+//import {SearchFilterModalModule} from '../searchUtils/searchFilterModal.module';
import {SearchPageModule} from '../searchUtils/searchPage.module';
import {FreeGuard} from'../../login/freeGuard.guard';
@@ -16,7 +17,7 @@ import {FreeGuard} from'../../login/freeGuard.guard';
imports: [
CommonModule, FormsModule,
DataProvidersServiceModule,
- SearchFormModule, SearchResultsModule, CompatibleDataProvidersRoutingModule, SearchPageModule
+ SearchFormModule, SearchResultsModule, CompatibleDataProvidersRoutingModule, SearchPageModule//, SearchFilterModalModule
],
declarations: [
diff --git a/portal-2/src/app/searchPages/dataProviders/compatibleDataProvidersTable-routing.module.ts b/portal-2/src/app/searchPages/dataProviders/compatibleDataProvidersTable-routing.module.ts
new file mode 100644
index 00000000..db9d5128
--- /dev/null
+++ b/portal-2/src/app/searchPages/dataProviders/compatibleDataProvidersTable-routing.module.ts
@@ -0,0 +1,15 @@
+import { NgModule } from '@angular/core';
+import { RouterModule } from '@angular/router';
+
+import{SearchCompatibleDataprovidersTableComponent} from './compatibleDataProvidersTable.component';
+import {FreeGuard} from'../../login/freeGuard.guard';
+
+@NgModule({
+ imports: [
+ RouterModule.forChild([
+ { path: '', component: SearchCompatibleDataprovidersTableComponent, canActivate: [FreeGuard] }
+
+ ])
+ ]
+})
+export class CompatibleDataProvidersTableRoutingModule { }
diff --git a/portal-2/src/app/searchPages/dataProviders/compatibleDataProvidersTable.component.ts b/portal-2/src/app/searchPages/dataProviders/compatibleDataProvidersTable.component.ts
new file mode 100644
index 00000000..9485b742
--- /dev/null
+++ b/portal-2/src/app/searchPages/dataProviders/compatibleDataProvidersTable.component.ts
@@ -0,0 +1,225 @@
+import {Component, Input, ViewChild} from '@angular/core';
+import { ActivatedRoute} from '@angular/router';
+
+import { Filter, Value} from '../searchUtils/searchHelperClasses.class';
+
+import {SearchDataprovidersService} from '../../services/searchDataproviders.service';
+import {SearchResult} from '../../utils/entities/searchResult';
+import {OpenaireProperties, ErrorCodes} from '../../utils/properties/openaireProperties';
+import {SearchFields} from '../../utils/properties/searchFields';
+import {SearchPageTableViewComponent } from '../searchUtils/searchPageTableView.component';
+import {SearchUtilsClass } from '../searchUtils/searchUtils.class';
+import {ExportCSVComponent} from '../../utils/exportCSV.class';
+
+@Component({
+ selector: 'search-dataproviders-table',
+ template: `
+
+
+
+
+
+ `
+
+})
+export class SearchCompatibleDataprovidersTableComponent {
+ public results =[];
+ public filters =[];
+ public baseUrl:string;
+ public searchUtils:SearchUtilsClass = new SearchUtilsClass();
+ public sub: any; public subResults: any;
+ public _location:Location;
+ public searchFields:SearchFields = new SearchFields();
+ public refineFields: string[] = this.searchFields.COMPATIBLE_DATAPROVIDER_FIELDS;
+ public fieldIdsMap= this.searchFields.DATASOURCE_FIELDS;
+ public _prefixQueryFields: {field:string,opName:string,opValue:string,values:string[]}[] =[{field:"compatibility",opName:"cm",opValue:"not", values:["UNKNOWN","hostedBy","notCompatible"]},{field:"type",opName:"tp",opValue:"not",values: ["other"]}];
+ // ["entityregistry","entityregistry::projects","entityregistry::repositories"]}];
+ public _prefixQuery: string = "";
+
+ public CSV: any = { "columnNames": [ "Title", "Type", "Coutries", "Compatibility" ],
+ "export":[]
+ };
+ public CSVDownloaded = false;
+ public resourcesQuery = "&query=((oaftype exact datasource) not(datasourcecompatibilityid = UNKNOWN) not(datasourcecompatibilityid = hostedBy) not(datasourcecompatibilityid = notCompatible) not(datasourcetypeuiid = other))";
+ public csvParams: string;
+ public disableForms: boolean = false;
+
+ @ViewChild (SearchPageTableViewComponent) searchPage : SearchPageTableViewComponent ;
+
+ constructor (private route: ActivatedRoute, private _searchDataprovidersService: SearchDataprovidersService ) {
+ var errorCodes:ErrorCodes = new ErrorCodes();
+ this.searchUtils.status =errorCodes.LOADING;
+ this.baseUrl = OpenaireProperties.getLinkToSearchCompatibleDataProvidersTable();
+ for(var i = 0; i < this._prefixQueryFields.length; i++ ){
+ for(var j =0; j < this._prefixQueryFields[i].values.length; j++){
+ this._prefixQuery+="&" + this._prefixQueryFields[i].field + "="
+ + this._prefixQueryFields[i].values[j] + "&" +
+ this._prefixQueryFields[i].opName + "=" + this._prefixQueryFields[i].opValue;
+ }
+ }
+ this._prefixQuery+="&";
+ }
+
+ public ngOnInit() {
+ this.searchPage.refineFields = this.refineFields;
+ this.searchPage.fieldIdsMap = this.fieldIdsMap;
+ this.sub = this.route.queryParams.subscribe(params => {
+ this.searchUtils.keyword = (params['keyword']?params['keyword']:'');
+ this.searchUtils.page = (params['page']=== undefined)?1:+params['page'];
+ this.filters = this.createFilters();
+ var queryParameters = this.searchPage.getIndexQueryParametersFromUrl(params);
+ this._getResults(queryParameters, false, this.searchUtils.page);
+ });
+ }
+
+ public ngOnDestroy() {
+ if(this.sub){
+ this.sub.unsubscribe();
+ }
+ if(this.subResults){
+ this.subResults.unsubscribe();
+ } }
+ private _getResults(parameters:string,refine:boolean, page: number){
+ this.csvParams = parameters+this.resourcesQuery+"&type=datasources";
+
+ var errorCodes:ErrorCodes = new ErrorCodes();
+ this.searchUtils.status = errorCodes.LOADING;
+ //this.searchPage.openLoading();
+ this.disableForms = true;
+ this.results = [];
+ this.searchUtils.totalResults = 0;
+
+ let size: number = 0;
+ this.subResults = this._searchDataprovidersService.searchCompatibleDataprovidersTable(parameters,(refine)?this.searchPage.getRefineFieldsQuery():null).subscribe(
+ data => {
+ size = data;
+ if(size > 0) {
+ this.subResults = this._searchDataprovidersService.searchCompatibleDataproviders(parameters,(refine)?this.searchPage.getRefineFieldsQuery():null, page, size, []).subscribe(
+ data => {
+ this.searchUtils.totalResults = data[0];
+ console.info("search Data Providers: [Parameters:"+parameters+" ] [total results:"+this.searchUtils.totalResults+"]");
+ this.results = data[1];
+ this.searchPage.checkSelectedFilters(this.filters);
+ this.searchPage.updateBaseUrlWithParameters(this.filters);
+ var errorCodes:ErrorCodes = new ErrorCodes();
+ this.searchUtils.status = errorCodes.DONE;
+ if(this.searchUtils.totalResults == 0 ){
+ this.searchUtils.status = errorCodes.NONE;
+ }
+ //this.searchPage.closeLoading();
+ this.disableForms = false;
+
+ },
+ err => {
+ console.log(err);
+ //TODO check erros (service not available, bad request)
+ // if( ){
+ // this.searchUtils.status = ErrorCodes.ERROR;
+ // }
+ var errorCodes:ErrorCodes = new ErrorCodes();
+ this.searchUtils.status = errorCodes.ERROR;
+ //this.searchPage.closeLoading();
+ this.disableForms = false;
+
+ }
+ );
+ } else {
+ this.searchPage.checkSelectedFilters(this.filters);
+ this.searchPage.updateBaseUrlWithParameters(this.filters);
+
+ var errorCodes:ErrorCodes = new ErrorCodes();
+ this.searchUtils.status = errorCodes.NONE;
+ this.disableForms = false;
+ }
+ },
+ err => {
+ console.log(err);
+ //TODO check erros (service not available, bad request)
+ // if( ){
+ // this.searchUtils.status = ErrorCodes.ERROR;
+ // }
+ var errorCodes:ErrorCodes = new ErrorCodes();
+ this.searchUtils.status = errorCodes.ERROR;
+ //this.searchPage.closeLoading();
+ }
+ );
+
+ }
+ private setFilters(){
+ //TODO set filters from
+ }
+
+ public queryChanged($event) {
+ var parameters = $event.index;
+ console.info("queryChanged: Execute search query "+parameters);
+ this._getResults(parameters, false, this.searchUtils.page);
+ }
+ private createFilters():Filter[] {
+ var filter_names=["Type","Compatibility Level"];
+ var filter_ids=["datasourcetypeuiid","datasourcecompatibilityname"];
+ var searchFields = new SearchFields();
+ var filter_original_ids = searchFields.COMPATIBLE_DATAPROVIDER_FIELDS;
+ var value_names=[
+ [
+ "Institutional Publication Repository","Thematic Publication Repository", "Other Publication Repository",
+ "Institutional Repositories Aggregators",
+ "Thematic Repositories Aggregators", "Other Repositories Aggregators",
+ "Data Repositories", "Data Repositories Aggregators", "Journals", "Journals Aggregators", "CRIS Systems", "Publication Catalogues"],
+ ["OpenAIRE Basic (DRIVER OA)","OpenAIRE 2.0 (EC funding)", "OpenAIRE 2.0+ (DRIVER OA, EC funding)", "OpenAIRE 3.0 (OA, funding)","OpenAIRE Data (funded, referenced datasets)"]];
+
+ var value_original_ids=[
+ ["pubsrepository::institutional","pubsrepository::thematic", "pubsrepository::unknown", "aggregator::pubsrepository::thematic","aggregator::pubsrepository::institutional","aggregator::pubsrepository::unknown",
+ "datarepository::unknown", "aggregator::datarepository", "pubsrepository::journal", "aggregator::pubsrepository::journals", "cris", "pubscatalogue::unknown"],
+ //["driver","openaire2.0", "driver-openaire2.0", "openaire3.0","openaire2.0_data"]
+ ["OpenAIRE Basic (DRIVER OA)","OpenAIRE 2.0 (EC funding)", "OpenAIRE 2.0+ (DRIVER OA, EC funding)", "OpenAIRE 3.0 (OA, funding)","OpenAIRE Data (funded, referenced datasets)"]];
+ var filters: Filter[] =[];
+ for(var i =0 ; i < filter_names.length;i++){
+ var values:Value[] = [];
+ for(var j =0 ; j < value_names[i].length;j++){
+ 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' };
+ filters.push(filter);
+ }
+ return filters;
+ }
+
+ public downloadClicked($event) {
+ if(!this.CSVDownloaded) {
+ this.CSVDownloaded = false;
+
+ var parameters = $event.value;
+
+ //this.getResultsCSV(parameters, false, 1, 1000);
+
+ this._searchDataprovidersService.searchCompatibleDataprovidersCSV(parameters,this.searchPage.getRefineFieldsQuery(), 1, 1000).subscribe(
+ data => {
+ this.CSV.export = data;
+ ExportCSVComponent.downloadCSV(this.CSV, "compatibleDataproviders.csv");
+
+ var errorCodes:ErrorCodes = new ErrorCodes();
+ this.searchUtils.status = errorCodes.DONE;
+ },
+ err => {
+ console.log(err);
+ //TODO check erros (service not available, bad request)
+ // if( ){
+ // this.searchUtils.status = ErrorCodes.ERROR;
+ // }
+ var errorCodes:ErrorCodes = new ErrorCodes();
+ this.searchUtils.status = errorCodes.ERROR;
+ }
+ );
+ }
+ }
+
+}
diff --git a/portal-2/src/app/searchPages/dataProviders/compatibleDataProvidersTable.module.ts b/portal-2/src/app/searchPages/dataProviders/compatibleDataProvidersTable.module.ts
new file mode 100644
index 00000000..2d0241ee
--- /dev/null
+++ b/portal-2/src/app/searchPages/dataProviders/compatibleDataProvidersTable.module.ts
@@ -0,0 +1,32 @@
+import { NgModule} from '@angular/core';
+import { CommonModule } from '@angular/common';
+import { FormsModule } from '@angular/forms';
+
+import{ CompatibleDataProvidersTableRoutingModule} from './compatibleDataProvidersTable-routing.module';
+import{SearchCompatibleDataprovidersTableComponent} from './compatibleDataProvidersTable.component';
+
+//import {DatasourceTableViewModule } from '../searchUtils/datasourceTableView.module';
+
+import {DataProvidersServiceModule} from '../../services/dataProvidersService.module';
+import {SearchFormModule} from '../searchUtils/searchForm.module';
+//import {SearchFilterModalModule} from '../searchUtils/searchFilterModal.module';
+import {SearchPageTableViewModule} from '../searchUtils/searchPageTableView.module';
+import {FreeGuard} from'../../login/freeGuard.guard';
+
+@NgModule({
+ imports: [
+ CommonModule, FormsModule,
+ DataProvidersServiceModule,
+ SearchFormModule, /*DatasourceTableViewModule,*/ CompatibleDataProvidersTableRoutingModule, SearchPageTableViewModule//, SearchFilterModalModule
+
+ ],
+ declarations: [
+ SearchCompatibleDataprovidersTableComponent
+ ],
+ providers:[FreeGuard
+ ],
+ exports: [
+ SearchCompatibleDataprovidersTableComponent
+ ]
+})
+export class CompatibleDataProvidersTableModule { }
diff --git a/portal-2/src/app/searchPages/dataProviders/datasourceTableView.component.ts b/portal-2/src/app/searchPages/dataProviders/datasourceTableView.component.ts
deleted file mode 100644
index af525ec4..00000000
--- a/portal-2/src/app/searchPages/dataProviders/datasourceTableView.component.ts
+++ /dev/null
@@ -1,74 +0,0 @@
-import {Component, Input, ViewChild} from '@angular/core';
-
-
-@Component({
- selector: 'table-view',
- template: `
-
-
-
-
-
- `
-
-})
-export class DatasourceTableViewComponent {
- @Input() datasources =[];
- // private results:{name:string, type:string, organizations:string, countries:string, compatibility:string}[] = [];
- constructor () {
-
- }
-
- public ngOnInit() {
- // // var results:{name:string, type:string, organizations:string, countries:string, compatibility:string}[] = []
- // for(var i =0; i < this.datasources.length; i++){
- // var datasource: {name:string, type:string, organizations:string, countries:string, compatibility:string} = {name:"",type:"",organizations:"", countries:"", compatibility:""};
- // datasource.name = '' + (this.datasources[i]['title'].name)?this.datasources[i]['title'].name:this.datasources[i]['title'].url +'';
- // datasource.type = this.datasources[i]['type'];
- // this.results.push(datasource);
- // }
- }
-
- public ngOnDestroy() {
-
- }
- sort(){
- // objs.sort(function(a,b) {return (a.last_nom > b.last_nom) ? 1 : ((b.last_nom > a.last_nom) ? -1 : 0);} );
- }
-
-}
diff --git a/portal-2/src/app/searchPages/dataProviders/entityRegistries.component.ts b/portal-2/src/app/searchPages/dataProviders/entityRegistries.component.ts
index 014a49db..62dc3f1e 100644
--- a/portal-2/src/app/searchPages/dataProviders/entityRegistries.component.ts
+++ b/portal-2/src/app/searchPages/dataProviders/entityRegistries.component.ts
@@ -22,7 +22,8 @@ import {ExportCSVComponent} from '../../utils/exportCSV.class';
(queryChange)="queryChanged($event)"
(downloadClick)="downloadClicked($event)"
[csvParams]="csvParams" csvPath="resources"
- [disableForms]="disableForms">
+ [disableForms]="disableForms"
+ [tableViewLink]="'/search/entity-registries-table'">
`
diff --git a/portal-2/src/app/searchPages/dataProviders/entityRegistries.module.ts b/portal-2/src/app/searchPages/dataProviders/entityRegistries.module.ts
index a05f1dd4..66e28de9 100644
--- a/portal-2/src/app/searchPages/dataProviders/entityRegistries.module.ts
+++ b/portal-2/src/app/searchPages/dataProviders/entityRegistries.module.ts
@@ -9,6 +9,7 @@ import {SearchResultsModule } from '../searchUtils/searchResults.module';
import {DataProvidersServiceModule} from '../../services/dataProvidersService.module';
import {SearchFormModule} from '../searchUtils/searchForm.module';
+//import {SearchFilterModalModule} from '../searchUtils/searchFilterModal.module';
import {SearchPageModule} from '../searchUtils/searchPage.module';
import {FreeGuard} from'../../login/freeGuard.guard';
@@ -16,7 +17,7 @@ import {FreeGuard} from'../../login/freeGuard.guard';
imports: [
CommonModule, FormsModule,
DataProvidersServiceModule,
- SearchFormModule, SearchResultsModule, EntityRegistriesRoutingModule, SearchPageModule
+ SearchFormModule, SearchResultsModule, EntityRegistriesRoutingModule, SearchPageModule//, SearchFilterModalModule
],
declarations: [
diff --git a/portal-2/src/app/searchPages/dataProviders/entityRegistriesTable-routing.module.ts b/portal-2/src/app/searchPages/dataProviders/entityRegistriesTable-routing.module.ts
new file mode 100644
index 00000000..d355963d
--- /dev/null
+++ b/portal-2/src/app/searchPages/dataProviders/entityRegistriesTable-routing.module.ts
@@ -0,0 +1,15 @@
+import { NgModule } from '@angular/core';
+import { RouterModule } from '@angular/router';
+
+import{SearchEntityRegistriesTableComponent} from './entityRegistriesTable.component';
+import {FreeGuard} from'../../login/freeGuard.guard';
+
+@NgModule({
+ imports: [
+ RouterModule.forChild([
+ { path: '', component: SearchEntityRegistriesTableComponent, canActivate: [FreeGuard] }
+
+ ])
+ ]
+})
+export class EntityRegistriesTableRoutingModule { }
diff --git a/portal-2/src/app/searchPages/dataProviders/entityRegistriesTable.component.ts b/portal-2/src/app/searchPages/dataProviders/entityRegistriesTable.component.ts
new file mode 100644
index 00000000..22943d16
--- /dev/null
+++ b/portal-2/src/app/searchPages/dataProviders/entityRegistriesTable.component.ts
@@ -0,0 +1,255 @@
+import {Component, Input, ViewChild} from '@angular/core';
+import { ActivatedRoute} from '@angular/router';
+
+import { Filter, Value} from '../searchUtils/searchHelperClasses.class';
+
+import {SearchDataprovidersService} from '../../services/searchDataproviders.service';
+import {SearchResult} from '../../utils/entities/searchResult';
+import {OpenaireProperties, ErrorCodes} from '../../utils/properties/openaireProperties';
+import {SearchFields} from '../../utils/properties/searchFields';
+import {SearchPageTableViewComponent } from '../searchUtils/searchPageTableView.component';
+import {SearchUtilsClass } from '../searchUtils/searchUtils.class';
+import {ExportCSVComponent} from '../../utils/exportCSV.class';
+
+@Component({
+ selector: 'search-entity-registries-table',
+ template: `
+
+
+
+
+ `
+
+})
+export class SearchEntityRegistriesTableComponent {
+ public results =[];
+ public filters =[];
+ public baseUrl:string;
+ public searchUtils:SearchUtilsClass = new SearchUtilsClass();
+ public sub: any; public subResults: any;
+ public _location:Location;
+ public searchFields:SearchFields = new SearchFields();
+ public refineFields: string[] = this.searchFields.ENTITY_REGISTRIES_FIELDS;
+ public fieldIdsMap= this.searchFields.DATASOURCE_FIELDS;
+ public _prefixQueryFields: {field:string,opName:string,opValue:string,values:string[]}[] =[
+ {field:"type",opName:"tp",opValue:"and",values: ["other"]}];
+ // ["entityregistry","entityregistry::projects","entityregistry::repositories"]}];
+ public _prefixQuery: string = "";
+
+ public CSV: any = { "columnNames": [ "Title", "Type", "Coutries", "Compatibility" ],
+ "export":[]
+ };
+ public CSVDownloaded = false;
+ public disableForms: boolean = false;
+
+ @ViewChild (SearchPageTableViewComponent) searchPage : SearchPageTableViewComponent ;
+ public resourcesQuery = "&query=((oaftype exact datasource) and(datasourcetypeuiid = other))";
+ public csvParams: string;
+
+ constructor (private route: ActivatedRoute, private _searchDataprovidersService: SearchDataprovidersService ) {
+ var errorCodes:ErrorCodes = new ErrorCodes();
+ this.searchUtils.status =errorCodes.LOADING;
+ this.baseUrl = OpenaireProperties.getLinkToSearchEntityRegistriesTable();
+ for(var i = 0; i < this._prefixQueryFields.length; i++ ){
+ for(var j =0; j < this._prefixQueryFields[i].values.length; j++){
+ this._prefixQuery+="&" + this._prefixQueryFields[i].field + "="
+ + this._prefixQueryFields[i].values[j] + "&" +
+ this._prefixQueryFields[i].opName + "=" + this._prefixQueryFields[i].opValue;
+ }
+ }
+ this._prefixQuery+="&";
+ }
+
+ public ngOnInit() {
+ this.searchPage.refineFields = this.refineFields;
+ this.searchPage.fieldIdsMap = this.fieldIdsMap;
+ this.sub = this.route.queryParams.subscribe(params => {
+ this.searchUtils.keyword = (params['keyword']?params['keyword']:'');
+ this.searchUtils.page = (params['page']=== undefined)?1:+params['page'];
+ this.filters = this.createFilters();
+
+ var queryParameters = this.searchPage.getIndexQueryParametersFromUrl(params);
+ this._getResults(queryParameters, false, this.searchUtils.page);
+ });
+ }
+
+ public ngOnDestroy() {
+ if(this.sub){
+ this.sub.unsubscribe();
+ }
+ if(this.subResults){
+ this.subResults.unsubscribe();
+ } }
+ private _getResults(parameters:string,refine:boolean, page: number){
+ this.csvParams = parameters+this.resourcesQuery+"&type=datasources";
+
+ var errorCodes:ErrorCodes = new ErrorCodes();
+ this.searchUtils.status = errorCodes.LOADING;
+ //this.searchPage.openLoading();
+ this.disableForms = true;
+ this.results = [];
+ this.searchUtils.totalResults = 0;
+
+ let size: number = 0;
+ this.subResults = this._searchDataprovidersService.searchEntityRegistriesTable(parameters,(refine)?this.searchPage.getRefineFieldsQuery():null).subscribe(
+ data => {
+ size = data;
+ if(size > 0) {
+ this.subResults = this._searchDataprovidersService.searchEntityRegistries(parameters,(refine)?this.searchPage.getRefineFieldsQuery():null, page, size, []).subscribe(
+ data => {
+ this.searchUtils.totalResults = data[0];
+ console.info("search Entity Registries: [Parameters:"+parameters+" ] [total results:"+this.searchUtils.totalResults+"]");
+ this.results = data[1];
+ this.searchPage.checkSelectedFilters(this.filters);
+ this.searchPage.updateBaseUrlWithParameters(this.filters);
+ var errorCodes:ErrorCodes = new ErrorCodes();
+ this.searchUtils.status = errorCodes.DONE;
+ if(this.searchUtils.totalResults == 0 ){
+ this.searchUtils.status = errorCodes.NONE;
+ }
+ //this.searchPage.closeLoading();
+ this.disableForms = false;
+
+ },
+ err => {
+ console.log(err);
+ //TODO check erros (service not available, bad request)
+ // if( ){
+ // this.searchUtils.status = ErrorCodes.ERROR;
+ // }
+ var errorCodes:ErrorCodes = new ErrorCodes();
+ this.searchUtils.status = errorCodes.ERROR;
+ //this.searchPage.closeLoading();
+ this.disableForms = false;
+
+ }
+ );
+ } else {
+ this.searchPage.checkSelectedFilters(this.filters);
+ this.searchPage.updateBaseUrlWithParameters(this.filters);
+
+ var errorCodes:ErrorCodes = new ErrorCodes();
+ this.searchUtils.status = errorCodes.NONE;
+ this.disableForms = false;
+ }
+ },
+ err => {
+ console.log(err);
+ //TODO check erros (service not available, bad request)
+ // if( ){
+ // this.searchUtils.status = ErrorCodes.ERROR;
+ // }
+ var errorCodes:ErrorCodes = new ErrorCodes();
+ this.searchUtils.status = errorCodes.ERROR;
+ //this.searchPage.closeLoading();
+ }
+ );
+/*
+ this.subResults = this._searchDataprovidersService.searchEntityRegistries(parameters,(refine)?this.searchPage.getRefineFieldsQuery():null, page, size, []).subscribe(
+ data => {
+ this.searchUtils.totalResults = data[0];
+ console.info("search Entity Registries: [Parameters:"+parameters+" ] [total results:"+this.searchUtils.totalResults+"]");
+ this.results = data[1];
+ this.searchPage.checkSelectedFilters(this.filters);
+ this.searchPage.updateBaseUrlWithParameters(this.filters);
+ var errorCodes:ErrorCodes = new ErrorCodes();
+ this.searchUtils.status = errorCodes.DONE;
+ if(this.searchUtils.totalResults == 0 ){
+ this.searchUtils.status = errorCodes.NONE;
+ }
+ //this.searchPage.closeLoading();
+ this.disableForms = false;
+
+ },
+ err => {
+ console.log(err);
+ //TODO check erros (service not available, bad request)
+ // if( ){
+ // this.searchUtils.status = ErrorCodes.ERROR;
+ // }
+ var errorCodes:ErrorCodes = new ErrorCodes();
+ this.searchUtils.status = errorCodes.ERROR;
+ //this.searchPage.closeLoading();
+ this.disableForms = false;
+
+ }
+ );
+*/
+ }
+ private setFilters(){
+ //TODO set filters from
+ }
+
+ public queryChanged($event) {
+ var parameters = $event.index;
+ console.info("queryChanged: Execute search query "+parameters);
+ this._getResults(parameters, false, this.searchUtils.page);
+ }
+ private createFilters():Filter[] {
+ var filter_names=["Type","Compatibility Level"];
+ var filter_ids=["datasourcetypename","datasourcecompatibilityname"];
+ var searchFields = new SearchFields();
+ var filter_original_ids = searchFields.ENTITY_REGISTRIES_FIELDS;
+ var value_names=[
+ ["Funder database","Registry of repositories","Scholarly Comm. Infrastructure","Registry","Information Space","Web Source"],
+
+ ["OpenAIRE Basic (DRIVER OA)","OpenAIRE 2.0 (EC funding)", "OpenAIRE 2.0+ (DRIVER OA, EC funding)", "OpenAIRE 3.0 (OA, funding)","OpenAIRE Data (funded, referenced datasets)"]];
+
+ var value_original_ids=[
+ ["Funder database","Registry of repositories","Scholarly Comm. Infrastructure","Registry","Information Space","Web Source"],
+ //["entityregistry::projects","entityregistry::repositories","scholarcomminfra","entityregistry","infospace","websource"],
+ //["driver","openaire2.0", "driver-openaire2.0", "openaire3.0","openaire2.0_data"]
+ ["OpenAIRE Basic (DRIVER OA)","OpenAIRE 2.0 (EC funding)", "OpenAIRE 2.0+ (DRIVER OA, EC funding)", "OpenAIRE 3.0 (OA, funding)","OpenAIRE Data (funded, referenced datasets)"]];
+
+ var filters: Filter[] =[];
+ for(var i =0 ; i < filter_names.length;i++){
+ var values:Value[] = [];
+ for(var j =0 ; j < value_names[i].length;j++){
+ 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' };
+ filters.push(filter);
+ }
+ return filters;
+ }
+
+
+
+ public downloadClicked($event) {
+ if(!this.CSVDownloaded) {
+ this.CSVDownloaded = false;
+
+ var parameters = $event.value;
+
+ //this.getResultsCSV(parameters, false, 1, 1000);
+
+ this._searchDataprovidersService.searchEntityRegistriesCSV(parameters, this.searchPage.getRefineFieldsQuery(), 1, 1000).subscribe(
+ data => {
+ this.CSV.export = data;
+ ExportCSVComponent.downloadCSV(this.CSV, "etityRegistries.csv");
+
+ var errorCodes:ErrorCodes = new ErrorCodes();
+ this.searchUtils.status = errorCodes.DONE;
+ },
+ err => {
+ console.log(err);
+ //TODO check erros (service not available, bad request)
+ // if( ){
+ // this.searchUtils.status = ErrorCodes.ERROR;
+ // }
+ var errorCodes:ErrorCodes = new ErrorCodes();
+ this.searchUtils.status = errorCodes.ERROR;
+ }
+ );
+ }
+ }
+}
diff --git a/portal-2/src/app/searchPages/dataProviders/entityRegistriesTable.module.ts b/portal-2/src/app/searchPages/dataProviders/entityRegistriesTable.module.ts
new file mode 100644
index 00000000..1db01786
--- /dev/null
+++ b/portal-2/src/app/searchPages/dataProviders/entityRegistriesTable.module.ts
@@ -0,0 +1,32 @@
+import { NgModule} from '@angular/core';
+import { CommonModule } from '@angular/common';
+import { FormsModule } from '@angular/forms';
+
+import{ EntityRegistriesTableRoutingModule} from './entityRegistriesTable-routing.module';
+import{SearchEntityRegistriesTableComponent} from './entityRegistriesTable.component';
+
+//import {DatasourceTableViewModule } from '../searchUtils/datasourceTableView.module';
+
+import {DataProvidersServiceModule} from '../../services/dataProvidersService.module';
+import {SearchFormModule} from '../searchUtils/searchForm.module';
+//import {SearchFilterModalModule} from '../searchUtils/searchFilterModal.module';
+import {SearchPageTableViewModule} from '../searchUtils/searchPageTableView.module';
+import {FreeGuard} from'../../login/freeGuard.guard';
+
+@NgModule({
+ imports: [
+ CommonModule, FormsModule,
+ DataProvidersServiceModule,
+ SearchFormModule, /*DatasourceTableViewModule,*/ EntityRegistriesTableRoutingModule, SearchPageTableViewModule
+
+ ],
+ declarations: [
+ SearchEntityRegistriesTableComponent
+ ],
+ providers:[FreeGuard
+ ],
+ exports: [
+ SearchEntityRegistriesTableComponent
+ ]
+})
+export class EntityRegistriesTableModule { }
diff --git a/portal-2/src/app/searchPages/find/mainSearch.module.ts b/portal-2/src/app/searchPages/find/mainSearch.module.ts
index 4d63b1b3..369534de 100644
--- a/portal-2/src/app/searchPages/find/mainSearch.module.ts
+++ b/portal-2/src/app/searchPages/find/mainSearch.module.ts
@@ -16,6 +16,7 @@ import {OrganizationsServiceModule} from '../../services/organizationsService.mo
import {PeopleServiceModule} from '../../services/peopleService.module';
import {BrowseEntitiesModule} from '../searchUtils/browseEntities.module';
import {SearchFormModule} from '../searchUtils/searchForm.module';
+//import {SearchFilterModalModule} from '../searchUtils/searchFilterModal.module';
import {FreeGuard} from'../../login/freeGuard.guard';
@NgModule({
@@ -23,7 +24,7 @@ import {FreeGuard} from'../../login/freeGuard.guard';
CommonModule, FormsModule, RouterModule,
DataProvidersServiceModule, DatasetsServiceModule, ProjectsServiceModule,
PublicationsServiceModule, OrganizationsServiceModule, PeopleServiceModule,
- BrowseEntitiesModule, SearchFormModule, SearchResultsModule, MainSearchRoutingModule
+ BrowseEntitiesModule, SearchFormModule, SearchResultsModule, MainSearchRoutingModule//, SearchFilterModalModule
],
declarations: [
diff --git a/portal-2/src/app/searchPages/searchUtils/searchFilter.module.ts b/portal-2/src/app/searchPages/searchUtils/searchFilter.module.ts
new file mode 100644
index 00000000..3cc6792b
--- /dev/null
+++ b/portal-2/src/app/searchPages/searchUtils/searchFilter.module.ts
@@ -0,0 +1,24 @@
+import { NgModule} from '@angular/core';
+import { CommonModule } from '@angular/common';
+import { FormsModule } from '@angular/forms';
+
+import {SearchFilterComponent} from './searchFilter.component';
+import{SearchFilterModalComponent} from './searchFilterModal.component';
+import {ModalModule} from '../../utils/modal/modal.module';
+
+@NgModule({
+ imports: [
+ CommonModule, FormsModule, ModalModule
+ ],
+ declarations: [
+ SearchFilterComponent, SearchFilterModalComponent
+],
+
+ providers:[
+ ],
+ exports: [
+ SearchFilterComponent, SearchFilterModalComponent
+
+ ]
+})
+export class SearchFilterModule { }
diff --git a/portal-2/src/app/searchPages/searchUtils/searchPage.component.ts b/portal-2/src/app/searchPages/searchUtils/searchPage.component.ts
index a8453aff..0e77f9c9 100644
--- a/portal-2/src/app/searchPages/searchUtils/searchPage.component.ts
+++ b/portal-2/src/app/searchPages/searchUtils/searchPage.component.ts
@@ -50,11 +50,28 @@ import {SearchFilterModalComponent} from './searchFilterModal.component';
@@ -66,11 +83,18 @@ import {SearchFilterModalComponent} from './searchFilterModal.component';
-
+
+
@@ -97,7 +121,9 @@ export class SearchPageComponent {
@Input() csvParams: string;
@Input() csvPath: string;
@Input() advancedSearchLink: string = "";
- @Input() disableForms:boolean = false;
+ @Input() tableViewLink: string;
+ @Input() disableForms: boolean = false;
+ @Input() tableView: boolean = false;
@ViewChild (ModalLoading) loading : ModalLoading ;
public fieldIdsMap;//: { [key:string]:{ name:string, operator:string, type:string, indexField:string, equalityOperator:string }};
diff --git a/portal-2/src/app/searchPages/searchUtils/searchPage.module.ts b/portal-2/src/app/searchPages/searchUtils/searchPage.module.ts
index 726d6565..aca9c561 100644
--- a/portal-2/src/app/searchPages/searchUtils/searchPage.module.ts
+++ b/portal-2/src/app/searchPages/searchUtils/searchPage.module.ts
@@ -6,8 +6,10 @@ import { RouterModule } from '@angular/router';
import{SearchPageComponent} from './searchPage.component';
import{SearchFormModule} from './searchForm.module';
import{SearchResultsModule} from './searchResults.module';
-import{SearchFilterComponent} from './searchFilter.component';
-import{SearchFilterModalComponent} from './searchFilterModal.component';
+//import{DatasourceTableViewModule} from './datasourceTableView.module';
+//import{SearchFilterComponent} from './searchFilter.component';
+//import{SearchFilterModalComponent} from './searchFilterModal.component';
+import {SearchFilterModule} from './searchFilter.module';
import{LoadingModalModule} from '../../utils/modal/loadingModal.module';
import {ReportsServiceModule} from '../../services/reportsService.module';
import{SearchPagingModule} from './searchPaging.module';
@@ -17,20 +19,23 @@ import {ModalModule} from '../../utils/modal/modal.module';
@NgModule({
imports: [
- CommonModule, FormsModule,RouterModule, SearchFormModule, SearchResultsModule, LoadingModalModule, ReportsServiceModule, SearchPagingModule, SearchDownloadModule, ModalModule
+ CommonModule, FormsModule,RouterModule, SearchFormModule, SearchResultsModule,
+ /*DatasourceTableViewModule,*/ LoadingModalModule, ReportsServiceModule,
+ SearchPagingModule, SearchDownloadModule, ModalModule, SearchFilterModule
],
declarations: [
- SearchPageComponent,
- SearchFilterComponent,
- SearchFilterModalComponent
+ SearchPageComponent//,
+ //SearchFilterComponent,
+ //SearchFilterModalComponent
,
],
providers:[
],
exports: [
- SearchPageComponent,
- SearchFilterComponent
+ SearchPageComponent//,
+ //SearchFilterComponent,
+ //SearchFilterModalComponent
]
})
export class SearchPageModule { }
diff --git a/portal-2/src/app/searchPages/searchUtils/searchPageTableView.component.ts b/portal-2/src/app/searchPages/searchUtils/searchPageTableView.component.ts
new file mode 100644
index 00000000..84cae3a3
--- /dev/null
+++ b/portal-2/src/app/searchPages/searchUtils/searchPageTableView.component.ts
@@ -0,0 +1,653 @@
+import {Component, Input, ViewChild, Output, EventEmitter} from '@angular/core';
+import {Observable} from 'rxjs/Observable';
+import {Location} from '@angular/common';
+import { Filter, Value} from './searchHelperClasses.class';
+import {SearchResult} from '../../utils/entities/searchResult';
+import {SearchFields} from '../../utils/properties/searchFields';
+import {SearchUtilsClass} from './searchUtils.class';
+import {DOI, StringUtils} from '../../utils/string-utils.class';
+import {ModalLoading} from '../../utils/modal/loading.component';
+import { Meta} from '../../../angular2-meta';
+import{SearchFilterComponent} from './searchFilter.component';
+import {SearchFilterModalComponent} from './searchFilterModal.component';
+import { ErrorCodes} from '../../utils/properties/openaireProperties';
+
+@Component({
+ selector: 'search-page-table',
+ template: `
+
+
+
+
+
+
+
+
+
+
+
+
+
+
No Results found
+
An Error Occured
+
Service not available
+
Loading...
+
+
0" class="uk-overflow-container custom-dataTable-content">
+
+
+
+
+ {{searchUtils.totalResults}} datasources, page {{searchUtils.page}} of {{(totalPages())}}
+
+
+ |
+
+
+ |
+
+
+ Show results in default view
+
+ |
+
+
+
+ Name |
+ Type |
+ Country |
+ Institution |
+ Compatibility |
+
+
+
+
+
+
+
+
+
+
+ [no title available]
+
+
+ |
+
+ {{dataprovider.type}}
+ -
+ |
+
+ {{country}}{{(i < ( dataprovider['countries'].slice(0,5).length-1))?", ":""}}{{(i == dataprovider['countries'].slice(0,5).length-1 && dataprovider['countries'].length > 5)?"...":""}}
+ -
+ |
+
+
+ {{org.name}}{{org.name}}{{(i < ( dataprovider['organizations'].slice(0,5).length-1))?", ":""}}{{(i == dataprovider['organizations'].slice(0,5).length-1 && dataprovider['organizations'].length > 5)?"...":""}}
+
+ -
+ |
+
+ {{dataprovider.compatibility}}
+ -
+ |
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ `
+})
+export class SearchPageTableViewComponent {
+ @Input() pageTitle = "";
+ @Input() results = [];
+ @Input() filters = [];
+ @Input() type:string = "";
+ @Input() entityType: string = "";
+ @Input() searchUtils:SearchUtilsClass = new SearchUtilsClass();
+ @Output() queryChange = new EventEmitter();
+ @Output() downloadClick = new EventEmitter();
+ @Input() baseUrl:string = '';
+ @Input() showResultCount:boolean = true;
+ @Input() showRefine:boolean = true;
+ @Input() refineFields = [];
+ @Input() csvParams: string;
+ @Input() csvPath: string;
+ @Input() advancedSearchLink: string = "";
+ @Input() searchViewLink: string;
+ @Input() disableForms: boolean = false;
+
+ @ViewChild (ModalLoading) loading : ModalLoading ;
+ public fieldIdsMap;//: { [key:string]:{ name:string, operator:string, type:string, indexField:string, equalityOperator:string }};
+ private searchFieldsHelper:SearchFields = new SearchFields();
+ private queryParameters: Map = new Map();
+ private baseURLWithParameters:string = '';
+ private sub: any;
+ public countFilters= 0;
+ public urlParam: string;
+ public parameterNames:string[] =[];
+ public parameterValues:string[] =[];
+
+ //public activePage: number = 1;
+ public rowsOnPage = 10;
+ public sortOrder = "asc";
+ @ViewChild('mf') table: any;//DataTable;
+
+ @ViewChild (SearchFilterModalComponent) searchFilterModal : SearchFilterModalComponent ;
+ public currentFilter: Filter;
+ public errorCodes:ErrorCodes = new ErrorCodes();
+
+ constructor (private location: Location , private _meta: Meta) {
+ }
+
+ ngOnInit() {
+ this.updateBaseUrlWithParameters(this.filters);
+ this.defineUrlParam();
+ this.updateTitle(this.pageTitle);
+ this.updateDescription("Openaire, search, repositories, open access, type, data provider, funder, project, " + this.type + "," +this.pageTitle);
+ // console.info(this.entityType + " " + this.urlParam + this.type);
+ }
+ ngAfterViewChecked(){
+
+ }
+
+ totalPages(): number {
+ let totalPages:any = this.searchUtils.totalResults/(this.rowsOnPage);
+ if(!(Number.isInteger(totalPages))) {
+ totalPages = (parseInt(totalPages, 10) + 1);
+ }
+ return totalPages;
+ }
+
+ refreshTable($event:any) {
+ this.searchUtils.page=$event.value;
+ this.table.mfActivePage=$event.value;
+ this.table.setPage(this.table.mfActivePage, this.rowsOnPage);
+ }
+
+ toggleModal($event) {
+ this.currentFilter = $event.value;
+ this.searchFilterModal.open();
+ }
+
+ updateDescription(description:string){
+ this._meta.updateMeta("description", description);
+ this._meta.updateMeta("og:description", description);
+ }
+ updateTitle(title:string){
+ var _suffix ="| OpenAIRE";
+ var _title = ((title.length> 50 ) ?title.substring(0,50):title) + _suffix;
+ this._meta.setTitle(_title );
+ this._meta.updateMeta("og:title",_title);
+ }
+ private defineUrlParam() {
+ if(this.entityType == "publication") {
+ this.urlParam = "articleId";
+ } else if(this.entityType == "dataset") {
+ this.urlParam = "datasetId";
+ } else if(this.entityType == "project") {
+ this.urlParam = "projectId";
+ } else if(this.entityType == "organization") {
+ this.urlParam = "organizationId";
+ } else if(this.entityType == "person") {
+ this.urlParam = "personId";
+ } else {
+ this.urlParam = "datasourceId";
+ }
+ }
+
+ public getQueryParametersFromUrl(params){
+ // var parameters = "";
+ var allFqs = "";
+
+ for(var i=0; i< this.refineFields.length ; i++){
+ var filterId = this.refineFields[i];
+
+ if(params[filterId] != undefined) {
+ if(this.queryParameters == undefined){
+ this.queryParameters = new Map();
+ }
+ this.queryParameters[filterId]=StringUtils.URIDecode(params[filterId]);
+ let values = (StringUtils.URIDecode(this.queryParameters[filterId])).split(/,(?=(?:[^\"]*\"[^\"]*\")*[^\"]*$)/,-1);
+ var countvalues = 0;
+ var fq = "";
+ for(let value of values) {
+ countvalues++;
+ var paramId = this.fieldIdsMap[filterId].param;
+ // parameters+='&' + paramId+ '='+ value;//+"&" + this.fieldIdsMap[paramId].operator + "="+((countvalues == 1)?"and":"or");
+ fq+=(fq.length > 0 ? " " + "or" + " ":"" ) + filterId +" exact " +value;// StringUtils.quote(value) ;
+ }
+ if(countvalues > 0){
+ fq="&fq="+fq;
+ }
+ allFqs += fq;
+ }
+
+
+ }
+ var keyword = params['keyword'];
+ var doiQuery = "";
+ var keywordQuery = "";
+ if((keyword && keyword.length > 0)){
+ if((this.type == 'publications' ||this.type == 'datasets')){
+ var DOIs:string[] = DOI.getDOIsFromString(keyword);
+ var doisParams = "";
+
+ for(var i =0 ;i < DOIs.length; i++){
+ doisParams+=(doisParams.length > 0?"&":"")+'doi="'+ DOIs[i]+'"';
+ }
+ if(doisParams.length > 0){
+ doiQuery += "&"+doisParams;
+ }else {
+ keywordQuery += "&q="+StringUtils.URIEncode(keyword);
+ }
+ }else{
+ keywordQuery += "&q="+StringUtils.URIEncode(keyword);
+
+ }
+ }
+ return (doiQuery.length > 0 ? doiQuery:keywordQuery) + allFqs;
+ }
+ public getIndexQueryParametersFromUrl(params){
+ // var parameters = "";
+ var allFqs = "";
+
+ for(var i=0; i< this.refineFields.length ; i++){
+ var filterId = this.refineFields[i];
+ var fq = "";
+ if(params[filterId] != undefined) {
+ if(this.queryParameters == undefined){
+ this.queryParameters = new Map();
+ }
+ this.queryParameters[filterId]=decodeURIComponent(params[filterId]);
+ let values = (decodeURIComponent(this.queryParameters[filterId])).split(/,(?=(?:[^\"]*\"[^\"]*\")*[^\"]*$)/,-1);
+ var countvalues = 0
+ for(let value of values) {
+ countvalues++;
+ // parameters+= ((countvalues == 1)?" and (":" or ")+ filterId+ '='+ value;
+ fq+=(fq.length > 0 ? " " + "or" + " ":"" ) + filterId + " exact " + value;//StringUtils.quote(value);
+ }
+ // parameters+= " ) ";
+ if(countvalues > 0){
+ fq="&fq="+fq;
+ }
+ allFqs += fq;
+ }
+
+ }
+ var keyword = params['keyword'];
+ var doiQuery = "";
+ var keywordQuery = "";
+ if((keyword && keyword.length > 0)){
+ if((this.type == 'publications' ||this.type == 'datasets')){
+ var DOIs:string[] = DOI.getDOIsFromString(keyword);
+ var doisParams = "";
+
+ for(var i =0 ;i < DOIs.length; i++){
+ doisParams+=(doisParams.length > 0?"&":"")+'doi="'+ DOIs[i]+'"';
+ }
+ if(doisParams.length > 0){
+ doiQuery += "&"+doisParams;
+ }
+ }else{
+ keywordQuery += "and ("+StringUtils.quote(StringUtils.URIEncode(keyword)) +")";
+
+ }
+ }
+ return (doiQuery.length > 0 ? doiQuery:keywordQuery) + allFqs;
+
+}
+ /*
+ * Mark as check the new filters that are selected, when you get them from search
+ */
+ public checkSelectedFilters(filters:Filter[]){
+ this.filters = filters;
+ for(var i=0; i< filters.length ; i++){
+ var filter:Filter = filters[i];
+ filter.countSelectedValues = 0;
+ if(this.queryParameters[filter.filterId] != undefined) {
+ let values = (decodeURIComponent(this.queryParameters[filter.filterId])).split(/,(?=(?:[^\"]*\"[^\"]*\")*[^\"]*$)/,-1);
+ for(let filterValue of filter.values) {
+ if(values.indexOf(StringUtils.quote(filterValue.id)) > -1) {
+ filterValue.selected = true;
+ filter.countSelectedValues++;
+ }else{
+ filterValue.selected = false;
+
+ }
+ }
+ }else{
+ for(let filterValue of filter.values) {
+ filterValue.selected = false;
+ }
+ }
+ }
+
+ return filters;
+ }
+ /*
+ * Update the url with proper parameters. This is used as base url in Paging Component
+ */
+ public updateBaseUrlWithParameters(filters:Filter[]){
+ this.baseURLWithParameters = this.baseUrl + this.createUrlParameters(filters,false);
+ }
+ /*
+ *
+ */
+ private createUrlParameters(filters:Filter[], includePage:boolean){
+ var allLimits="";//location.search.slice(1);
+ this.parameterNames.splice(0,this.parameterNames.length);
+ this.parameterValues.splice(0,this.parameterValues.length);
+
+ for (let filter of filters){
+ var filterLimits="";
+ if(filter.countSelectedValues > 0){
+ for (let value of filter.values){
+ if(value.selected == true){
+ filterLimits+=((filterLimits.length == 0)?'':',') +'"'+ StringUtils.URIEncode(value.id)+'"';
+ }
+ }
+ this.queryParameters[filter.filterId]=filterLimits;
+ if(filterLimits.length > 0){
+ this.parameterNames.push(filter.filterId);
+ this.parameterValues.push(filterLimits);
+ }
+ allLimits+=(allLimits.length==0?"?":"&")+((filterLimits.length == 0 )?'':filter.filterId + '='+ filterLimits) ;
+ }
+ }
+ if(this.searchUtils.keyword.length > 0 ){
+ allLimits+=(allLimits.length==0?"?":"&")+'keyword=' + this.searchUtils.keyword;
+ this.parameterNames.push("keyword");
+ this.parameterValues.push(this.searchUtils.keyword);
+ }
+ if(this.searchUtils.page != 1 && includePage){
+ allLimits+=((allLimits.length == 0)?'?':'&') + 'page=' + this.searchUtils.page;
+ }
+
+ return allLimits;
+ }
+ /*
+ *
+ */
+ private createSearchQueryParameters(filters:Filter[]){
+ var allFqs = "";
+ for (let filter of filters){
+ if(filter.countSelectedValues > 0){
+ var fq = "";
+ var count_selected=0;
+ for (let value of filter.values){
+ if(value.selected == true){
+ count_selected++;
+ fq+=(fq.length > 0 ? " " + filter.filterOperator + " ":"" ) + filter.filterId + " exact " + StringUtils.quote(StringUtils.URIEncode(value.id));
+ }
+ }
+ fq="&fq="+fq;
+ allFqs += fq;
+ }
+ }
+ var doiQuery = "";
+ var keywordQuery = "";
+ if((this.searchUtils.keyword && this.searchUtils.keyword.length > 0)){
+ if((this.type == 'publications' ||this.type == 'datasets')){
+ var DOIs:string[] = DOI.getDOIsFromString(this.searchUtils.keyword);
+ var doisParams = "";
+
+ for(var i =0 ;i < DOIs.length; i++){
+ doisParams+=(doisParams.length > 0?"&":"")+'doi="'+ DOIs[i]+'"';
+ }
+ if(doisParams.length > 0){
+ doiQuery += "&"+doisParams;
+ }else{
+ keywordQuery += "&q="+StringUtils.URIEncode(this.searchUtils.keyword);
+ }
+ }else{
+ keywordQuery += "&q="+StringUtils.URIEncode(this.searchUtils.keyword);
+ }
+ }
+
+ return (doiQuery.length > 0 ? doiQuery:keywordQuery) + allFqs;
+
+ }
+ private createIndexQueryParameters(filters:Filter[]){
+ var allFqs = "";
+ for (let filter of filters){
+ if(filter.countSelectedValues > 0){
+ var count_selected=0;
+ var fq = "";
+ for (let value of filter.values){
+ if(value.selected == true){
+ count_selected++;
+ fq+=(fq.length > 0 ? " " + filter.filterOperator + " ":"" ) + filter.filterId + " exact " + StringUtils.quote(StringUtils.URIEncode(value.id));
+ }
+ }
+ if(count_selected > 0){
+ fq="&fq="+fq;
+ allFqs += fq;
+ }
+ }
+ }
+ var doiQuery = "";
+ var keywordQuery = "";
+ if((this.searchUtils.keyword && this.searchUtils.keyword.length > 0)){
+ if((this.type == 'publications' ||this.type == 'datasets')){
+ var DOIs:string[] = DOI.getDOIsFromString(this.searchUtils.keyword);
+ var doisParams = "";
+ for(var i =0 ;i < DOIs.length; i++){
+ doisParams+=(doisParams.length > 0?"&":"")+'doi="'+ DOIs[i]+'"';
+ }
+ if(doisParams.length > 0){
+ doiQuery += "&"+doisParams;
+ }
+ }else{
+ keywordQuery += " and ("+StringUtils.quote(StringUtils.URIEncode(this.searchUtils.keyword)) +")"
+
+ }
+ }
+ return (doiQuery.length > 0 ? doiQuery:keywordQuery) + allFqs;
+
+ }
+ private isFiltered(){
+ var filtered=false;
+ for (let filter of this.filters){
+ if(filter.countSelectedValues > 0){
+ filtered = true;
+ break;
+ }
+ }
+ if(this.searchUtils.keyword.length > 0 ){
+ filtered = true;
+ }
+ return filtered;
+ }
+ private clearKeywords(){
+ if(this.searchUtils.keyword.length > 0 ){
+ this.searchUtils.keyword ='';
+ }
+ this.goTo(1);
+ }
+ private clearFilters(){
+ for (var i =0 ; i < this.filters.length; i++){
+ for (var j=0; j < this.filters[i].countSelectedValues; j++){
+ if(this.filters[i].values[j].selected){
+ this.filters[i].values[j].selected = false;
+ }
+ this.filters[i].countSelectedValues = 0;
+ }
+ }
+ this.clearKeywords();
+
+ }
+ private removeFilter(value:Value,filter:Filter){
+ filter.countSelectedValues--;
+ if(value.selected == true){
+ value.selected = false;
+ }
+ this.goTo(1);
+
+ }
+ goTo(page:number = 1){
+ this.searchUtils.page = page;
+ console.info("searchUtils.page goto = "+this.searchUtils.page);
+ this.queryParameters = new Map();
+ var urlParameters = this.createUrlParameters(this.filters,true);
+ console.info("urlParams : "+urlParameters);
+ this.updateBaseUrlWithParameters(this.filters);
+ var queryParameters = this.createSearchQueryParameters(this.filters);
+ console.info("queryParams : "+queryParameters);
+ var indexQuery = this.createIndexQueryParameters(this.filters);
+
+ this.location.go(location.pathname,urlParameters);
+
+ this.queryChange.emit({
+ value: queryParameters,
+ index:indexQuery
+
+ });
+
+ }
+ filterChanged($event){
+ console.info("filter Changed");
+ this.goTo(1);
+ }
+ keywordChanged($event) {
+ this.searchUtils.keyword = $event.value;
+ this.goTo(1);
+ }
+
+ downloadClicked($event) {
+ if($event.value == true) {
+ var queryParameters = this.createSearchQueryParameters(this.filters);
+
+ this.downloadClick.emit({
+ value: queryParameters
+ });
+ }
+ }
+
+ /*
+ * Get A sub-array of this.refineFields array, which contains the ids of the selected filters
+ */
+ public getSelectedFilters():string[] {
+ var selected:string[] = [];
+ for(var i=0; i < this.filters.length; i++){
+ var filter:Filter = this.filters[i];
+ if(filter.countSelectedValues > 0){
+ selected.push(filter.filterId);
+ }
+ }
+ return selected;
+ }
+ /*
+ * Get A sub-array of this.refineFields array, which contains the ids of the selected parameters
+ */
+ private getSelectedParameters():string[] {
+ var selected:string[] = [];
+ var params:string[] = Object.keys(this.queryParameters);
+ for(var i=0; i < params.length; i++){
+ if(this.refineFields.indexOf(params[i]) > -1){
+ selected.push(params[i]);
+ }
+ }
+ return selected;
+ }
+ /*
+ * Get A sub-array of this.refineFields array, which hides hidden fields (e.g Funding level 0,1,2,..), and contains those that depend on another fields (e.g Funding level 0 if Funder is selected )
+ */
+ public getFields():string[] {
+ var selected_filters:string[] = this.getSelectedFilters();
+ if(selected_filters.length == 0){
+ selected_filters = this.getSelectedParameters();
+ }
+ var fields:string[] = [];
+ for(var i =0 ; i < this.refineFields.length;i++){
+ var dependentTo = this.searchFieldsHelper.DEPENDENT_FIELDS[this.refineFields[i]];
+
+ //if filter is not marked as hidden OR it is hidden but it is dependent to a field that it IS selected
+ if(this.searchFieldsHelper.HIDDEN_FIELDS.indexOf(this.refineFields[i]) == -1 || (selected_filters.indexOf(dependentTo) != -1) ){
+ fields.push(this.refineFields[i]);
+ }
+ }
+ return fields;
+ }
+ /*
+ * Get a query string of all fields, that want to get from search (e.g. &fields=funderid&fields=projectstartyear&...))
+ */
+ public getRefineFieldsQuery():string{
+
+ var fields:string[] = this.getFields();
+ var fieldsStr = ""
+ for(var i =0 ; i < fields.length ;i++){
+ fieldsStr+="&fields="+fields[i];
+ }
+ return "&refine=true"+fieldsStr;
+ }
+
+ // for loading
+ public openLoading(){
+ if(this.loading){
+ this.loading.open();
+ }
+ }
+ public closeLoading(){
+ if(this.loading){
+ this.loading.close();
+ }
+ }
+ getSelectedValues(filter):any{
+ var selected = [];
+ if(filter.countSelectedValues >0){
+ for (var i=0; i < filter.values.length; i++){
+ if(filter.values[i].selected){
+ selected.push(filter.values[i]);
+ }
+ }
+ }
+ return selected;
+
+ }
+}
diff --git a/portal-2/src/app/searchPages/searchUtils/searchPageTableView.module.ts b/portal-2/src/app/searchPages/searchUtils/searchPageTableView.module.ts
new file mode 100644
index 00000000..144d36df
--- /dev/null
+++ b/portal-2/src/app/searchPages/searchUtils/searchPageTableView.module.ts
@@ -0,0 +1,42 @@
+import { NgModule} from '@angular/core';
+import { CommonModule } from '@angular/common';
+import { FormsModule } from '@angular/forms';
+import { RouterModule } from '@angular/router';
+
+import{SearchPageTableViewComponent} from './searchPageTableView.component';
+import{SearchFormModule} from './searchForm.module';
+import{SearchResultsModule} from './searchResults.module';
+//import{DatasourceTableViewModule} from './datasourceTableView.module';
+//import{SearchFilterComponent} from './searchFilter.component';
+//import{SearchFilterModalComponent} from './searchFilterModal.component';
+import {SearchFilterModule} from './searchFilter.module';
+import{LoadingModalModule} from '../../utils/modal/loadingModal.module';
+import {ReportsServiceModule} from '../../services/reportsService.module';
+import{SearchPagingModule} from './searchPaging.module';
+import {SearchDownloadModule} from './searchDownload.module';
+import {ModalModule} from '../../utils/modal/modal.module';
+import {PagingModule} from '../../utils/paging.module';
+import {DataTableModule} from "angular2-datatable";
+
+
+@NgModule({
+ imports: [
+ CommonModule, FormsModule,RouterModule, SearchFormModule, SearchResultsModule, /*DatasourceTableViewModule,*/ LoadingModalModule,
+ ReportsServiceModule, SearchPagingModule, SearchDownloadModule, ModalModule, PagingModule, DataTableModule, SearchFilterModule
+ ],
+ declarations: [
+ SearchPageTableViewComponent//,
+ //SearchFilterComponent,
+ //SearchFilterModalComponent
+ ,
+],
+
+ providers:[
+ ],
+ exports: [
+ SearchPageTableViewComponent//,
+ //SearchFilterComponent,
+ //SearchFilterModalComponent
+ ]
+})
+export class SearchPageTableViewModule { }
diff --git a/portal-2/src/app/searchPages/simple/searchDataProviders.module.ts b/portal-2/src/app/searchPages/simple/searchDataProviders.module.ts
index 03e24660..7752bf52 100644
--- a/portal-2/src/app/searchPages/simple/searchDataProviders.module.ts
+++ b/portal-2/src/app/searchPages/simple/searchDataProviders.module.ts
@@ -9,6 +9,7 @@ import {SearchResultsModule } from '../searchUtils/searchResults.module';
import {DataProvidersServiceModule} from '../../services/dataProvidersService.module';
import {SearchFormModule} from '../searchUtils/searchForm.module';
+//import {SearchFilterModalModule} from '../searchUtils/searchFilterModal.module';
import {SearchPageModule} from '../searchUtils/searchPage.module';
import {FreeGuard} from'../../login/freeGuard.guard';
@@ -17,7 +18,7 @@ import {FreeGuard} from'../../login/freeGuard.guard';
CommonModule, FormsModule,
DataProvidersServiceModule,
- SearchFormModule, SearchResultsModule, SearchDataProvidersRoutingModule, SearchPageModule
+ SearchFormModule, SearchResultsModule, SearchDataProvidersRoutingModule, SearchPageModule//, SearchFilterModalModule
],
declarations: [
diff --git a/portal-2/src/app/searchPages/simple/searchDatasets.module.ts b/portal-2/src/app/searchPages/simple/searchDatasets.module.ts
index d686200d..98e27db0 100644
--- a/portal-2/src/app/searchPages/simple/searchDatasets.module.ts
+++ b/portal-2/src/app/searchPages/simple/searchDatasets.module.ts
@@ -9,6 +9,7 @@ import {SearchResultsModule } from '../searchUtils/searchResults.module';
import {DatasetsServiceModule} from '../../services/datasetsService.module';
import {SearchFormModule} from '../searchUtils/searchForm.module';
+//import {SearchFilterModalModule} from '../searchUtils/searchFilterModal.module';
import {SearchPageModule} from '../searchUtils/searchPage.module';
import {FreeGuard} from'../../login/freeGuard.guard';
@@ -17,7 +18,7 @@ import {FreeGuard} from'../../login/freeGuard.guard';
CommonModule, FormsModule,
DatasetsServiceModule,
- SearchFormModule, SearchResultsModule, SearchDatasetsRoutingModule, SearchPageModule
+ SearchFormModule, SearchResultsModule, SearchDatasetsRoutingModule, SearchPageModule//, SearchFilterModalModule
],
declarations: [
diff --git a/portal-2/src/app/searchPages/simple/searchOrganizations.module.ts b/portal-2/src/app/searchPages/simple/searchOrganizations.module.ts
index 4f50fe2a..42414911 100644
--- a/portal-2/src/app/searchPages/simple/searchOrganizations.module.ts
+++ b/portal-2/src/app/searchPages/simple/searchOrganizations.module.ts
@@ -9,6 +9,7 @@ import {SearchResultsModule } from '../searchUtils/searchResults.module';
import {OrganizationsServiceModule} from '../../services/organizationsService.module';
import {SearchFormModule} from '../searchUtils/searchForm.module';
+//import {SearchFilterModalModule} from '../searchUtils/searchFilterModal.module';
import {SearchPageModule} from '../searchUtils/searchPage.module';
import {FreeGuard} from'../../login/freeGuard.guard';
@@ -17,7 +18,7 @@ import {FreeGuard} from'../../login/freeGuard.guard';
CommonModule, FormsModule,
OrganizationsServiceModule,
- SearchFormModule, SearchResultsModule, SearchOrganizationsRoutingModule, SearchPageModule
+ SearchFormModule, SearchResultsModule, SearchOrganizationsRoutingModule, SearchPageModule//, SearchFilterModalModule
],
declarations: [
diff --git a/portal-2/src/app/searchPages/simple/searchPeople.module.ts b/portal-2/src/app/searchPages/simple/searchPeople.module.ts
index 2cdc30de..9f2359de 100644
--- a/portal-2/src/app/searchPages/simple/searchPeople.module.ts
+++ b/portal-2/src/app/searchPages/simple/searchPeople.module.ts
@@ -9,6 +9,7 @@ import {SearchResultsModule } from '../searchUtils/searchResults.module';
import {PeopleServiceModule} from '../../services/peopleService.module';
import {SearchFormModule} from '../searchUtils/searchForm.module';
+//import {SearchFilterModalModule} from '../searchUtils/searchFilterModal.module';
import {SearchPageModule} from '../searchUtils/searchPage.module';
import {FreeGuard} from'../../login/freeGuard.guard';
@@ -17,7 +18,7 @@ import {FreeGuard} from'../../login/freeGuard.guard';
CommonModule, FormsModule,
PeopleServiceModule,
- SearchFormModule, SearchResultsModule, SearchPeopleRoutingModule, SearchPageModule
+ SearchFormModule, SearchResultsModule, SearchPeopleRoutingModule, SearchPageModule//, SearchFilterModalModule
],
declarations: [
diff --git a/portal-2/src/app/searchPages/simple/searchProjects.module.ts b/portal-2/src/app/searchPages/simple/searchProjects.module.ts
index 083f430e..f79b2f98 100644
--- a/portal-2/src/app/searchPages/simple/searchProjects.module.ts
+++ b/portal-2/src/app/searchPages/simple/searchProjects.module.ts
@@ -9,6 +9,7 @@ import {SearchResultsModule } from '../searchUtils/searchResults.module';
import {ProjectsServiceModule} from '../../services/projectsService.module';
import {SearchFormModule} from '../searchUtils/searchForm.module';
+//import {SearchFilterModalModule} from '../searchUtils/searchFilterModal.module';
import {SearchPageModule} from '../searchUtils/searchPage.module';
import {FreeGuard} from'../../login/freeGuard.guard';
@@ -17,7 +18,7 @@ import {FreeGuard} from'../../login/freeGuard.guard';
CommonModule, FormsModule,
ProjectsServiceModule,
- SearchFormModule, SearchResultsModule, SearchProjectsRoutingModule, SearchPageModule
+ SearchFormModule, SearchResultsModule, SearchProjectsRoutingModule, SearchPageModule//, SearchFilterModalModule
],
declarations: [
diff --git a/portal-2/src/app/searchPages/simple/searchPublications.module.ts b/portal-2/src/app/searchPages/simple/searchPublications.module.ts
index 20ea399e..b8c2ebb2 100644
--- a/portal-2/src/app/searchPages/simple/searchPublications.module.ts
+++ b/portal-2/src/app/searchPages/simple/searchPublications.module.ts
@@ -9,6 +9,7 @@ import {SearchResultsModule } from '../searchUtils/searchResults.module';
import {PublicationsServiceModule} from '../../services/publicationsService.module';
import {SearchFormModule} from '../searchUtils/searchForm.module';
+//import {SearchFilterModalModule} from '../searchUtils/searchFilterModal.module';
import {SearchPageModule} from '../searchUtils/searchPage.module';
import {FreeGuard} from'../../login/freeGuard.guard';
@@ -17,7 +18,7 @@ import {FreeGuard} from'../../login/freeGuard.guard';
CommonModule, FormsModule,
PublicationsServiceModule,
- SearchFormModule, SearchResultsModule, SearchPublicationsRoutingModule, SearchPageModule
+ SearchFormModule, SearchResultsModule, SearchPublicationsRoutingModule, SearchPageModule//, SearchFilterModalModule
],
declarations: [
diff --git a/portal-2/src/app/services/searchDataproviders.service.ts b/portal-2/src/app/services/searchDataproviders.service.ts
index 76b39a9b..c09a7549 100644
--- a/portal-2/src/app/services/searchDataproviders.service.ts
+++ b/portal-2/src/app/services/searchDataproviders.service.ts
@@ -62,8 +62,34 @@ export class SearchDataprovidersService {
})
.map(res => [res['meta'].total, this.parseResults(res['results'])])
}
+
+ searchCompatibleDataprovidersTable (params: string,refineParams:string):any {
+ let size: number = 0;
+ let url: string= OpenaireProperties.getSearchResourcesAPIURL();
+ url += "?query=((oaftype exact datasource) not(datasourcecompatibilityid = UNKNOWN) not(datasourcecompatibilityid = hostedBy) not(datasourcecompatibilityid = notCompatible) not(datasourcetypeuiid = other))"
+ if(params!= null && params != '' ) {
+ url += params;
+ }
+ if(refineParams!= null && refineParams != '' ) {
+ url += refineParams;
+ }
+ url += "&page=0&size=1&format=json";
+
+ let key = url;
+ if (this._cache.has(key)) {
+ return Observable.of(this._cache.get(key)).map(res => res['meta'].total);
+ }
+
+ return this.http.get(url).map(res => res.json())
+ .do(res => {
+ this._cache.set(key, res);
+ })
+ .map(res => res['meta'].total);
+ }
+
searchCompatibleDataproviders (params: string,refineParams:string, page: number, size: number, refineFields:string[] ):any {
- let url = OpenaireProperties.getSearchResourcesAPIURL();
+ console.info("in search Compatible Dataproviders service function");
+ let url: string = OpenaireProperties.getSearchResourcesAPIURL();
url += "?query=((oaftype exact datasource) not(datasourcecompatibilityid = UNKNOWN) not(datasourcecompatibilityid = hostedBy) not(datasourcecompatibilityid = notCompatible) not(datasourcetypeuiid = other))"
if(params!= null && params != '' ) {
url += params;
@@ -84,9 +110,34 @@ export class SearchDataprovidersService {
})
.map(res => [res['meta'].total, this.parseResults(res['results']),RefineResultsUtils.parse(res['refineResults'],refineFields, "datasource")]);
}
+
+ searchEntityRegistriesTable (params: string,refineParams:string):any {
+ let size: number = 0;
+ let url: string= OpenaireProperties.getSearchResourcesAPIURL();
+ url += "?query=((oaftype exact datasource) and(datasourcetypeuiid = other))";
+ if(params!= null && params != '' ) {
+ url += params;
+ }
+ if(refineParams!= null && refineParams != '' ) {
+ url += refineParams;
+ }
+ url += "&page=0&size=1&format=json";
+
+ let key = url;
+ if (this._cache.has(key)) {
+ return Observable.of(this._cache.get(key)).map(res => res['meta'].total);
+ }
+
+ return this.http.get(url).map(res => res.json())
+ .do(res => {
+ this._cache.set(key, res);
+ })
+ .map(res => res['meta'].total);
+ }
+
searchEntityRegistries (params: string,refineParams:string, page: number, size: number, refineFields:string[] ):any {
let url = OpenaireProperties.getSearchResourcesAPIURL();
- url += "?query=((oaftype exact datasource) and(datasourcetypeuiid = other))"
+ url += "?query=((oaftype exact datasource) and(datasourcetypeuiid = other))";
if(params!= null && params != '' ) {
url += params;
}
@@ -287,7 +338,7 @@ export class SearchDataprovidersService {
result['type'] = this.getDataproviderType(resData);
let typeid: string = resData['datasourcetype'].classid;
- console.info(typeid);
+ //console.info(typeid);
if(typeid != "entityregistry" && typeid != "entityregistry::projects" && typeid != "entityregistry::repositories") {
if(resData.hasOwnProperty('accessinfopackage')) {
diff --git a/portal-2/src/app/utils/properties/openaireProperties.ts b/portal-2/src/app/utils/properties/openaireProperties.ts
index 81ce16d3..a2399e6f 100644
--- a/portal-2/src/app/utils/properties/openaireProperties.ts
+++ b/portal-2/src/app/utils/properties/openaireProperties.ts
@@ -15,7 +15,10 @@ export class OpenaireProperties {
private static searchLinkToOrganizations = "search/find/organizations";
private static searchLinkToPeople = "search/find/people";
public static searchLinkToCompatibleDataProviders = "search/data-providers";
+ public static searchLinkToCompatibleDataProvidersTable = "search/data-providers-table";
public static searchLinkToEntityRegistriesDataProviders = "search/entity-registries";
+ public static searchLinkToEntityRegistriesDataProvidersTable = "search/entity-registries-table";
+
//Advanced Search pages
public static searchLinkToAdvancedPublications = "search/advanced/publications";
public static searchLinkToAdvancedProjects = "search/advanced/projects";
@@ -106,9 +109,15 @@ export class OpenaireProperties {
public static getLinkToSearchCompatibleDataProviders():string{
return this.baseSearchLink + this.searchLinkToCompatibleDataProviders;
}
+ public static getLinkToSearchCompatibleDataProvidersTable():string{
+ return this.baseSearchLink + this.searchLinkToCompatibleDataProvidersTable;
+ }
public static getLinkToSearchEntityRegistries():string{
return this.baseSearchLink + this.searchLinkToEntityRegistriesDataProviders;
}
+ public static getLinkToSearchEntityRegistriesTable():string{
+ return this.baseSearchLink + this.searchLinkToEntityRegistriesDataProvidersTable;
+ }
public static getLinkToSearchDatasets():string{
return this.baseSearchLink + this.searchLinkToDatasets;
}
diff --git a/portal-2/src/server.routes.ts b/portal-2/src/server.routes.ts
index dcc7d5d2..ea9606a7 100644
--- a/portal-2/src/server.routes.ts
+++ b/portal-2/src/server.routes.ts
@@ -15,7 +15,7 @@ export const routes: string[] = [
'search/find/people','search/find/publications','search/find/projects','search/find/datasets','search/find/dataproviders','search/find/organizations',
'search/advanced/people','search/advanced/publications','search/advanced/projects','search/advanced/datasets','search/advanced/dataproviders','search/advanced/organizations',
'participate/deposit-publications','participate/deposit-datasets','participate/deposit-publications-result','participate/deposit-datasets-result', 'participate/deposit-subject-result',
- 'search/data-providers','search/entity-registries', 'project-report',
+ 'search/data-providers','search/data-providers-table','search/entity-registries','search/entity-registries-table','project-report',
'claims','myclaims','participate/claim', 'participate/direct-claim', 'claims-project-manager',
'test', 'user-info',
'**','error'