* refactored author info pars
This commit is contained in:
parent
8afe19deb1
commit
51c6f65b29
|
|
@ -158,25 +158,19 @@ class Importer {
|
||||||
const splitted_initials = initials.split(/[\s.]+/).filter(Boolean);
|
const splitted_initials = initials.split(/[\s.]+/).filter(Boolean);
|
||||||
// console.log(initials, '||', splitted_initials);
|
// console.log(initials, '||', splitted_initials);
|
||||||
|
|
||||||
const first_name = splitted_initials[0];
|
info.firstName = splitted_initials[0];
|
||||||
info["firstName"] = first_name;
|
|
||||||
|
|
||||||
const middle_name =
|
info.middleName = splitted_initials.length > 1 ? splitted_initials[1] : "";
|
||||||
splitted_initials.length > 1 ? splitted_initials[1] : "";
|
|
||||||
info["middleName"] = middle_name;
|
|
||||||
|
|
||||||
const surname = $individInfo.find("surname").text();
|
info.lastName = $individInfo.find("surname").text();
|
||||||
info["lastName"] = surname;
|
|
||||||
|
|
||||||
const organization = $individInfo.find("orgName").text();
|
const organization = $individInfo.find("orgName").text();
|
||||||
const address = $individInfo.find("address").text();
|
const address = $individInfo.find("address").text();
|
||||||
info["affiliation[ru_RU]"] = organization + " " + address;
|
info.affiliation = organization + " " + address;
|
||||||
|
|
||||||
const bio = $individInfo.find("otherInfo").text();
|
info.biography = $individInfo.find("otherInfo").text();
|
||||||
info["biography[ru_RU]"] = bio;
|
|
||||||
|
|
||||||
const email = $individInfo.find("email").text();
|
info.email = $individInfo.find("email").text();
|
||||||
info["email"] = email;
|
|
||||||
|
|
||||||
return info;
|
return info;
|
||||||
}
|
}
|
||||||
|
|
@ -212,7 +206,16 @@ class Importer {
|
||||||
const $individInfo_rus = $author.find("individInfo[lang=RUS]");
|
const $individInfo_rus = $author.find("individInfo[lang=RUS]");
|
||||||
const $individInfo_eng = $author.find("individInfo[lang=ENG]");
|
const $individInfo_eng = $author.find("individInfo[lang=ENG]");
|
||||||
|
|
||||||
const authorInfo = this.getAuthorInfo($individInfo_rus);
|
const authorInfo_rus = this.getAuthorInfo($individInfo_rus);
|
||||||
|
|
||||||
|
var authorInfo = {};
|
||||||
|
authorInfo.firstName = authorInfo_rus.firstName;
|
||||||
|
authorInfo.middleName = authorInfo_rus.middleName;
|
||||||
|
authorInfo.lastName = authorInfo_rus.lastName;
|
||||||
|
authorInfo.email = authorInfo_rus.email;
|
||||||
|
|
||||||
|
authorInfo['affiliation[ru_RU]'] = authorInfo_rus.affiliation;
|
||||||
|
authorInfo['biography[ru_RU]'] = authorInfo_rus.biography;
|
||||||
authorInfoCollection.push(authorInfo);
|
authorInfoCollection.push(authorInfo);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -84,8 +84,10 @@ module.exports = {
|
||||||
'suffix': '',
|
'suffix': '',
|
||||||
'userUrl': '',
|
'userUrl': '',
|
||||||
'orcid': '',
|
'orcid': '',
|
||||||
'affiliation[ru_RU]': 'org',
|
'affiliation[ru_RU]': '',
|
||||||
'biography[ru_RU]': '',
|
'biography[ru_RU]': '',
|
||||||
|
'affiliation[en_US]': '',
|
||||||
|
'biography[en_US]': '',
|
||||||
'userGroupId': '',
|
'userGroupId': '',
|
||||||
'includeInBrowse': 'on',
|
'includeInBrowse': 'on',
|
||||||
},
|
},
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user