Examples of WMSStoreInfo


Examples of org.geoserver.catalog.WMSStoreInfo

        String caps = wms11BaseNfiURL + "?service=WMS&request=GetCapabilities&version=1.1.1";
        TestHttpClientProvider.bind(wms11ClientNfi, caps);
       
        // setup the WMS layer
        CatalogBuilder cb = new CatalogBuilder(getCatalog());
        WMSStoreInfo store = cb.buildWMSStore("mock-wms-store-110-nfi");
        getCatalog().add(store);
        cb.setStore(store);
        store.setCapabilitiesURL(caps);
        WMSLayerInfo wmsLayer = cb.buildWMSLayer("world4326");
        getCatalog().add(wmsLayer);
        LayerInfo gsLayer = cb.buildLayer(wmsLayer);
        gsLayer.setName(WORLD4326_110_NFI);
        getCatalog().add(gsLayer);
View Full Code Here

Examples of org.geoserver.catalog.WMSStoreInfo

            return;
        }

        // setup the wms store, resource and layer
        CatalogBuilder cb = new CatalogBuilder(catalog);
        WMSStoreInfo wms = cb.buildWMSStore("demo");
        wms.setCapabilitiesURL(RemoteOWSTestSupport.WMS_SERVER_URL
                + "service=WMS&request=GetCapabilities");
        catalog.save(wms);
        cb.setStore(wms);
        WMSLayerInfo states = cb.buildWMSLayer("topp:states");
        states.setName("rstates");
View Full Code Here

Examples of org.geoserver.catalog.WMSStoreInfo

    public void testAddWMSStore() {
        assertTrue( catalog.getStores(WMSStoreInfo.class).isEmpty() );
        addWMSStore();
        assertEquals( 1, catalog.getStores(WMSStoreInfo.class).size() );
       
        WMSStoreInfo retrieved = catalog.getStore(wms.getId(), WMSStoreInfo.class);
       
        WMSStoreInfo wms2 = catalog.getFactory().createWebMapServer();
        wms2.setName( "wms2Name" );
        wms2.setWorkspace( ws );
       
        catalog.add( wms2 );
        assertEquals( 2, catalog.getStores(WMSStoreInfo.class).size() );
    }
View Full Code Here

Examples of org.geoserver.catalog.WMSStoreInfo

       
        // add a wms store too, if possible
        if (RemoteOWSTestSupport.isRemoteWMSStatesAvailable(LOGGER)) {
            // setup the wms store, resource and layer
            CatalogBuilder cb = new CatalogBuilder(getCatalog());
            WMSStoreInfo wms = cb.buildWMSStore("demo");
            wms.setCapabilitiesURL(RemoteOWSTestSupport.WMS_SERVER_URL
                    + "service=WMS&request=GetCapabilities");
            getCatalog().save(wms);
            cb.setStore(wms);
            WMSLayerInfo states = cb.buildWMSLayer("topp:states");
            states.setName("rstates");
View Full Code Here

Examples of org.geoserver.catalog.WMSStoreInfo

        testAddWorkspace();
       
        File dir = new File( testData.getDataDirectoryRoot(), "workspaces/acme/demowms");
        assertFalse( dir.exists() );
       
        WMSStoreInfo wms = catalog.getFactory().createWebMapServer();
        wms.setName( "demowms" );
        wms.setWorkspace( catalog.getWorkspaceByName( "acme" ) );
        catalog.add( wms );
       
        assertTrue( dir.exists() );
        assertTrue( new File( dir, "wmsstore.xml").exists() );
    }
View Full Code Here

Examples of org.geoserver.catalog.WMSStoreInfo

   
    @Test
    public void testModifyWMSStore() throws Exception {
        testAddWMSStore();
       
        WMSStoreInfo wms = catalog.getStoreByName( "acme", "demowms", WMSStoreInfo.class );
        assertNull( wms.getCapabilitiesURL() );
       
        String capsURL = "http://demo.opengeo.org:8080/geoserver/wms?request=GetCapabilites&service=WMS";
        wms.setCapabilitiesURL(capsURL);
        catalog.save( wms );
       
        File f = new File( testData.getDataDirectoryRoot(), "workspaces/acme/demowms/wmsstore.xml");
        Document dom = dom( f );
        assertXpathEvaluatesTo(capsURL, "/wmsStore/capabilitiesURL/text()", dom);
View Full Code Here

Examples of org.geoserver.catalog.WMSStoreInfo

        testAddWMSStore();
       
        File f = new File( testData.getDataDirectoryRoot(), "workspaces/acme/demowms");
        assertTrue( f.exists() );
       
        WMSStoreInfo wms = catalog.getStoreByName("acme", "demowms", WMSStoreInfo.class);
        catalog.remove( wms );
        assertFalse( f.exists() );
    }
View Full Code Here

Examples of org.geoserver.catalog.WMSStoreInfo

     * @param parameters
     */
    public WMSStoreEditPage(PageParameters parameters) {
        String wsName = parameters.getString(WS_NAME);
        String storeName = parameters.getString(STORE_NAME);
        WMSStoreInfo store = getCatalog().getStoreByName(wsName, storeName, WMSStoreInfo.class);
        initUI(store);
    }
View Full Code Here

Examples of org.geoserver.catalog.WMSStoreInfo

public class WMSStoreNewPage extends AbstractWMSStorePage {

    public WMSStoreNewPage() {
        try {
            CatalogBuilder builder = new CatalogBuilder(getCatalog());
            WMSStoreInfo store = builder.buildWMSStore(null);

            initUI(store);
            capabilitiesURL.getFormComponent().add(new WMSCapabilitiesURLValidator());
        } catch (IOException e) {
            throw new RuntimeException("Could not setup the WMS store: " + e.getMessage(), e);
View Full Code Here

Examples of org.geoserver.catalog.WMSStoreInfo

            throws IllegalArgumentException {
        /*
         * Try saving a copy of it so if the process fails somehow the original "info" does not end
         * up with an id set
         */
        WMSStoreInfo savedStore = getCatalog().getFactory().createWebMapServer();
        clone(info, savedStore);

        // GR: this shouldn't fail, the Catalog.save(StoreInfo) API does not declare any action in
        // case of a failure!... strange, why a save can't fail?
        // Still, be cautious and wrap it in a try/catch block so the page does not blow up
        try {
            getCatalog().validate(savedStore, false).throwIfInvalid();
            getCatalog().save(savedStore);
        } catch (RuntimeException e) {
            LOGGER.log(Level.INFO, "Adding the store for " + info.getCapabilitiesURL(), e);
            throw new IllegalArgumentException(
                    "The WMS store could not be saved. Failure message: " + e.getMessage());
        }

        // the StoreInfo save succeeded... try to present the list of coverages (well, _the_
        // coverage while the getotools coverage api does not allow for more than one
        NewLayerPage layerChooserPage;
        try {
            layerChooserPage = new NewLayerPage(savedStore.getId());
        } catch (RuntimeException e) {
            LOGGER.log(Level.INFO, "Getting list of layers for the WMS store " + info.getCapabilitiesURL(), e);
            // doh, can't present the list of coverages, means saving the StoreInfo is meaningless.
            try {// be extra cautious
                getCatalog().remove(savedStore);
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.