Search in sources :

Example 26 with Source

use of hex.glm.GLM2.Source in project ORCID-Source by ORCID.

the class OtherNameForm method toOtherName.

public OtherName toOtherName() {
    OtherName otherName = new OtherName();
    if (!PojoUtil.isEmpty(this.getContent())) {
        otherName.setContent(this.getContent());
    }
    if (this.visibility != null && this.visibility.getVisibility() != null) {
        otherName.setVisibility(org.orcid.jaxb.model.common_v2.Visibility.fromValue(this.getVisibility().getVisibility().value()));
    }
    if (!PojoUtil.isEmpty(this.getPutCode())) {
        otherName.setPutCode(Long.valueOf(this.getPutCode()));
    }
    if (displayIndex != null) {
        otherName.setDisplayIndex(displayIndex);
    } else {
        otherName.setDisplayIndex(0L);
    }
    otherName.setSource(new Source(source));
    return otherName;
}
Also used : OtherName(org.orcid.jaxb.model.record_v2.OtherName) Source(org.orcid.jaxb.model.common_v2.Source)

Example 27 with Source

use of hex.glm.GLM2.Source in project ORCID-Source by ORCID.

the class JpaJaxbNameAdapterTest method fromNameToRecordNameEntityTest.

@Test
public void fromNameToRecordNameEntityTest() throws JAXBException {
    Name name = new Name();
    name.setCreditName(new CreditName("Credit Name"));
    name.setFamilyName(new FamilyName("Family Name"));
    name.setGivenNames(new GivenNames("Given Names"));
    name.setPath("0000-0000-0000-0000");
    name.setVisibility(Visibility.PUBLIC);
    name.setSource(new Source("0000-0000-0000-0000"));
    RecordNameEntity entity = adapter.toRecordNameEntity(name);
    assertNotNull(entity);
    assertEquals("Credit Name", entity.getCreditName());
    assertEquals("Family Name", entity.getFamilyName());
    assertEquals("Given Names", entity.getGivenNames());
    assertEquals(Visibility.PUBLIC, entity.getVisibility());
    assertNotNull(entity.getProfile());
    assertEquals("0000-0000-0000-0000", entity.getProfile().getId());
}
Also used : FamilyName(org.orcid.jaxb.model.record_v2.FamilyName) GivenNames(org.orcid.jaxb.model.record_v2.GivenNames) CreditName(org.orcid.jaxb.model.common_v2.CreditName) RecordNameEntity(org.orcid.persistence.jpa.entities.RecordNameEntity) Source(org.orcid.jaxb.model.common_v2.Source) FamilyName(org.orcid.jaxb.model.record_v2.FamilyName) CreditName(org.orcid.jaxb.model.common_v2.CreditName) Name(org.orcid.jaxb.model.record_v2.Name) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)17 Source (org.orcid.jaxb.model.common_v2.Source)16 Source (hex.glm.GLM2.Source)11 SourceClientId (org.orcid.jaxb.model.common_v2.SourceClientId)5 SourceName (org.orcid.jaxb.model.common_v2.SourceName)3 Items (org.orcid.jaxb.model.notification.permission_v2.Items)3 NotificationPermission (org.orcid.jaxb.model.notification.permission_v2.NotificationPermission)3 ExternalID (org.orcid.jaxb.model.record_v2.ExternalID)3 File (java.io.File)2 ArrayList (java.util.ArrayList)2 DisambiguatedOrganization (org.orcid.jaxb.model.common_v2.DisambiguatedOrganization)2 LastModifiedDate (org.orcid.jaxb.model.common_v2.LastModifiedDate)2 Organization (org.orcid.jaxb.model.common_v2.Organization)2 OrganizationAddress (org.orcid.jaxb.model.common_v2.OrganizationAddress)2 NotificationAmended (org.orcid.jaxb.model.notification.amended_v2.NotificationAmended)2 AuthorizationUrl (org.orcid.jaxb.model.notification.permission_v2.AuthorizationUrl)2 Item (org.orcid.jaxb.model.notification.permission_v2.Item)2 Notification (org.orcid.jaxb.model.notification_v2.Notification)2 ExternalIDs (org.orcid.jaxb.model.record_v2.ExternalIDs)2 NotificationEntity (org.orcid.persistence.jpa.entities.NotificationEntity)2