use of org.isotc211.x2005.gmd.CIResponsiblePartyDocument in project arctic-sea by 52North.
the class Iso19139GmdEncoder method encodeResponsibleParty.
private XmlObject encodeResponsibleParty(CiResponsibleParty responsibleParty, EncodingContext context) throws EncodingException {
if (responsibleParty.isSetSimpleAttrs()) {
CIResponsiblePartyPropertyType cirppt = CIResponsiblePartyPropertyType.Factory.newInstance(getXmlOptions());
cirppt.setHref(responsibleParty.getSimpleAttrs().getHref());
if (responsibleParty.getSimpleAttrs().isSetTitle()) {
cirppt.setTitle(responsibleParty.getSimpleAttrs().getTitle());
}
if (responsibleParty.getSimpleAttrs().isSetRole()) {
cirppt.setRole(responsibleParty.getSimpleAttrs().getRole());
}
return cirppt;
}
CIResponsiblePartyType cirpt = CIResponsiblePartyType.Factory.newInstance(getXmlOptions());
if (responsibleParty.isSetIndividualName()) {
cirpt.addNewIndividualName().setCharacterString(responsibleParty.getIndividualName());
}
if (responsibleParty.isSetOrganizationName()) {
cirpt.addNewOrganisationName().setCharacterString(responsibleParty.getOrganizationName());
}
if (responsibleParty.isSetPositionName()) {
cirpt.addNewPositionName().setCharacterString(responsibleParty.getPositionName());
}
// set contact
if (responsibleParty.isSetContactInfo()) {
encodeContact(cirpt.addNewContactInfo(), responsibleParty.getContactInfo());
}
// set role
encodeRole(cirpt.addNewRole(), responsibleParty.getRoleNillable());
if (responsibleParty.isSetId()) {
cirpt.setId(responsibleParty.getId());
}
if (responsibleParty.isSetUuid()) {
cirpt.setUuid(responsibleParty.getUuid());
}
if (context.has(XmlBeansEncodingFlags.PROPERTY_TYPE)) {
CIResponsiblePartyPropertyType cirppt = CIResponsiblePartyPropertyType.Factory.newInstance(getXmlOptions());
cirppt.setCIResponsibleParty(cirpt);
return cirppt;
} else if (context.has(XmlBeansEncodingFlags.DOCUMENT)) {
CIResponsiblePartyDocument cirpd = CIResponsiblePartyDocument.Factory.newInstance(getXmlOptions());
cirpd.setCIResponsibleParty(cirpt);
return cirpd;
}
return cirpt;
}
use of org.isotc211.x2005.gmd.CIResponsiblePartyDocument in project arctic-sea by 52North.
the class Iso19139GmdEncoder method encodeResponsibleParty.
private XmlObject encodeResponsibleParty(SmlResponsibleParty responsibleParty, EncodingContext additionalValues) throws EncodingException {
if (responsibleParty.isSetHref()) {
CIResponsiblePartyPropertyType cirppt = CIResponsiblePartyPropertyType.Factory.newInstance(getXmlOptions());
cirppt.setHref(responsibleParty.getHref());
if (responsibleParty.isSetTitle()) {
cirppt.setTitle(responsibleParty.getTitle());
}
if (responsibleParty.isSetRole()) {
cirppt.setRole(responsibleParty.getRole());
}
return cirppt;
}
CIResponsiblePartyType cirpt = CIResponsiblePartyType.Factory.newInstance(getXmlOptions());
if (responsibleParty.isSetIndividualName()) {
cirpt.addNewIndividualName().setCharacterString(responsibleParty.getIndividualName());
}
if (responsibleParty.isSetOrganizationName()) {
cirpt.addNewOrganisationName().setCharacterString(responsibleParty.getOrganizationName());
}
if (responsibleParty.isSetPositionName()) {
cirpt.addNewPositionName().setCharacterString(responsibleParty.getPositionName());
}
// set contact
encodeContact(cirpt.addNewContactInfo().addNewCIContact(), responsibleParty);
// set role
encodeRole(cirpt.addNewRole(), responsibleParty.getRoleObject());
if (additionalValues.has(XmlBeansEncodingFlags.PROPERTY_TYPE)) {
CIResponsiblePartyPropertyType cirppt = CIResponsiblePartyPropertyType.Factory.newInstance(getXmlOptions());
cirppt.setCIResponsibleParty(cirpt);
return cirppt;
} else if (additionalValues.has(XmlBeansEncodingFlags.DOCUMENT)) {
CIResponsiblePartyDocument cirpd = CIResponsiblePartyDocument.Factory.newInstance(getXmlOptions());
cirpd.setCIResponsibleParty(cirpt);
}
return cirpt;
}
Aggregations