Search in sources :

Example 1 with OwsDomain

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

the class AbstractGetCapabilitiesHandler method getCommonParameters.

private Collection<OwsDomain> getCommonParameters(String service) {
    OwsDomain serviceParameter = new OwsDomain(OWSConstants.RequestParams.service, new OwsAllowedValues(new OwsValue(service)));
    OwsDomain versionParameter = new OwsDomain(OWSConstants.RequestParams.version, getSupportedVersions(service));
    return Arrays.asList(serviceParameter, versionParameter);
}
Also used : OwsDomain(org.n52.shetland.ogc.ows.OwsDomain) OwsAllowedValues(org.n52.shetland.ogc.ows.OwsAllowedValues) OwsValue(org.n52.shetland.ogc.ows.OwsValue)

Example 2 with OwsDomain

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

the class AbstractGetCapabilitiesHandler method getAcceptLanguagesDomain.

private OwsDomain getAcceptLanguagesDomain() {
    Set<Locale> availableLocales = serviceMetadataRepository.getAvailableLocales();
    OwsPossibleValues possibleValues = new OwsAllowedValues(availableLocales.stream().map(LocaleHelper::encode).map(OwsValue::new));
    return new OwsDomain(GetCapabilitiesParams.AcceptLanguages, possibleValues);
}
Also used : Locale(java.util.Locale) OwsDomain(org.n52.shetland.ogc.ows.OwsDomain) OwsAllowedValues(org.n52.shetland.ogc.ows.OwsAllowedValues) LocaleHelper(org.n52.janmayen.i18n.LocaleHelper) OwsPossibleValues(org.n52.shetland.ogc.ows.OwsPossibleValues)

Example 3 with OwsDomain

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

the class AbstractGetCapabilitiesHandler method getSectionsDomain.

private OwsDomain getSectionsDomain() {
    OwsPossibleValues possibleValues = new OwsAllowedValues(Arrays.stream(OWSConstants.CapabilitiesSection.values()).map(Object::toString).map(OwsValue::new));
    OwsValue defaultValue = new OwsValue(OWSConstants.CapabilitiesSection.All.toString());
    return new OwsDomain(GetCapabilitiesParams.Sections, possibleValues, defaultValue);
}
Also used : OwsDomain(org.n52.shetland.ogc.ows.OwsDomain) OwsAllowedValues(org.n52.shetland.ogc.ows.OwsAllowedValues) OwsPossibleValues(org.n52.shetland.ogc.ows.OwsPossibleValues) OwsValue(org.n52.shetland.ogc.ows.OwsValue)

Example 4 with OwsDomain

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

the class AbstractCapabilitiesBaseTypeDecoder method parseDomain.

private OwsDomain parseDomain(DomainType domain) {
    if (domain == null) {
        return null;
    }
    OwsValue defaultValue = parseValue(domain.getDefaultValue());
    Collection<OwsMetadata> metadata = parseMetadata(domain.getMetadataArray());
    OwsDomainMetadata meaning = parseDomainMetadata(domain.getMeaning());
    OwsDomainMetadata dataType = parseDomainMetadata(domain.getDataType());
    OwsValuesUnit valuesUnit = Stream.of(parseUom(domain.getUOM()), parseReferenceSystem(domain.getReferenceSystem())).filter(Objects::nonNull).findFirst().orElse(null);
    OwsPossibleValues possibleValues = Stream.of(parseAnyValue(domain.getAnyValue()), parseAllowedValues(domain.getAllowedValues()), parseValuesReference(domain.getValuesReference()), parseNoValues(domain.getNoValues())).filter(Objects::nonNull).findFirst().orElse(null);
    return new OwsDomain(domain.getName(), possibleValues, defaultValue, meaning, dataType, valuesUnit, metadata);
}
Also used : OwsDomain(org.n52.shetland.ogc.ows.OwsDomain) OwsDomainMetadata(org.n52.shetland.ogc.ows.OwsDomainMetadata) OwsMetadata(org.n52.shetland.ogc.ows.OwsMetadata) OwsValuesUnit(org.n52.shetland.ogc.ows.OwsValuesUnit) Objects(java.util.Objects) OwsPossibleValues(org.n52.shetland.ogc.ows.OwsPossibleValues) OwsValue(org.n52.shetland.ogc.ows.OwsValue)

Example 5 with OwsDomain

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

the class AbstractCapabilitiesBaseTypeDecoder method parseOperationMetadata.

private OwsOperationsMetadata parseOperationMetadata(OperationsMetadata operationsMetadata) {
    if (operationsMetadata == null) {
        return null;
    }
    List<OwsOperation> operations = parseOperations(operationsMetadata.getOperationArray());
    List<OwsDomain> parameters = parseDomains(operationsMetadata.getParameterArray());
    List<OwsDomain> constraints = parseDomains(operationsMetadata.getConstraintArray());
    OwsOperationMetadataExtension extension = parseOperationsMetadataExtension(operationsMetadata.getExtendedCapabilities());
    return new OwsOperationsMetadata(operations, parameters, constraints, extension);
}
Also used : OwsDomain(org.n52.shetland.ogc.ows.OwsDomain) OwsOperationsMetadata(org.n52.shetland.ogc.ows.OwsOperationsMetadata) OwsOperation(org.n52.shetland.ogc.ows.OwsOperation) OwsOperationMetadataExtension(org.n52.shetland.ogc.ows.OwsOperationMetadataExtension)

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