public String getName() { return delegate.getName(); }
private void modifyWMTSStore(WMTSStoreInfo wmss) throws IOException { LOGGER.fine("Persisting wmts store " + wmss.getName()); Resource xml = dd.config(wmss); persist(wmss, xml); }
private void addWMTSStore(WMTSStoreInfo wmss) throws IOException { LOGGER.fine("Persisting wmts store " + wmss.getName()); Resource xml = dd.config(wmss); persist(wmss, xml); }
private void removeWMTSStore(WMTSStoreInfo wmss) throws IOException { LOGGER.fine("Removing wmts datastore " + wmss.getName()); Resource directory = dd.get(wmss); rmRes(directory); }
private void loadWmtsStore( StoreContents storeContents, CatalogImpl catalog, XStreamPersister xp) { final Resource storeResource = storeContents.resource; WMTSStoreInfo wmts = null; try { wmts = depersist(xp, storeContents.contents, WMTSStoreInfo.class); catalog.add(wmts); LOGGER.info("Loaded wmtsstore '" + wmts.getName() + "'"); } catch (Exception e) { LOGGER.log( Level.WARNING, "Failed to load wmts store '" + storeResource.name() + "'", e); return; } // load wmts layers LayerLoader<WMTSLayerInfo> coverageLoader = new LayerLoader<>(WMTSLayerInfo.class, xp, catalog); try (AsynchResourceIterator<LayerContents> it = new AsynchResourceIterator<>( storeResource.parent(), Resources.DirectoryFilter.INSTANCE, WMTS_LAYER_MAPPER)) { while (it.hasNext()) { LayerContents lc = it.next(); coverageLoader.accept(lc); } } }
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; }
@Override protected Component getContents(String id) { return new StoreConnectionFailedInformationPanel( id, info.getName(), exceptionMessage); }
boolean layerConfigured(final WMTSStoreInfo store, final String nativeName) { final Filter filter = Predicates.and( Predicates.equal("store.name", store.getName()), Predicates.equal("nativeName", nativeName)); try (CloseableIterator<WMTSLayerInfo> it = catalog.list(WMTSLayerInfo.class, filter, 0, 1, null)) { return it.hasNext(); } }
@Test public void testGetAllAsHTML() throws Exception { Document dom = getAsDOM(RestBaseController.ROOT_PATH + "/workspaces/sf/wmtsstores.html"); List<WMTSStoreInfo> stores = catalog.getStoresByWorkspace("sf", WMTSStoreInfo.class); NodeList links = xp.getMatchingNodes("//html:a", dom); assertEquals(stores.size(), links.getLength()); for (int i = 0; i < stores.size(); i++) { WMTSStoreInfo store = stores.get(i); Element link = (Element) links.item(i); assertTrue(link.getAttribute("href").endsWith(store.getName() + ".html")); } }
catalog.add(store); String storeName = store.getName(); LOGGER.info("POST wmts store " + storeName); UriComponents uriComponents =
@Override protected void postEncodeReference( Object obj, String ref, String prefix, HierarchicalStreamWriter writer, MarshallingContext context) { if (obj instanceof NamespaceInfo) { NamespaceInfo ns = (NamespaceInfo) obj; converter.encodeLink( "/namespaces/" + converter.encode(ns.getPrefix()), writer); } if (obj instanceof WMTSStoreInfo) { WMTSStoreInfo store = (WMTSStoreInfo) obj; converter.encodeLink( "/workspaces/" + converter.encode(store.getWorkspace().getName()) + "/wmtsstores/" + converter.encode(store.getName()), writer); } } });
"storeEmpty", this, store.getName(), store.getWorkspace().getName()) .getString());