diff --git a/portal-2/src/app/claimPages/linking/selected/selected.component.ts b/portal-2/src/app/claimPages/linking/selected/selected.component.ts index 3917e35d..50838e11 100644 --- a/portal-2/src/app/claimPages/linking/selected/selected.component.ts +++ b/portal-2/src/app/claimPages/linking/selected/selected.component.ts @@ -200,10 +200,10 @@ export class ClaimSelectedComponent { -@Component({ - selector: 'add-more', - template: `` -}) -export class Addmore { - @Input() type = 'publication'; -} +// @Component({ +// selector: 'add-more', +// template: `` +// }) +// export class Addmore { +// @Input() type = 'publication'; +// } diff --git a/portal-2/src/app/home/home.component.html b/portal-2/src/app/home/home.component.html deleted file mode 100644 index 5f929e11..00000000 --- a/portal-2/src/app/home/home.component.html +++ /dev/null @@ -1,15 +0,0 @@ - -
-
-
-
-
- - - - -
-
-
-
-
diff --git a/portal-2/src/app/home/home.component.ts b/portal-2/src/app/home/home.component.ts index ac9604d7..f8501acb 100644 --- a/portal-2/src/app/home/home.component.ts +++ b/portal-2/src/app/home/home.component.ts @@ -5,11 +5,54 @@ import {Location} from '@angular/common'; @Component({ selector: 'home', - templateUrl: 'home.component.html', + template:` + +
+
+
+
+
+ + + + +
+
+
+
+
+` }) export class HomeComponent { - constructor ( private _router: Router, private location: Location) {} + private start ;private end ; + + constructor ( private _router: Router, private location: Location) { + this.start = new Date().getTime(); + + } + ngOnInit() { + + this.end = new Date().getTime(); + var time = this.end - this.start; + console.log('ngOnInit:Execution time: ' + time); + + + +} +ngAfterContentInit() { +this.end = new Date().getTime(); +var time = this.end - this.start; +console.log('ngAfterContentInit:Execution time: ' + time); +} + +ngAfterViewChecked() { + +this.end = new Date().getTime(); +var time = this.end - this.start; +console.log('ngAfterViewChecked: Execution time: ' + time); +} + searchTerm(term: string) { window.location.href="/search?keyword="+term; diff --git a/portal-2/src/app/landingPages/dataProvider/dataProvider.component.ts b/portal-2/src/app/landingPages/dataProvider/dataProvider.component.ts index 5fc2f538..edee7fc3 100644 --- a/portal-2/src/app/landingPages/dataProvider/dataProvider.component.ts +++ b/portal-2/src/app/landingPages/dataProvider/dataProvider.component.ts @@ -13,7 +13,10 @@ import{TabsComponent} from './tabs.component'; }) export class DataProviderComponent { + private start ;private end ; constructor (private _publicationService: DataProviderService, private route: ActivatedRoute) { + this.start = new Date().getTime(); + } ngOnInit() { this.sub = this.route.queryParams.subscribe(data => { @@ -24,11 +27,25 @@ export class DataProviderComponent { }else{ console.info("Datasource id not found"); } + this.end = new Date().getTime(); + var time = this.end - this.start; + console.log('ngOnInit:Execution time: ' + time); - }); + }); -} + } + ngAfterContentInit() { + this.end = new Date().getTime(); + var time = this.end - this.start; + console.log('ngAfterContentInit:Execution time: ' + time); + } + + ngAfterViewChecked() { + this.end = new Date().getTime(); + var time = this.end - this.start; + console.log('ngAfterViewChecked: Execution time: ' + time); + } ngOnDestroy() { this.sub.unsubscribe(); diff --git a/portal-2/src/app/landingPages/publication/publication.component.ts b/portal-2/src/app/landingPages/publication/publication.component.ts index 4087ac59..7dc82289 100644 --- a/portal-2/src/app/landingPages/publication/publication.component.ts +++ b/portal-2/src/app/landingPages/publication/publication.component.ts @@ -20,8 +20,9 @@ export class PublicationComponent { private showAllFundedBy: boolean = false; private showAllPublishedIn: boolean = false; + private start ;private end ; constructor (private _publicationService: PublicationService, private route: ActivatedRoute) { - + this.start = new Date().getTime(); } ngOnInit() { this.sub = this.route.queryParams.subscribe(data => { @@ -32,11 +33,27 @@ export class PublicationComponent { }else{ console.info("Article id not found"); } + this.end = new Date().getTime(); + var time = this.end - this.start; + console.log('ngOnInit:Execution time: ' + time); }); } +ngAfterContentInit() { + this.end = new Date().getTime(); + var time = this.end - this.start; + console.log('ngAfterContentInit:Execution time: ' + time); + } + +ngAfterViewChecked() { + // console.info("indentifiers:"+(this.publicationInfo != undefined&& this.publicationInfo.identifiers!= undefined)?this.publicationInfo.identifiers.size:"-"); + + this.end = new Date().getTime(); + var time = this.end - this.start; + console.log('ngAfterViewChecked: Execution time: ' + time); + } ngOnDestroy() { this.sub.unsubscribe(); diff --git a/portal-2/src/app/services/entitySearch.service.ts b/portal-2/src/app/services/entitySearch.service.ts index 0ca3ce6e..79dea082 100644 --- a/portal-2/src/app/services/entitySearch.service.ts +++ b/portal-2/src/app/services/entitySearch.service.ts @@ -14,8 +14,7 @@ export class EntitiesSearchService { constructor(private http: Http, public _cache: CacheService) {} searchProjectsByFunder(keyword:string, funderId:string):any { - //TODO ............. - let url = OpenaireProperties. getSearchAPIURLLast()+"projects?"+((keyword && keyword.length > 0)?("q=" +keyword+"&op=and"):"")+"&funder="+funderId+"&fn=and&size=10&page=1"+"&format=json"; + let url = OpenaireProperties. getSearchAPIURLLast()+"projects?"+((keyword && keyword.length > 0)?("q=" +keyword):"")+"&fq=funderid exact " + '"'+funderId+ '"'+"&size=10&page=0&format=json"; return this.http.get(url).toPromise() .then(request => { @@ -58,16 +57,16 @@ export class EntitiesSearchService { } private searchEntity (keyword: string,APIname:string,oafEntityType:string, type:string):any { - let link = OpenaireProperties. getSearchAPIURLLast()+APIname+"?format=json"; + let link = OpenaireProperties. getSearchAPIURLLast()+APIname; return this.search(link,keyword,oafEntityType,type) } private fetchEntity (id: string,APIname:string,oafEntityType:string, type:string):any { - let link = OpenaireProperties. getSearchAPIURLLast()+APIname+"?format=json"; + let link = OpenaireProperties. getSearchAPIURLLast()+APIname; return this.fetch(link,id,oafEntityType,type) } private fetch (link,id,oafEntityType,type){ - let url = link+"/"+id; + let url = link+"/"+id+"?format=json"; return this.http.get(url) .map(request => request.json()) // .do(res => console.info(res)) @@ -79,10 +78,10 @@ private fetch (link,id,oafEntityType,type){ private search (link,keyword,oafEntityType,type){ let url = link+"?"; if(keyword!= null && keyword != '' ) { - url += "q="+ keyword+"&op=and"; + url += "q="+ keyword; } - //TODO change page size when new API is ready - url += "&page="+(type == "publication"?0:1)+"&size="+10; + + url += "&page=0&size="+10+"&format=json"; return this.http.get(url).toPromise() .then(request => {