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
This commit is contained in:
konstantina.galouni 2016-10-14 10:27:19 +00:00
parent 8308223b18
commit f888c6937d
23 changed files with 316 additions and 100 deletions

View File

@ -12,7 +12,7 @@ import {DepositResultComponent} from './depositResult.component';
@NgModule({
imports: [
CommonModule, FormsModule,
UtilsModule
UtilsModule,
],
declarations: [
DepositComponent,

View File

@ -32,9 +32,8 @@
</dd>
</dl>
<tabs [tabs]="dataProviderInfo.tabs"
[publications]="dataProviderInfo.publications"
[datasets]="dataProviderInfo.datasets"
<tabs [id] = "datasourceId"
[tabs]="dataProviderInfo.tabs"
[statistics]="dataProviderInfo.statistics"
[projects]="dataProviderInfo.projects"
[datasources]="dataProviderInfo.datasources">

View File

@ -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: `
<div *ngIf="datasets == undefined" class = "alert alert-info " >
<div *ngIf="searchDatasetsComponent.totalResults == 0" class = "alert alert-info " >
There are no datasets
</div>
<div *ngIf="datasets != undefined">
<div *ngIf="searchDatasetsComponent.totalResults > 0">
<p>
The results below are discovered through our pilot algorithms.
<a href="mailto:">Let us know how we are doing!</a>
</p>
<div class = "text-right" *ngIf = "searchDatasetsComponent.totalResults > 10" ><a [href] = "linkToSearchDatasets" >View all {{searchDatasetsComponent.totalResults}} results</a></div>
<search-result [(results)]="searchDatasetsComponent.results" [(status)]= "searchDatasetsComponent.status"></search-result>
</div>
`
})
export class DatasetsTabComponent {
@Input() datasets;
@Input() searchDatasetsComponent : SearchDatasetsComponent;
private linkToSearchDatasets = "";
constructor () {}
ngOnInit() {}
ngOnInit() {
this.linkToSearchDatasets = OpenaireProperties.getLinkToSearchDatasets();
}
ngOnDestroy() {}
}

View File

@ -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: `
<div *ngIf="publications == undefined" class = "alert alert-info " >
<div *ngIf="searchPublicationsComponent.totalResults == 0" class = "alert alert-info " >
There are no publications
</div>
<div *ngIf="publications != undefined">
<div *ngIf="searchPublicationsComponent.totalResults > 0">
<p>
The results below are discovered through our pilot algorithms.
<a href="mailto:">Let us know how we are doing!</a>
</p>
<div class = "text-right" *ngIf = "searchPublicationsComponent.totalResults > 10" ><a [href] = "linkToSearchPublications" >View all {{searchPublicationsComponent.totalResults}} results</a></div>
<search-result [(results)]="searchPublicationsComponent.results" [(status)]= "searchPublicationsComponent.status"></search-result>
</div>
`
})
export class PublicationsTabComponent {
@Input() publications;
@Input() searchPublicationsComponent : SearchPublicationsComponent;
private linkToSearchPublications = "";
constructor () {}
ngOnInit() {}
ngOnInit() {
this.linkToSearchPublications = OpenaireProperties.getLinkToSearchPublications();
}
ngOnDestroy() {}
}

View File

@ -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';
<li *ngIf="tabs.length>0" class="active">
<a data-toggle="tab" href="#{{tabs[0].content}}">
{{tabs[0].name}}
<span class="badge" *ngIf="tabs[0].content=='publicationsTab'">
{{searchPublicationsComponent.totalResults}}
</span>
<span class="badge" *ngIf="tabs[0].content=='datasetsTab'">
{{searchDatasetsComponent.totalResults}}
</span>
</a>
</li>
<li *ngFor="let tab of tabs; let i=index" role="presentation">
<a *ngIf="i>0" data-toggle="tab" href="#{{tab.content}}">
{{tab.name}}
<span class="badge" *ngIf="tab.content=='publicationsTab'">
{{searchPublicationsComponent.totalResults}}
</span>
<span class="badge" *ngIf="tab.content=='datasetsTab'">
{{searchDatasetsComponent.totalResults}}
</span>
</a>
</li>
</ul>
@ -20,10 +39,10 @@ import {Component, Input} from '@angular/core';
<div class="tab-content">
<div *ngIf="tabs.length>0" id="{{tabs[0].content}}" class="tab-pane fade in active panel-body">
<publicationsTab *ngIf="tabs[0].content=='publicationsTab'"
[publications]="publications">
[searchPublicationsComponent]="searchPublicationsComponent">
</publicationsTab>
<datasetsTab *ngIf="tabs[0].content=='datasetsTab'"
[datasets]="datasets">
[searchDatasetsComponent]="searchDatasetsComponent">
</datasetsTab>
<statisticsTab *ngIf="tabs[0].content=='statisticsTab'"
[statistics]="statistics">
@ -37,7 +56,9 @@ import {Component, Input} from '@angular/core';
</div>
<div *ngFor="let tab of tabs; let i=index" id="{{tab.content}}" class="tab-pane fade panel-body">
<publicationsTab *ngIf="i>0 && tab.content=='publicationsTab'"></publicationsTab>
<publicationsTab *ngIf="i>0 && tab.content=='publicationsTab'"
[searchPublicationsComponent] = "searchPublicationsComponent">
</publicationsTab>
<datasetsTab *ngIf="i>0 && tab.content=='datasetsTab'"></datasetsTab>
<statisticsTab *ngIf="i>0 && tab.content=='statisticsTab'">trgfrg</statisticsTab>
<projectsTab *ngIf="i>0 && tab.content=='projectsTab'"></projectsTab>
@ -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");
}
}

View File

@ -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({

View File

@ -36,9 +36,12 @@
<li role="presentation">
<a data-toggle="tab" href="#dataProvidersTab">
Data Providers
<span *ngIf="organizationInfo.dataProviders == undefined" class="badge">0</span>
<!--span *ngIf="organizationInfo.dataProviders == undefined" class="badge">0</span>
<span *ngIf="organizationInfo.dataProviders != undefined" class="badge">
{{organizationInfo.dataProviders.length}}
</span-->
<span class="badge">
{{searchDataprovidersComponent.totalResults}}
</span>
</a>
</li>
@ -104,7 +107,20 @@
</div>
<div id="dataProvidersTab" class="tab-pane fade panel-body">
<showDataProviders [dataProviders]="organizationInfo.dataProviders"></showDataProviders>
<!--showDataProviders [dataProviders]="organizationInfo.dataProviders"></showDataProviders-->
<div *ngIf="searchDataprovidersComponent.totalResults == 0" class = "alert alert-info " >
There are no dataproviders
</div>
<div *ngIf="searchDataprovidersComponent.totalResults > 0">
<p>
The results below are discovered through our pilot algorithms.
<a href="mailto:">Let us know how we are doing!</a>
</p>
<div class = "text-right" *ngIf = "searchDataprovidersComponent.totalResults > 10" ><a [href] = "linkToSearchDataproviders" >View all {{searchDataprovidersComponent.totalResults}} results</a></div>
<search-result [(results)]="searchDataprovidersComponent.results" [(status)]= "searchDataprovidersComponent.status"></search-result>
</div>
</div>
</div>
</div>

View File

@ -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<string>;
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<string>;
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();
}
}

View File

@ -24,11 +24,17 @@
<li class="active">
<a data-toggle="tab" href="#publicationsTab">
Publications
<span class="badge">
{{searchPublicationsComponent.totalResults}}
</span>
</a>
</li>
<li role="presentation">
<a data-toggle="tab" href="#researchDataTab">
Research Data
<span class="badge">
{{searchDatasetsComponent.totalResults}}
</span>
</a>
</li>
</ul>
@ -36,27 +42,34 @@
<div class="tab-content">
<div id="publicationsTab" class="tab-pane fade in active panel-body">
<div *ngIf="personInfo.publications == undefined" class = "alert alert-info " >
<div *ngIf="searchPublicationsComponent.totalResults == 0" class = "alert alert-info " >
There are no publications
</div>
<div *ngIf="personInfo.publications != undefined">
<div *ngIf="searchPublicationsComponent.totalResults > 0">
<p>
The results below are discovered through our pilot algorithms.
<a href="mailto:">Let us know how we are doing!</a>
</p>
<div class = "text-right" *ngIf = "searchPublicationsComponent.totalResults > 10" ><a [href] = "linkToSearchPublications" >View all {{searchPublicationsComponent.totalResults}} results</a></div>
<search-result [(results)]="searchPublicationsComponent.results" [(status)]= "searchPublicationsComponent.status"></search-result>
</div>
</div>
<div id="researchDataTab" class="tab-pane fade panel-body">
<div *ngIf="personInfo.researchData == undefined" class = "alert alert-info ">
<div *ngIf="searchDatasetsComponent.totalResults == 0" class = "alert alert-info " >
There are no research data
</div>
<div *ngIf="personInfo.researchData != undefined">
<div *ngIf="searchDatasetsComponent.totalResults > 0">
<p>
The results below are discovered through our pilot algorithms.
<a href="mailto:">Let us know how we are doing!</a>
</p>
<div class = "text-right" *ngIf = "searchDatasetsComponent.totalResults > 10" ><a [href] = "linkToSearchDatasets" >View all {{searchDatasetsComponent.totalResults}} results</a></div>
<search-result [(results)]="searchDatasetsComponent.results" [(status)]= "searchDatasetsComponent.status"></search-result>
</div>
</div>
</div>

View File

@ -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();
}
}

View File

@ -66,6 +66,9 @@
<li>
<a data-toggle="tab" href="#researchDataTab">
Research Data
<span class="badge">
{{searchDatasetsComponent.totalResults}}
</span>
</a>
</li>
<li>
@ -94,14 +97,18 @@
</div>
<div id="researchDataTab" class="tab-pane fade panel-body">
<div *ngIf="projectInfo.researchData == undefined" class = "alert alert-info ">
<div *ngIf="searchDatasetsComponent.totalResults == 0" class = "alert alert-info " >
There are no research data
</div>
<div *ngIf="projectInfo.researchData != undefined">
<div *ngIf="searchDatasetsComponent.totalResults > 0">
<p>
The results below are discovered through our pilot algorithms.
<a href="mailto:">Let us know how we are doing!</a>
</p>
<div class = "text-right" *ngIf = "searchDatasetsComponent.totalResults > 10" ><a [href] = "linkToSearchDatasets" >View all {{searchDatasetsComponent.totalResults}} results</a></div>
<search-result [(results)]="searchDatasetsComponent.results" [(status)]= "searchDatasetsComponent.status"></search-result>
</div>
</div>

View File

@ -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 = '';

View File

@ -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"];

View File

@ -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() {

View File

@ -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[] {

View File

@ -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");
}
}

View File

@ -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)

View File

@ -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<length; i++) {
let resData = length > 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<relLength; j++) {
let relation = relLength > 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<fundingLength; z++) {
let fundingData = fundingLength > 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;

View File

@ -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 {

View File

@ -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)

View File

@ -41,7 +41,7 @@ export class DataProviderInfo {
};
organizations: {"name": string, "url": string}[];
publications: any;
//publications: any;
datasets: any;
statistics: any;
projects: any;

View File

@ -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}[]}[];
}

View File

@ -13,7 +13,7 @@ export class ProjectInfo {
url: string;
urlInfo: string;
publications: any;
//publications: any;
researchData: any;
statistics: any;