public void setName(String name) { delegate.setName(name); }
@Test public void testAddWMTSStore() throws Exception { testAddWorkspace(); File dir = new File(testData.getDataDirectoryRoot(), "workspaces/acme/demowmts"); assertFalse(dir.exists()); WMTSStoreInfo wmts = catalog.getFactory().createWebMapTileServer(); wmts.setName("demowmts"); wmts.setWorkspace(catalog.getWorkspaceByName("acme")); catalog.add(wmts); assertTrue(dir.exists()); assertTrue(new File(dir, "wmtsstore.xml").exists()); }
@Test public void testAddWMTSStore() { assertTrue(catalog.getStores(WMTSStoreInfo.class).isEmpty()); addWMTSStore(); assertEquals(1, catalog.getStores(WMTSStoreInfo.class).size()); WMTSStoreInfo retrieved = catalog.getStore(wmtss.getId(), WMTSStoreInfo.class); assertNotNull(retrieved); WMTSStoreInfo wmts2 = catalog.getFactory().createWebMapTileServer(); wmts2.setName("wmts2Name"); wmts2.setWorkspace(ws); catalog.add(wmts2); assertEquals(2, catalog.getStores(WMTSStoreInfo.class).size()); }
public WMTSStoreInfo clone(final WMTSStoreInfo source, boolean allowEnvParametrization) { WMTSStoreInfo target; try { target = (WMTSStoreInfo) SerializationUtils.clone(source); if (target instanceof StoreInfoImpl && target.getCatalog() == null) { ((StoreInfoImpl) target).setCatalog(catalog); } } catch (Exception e) { target = catalog.getFactory().createWebMapTileServer(); target.setDescription(source.getDescription()); target.setEnabled(source.isEnabled()); target.setName(source.getName()); target.setType(source.getType()); target.setWorkspace(source.getWorkspace()); } setConnectionParameters(source, target); if (allowEnvParametrization) { // Resolve GeoServer Environment placeholders final GeoServerEnvironment gsEnvironment = GeoServerExtensions.bean(GeoServerEnvironment.class); if (gsEnvironment != null && GeoServerEnvironment.ALLOW_ENV_PARAMETRIZATION) { target.setCapabilitiesURL( (String) gsEnvironment.resolveValue(source.getCapabilitiesURL())); target.setUsername((String) gsEnvironment.resolveValue(source.getUsername())); target.setPassword((String) gsEnvironment.resolveValue(source.getPassword())); } } return target; }
wmts.setName("foo"); wmts.setCapabilitiesURL("http://fake.host/wmts?request=getCapabilities"); catalog.add(wmts);
wmtss.setName("wmtsName"); wmtss.setType("WMTS"); wmtss.setCapabilitiesURL("http://fake.wmts.url");
store.setType("WMTS"); store.setEnabled(true); store.setName("wmts"); store.setCapabilitiesURL(capabilities); catalog.add(store);