Bug fixed in metrics service (metrics info cached before parsed) | Open Graph metatags added in person landing page | baseLink for openaire starting page added in properties file
git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-services-portal/trunk@47421 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
parent
b3ab493532
commit
10e9fb8fdc
|
@ -1,6 +1,6 @@
|
|||
import {Component, ElementRef} from '@angular/core';
|
||||
import {Observable} from 'rxjs/Observable';
|
||||
import { ActivatedRoute, Route} from '@angular/router';
|
||||
import { ActivatedRoute, Route, Router} from '@angular/router';
|
||||
import {PersonService} from './person.service';
|
||||
import { PersonInfo } from '../../utils/entities/personInfo';
|
||||
|
||||
|
@ -38,13 +38,16 @@ export class PersonComponent {
|
|||
private _personService: PersonService,
|
||||
private route: ActivatedRoute,
|
||||
private _searchPublicationsService: SearchPublicationsService,
|
||||
private _searchDatasetsService: SearchDatasetsService, private _meta: Meta) {
|
||||
private _searchDatasetsService: SearchDatasetsService,
|
||||
private _router: Router,
|
||||
private _meta: Meta) {
|
||||
|
||||
this.fetchPublications = new FetchPublications( this._searchPublicationsService);
|
||||
this.fetchDatasets = new FetchDatasets( this._searchDatasetsService);
|
||||
// this.scrollUp = this._route.events.subscribe((path) => {
|
||||
// element.nativeElement.scrollIntoView();
|
||||
// });
|
||||
this.updateUrl(OpenaireProperties.getBaseLink()+this._router.url);
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
|
@ -150,12 +153,15 @@ export class PersonComponent {
|
|||
}
|
||||
updateDescription(description:string){
|
||||
this._meta.updateMeta("description", description);
|
||||
this._meta.updateMeta("og:description", description);
|
||||
this._meta.updateProperty("og:description", description);
|
||||
}
|
||||
updateTitle(title:string){
|
||||
var _suffix ="| OpenAIRE";
|
||||
var _title = ((title.length> 50 ) ?title.substring(0,50):title) + _suffix;
|
||||
this._meta.setTitle(_title );
|
||||
this._meta.updateMeta("og:title",_title);
|
||||
this._meta.updateProperty("og:title",_title);
|
||||
}
|
||||
updateUrl(url:string){
|
||||
this._meta.updateProperty("og:url", url);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -66,12 +66,12 @@ import {SearchFilterModalComponent} from './searchFilterModal.component';
|
|||
[type]="entityType" [urlParam]="urlParam"
|
||||
[showLoading]="true">
|
||||
</search-result>
|
||||
<table-view *ngIf="tableView"
|
||||
<!--table-view *ngIf="tableView"
|
||||
[results]="results"
|
||||
[status]=searchUtils.status
|
||||
[type]="entityType" [urlParam]="urlParam"
|
||||
[showLoading]="true">
|
||||
</table-view>
|
||||
</table-view-->
|
||||
</div>
|
||||
|
||||
|
||||
|
@ -89,12 +89,12 @@ import {SearchFilterModalComponent} from './searchFilterModal.component';
|
|||
[type]="entityType" [urlParam]="urlParam"
|
||||
[showLoading]="true">
|
||||
</search-result>
|
||||
<table-view *ngIf="tableView"
|
||||
<!--table-view *ngIf="tableView"
|
||||
[results]="results"
|
||||
[status]=searchUtils.status
|
||||
[type]="entityType" [urlParam]="urlParam"
|
||||
[showLoading]="true">
|
||||
</table-view>
|
||||
</table-view-->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -17,16 +17,18 @@ export class MetricsService {
|
|||
let url = OpenaireProperties.getMetricsAPIURL()+entity+"/"+id+"/clicks";
|
||||
let key = url;
|
||||
if (this._cache.has(key)) {
|
||||
return Observable.of(this._cache.get(key));
|
||||
return Observable.of(this._cache.get(key))
|
||||
.map(res => this.parseMetrics(res["downloads"], res["views"], res["total_downloads"], res["total_views"],
|
||||
res["total_openaire_views"], res["total_openaire_downloads"], res["pageviews"]));
|
||||
}
|
||||
|
||||
return this.http.get(url)
|
||||
.map(res => <any> res.json())
|
||||
.map(res => this.parseMetrics(res["downloads"], res["views"], res["total_downloads"], res["total_views"],
|
||||
res["total_openaire_views"], res["total_openaire_downloads"], res["pageviews"]))
|
||||
.do(res => {
|
||||
this._cache.set(key, res);
|
||||
});
|
||||
})
|
||||
.map(res => this.parseMetrics(res["downloads"], res["views"], res["total_downloads"], res["total_views"],
|
||||
res["total_openaire_views"], res["total_openaire_downloads"], res["pageviews"]));
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -1,5 +1,9 @@
|
|||
export class OpenaireProperties {
|
||||
private static productionMode:boolean = false;
|
||||
|
||||
//base url
|
||||
private static baseLink = "http://demo.openaire.eu";
|
||||
|
||||
//landing Pages
|
||||
private static baseSearchLink="/";
|
||||
private static searchLinkToPublication = "search/publication?articleId=";
|
||||
|
@ -79,6 +83,11 @@ export class OpenaireProperties {
|
|||
private static uploadService = "http://scoobydoo.di.uoa.gr:8000/upload";
|
||||
|
||||
private static vocabulariesAPI ="https://beta.services.openaire.eu/provision/mvc/vocabularies/";
|
||||
|
||||
public static getBaseLink():string{
|
||||
return this.baseLink;
|
||||
}
|
||||
|
||||
//landing Pages' getters
|
||||
public static getsearchLinkToPublication():string{
|
||||
return this.baseSearchLink + this.searchLinkToPublication;
|
||||
|
|
|
@ -7,10 +7,19 @@
|
|||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<base href="/" />
|
||||
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
|
||||
<meta name="description" content="open access, research, scientific publication, European Commission, EC, FP7, ERC, Horizon 2020, H2020, search, projects ">
|
||||
<meta property="og:description" content="open access, research, scientific publication, European Commission, EC, FP7, ERC, Horizon 2020, H2020, search, projects ">
|
||||
<meta property="og:title" content="Search OpenAIRE">
|
||||
<meta name="og:image" content="assets/newlogo.png">
|
||||
<meta name="description" content="open access, research, scientific publication, European Commission, EC, FP7, ERC, Horizon 2020, H2020, search, projects "/>
|
||||
<meta property="og:description" content="open access, research, scientific publication, European Commission, EC, FP7, ERC, Horizon 2020, H2020, search, projects "/>
|
||||
<meta property="og:title" content="Search OpenAIRE"/>
|
||||
|
||||
<meta property="og:type" content="website"/>
|
||||
<meta property="og:url" content="http://demo.openaire.eu"/>
|
||||
<meta property="og:site_name" content="OpenAIRE"/>
|
||||
|
||||
<!--meta property="og:image" content="http://duffy.di.uoa.gr:3000/assets/newlogo_200_200.png"/>
|
||||
<meta property="og:image:type" content="image/png" />
|
||||
<meta property="og:image:width" content="200" />
|
||||
<meta property="og:image:height" content="200" /-->
|
||||
|
||||
<link href="assets/favicon.ico" rel="shortcut icon" type="image/vnd.microsoft.icon" />
|
||||
<title>Search OpenAIRE</title>
|
||||
<!-- <script src="assets/jquery/jquery.min.js" type="text/javascript"></script> -->
|
||||
|
|
Loading…
Reference in New Issue