Examples of DataStoreInfo


Examples of org.geoserver.catalog.DataStoreInfo

        StyleInfo style = catalog.getFactory().createStyle();
        style.setName("style_testFeatureType");
        style.setFilename("style_testFeatureType");
        catalog.add(style);

        DataStoreInfo dataStore = catalog.getFactory().createDataStore();
        dataStore.setName("dataStore2");
        dataStore.setDescription("store description");
        dataStore.setEnabled(true);
        dataStore.setWorkspace(ws);
        catalog.add(dataStore);

        FeatureTypeInfo refFeatureType = catalog.getFactory().createFeatureType();
        refFeatureType.setName("featureType");
        refFeatureType.setNativeName("nativefeatureType");
View Full Code Here

Examples of org.geoserver.catalog.DataStoreInfo

       
        NodeList links = xp.getMatchingNodes("//html:a", dom );
        assertEquals( datastores.size(), links.getLength() );
       
        for ( int i = 0; i < datastores.size(); i++ ){
            DataStoreInfo ds = datastores.get( i );
            Element link = (Element) links.item( i );
           
            assertTrue( link.getAttribute("href").endsWith( ds.getName() + ".html") );
        }
    }
View Full Code Here

Examples of org.geoserver.catalog.DataStoreInfo

    }
   
    public void testGetAsHTML() throws Exception {
        Document dom = getAsDOM( "/rest/workspaces/sf/datastores/sf.html");
       
        DataStoreInfo ds = catalog.getDataStoreByName( "sf" );
        List<FeatureTypeInfo> featureTypes = catalog.getFeatureTypesByDataStore( ds );
       
        NodeList links = xp.getMatchingNodes("//html:a", dom );
        assertEquals( featureTypes.size(), links.getLength() );
       
View Full Code Here

Examples of org.geoserver.catalog.DataStoreInfo

            postAsServletResponse( "/rest/workspaces/sf/datastores", xml, "text/xml" );
        assertEquals( 201, response.getStatusCode() );
        assertNotNull( response.getHeader( "Location") );
        assertTrue( response.getHeader("Location").endsWith( "/workspaces/sf/datastores/newDataStore" ) );

        DataStoreInfo newDataStore = catalog.getDataStoreByName( "newDataStore" );
        assertNotNull( newDataStore );
       
        DataStore ds = (DataStore) newDataStore.getDataStore(null);
        assertNotNull(ds);
    }
View Full Code Here

Examples of org.geoserver.catalog.DataStoreInfo

       
        assertEquals( 201, response.getStatusCode() );
        assertNotNull( response.getHeader( "Location") );
        assertTrue( response.getHeader("Location").endsWith( "/workspaces/sf/datastores/newDataStore" ) );
       
        DataStoreInfo newDataStore = catalog.getDataStoreByName( "newDataStore" );
        assertNotNull( newDataStore );
       
        DataStore ds = (DataStore) newDataStore.getDataStore(null);
        assertNotNull(ds);
    }
View Full Code Here

Examples of org.geoserver.catalog.DataStoreInfo

       
        MockHttpServletResponse response =
            putAsServletResponse( "/rest/workspaces/sf/datastores/sf", xml, "text/xml");
        assertEquals( 200, response.getStatusCode() );
       
        DataStoreInfo ds = catalog.getDataStoreByName( "sf", "sf" );
        assertEquals( 2, ds.getConnectionParameters().size() );
        assertTrue( ds.getConnectionParameters().containsKey( "one" ) );
        assertTrue( ds.getConnectionParameters().containsKey( "two" ) );
    }
View Full Code Here

Examples of org.geoserver.catalog.DataStoreInfo

        logger.warn("fire on commit? " + catalog.isFireEventsOnCommit());

        Listener listener = new Listener();
        catalog.addListener(listener);

        DataStoreInfo store = catalog.getFactory().createDataStore();
        store.setName("foo" + System.currentTimeMillis()); // we need a unique name
        store.setDescription("testAddStore() "); // just for data debugging

        WorkspaceInfoImpl ws = catalog.getFactory().createWorkspace();
        ws.setName("testAddStore" + System.currentTimeMillis()); // we need a unique name
        catalog.add(ws);

        store.setWorkspace(ws);
        catalog.add(store);

        assertFalse("Listener added, shouldn't", listener.added);

        endTransaction();
View Full Code Here

Examples of org.geoserver.catalog.DataStoreInfo

    }

    public void _testModifyStore() {
        logger.error("------------------> running testModifyStore");

        DataStoreInfo store = catalog.getFactory().createDataStore();
        store.setName("bar");

        WorkspaceInfoImpl ws = catalog.getFactory().createWorkspace();
        ws.setName("testModifyStore" + System.currentTimeMillis()); // we need a unique name
        catalog.add(ws);

        store.setWorkspace(ws);
        catalog.add(store);

        endTransaction();
        startNewTransaction();

        Listener listener = new Listener();
        catalog.addListener(listener);
        store = (DataStoreInfo) catalog.getDataStore(store.getId());
        store.setName("bar2");
        catalog.save(store);

        assertFalse("Listener modified, it should not.", listener.modified);
        endTransaction();
        assertTrue("Listener not modified.", listener.modified);
View Full Code Here

Examples of org.geoserver.catalog.DataStoreInfo

                    String storeType = new DirectoryDataStoreFactory().getDisplayName();
                    Map<String, Serializable> params = new HashMap<String, Serializable>();
                    params.put(DirectoryDataStoreFactory.URLP.key, new File(directory).toURI().toURL().toString());
                    params.put(DirectoryDataStoreFactory.NAMESPACE.key, new URI(ns).toString());
                   
                    DataStoreInfo si;
                    StoreInfo preExisting = getCatalog().getStoreByName(ws, project, StoreInfo.class);
                    boolean storeNew = false;
                    if(preExisting != null) {
                        if(!(preExisting instanceof DataStoreInfo)) {
                            error(new ParamResourceModel("storeExistsNotVector", this, project));
                            return;
                        }
                        si = (DataStoreInfo) preExisting;
                        if(!si.getType().equals(storeType) || !si.getConnectionParameters().equals(params)) {
                            error(new ParamResourceModel("storeExistsNotSame", this, project));
                            return;
                        }
                        // 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);
                    }
                   
                    // build and run the importer
View Full Code Here

Examples of org.geoserver.catalog.DataStoreInfo

    protected List handleListGet() throws Exception {
        String ws = getAttribute( "workspace" );
        String ds = getAttribute("datastore");
       
        if ( ds != null ) {
            DataStoreInfo dataStore = catalog.getDataStoreByName( ds );
            return catalog.getFeatureTypesByDataStore(dataStore);   
        }
       
        NamespaceInfo ns = catalog.getNamespaceByPrefix( ws );
        return catalog.getFeatureTypesByNamespace( ns );
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.