[Library|Trunk]
- piwik update: for result landing create custom url using the url format with the dedup id - result landing service: url encode pid for search service - update message for orcid git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-services-library/trunk/ng-openaire-library/src/app@60625 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
parent
04f8e00242
commit
3f64157136
|
@ -368,7 +368,7 @@ export class ResultLandingComponent {
|
||||||
this.updateDescription((this.resultLandingInfo.description ? (this.resultLandingInfo.description) : ("," + this.resultLandingInfo.title)));
|
this.updateDescription((this.resultLandingInfo.description ? (this.resultLandingInfo.description) : ("," + this.resultLandingInfo.title)));
|
||||||
}
|
}
|
||||||
if (this.properties.enablePiwikTrack && (typeof document !== 'undefined')) {
|
if (this.properties.enablePiwikTrack && (typeof document !== 'undefined')) {
|
||||||
this.subscriptions.push(this._piwikService.trackView(this.properties, this.resultLandingInfo.title/*.name*/, this.piwikSiteId).subscribe());
|
this.subscriptions.push(this._piwikService.trackViewForCustomUrl(this.properties, this.resultLandingInfo.title, this.linkToLandingPage.split("?")[1] + this.id ,this.piwikSiteId).subscribe());
|
||||||
}
|
}
|
||||||
|
|
||||||
let bioentitiesNum = 0;
|
let bioentitiesNum = 0;
|
||||||
|
|
|
@ -38,7 +38,7 @@ export class ResultLandingService {
|
||||||
} else if (identifier) {
|
} else if (identifier) {
|
||||||
// pid = "10.3389/fphys.2014.00466";
|
// pid = "10.3389/fphys.2014.00466";
|
||||||
let url = properties.searchAPIURLLAst + "resources2";
|
let url = properties.searchAPIURLLAst + "resources2";
|
||||||
url += "?pid="+identifier.id + "&pidtype=" + identifier.class + "&type=";
|
url += "?pid="+encodeURIComponent(identifier.id) + "&pidtype=" + identifier.class + "&type=";
|
||||||
if (type === 'publication') {
|
if (type === 'publication') {
|
||||||
url += 'publications';
|
url += 'publications';
|
||||||
} else if (type === 'dataset') {
|
} else if (type === 'dataset') {
|
||||||
|
|
|
@ -294,9 +294,9 @@ declare var UIkit: any;
|
||||||
[classBody]="'landing-modal uk-padding-remove'">
|
[classBody]="'landing-modal uk-padding-remove'">
|
||||||
<div class="uk-padding-small">
|
<div class="uk-padding-small">
|
||||||
<div>
|
<div>
|
||||||
This research outcome has been <span class="uk-text-bold">deduplicated in OpenAIRE</span>.
|
This research outcome is the result of <span class="uk-text-bold"> merged research outcomes in OpenAIRE</span>.
|
||||||
<br><br>
|
<br><br>
|
||||||
You have already added <span class="uk-text-bold">{{this.putCodes?.length}} works</span> in your ORCID record related to this research outcome.
|
You have already added <span class="uk-text-bold">{{this.putCodes?.length}} works</span> in your ORCID record related to the merged research outcome.
|
||||||
<div *ngIf="currentAction == 'delete'">
|
<div *ngIf="currentAction == 'delete'">
|
||||||
If you continue with delete action, <span class="uk-text-bold">all these works will be deleted</span>.
|
If you continue with delete action, <span class="uk-text-bold">all these works will be deleted</span>.
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -3,28 +3,41 @@ import {HttpClient} from "@angular/common/http";
|
||||||
|
|
||||||
import {StringUtils} from '../string-utils.class';
|
import {StringUtils} from '../string-utils.class';
|
||||||
import {EnvProperties} from '../properties/env-properties';
|
import {EnvProperties} from '../properties/env-properties';
|
||||||
|
import {Observable} from "rxjs";
|
||||||
|
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class PiwikService {
|
export class PiwikService {
|
||||||
constructor(private http: HttpClient ) {}
|
constructor(private http: HttpClient ) {}
|
||||||
|
trackViewForCustomUrl (properties:EnvProperties, title, pageparams, siteId = null):any {
|
||||||
|
let piwikId= ((siteId!=null)?siteId:properties.piwikSiteId);
|
||||||
|
if(typeof location !== 'undefined' && piwikId){
|
||||||
|
return this.doTrackView(properties,title,piwikId,location.href.split("?")[0] + "?" + pageparams);
|
||||||
|
}
|
||||||
|
}
|
||||||
trackView (properties:EnvProperties, title, siteId = null):any {
|
trackView (properties:EnvProperties, title, siteId = null):any {
|
||||||
|
|
||||||
let ua = this.getUserAgent();
|
|
||||||
let referrer = this.getReferrer();
|
|
||||||
let piwikId= ((siteId!=null)?siteId:properties.piwikSiteId);
|
let piwikId= ((siteId!=null)?siteId:properties.piwikSiteId);
|
||||||
if(typeof location !== 'undefined' && piwikId){
|
if(typeof location !== 'undefined' && piwikId){
|
||||||
var url = properties.piwikBaseUrl+piwikId+"&rec=1&url="+StringUtils.URIEncode(location.href)+"&action_name="+StringUtils.URIEncode(title)+
|
return this.doTrackView(properties,title,piwikId,location.href);
|
||||||
((ua != null && ua.length > 0)?('&ua='+StringUtils.URIEncode(ua)):'')+
|
|
||||||
((referrer != null && referrer.length > 0)?('&urlref='+StringUtils.URIEncode(referrer)):'');
|
|
||||||
//console.log("Piwik - View: " + url);
|
|
||||||
// return Observable.of(new Object()).mapTo(true); // for testing
|
|
||||||
return this.http.get( url, {responseType: 'blob'});
|
|
||||||
// .do(request => console.info("Piwik request completed" ));
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
private doTrackView (properties:EnvProperties, title, siteId, pageURL):any {
|
||||||
|
|
||||||
|
let ua = this.getUserAgent();
|
||||||
|
let referrer = this.getReferrer();
|
||||||
|
let piwikId= ((siteId!=null)?siteId:properties.piwikSiteId);
|
||||||
|
if(typeof location !== 'undefined' && piwikId){
|
||||||
|
console.log("Piwik - View: " + pageURL, title);
|
||||||
|
var url = properties.piwikBaseUrl+piwikId+"&rec=1&url="+StringUtils.URIEncode(pageURL)+"&action_name="+StringUtils.URIEncode(title)+
|
||||||
|
((ua != null && ua.length > 0)?('&ua='+StringUtils.URIEncode(ua)):'')+
|
||||||
|
((referrer != null && referrer.length > 0)?('&urlref='+StringUtils.URIEncode(referrer)):'');
|
||||||
|
console.log("Piwik - View: " + url);
|
||||||
|
// return Observable.of(new Object()); // for testing
|
||||||
|
return this.http.get( url, {responseType: 'blob'});
|
||||||
|
// .do(request => console.info("Piwik request completed" ));
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
trackDownload (properties:EnvProperties, type = "", siteId = null):any {
|
trackDownload (properties:EnvProperties, type = "", siteId = null):any {
|
||||||
var ua = this.getUserAgent();
|
var ua = this.getUserAgent();
|
||||||
var referrer = this.getReferrer();
|
var referrer = this.getReferrer();
|
||||||
|
|
Loading…
Reference in New Issue