use of oasis.names.tc.ebxml_regrep.xsd.rim._3.PersonType in project ddf by codice.
the class RegistryPackageWebConverterTest method getFirstPerson.
private PersonType getFirstPerson() {
PersonType person = RIM_FACTORY.createPersonType();
person.setId("urn:contact:id0");
person.setPersonName(getPersonName("john", "doe", "middleName"));
person.getTelephoneNumber().add(getPhoneNumber("111", "country", "1234", "111-1111", "cell phone"));
person.getEmailAddress().add(getEmailAddress("emailaddress@something.com", null));
person.getAddress().add(getAddress("Phoenix", "USA", "85037", "AZ", "1234 Some Street", "1234"));
return person;
}
use of oasis.names.tc.ebxml_regrep.xsd.rim._3.PersonType in project ddf by codice.
the class RegistryPackageTypeHelper method populateLists.
private void populateLists() {
serviceBindings.clear();
services.clear();
extrinsicObjects.clear();
organizations.clear();
persons.clear();
associations.clear();
if (registryPackageType == null) {
return;
}
if (registryPackageType.isSetRegistryObjectList()) {
RegistryObjectListType registryObjectList = registryPackageType.getRegistryObjectList();
for (JAXBElement<? extends IdentifiableType> identifiableType : registryObjectList.getIdentifiable()) {
RegistryObjectType registryObject = (RegistryObjectType) identifiableType.getValue();
if (registryObject instanceof ExtrinsicObjectType) {
extrinsicObjects.add((ExtrinsicObjectType) registryObject);
} else if (registryObject instanceof ServiceType) {
ServiceType service = (ServiceType) registryObject;
services.add(service);
serviceBindings.addAll(service.getServiceBinding());
} else if (registryObject instanceof OrganizationType) {
organizations.add((OrganizationType) registryObject);
} else if (registryObject instanceof PersonType) {
persons.add((PersonType) registryObject);
} else if (registryObject instanceof AssociationType1) {
associations.add((AssociationType1) registryObject);
}
}
}
}
use of oasis.names.tc.ebxml_regrep.xsd.rim._3.PersonType in project ddf by codice.
the class RegistryPackageWebConverterTest method getSecondPerson.
private PersonType getSecondPerson() {
PersonType person = RIM_FACTORY.createPersonType();
person.setId("urn:contact:id1");
person.setPersonName(getPersonName("john1", "doe1", null));
person.getTelephoneNumber().add(getPhoneNumber("111", null, "1234", "111-1111", null));
person.getEmailAddress().add(getEmailAddress("emailaddress@something.com", null));
return person;
}
use of oasis.names.tc.ebxml_regrep.xsd.rim._3.PersonType in project ddf by codice.
the class RegistryPackageWebConverterTest method getThirdPerson.
private PersonType getThirdPerson() {
PersonType person = RIM_FACTORY.createPersonType();
person.setId("urn:contact:id2");
person.setPersonName(getPersonName("john2", "doe2", null));
person.getTelephoneNumber().add(getPhoneNumber("111", null, "1234", "111-1111", null));
person.getEmailAddress().add(getEmailAddress("emailaddress@something.com", null));
return person;
}
use of oasis.names.tc.ebxml_regrep.xsd.rim._3.PersonType in project ddf by codice.
the class RegistryPackageConverter method parseRegistryPerson.
private static void parseRegistryPerson(PersonType person, MetacardImpl metacard) throws RegistryConversionException {
validateIdentifiable(person);
String name = "no name";
String phone = "no telephone number";
String email = "no email address";
if (person.isSetPersonName()) {
PersonNameType personName = person.getPersonName();
List<String> nameParts = new ArrayList<>();
if (StringUtils.isNotBlank(personName.getFirstName())) {
nameParts.add(personName.getFirstName());
}
if (StringUtils.isNotBlank(personName.getLastName())) {
nameParts.add(personName.getLastName());
}
if (CollectionUtils.isNotEmpty(nameParts)) {
name = String.join(" ", nameParts);
}
}
if (person.isSetTelephoneNumber()) {
List<TelephoneNumberType> phoneNumbers = person.getTelephoneNumber();
if (CollectionUtils.isNotEmpty(phoneNumbers)) {
phone = getPhoneNumber(phoneNumbers.get(0));
}
}
if (person.isSetEmailAddress()) {
List<EmailAddressType> emailAddresses = person.getEmailAddress();
if (CollectionUtils.isNotEmpty(emailAddresses)) {
EmailAddressType emailAddress = emailAddresses.get(0);
if (StringUtils.isNotBlank(emailAddress.getAddress())) {
email = emailAddress.getAddress();
}
}
}
String metacardPoc = String.format("%s, %s, %s", name, phone, email);
metacard.setAttribute(Metacard.POINT_OF_CONTACT, metacardPoc);
}
Aggregations