public void setCapabilitiesURL(String url) { delegate.setCapabilitiesURL(url); }
/** * @param source * @param target */ private void setConnectionParameters(final WMTSStoreInfo source, WMTSStoreInfo target) { target.setCapabilitiesURL(source.getCapabilitiesURL()); target.setUsername(source.getUsername()); target.setPassword(source.getPassword()); target.setUseConnectionPooling(source.isUseConnectionPooling()); target.setMaxConnections(source.getMaxConnections()); target.setConnectTimeout(source.getConnectTimeout()); target.setReadTimeout(source.getReadTimeout()); }
@Test public void testModifyWMTSStore() throws Exception { testAddWMTSStore(); WMTSStoreInfo wmts = catalog.getStoreByName("acme", "demowmts", WMTSStoreInfo.class); assertNull(wmts.getCapabilitiesURL()); String capsURL = "http://demo.opengeo.org:8080/geoserver/gwc?request=GetCapabilites&service=WMTS"; wmts.setCapabilitiesURL(capsURL); catalog.save(wmts); File f = new File(testData.getDataDirectoryRoot(), "workspaces/acme/demowmts/wmtsstore.xml"); Document dom = dom(f); assertXpathEvaluatesTo(capsURL, "/wmtsStore/capabilitiesURL/text()", dom); }
@Test public void testWMTSLayer100() throws Exception { TestHttpClientProvider.startTest(); try { String baseURL = TestHttpClientProvider.MOCKSERVER + "/wmts100"; MockHttpClient client = new MockHttpClient(); URL capsURL = new URL(baseURL + "?REQUEST=GetCapabilities&VERSION=1.0.0&SERVICE=WMTS"); client.expectGet( capsURL, new MockHttpResponse(getClass().getResource("nasa.getcapa.xml"), "text/xml")); TestHttpClientProvider.bind(client, capsURL); CatalogBuilder cb = new CatalogBuilder(getCatalog()); WMTSStoreInfo store = cb.buildWMTSStore("test-wmts-store"); store.setCapabilitiesURL(capsURL.toExternalForm()); cb.setStore(store); WMTSLayerInfo layer = cb.buildWMTSLayer("AMSR2_Wind_Speed_Night"); // check the bbox has the proper axis order assertEquals("Wind Speed (Night, AMSR2, GCOM-W1)", layer.getTitle()); assertEquals("EPSG:4326", layer.getSRS()); ReferencedEnvelope bbox = layer.getLatLonBoundingBox(); assertEquals(-180, bbox.getMinX(), 0d); assertEquals(-90, bbox.getMinY(), 0d); assertEquals(180, bbox.getMaxX(), 0d); assertEquals(90, bbox.getMaxY(), 0d); } finally { TestHttpClientProvider.endTest(); } }
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.setWorkspace(ws); 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"); wmtss.setWorkspace(ws);
@Override protected void onSetUp(SystemTestData testData) throws Exception { super.onSetUp(testData); // we need to add a wmts store CatalogBuilder cb = new CatalogBuilder(catalog); cb.setWorkspace(catalog.getWorkspaceByName("sf")); WMTSStoreInfo wmts = cb.buildWMTSStore("demo"); wmts.setCapabilitiesURL( clientMocker.getServer() + "/geoserver/gwc?REQUEST=GetCapabilities&VERSION=1.0.0&SERVICE=WMTS"); catalog.add(wmts); // and a wmts layer as well (cannot use the builder, would turn this test into an online one addWmtsLayer(); }
@Override protected void onSetUp(SystemTestData testData) throws Exception { super.onSetUp(testData); // we need to add a wmts store CatalogBuilder cb = new CatalogBuilder(catalog); cb.setWorkspace(catalog.getWorkspaceByName("sf")); WMTSStoreInfo wmts = cb.buildWMTSStore("demo"); wmts.setCapabilitiesURL(capabilities); catalog.add(wmts); cb.setStore(wmts); WMTSLayerInfo layer = cb.buildWMTSLayer(LAYER_NAME); catalog.add(layer); }
store.setEnabled(true); store.setName("wmts"); store.setCapabilitiesURL(capabilities); catalog.add(store);