[Library|Trunk]

Update canonical url policy:
	for organizations & results
	instead of the dedup id put the first id of the merged records.



git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-services-library/trunk/ng-openaire-library/src/app@59293 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
argiro.kokogiannaki 2020-08-19 11:01:22 +00:00
parent 30fb2d9369
commit 530a441f4a
7 changed files with 20 additions and 3 deletions

View File

@ -680,4 +680,17 @@ export class ParsingFunctions {
});
return references;
}
static parseRelCanonicalId(record, type){
try{
if(record["result"]["metadata"]["oaf:entity"][("oaf:"+type)]["children"] && record["result"]["metadata"]["oaf:entity"][("oaf:"+type)]["children"][type]){
for(let child of record["result"]["metadata"]["oaf:entity"][("oaf:"+type)]["children"][type]){
return child["objidentifier"];
}
}
}catch(e){
// console.error(e);
}
return record["result"]["header"]["dri:objIdentifier"];
}
}

View File

@ -335,7 +335,7 @@ export class OrganizationComponent {
this.errorMessage = 'No organization found';
} else {
this.organizationInfo = data;
this.seoService.createLinkForCanonicalURL(this.properties.baseLink + this.properties.searchLinkToOrganization + this.organizationInfo.objIdentifier);
this.seoService.createLinkForCanonicalURL(this.properties.baseLink + this.properties.searchLinkToOrganization + this.organizationInfo.relcanId);
this.updateTitle((this.organizationInfo.title.name?this.organizationInfo.title.name:(this.organizationInfo.name?this.organizationInfo.name:'No title available')));
this.updateDescription("Organization, country, " +
(this.organizationInfo.title.name?this.organizationInfo.title.name:'No title available') +

View File

@ -323,7 +323,7 @@ export class ResultLandingComponent {
if (this.type == "result") { // no type was specified - update URL based this.resultLandingInfo.resultType
this.updateUrlWithType();
}
this.seoService.createLinkForCanonicalURL(this.properties.baseLink + this.linkToLandingPage + this.resultLandingInfo.record["result"]["header"]["dri:objIdentifier"]);
this.seoService.createLinkForCanonicalURL(this.properties.baseLink + this.linkToLandingPage + this.resultLandingInfo.relcanId);
if ((this.type == "publication") && (this.properties.environment == "beta" || this.properties.environment == "development") && (typeof document !== 'undefined')) {
this.getOpenCitations();
}

View File

@ -85,6 +85,7 @@ export class ResultLandingService {
// res
this.resultLandingInfo.record = data[14];
this.resultLandingInfo.relcanId = ParsingFunctions.parseRelCanonicalId(this.resultLandingInfo.record, "result");
this.resultLandingInfo.resultType = data[0].resulttype.classid;
// res['result']['metadata']['oaf:entity']['oaf:result']

View File

@ -8,6 +8,7 @@ import {OrganizationInfo} from '../utils/entities/organizationInfo';
import{EnvProperties} from '../utils/properties/env-properties';
import {map} from "rxjs/operators";
import {ParsingFunctions} from "../landingPages/landing-utils/parsingFunctions.class";
@Injectable()
export class OrganizationService {
@ -48,7 +49,7 @@ export class OrganizationService {
parseOrganizationInfo (data: any):any {
this.organizationInfo = new OrganizationInfo();
this.organizationInfo.relcanId = ParsingFunctions.parseRelCanonicalId(data,"organization");
let organization;
let relations;
if(data != null) {

View File

@ -14,6 +14,7 @@ export interface OrganizationProject {
}
export class OrganizationInfo {
relcanId;
title: { name: string; url: string; };
name: string;
country: string;

View File

@ -19,6 +19,7 @@ export interface Reference {
}
export class ResultLandingInfo {
relcanId;
// PUBLICATION, DATASET, SOFTWARE, ORP
record;
resultType: "publication"|"dataset"|"other"|"software";