Examples of CatalogBuilder


Examples of org.geoserver.catalog.CatalogBuilder

        this.resourceInfo = resourceInfo;
    }

    public Object getObject() {
        if(resourceInfo.getCatalog() == null)
            new CatalogBuilder(GeoServerApplication.get().getCatalog()).attach(resourceInfo);
        return resourceInfo;
    }
View Full Code Here

Examples of org.geoserver.catalog.CatalogBuilder

            public void onSubmit(final AjaxRequestTarget target, Form form) {
                // perform manual processing otherwise the component contents won't be updated
                form.process();
                ResourceInfo resource = (ResourceInfo) BasicResourceConfig.this.getModelObject();
                try {
                    CatalogBuilder cb = new CatalogBuilder(GeoServerApplication.get().getCatalog());
                    ReferencedEnvelope bounds = cb.getNativeBounds(resource);
                    resource.setNativeBoundingBox(bounds);
                    nativeBBox.setModelObject(bounds);
                } catch(IOException e) {
                    LOGGER.log(Level.SEVERE, "Error computing the native BBOX", e);
                    error("Error computing the native BBOX:" + e.getMessage());
View Full Code Here

Examples of org.geoserver.catalog.CatalogBuilder

                nativeBBox.processInput();
                declaredCRS.processInput();
               
                ReferencedEnvelope nativeBounds = (ReferencedEnvelope) nativeBBox.getModelObject();
                try {
                    CatalogBuilder cb = new CatalogBuilder(GeoServerApplication.get().getCatalog());
                    latLonPanel.setModelObject(cb.getLatLonBounds(nativeBounds, declaredCRS.getCRS()));
                } catch(IOException e) {
                    LOGGER.log(Level.SEVERE, "Error computing the geographic BBOX", e);
                    error("Error computing the geographic bounds:" + e.getMessage());
                }
                target.addComponent(latLonPanel);
View Full Code Here

Examples of org.geoserver.catalog.CatalogBuilder

        lg.getStyles().add(catalog.getStyleByName(lakes));
        lg.getLayers().add(catalog.getLayerByName(forests));
        lg.getStyles().add(catalog.getStyleByName(forests));
        lg.getLayers().add(catalog.getLayerByName(bridges));
        lg.getStyles().add(catalog.getStyleByName(bridges));
        CatalogBuilder builder = new CatalogBuilder(catalog);
        builder.calculateLayerGroupBounds(lg);
        catalog.add(lg);

        // makes the lakes layer a multi-style one
        LayerInfo lakesLayer = catalog.getLayerByName(getLayerId(MockData.LAKES));
        lakesLayer.getStyles().add(catalog.getStyleByName(MockData.FORESTS.getLocalPart()));
View Full Code Here

Examples of org.geoserver.catalog.CatalogBuilder

    @Override
    protected void oneTimeSetUp() throws Exception {
        super.oneTimeSetUp();
       
        CatalogFactory cf = getCatalog().getFactory();
        CatalogBuilder cb = new CatalogBuilder(getCatalog());
        LayerGroupInfo gi = cf.createLayerGroup();
        gi.setName("testGroup");
        gi.getLayers().add(getCatalog().getLayerByName(MockData.BASIC_POLYGONS.getLocalPart()));
        gi.getStyles().add(getCatalog().getStyleByName("polygon"));
        cb.calculateLayerGroupBounds(gi);
        getCatalog().add(gi);
    }
View Full Code Here

Examples of org.geoserver.catalog.CatalogBuilder

                        }
                        // make sure it's enabled, we just verified the directory exists
                        si.setEnabled(true);
                    } else {
                        storeNew = true;
                        CatalogBuilder builder = new CatalogBuilder(getCatalog());
                        builder.setWorkspace(ws);
                        si = builder.buildDataStore(project);
                        si.getConnectionParameters().putAll(params);
                        si.setEnabled(true);
                        si.setType(storeType);
                       
                        getCatalog().add(si);
View Full Code Here

Examples of org.geoserver.catalog.CatalogBuilder

        this.summary = layerInfo;
    }

    public Object getObject() {
        if(summary.getLayer().getResource().getCatalog() == null) {
            new CatalogBuilder(GeoServerApplication.get().getCatalog()).attach(summary.getLayer());
        }
        return summary;
    }
View Full Code Here

Examples of org.geoserver.catalog.CatalogBuilder

            throw new RestletException( "layer group must not be empty", Status.CLIENT_ERROR_BAD_REQUEST );
        }
      
        if ( lg.getBounds() == null ) {
            LOGGER.fine( "Auto calculating layer group bounds");
            new CatalogBuilder( catalog ).calculateLayerGroupBounds(lg);
        }
       
        catalog.add( lg );
        return lg.getName();
    }
View Full Code Here

Examples of org.geoserver.catalog.CatalogBuilder

        //ensure not a name change
        if ( lg.getName() != null && !lg.getName().equals( original.getName() ) ) {
            throw new RestletException( "Can't change name of a layer group", Status.CLIENT_ERROR_FORBIDDEN );
        }
       
        new CatalogBuilder( catalog ).updateLayerGroup( original, lg );
        catalog.save( original );
    }
View Full Code Here

Examples of org.geoserver.catalog.CatalogBuilder

//            throw new RestletException( "Can't change name of a layer", Status.CLIENT_ERROR_FORBIDDEN );
//        }
        // force in the same resource otherwise the update will simply fail as we cannot reach the name
        layer.setResource(original.getResource());
       
        new CatalogBuilder( catalog ).updateLayer( original, layer );
        catalog.save( original );

        LOGGER.info( "PUT layer " + l);
    }
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.