1. searchDataproviders.component, searchProjects.component: Community is specified by url parameter.
2. searchDataproviders.service, searchProjects.service: communityId specified by parameter of the search function. git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-connect-portal/trunk@51014 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
parent
c0e4df0714
commit
ef9312b647
|
@ -42,6 +42,8 @@ export class OpenaireSearchDataprovidersComponent {
|
|||
|
||||
public disableForms: boolean = false;
|
||||
|
||||
private communityId: string = '';
|
||||
|
||||
@ViewChild (SearchPageTableViewComponent) searchPage : SearchPageTableViewComponent ;
|
||||
|
||||
constructor (private route: ActivatedRoute, private _searchDataprovidersService: SearchCommunityDataprovidersService) {
|
||||
|
@ -56,6 +58,7 @@ export class OpenaireSearchDataprovidersComponent {
|
|||
});
|
||||
//this.searchPage.refineFields = this.refineFields;
|
||||
this.sub = this.route.queryParams.subscribe(params => {
|
||||
this.communityId = params['communityId'];
|
||||
this.searchUtils.keyword = (params['keyword']?params['keyword']:'');
|
||||
//this.filters = this.createFilters();
|
||||
//this.searchPage.getParametersFromUrl(params);
|
||||
|
@ -80,7 +83,7 @@ export class OpenaireSearchDataprovidersComponent {
|
|||
|
||||
let size: number = 0;
|
||||
|
||||
this.subResults = this._searchDataprovidersService.searchDataproviders(this.properties).subscribe(
|
||||
this.subResults = this._searchDataprovidersService.searchDataproviders(this.properties, this.communityId).subscribe(
|
||||
data => {
|
||||
//this.filters = this.createFilters(data, params);
|
||||
console.info(data);
|
||||
|
|
|
@ -42,6 +42,8 @@ export class OpenaireSearchProjectsComponent {
|
|||
|
||||
public disableForms: boolean = false;
|
||||
|
||||
private communityId: string = '';
|
||||
|
||||
@ViewChild (SearchPageTableViewComponent) searchPage : SearchPageTableViewComponent ;
|
||||
|
||||
constructor (private route: ActivatedRoute, private _searchProjectsService: SearchCommunityProjectsService) {
|
||||
|
@ -56,6 +58,7 @@ export class OpenaireSearchProjectsComponent {
|
|||
});
|
||||
//this.searchPage.refineFields = this.refineFields;
|
||||
this.sub = this.route.queryParams.subscribe(params => {
|
||||
this.communityId = params['communityId'];
|
||||
this.searchUtils.keyword = (params['keyword']?params['keyword']:'');
|
||||
//this.filters = this.createFilters();
|
||||
//this.searchPage.getParametersFromUrl(params);
|
||||
|
@ -80,7 +83,7 @@ export class OpenaireSearchProjectsComponent {
|
|||
|
||||
let size: number = 0;
|
||||
|
||||
this.subResults = this._searchProjectsService.searchProjects(this.properties).subscribe(
|
||||
this.subResults = this._searchProjectsService.searchProjects(this.properties, this.communityId).subscribe(
|
||||
data => {
|
||||
this.filters = this.createFilters(data, params);
|
||||
|
||||
|
|
|
@ -12,8 +12,8 @@ import{EnvProperties} from '../openaireLibrary/utils/properties/env-properties';
|
|||
export class SearchCommunityDataprovidersService {
|
||||
constructor(private http: Http ) {}
|
||||
|
||||
searchDataproviders (properties:EnvProperties ):any {
|
||||
let url = properties.communityAPI+"egi/contentproviders";
|
||||
searchDataproviders (properties:EnvProperties, communityId: string):any {
|
||||
let url = properties.communityAPI+communityId+"/contentproviders";
|
||||
|
||||
return this.http.get((properties.useCache)? (properties.cacheUrl+encodeURIComponent(url)): url)
|
||||
.map(res => <any> res.json())
|
||||
|
|
|
@ -10,15 +10,10 @@ import{EnvProperties} from '../openaireLibrary/utils/properties/env-properties';
|
|||
|
||||
@Injectable()
|
||||
export class SearchCommunityProjectsService {
|
||||
private sizeOfDescription: number = 270;
|
||||
|
||||
constructor(private http: Http ) {}
|
||||
|
||||
searchProjects (properties:EnvProperties ):any {
|
||||
|
||||
console.info("In searchProjects");
|
||||
|
||||
let url = properties.communityAPI+"egi/projects";
|
||||
searchProjects (properties:EnvProperties, communityId: string):any {
|
||||
let url = properties.communityAPI+communityId+"/projects";
|
||||
|
||||
return this.http.get((properties.useCache)? (properties.cacheUrl+encodeURIComponent(url)): url)
|
||||
.map(res => <any> res.json())
|
||||
|
|
Loading…
Reference in New Issue