Package net.opengis.ows10

Examples of net.opengis.ows10.OperationType


     * @param operationsMetadata
     */
    private void OperationMetadata_GetRecords(Ows10Factory owsf, String baseUrl,
            OperationsMetadataType operationsMetadata) {
        // - GetRecords
        OperationType getRecords = owsf.createOperationType();
        operationsMetadata.getOperation().add(getRecords);

        getRecords.setName("GetRecords");
        DCPType getRecordsDCP = owsf.createDCPType();
        getRecords.getDCP().add(getRecordsDCP);

        HTTPType getRecordsHTTP = owsf.createHTTPType();
        getRecordsDCP.setHTTP(getRecordsHTTP);

        String getRecordsHref = ResponseUtils.buildURL(baseUrl, "csw",
                new HashMap<String, String>(), URLType.SERVICE);

        RequestMethodType getRecordsGet = owsf.createRequestMethodType();
        getRecordsGet.setHref(getRecordsHref);
        getRecordsHTTP.getGet().add(getRecordsGet);

        RequestMethodType getRecordsPost = owsf.createRequestMethodType();
        getRecordsPost.setHref(getRecordsHref);

        // - GetRecords - constraints
        DomainType getRecordsPostConstraints = owsf.createDomainType();
        getRecordsPostConstraints.setName("PostEncoding");
        getRecordsPostConstraints.getValue().add("XML");

        getRecordsPost.getConstraint().add(getRecordsPostConstraints);
        getRecordsHTTP.getPost().add(getRecordsPost);

        // - Parameters
        for (DomainType param : operationParameters.get("GetRecords"))
        {
            // clone the object, as the caps decorators might want to modify it
            getRecords.getParameter().add(EcoreUtil.copy(param));
        }

        // - Constraints
        for (DomainType constraint : operationConstraints.get("GetRecords"))
        {
            // clone the object, as the caps decorators might want to modify it
            getRecords.getConstraint().add(EcoreUtil.copy(constraint));
        }
       
        // the additional queriables based on the store
        try {
            for(RecordDescriptor rd : store.getRecordDescriptors()) {              
                List<Name> queriables = store.getCapabilities().getQueriables(rd.getFeatureDescriptor().getName() );
                if(queriables != null && queriables.size() > 0) {
                    DomainType dt = owsf.createDomainType();
                    dt.setName(rd.getQueryablesDescription());                   
                    NamespaceSupport nss = rd.getNamespaceSupport();
                       
                    for (Name q : queriables) {                      
                        String prefix = nss.getPrefix(q.getNamespaceURI());
                        dt.getValue().add(prefix==null? q.getLocalPart() : prefix + ":" + q.getLocalPart());
                    }                       
                    getRecords.getConstraint().add(dt);
                }
               
            }
           
            DomainType dt = owsf.createDomainType();
            dt.setName("XPathQueryables");
            dt.getValue().add("allowed");
            getRecords.getConstraint().add(dt);
           
        } catch (IOException e) {
            LOGGER.log(Level.WARNING, "Failed to encode getRecords additional queriables", e);
        }
    }
View Full Code Here


     * @param operationsMetadata
     */
    private void OperationMetadata_GetRecordById(Ows10Factory owsf, String baseUrl,
            OperationsMetadataType operationsMetadata) {
        // - GetRecordById
        OperationType getRecordById = owsf.createOperationType();
        operationsMetadata.getOperation().add(getRecordById);

        getRecordById.setName("GetRecordById");
        DCPType getRecordByIdDCP = owsf.createDCPType();
        getRecordById.getDCP().add(getRecordByIdDCP);

        HTTPType getRecordByIdHTTP = owsf.createHTTPType();
        getRecordByIdDCP.setHTTP(getRecordByIdHTTP);

        String getRecordByIdHref = ResponseUtils.buildURL(baseUrl, "csw",
                new HashMap<String, String>(), URLType.SERVICE);

        RequestMethodType getRecordByIdGet = owsf.createRequestMethodType();
        getRecordByIdGet.setHref(getRecordByIdHref);
        getRecordByIdHTTP.getGet().add(getRecordByIdGet);

        RequestMethodType getRecordByIdPost = owsf.createRequestMethodType();
        getRecordByIdPost.setHref(getRecordByIdHref);

        // - GetRecordById - constraints
        DomainType getRecordByIdPostConstraints = owsf.createDomainType();
        getRecordByIdPostConstraints.setName("PostEncoding");
        getRecordByIdPostConstraints.getValue().add("XML");

        getRecordByIdPost.getConstraint().add(getRecordByIdPostConstraints);
        getRecordByIdHTTP.getPost().add(getRecordByIdPost);
       
        // - Parameters
        for (DomainType param : operationParameters.get("GetRecordById"))
        {
            // clone the object, as the caps decorators might want to modify it
            getRecordById.getParameter().add(EcoreUtil.copy(param));
        }

        // - Constraints
        for (DomainType constraint : operationConstraints.get("GetRecordById"))
        {
            // clone the object, as the caps decorators might want to modify it
            getRecordById.getConstraint().add(EcoreUtil.copy(constraint));
        }
    }
View Full Code Here

     * @param operationsMetadata
     */
    private void OperationMetadata_GetDomain(Ows10Factory owsf, String baseUrl,
            OperationsMetadataType operationsMetadata) {
        // - GetDomain
        OperationType getDomain = owsf.createOperationType();
        operationsMetadata.getOperation().add(getDomain);

        getDomain.setName("GetDomain");
        DCPType getDomainDCP = owsf.createDCPType();
        getDomain.getDCP().add(getDomainDCP);

        HTTPType getDomainHTTP = owsf.createHTTPType();
        getDomainDCP.setHTTP(getDomainHTTP);

        String getDomainHref = ResponseUtils.buildURL(baseUrl, "csw",
                new HashMap<String, String>(), URLType.SERVICE);

        RequestMethodType getDomainGet = owsf.createRequestMethodType();
        getDomainGet.setHref(getDomainHref);
        getDomainHTTP.getGet().add(getDomainGet);

        RequestMethodType getDomainPost = owsf.createRequestMethodType();
        getDomainPost.setHref(getDomainHref);

        // - GetDomain - constraints
        DomainType getDomainPostConstraints = owsf.createDomainType();
        getDomainPostConstraints.setName("PostEncoding");
        getDomainPostConstraints.getValue().add("XML");

        getDomainPost.getConstraint().add(getDomainPostConstraints);
        getDomainHTTP.getPost().add(getDomainPost);

        // - Fixed Parameters
        for (DomainType param : operationParameters.get("GetDomain"))
        {
            // clone the object, as the caps decorators might want to modify it
            getDomain.getParameter().add(EcoreUtil.copy(param));
        }
       
        // The domain queriables list from the catalog store
        try {
            Set<String> summary = new HashSet<String>();
            for (RecordDescriptor rd : store.getRecordDescriptors()) {
                List<Name> queriables = store.getCapabilities().getDomainQueriables(rd.getFeatureDescriptor().getName());

                if (queriables != null && queriables.size() > 0) {
                    NamespaceSupport nss = rd.getNamespaceSupport();
                    for (Name q : queriables) {                       
                        String prefix = nss.getPrefix(q.getNamespaceURI());
                        summary.add(prefix==null? q.getLocalPart() : prefix + ":" + q.getLocalPart());
                    }

                }
            }
               
            if(summary.size() > 0) {
                List<String> sorted = new ArrayList<String>(summary);
                Collections.sort(sorted);
                DomainType dt = owsf.createDomainType();
                dt.setName("PropertyName");
                for (String name : sorted) {
                    dt.getValue().add(name);
                }
                getDomain.getParameter().add(dt);
            }
        } catch (IOException e) {
            LOGGER.log(Level.WARNING, "Failed to encode getDomain ParameterName values", e);
        }

        // - Constraints
        for (DomainType constraint : operationConstraints.get("GetDomain"))
        {
            getDomain.getConstraint().add(EcoreUtil.copy(constraint));
        }
    }
View Full Code Here

     * @param operationsMetadata
     */
    private void OperationMetadata_Transaction(Ows10Factory owsf, String baseUrl,
            OperationsMetadataType operationsMetadata) {
        // - Transaction
        OperationType transaction = owsf.createOperationType();
        operationsMetadata.getOperation().add(transaction);

        transaction.setName("Transaction");
        DCPType transactionDCP = owsf.createDCPType();
        transaction.getDCP().add(transactionDCP);

        HTTPType transactionHTTP = owsf.createHTTPType();
        transactionDCP.setHTTP(transactionHTTP);

        String transactionHref = ResponseUtils.buildURL(baseUrl, "csw",
                new HashMap<String, String>(), URLType.SERVICE);

        RequestMethodType transactionGet = owsf.createRequestMethodType();
        transactionGet.setHref(transactionHref);
        transactionHTTP.getGet().add(transactionGet);

        RequestMethodType transactionPost = owsf.createRequestMethodType();
        transactionPost.setHref(transactionHref);

        // - Transaction - constraints
        DomainType transactionPostConstraints = owsf.createDomainType();
        transactionPostConstraints.setName("PostEncoding");
        transactionPostConstraints.getValue().add("XML");

        transactionPost.getConstraint().add(transactionPostConstraints);
        transactionHTTP.getPost().add(transactionPost);
       
        // - Parameters
        for (DomainType param : operationParameters.get("Transaction"))
        {
            // clone the object, as the caps decorators might want to modify it
            transaction.getParameter().add(EcoreUtil.copy(param));
        }

        // - Constraints
        for (DomainType constraint : operationConstraints.get("Transaction"))
        {
            // clone the object, as the caps decorators might want to modify it
            transaction.getConstraint().add(EcoreUtil.copy(constraint));
        }
       
    }
View Full Code Here

  @Override
  public CapabilitiesType decorate(CapabilitiesType caps, CatalogStore store) {
    // amend GetRecords
    OperationsMetadataType operations = caps.getOperationsMetadata();
    OperationType gro = getOperation("GetRecords", operations);

    DomainType outputFormats = getParameter("outputFormat", gro);
    outputFormats.getValue().add("text/xml");

    return caps;
View Full Code Here

  }

  private OperationType getOperation(String operationName,
      OperationsMetadataType operations) {
    for (Object o : operations.getOperation()) {
      OperationType op = (OperationType) o;
      if (operationName.equals(op.getName())) {
        return op;
      }
    }

    throw new IllegalArgumentException("Could not find operation "
View Full Code Here

     * @param operationsMetadata
     */
    private void OperationMetadata_GetCapabilities(Ows10Factory owsf, final String baseUrl,
            OperationsMetadataType operationsMetadata) {
        // - GetCapabilities
        OperationType getCapabilities = owsf.createOperationType();
        operationsMetadata.getOperation().add(getCapabilities);

        getCapabilities.setName("GetCapabilities");
        DCPType getCapabilitiesDCP = owsf.createDCPType();
        getCapabilities.getDCP().add(getCapabilitiesDCP);

        HTTPType getCapabilitiesHTTP = owsf.createHTTPType();
        getCapabilitiesDCP.setHTTP(getCapabilitiesHTTP);

        String getCapabilitiesHref = ResponseUtils.buildURL(baseUrl, "csw",
                new HashMap<String, String>(), URLType.SERVICE);

        RequestMethodType getCapabilitiesGet = owsf.createRequestMethodType();
        getCapabilitiesGet.setHref(getCapabilitiesHref);
        getCapabilitiesHTTP.getGet().add(getCapabilitiesGet);

        RequestMethodType getCapabilitiesPost = owsf.createRequestMethodType();
        getCapabilitiesPost.setHref(getCapabilitiesHref);
        getCapabilitiesHTTP.getPost().add(getCapabilitiesPost);

        // - Parameters
        for (DomainType param : operationParameters.get("GetCapabilities"))
        {
            // clone the object, as the caps decorators might want to modify it
            getCapabilities.getParameter().add(EcoreUtil.copy(param));
        }

        // - Constraints
        for (DomainType constraint : operationConstraints.get("GetCapabilities"))
        {
            // clone the object, as the caps decorators might want to modify it
            getCapabilities.getConstraint().add(EcoreUtil.copy(constraint));
        }
    }
View Full Code Here

        //assertFeatureTypeList(caps);
        //assertFilterCapabilities(caps);
    }

    private void assertOperationsMetadataDeeGree(WFSCapabilitiesType caps) {
        OperationsMetadataType om = caps.getOperationsMetadata();
        assertNotNull(om);

        assertEquals(6, om.getOperation().size());
       
        OperationType getCapsOp = (OperationType) om.getOperation().get(2);
        assertEquals("GetCapabilities", getCapsOp.getName());
        assertEquals( 1, getCapsOp.getDCP().size());
       
        DCPType dcp = (DCPType) getCapsOp.getDCP().get(0);
        assertEquals( 1, dcp.getHTTP().getGet().size() );
        assertEquals( 1, dcp.getHTTP().getPost().size() );
       
        assertEquals( "http://demo.deegree.org/deegree-wfs/services?", ((RequestMethodType) dcp.getHTTP().getGet().get(0)).getHref() );
        assertEquals( "http://demo.deegree.org/deegree-wfs/services", ((RequestMethodType) dcp.getHTTP().getPost().get(0)).getHref() );
       
        assertEquals("GetFeature", ((OperationType) om.getOperation().get(0)).getName());
        assertEquals("DescribeFeatureType", ((OperationType) om.getOperation().get(1)).getName());
        assertEquals("GetFeatureWithLock", ((OperationType) om.getOperation().get(3)).getName());
        assertEquals("LockFeature", ((OperationType) om.getOperation().get(4)).getName());
        assertEquals("Transaction", ((OperationType) om.getOperation().get(5)).getName());
    }
View Full Code Here

        assertEquals("WFS", sa.getServiceType().getValue());
        assertEquals("1.1.0", sa.getServiceTypeVersion());
    }

    void assertOperationsMetadata(WFSCapabilitiesType caps) {
        OperationsMetadataType om = caps.getOperationsMetadata();
        assertNotNull(om);

        assertEquals(6, om.getOperation().size());
       
        OperationType getCapsOp = (OperationType) om.getOperation().get(0);
        assertEquals("GetCapabilities", getCapsOp.getName());
        assertEquals( 1, getCapsOp.getDCP().size());
       
        DCPType dcp = (DCPType) getCapsOp.getDCP().get(0);
        assertEquals( 1, dcp.getHTTP().getGet().size() );
        assertEquals( 1, dcp.getHTTP().getPost().size() );
       
        assertEquals( "http://localhost:8080/geoserver/wfs", ((RequestMethodType) dcp.getHTTP().getGet().get(0)).getHref() );
        assertEquals( "http://localhost:8080/geoserver/wfs", ((RequestMethodType) dcp.getHTTP().getPost().get(0)).getHref() );
       
        assertEquals("DescribeFeatureType", ((OperationType) om.getOperation().get(1)).getName());
        assertEquals(1, ((OperationType) om.getOperation().get(1)).getDCP().size());
        assertEquals("GetFeature", ((OperationType) om.getOperation().get(2)).getName());
        assertEquals(1, ((OperationType) om.getOperation().get(2)).getDCP().size());
        assertEquals("LockFeature", ((OperationType) om.getOperation().get(3)).getName());
        assertEquals(1, ((OperationType) om.getOperation().get(3)).getDCP().size());
        assertEquals("GetFeatureWithLock", ((OperationType) om.getOperation().get(4)).getName());
        assertEquals(1, ((OperationType) om.getOperation().get(4)).getDCP().size());
        assertEquals("Transaction", ((OperationType) om.getOperation().get(5)).getName());
        assertEquals(1, ((OperationType) om.getOperation().get(5)).getDCP().size());
    }
View Full Code Here

    /**
     * @return the operation metadata advertised in the capabilities for the given operation
     * @see #getServerSupportedOutputFormats(WFSOperationType)
     */
    protected OperationType getOperationMetadata(final WFSOperationType operation) {
        final OperationsMetadataType operationsMetadata = capabilities.getOperationsMetadata();
        @SuppressWarnings("unchecked")
        final List<OperationType> operations = operationsMetadata.getOperation();
        final String expectedOperationName = operation.getName();
        for (OperationType operationType : operations) {
            String operationName = operationType.getName();
            if (expectedOperationName.equalsIgnoreCase(operationName)) {
                return operationType;
View Full Code Here

TOP

Related Classes of net.opengis.ows10.OperationType

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.