[Trunk | Library]:
1. resultLandingInfo.ts: In "contexts" field add: "idContext": string, "idCategory": string, "idConcept": string (needed for enermaps). 2. parsingFunctions.class.ts: In method "parseContexts()", parse also these new id fields. git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-services-library/trunk/ng-openaire-library/src/app@60780 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
parent
1d358d65fb
commit
43cc10d32b
|
@ -543,12 +543,14 @@ export class ParsingFunctions {
|
|||
}
|
||||
|
||||
parseContexts(_contexts: any): {
|
||||
"labelContext": string, "labelCategory": string,
|
||||
"labelConcept": string, inline: boolean
|
||||
"labelContext": string, "idContext": string,
|
||||
"labelCategory": string, "idCategory": string,
|
||||
"labelConcept": string, "idConcept": string, inline: boolean
|
||||
}[] {
|
||||
let contexts = new Array<{
|
||||
"labelContext": string, "labelCategory": string,
|
||||
"labelConcept": string, inline: boolean
|
||||
"labelContext": string, "idContext": string,
|
||||
"labelCategory": string, "idCategory": string,
|
||||
"labelConcept": string, "idConcept": string, inline: boolean
|
||||
}>();
|
||||
|
||||
let position = 0;
|
||||
|
@ -570,26 +572,41 @@ export class ParsingFunctions {
|
|||
for (let j = 0; j < length1; j++) {
|
||||
categoryConcept = Array.isArray(category['concept']) ? category['concept'][j] : category['concept'];
|
||||
|
||||
contexts[position] = {"labelContext": "", "labelCategory": "", "labelConcept": "", inline: false};
|
||||
contexts[position] = {"labelContext": "", "idContext": "",
|
||||
"labelCategory": "", "idCategory": "",
|
||||
"labelConcept": "", "idConcept": "", inline: false};
|
||||
contexts[position]['labelContext'] = context.label;
|
||||
contexts[position]['idContext'] = context.id;
|
||||
contexts[position]['labelCategory'] = category.label;
|
||||
contexts[position]['idCategory'] = category.id;
|
||||
contexts[position]['labelConcept'] = categoryConcept.label;
|
||||
|
||||
contexts[position]['idConcept'] = categoryConcept.id;
|
||||
|
||||
position++;
|
||||
}
|
||||
} else {
|
||||
contexts[position] = {"labelContext": "", "labelCategory": "", "labelConcept": "", inline: false};
|
||||
contexts[position] = {"labelContext": "", "idContext": "",
|
||||
"labelCategory": "", "idCategory": "",
|
||||
"labelConcept": "", "idConcept": "", inline: false};
|
||||
contexts[position]['labelContext'] = context.label;
|
||||
contexts[position]['idContext'] = context.id;
|
||||
contexts[position]['labelCategory'] = category.label;
|
||||
contexts[position]['idCategory'] = category.id;
|
||||
contexts[position]['labelConcept'] = null;
|
||||
contexts[position]['idConcept'] = null;
|
||||
position++;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
contexts[position] = {"labelContext": "", "labelCategory": "", "labelConcept": "", inline: false};
|
||||
contexts[position] = {"labelContext": "", "idContext": "",
|
||||
"labelCategory": "", "idCategory": "",
|
||||
"labelConcept": "", "idConcept": "", inline: false};
|
||||
contexts[position]['labelContext'] = context.label;
|
||||
contexts[position]['idContext'] = context.id;
|
||||
contexts[position]['labelCategory'] = null;
|
||||
contexts[position]['idCategory'] = null;
|
||||
contexts[position]['labelConcept'] = null;
|
||||
contexts[position]['idConcept'] = null;
|
||||
contexts[position]['new'] = false;
|
||||
position++;
|
||||
}
|
||||
|
@ -609,7 +626,7 @@ export class ParsingFunctions {
|
|||
|
||||
parseLanguages(_languages: any) {
|
||||
var languages = new Array<string>();
|
||||
|
||||
|
||||
if (!Array.isArray(_languages)) {
|
||||
if (_languages.classname != "Undetermined" && _languages.classname) {
|
||||
languages.push(_languages.classname);
|
||||
|
|
|
@ -59,7 +59,9 @@ export class ResultLandingInfo {
|
|||
//isSupplementTo
|
||||
supplementedByResearchResults: RelationResult[];
|
||||
|
||||
contexts: { "labelContext": string, "labelCategory": string, "labelConcept": string, "inline": boolean }[];
|
||||
contexts: { "labelContext": string, "idContext": string,
|
||||
"labelCategory": string, "idCategory": string,
|
||||
"labelConcept": string, "idConcept": string, "inline": boolean }[];
|
||||
|
||||
deletedByInferenceIds: string[];
|
||||
|
||||
|
|
Loading…
Reference in New Issue