Revision 59303
Added by Konstantina Galouni over 3 years ago
parsingFunctions.class.ts | ||
---|---|---|
599 | 599 |
} |
600 | 600 |
|
601 | 601 |
parseTypes(types: string[], uniqueTypes: Set<string>, instance: any) { |
602 |
if (instance.hasOwnProperty("instancetype") && instance['instancetype'].classname) { |
|
602 |
if (instance && instance.hasOwnProperty("instancetype") && instance['instancetype'].classname) {
|
|
603 | 603 |
if (!uniqueTypes.has(instance['instancetype'].classname)) { |
604 | 604 |
types.push(instance['instancetype'].classname); |
605 | 605 |
uniqueTypes.add(instance['instancetype'].classname); |
... | ... | |
680 | 680 |
}); |
681 | 681 |
return references; |
682 | 682 |
} |
683 |
static parseRelCanonicalId(record, type){ |
|
684 |
try{ |
|
685 |
if(record["result"]["metadata"]["oaf:entity"][("oaf:"+type)]["children"] && record["result"]["metadata"]["oaf:entity"][("oaf:"+type)]["children"][type]){ |
|
686 |
for(let child of record["result"]["metadata"]["oaf:entity"][("oaf:"+type)]["children"][type]){ |
|
687 |
return child["objidentifier"]; |
|
688 |
} |
|
689 |
} |
|
690 |
}catch(e){ |
|
691 |
// console.error(e); |
|
692 |
} |
|
693 |
return record["result"]["header"]["dri:objIdentifier"]; |
|
694 |
|
|
695 |
} |
|
683 | 696 |
} |
Also available in: Unified diff
[use-UoaAdminToolsLibrary | Library]: Merge trunk into branch.