From f888c6937d733c03993d2f14901dd6ddb63e5012 Mon Sep 17 00:00:00 2001 From: "konstantina.galouni" Date: Fri, 14 Oct 2016 10:27:19 +0000 Subject: [PATCH] Publications' tab in dataprovider's and person's landing pages completed | Datasets' tab in project's, dataprovider's and person's landing pages completed | Dataproviders' tab in organization's landing page completed | (view all links should be fixed) git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-services-portal/trunk@44072 d315682c-612b-4755-9ff5-7f18f6832af3 --- portal-2/src/app/deposit/deposit.module.ts | 2 +- .../dataProvider/dataProvider.component.html | 5 +- .../dataProvider/datasetsTab.component.ts | 19 ++++- .../dataProvider/publicationsTab.component.ts | 19 ++++- .../dataProvider/tabs.component.ts | 69 ++++++++++++++-- .../src/app/landingPages/landing.module.ts | 2 - .../organization/organization.component.html | 20 ++++- .../organization/organization.component.ts | 47 ++++++++--- .../landingPages/person/person.component.html | 21 ++++- .../landingPages/person/person.component.ts | 79 +++++++++++++++---- .../project/project.component.html | 11 ++- .../landingPages/project/project.component.ts | 22 +++++- .../compatibleDataProviders.component.ts | 8 +- .../app/searchPages/find/search.component.ts | 4 +- .../searchDataproviders.component.ts | 10 +-- .../searchPages/searchDatasets.component.ts | 8 +- .../services/searchDataproviders.service.ts | 20 +++-- .../app/services/searchDatasets.service.ts | 32 +++++--- .../services/searchOrganizations.service.ts | 6 +- .../services/searchPublications.service.ts | 4 + .../app/utils/entities/dataProviderInfo.ts | 2 +- .../app/utils/entities/organizationInfo.ts | 4 +- .../src/app/utils/entities/projectInfo.ts | 2 +- 23 files changed, 316 insertions(+), 100 deletions(-) diff --git a/portal-2/src/app/deposit/deposit.module.ts b/portal-2/src/app/deposit/deposit.module.ts index 9b27db50..27127f30 100644 --- a/portal-2/src/app/deposit/deposit.module.ts +++ b/portal-2/src/app/deposit/deposit.module.ts @@ -12,7 +12,7 @@ import {DepositResultComponent} from './depositResult.component'; @NgModule({ imports: [ CommonModule, FormsModule, - UtilsModule + UtilsModule, ], declarations: [ DepositComponent, diff --git a/portal-2/src/app/landingPages/dataProvider/dataProvider.component.html b/portal-2/src/app/landingPages/dataProvider/dataProvider.component.html index 9e3d8614..300f6fa1 100644 --- a/portal-2/src/app/landingPages/dataProvider/dataProvider.component.html +++ b/portal-2/src/app/landingPages/dataProvider/dataProvider.component.html @@ -32,9 +32,8 @@ - diff --git a/portal-2/src/app/landingPages/dataProvider/datasetsTab.component.ts b/portal-2/src/app/landingPages/dataProvider/datasetsTab.component.ts index f62ebf95..f6f7c4f7 100644 --- a/portal-2/src/app/landingPages/dataProvider/datasetsTab.component.ts +++ b/portal-2/src/app/landingPages/dataProvider/datasetsTab.component.ts @@ -1,28 +1,39 @@ import {Component, Input} from '@angular/core'; +import { SearchDatasetsComponent } from '../../searchPages/searchDatasets.component'; +import {SearchResultComponent} from '../../searchPages/searchUtils/searchResult.component'; + +import {OpenaireProperties} from '../../utils/properties/openaireProperties'; + @Component({ selector: 'datasetsTab', template: ` -
+
There are no datasets
-
+

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

+ + +
` }) export class DatasetsTabComponent { - @Input() datasets; + @Input() searchDatasetsComponent : SearchDatasetsComponent; + private linkToSearchDatasets = ""; constructor () {} - ngOnInit() {} + ngOnInit() { + this.linkToSearchDatasets = OpenaireProperties.getLinkToSearchDatasets(); + } ngOnDestroy() {} } diff --git a/portal-2/src/app/landingPages/dataProvider/publicationsTab.component.ts b/portal-2/src/app/landingPages/dataProvider/publicationsTab.component.ts index f1398892..2ae78544 100644 --- a/portal-2/src/app/landingPages/dataProvider/publicationsTab.component.ts +++ b/portal-2/src/app/landingPages/dataProvider/publicationsTab.component.ts @@ -1,28 +1,39 @@ import {Component, Input} from '@angular/core'; +import { SearchPublicationsComponent } from '../../searchPages/searchPublications.component'; +import {SearchResultComponent} from '../../searchPages/searchUtils/searchResult.component'; + +import {OpenaireProperties} from '../../utils/properties/openaireProperties'; + @Component({ selector: 'publicationsTab', template: ` -
+
There are no publications
-
+

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

+ + +
` }) export class PublicationsTabComponent { - @Input() publications; + @Input() searchPublicationsComponent : SearchPublicationsComponent; + private linkToSearchPublications = ""; constructor () {} - ngOnInit() {} + ngOnInit() { + this.linkToSearchPublications = OpenaireProperties.getLinkToSearchPublications(); + } ngOnDestroy() {} } diff --git a/portal-2/src/app/landingPages/dataProvider/tabs.component.ts b/portal-2/src/app/landingPages/dataProvider/tabs.component.ts index b63c5404..f5786bdc 100644 --- a/portal-2/src/app/landingPages/dataProvider/tabs.component.ts +++ b/portal-2/src/app/landingPages/dataProvider/tabs.component.ts @@ -1,4 +1,11 @@ import {Component, Input} from '@angular/core'; +import {ActivatedRoute, Params} from '@angular/router'; + +import { SearchPublicationsComponent } from '../../searchPages/searchPublications.component'; +import { SearchPublicationsService } from '../../services/searchPublications.service'; +import { SearchDatasetsComponent } from '../../searchPages/searchDatasets.component'; +import { SearchDatasetsService } from '../../services/searchDatasets.service'; +import {RefineResultsService} from '../../services/servicesUtils/refineResuts.service'; @Component({ selector: 'tabs', @@ -7,12 +14,24 @@ import {Component, Input} from '@angular/core';
  • {{tabs[0].name}} + + {{searchPublicationsComponent.totalResults}} + + + {{searchDatasetsComponent.totalResults}} +
  • {{tab.name}} + + {{searchPublicationsComponent.totalResults}} + + + {{searchDatasetsComponent.totalResults}} +
  • @@ -20,10 +39,10 @@ import {Component, Input} from '@angular/core';
    + [searchPublicationsComponent]="searchPublicationsComponent"> + [searchDatasetsComponent]="searchDatasetsComponent"> @@ -37,7 +56,9 @@ import {Component, Input} from '@angular/core';
    - + + trgfrg @@ -49,16 +70,48 @@ import {Component, Input} from '@angular/core'; export class TabsComponent { + @Input() id: string; @Input() tabs: {"name": string, "content": string}[]; - @Input() publications; - @Input() datasets; + //@Input() publications; + //@Input() datasets; @Input() statistics; @Input() projects; @Input() datasources; - constructor () {} + subPublications: any; + subDatasets: any; - ngOnInit() {} + private searchPublicationsComponent : SearchPublicationsComponent; + private searchDatasetsComponent: SearchDatasetsComponent; - ngOnDestroy() {} + constructor (private route: ActivatedRoute, + private _searchPublicationsService: SearchPublicationsService, + private _searchDatasetsService: SearchDatasetsService, + private _refineResultsService:RefineResultsService) { + this.searchPublicationsComponent = new SearchPublicationsComponent(this.route, this._searchPublicationsService); + this.searchDatasetsComponent = new SearchDatasetsComponent(this.route, this._searchDatasetsService, this._refineResultsService); + } + + ngOnInit() { + this.subPublications = this.route.queryParams.subscribe(params => { + this.searchPublications(); + }); + + this.subDatasets = this.route.queryParams.subscribe(params => { + this.searchDatasets(); + }); + } + + ngOnDestroy() { + this.subPublications.unsubscribe(); + this.subDatasets.unsubscribe(); + } + + private searchPublications() { + this.searchPublicationsComponent.getResults(this.id, 1, 10, "dataproviderPage"); + } + + private searchDatasets() { + this.searchDatasetsComponent.getResults(this.id, 1, 10, "dataproviderPage"); + } } diff --git a/portal-2/src/app/landingPages/landing.module.ts b/portal-2/src/app/landingPages/landing.module.ts index a516c2f3..a0edfae3 100644 --- a/portal-2/src/app/landingPages/landing.module.ts +++ b/portal-2/src/app/landingPages/landing.module.ts @@ -25,12 +25,10 @@ import {TabsComponent} from './dataProvider/tabs.component'; import {DataProviderComponent} from './dataProvider/dataProvider.component'; - import { PersonComponent } from './person/person.component'; import { ProjectComponent } from './project/project.component'; import { OrganizationComponent } from './organization/organization.component'; import { DatasetComponent } from './dataset/dataset.component'; - import { PublicationComponent } from './publication/publication.component'; @NgModule({ diff --git a/portal-2/src/app/landingPages/organization/organization.component.html b/portal-2/src/app/landingPages/organization/organization.component.html index 3d0c12b0..69450e00 100644 --- a/portal-2/src/app/landingPages/organization/organization.component.html +++ b/portal-2/src/app/landingPages/organization/organization.component.html @@ -36,9 +36,12 @@
  • Data Providers - 0 + + + {{searchDataprovidersComponent.totalResults}}
  • @@ -104,7 +107,20 @@
    - + +
    + There are no dataproviders +
    + +
    +

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

    + + + +
    diff --git a/portal-2/src/app/landingPages/organization/organization.component.ts b/portal-2/src/app/landingPages/organization/organization.component.ts index 457f8997..5f4013df 100644 --- a/portal-2/src/app/landingPages/organization/organization.component.ts +++ b/portal-2/src/app/landingPages/organization/organization.component.ts @@ -4,15 +4,39 @@ import {ActivatedRoute} from '@angular/router'; import {OrganizationService} from '../../services/organization.service'; import {OrganizationInfo} from '../../utils/entities/organizationInfo'; +import { SearchDataprovidersComponent } from '../../searchPages/searchDataproviders.component'; +import { SearchDataprovidersService } from '../../services/searchDataproviders.service'; +import {SearchResultComponent} from '../../searchPages/searchUtils/searchResult.component'; + +import {OpenaireProperties} from '../../utils/properties/openaireProperties'; + @Component({ selector: 'organization', templateUrl: 'organization.component.html', }) export class OrganizationComponent { + + organizationInfo: OrganizationInfo; + private organizationId: string; + private projectsNum : number = 0; + private fundersSet: Set; + private emptyFundersSet: boolean = true; + public warningMessage = ""; + public errorMessage = ""; + private data : any = { "export":[] }; + + sub: any; + subDataproviders: any; + + private searchDataprovidersComponent : SearchDataprovidersComponent; + private linkToSearchDataproviders = ""; + constructor (private _organizationService: OrganizationService, - private route: ActivatedRoute) { + private route: ActivatedRoute, + private _searchDataprovidersService: SearchDataprovidersService) { console.info('organization constructor'); + this.searchDataprovidersComponent = new SearchDataprovidersComponent(this.route, this._searchDataprovidersService); } ngOnInit() { @@ -26,22 +50,17 @@ export class OrganizationComponent { this.warningMessage="No valid project id"; } }); - } - organizationInfo: OrganizationInfo; - private organizationId: string; - private projectsNum : number = 0; - private fundersSet: Set; - private emptyFundersSet: boolean = true; - public warningMessage = ""; - public errorMessage = ""; - private data : any = { "export":[] }; + this.subDataproviders = this.route.queryParams.subscribe(params => { + this.searchDataproviders(); + }); + } ngOnDestroy() { this.sub.unsubscribe(); + this.subDataproviders.unsubscribe(); } - sub: any; private getOrganizationInfo () { console.info("inside getProjectInfo of component"); @@ -114,4 +133,10 @@ export class OrganizationComponent { quote(word: string): string { return '"'+word+'"'; } + + + private searchDataproviders() { + this.searchDataprovidersComponent.getResults(this.organizationId, 1, 10, "organizationPage"); + this.linkToSearchDataproviders = OpenaireProperties.getLinkToSearchDataProviders(); + } } diff --git a/portal-2/src/app/landingPages/person/person.component.html b/portal-2/src/app/landingPages/person/person.component.html index 3eb37cee..20077deb 100644 --- a/portal-2/src/app/landingPages/person/person.component.html +++ b/portal-2/src/app/landingPages/person/person.component.html @@ -24,11 +24,17 @@
  • Publications + + {{searchPublicationsComponent.totalResults}} +
  • Research Data + + {{searchDatasetsComponent.totalResults}} +
  • @@ -36,27 +42,34 @@
    -
    +
    There are no publications
    -
    +

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

    + + +
    -
    +
    There are no research data
    -
    + +

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

    + + +
    diff --git a/portal-2/src/app/landingPages/person/person.component.ts b/portal-2/src/app/landingPages/person/person.component.ts index f3077308..15f91380 100644 --- a/portal-2/src/app/landingPages/person/person.component.ts +++ b/portal-2/src/app/landingPages/person/person.component.ts @@ -3,15 +3,45 @@ import {Observable} from 'rxjs/Observable'; import { ActivatedRoute } from '@angular/router'; import {PersonService} from '../../services/person.service'; import { PersonInfo } from '../../utils/entities/personInfo'; + +import { SearchPublicationsComponent } from '../../searchPages/searchPublications.component'; +import { SearchPublicationsService } from '../../services/searchPublications.service'; +import { SearchDatasetsComponent } from '../../searchPages/searchDatasets.component'; +import { SearchDatasetsService } from '../../services/searchDatasets.service'; +import {RefineResultsService} from '../../services/servicesUtils/refineResuts.service'; +import { SearchResultComponent } from '../../searchPages/searchUtils/searchResult.component'; + +import {OpenaireProperties} from '../../utils/properties/openaireProperties'; + @Component({ selector: 'person', templateUrl: 'person.component.html', }) export class PersonComponent { + + sub: any; + subPublications: any; + subDatasets: any; + + private searchPublicationsComponent : SearchPublicationsComponent; + private linkToSearchPublications = ""; + private searchDatasetsComponent : SearchDatasetsComponent; + private linkToSearchDatasets = ""; + + personInfo: PersonInfo; + private personId: string; + public warningMessage = ""; + public errorMessage = ""; + constructor (private _personService: PersonService, - private route: ActivatedRoute) { + private route: ActivatedRoute, + private _searchPublicationsService: SearchPublicationsService, + private _searchDatasetsService: SearchDatasetsService, + private _refineResultsService:RefineResultsService) { console.info('person constructor'); + this.searchPublicationsComponent = new SearchPublicationsComponent(this.route, this._searchPublicationsService); + this.searchDatasetsComponent = new SearchDatasetsComponent(this.route, this._searchDatasetsService, this._refineResultsService); } ngOnInit() { @@ -26,16 +56,22 @@ export class PersonComponent { } }); + + this.subPublications = this.route.queryParams.subscribe(params => { + this.searchPublications(); + }); + + this.subDatasets = this.route.queryParams.subscribe(params => { + this.searchDatasets(); + }); } - personInfo: PersonInfo; - private personId: string; - public warningMessage = ""; - public errorMessage = ""; ngOnDestroy() { this.sub.unsubscribe(); + this.subPublications.unsubscribe(); + this.subDatasets.unsubscribe(); } - sub: any; + private getPersonInfo () { console.info("inside getProjectInfo of component"); @@ -44,17 +80,26 @@ export class PersonComponent { this.errorMessage="" console.info("do request"); - this._personService.getPersonInfo(this.personId).subscribe( - data => { - this.personInfo = data; - }, - err => { - console.error(err) - console.info("error"); + this._personService.getPersonInfo(this.personId).subscribe( + data => { + this.personInfo = data; + }, + err => { + console.error(err) + console.info("error"); - this.errorMessage = 'No person found'; - } - ); - } + this.errorMessage = 'No person found'; + } + ); + } + private searchPublications() { + this.searchPublicationsComponent.getResults(this.personId, 1, 10, "personPage"); + this.linkToSearchPublications = OpenaireProperties.getLinkToSearchPublications(); + } + + private searchDatasets() { + this.searchDatasetsComponent.getResults(this.personId, 1, 10, "personPage"); + this.linkToSearchDatasets = OpenaireProperties.getLinkToSearchDatasets(); + } } diff --git a/portal-2/src/app/landingPages/project/project.component.html b/portal-2/src/app/landingPages/project/project.component.html index 48dbe6e0..e93edf45 100644 --- a/portal-2/src/app/landingPages/project/project.component.html +++ b/portal-2/src/app/landingPages/project/project.component.html @@ -66,6 +66,9 @@
  • Research Data + + {{searchDatasetsComponent.totalResults}} +
  • @@ -94,14 +97,18 @@
  • -
    +
    There are no research data
    -
    + +

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

    + + +
    diff --git a/portal-2/src/app/landingPages/project/project.component.ts b/portal-2/src/app/landingPages/project/project.component.ts index 7a5983d9..541fcbd9 100644 --- a/portal-2/src/app/landingPages/project/project.component.ts +++ b/portal-2/src/app/landingPages/project/project.component.ts @@ -7,8 +7,9 @@ import {InlineClaimResultComponent} from '../../claimPages/inlineClaims/inlineCl import { SearchPublicationsComponent } from '../../searchPages/searchPublications.component'; import {SearchPublicationsService} from '../../services/searchPublications.service'; -//import { SearchDatasetsComponent } from '../../searchPages/searchDatasets.component'; -//import {SearchDatasetsService} from '../../services/searchDatasets.service'; +import { SearchDatasetsComponent } from '../../searchPages/searchDatasets.component'; +import { SearchDatasetsService } from '../../services/searchDatasets.service'; +import {RefineResultsService} from '../../services/servicesUtils/refineResuts.service'; import {SearchResultComponent} from '../../searchPages/searchUtils/searchResult.component'; import {OpenaireProperties} from '../../utils/properties/openaireProperties'; @@ -33,13 +34,18 @@ export class ProjectComponent implements OnInit{ sub: any; subPublications: any; + subDatasets: any; private searchPublicationsComponent : SearchPublicationsComponent; private linkToSearchPublications = ""; + private searchDatasetsComponent : SearchDatasetsComponent; + private linkToSearchDatasets = ""; constructor (private _projectService: ProjectService, + private route: ActivatedRoute, private _searchPublicationsService: SearchPublicationsService, - private route: ActivatedRoute) { + private _searchDatasetsService: SearchDatasetsService, + private _refineResultsService:RefineResultsService) { console.info('project constructor'); // this.projectId = 'corda_______::2c37878a0cede85dbbd1081bb9b4a2f8'; // console.info("1 Id is :"+this.projectId); @@ -50,6 +56,7 @@ export class ProjectComponent implements OnInit{ // } this.searchPublicationsComponent = new SearchPublicationsComponent(this.route, this._searchPublicationsService); + this.searchDatasetsComponent = new SearchDatasetsComponent(this.route, this._searchDatasetsService, this._refineResultsService); } ngOnInit() { @@ -94,12 +101,16 @@ export class ProjectComponent implements OnInit{ this.searchPublications(); }); + this.subDatasets = this.route.queryParams.subscribe(params => { + this.searchDatasets(); + }); } ngOnDestroy() { this.sub.unsubscribe(); this.subPublications.unsubscribe(); + this.subDatasets.unsubscribe(); } private searchPublications() { @@ -107,6 +118,11 @@ export class ProjectComponent implements OnInit{ this.linkToSearchPublications = OpenaireProperties.getLinkToSearchPublications(); } + private searchDatasets() { + this.searchDatasetsComponent.getResults(this.projectId, 1, 10, "projectPage"); + this.linkToSearchDatasets = OpenaireProperties.getLinkToSearchDatasets(); + } + getProjectInfo (id:string) { console.info("inside getProjectInfo of component"); this.warningMessage = ''; diff --git a/portal-2/src/app/searchPages/dataProviders/compatibleDataProviders.component.ts b/portal-2/src/app/searchPages/dataProviders/compatibleDataProviders.component.ts index 941d804d..9fd24326 100644 --- a/portal-2/src/app/searchPages/dataProviders/compatibleDataProviders.component.ts +++ b/portal-2/src/app/searchPages/dataProviders/compatibleDataProviders.component.ts @@ -57,7 +57,7 @@ export class SearchCompatibleDataprovidersComponent { } } } - this.getResults(this.keyword, this.page, this.size); + this.getResults(this.keyword, this.page, this.size, "searchPage"); }); } @@ -65,11 +65,11 @@ export class SearchCompatibleDataprovidersComponent { this.sub.unsubscribe(); } - public getResults(parameters:string, page: number, size: number){ + public getResults(parameters:string, page: number, size: number, flag: string){ console.info("getResults: Execute search query "+parameters); //q=(not datasourcecompatibilityid exact 'UNKNOWN' )and (not datasourcecompatibilityid exact 'hostedBy' ) and (not datasourcecompatibilityid exact 'notCompatible' ) // (datasourcecompatibilityid <> "UNKNOWN") and (datasourcecompatibilityid <> "hostedBy") and (datasourcecompatibilityid <> "notCompatible") - this._searchDataprovidersService.searchDataproviders(parameters, page, size).subscribe( + this._searchDataprovidersService.searchDataproviders(parameters, page, size, flag).subscribe( data => { this.totalResults = data[0]; console.info("searchPubl total="+this.totalResults); @@ -98,7 +98,7 @@ export class SearchCompatibleDataprovidersComponent { private queryChanged($event) { var parameters = $event.value; console.info("queryChanged: Execute search query "+parameters); - this.getResults(parameters, this.page, this.size); + this.getResults(parameters, this.page, this.size, "searchPage"); } private createFilters():Filter[] { var filter_names=["Type","Compatibility Level"]; diff --git a/portal-2/src/app/searchPages/find/search.component.ts b/portal-2/src/app/searchPages/find/search.component.ts index f20cc058..a85cf8ea 100644 --- a/portal-2/src/app/searchPages/find/search.component.ts +++ b/portal-2/src/app/searchPages/find/search.component.ts @@ -160,7 +160,7 @@ export class SearchComponent { } private searchDatasets() { this.activeTab = "datasets"; - this.searchDatasetsComponent.getResults(this.keyword, 1, 10); + this.searchDatasetsComponent.getResults(this.keyword, 1, 10, "searchPage"); this.linkToSearchDatasets = OpenaireProperties.getLinkToSearchDatasets() + this.keyword; } private searchProjects() { @@ -170,7 +170,7 @@ export class SearchComponent { } private searchDataProviders() { this.activeTab = "datproviders"; - this.searchDataProvidersComponent.getResults(this.keyword, 1, 10); + this.searchDataProvidersComponent.getResults(this.keyword, 1, 10, "searchPage"); this.linkToSearchDataproviders = OpenaireProperties.getLinkToSearchDataProviders() + this.keyword; } private searchOrganizations() { diff --git a/portal-2/src/app/searchPages/searchDataproviders.component.ts b/portal-2/src/app/searchPages/searchDataproviders.component.ts index dd3846dc..63f95232 100644 --- a/portal-2/src/app/searchPages/searchDataproviders.component.ts +++ b/portal-2/src/app/searchPages/searchDataproviders.component.ts @@ -43,9 +43,9 @@ export class SearchDataprovidersComponent { this.sub = this.route.queryParams.subscribe(params => { this.keyword = (params['keyword']?params['keyword']:''); this.page = (params['page']=== undefined)?1:+params['page']; - + this.filters = this.createFilters(); - this.getResults(this.keyword, this.page, this.size); + this.getResults(this.keyword, this.page, this.size, "searchPage"); }); } @@ -53,10 +53,10 @@ export class SearchDataprovidersComponent { this.sub.unsubscribe(); } - public getResults(parameters:string, page: number, size: number){ + public getResults(parameters:string, page: number, size: number, flag: string){ console.info("getResults: Execute search query "+parameters); - this._searchDataprovidersService.searchDataproviders(parameters, page, size).subscribe( + this._searchDataprovidersService.searchDataproviders(parameters, page, size, flag).subscribe( data => { this.totalResults = data[0]; console.info("searchPubl total="+this.totalResults); @@ -87,7 +87,7 @@ export class SearchDataprovidersComponent { private queryChanged($event) { var parameters = $event.value; console.info("queryChanged: Execute search query "+parameters); - this.getResults(parameters, this.page, this.size); + this.getResults(parameters, this.page, this.size, "searchPage"); } private createFilters():Filter[] { diff --git a/portal-2/src/app/searchPages/searchDatasets.component.ts b/portal-2/src/app/searchPages/searchDatasets.component.ts index 0e288192..f627cd44 100644 --- a/portal-2/src/app/searchPages/searchDatasets.component.ts +++ b/portal-2/src/app/searchPages/searchDatasets.component.ts @@ -46,7 +46,7 @@ export class SearchDatasetsComponent { this.keyword = (params['keyword']?params['keyword']:''); this.page = (params['page']=== undefined)?1:+params['page']; this.getRefineResults(); - this.getResults(this.keyword, this.page, this.size); + this.getResults(this.keyword, this.page, this.size, "searchPage"); @@ -78,10 +78,10 @@ export class SearchDatasetsComponent { } ); } - public getResults(parameters:string, page: number, size: number){ + public getResults(parameters:string, page: number, size: number, flag: string){ console.info("getResults: Execute search query "+parameters); - this._searchDatasetsService.searchDatasets(parameters, page, size).subscribe( + this._searchDatasetsService.searchDatasets(parameters, page, size, flag).subscribe( data => { this.totalResults = data[0]; console.info("searchDataset total="+this.totalResults); @@ -112,6 +112,6 @@ export class SearchDatasetsComponent { private queryChanged($event) { var parameters = $event.value; console.info("queryChanged: Execute search query "+parameters); - this.getResults(parameters, this.page, this.size); + this.getResults(parameters, this.page, this.size, "searchPage"); } } diff --git a/portal-2/src/app/services/searchDataproviders.service.ts b/portal-2/src/app/services/searchDataproviders.service.ts index f7d8a19d..bfb0d8cc 100644 --- a/portal-2/src/app/services/searchDataproviders.service.ts +++ b/portal-2/src/app/services/searchDataproviders.service.ts @@ -8,17 +8,23 @@ import {SearchResult} from '../utils/entities/searchResult'; export class SearchDataprovidersService { constructor(private http: Http) {} - searchDataproviders (params: string, page: number, size: number):any { + searchDataproviders (params: string, page: number, size: number, flag: string):any { console.info("In searchDataproviders"); - let link = OpenaireProperties.getSearchAPIURL()+"datasources"; + let link, url; - let url = link+"?"; - if(params != '') { - url += "q="+params+"&page="+page+"&size="+size; - } else { - url += "page="+page+"&size="+size; + if(flag == "searchPage") { + link = OpenaireProperties.getSearchAPIURL()+"datasources"; + + url = link+"?"; + if(params != '') { + url += "q="+params+"&page="+page+"&size="+size; + } else { + url += "page="+page+"&size="+size; + } + } else if(flag == 'organizationPage') { + url = OpenaireProperties.getSearchAPIURL() + 'organizations/'+params+"/datasources"; } return this.http.get(url) diff --git a/portal-2/src/app/services/searchDatasets.service.ts b/portal-2/src/app/services/searchDatasets.service.ts index 947a2cf8..ead8ae37 100644 --- a/portal-2/src/app/services/searchDatasets.service.ts +++ b/portal-2/src/app/services/searchDatasets.service.ts @@ -10,17 +10,27 @@ export class SearchDatasetsService { constructor(private http: Http) {} - searchDatasets (params: string, page: number, size: number):any { + searchDatasets (params: string, page: number, size: number, flag: string):any { console.info("In searchDatasets"); - let link = OpenaireProperties.getSearchAPIURL()+"datasets"; + let link, url; - let url = link+"?"; - if(params != '') { - url += "q="+params+"&page="+page+"&size="+size; - } else { - url += "page="+page+"&size="+size; + if(flag == 'searchPage') { + link = OpenaireProperties.getSearchAPIURL()+"datasets"; + + url = link+"?"; + if(params != '') { + url += "q="+params+"&page="+page+"&size="+size; + } else { + url += "page="+page+"&size="+size; + } + } else if(flag == 'personPage') { + url = OpenaireProperties.getSearchAPIURL() + 'people/'+params+"/datasets"; + } else if(flag == 'projectPage') { + url = OpenaireProperties.getSearchAPIURL() + 'projects/'+params+"/datasets"; + } else if(flag == 'dataproviderPage') { + url = OpenaireProperties.getSearchAPIURL() + 'datasources/'+params+"/datasets"; } return this.http.get(url) @@ -38,7 +48,7 @@ export class SearchDatasetsService { let length = Array.isArray(data) ? data.length : 1; for(let i=0; i 1 ? data[i]['result']['metadata']['oaf:entity']['oaf:result'] : data['result']['metadata']['oaf:entity']['oaf:result']; + let resData = Array.isArray(data) ? data[i]['result']['metadata']['oaf:entity']['oaf:result'] : data['result']['metadata']['oaf:entity']['oaf:result']; var result: SearchResult = new SearchResult(); @@ -51,7 +61,7 @@ export class SearchDatasetsService { } result['title'].url = OpenaireProperties.getsearchLinkToDataset(); - result['title'].url += length > 1 ? data[i]['result']['header']['dri:objIdentifier'] : data['result']['header']['dri:objIdentifier']; + result['title'].url += Array.isArray(data) ? data[i]['result']['header']['dri:objIdentifier'] : data['result']['header']['dri:objIdentifier']; if(resData['bestlicense'].hasOwnProperty("classid")) { result['title'].accessMode = resData['bestlicense'].classid; } @@ -60,7 +70,7 @@ export class SearchDatasetsService { let relLength = Array.isArray(resData['rels']['rel']) ? resData['rels']['rel'].length : 1; for(let j=0; j 1 ? resData['rels']['rel'][j] : resData['rels']['rel']; + let relation = Array.isArray(resData['rels']['rel']) ? resData['rels']['rel'][j] : resData['rels']['rel']; if(relation.hasOwnProperty("to")) { if(relation['to'].class == "hasAuthor") { @@ -96,7 +106,7 @@ export class SearchDatasetsService { let fundingLength = Array.isArray(relation['funding']) ? relation['funding'].length : 1; for(let z=0; z 1 ? relation['funding'][z] : relation['funding']; + let fundingData = Array.isArray(relation['funding']) ? relation['funding'][z] : relation['funding']; if(fundingData.hasOwnProperty("funder")) { result['projects'][countProjects]['funderShortname'] = fundingData['funder'].shortname; diff --git a/portal-2/src/app/services/searchOrganizations.service.ts b/portal-2/src/app/services/searchOrganizations.service.ts index 0467c11e..9ee3d6ba 100644 --- a/portal-2/src/app/services/searchOrganizations.service.ts +++ b/portal-2/src/app/services/searchOrganizations.service.ts @@ -13,9 +13,11 @@ export class SearchOrganizationsService { console.info("In searchOrganizations"); - let link = OpenaireProperties.getSearchAPIURL()+"organizations"; + let link, url; - let url = link+"?"; + link = OpenaireProperties.getSearchAPIURL()+"organizations"; + + url = link+"?"; if(params != '') { url += "q="+params+"&page="+page+"&size="+size; } else { diff --git a/portal-2/src/app/services/searchPublications.service.ts b/portal-2/src/app/services/searchPublications.service.ts index 963e7595..8f5aec73 100644 --- a/portal-2/src/app/services/searchPublications.service.ts +++ b/portal-2/src/app/services/searchPublications.service.ts @@ -27,6 +27,10 @@ export class SearchPublicationsService { } } else if(flag == 'projectPage') { url = OpenaireProperties.getSearchAPIURL() + 'projects/'+params+"/publications"; + } else if(flag == 'dataproviderPage') { + url = OpenaireProperties.getSearchAPIURL() + 'datasources/'+params+"/publications"; + } else if(flag == 'personPage') { + url = OpenaireProperties.getSearchAPIURL() + 'people/'+params+"/publications"; } return this.http.get(url) diff --git a/portal-2/src/app/utils/entities/dataProviderInfo.ts b/portal-2/src/app/utils/entities/dataProviderInfo.ts index 6228fe5c..336ba831 100644 --- a/portal-2/src/app/utils/entities/dataProviderInfo.ts +++ b/portal-2/src/app/utils/entities/dataProviderInfo.ts @@ -41,7 +41,7 @@ export class DataProviderInfo { }; organizations: {"name": string, "url": string}[]; - publications: any; + //publications: any; datasets: any; statistics: any; projects: any; diff --git a/portal-2/src/app/utils/entities/organizationInfo.ts b/portal-2/src/app/utils/entities/organizationInfo.ts index 90731cea..db6a9509 100644 --- a/portal-2/src/app/utils/entities/organizationInfo.ts +++ b/portal-2/src/app/utils/entities/organizationInfo.ts @@ -7,6 +7,6 @@ export class OrganizationInfo { "acronym": string, "funder": string, "fundingStream": string, "fundingLevel1": string, "fundingLevel2": string, "sc39": string, "startDate": string, "endDate": string }[]>; - dataProviders: { "name": string, "url": string, "type": string, "websiteUrl": string, - "organizations": {"name": string, "url": string}[]}[]; + //dataProviders: { "name": string, "url": string, "type": string, "websiteUrl": string, + // "organizations": {"name": string, "url": string}[]}[]; } diff --git a/portal-2/src/app/utils/entities/projectInfo.ts b/portal-2/src/app/utils/entities/projectInfo.ts index 82395e9b..c87cc4e4 100644 --- a/portal-2/src/app/utils/entities/projectInfo.ts +++ b/portal-2/src/app/utils/entities/projectInfo.ts @@ -13,7 +13,7 @@ export class ProjectInfo { url: string; urlInfo: string; - publications: any; + //publications: any; researchData: any; statistics: any;