use of ma.glasnost.orika.MapperFactory in project ORCID-Source by ORCID.
the class MapperFacadeFactory method getEducationMapperFacade.
public MapperFacade getEducationMapperFacade() {
MapperFactory mapperFactory = getNewMapperFactory();
ClassMapBuilder<Education, OrgAffiliationRelationEntity> educationClassMap = mapperFactory.classMap(Education.class, OrgAffiliationRelationEntity.class);
addV2CommonFields(educationClassMap);
registerSourceConverters(mapperFactory, educationClassMap);
educationClassMap.fieldBToA("org.name", "organization.name");
educationClassMap.fieldBToA("org.city", "organization.address.city");
educationClassMap.fieldBToA("org.region", "organization.address.region");
educationClassMap.fieldBToA("org.country", "organization.address.country");
educationClassMap.fieldBToA("org.orgDisambiguated.sourceId", "organization.disambiguatedOrganization.disambiguatedOrganizationIdentifier");
educationClassMap.fieldBToA("org.orgDisambiguated.sourceType", "organization.disambiguatedOrganization.disambiguationSource");
educationClassMap.fieldBToA("org.orgDisambiguated.id", "organization.disambiguatedOrganization.id");
educationClassMap.field("departmentName", "department");
educationClassMap.field("roleTitle", "title");
educationClassMap.register();
ClassMapBuilder<EducationSummary, OrgAffiliationRelationEntity> educationSummaryClassMap = mapperFactory.classMap(EducationSummary.class, OrgAffiliationRelationEntity.class);
addV2CommonFields(educationSummaryClassMap);
registerSourceConverters(mapperFactory, educationSummaryClassMap);
educationSummaryClassMap.fieldBToA("org.name", "organization.name");
educationSummaryClassMap.fieldBToA("org.city", "organization.address.city");
educationSummaryClassMap.fieldBToA("org.region", "organization.address.region");
educationSummaryClassMap.fieldBToA("org.country", "organization.address.country");
educationSummaryClassMap.fieldBToA("org.orgDisambiguated.sourceId", "organization.disambiguatedOrganization.disambiguatedOrganizationIdentifier");
educationSummaryClassMap.fieldBToA("org.orgDisambiguated.sourceType", "organization.disambiguatedOrganization.disambiguationSource");
educationSummaryClassMap.fieldBToA("org.orgDisambiguated.id", "organization.disambiguatedOrganization.id");
educationSummaryClassMap.field("departmentName", "department");
educationSummaryClassMap.field("roleTitle", "title");
educationSummaryClassMap.register();
mapFuzzyDateToStartDateEntityAndEndDateEntity(mapperFactory);
return mapperFactory.getMapperFacade();
}
use of ma.glasnost.orika.MapperFactory in project ORCID-Source by ORCID.
the class MapperFacadeFactory method getEmailMapperFacade.
public MapperFacade getEmailMapperFacade() {
MapperFactory mapperFactory = getNewMapperFactory();
ClassMapBuilder<Email, EmailEntity> emailClassMap = mapperFactory.classMap(Email.class, EmailEntity.class);
emailClassMap.byDefault();
emailClassMap.field("email", "id");
emailClassMap.field("primary", "primary");
emailClassMap.field("verified", "verified");
addV2DateFields(emailClassMap);
registerSourceConverters(mapperFactory, emailClassMap);
emailClassMap.register();
return mapperFactory.getMapperFacade();
}
use of ma.glasnost.orika.MapperFactory in project ORCID-Source by ORCID.
the class MapperFacadeFactory method getOtherNameMapperFacade.
public MapperFacade getOtherNameMapperFacade() {
MapperFactory mapperFactory = getNewMapperFactory();
ClassMapBuilder<OtherName, OtherNameEntity> otherNameClassMap = mapperFactory.classMap(OtherName.class, OtherNameEntity.class);
addV2DateFields(otherNameClassMap);
registerSourceConverters(mapperFactory, otherNameClassMap);
otherNameClassMap.field("putCode", "id");
otherNameClassMap.field("content", "displayName");
otherNameClassMap.field("path", "profile.orcid");
otherNameClassMap.fieldBToA("displayIndex", "displayIndex");
otherNameClassMap.byDefault();
otherNameClassMap.register();
return mapperFactory.getMapperFacade();
}
use of ma.glasnost.orika.MapperFactory in project ORCID-Source by ORCID.
the class MapperFacadeFactory method getEmploymentMapperFacade.
public MapperFacade getEmploymentMapperFacade() {
MapperFactory mapperFactory = getNewMapperFactory();
ClassMapBuilder<Employment, OrgAffiliationRelationEntity> classMap = mapperFactory.classMap(Employment.class, OrgAffiliationRelationEntity.class);
addV2CommonFields(classMap);
registerSourceConverters(mapperFactory, classMap);
classMap.fieldBToA("org.name", "organization.name");
classMap.fieldBToA("org.city", "organization.address.city");
classMap.fieldBToA("org.region", "organization.address.region");
classMap.fieldBToA("org.country", "organization.address.country");
classMap.fieldBToA("org.orgDisambiguated.sourceId", "organization.disambiguatedOrganization.disambiguatedOrganizationIdentifier");
classMap.fieldBToA("org.orgDisambiguated.sourceType", "organization.disambiguatedOrganization.disambiguationSource");
classMap.fieldBToA("org.orgDisambiguated.id", "organization.disambiguatedOrganization.id");
classMap.field("departmentName", "department");
classMap.field("roleTitle", "title");
classMap.register();
ClassMapBuilder<EmploymentSummary, OrgAffiliationRelationEntity> employmentSummaryClassMap = mapperFactory.classMap(EmploymentSummary.class, OrgAffiliationRelationEntity.class);
addV2CommonFields(employmentSummaryClassMap);
registerSourceConverters(mapperFactory, employmentSummaryClassMap);
employmentSummaryClassMap.fieldBToA("org.name", "organization.name");
employmentSummaryClassMap.fieldBToA("org.city", "organization.address.city");
employmentSummaryClassMap.fieldBToA("org.region", "organization.address.region");
employmentSummaryClassMap.fieldBToA("org.country", "organization.address.country");
employmentSummaryClassMap.fieldBToA("org.orgDisambiguated.sourceId", "organization.disambiguatedOrganization.disambiguatedOrganizationIdentifier");
employmentSummaryClassMap.fieldBToA("org.orgDisambiguated.sourceType", "organization.disambiguatedOrganization.disambiguationSource");
employmentSummaryClassMap.fieldBToA("org.orgDisambiguated.id", "organization.disambiguatedOrganization.id");
employmentSummaryClassMap.field("departmentName", "department");
employmentSummaryClassMap.field("roleTitle", "title");
employmentSummaryClassMap.register();
mapFuzzyDateToStartDateEntityAndEndDateEntity(mapperFactory);
return mapperFactory.getMapperFacade();
}
use of ma.glasnost.orika.MapperFactory in project ORCID-Source by ORCID.
the class MapperFacadeFactory method getNameMapperFacade.
public MapperFacade getNameMapperFacade() {
MapperFactory mapperFactory = getNewMapperFactory();
ClassMapBuilder<Name, RecordNameEntity> nameClassMap = mapperFactory.classMap(Name.class, RecordNameEntity.class);
addV2DateFields(nameClassMap);
nameClassMap.field("creditName.content", "creditName");
nameClassMap.field("givenNames.content", "givenNames");
nameClassMap.field("familyName.content", "familyName");
nameClassMap.field("path", "profile.id");
nameClassMap.byDefault();
nameClassMap.register();
return mapperFactory.getMapperFacade();
}
Aggregations