Search People completed | Publications' tab in project's landing page completed (view all link should be fixed)
git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-services-portal/trunk@44035 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
parent
1f3e97cb96
commit
14af748130
|
@ -18,6 +18,7 @@ import { SearchDataprovidersComponent } from './searchPages/searchDataproviders.
|
|||
import { SearchProjectsComponent } from './searchPages/searchProjects.component';
|
||||
import { SearchDatasetsComponent } from './searchPages/searchDatasets.component';
|
||||
import { SearchOrganizationsComponent } from './searchPages/searchOrganizations.component';
|
||||
import { SearchPeopleComponent } from './searchPages/searchPeople.component';
|
||||
import { AdvancedSearchPublicationsComponent } from './searchPages/advancedSearchPublications.component';
|
||||
import { DepositComponent } from './deposit/deposit.component';
|
||||
import { DepositResultComponent } from './deposit/depositResult.component';
|
||||
|
@ -48,6 +49,7 @@ const appRoutes: Routes = [
|
|||
{ path: 'search/find/projects', component: SearchProjectsComponent },
|
||||
{ path: 'search/find/datasets', component: SearchDatasetsComponent },
|
||||
{ path: 'search/find/organizations', component: SearchOrganizationsComponent },
|
||||
{ path: 'search/find/people', component: SearchPeopleComponent },
|
||||
{ path: 'search/advanced/publications', component: AdvancedSearchPublicationsComponent },
|
||||
{ path: 'deposit', component: DepositComponent},
|
||||
{ path: 'deposit-results', component: DepositResultComponent},
|
||||
|
|
|
@ -7,6 +7,8 @@ import {UtilsModule} from '../utils/utils.module';
|
|||
import {ClaimModule} from '../claimPages/claim.module';
|
||||
import {ServicesModule} from '../services/services.module';
|
||||
|
||||
import {SearchModule} from '../searchPages/search.module';
|
||||
|
||||
import {TabPagingComponent} from './tabPaging.component.ts';
|
||||
import {TabTableComponent} from './tabTable.component.ts';
|
||||
import {ShowTitleComponent} from './showTitle.component.ts';
|
||||
|
@ -36,7 +38,8 @@ import { PublicationComponent } from './publication/publication.component';
|
|||
CommonModule, FormsModule,
|
||||
UtilsModule,
|
||||
ClaimModule,
|
||||
ServicesModule
|
||||
ServicesModule,
|
||||
SearchModule
|
||||
|
||||
],
|
||||
declarations: [
|
||||
|
|
|
@ -58,6 +58,9 @@
|
|||
<li class="active">
|
||||
<a data-toggle="tab" href="#publicationsTab">
|
||||
Publications
|
||||
<span class="badge">
|
||||
{{searchPublicationsComponent.totalResults}}
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
|
@ -75,15 +78,18 @@
|
|||
<div class="tab-content">
|
||||
<div id="publicationsTab" class="tab-pane fade in active panel-body">
|
||||
|
||||
<div *ngIf="projectInfo.publications == undefined" class = "alert alert-info " >
|
||||
<div *ngIf="searchPublicationsComponent.totalResults == 0" class = "alert alert-info " >
|
||||
There are no publications
|
||||
</div>
|
||||
|
||||
<div *ngIf="projectInfo.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>
|
||||
|
||||
|
|
|
@ -5,13 +5,41 @@ import {ProjectService} from '../../services/project.service';
|
|||
import {ProjectInfo} from '../../utils/entities/projectInfo';
|
||||
import {InlineClaimResultComponent} from '../../claimPages/inlineClaims/inlineClaimResult.component';
|
||||
|
||||
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 {SearchResultComponent} from '../../searchPages/searchUtils/searchResult.component';
|
||||
|
||||
import {OpenaireProperties} from '../../utils/properties/openaireProperties';
|
||||
|
||||
@Component({
|
||||
selector: 'project',
|
||||
templateUrl: 'project.component.html',
|
||||
})
|
||||
export class ProjectComponent implements OnInit{
|
||||
|
||||
|
||||
private projectId : string ;
|
||||
private projectInfo: ProjectInfo;
|
||||
|
||||
private project ;
|
||||
|
||||
@ViewChild (InlineClaimResultComponent) inlineClaimResult : InlineClaimResultComponent ;
|
||||
|
||||
|
||||
public warningMessage = "";
|
||||
public errorMessage = "";
|
||||
|
||||
sub: any;
|
||||
subPublications: any;
|
||||
|
||||
private searchPublicationsComponent : SearchPublicationsComponent;
|
||||
private linkToSearchPublications = "";
|
||||
|
||||
constructor (private _projectService: ProjectService,
|
||||
private route: ActivatedRoute) {
|
||||
private _searchPublicationsService: SearchPublicationsService,
|
||||
private route: ActivatedRoute) {
|
||||
console.info('project constructor');
|
||||
// this.projectId = 'corda_______::2c37878a0cede85dbbd1081bb9b4a2f8';
|
||||
// console.info("1 Id is :"+this.projectId);
|
||||
|
@ -20,7 +48,10 @@ export class ProjectComponent implements OnInit{
|
|||
// }else{
|
||||
// this.warningMessage=" 1 No valid project id";
|
||||
// }
|
||||
|
||||
this.searchPublicationsComponent = new SearchPublicationsComponent(this.route, this._searchPublicationsService);
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
// this.sub = this.route.params.subscribe(params => {
|
||||
// this.projectId = params['projectId'];
|
||||
|
@ -59,22 +90,22 @@ export class ProjectComponent implements OnInit{
|
|||
|
||||
});
|
||||
|
||||
this.subPublications = this.route.queryParams.subscribe(params => {
|
||||
this.searchPublications();
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
private projectId : string ;
|
||||
private projectInfo: ProjectInfo;
|
||||
|
||||
private project ;
|
||||
|
||||
@ViewChild (InlineClaimResultComponent) inlineClaimResult : InlineClaimResultComponent ;
|
||||
|
||||
|
||||
public warningMessage = "";
|
||||
public errorMessage = "";
|
||||
ngOnDestroy() {
|
||||
this.sub.unsubscribe();
|
||||
this.subPublications.unsubscribe();
|
||||
}
|
||||
sub: any;
|
||||
|
||||
private searchPublications() {
|
||||
this.searchPublicationsComponent.getResults(this.projectId, 1, 10, "projectPage");
|
||||
this.linkToSearchPublications = OpenaireProperties.getLinkToSearchPublications();
|
||||
}
|
||||
|
||||
getProjectInfo (id:string) {
|
||||
console.info("inside getProjectInfo of component");
|
||||
|
|
|
@ -7,11 +7,13 @@ import { SearchDataprovidersComponent } from '../searchDataproviders.component';
|
|||
import { SearchProjectsComponent } from '../searchProjects.component';
|
||||
import { SearchDatasetsComponent } from '../searchDatasets.component';
|
||||
import { SearchOrganizationsComponent } from '../searchOrganizations.component';
|
||||
import { SearchPeopleComponent } from '../searchPeople.component';
|
||||
|
||||
import {SearchPublicationsService} from '../../services/searchPublications.service';
|
||||
import {SearchDataprovidersService} from '../../services/searchDataproviders.service';
|
||||
import {SearchProjectsService} from '../../services/searchProjects.service';
|
||||
import {SearchDatasetsService} from '../../services/searchDatasets.service';
|
||||
import {SearchPeopleService} from '../../services/searchPeople.service';
|
||||
import {SearchOrganizationsService} from '../../services/searchOrganizations.service';
|
||||
|
||||
import {OpenaireProperties} from '../../utils/properties/openaireProperties';
|
||||
|
@ -60,7 +62,7 @@ import {OpenaireProperties} from '../../utils/properties/openaireProperties';
|
|||
</li>
|
||||
<li>
|
||||
<a data-toggle="tab" href="#peopleTab" >
|
||||
People (-)
|
||||
People ({{searchPeopleComponent.totalResults}})
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
@ -86,8 +88,8 @@ import {OpenaireProperties} from '../../utils/properties/openaireProperties';
|
|||
<search-result [(results)]="searchOrganizationsComponent.results" [(status)]= "searchOrganizationsComponent.status"></search-result>
|
||||
</div>
|
||||
<div id="peopleTab" class="tab-pane fade in active panel-body" >
|
||||
<!--<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 class = "text-right" *ngIf = "searchPeopleComponent.totalResults > 10" ><a [href] = "linkToSearchPeople" >View all {{searchPeopleComponent.totalResults}} results</a></div>
|
||||
<search-result [(results)]="searchPeopleComponent.results" [(status)]= "searchPeopleComponent.status"></search-result>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -111,12 +113,14 @@ export class SearchComponent {
|
|||
private linkToSearchDataproviders = "";
|
||||
private linkToSearchDatasets = "";
|
||||
private linkToSearchOrganizations = "";
|
||||
private linkToSearchPeople = "";
|
||||
|
||||
private searchPublicationsComponent : SearchPublicationsComponent;
|
||||
private searchDataProvidersComponent : SearchDataprovidersComponent;
|
||||
private searchProjectsComponent : SearchProjectsComponent;
|
||||
private searchDatasetsComponent: SearchDatasetsComponent;
|
||||
private searchOrganizationsComponent: SearchOrganizationsComponent;
|
||||
private searchPeopleComponent: SearchPeopleComponent;
|
||||
|
||||
//TODO add more viewchild for other entities
|
||||
|
||||
|
@ -125,12 +129,14 @@ export class SearchComponent {
|
|||
private _searchDataprovidersService: SearchDataprovidersService,
|
||||
private _searchProjectsService: SearchProjectsService,
|
||||
private _searchDatasetsService: SearchDatasetsService,
|
||||
private _searchOrganizationsService: SearchOrganizationsService) {
|
||||
private _searchOrganizationsService: SearchOrganizationsService,
|
||||
private _searchPeopleService: SearchPeopleService) {
|
||||
this.searchPublicationsComponent = new SearchPublicationsComponent(this.route, this._searchPublicationsService);
|
||||
this.searchDataProvidersComponent = new SearchDataprovidersComponent(this.route,this._searchDataprovidersService);
|
||||
this.searchProjectsComponent = new SearchProjectsComponent(this.route, this._searchProjectsService);
|
||||
this.searchDatasetsComponent = new SearchDatasetsComponent(this.route, this._searchDatasetsService);;
|
||||
this.searchOrganizationsComponent = new SearchOrganizationsComponent(this.route, this._searchOrganizationsService);;
|
||||
this.searchDatasetsComponent = new SearchDatasetsComponent(this.route, this._searchDatasetsService);
|
||||
this.searchOrganizationsComponent = new SearchOrganizationsComponent(this.route, this._searchOrganizationsService);
|
||||
this.searchPeopleComponent = new SearchPeopleComponent(this.route, this._searchPeopleService);
|
||||
}
|
||||
|
||||
private ngOnInit() {
|
||||
|
@ -147,7 +153,7 @@ export class SearchComponent {
|
|||
}
|
||||
private searchPublications() {
|
||||
this.activeTab = "publications";
|
||||
this.searchPublicationsComponent.getResults(this.keyword, 1, 10);
|
||||
this.searchPublicationsComponent.getResults(this.keyword, 1, 10, "searchPage");
|
||||
this.linkToSearchPublications = OpenaireProperties.getLinkToSearchPublications() + this.keyword;
|
||||
}
|
||||
private searchDatasets() {
|
||||
|
@ -171,7 +177,9 @@ export class SearchComponent {
|
|||
this.linkToSearchOrganizations = OpenaireProperties.getLinkToSearchOrganizations() + this.keyword;
|
||||
}
|
||||
private searchPeople() {
|
||||
this.activeTab = "publications";
|
||||
this.activeTab = "people";
|
||||
this.searchPeopleComponent.getResults(this.keyword, 1, 10);
|
||||
this.linkToSearchPeople = OpenaireProperties.getLinkToSearchPeople() + this.keyword;
|
||||
}
|
||||
|
||||
private keywordChanged($event){
|
||||
|
@ -181,6 +189,7 @@ export class SearchComponent {
|
|||
this.searchDataProviders();
|
||||
this.searchDatasets();
|
||||
this.searchOrganizations();
|
||||
this.searchPeople();
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -25,6 +25,7 @@ import { SearchDataprovidersComponent } from './searchDataproviders.component';
|
|||
import { SearchProjectsComponent } from './searchProjects.component';
|
||||
import {SearchDatasetsComponent} from './searchDatasets.component';
|
||||
import {SearchOrganizationsComponent} from './searchOrganizations.component';
|
||||
import {SearchPeopleComponent} from './searchPeople.component';
|
||||
|
||||
import {SearchComponent} from './find/search.component';
|
||||
import {SearchCompatibleDataprovidersComponent} from './dataProviders/compatibleDataProviders.component';
|
||||
|
@ -54,7 +55,8 @@ import {SearchCompatibleDataprovidersComponent} from './dataProviders/compatible
|
|||
SearchProjectsComponent,
|
||||
SearchCompatibleDataprovidersComponent,
|
||||
SearchDatasetsComponent,
|
||||
SearchOrganizationsComponent
|
||||
SearchOrganizationsComponent,
|
||||
SearchPeopleComponent
|
||||
],
|
||||
|
||||
providers:[
|
||||
|
@ -68,8 +70,10 @@ import {SearchCompatibleDataprovidersComponent} from './dataProviders/compatible
|
|||
SearchDataprovidersComponent,
|
||||
SearchDatasetsComponent,
|
||||
SearchOrganizationsComponent,
|
||||
SearchPeopleComponent,
|
||||
SearchComponent,
|
||||
SearchCompatibleDataprovidersComponent
|
||||
SearchCompatibleDataprovidersComponent,
|
||||
SearchResultComponent
|
||||
]
|
||||
})
|
||||
export class SearchModule { }
|
||||
|
|
|
@ -0,0 +1,147 @@
|
|||
import {Component, Input, ViewChild} from '@angular/core';
|
||||
import { ActivatedRoute} from '@angular/router';
|
||||
|
||||
import { Filter, Value} from './searchUtils/searchHelperClasses.class';
|
||||
|
||||
import {SearchPeopleService} from '../services/searchPeople.service';
|
||||
import {SearchResult} from '../utils/entities/searchResult';
|
||||
import {OpenaireProperties, ErrorCodes} from '../utils/properties/openaireProperties';
|
||||
|
||||
@Component({
|
||||
selector: 'search-people',
|
||||
template: `
|
||||
|
||||
<search-page pageTitle="Search People" type="people" [(filters)] = "filters"
|
||||
[(results)] = "results" [(totalResults)] = "totalResults" [(keyword)] = "keyword"
|
||||
[(page)] = "page" [(size)] = "size" [(status)] = "status" [baseUrl] = "baseUrl" (queryChange)="queryChanged($event)" >
|
||||
</search-page>
|
||||
|
||||
`
|
||||
|
||||
})
|
||||
export class SearchPeopleComponent {
|
||||
public results =[];
|
||||
private filters =[];
|
||||
public totalResults:number = 0 ;
|
||||
public status:number;
|
||||
private baseUrl:string;
|
||||
private keyword = '';
|
||||
private page :number = 1;
|
||||
private size :number = 10;
|
||||
private sub: any;
|
||||
|
||||
constructor (private route: ActivatedRoute, private _searchPeopleService: SearchPeopleService ) {
|
||||
//this.results =[];
|
||||
//this.filters =[];
|
||||
var errorCodes:ErrorCodes = new ErrorCodes();
|
||||
this.status =errorCodes.LOADING;
|
||||
this.baseUrl = OpenaireProperties.getLinkToSearchPeople();
|
||||
}
|
||||
|
||||
private ngOnInit() {
|
||||
this.sub = this.route.queryParams.subscribe(params => {
|
||||
this.keyword = (params['keyword']?params['keyword']:'');
|
||||
this.page = (params['page']=== undefined)?1:+params['page'];
|
||||
for(var i=0; i<5 ; i++){
|
||||
var values = [];
|
||||
for(var j=0; j<10 ; j++){
|
||||
var value:Value = {name: "name"+j, id: "filter_"+i+ "_id_"+j, number:j, selected:false}
|
||||
values.push(value);
|
||||
}
|
||||
values.sort((n2,n1) => {
|
||||
if (n1.number > n2.number) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (n1.number < n2.number) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
});
|
||||
var filter:Filter = {title: "title"+i, filterId: "filter_"+i, originalFilterId: "filter_"+i, values : values, countSelectedValues:0, "filterOperator": 'and'}
|
||||
if(i==0) {
|
||||
var values = [];
|
||||
for(var j=0; j<10 ; j++){
|
||||
var value:Value = {name: "MYname"+j, id: "MYfilter_"+i+ "_id_"+j, number:j, selected:false}
|
||||
values.push(value);
|
||||
}
|
||||
values.sort((n2,n1) => {
|
||||
if (n1.number > n2.number) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (n1.number < n2.number) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
});
|
||||
var filter1:Filter = {title: "MYtitle"+i, filterId: "MYfilter_"+i, originalFilterId: "MYfilter_"+i, values : values, countSelectedValues:0, "filterOperator": 'or'}
|
||||
this.filters.push(filter1);
|
||||
this.getResults(this.keyword, this.page, this.size);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
console.info(params);
|
||||
if(params[filter.filterId] != undefined) {
|
||||
let values = params[filter.filterId].split(",");
|
||||
for(let value of values) {
|
||||
for(let filterValue of filter.values) {
|
||||
if(filterValue.id == value) {
|
||||
filterValue.selected = true;
|
||||
filter.countSelectedValues++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
private ngOnDestroy() {
|
||||
this.sub.unsubscribe();
|
||||
}
|
||||
|
||||
public getResults(parameters:string, page: number, size: number){
|
||||
console.info("getResults: Execute search query "+parameters);
|
||||
|
||||
this._searchPeopleService.searchPeople(parameters, page, size).subscribe(
|
||||
data => {
|
||||
this.totalResults = data[0];
|
||||
console.info("search People total="+this.totalResults);
|
||||
this.results = data[1];
|
||||
var errorCodes:ErrorCodes = new ErrorCodes();
|
||||
this.status = errorCodes.DONE;
|
||||
if(this.totalResults == 0 ){
|
||||
this.status = errorCodes.NONE;
|
||||
}
|
||||
},
|
||||
err => {
|
||||
console.error(err);
|
||||
console.info("error");
|
||||
//TODO check erros (service not available, bad request)
|
||||
// if( ){
|
||||
// this.status = ErrorCodes.ERROR;
|
||||
// }
|
||||
var errorCodes:ErrorCodes = new ErrorCodes();
|
||||
this.status = errorCodes.NOT_AVAILABLE;
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
private setFilters(){
|
||||
//TODO set filters from
|
||||
}
|
||||
|
||||
private queryChanged($event) {
|
||||
var parameters = $event.value;
|
||||
console.info("queryChanged: Execute search query "+parameters);
|
||||
this.getResults(parameters, this.page, this.size);
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -79,7 +79,7 @@ export class SearchPublicationsComponent {
|
|||
});
|
||||
var filter1:Filter = {title: "MYtitle"+i, filterId: "MYfilter_"+i, originalFilterId: "MYfilter_"+i, values : values, countSelectedValues:0, "filterOperator": 'or'}
|
||||
this.filters.push(filter1);
|
||||
this.getResults(this.keyword, this.page, this.size);
|
||||
this.getResults(this.keyword, this.page, this.size, "searchPage");
|
||||
|
||||
}
|
||||
|
||||
|
@ -106,10 +106,10 @@ export class SearchPublicationsComponent {
|
|||
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._searchPublicationsService.searchPublications(parameters, page, size).subscribe(
|
||||
this._searchPublicationsService.searchPublications(parameters, page, size, flag).subscribe(
|
||||
data => {
|
||||
this.totalResults = data[0];
|
||||
console.info("searchPubl total="+this.totalResults);
|
||||
|
@ -140,7 +140,7 @@ export class SearchPublicationsComponent {
|
|||
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");
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -0,0 +1,56 @@
|
|||
import {Injectable} from '@angular/core';
|
||||
import {Http, Response} from '@angular/http';
|
||||
import {Observable} from 'rxjs/Observable';
|
||||
import {OpenaireProperties} from '../utils/properties/openaireProperties';
|
||||
import {SearchResult} from '../utils/entities/searchResult';
|
||||
|
||||
@Injectable()
|
||||
export class SearchPeopleService {
|
||||
|
||||
constructor(private http: Http) {}
|
||||
|
||||
searchPeople (params: string, page: number, size: number):any {
|
||||
|
||||
console.info("In searchPeople");
|
||||
|
||||
let link = OpenaireProperties.getSearchAPIURL()+"people";
|
||||
|
||||
let url = link+"?";
|
||||
if(params != '') {
|
||||
url += "q="+params+"&page="+page+"&size="+size;
|
||||
} else {
|
||||
url += "page="+page+"&size="+size;
|
||||
}
|
||||
|
||||
return this.http.get(url)
|
||||
.map(res => <any> res.json())
|
||||
.do(res => console.info(res))
|
||||
//.map(res => []);
|
||||
.map(res => [res['meta'].total, this.parseResults(res['results'])])
|
||||
;
|
||||
}
|
||||
|
||||
|
||||
parseResults(data: any): SearchResult[] {
|
||||
let results: SearchResult[] = [];
|
||||
|
||||
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:person'] : data['result']['metadata']['oaf:entity']['oaf:person'];
|
||||
|
||||
var result: SearchResult = new SearchResult();
|
||||
|
||||
result['title'] = {"name": '', "url": '', "accessMode": ''};
|
||||
|
||||
result['title'].name = resData.fullname;
|
||||
|
||||
result['title'].url = OpenaireProperties.getsearchLinkToPerson();
|
||||
result['title'].url += length > 1 ? data[i]['result']['header']['dri:objIdentifier'] : data['result']['header']['dri:objIdentifier'];
|
||||
|
||||
results.push(result);
|
||||
}
|
||||
|
||||
return results;
|
||||
}
|
||||
}
|
|
@ -10,17 +10,23 @@ export class SearchPublicationsService {
|
|||
|
||||
constructor(private http: Http) {}
|
||||
|
||||
searchPublications (params: string, page: number, size: number):any {
|
||||
searchPublications (params: string, page: number, size: number, flag: string):any {
|
||||
|
||||
console.info("In searchPublications");
|
||||
|
||||
let link = OpenaireProperties.getSearchAPIURL()+"publications";
|
||||
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()+"publications";
|
||||
|
||||
url = link+"?";
|
||||
if(params != '') {
|
||||
url += "q="+params+"&page="+page+"&size="+size;
|
||||
} else {
|
||||
url += "page="+page+"&size="+size;
|
||||
}
|
||||
} else if(flag == 'projectPage') {
|
||||
url = OpenaireProperties.getSearchAPIURL() + 'projects/'+params+"/publications";
|
||||
}
|
||||
|
||||
return this.http.get(url)
|
||||
|
|
|
@ -19,6 +19,7 @@ import {DataProviderService} from './dataProvider.service';
|
|||
import {SearchDataprovidersService} from './searchDataproviders.service';
|
||||
import {SearchDatasetsService} from './searchDatasets.service';
|
||||
import {SearchOrganizationsService} from './searchOrganizations.service';
|
||||
import {SearchPeopleService} from './searchPeople.service';
|
||||
|
||||
import {SearchProjectsService} from './searchProjects.service';
|
||||
|
||||
|
@ -34,7 +35,8 @@ import {SearchProjectsService} from './searchProjects.service';
|
|||
PersonService, ProjectService, PublicationService, SearchCrossrefService,
|
||||
SearchCrossrefService, SearchDataciteService, SearchOrcidService,
|
||||
SearchPublicationsService, SearchDataprovidersService, DataProviderService,
|
||||
SearchProjectsService, SearchDatasetsService, SearchOrganizationsService
|
||||
SearchProjectsService, SearchDatasetsService, SearchOrganizationsService,
|
||||
SearchPeopleService
|
||||
],
|
||||
exports: [
|
||||
]
|
||||
|
|
|
@ -29,7 +29,7 @@ import 'rxjs/Rx';
|
|||
<li><a href="/search/find/projects">Projects</a></li>
|
||||
<li><a href="/search/find/dataproviders">Data Providers</a></li>
|
||||
<li><a href="/search/find/organizations">Organizations</a></li>
|
||||
<li><a href="/search/find/">People</a></li>
|
||||
<li><a href="/search/find/people">People</a></li>
|
||||
<li role="separator" class="divider"></li>
|
||||
<li><a href="#">Separated link</a></li>
|
||||
<li role="separator" class="divider"></li>
|
||||
|
|
|
@ -16,4 +16,8 @@ export class ProjectInfo {
|
|||
publications: any;
|
||||
researchData: any;
|
||||
statistics: any;
|
||||
|
||||
totalPublications: number;
|
||||
totalDatasets: number;
|
||||
publicationsStatus: any;
|
||||
}
|
||||
|
|
|
@ -13,18 +13,19 @@ export class OpenaireProperties {
|
|||
private static searchLinkToProjects = "search/find/projects?keyword=";
|
||||
private static searchLinkToDatasets = "search/find/datasets?keyword=";
|
||||
private static searchLinkToOrganizations = "search/find/organizations?keyword=";
|
||||
private static searchLinkToPeople = "search/find/people?keyword=";
|
||||
|
||||
// Services - APIs
|
||||
|
||||
// public claimsAPIURL = "http://rudie.di.uoa.gr:8080/dnet-openaire-connector-service-1.0.0-SNAPSHOT/rest/claimsService/"
|
||||
private static claimsAPIURL = "http://scoobydoo.di.uoa.gr:8181/dnet-openaire-connector-service-1.0.0-SNAPSHOT/rest/claimsService/";
|
||||
|
||||
private static searchAPIURL = "http://astero.di.uoa.gr:8080/dnet-functionality-services-2.0.0-SNAPSHOT/rest/v2/api/";
|
||||
// private searchAPIURL = "http://rudie.di.uoa.gr:8080/dnet-functionality-services-2.0.0-SNAPSHOT/rest/v2.0/api/";
|
||||
// private searchAPIURL = "http://scoobydoo.di.uoa.gr:8181/dnet-functionality-services-2.0.0-SNAPSHOT/rest/v2.0/api/";
|
||||
//private static searchAPIURL = "http://astero.di.uoa.gr:8080/dnet-functionality-services-2.0.0-SNAPSHOT/rest/v2/api/";
|
||||
//private static searchAPIURL = "http://rudie.di.uoa.gr:8080/dnet-functionality-services-2.0.0-SNAPSHOT/rest/v2/api/";
|
||||
private static searchAPIURL = "http://scoobydoo.di.uoa.gr:8181/dnet-functionality-services-2.0.0-SNAPSHOT/rest/v2/api/";
|
||||
|
||||
private static searchServiveURL = "http://astero.di.uoa.gr:8080/dnet-functionality-services-2.0.0-SNAPSHOT/";
|
||||
// private static searchServiveURL = "http://scoobydoo.di.uoa.gr:8181/dnet-functionality-services-2.0.0-SNAPSHOT/";
|
||||
//private static searchServiveURL = "http://astero.di.uoa.gr:8080/dnet-functionality-services-2.0.0-SNAPSHOT/";
|
||||
private static searchServiveURL = "http://scoobydoo.di.uoa.gr:8181/dnet-functionality-services-2.0.0-SNAPSHOT/";
|
||||
// private static searchServiveURL = "http://services.openaire.eu:8380/search/";
|
||||
//private static searchServiveURL = "http://rudie.di.uoa.gr:8080/dnet-functionality-services-2.0.0-SNAPSHOT/";
|
||||
|
||||
|
@ -89,6 +90,9 @@ export class OpenaireProperties {
|
|||
public static getLinkToSearchOrganizations():string{
|
||||
return this.baseSearchLink + this.searchLinkToOrganizations;
|
||||
}
|
||||
public static getLinkToSearchPeople():string{
|
||||
return this.baseSearchLink + this.searchLinkToPeople;
|
||||
}
|
||||
|
||||
// Services - APIs' getters
|
||||
public static getSearchAPIURL():string{
|
||||
|
|
|
@ -73,6 +73,7 @@ app.get('/search/find/dataproviders', ngApp);
|
|||
app.get('/search/find/projects', ngApp);
|
||||
app.get('/search/find/datasets', ngApp);
|
||||
app.get('/search/find/organizations', ngApp);
|
||||
app.get('/search/find/people', ngApp);
|
||||
app.get('/deposit', ngApp);
|
||||
app.get('/deposit-result', ngApp);
|
||||
app.get('/error', ngApp);
|
||||
|
|
Loading…
Reference in New Issue