Package org.geoserver.wms

Examples of org.geoserver.wms.DescribeLayerRequest


    private DescribeLayerRequest getRequest(Map<String, String> rawKvp, Map<String, Object> kvp)
            throws Exception {

        DescribeLayerKvpRequestReader reader = new DescribeLayerKvpRequestReader(wms);
        DescribeLayerRequest req = (DescribeLayerRequest) reader.createRequest();
        return (DescribeLayerRequest) reader.read(req, kvp, rawKvp);
    }
View Full Code Here


        catalog.add(layerInfo2);

        params.put("LAYERS", "topp:states,topp:fakeCoverage");
        Map<String, Object> kvp = new HashMap<String, Object>(params);
        kvp.put("LAYERS", Arrays.asList(new MapLayerInfo(layerInfo), new MapLayerInfo(layerInfo2)));
        DescribeLayerRequest describeRequest = getRequest(params, kvp);
        assertNotNull(describeRequest);
        assertNotNull(describeRequest.getLayers());
        assertEquals(2, describeRequest.getLayers().size());
    }
View Full Code Here

        catalog.add(coverageInfo);
        catalog.add(coverageLayerInfo);

        geoServerImpl.add(new WMSInfoImpl());
        WMS wms = new WMS(geoServerImpl);
        request = new DescribeLayerRequest();
        request.setBaseUrl("http://localhost:8080/geoserver");
        request.setVersion(WMS.VERSION_1_1_1.toString());
    }
View Full Code Here

    private DescribeLayerRequest getRequest(Map<String, String> rawKvp, Map<String, Object> kvp)
            throws Exception {

        DescribeLayerKvpRequestReader reader = new DescribeLayerKvpRequestReader(wms);
        DescribeLayerRequest req = (DescribeLayerRequest) reader.createRequest();
        return (DescribeLayerRequest) reader.read(req, kvp, rawKvp);
    }
View Full Code Here

        catalog.add(layerInfo2);

        params.put("LAYERS", "topp:states,topp:fakeCoverage");
        Map<String, Object> kvp = new HashMap<String, Object>(params);
        kvp.put("LAYERS", Arrays.asList(new MapLayerInfo(layerInfo), new MapLayerInfo(layerInfo2)));
        DescribeLayerRequest describeRequest = getRequest(params, kvp);
        assertNotNull(describeRequest);
        assertNotNull(describeRequest.getLayers());
        assertEquals(2, describeRequest.getLayers().size());
    }
View Full Code Here

        catalog.add(coverageInfo);
        catalog.add(coverageLayerInfo);

        geoServerImpl.add(new WMSInfoImpl());
        WMS wms = new WMS(geoServerImpl);
        request = new DescribeLayerRequest();
        request.setBaseUrl("http://localhost:8080/geoserver");
        request.setVersion(WMS.VERSION_1_1_1.toString());
    }
View Full Code Here

     */
    @SuppressWarnings({ "rawtypes", "unchecked" })
    @Override
    public Object read(Object req, Map kvp, Map rawKvp) throws Exception {

        DescribeLayerRequest request = (DescribeLayerRequest) super.read(req, kvp, rawKvp);
        request.setRawKvp(rawKvp);

        final String version = request.getVersion();
        if (null == version) {
            String code = "NoVersionInfo";
            String simpleName = getClass().getSimpleName();
            throw new ServiceException(
                    "Version parameter not provided for DescribeLayer operation", code, simpleName);
        }

        if (!wms.getVersion().equals(version)) {
            throw new ServiceException("Wrong value for version parameter: " + version
                    + ". This server accetps version " + wms.getVersion(), "InvalidVersion",
                    getClass().getSimpleName());
        }

        List<MapLayerInfo> layers = new MapLayerInfoKvpParser("LAYERS", wms).parse((String) rawKvp.get("LAYERS"));
        request.setLayers(layers);
        if (layers == null || layers.size() == 0) {
            throw new ServiceException("No LAYERS has been requested", "NoLayerRequested",
                    getClass().getName());
        }
        return request;
View Full Code Here

        public void encode(Object o) throws IllegalArgumentException {
            if (!(o instanceof DescribeLayerRequest)) {
                throw new IllegalArgumentException();
            }

            DescribeLayerRequest req = (DescribeLayerRequest) o;

            AttributesImpl versionAtt = new AttributesImpl();
            final String requestVersion = req.getVersion();
            if (requestVersion == null) {
                throw new NullPointerException("requestVersion");
            }

            versionAtt.addAttribute("", "version", "version", "", requestVersion);
View Full Code Here

    public String getMimeType(Object value, Operation operation)
      throws ServiceException {

    Object op = operation.getParameters()[0];
    if (op instanceof DescribeLayerRequest) {
      DescribeLayerRequest dlr = (DescribeLayerRequest) op;
      return dlr.getOutputFormat();
    }
    throw new ServiceException("Unable to parse incoming operation");
  }
View Full Code Here

            ServiceException {

       
        Assert.notNull(operation.getParameters());
        Assert.isTrue(operation.getParameters()[0] instanceof DescribeLayerRequest);
        final DescribeLayerRequest request = (DescribeLayerRequest) operation.getParameters()[0];
       
        Assert.isTrue(value instanceof DescribeLayerModel);
        final DescribeLayerModel results = (DescribeLayerModel) value;
        try {
          write(results, request, output);
View Full Code Here

TOP

Related Classes of org.geoserver.wms.DescribeLayerRequest

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.