Package com.boundlessgeo.geoserver.json

Examples of com.boundlessgeo.geoserver.json.JSONArr.addObject()


        JSONArr arr = obj.putArray("layers");
        try (
            CloseableIterator<LayerInfo> it = cat.list(LayerInfo.class, filter, offset(page, count), count, sortBy);
        ) {
            while (it.hasNext()) {
                layer(arr.addObject(), it.next(), req);
            }
        }

        return obj;
    }
View Full Code Here


        response.setStatus(HttpStatus.BAD_REQUEST.value());
       
        JSONObj obj = IO.error(new JSONObj(), e);
        JSONArr errors = obj.putArray("errors");
        for (MarkedYAMLException error : e.errors()) {
            JSONObj err = errors.addObject()
                .put("problem", error.getProblem());
            Mark mark = error.getProblemMark();
            if (mark != null) {
                err.put("line", mark.getLine()).put("column", mark.getColumn());
            }
View Full Code Here

        Catalog cat = geoServer.getCatalog();
        JSONArr arr = new JSONArr();
       
        for (Ref ref : recent.list(LayerInfo.class)) {
            LayerInfo layer = cat.getLayer(ref.id);
            IO.layer(arr.addObject(), layer, req);
        }
        return arr;
    }

    JSONObj layer(JSONObj obj, LayerInfo l, HttpServletRequest req) {
View Full Code Here

    @RequestMapping(method = RequestMethod.GET)
    public @ResponseBody JSONArr list() {
        JSONArr list = new JSONArr();
        for (DataFormat<?> format : formats()) {
            encode(list.addObject(), format);
        }

        return list;
    }
View Full Code Here

            obj.put("vendor", g.real.getVendor())
               .put("version", g.real.getVersion());

            JSONArr connection = obj.putArray("params");
            IO.param(connection.addObject(), g.real);

            return obj;
        }

        DataFormat<Class<?>> s = findServiceFormat(name);
View Full Code Here

        JSONObj cache = obj.putObject("recent");

        JSONArr recentMaps = cache.putArray("maps");
        for (Ref ref : recent.list(LayerGroupInfo.class)) {
            IO.ref(recentMaps.addObject(), ref);
        }

        return obj;
    }
}
View Full Code Here

        CloseableIterator<LayerGroupInfo> it = cat.list(LayerGroupInfo.class, equal("workspace.name", wsName));
        try {
            while (it.hasNext()) {
                LayerGroupInfo map = it.next();
                if( checkMap( map ) ){
                    JSONObj obj = arr.addObject();
                    map(obj, map, wsName);
                }
            }
        }
        finally {
View Full Code Here

    }
   
    private JSONArr mapLayerList(LayerGroupInfo map, HttpServletRequest req){
        JSONArr arr = new JSONArr();
        for (PublishedInfo l : Lists.reverse(map.getLayers())) {
            layer(arr.addObject(), l, req);
        }
        return arr;
    }
    @RequestMapping(value="/{wsName}/{name}/layers", method = RequestMethod.GET)
    public @ResponseBody
View Full Code Here

        Catalog cat = geoServer.getCatalog();

        for (Ref ref : recent.list(LayerGroupInfo.class)) {
            LayerGroupInfo map = cat.getLayerGroup(ref.id);
            if( checkMap( map ) ){
                JSONObj obj = arr.addObject();
                map(obj, map, map.getWorkspace().getName());
            }
        }
        return arr;
    }
View Full Code Here

        map(obj,map,wsName);
       
        List<PublishedInfo> published = Lists.reverse(map.getLayers());
        JSONArr layers = obj.putArray("layers");
        for (PublishedInfo l : published) {
            layer(layers.addObject(), l, req);
        }
        return obj;
    }
   
    private JSONObj layer(JSONObj obj, PublishedInfo l, HttpServletRequest req) {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.