Package org.geotools.data.ows

Examples of org.geotools.data.ows.OperationType


        GeneralEnvelope envelope = wms.getEnvelope(layer, crs);
        assertFalse(envelope.isEmpty() || envelope.isNull() || envelope.isInfinite());
        assertNotNull("Envelope "+CRS.toSRS(crs), envelope);

        GetMapRequest getMap = wms.createGetMapRequest();
        OperationType operationType = wms.getCapabilities().getRequest().getGetMap();

        getMap.addLayer(layer);
        String version = wms.getCapabilities().getVersion();
       
        getMap.setBBox(envelope);
View Full Code Here


        GeneralEnvelope envelope = wms.getEnvelope(layer, crs);
        assertFalse(envelope.isEmpty() || envelope.isNull() || envelope.isInfinite());
        assertNotNull("Envelope "+CRS.toSRS(crs), envelope);
   
        GetMapRequest getMap = wms.createGetMapRequest();
        OperationType operationType = wms.getCapabilities().getRequest().getGetMap();

        getMap.addLayer(layer);
        String version = wms.getCapabilities().getVersion();
        String srs = CRS.toSRS(envelope.getCoordinateReferenceSystem());
        getMap.setBBox(envelope);
View Full Code Here

            }

            List l = new LinkedList();

            for (int i = 0; i < value.length; i++) {
                OperationType t = (OperationType) value[i].getValue();
                l.add(t);
            }

            return l.toArray(new OperationType[(l.size())]);
        }
View Full Code Here

                if ((sdl == null) && (value[i].getElement() != null)
                        && "SchemaDescriptionLanguage".equals(
                            value[i].getElement().getName())) {
                    sdl = (List) value[i].getValue();
                } else {
                    OperationType t = (OperationType) value[i].getValue();
                    l.add(t);
                }
            }

            OperationType[] ot = new OperationType[l.size()];
View Full Code Here

            }

            List l = new LinkedList();

            for (int i = 0; i < value.length; i++) {
                OperationType t = (OperationType) value[i].getValue();
                l.add(t);
            }

            return l.toArray(new OperationType[l.size()]);
        }
View Full Code Here

                if ((sdl == null) && (value[i].getElement() != null)
                        && elements[0].getName().equals(value[i].getElement()
                                                                    .getName())) {
                    sdl = (List) value[i].getValue();
                } else {
                    OperationType t = (OperationType) value[i].getValue();
                    l.add(t);
                }
            }

            OperationType[] ot = new OperationType[l.size()];
View Full Code Here

            if (value.length < 1) {
                throw new SAXException(
                    "Must have atleast one http type defined.");
            }

            OperationType c = new OperationType();

            for (int i = 0; i < value.length; i++) {
                if ((value[i].getElement() != null)
                        && value[i].getElement().getName().equals(elements[0]
                            .getName())) {
                    // get
                    c.setGet((URL) value[i].getValue());
                }

                if ((value[i].getElement() != null)
                        && value[i].getElement().getName().equals(elements[1]
                            .getName())) {
                    // post
                    c.setPost((URL) value[i].getValue());
                }
            }

            return c;
        }
View Full Code Here

                if (t != null) {
                    if (elements[0].getName().equals(value[i].getElement()
                                                                 .getName())) {
                        if (result[0] == null) {
                            result[0] = new OperationType();
                        }

                        // merge them
                        for (int j = 0; j < t.length; j++) {
                            if ((result[0].getGet() == null)
                                    && (t[j].getGet() != null)) {
                                result[0].setGet(t[j].getGet());
                            }

                            if ((result[0].getPost() == null)
                                    && (t[j].getPost() != null)) {
                                result[0].setPost(t[j].getPost());
                            }
                        }
                    } else {
                        if (elements[1].getName().equals(value[i].getElement()
                                                                     .getName())) {
                            if (result[1] == null) {
                                result[1] = new OperationType();
                            }

                            // merge them
                            for (int j = 0; j < t.length; j++) {
                                if ((result[1].getGet() == null)
                                        && (t[j].getGet() != null)) {
                                    result[1].setGet(t[j].getGet());
                                }

                                if ((result[1].getPost() == null)
                                        && (t[j].getPost() != null)) {
                                    result[1].setPost(t[j].getPost());
                                }

                                if (t[j].getFormats() != null) {
                                    if (result[1].getFormats() == null) {
                                        result[1].setFormats(t[j].getFormats());
                                    } else {
                                        List st = result[0].getFormats();

                                        if (t[j].getFormats() == null) {
                                            t[j].setFormats(st);
                                        } else if (st != null) {
                                            t[j].getFormats().addAll(st);
                                        }
                                    }
                                }
                            }
                        } else {
                            if (elements[2].getName().equals(value[i].getElement()
                                                                         .getName())) {
                                if (result[2] == null) {
                                    result[2] = new OperationType();
                                }

                                // merge them
                                for (int j = 0; j < t.length; j++) {
                                    if ((result[2].getGet() == null)
                                            && (t[j].getGet() != null)) {
                                        result[2].setGet(t[j].getGet());
                                    }

                                    if ((result[2].getPost() == null)
                                            && (t[j].getPost() != null)) {
                                        result[2].setPost(t[j].getPost());
                                    }
                                }
                            } else {
                                if (elements[3].getName().equals(value[i].getElement()
                                                                             .getName())) {
                                    if (result[3] == null) {
                                        result[3] = new OperationType();
                                    }

                                    // merge them
                                    for (int j = 0; j < t.length; j++) {
                                        if ((result[3].getGet() == null)
                                                && (t[j].getGet() != null)) {
                                            result[3].setGet(t[j].getGet());
                                        }

                                        if ((result[3].getPost() == null)
                                                && (t[j].getPost() != null)) {
                                            result[3].setPost(t[j].getPost());
                                        }

                                        if (t[j].getFormats() != null) {
                                            if (result[3].getFormats() == null) {
                                                result[3].setFormats(t[j]
                                                    .getFormats());
                                            } else {
                                                List st = (List) result[0]
                                                    .getFormats();

                                                if (t[j].getFormats() == null) {
                                                    t[j].setFormats(st);
                                                } else if (st != null) {
                                                    ((List) t[j].getFormats())
                                                    .addAll(st);
                                                }
                                            }
                                        }
                                    }
                                } else {
                                    if (elements[4].getName().equals(value[i].getElement()
                                                                                 .getName())) {
                                        if (result[4] == null) {
                                            result[4] = new OperationType();
                                        }

                                        // merge them
                                        for (int j = 0; j < t.length; j++) {
                                            if ((result[4].getGet() == null)
                                                    && (t[j].getGet() != null)) {
                                                result[4].setGet(t[j].getGet());
                                            }

                                            if ((result[4].getPost() == null)
                                                    && (t[j].getPost() != null)) {
                                                result[4].setPost(t[j].getPost());
                                            }

                                            if (t[j].getFormats() != null) {
                                                if (result[4].getFormats() == null) {
                                                    result[4].setFormats(t[j]
                                                        .getFormats());
                                                } else {
                                                    List st = (List) result[0]
                                                        .getFormats();

                                                    if (t[j].getFormats() == null) {
                                                        t[j].setFormats(st);
                                                    } else if (st != null) {
                                                        ((List) t[j].getFormats())
                                                        .addAll(st);
                                                    }
                                                }
                                            }
                                        }
                                    } else {
                                        if (elements[5].getName().equals(value[i].getElement()
                                                                                     .getName())) {
                                            if (result[5] == null) {
                                                result[5] = new OperationType();
                                            }

                                            // merge them
                                            for (int j = 0; j < t.length;
                                                    j++) {
View Full Code Here

    }

    @Override
    public URL getOperationURL(WFSOperationType operation, HttpMethod method)
            throws UnsupportedOperationException {
        OperationType operationType;
        switch (operation) {
        case DESCRIBE_FEATURETYPE:
            operationType = capabilities.getDescribeFeatureType();
            break;
        case GET_CAPABILITIES:
            operationType = capabilities.getGetCapabilities();
            break;
        case GET_FEATURE:
            operationType = capabilities.getGetFeature();
            break;
        case GET_FEATURE_WITH_LOCK:
            operationType = capabilities.getGetFeatureWithLock();
            break;
        case LOCK_FEATURE:
            operationType = capabilities.getLockFeature();
            break;
        case TRANSACTION:
            operationType = capabilities.getTransaction();
            break;
        default:
            throw new IllegalArgumentException("Unknown operation type " + operation);
        }
        if (operationType == null) {
            throw new UnsupportedOperationException(operation + " not supported by the server");
        }
        URL url;
        if (GET == method) {
            url = operationType.getGet();
        } else {
            url = operationType.getPost();
        }
        if (url == null) {
            throw new UnsupportedOperationException("Method " + method + " for " + operation
                    + " is not supported by the server");
        }
View Full Code Here

                icon = new ImageIcon( image );               
                if ( layer.getChildren() != null && layer.getChildren().length != 0) {
                    // Do not request "parent" layer graphics - this kills Mapserver                   
                    return icon;
                }
                OperationType getLegendGraphic = getCapabilities().getRequest().getGetLegendGraphic();
                if( getLegendGraphic == null ){
                    // this wms server does not support legend graphics
                    return icon;
                }
                GetLegendGraphicRequest request = createGetLegendGraphicRequest();
                request.setLayer( layer.getName() );
                request.setWidth("16");
                request.setHeight("16");

                String desiredFormat = null;
                List<String> formats = getLegendGraphic.getFormats();
                if (formats.contains("image/png")) {
                    desiredFormat = "image/png";
                }
                else if (formats.contains("image/gif")) {
                    desiredFormat = "image/gif";
View Full Code Here

TOP

Related Classes of org.geotools.data.ows.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.