Search in sources :

Example 1 with CIContactType

use of org.isotc211.x2005.gmd.CIContactType in project arctic-sea by 52North.

the class Iso19139GmdEncoder method encodeContact.

private void encodeContact(CIContactPropertyType cicpt, Referenceable<CiContact> referenceable) {
    if (referenceable.isReference()) {
        Reference reference = referenceable.getReference();
        reference.getActuate().map(Actuate::toString).map(ActuateType.Enum::forString).ifPresent(cicpt::setActuate);
        reference.getArcrole().ifPresent(cicpt::setArcrole);
        reference.getHref().map(URI::toString).ifPresent(cicpt::setHref);
        reference.getRole().ifPresent(cicpt::setRole);
        reference.getShow().map(Show::toString).map(ShowType.Enum::forString).ifPresent(cicpt::setShow);
        reference.getTitle().ifPresent(cicpt::setTitle);
        reference.getType().map(Type::toString).map(TypeType.Enum::forString).ifPresent(cicpt::setType);
    } else {
        if (referenceable.isInstance()) {
            Nillable<CiContact> nillable = referenceable.getInstance();
            if (nillable.isPresent()) {
                CiContact ciContact = referenceable.getInstance().get();
                CIContactType cict = cicpt.addNewCIContact();
                if (ciContact.getAddress() != null) {
                    encodeCiAddress(cict.addNewAddress(), ciContact.getAddress());
                }
                if (ciContact.getContactInstructionsNillable() != null) {
                    if (ciContact.getContactInstructionsNillable().isPresent()) {
                        cict.addNewContactInstructions().setCharacterString(ciContact.getContactInstructions());
                    } else if (ciContact.getContactInstructionsNillable().hasReason()) {
                        cict.addNewContactInstructions().setNilReason(ciContact.getContactInstructionsNillable().getNilReason().get());
                    }
                }
                if (ciContact.isSetHoursOfService()) {
                    if (ciContact.getHoursOfServiceNillable().isPresent()) {
                        cict.addNewHoursOfService().setCharacterString(ciContact.getHoursOfService());
                    } else if (ciContact.getHoursOfServiceNillable().hasReason()) {
                        cict.addNewHoursOfService().setNilReason(ciContact.getHoursOfServiceNillable().getNilReason().get());
                    }
                }
                if (ciContact.getOnlineResourceReferenceable() != null) {
                    encodeOnlineResource(cict.addNewOnlineResource(), ciContact.getOnlineResourceReferenceable());
                }
                if (ciContact.isSetPhone()) {
                    encodePhone(cict.addNewPhone(), ciContact.getPhone());
                }
            } else {
                if (nillable.hasReason()) {
                    cicpt.setNilReason(nillable.getNilReason().get());
                }
            }
        }
    }
}
Also used : ActuateType(org.w3.x1999.xlink.ActuateType) Actuate(org.n52.shetland.w3c.xlink.Actuate) CIAddressType(org.isotc211.x2005.gmd.CIAddressType) CIContactPropertyType(org.isotc211.x2005.gmd.CIContactPropertyType) DQDomainConsistencyPropertyType(org.isotc211.x2005.gmd.DQDomainConsistencyPropertyType) CodeType(net.opengis.gml.x32.CodeType) MDMetadataPropertyType(org.isotc211.x2005.gmd.MDMetadataPropertyType) MDMetadataType(org.isotc211.x2005.gmd.MDMetadataType) LocalisedCharacterStringPropertyType(org.isotc211.x2005.gmd.LocalisedCharacterStringPropertyType) CharacterStringPropertyType(org.isotc211.x2005.gco.CharacterStringPropertyType) EXExtentPropertyType(org.isotc211.x2005.gmd.EXExtentPropertyType) CICitationType(org.isotc211.x2005.gmd.CICitationType) MDDataIdentificationType(org.isotc211.x2005.gmd.MDDataIdentificationType) DQDomainConsistencyType(org.isotc211.x2005.gmd.DQDomainConsistencyType) EXVerticalExtentType(org.isotc211.x2005.gmd.EXVerticalExtentType) GmdDateType(org.n52.shetland.iso.gmd.GmdDateType) CodeListValueType(org.isotc211.x2005.gco.CodeListValueType) AbstractCRSType(net.opengis.gml.x32.AbstractCRSType) DQResultPropertyType(org.isotc211.x2005.gmd.DQResultPropertyType) CIDateType(org.isotc211.x2005.gmd.CIDateType) CIContactType(org.isotc211.x2005.gmd.CIContactType) ShowType(org.w3.x1999.xlink.ShowType) MDIdentificationPropertyType(org.isotc211.x2005.gmd.MDIdentificationPropertyType) EXExtentType(org.isotc211.x2005.gmd.EXExtentType) CIOnlineResourcePropertyType(org.isotc211.x2005.gmd.CIOnlineResourcePropertyType) BaseUnitType(net.opengis.gml.x32.BaseUnitType) CITelephonePropertyType(org.isotc211.x2005.gmd.CITelephonePropertyType) ActuateType(org.w3.x1999.xlink.ActuateType) CIAddressPropertyType(org.isotc211.x2005.gmd.CIAddressPropertyType) UnitOfMeasurePropertyType(org.isotc211.x2005.gco.UnitOfMeasurePropertyType) EXVerticalExtentPropertyType(org.isotc211.x2005.gmd.EXVerticalExtentPropertyType) CIOnlineResourceType(org.isotc211.x2005.gmd.CIOnlineResourceType) DQQuantitativeResultType(org.isotc211.x2005.gmd.DQQuantitativeResultType) CIResponsiblePartyType(org.isotc211.x2005.gmd.CIResponsiblePartyType) SupportedType(org.n52.shetland.ogc.SupportedType) LocalisedCharacterStringType(org.isotc211.x2005.gmd.LocalisedCharacterStringType) CICitationPropertyType(org.isotc211.x2005.gmd.CICitationPropertyType) CITelephoneType(org.isotc211.x2005.gmd.CITelephoneType) DQConformanceResultType(org.isotc211.x2005.gmd.DQConformanceResultType) TypeType(org.w3.x1999.xlink.TypeType) Type(org.n52.shetland.w3c.xlink.Type) CIRoleCodePropertyType(org.isotc211.x2005.gmd.CIRoleCodePropertyType) MDDataIdentificationPropertyType(org.isotc211.x2005.gmd.MDDataIdentificationPropertyType) RealPropertyType(org.isotc211.x2005.gco.RealPropertyType) AbstractMDIdentificationType(org.isotc211.x2005.gmd.AbstractMDIdentificationType) PTFreeTextType(org.isotc211.x2005.gmd.PTFreeTextType) SCCRSPropertyType(org.isotc211.x2005.gsr.SCCRSPropertyType) CIResponsiblePartyPropertyType(org.isotc211.x2005.gmd.CIResponsiblePartyPropertyType) Reference(org.n52.shetland.w3c.xlink.Reference) CIContactType(org.isotc211.x2005.gmd.CIContactType) Show(org.n52.shetland.w3c.xlink.Show) TypeType(org.w3.x1999.xlink.TypeType) CiContact(org.n52.shetland.iso.gmd.CiContact) ShowType(org.w3.x1999.xlink.ShowType)

Aggregations

AbstractCRSType (net.opengis.gml.x32.AbstractCRSType)1 BaseUnitType (net.opengis.gml.x32.BaseUnitType)1 CodeType (net.opengis.gml.x32.CodeType)1 CharacterStringPropertyType (org.isotc211.x2005.gco.CharacterStringPropertyType)1 CodeListValueType (org.isotc211.x2005.gco.CodeListValueType)1 RealPropertyType (org.isotc211.x2005.gco.RealPropertyType)1 UnitOfMeasurePropertyType (org.isotc211.x2005.gco.UnitOfMeasurePropertyType)1 AbstractMDIdentificationType (org.isotc211.x2005.gmd.AbstractMDIdentificationType)1 CIAddressPropertyType (org.isotc211.x2005.gmd.CIAddressPropertyType)1 CIAddressType (org.isotc211.x2005.gmd.CIAddressType)1 CICitationPropertyType (org.isotc211.x2005.gmd.CICitationPropertyType)1 CICitationType (org.isotc211.x2005.gmd.CICitationType)1 CIContactPropertyType (org.isotc211.x2005.gmd.CIContactPropertyType)1 CIContactType (org.isotc211.x2005.gmd.CIContactType)1 CIDateType (org.isotc211.x2005.gmd.CIDateType)1 CIOnlineResourcePropertyType (org.isotc211.x2005.gmd.CIOnlineResourcePropertyType)1 CIOnlineResourceType (org.isotc211.x2005.gmd.CIOnlineResourceType)1 CIResponsiblePartyPropertyType (org.isotc211.x2005.gmd.CIResponsiblePartyPropertyType)1 CIResponsiblePartyType (org.isotc211.x2005.gmd.CIResponsiblePartyType)1 CIRoleCodePropertyType (org.isotc211.x2005.gmd.CIRoleCodePropertyType)1