Search in sources :

Example 26 with If

use of org.w3._2007.rif.If in project arctic-sea by 52North.

the class Iso19139GmdEncoder method encodeEXExtent.

private XmlObject encodeEXExtent(EXExtent exExtent, EncodingContext context) throws EncodingException {
    EXExtentType exet = EXExtentType.Factory.newInstance();
    if (exExtent.hasDescription()) {
        exet.addNewDescription().setCharacterString(exExtent.getDescription());
    }
    if (exExtent.hasVerticalExtent()) {
        for (Referenceable<EXVerticalExtent> verticalExtent : exExtent.getExVerticalExtent()) {
            EXVerticalExtentPropertyType exvept = exet.addNewVerticalElement();
            if (verticalExtent.isReference()) {
                Reference reference = verticalExtent.getReference();
                reference.getActuate().map(Actuate::toString).map(ActuateType.Enum::forString).ifPresent(exvept::setActuate);
                reference.getArcrole().ifPresent(exvept::setArcrole);
                reference.getHref().map(URI::toString).ifPresent(exvept::setHref);
                reference.getRole().ifPresent(exvept::setRole);
                reference.getShow().map(Show::toString).map(ShowType.Enum::forString).ifPresent(exvept::setShow);
                reference.getTitle().ifPresent(exvept::setTitle);
                reference.getType().map(Type::toString).map(TypeType.Enum::forString).ifPresent(exvept::setType);
            } else {
                if (verticalExtent.isInstance()) {
                    Nillable<EXVerticalExtent> nillable = verticalExtent.getInstance();
                    if (nillable.isPresent()) {
                        XmlObject xml = encodeEXVerticalExtent(nillable.get(), EncodingContext.empty());
                        if (xml != null && xml instanceof EXVerticalExtentType) {
                            exvept.setEXVerticalExtent((EXVerticalExtentType) xml);
                        } else {
                            exvept.setNil();
                            exvept.setNilReason(Nillable.missing().get());
                        }
                    } else {
                        exvept.setNil();
                        if (nillable.hasReason()) {
                            exvept.setNilReason(nillable.getNilReason().get());
                        } else {
                            exvept.setNilReason(Nillable.missing().get());
                        }
                    }
                }
            }
        }
    }
    if (context.has(XmlBeansEncodingFlags.PROPERTY_TYPE)) {
        EXExtentPropertyType exept = EXExtentPropertyType.Factory.newInstance(getXmlOptions());
        exept.setEXExtent(exet);
        return exept;
    } else if (context.has(XmlBeansEncodingFlags.DOCUMENT)) {
        EXExtentDocument exed = EXExtentDocument.Factory.newInstance(getXmlOptions());
        exed.setEXExtent(exet);
        return exed;
    }
    return exet;
}
Also used : ActuateType(org.w3.x1999.xlink.ActuateType) Reference(org.n52.shetland.w3c.xlink.Reference) EXExtentDocument(org.isotc211.x2005.gmd.EXExtentDocument) EXExtentType(org.isotc211.x2005.gmd.EXExtentType) EXVerticalExtentPropertyType(org.isotc211.x2005.gmd.EXVerticalExtentPropertyType) EXVerticalExtentType(org.isotc211.x2005.gmd.EXVerticalExtentType) 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) EXVerticalExtent(org.n52.shetland.iso.gmd.EXVerticalExtent) EXExtentPropertyType(org.isotc211.x2005.gmd.EXExtentPropertyType) Show(org.n52.shetland.w3c.xlink.Show) XmlObject(org.apache.xmlbeans.XmlObject) TypeType(org.w3.x1999.xlink.TypeType) ShowType(org.w3.x1999.xlink.ShowType)

Example 27 with If

use of org.w3._2007.rif.If in project arctic-sea by 52North.

the class Iso19139GmdEncoder method encodeOnlineResource.

private void encodeOnlineResource(CIOnlineResourcePropertyType ciorpt, Referenceable<CiOnlineResource> referenceable) {
    if (referenceable.isReference()) {
        Reference reference = referenceable.getReference();
        reference.getActuate().map(Actuate::toString).map(ActuateType.Enum::forString).ifPresent(ciorpt::setActuate);
        reference.getArcrole().ifPresent(ciorpt::setArcrole);
        reference.getHref().map(URI::toString).ifPresent(ciorpt::setHref);
        reference.getRole().ifPresent(ciorpt::setRole);
        reference.getShow().map(Show::toString).map(ShowType.Enum::forString).ifPresent(ciorpt::setShow);
        reference.getTitle().ifPresent(ciorpt::setTitle);
        reference.getType().map(Type::toString).map(TypeType.Enum::forString).ifPresent(ciorpt::setType);
    } else {
        if (referenceable.isInstance()) {
            Nillable<CiOnlineResource> nillable = referenceable.getInstance();
            if (nillable.isPresent()) {
                CIOnlineResourceType ciort = ciorpt.addNewCIOnlineResource();
                encodeOnlineResource(ciort, referenceable.getInstance().get());
            } else {
                if (nillable.hasReason()) {
                    ciorpt.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) Show(org.n52.shetland.w3c.xlink.Show) CiOnlineResource(org.n52.shetland.iso.gmd.CiOnlineResource) CIOnlineResourceType(org.isotc211.x2005.gmd.CIOnlineResourceType) TypeType(org.w3.x1999.xlink.TypeType) ShowType(org.w3.x1999.xlink.ShowType)

Example 28 with If

use of org.w3._2007.rif.If in project arctic-sea by 52North.

the class Iso19139GmdEncoder method encodeEXVerticalExtent.

private XmlObject encodeEXVerticalExtent(EXVerticalExtent exVerticalExtent, EncodingContext context) throws EncodingException {
    EXVerticalExtentType exvet = EXVerticalExtentType.Factory.newInstance();
    if (exVerticalExtent.isSetId()) {
        exvet.setId(exVerticalExtent.getId());
    }
    if (exVerticalExtent.isSetUuid()) {
        exvet.setUuid(exVerticalExtent.getUuid());
    }
    // min value
    Nillable<Double> minNillable = exVerticalExtent.getMinimumValue();
    RealPropertyType rptMinValue = exvet.addNewMinimumValue();
    if (minNillable.isPresent()) {
        rptMinValue.setReal(minNillable.get());
    } else {
        rptMinValue.setNil();
        if (minNillable.hasReason()) {
            rptMinValue.setNilReason(minNillable.getNilReason().get());
        } else {
            rptMinValue.setNilReason(Nillable.missing().get());
        }
    }
    // max value
    Nillable<Double> maxNillable = exVerticalExtent.getMaximumValue();
    RealPropertyType rptMinMaxValue = exvet.addNewMaximumValue();
    if (maxNillable.isPresent()) {
        rptMinMaxValue.setReal(maxNillable.get());
    } else {
        rptMinMaxValue.setNil();
        if (maxNillable.hasReason()) {
            rptMinMaxValue.setNilReason(maxNillable.getNilReason().get());
        } else {
            rptMinMaxValue.setNilReason(Nillable.missing().get());
        }
    }
    // verticalCRS
    SCCRSPropertyType sccrspt = exvet.addNewVerticalCRS();
    Referenceable<ScCRS> verticalCRS = exVerticalExtent.getVerticalCRS();
    if (verticalCRS.isReference()) {
        Reference reference = verticalCRS.getReference();
        reference.getActuate().map(Actuate::toString).map(ActuateType.Enum::forString).ifPresent(sccrspt::setActuate);
        reference.getArcrole().ifPresent(sccrspt::setArcrole);
        reference.getHref().map(URI::toString).ifPresent(sccrspt::setHref);
        reference.getRole().ifPresent(sccrspt::setRole);
        reference.getShow().map(Show::toString).map(ShowType.Enum::forString).ifPresent(sccrspt::setShow);
        reference.getTitle().ifPresent(sccrspt::setTitle);
        reference.getType().map(Type::toString).map(TypeType.Enum::forString).ifPresent(sccrspt::setType);
    } else {
        if (verticalCRS.isInstance()) {
            Nillable<ScCRS> nillable = verticalCRS.getInstance();
            if (nillable.isPresent()) {
                XmlObject xml = encodeObjectToXml(GmlConstants.NS_GML_32, nillable.get().getAbstractCrs());
                if (xml != null && xml instanceof AbstractCRSType) {
                    final XmlObject substituteElement = XmlHelper.substituteElement(sccrspt.addNewAbstractCRS(), xml);
                    substituteElement.set(xml);
                } else {
                    sccrspt.setNil();
                    sccrspt.setNilReason(Nillable.missing().get());
                }
            } else {
                sccrspt.setNil();
                if (nillable.hasReason()) {
                    sccrspt.setNilReason(nillable.getNilReason().get());
                } else {
                    sccrspt.setNilReason(Nillable.missing().get());
                }
            }
        }
    }
    if (context.has(XmlBeansEncodingFlags.PROPERTY_TYPE)) {
        EXVerticalExtentPropertyType exvept = EXVerticalExtentPropertyType.Factory.newInstance(getXmlOptions());
        exvept.setEXVerticalExtent(exvet);
        return exvept;
    } else if (context.has(XmlBeansEncodingFlags.DOCUMENT)) {
        EXVerticalExtentDocument exved = EXVerticalExtentDocument.Factory.newInstance(getXmlOptions());
        exved.setEXVerticalExtent(exvet);
        return exved;
    }
    return exvet;
}
Also used : ActuateType(org.w3.x1999.xlink.ActuateType) Reference(org.n52.shetland.w3c.xlink.Reference) ScCRS(org.n52.shetland.iso.gmd.ScCRS) EXVerticalExtentPropertyType(org.isotc211.x2005.gmd.EXVerticalExtentPropertyType) EXVerticalExtentType(org.isotc211.x2005.gmd.EXVerticalExtentType) 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) RealPropertyType(org.isotc211.x2005.gco.RealPropertyType) SCCRSPropertyType(org.isotc211.x2005.gsr.SCCRSPropertyType) AbstractCRSType(net.opengis.gml.x32.AbstractCRSType) Show(org.n52.shetland.w3c.xlink.Show) XmlObject(org.apache.xmlbeans.XmlObject) EXVerticalExtentDocument(org.isotc211.x2005.gmd.EXVerticalExtentDocument) TypeType(org.w3.x1999.xlink.TypeType) ShowType(org.w3.x1999.xlink.ShowType)

Example 29 with If

use of org.w3._2007.rif.If in project arctic-sea by 52North.

the class GmlEncoderv321 method addAbstractCRSValues.

private void addAbstractCRSValues(AbstractCRSType acrst, AbstractCRS abstractCRS) throws EncodingException {
    addDefinitonValues(acrst, abstractCRS);
    if (abstractCRS.hasDomainOfValidity()) {
        for (Referenceable<DomainOfValidity> domainOfValidity : abstractCRS.getDomainOfValidity()) {
            net.opengis.gml.x32.DomainOfValidityDocument.DomainOfValidity dov = acrst.addNewDomainOfValidity();
            if (domainOfValidity.isReference()) {
                Reference reference = domainOfValidity.getReference();
                reference.getActuate().map(Actuate::toString).map(ActuateType.Enum::forString).ifPresent(dov::setActuate);
                reference.getArcrole().ifPresent(dov::setArcrole);
                reference.getHref().map(URI::toString).ifPresent(dov::setHref);
                reference.getRole().ifPresent(dov::setRole);
                reference.getShow().map(Show::toString).map(ShowType.Enum::forString).ifPresent(dov::setShow);
                reference.getTitle().ifPresent(dov::setTitle);
                reference.getType().map(Type::toString).map(TypeType.Enum::forString).ifPresent(dov::setType);
            } else {
                if (domainOfValidity.isInstance()) {
                    Nillable<DomainOfValidity> nillable = domainOfValidity.getInstance();
                    if (nillable.isPresent()) {
                        net.opengis.gml.x32.DomainOfValidityDocument.DomainOfValidity xml = createDomainOfValidity(nillable.get(), EncodingContext.empty());
                        if (xml != null) {
                            dov.set(xml);
                        } else {
                            dov.setNil();
                            dov.setNilReason(Nillable.missing().get());
                        }
                    } else {
                        dov.setNil();
                        if (nillable.hasReason()) {
                            dov.setNilReason(nillable.getNilReason().get());
                        } else {
                            dov.setNilReason(Nillable.missing().get());
                        }
                    }
                }
            }
        }
    }
    if (abstractCRS.hasScope()) {
        abstractCRS.getScope().forEach(scope -> acrst.addNewScope().setStringValue(scope));
    }
}
Also used : ActuateType(org.w3.x1999.xlink.ActuateType) DomainOfValidity(org.n52.shetland.ogc.gml.DomainOfValidity) Reference(org.n52.shetland.w3c.xlink.Reference) Actuate(org.n52.shetland.w3c.xlink.Actuate) EnvelopeType(net.opengis.gml.x32.EnvelopeType) MultiPointType(net.opengis.gml.x32.MultiPointType) VerticalDatumPropertyType(net.opengis.gml.x32.VerticalDatumPropertyType) CodeType(net.opengis.gml.x32.CodeType) DirectPositionListType(net.opengis.gml.x32.DirectPositionListType) CoordinateSystemAxisPropertyType(net.opengis.gml.x32.CoordinateSystemAxisPropertyType) VerticalCSType(net.opengis.gml.x32.VerticalCSType) TimePeriodPropertyType(net.opengis.gml.x32.TimePeriodPropertyType) LineStringType(net.opengis.gml.x32.LineStringType) CoordinateSystemAxisType(net.opengis.gml.x32.CoordinateSystemAxisType) FeaturePropertyType(net.opengis.gml.x32.FeaturePropertyType) TimeInstantPropertyType(net.opengis.gml.x32.TimeInstantPropertyType) TimeIndeterminateValueType(net.opengis.gml.x32.TimeIndeterminateValueType) GeometryPropertyType(net.opengis.gml.x32.GeometryPropertyType) PolygonType(net.opengis.gml.x32.PolygonType) VerticalDatumType(net.opengis.gml.x32.VerticalDatumType) MultiCurveType(net.opengis.gml.x32.MultiCurveType) AggregationType(net.opengis.gml.x32.AggregationType) AbstractCRSType(net.opengis.gml.x32.AbstractCRSType) ShowType(org.w3.x1999.xlink.ShowType) AbstractRingPropertyType(net.opengis.gml.x32.AbstractRingPropertyType) LinearRingType(net.opengis.gml.x32.LinearRingType) EXExtentType(org.isotc211.x2005.gmd.EXExtentType) TimePeriodType(net.opengis.gml.x32.TimePeriodType) ReferenceType(net.opengis.gml.x32.ReferenceType) TimeInstantType(net.opengis.gml.x32.TimeInstantType) GenericMetaDataType(net.opengis.gml.x32.GenericMetaDataType) ActuateType(org.w3.x1999.xlink.ActuateType) TimePositionType(net.opengis.gml.x32.TimePositionType) VerticalCRSType(net.opengis.gml.x32.VerticalCRSType) CurvePropertyType(net.opengis.gml.x32.CurvePropertyType) DefinitionType(net.opengis.gml.x32.DefinitionType) AbstractCoordinateSystemType(net.opengis.gml.x32.AbstractCoordinateSystemType) AbstractDatumType(net.opengis.gml.x32.AbstractDatumType) AbstractRingType(net.opengis.gml.x32.AbstractRingType) MeasureType(net.opengis.gml.x32.MeasureType) VerticalCSPropertyType(net.opengis.gml.x32.VerticalCSPropertyType) CodeWithAuthorityType(net.opengis.gml.x32.CodeWithAuthorityType) TypeType(org.w3.x1999.xlink.TypeType) Type(org.n52.shetland.w3c.xlink.Type) AbstractGeometryType(net.opengis.gml.x32.AbstractGeometryType) DirectPositionType(net.opengis.gml.x32.DirectPositionType) FeatureCollectionType(net.opengis.gml.x32.FeatureCollectionType) PointType(net.opengis.gml.x32.PointType) VerticalCRSPropertyType(net.opengis.gml.x32.VerticalCRSPropertyType) Show(org.n52.shetland.w3c.xlink.Show) TypeType(org.w3.x1999.xlink.TypeType) ShowType(org.w3.x1999.xlink.ShowType)

Example 30 with If

use of org.w3._2007.rif.If in project arctic-sea by 52North.

the class OwsEncoderv110 method encodeOwsPossibleValues.

private void encodeOwsPossibleValues(OwsPossibleValues possibleValues, DomainType xdomain) {
    if (possibleValues.isAnyValue()) {
        xdomain.addNewAnyValue();
    } else if (possibleValues.isNoValues()) {
        xdomain.addNewNoValues();
    } else if (possibleValues.isValuesReference()) {
        OwsValuesReference vr = possibleValues.asValuesReference();
        ValuesReference xvr = xdomain.addNewValuesReference();
        xvr.setReference(vr.getReference().toString());
        xvr.setStringValue(vr.getValue());
    } else if (possibleValues.isAllowedValues()) {
        OwsAllowedValues av = possibleValues.asAllowedValues();
        AllowedValues xav = xdomain.addNewAllowedValues();
        av.getRestrictions().forEach(restriction -> {
            if (restriction.isRange()) {
                OwsRange range = restriction.asRange();
                RangeType xrange = xav.addNewRange();
                range.getLowerBound().map(OwsValue::getValue).ifPresent(v -> xrange.addNewMinimumValue().setStringValue(v));
                range.getUpperBound().map(OwsValue::getValue).ifPresent(v -> xrange.addNewMaximumValue().setStringValue(v));
                range.getSpacing().map(OwsValue::getValue).ifPresent(v -> xrange.addNewSpacing().setStringValue(v));
                xrange.setRangeClosure(Collections.singletonList(range.getType()));
            } else if (restriction.isValue()) {
                xav.addNewValue().setStringValue(restriction.asValue().getValue());
            }
        });
    }
}
Also used : SortedSet(java.util.SortedSet) OwsPossibleValues(org.n52.shetland.ogc.ows.OwsPossibleValues) CodedException(org.n52.shetland.ogc.ows.exception.CodedException) LoggerFactory(org.slf4j.LoggerFactory) SectionsType(net.opengis.ows.x11.SectionsType) OwsAllowedValues(org.n52.shetland.ogc.ows.OwsAllowedValues) OwsServiceProvider(org.n52.shetland.ogc.ows.OwsServiceProvider) Show(org.n52.shetland.w3c.xlink.Show) LocalizedString(org.n52.janmayen.i18n.LocalizedString) Map(java.util.Map) KeywordsType(net.opengis.ows.x11.KeywordsType) ActuateType(org.w3.x1999.xlink.ActuateType) RequestMethodType(net.opengis.ows.x11.RequestMethodType) URI(java.net.URI) OwsRequestMethod(org.n52.shetland.ogc.ows.OwsRequestMethod) ServiceIdentification(net.opengis.ows.x11.ServiceIdentificationDocument.ServiceIdentification) OwsValue(org.n52.shetland.ogc.ows.OwsValue) OWSConstants(org.n52.shetland.ogc.ows.OWSConstants) EncodingException(org.n52.svalbard.encode.exception.EncodingException) MetadataType(net.opengis.ows.x11.MetadataType) N52XmlHelper(org.n52.svalbard.util.N52XmlHelper) HTTP(net.opengis.ows.x11.HTTPDocument.HTTP) Actuate(org.n52.shetland.w3c.xlink.Actuate) ResponsiblePartySubsetType(net.opengis.ows.x11.ResponsiblePartySubsetType) Set(java.util.Set) Setting(org.n52.faroe.annotation.Setting) ValuesReference(net.opengis.ows.x11.ValuesReferenceDocument.ValuesReference) LocaleHelper(org.n52.janmayen.i18n.LocaleHelper) OwsMetadata(org.n52.shetland.ogc.ows.OwsMetadata) ExceptionReport(net.opengis.ows.x11.ExceptionReportDocument.ExceptionReport) HTTPMethods(org.n52.janmayen.http.HTTPMethods) Sets(com.google.common.collect.Sets) DomainType(net.opengis.ows.x11.DomainType) LanguageStringType(net.opengis.ows.x11.LanguageStringType) OwsEncoderSettings(org.n52.svalbard.OwsEncoderSettings) List(java.util.List) DCP(net.opengis.ows.x11.DCPDocument.DCP) OnlineResourceType(net.opengis.ows.x11.OnlineResourceType) Stream(java.util.stream.Stream) ExceptionReportDocument(net.opengis.ows.x11.ExceptionReportDocument) SchemaLocation(org.n52.shetland.w3c.SchemaLocation) CodeType(net.opengis.ows.x11.CodeType) TelephoneType(net.opengis.ows.x11.TelephoneType) OwsResponsibleParty(org.n52.shetland.ogc.ows.OwsResponsibleParty) CollectionHelper(org.n52.shetland.util.CollectionHelper) AddressType(net.opengis.ows.x11.AddressType) OperationsMetadata(net.opengis.ows.x11.OperationsMetadataDocument.OperationsMetadata) Optional(java.util.Optional) OwsValuesReference(org.n52.shetland.ogc.ows.OwsValuesReference) SuppressFBWarnings(edu.umd.cs.findbugs.annotations.SuppressFBWarnings) OwsAddress(org.n52.shetland.ogc.ows.OwsAddress) Joiner(com.google.common.base.Joiner) MultilingualString(org.n52.janmayen.i18n.MultilingualString) MediaTypes(org.n52.janmayen.http.MediaTypes) ByteArrayOutputStream(java.io.ByteArrayOutputStream) ServiceProvider(net.opengis.ows.x11.ServiceProviderDocument.ServiceProvider) Collectors.groupingBy(java.util.stream.Collectors.groupingBy) OwsDCP(org.n52.shetland.ogc.ows.OwsDCP) Supplier(java.util.function.Supplier) ArrayList(java.util.ArrayList) RangeType(net.opengis.ows.x11.RangeType) OwsAcceptVersions(org.n52.shetland.ogc.ows.OwsAcceptVersions) OwsExceptionCode(org.n52.shetland.ogc.ows.exception.OwsExceptionCode) Collectors.mapping(java.util.stream.Collectors.mapping) ExceptionType(net.opengis.ows.x11.ExceptionType) OwsDomainMetadata(org.n52.shetland.ogc.ows.OwsDomainMetadata) UnsupportedEncoderInputException(org.n52.svalbard.encode.exception.UnsupportedEncoderInputException) XmlObject(org.apache.xmlbeans.XmlObject) AllowedValues(net.opengis.ows.x11.AllowedValuesDocument.AllowedValues) DomainMetadataType(net.opengis.ows.x11.DomainMetadataType) PrintStream(java.io.PrintStream) OwsOperationMetadataExtension(org.n52.shetland.ogc.ows.OwsOperationMetadataExtension) OwsRange(org.n52.shetland.ogc.ows.OwsRange) Logger(org.slf4j.Logger) AcceptVersionsType(net.opengis.ows.x11.AcceptVersionsType) OwsOnlineResource(org.n52.shetland.ogc.ows.OwsOnlineResource) OwsPhone(org.n52.shetland.ogc.ows.OwsPhone) OwsKeyword(org.n52.shetland.ogc.ows.OwsKeyword) OwsCode(org.n52.shetland.ogc.ows.OwsCode) OwsExceptionReport(org.n52.shetland.ogc.ows.exception.OwsExceptionReport) ShowType(org.w3.x1999.xlink.ShowType) ExceptionDocument(net.opengis.ows.x11.ExceptionDocument) Collectors.toList(java.util.stream.Collectors.toList) OwsContact(org.n52.shetland.ogc.ows.OwsContact) OwsLanguageString(org.n52.shetland.ogc.ows.OwsLanguageString) OwsHttp(org.n52.shetland.ogc.ows.OwsHttp) Configurable(org.n52.faroe.annotation.Configurable) CodingHelper(org.n52.svalbard.util.CodingHelper) OwsSections(org.n52.shetland.ogc.ows.OwsSections) OwsServiceIdentification(org.n52.shetland.ogc.ows.OwsServiceIdentification) ContactType(net.opengis.ows.x11.ContactType) OwsOperation(org.n52.shetland.ogc.ows.OwsOperation) OwsOperationsMetadata(org.n52.shetland.ogc.ows.OwsOperationsMetadata) Operation(net.opengis.ows.x11.OperationDocument.Operation) Collections(java.util.Collections) OwsDomain(org.n52.shetland.ogc.ows.OwsDomain) OwsAllowedValues(org.n52.shetland.ogc.ows.OwsAllowedValues) OwsRange(org.n52.shetland.ogc.ows.OwsRange) RangeType(net.opengis.ows.x11.RangeType) OwsValuesReference(org.n52.shetland.ogc.ows.OwsValuesReference) OwsAllowedValues(org.n52.shetland.ogc.ows.OwsAllowedValues) AllowedValues(net.opengis.ows.x11.AllowedValuesDocument.AllowedValues) ValuesReference(net.opengis.ows.x11.ValuesReferenceDocument.ValuesReference) OwsValuesReference(org.n52.shetland.ogc.ows.OwsValuesReference) OwsValue(org.n52.shetland.ogc.ows.OwsValue)

Aggregations

Actuate (org.n52.shetland.w3c.xlink.Actuate)15 Show (org.n52.shetland.w3c.xlink.Show)15 ActuateType (org.w3.x1999.xlink.ActuateType)15 ShowType (org.w3.x1999.xlink.ShowType)15 Reference (org.n52.shetland.w3c.xlink.Reference)14 Type (org.n52.shetland.w3c.xlink.Type)14 TypeType (org.w3.x1999.xlink.TypeType)14 IOException (java.io.IOException)13 XmlObject (org.apache.xmlbeans.XmlObject)11 AbstractCRSType (net.opengis.gml.x32.AbstractCRSType)10 CodeType (net.opengis.gml.x32.CodeType)10 EXExtentType (org.isotc211.x2005.gmd.EXExtentType)10 ProvideAndRegisterDocumentSetRequestType (ihe.iti.xds_b._2007.ProvideAndRegisterDocumentSetRequestType)9 ArrayList (java.util.ArrayList)8 CIResponsiblePartyPropertyType (org.isotc211.x2005.gmd.CIResponsiblePartyPropertyType)8 CIResponsiblePartyType (org.isotc211.x2005.gmd.CIResponsiblePartyType)8 ByteArrayOutputStream (java.io.ByteArrayOutputStream)7 BaseUnitType (net.opengis.gml.x32.BaseUnitType)6 VerticalDatumPropertyType (net.opengis.gml.x32.VerticalDatumPropertyType)5 VerticalDatumType (net.opengis.gml.x32.VerticalDatumType)5