Package org.geoserver.catalog

Examples of org.geoserver.catalog.CascadeDeleteVisitor


                new ParamResourceModel("confirmRollback", this)) {
           
            @Override
            protected void onClick(AjaxRequestTarget target) {
                Catalog catalog = getCatalog();
                CascadeDeleteVisitor deleteVisitor = new CascadeDeleteVisitor(catalog);
                String project = summary.getProject();
                if(summary.isWorkspaceNew()) {
                    WorkspaceInfo ws = catalog.getWorkspaceByName(project);
                    if(ws != null)
                        ws.accept(deleteVisitor);
View Full Code Here


    @Override
    protected void setUpInternal() throws Exception {
        super.setUpInternal();
       
        catalog = getCatalog();
        visitor = new CascadeDeleteVisitor(catalog);
       
        // setup a group, see GEOS-3040
        Catalog catalog = getCatalog();
        String lakes = MockData.LAKES.getLocalPart();
        String forests = MockData.FORESTS.getLocalPart();
View Full Code Here

            }
           
            protected boolean onSubmit(AjaxRequestTarget target, Component contents) {
                // cascade delete the whole selection
                Catalog catalog = GeoServerApplication.get().getCatalog();
                CascadeDeleteVisitor visitor = new CascadeDeleteVisitor(catalog);
                for (CatalogInfo ci : selection) {
                    ci.accept(visitor);
                }
               
                // the deletion will have changed what we see in the page
View Full Code Here

            }
           
            protected boolean onSubmit(AjaxRequestTarget target, Component contents) {
                // cascade delete the whole selection
                Catalog catalog = GeoServerApplication.get().getCatalog();
                CascadeDeleteVisitor visitor = new CascadeDeleteVisitor(catalog);
                DataAccessRuleDAO dao = DataAccessRuleDAO.get();
                for (DataAccessRule rule : selection) {
                    dao.removeRule(rule);  
                }
                try {
View Full Code Here

    @RequestMapping(value="/{wsName}/{name}", method = RequestMethod.DELETE)
    public @ResponseBody void delete(@PathVariable String wsName, @PathVariable String name) throws IOException {
        Catalog cat = geoServer.getCatalog();
        LayerInfo layer = findLayer(wsName, name, cat);
        recent.remove(LayerInfo.class, layer);
        new CascadeDeleteVisitor(cat).visit(layer);
    }
View Full Code Here

    @RequestMapping(value = "/{wsName}", method = RequestMethod.DELETE)
    public void delete(@PathVariable String wsName, HttpServletResponse response) {
        Catalog cat = geoServer.getCatalog();

        WorkspaceInfo ws = findWorkspace(wsName, cat);
        new CascadeDeleteVisitor(cat).visit(ws);

        response.setStatus(HttpStatus.OK.value());
    }
View Full Code Here

        List<ResourceInfo> layers = cat.getResourcesByStore(store, ResourceInfo.class );
        if( layers.isEmpty() ){
            cat.remove(store);
        }
        else if (recurse){
            CascadeDeleteVisitor delete = new CascadeDeleteVisitor(cat);
            if( store instanceof DataStoreInfo){
                delete.visit((DataStoreInfo)store);
            }
            else if( store instanceof CoverageStoreInfo){
                delete.visit((CoverageStoreInfo)store);
            }
            else if( store instanceof WMSStoreInfo){
                delete.visit((WMSStoreInfo)store);
            }
            else {
                throw new IllegalStateException( "Unable to delete "+name+" - expected data store, coverage store or wms store" );
            }
        }
View Full Code Here

            }
           
            protected boolean onSubmit(AjaxRequestTarget target, Component contents) {
                // cascade delete the whole selection
                Catalog catalog = GeoServerApplication.get().getCatalog();
                CascadeDeleteVisitor visitor = new CascadeDeleteVisitor(catalog);
                DataAccessRuleDAO dao = DataAccessRuleDAO.get();
                for (DataAccessRule rule : selection) {
                    dao.removeRule(rule);  
                }
                try {
View Full Code Here

        String databaseLocation = null;
        if("h2".equals(params.get("dbtype"))) {
            databaseLocation = (String) params.get("database");
        }

        CascadeDeleteVisitor v = new CascadeDeleteVisitor(getCatalog());
        store.accept(v);
       
        // clean up the database files if needed
        if(databaseLocation != null) {
            final File dbFile = new File(databaseLocation);
View Full Code Here

    }
   
    @After
    public void dropStore() {
        Catalog cat = getCatalog();
        CascadeDeleteVisitor visitor = new CascadeDeleteVisitor(cat);
        store.accept(visitor);
    }
View Full Code Here

TOP

Related Classes of org.geoserver.catalog.CascadeDeleteVisitor

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.