Package org.geoserver.catalog

Examples of org.geoserver.catalog.Catalog.save()


            ResourcePool resourcePool = catalog.getResourcePool();
            resourcePool.clear(info);
            catalog.save(info);

            for (CoverageInfo coverage : alreadyConfigured) {
                catalog.save(coverage);
            }
            LOGGER.finer("Saved store " + info.getName());
        } catch (RuntimeException e) {
            LOGGER.log(Level.WARNING, "Saving the store for " + info.getURL(), e);
            throw new IllegalArgumentException("Unable to save the store: " + e.getMessage());
View Full Code Here


        layer.setEnabled(true);

        if (layer.getId() == null) {
            catalog.add(layer);
        } else {
            catalog.save(layer);
        }

        Document dom = getAsDOM("wcs?service=WCS&version=2.0.1&request=DescribeEOCoverageSet&eoId=sf__waterview_dss");
        assertEquals("4", xpath.evaluate("count(//wcs:CoverageDescriptions/wcs:CoverageDescription)", dom));
View Full Code Here

            String namespaceURI = name.getNamespaceURI();
            String localPart = name.getLocalPart();
            FeatureTypeInfo typeInfo = catalog.getFeatureTypeByName(namespaceURI, localPart);
            LayerInfo layer = catalog.getLayerByName(typeInfo.getPrefixedName());
            layer.getMetadata().put(Properties.INDEXING_ENABLED, Boolean.TRUE);
            catalog.save(layer);
        }

        Map<String, String> namespaces = new HashMap<String, String>();
        namespaces.put("atom", "http://www.w3.org/2005/Atom");
        namespaces.put("geo", "http://www.google.com/geo/schemas/sitemap/1.0");
View Full Code Here

                Catalog catalog = ((GeoServerApplication)getApplication()).getCatalog();
                StyleInfo style = (StyleInfo) styleChoice.getModelObject();
               
                try {
                    catalog.getResourcePool().writeStyle(style, new ByteArrayInputStream(sld.getBytes()));
                    catalog.save(style);
                   
                    mapPanel.update(null,style,target);
                }
                catch (IOException e) {
                    throw new RuntimeException(e);
View Full Code Here

        getCatalog().save(resource);
       
        Catalog catalog = getCatalog();
        DataStoreInfo info =catalog.getDataStoreByName(MockData.SF_PREFIX);
        info.setEnabled(false);
        catalog.save(info);
    }
    /**
     * As for section 7.2.4.1, ensures the GeCapabilities document validates against its schema
     */
 
View Full Code Here

        // add the target code to the supported ones
        Catalog catalog = getCatalog();
        final String layerId = getLayerId(TASMANIA_BM);
        CoverageInfo ci = catalog.getCoverageByName(layerId);
        ci.getResponseSRS().add("EPSG:3857");
        catalog.save(ci);

        // do the request
        Map<String, Object> raw = baseMap();
        raw.put("identifier", layerId);
        raw.put("format", "image/geotiff");
View Full Code Here

        Catalog cat = getCatalog();
        FeatureTypeInfo ft1 = cat.getFeatureTypeByName("sf", "PrimitiveGeoFeature");
        FeatureTypeInfo ft2 = cat.getFeatureTypeByName("sf", "AggregateGeoFeature");
        ft1.setNumDecimals(0);
        ft2.setNumDecimals(0);
        cat.save(ft1);
        cat.save(ft2);
    }

  @Test
    public void testDefaults() throws Exception {
View Full Code Here

        FeatureTypeInfo ft1 = cat.getFeatureTypeByName("sf", "PrimitiveGeoFeature");
        FeatureTypeInfo ft2 = cat.getFeatureTypeByName("sf", "AggregateGeoFeature");
        ft1.setNumDecimals(0);
        ft2.setNumDecimals(0);
        cat.save(ft1);
        cat.save(ft2);
    }

  @Test
    public void testDefaults() throws Exception {
        Document dom = getAsDOM("wfs?request=getfeature&featureid=PrimitiveGeoFeature.f008&version=1.0.0");
View Full Code Here

    @Test
    public void testGlobal() throws Exception {
      Catalog cat = getCatalog();
        FeatureTypeInfo ft = cat.getFeatureTypeByName("sf", "PrimitiveGeoFeature");
        ft.setNumDecimals(-1);
        cat.save(ft);
       
        GeoServerInfo global = getGeoServer().getGlobal();
        global.getSettings().setNumDecimals(1);
        getGeoServer().save(global);
       
View Full Code Here

    @Test
    public void testPerFeatureType() throws Exception {
        Catalog cat = getCatalog();
        FeatureTypeInfo ft = cat.getFeatureTypeByName("sf", "PrimitiveGeoFeature");
        ft.setNumDecimals(1);
        cat.save(ft);
       
        Document dom = getAsDOM("wfs?request=getfeature&featureid=PrimitiveGeoFeature.f008&version=1.0.0");
        runAssertions(dom,1);
    }
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.