[Library|Trunk]

Properties
	add link to software landing page

Rel Canonical change:
In landing pages:
	for results: use the objIdentifier in relcan (in case the request is from a dedup id)
	in all landing: when the record not found use the simple search link tfor the relcan
	



git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-services-library/trunk/ng-openaire-library/src/app@55949 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
argiro.kokogiannaki 2019-06-03 08:53:57 +00:00
parent 10ed032ead
commit 2dd9935734
10 changed files with 20 additions and 20 deletions

View File

@ -129,7 +129,6 @@ export class DataProviderComponent {
.subscribe((data: { envSpecific: EnvProperties }) => { .subscribe((data: { envSpecific: EnvProperties }) => {
this.properties = data.envSpecific; this.properties = data.envSpecific;
this.updateUrl(data.envSpecific.baseLink+this._router.url); this.updateUrl(data.envSpecific.baseLink+this._router.url);
this.seoService.createLinkForCanonicalURL(this.properties.baseLink+this._router.url);
}); });
this.sub = this.route.queryParams.subscribe(data => { this.sub = this.route.queryParams.subscribe(data => {
@ -174,7 +173,7 @@ export class DataProviderComponent {
this.subInfo = this._dataproviderService.getDataproviderInfo(this.datasourceId, this.properties).subscribe( this.subInfo = this._dataproviderService.getDataproviderInfo(this.datasourceId, this.properties).subscribe(
data => { data => {
this.dataProviderInfo = data; this.dataProviderInfo = data;
this.seoService.createLinkForCanonicalURL(this.properties.baseLink+this._router.url);
this.getDataProviderAggregationStatus(this.dataProviderInfo.originalId); this.getDataProviderAggregationStatus(this.dataProviderInfo.originalId);
this.initTabs(); this.initTabs();
@ -196,6 +195,7 @@ export class DataProviderComponent {
this.handleError("Error getting content provider for id: "+this.datasourceId, err); this.handleError("Error getting content provider for id: "+this.datasourceId, err);
this.errorMessage = 'No dataProvider found'; this.errorMessage = 'No dataProvider found';
this.showLoading = false; this.showLoading = false;
this.seoService.createLinkForCanonicalURL(this.properties.baseLink + this.properties.searchLinkToDataProviders);
} }
); );
} }

View File

@ -76,7 +76,6 @@ export class DatasetComponent {
.subscribe((data: { envSpecific: EnvProperties }) => { .subscribe((data: { envSpecific: EnvProperties }) => {
this.properties = data.envSpecific; this.properties = data.envSpecific;
this.updateUrl(data.envSpecific.baseLink+this._router.url); this.updateUrl(data.envSpecific.baseLink+this._router.url);
this.seoService.createLinkForCanonicalURL(this.properties.baseLink+this._router.url);
}); });
this.sub = this.route.queryParams.subscribe(params => { this.sub = this.route.queryParams.subscribe(params => {
@ -129,6 +128,7 @@ export class DatasetComponent {
this.infoSub = this._datasetService.getDatasetInfo(id, this. properties).subscribe( this.infoSub = this._datasetService.getDatasetInfo(id, this. properties).subscribe(
data => { data => {
this.datasetInfo = data; this.datasetInfo = data;
this.seoService.createLinkForCanonicalURL(this.properties.baseLink + this.properties.searchLinkToDataset + this.datasetInfo.record["result"]["header"]["dri:objIdentifier"]);
/* /*
if(this.datasetInfo.title.name != undefined && this.datasetInfo.title.name!= ''){ if(this.datasetInfo.title.name != undefined && this.datasetInfo.title.name!= ''){
this.updateTitle(this.datasetInfo.title.name); this.updateTitle(this.datasetInfo.title.name);
@ -159,7 +159,7 @@ export class DatasetComponent {
err => { err => {
//console.log(err) //console.log(err)
this.handleError("Error getting research data for id: "+this.datasetId, err); this.handleError("Error getting research data for id: "+this.datasetId, err);
this.seoService.createLinkForCanonicalURL(this.properties.baseLink + this.properties.searchLinkToDatasets);
this.errorMessage = 'No research data found'; this.errorMessage = 'No research data found';
this.showLoading = false; this.showLoading = false;
} }

View File

@ -126,7 +126,6 @@ export class OrganizationComponent {
.subscribe((data: { envSpecific: EnvProperties }) => { .subscribe((data: { envSpecific: EnvProperties }) => {
this.properties = data.envSpecific; this.properties = data.envSpecific;
this.updateUrl(data.envSpecific.baseLink+this._router.url); this.updateUrl(data.envSpecific.baseLink+this._router.url);
this.seoService.createLinkForCanonicalURL(this.properties.baseLink+this._router.url);
}); });
this.sub = this.route.queryParams.subscribe(params => { this.sub = this.route.queryParams.subscribe(params => {
this.organizationInfo=null; this.organizationInfo=null;
@ -203,7 +202,8 @@ export class OrganizationComponent {
this.errorMessage = 'No organization found'; this.errorMessage = 'No organization found';
} else { } else {
this.organizationInfo = data; this.organizationInfo = data;
this.updateTitle(this.organizationInfo.title.name); this.seoService.createLinkForCanonicalURL(this.properties.baseLink+this._router.url);
this.updateTitle(this.organizationInfo.title.name);
this.updateDescription("Organization, country, "+this.organizationInfo.title.name +((this.organizationInfo.title.name && this.organizationInfo.title.name != this.organizationInfo.name)?(", "+this.organizationInfo.name):"") ); this.updateDescription("Organization, country, "+this.organizationInfo.title.name +((this.organizationInfo.title.name && this.organizationInfo.title.name != this.organizationInfo.name)?(", "+this.organizationInfo.name):"") );
if(this.properties.enablePiwikTrack && (typeof document !== 'undefined')){ if(this.properties.enablePiwikTrack && (typeof document !== 'undefined')){
this.piwiksub = this._piwikService.trackView(this.properties, this.organizationInfo.title.name, this.piwikSiteId).subscribe(); this.piwiksub = this._piwikService.trackView(this.properties, this.organizationInfo.title.name, this.piwikSiteId).subscribe();
@ -235,7 +235,7 @@ export class OrganizationComponent {
err => { err => {
//console.log(err) //console.log(err)
this.handleError("Error getting organization for id: "+this.organizationId, err); this.handleError("Error getting organization for id: "+this.organizationId, err);
this.seoService.createLinkForCanonicalURL(this.properties.baseLink + this.properties.searchLinkToOrganizations);
this.errorMessage = 'No organization found'; this.errorMessage = 'No organization found';
this.showLoading = false; this.showLoading = false;
} }

View File

@ -76,7 +76,6 @@ export class OrpComponent {
.subscribe((data: { envSpecific: EnvProperties }) => { .subscribe((data: { envSpecific: EnvProperties }) => {
this.properties = data.envSpecific; this.properties = data.envSpecific;
this.updateUrl(data.envSpecific.baseLink+this._router.url); this.updateUrl(data.envSpecific.baseLink+this._router.url);
this.seoService.createLinkForCanonicalURL(this.properties.baseLink+this._router.url);
}); });
this.sub = this.route.queryParams.subscribe(params => { this.sub = this.route.queryParams.subscribe(params => {
@ -125,6 +124,7 @@ export class OrpComponent {
this.infoSub = this._orpService.getOrpInfo(id, this. properties).subscribe( this.infoSub = this._orpService.getOrpInfo(id, this. properties).subscribe(
data => { data => {
this.orpInfo = data; this.orpInfo = data;
this.seoService.createLinkForCanonicalURL(this.properties.baseLink + this.properties.searchLinkToOrp + this.orpInfo.record["result"]["header"]["dri:objIdentifier"]);
if(this.orpInfo.title){ if(this.orpInfo.title){
this.updateTitle(this.orpInfo.title); this.updateTitle(this.orpInfo.title);
this.updateDescription((this.orpInfo.description?(this.orpInfo.description):(","+this.orpInfo.title))); this.updateDescription((this.orpInfo.description?(this.orpInfo.description):(","+this.orpInfo.title)));
@ -149,7 +149,7 @@ export class OrpComponent {
err => { err => {
//console.log(err) //console.log(err)
this.handleError("Error getting other research product for id: "+this.orpId, err); this.handleError("Error getting other research product for id: "+this.orpId, err);
this.seoService.createLinkForCanonicalURL(this.properties.baseLink + this.properties.searchLinkToOrps);
this.errorMessage = 'No research product found'; this.errorMessage = 'No research product found';
this.showLoading = false; this.showLoading = false;
} }

View File

@ -136,7 +136,6 @@ properties:EnvProperties;
this.updateTitle(title); this.updateTitle(title);
this.updateDescription(description); this.updateDescription(description);
this.seoService.createLinkForCanonicalURL(this.properties.baseLink+this._router.url);
this.projectId = params['projectId']; this.projectId = params['projectId'];
var grantId = params['grantId']; var grantId = params['grantId'];
var funder = params['funder']; var funder = params['funder'];
@ -318,7 +317,7 @@ actionsAfterLoadId(){
err => { err => {
//console.log(err); //console.log(err);
this.handleError("Error getting project for id: "+this.projectId, err); this.handleError("Error getting project for id: "+this.projectId, err);
this.seoService.createLinkForCanonicalURL(this.properties.baseLink + this.properties.searchLinkToProjects);
this.errorMessage = 'No project found'; this.errorMessage = 'No project found';
this.showLoading = false; this.showLoading = false;
} }
@ -343,7 +342,7 @@ actionsAfterLoadId(){
err => { err => {
//console.log(err); //console.log(err);
this.handleError("Error getting project for grant id: "+grantId+" and funder: "+funder, err); this.handleError("Error getting project for grant id: "+grantId+" and funder: "+funder, err);
this.seoService.createLinkForCanonicalURL(this.properties.baseLink + this.properties.searchLinkToProjects);
this.errorMessage = 'No project found'; this.errorMessage = 'No project found';
this.showLoading = false; this.showLoading = false;
} }
@ -354,6 +353,7 @@ actionsAfterGettingProjectInfo(){
if(this.projectName == undefined || this.projectName == '') { if(this.projectName == undefined || this.projectName == '') {
this.projectName = this.projectInfo.title; this.projectName = this.projectInfo.title;
} }
this.seoService.createLinkForCanonicalURL(this.properties.baseLink+this._router.url);
this.updateTitle(this.projectName); this.updateTitle(this.projectName);
this.updateDescription("project, "+this.projectName+ ","+this.projectInfo.funder+","+this.projectInfo.acronym); this.updateDescription("project, "+this.projectName+ ","+this.projectInfo.funder+","+this.projectInfo.acronym);
if(this.properties.enablePiwikTrack && (typeof document !== 'undefined')){ if(this.properties.enablePiwikTrack && (typeof document !== 'undefined')){

View File

@ -94,7 +94,6 @@ export class PublicationComponent {
this.publicationInfo = null; this.publicationInfo = null;
this.updateTitle("Publication"); this.updateTitle("Publication");
this.updateDescription(""); this.updateDescription("");
this.seoService.createLinkForCanonicalURL(this.properties.baseLink+this._router.url);
this.articleId = data['articleId']; this.articleId = data['articleId'];
this.metricsClicked = false; this.metricsClicked = false;
@ -152,7 +151,7 @@ export class PublicationComponent {
this.infoSub = this._publicationService.getPublicationInfo(this.articleId, this.properties).subscribe( this.infoSub = this._publicationService.getPublicationInfo(this.articleId, this.properties).subscribe(
data => { data => {
this.publicationInfo = data; this.publicationInfo = data;
this.seoService.createLinkForCanonicalURL(this.properties.baseLink + this.properties.searchLinkToPublication + this.publicationInfo.record["result"]["header"]["dri:objIdentifier"]);
if((this.properties.environment == "beta" || this.properties.environment == "development") && (typeof document !== 'undefined')) { if((this.properties.environment == "beta" || this.properties.environment == "development") && (typeof document !== 'undefined')) {
this.getOpenCitations(this.articleId); this.getOpenCitations(this.articleId);
} }
@ -219,6 +218,7 @@ export class PublicationComponent {
this.errorMessage = 'No publication found'; this.errorMessage = 'No publication found';
this.showLoading = false; this.showLoading = false;
this.seoService.createLinkForCanonicalURL(this.properties.baseLink + this.properties.searchLinkToPublications);
} }
); );
} }

View File

@ -71,7 +71,6 @@ export class SoftwareComponent {
.subscribe((data: { envSpecific: EnvProperties }) => { .subscribe((data: { envSpecific: EnvProperties }) => {
this.properties = data.envSpecific; this.properties = data.envSpecific;
this.updateUrl(data.envSpecific.baseLink+this._router.url); this.updateUrl(data.envSpecific.baseLink+this._router.url);
this.seoService.createLinkForCanonicalURL(this.properties.baseLink+this._router.url);
}); });
this.sub = this.route.queryParams.subscribe(params => { this.sub = this.route.queryParams.subscribe(params => {
@ -124,6 +123,7 @@ export class SoftwareComponent {
this.infoSub = this._softwareService.getSoftwareInfo(id, this.properties).subscribe( this.infoSub = this._softwareService.getSoftwareInfo(id, this.properties).subscribe(
data => { data => {
this.softwareInfo = data; this.softwareInfo = data;
this.seoService.createLinkForCanonicalURL(this.properties.baseLink + this.properties.searchLinkToSoftwareLanding + this.softwareInfo.record["result"]["header"]["dri:objIdentifier"]);
/*if(this.softwareInfo.title.name != undefined && this.softwareInfo.title.name!= ''){ /*if(this.softwareInfo.title.name != undefined && this.softwareInfo.title.name!= ''){
this.updateTitle(this.softwareInfo.title.name); this.updateTitle(this.softwareInfo.title.name);
this.updateDescription("Software, search, repositories, open access,"+this.softwareInfo.title.name); this.updateDescription("Software, search, repositories, open access,"+this.softwareInfo.title.name);
@ -152,7 +152,7 @@ export class SoftwareComponent {
err => { err => {
//console.log(err) //console.log(err)
this.handleError("Error getting software for id: "+this.softwareId, err); this.handleError("Error getting software for id: "+this.softwareId, err);
this.seoService.createLinkForCanonicalURL(this.properties.baseLink + this.properties.searchLinkToSoftware);
this.errorMessage = 'No software found'; this.errorMessage = 'No software found';
this.showLoading = false; this.showLoading = false;
} }

View File

@ -11,10 +11,8 @@ export class SEOService {
createLinkForCanonicalURL(url:string, addParameters:boolean=true) { createLinkForCanonicalURL(url:string, addParameters:boolean=true) {
if(this.doc && (typeof this.doc.getElementById === "function" || typeof this.doc.createElement === "function") ){ if(this.doc && (typeof this.doc.getElementById === "function" || typeof this.doc.createElement === "function") ){
if(addParameters || !this.doc.URL || this.doc.URL.indexOf("?") == -1){ if(!addParameters && url && url.indexOf("?") != -1){
url = this.doc.URL; url = url.substring(0,url.indexOf("?"));
}else{
url = this.doc.URL.substring(0,this.doc.URL.indexOf("?"));
} }
if (typeof this.doc.getElementById === "function") { if (typeof this.doc.getElementById === "function") {
let currentLink: HTMLLinkElement = this.doc.getElementById("relcan"); let currentLink: HTMLLinkElement = this.doc.getElementById("relcan");

View File

@ -3,6 +3,7 @@ export class OrganizationInfo {
name: string; name: string;
country: string; country: string;
projects: Map<string, { "name": string, "id":string, "code": string, projects: Map<string, { "name": string, "id":string, "code": string,
"acronym": string, "funder": string, "funderId": string, "acronym": string, "funder": string, "funderId": string,
"fundingStream": string, "fundingLevel1": string, "fundingLevel2": string, "fundingStream": string, "fundingLevel1": string, "fundingLevel2": string,

View File

@ -106,6 +106,7 @@ export class EnvProperties {
searchLinkToProject; searchLinkToProject;
searchLinkToDataProvider; searchLinkToDataProvider;
searchLinkToDataset; searchLinkToDataset;
searchLinkToSoftwareLanding;
searchLinkToOrp; searchLinkToOrp;
searchLinkToOrganization; searchLinkToOrganization;
//Search pages //Search pages