Search in sources :

Example 11 with OwsDomain

use of org.n52.shetland.ogc.ows.OwsDomain in project arctic-sea by 52North.

the class OwsEncoderv110 method encode.

@Override
public XmlObject encode(Object element, EncodingContext additionalValues) throws EncodingException {
    if (element instanceof OwsServiceIdentification) {
        return encodeServiceIdentification((OwsServiceIdentification) element);
    } else if (element instanceof OwsServiceProvider) {
        return encodeServiceProvider((OwsServiceProvider) element);
    } else if (element instanceof OwsOperationsMetadata) {
        return encodeOperationsMetadata((OwsOperationsMetadata) element);
    } else if (element instanceof OwsExceptionReport) {
        if (isEncodeExceptionsOnly(additionalValues) && !((OwsExceptionReport) element).getExceptions().isEmpty()) {
            return encodeOwsException(((OwsExceptionReport) element).getExceptions().get(0));
        }
        return encodeOwsExceptionReport((OwsExceptionReport) element);
    } else if (element instanceof OwsMetadata) {
        MetadataType metadataType = MetadataType.Factory.newInstance(getXmlOptions());
        encodeOwsMetadata((OwsMetadata) element, metadataType);
        return metadataType;
    } else if (element instanceof OwsDomain) {
        DomainType domainType = DomainType.Factory.newInstance(getXmlOptions());
        encodeOwsDomain((OwsDomain) element, domainType);
        return domainType;
    } else if (element instanceof OwsAcceptVersions) {
        return encodeAcceptVersions((OwsAcceptVersions) element);
    } else if (element instanceof OwsSections) {
        return encodeSections((OwsSections) element);
    }
    throw new UnsupportedEncoderInputException(this, element);
}
Also used : OwsDomain(org.n52.shetland.ogc.ows.OwsDomain) DomainType(net.opengis.ows.x11.DomainType) OwsOperationsMetadata(org.n52.shetland.ogc.ows.OwsOperationsMetadata) OwsMetadata(org.n52.shetland.ogc.ows.OwsMetadata) OwsSections(org.n52.shetland.ogc.ows.OwsSections) OwsServiceProvider(org.n52.shetland.ogc.ows.OwsServiceProvider) MetadataType(net.opengis.ows.x11.MetadataType) DomainMetadataType(net.opengis.ows.x11.DomainMetadataType) OwsServiceIdentification(org.n52.shetland.ogc.ows.OwsServiceIdentification) OwsExceptionReport(org.n52.shetland.ogc.ows.exception.OwsExceptionReport) OwsAcceptVersions(org.n52.shetland.ogc.ows.OwsAcceptVersions) UnsupportedEncoderInputException(org.n52.svalbard.encode.exception.UnsupportedEncoderInputException)

Example 12 with OwsDomain

use of org.n52.shetland.ogc.ows.OwsDomain in project arctic-sea by 52North.

the class AbstractCapabilitiesBaseTypeDecoder method parseRequestMethod.

private OwsRequestMethod parseRequestMethod(String httpMethod, RequestMethodType method) {
    if (method == null) {
        return null;
    }
    URI href = Optional.ofNullable(method.getHref()).map(Strings::emptyToNull).map(URI::create).orElse(null);
    URI role = Optional.ofNullable(method.getRole()).map(Strings::emptyToNull).map(URI::create).orElse(null);
    URI arcrole = Optional.ofNullable(method.getArcrole()).map(Strings::emptyToNull).map(URI::create).orElse(null);
    Show show = Optional.ofNullable(method.getShow()).map(Object::toString).map(Show::valueOf).orElse(null);
    Actuate actuate = Optional.ofNullable(method.getActuate()).map(Object::toString).map(Actuate::valueOf).orElse(null);
    String title = method.getTitle();
    List<OwsDomain> constraints = parseDomains(method.getConstraintArray());
    return new OwsRequestMethod(href, constraints, httpMethod, role, arcrole, title, show, actuate);
}
Also used : OwsDomain(org.n52.shetland.ogc.ows.OwsDomain) Actuate(org.n52.shetland.w3c.xlink.Actuate) Show(org.n52.shetland.w3c.xlink.Show) XmlObject(org.apache.xmlbeans.XmlObject) LocalizedString(org.n52.janmayen.i18n.LocalizedString) MultilingualString(org.n52.janmayen.i18n.MultilingualString) OwsLanguageString(org.n52.shetland.ogc.ows.OwsLanguageString) OwsRequestMethod(org.n52.shetland.ogc.ows.OwsRequestMethod) URI(java.net.URI) Strings(com.google.common.base.Strings)

Aggregations

OwsDomain (org.n52.shetland.ogc.ows.OwsDomain)12 OwsAllowedValues (org.n52.shetland.ogc.ows.OwsAllowedValues)5 OwsPossibleValues (org.n52.shetland.ogc.ows.OwsPossibleValues)5 OwsValue (org.n52.shetland.ogc.ows.OwsValue)5 OwsOperationsMetadata (org.n52.shetland.ogc.ows.OwsOperationsMetadata)3 XmlObject (org.apache.xmlbeans.XmlObject)2 OwsMetadata (org.n52.shetland.ogc.ows.OwsMetadata)2 OwsOperation (org.n52.shetland.ogc.ows.OwsOperation)2 OwsOperationMetadataExtension (org.n52.shetland.ogc.ows.OwsOperationMetadataExtension)2 Strings (com.google.common.base.Strings)1 URI (java.net.URI)1 HashSet (java.util.HashSet)1 LinkedList (java.util.LinkedList)1 Locale (java.util.Locale)1 Objects (java.util.Objects)1 DomainMetadataType (net.opengis.ows.x11.DomainMetadataType)1 DomainType (net.opengis.ows.x11.DomainType)1 MetadataType (net.opengis.ows.x11.MetadataType)1 RequestOperatorKey (org.n52.iceland.request.operator.RequestOperatorKey)1 LocaleHelper (org.n52.janmayen.i18n.LocaleHelper)1