Package org.dspace.authority.orcid.model

Examples of org.dspace.authority.orcid.model.BioName


            log.error("Error in finding the country in bio xml.", e);
        }
    }

    protected void setPersonalDetails(Node xml, Bio bio) {
        BioName name = bio.getName();

        try {
            String givenNames = XMLUtils.getTextContent(xml, GIVEN_NAMES);
            name.setGivenNames(givenNames);
        } catch (XPathExpressionException e) {
            log.error("Error in finding the given names in bio xml.", e);
        }

        try {
            String familyName = XMLUtils.getTextContent(xml, FAMILY_NAME);
            name.setFamilyName(familyName);
        } catch (XPathExpressionException e) {
            log.error("Error in finding the family name in bio xml.", e);
        }

        try {
            String creditName = XMLUtils.getTextContent(xml, CREDIT_NAME);
            name.setCreditName(creditName);
        } catch (XPathExpressionException e) {
            log.error("Error in finding the credit name in bio xml.", e);
        }

        try {

            Iterator<Node> iterator = XMLUtils.getNodeListIterator(xml, OTHER_NAME);
            while (iterator.hasNext()) {
                Node otherName = iterator.next();
                String textContent = otherName.getTextContent();
                name.getOtherNames().add(textContent.trim());
            }

        } catch (XPathExpressionException e) {
            log.error("Error in finding the other names in bio xml.", e);
        }
View Full Code Here


        return authority;
    }

    public boolean setValues(Bio bio) {
        BioName name = bio.getName();

        if (updateValue(bio.getOrcid(), getOrcid_id())) {
            setOrcid_id(bio.getOrcid());
        }

        if (updateValue(name.getFamilyName(), getLastName())) {
            setLastName(name.getFamilyName());
        }

        if (updateValue(name.getGivenNames(), getFirstName())) {
            setFirstName(name.getGivenNames());
        }

        if (StringUtils.isNotBlank(name.getCreditName())) {
            if (!getNameVariants().contains(name.getCreditName())) {
                addNameVariant(name.getCreditName());
                update = true;
            }
        }
        for (String otherName : name.getOtherNames()) {
            if (!getNameVariants().contains(otherName)) {
                addNameVariant(otherName);
                update = true;
            }
        }
View Full Code Here

TOP

Related Classes of org.dspace.authority.orcid.model.BioName

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.