Search in sources :

Example 1 with OwsOperationsMetadata

use of org.n52.shetland.ogc.ows.OwsOperationsMetadata 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)

Example 2 with OwsOperationsMetadata

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

the class OwsEncoderv110 method encodeOperationsMetadata.

private OperationsMetadata encodeOperationsMetadata(OwsOperationsMetadata om) throws EncodingException {
    OperationsMetadata xom = OperationsMetadata.Factory.newInstance(getXmlOptions());
    om.getOperations().forEach(x -> encodeOwsOperation(x, xom.addNewOperation()));
    om.getConstraints().forEach(x -> encodeOwsDomain(x, xom.addNewConstraint()));
    om.getParameters().forEach(x -> encodeOwsDomain(x, xom.addNewParameter()));
    if (om.getExtension().isPresent()) {
        xom.setExtendedCapabilities(encodeOwsOperationsMetadataExtension(om.getExtension().get()));
    }
    return xom;
}
Also used : OperationsMetadata(net.opengis.ows.x11.OperationsMetadataDocument.OperationsMetadata) OwsOperationsMetadata(org.n52.shetland.ogc.ows.OwsOperationsMetadata)

Example 3 with OwsOperationsMetadata

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

the class AbstractGetCapabilitiesHandler method createCapabilities.

private OwsCapabilities createCapabilities(GetCapabilitiesRequest request, String service, String version) throws OwsExceptionReport {
    Set<CapabilitiesSection> sections = getRequestedSections(request);
    Locale requestedLocale = getRequestedLocale(request);
    String updateSequence = null;
    OwsServiceIdentification serviceIdentification = null;
    if (sections.contains(CapabilitiesSection.ServiceIdentification)) {
        serviceIdentification = getServiceIdentification(service, requestedLocale);
    }
    OwsServiceProvider serviceProvider = null;
    if (sections.contains(CapabilitiesSection.ServiceProvider)) {
        serviceProvider = getServiceProvider(service, requestedLocale);
    }
    OwsOperationsMetadata operationsMetadata = null;
    if (sections.contains(CapabilitiesSection.OperationsMetadata)) {
        operationsMetadata = getOperations(service, version);
    }
    Set<String> languages = null;
    if (sections.contains(CapabilitiesSection.Languages)) {
        languages = getLanguages();
    }
    T contents = null;
    if (sections.contains(CapabilitiesSection.Contents)) {
        contents = createContents(service, version);
    }
    Collection<OwsCapabilitiesExtension> extensions = getExtensions(request, service, version);
    OwsCapabilities capabilities = new OwsCapabilities(service, version, updateSequence, serviceIdentification, serviceProvider, operationsMetadata, languages, extensions);
    return createCapabilities(capabilities, contents);
}
Also used : Locale(java.util.Locale) OwsCapabilitiesExtension(org.n52.shetland.ogc.ows.OwsCapabilitiesExtension) CapabilitiesSection(org.n52.shetland.ogc.ows.OWSConstants.CapabilitiesSection) OwsOperationsMetadata(org.n52.shetland.ogc.ows.OwsOperationsMetadata) OwsServiceProvider(org.n52.shetland.ogc.ows.OwsServiceProvider) OwsCapabilities(org.n52.shetland.ogc.ows.OwsCapabilities) OwsServiceIdentification(org.n52.shetland.ogc.ows.OwsServiceIdentification)

Example 4 with OwsOperationsMetadata

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

the class AbstractGetCapabilitiesHandler method getOperations.

private OwsOperationsMetadata getOperations(String service, String version) throws OwsExceptionReport {
    Collection<OwsDomain> parameters = getCommonParameters(service);
    Collection<OwsDomain> constraints = null;
    Collection<OwsOperation> operations = new LinkedList<>();
    OwsOperationMetadataExtension extension = getOperationsMetadataExtension(service, version);
    for (RequestOperatorKey operatorKey : requestOperatorRepository.getActiveRequestOperatorKeys(new OwsServiceKey(service, version))) {
        Optional.ofNullable(requestOperatorRepository.getRequestOperator(operatorKey).getOperationMetadata(service, version)).ifPresent(operations::add);
    }
    return new OwsOperationsMetadata(operations, parameters, constraints, extension);
}
Also used : OwsDomain(org.n52.shetland.ogc.ows.OwsDomain) RequestOperatorKey(org.n52.iceland.request.operator.RequestOperatorKey) OwsOperationsMetadata(org.n52.shetland.ogc.ows.OwsOperationsMetadata) OwsOperation(org.n52.shetland.ogc.ows.OwsOperation) OwsServiceKey(org.n52.shetland.ogc.ows.service.OwsServiceKey) OwsOperationMetadataExtension(org.n52.shetland.ogc.ows.OwsOperationMetadataExtension) LinkedList(java.util.LinkedList)

Example 5 with OwsOperationsMetadata

use of org.n52.shetland.ogc.ows.OwsOperationsMetadata 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)

Aggregations

OwsOperationsMetadata (org.n52.shetland.ogc.ows.OwsOperationsMetadata)6 OwsDomain (org.n52.shetland.ogc.ows.OwsDomain)3 OwsServiceIdentification (org.n52.shetland.ogc.ows.OwsServiceIdentification)3 OwsServiceProvider (org.n52.shetland.ogc.ows.OwsServiceProvider)3 OwsCapabilities (org.n52.shetland.ogc.ows.OwsCapabilities)2 OwsCapabilitiesExtension (org.n52.shetland.ogc.ows.OwsCapabilitiesExtension)2 OwsOperation (org.n52.shetland.ogc.ows.OwsOperation)2 OwsOperationMetadataExtension (org.n52.shetland.ogc.ows.OwsOperationMetadataExtension)2 LinkedList (java.util.LinkedList)1 Locale (java.util.Locale)1 DomainMetadataType (net.opengis.ows.x11.DomainMetadataType)1 DomainType (net.opengis.ows.x11.DomainType)1 MetadataType (net.opengis.ows.x11.MetadataType)1 OperationsMetadata (net.opengis.ows.x11.OperationsMetadataDocument.OperationsMetadata)1 RequestOperatorKey (org.n52.iceland.request.operator.RequestOperatorKey)1 LocalizedString (org.n52.janmayen.i18n.LocalizedString)1 MultilingualString (org.n52.janmayen.i18n.MultilingualString)1 CapabilitiesSection (org.n52.shetland.ogc.ows.OWSConstants.CapabilitiesSection)1 OwsAcceptVersions (org.n52.shetland.ogc.ows.OwsAcceptVersions)1 OwsLanguageString (org.n52.shetland.ogc.ows.OwsLanguageString)1