List<String> getAvailableLayersInternal( String workspaceName, String storeName, boolean quietOnNotFound) { NamespaceInfo ns = getNamespaceInternal(workspaceName); Collection<WMTSStoreInfo> stores = getStoresInternal(ns, storeName, quietOnNotFound); return stores.stream() .flatMap( store -> { WebMapTileServer ds; try { ds = store.getWebMapTileServer(null); } catch (IOException e) { throw new RestException( "Could not load wmts store: " + storeName, HttpStatus.INTERNAL_SERVER_ERROR, e); } final List<WMTSLayer> layerList = ds.getCapabilities().getLayerList(); return layerList .stream() .map(Layer::getName) .filter(Objects::nonNull) .filter(name -> !name.isEmpty()) .filter(name -> !layerConfigured(store, name)); }) .collect(Collectors.toList()); }
/** @return */ public GetTileRequest createGetTileRequest() { URL url; if (WMTSServiceType.KVP.equals(type)) { url = findURL(getCapabilities().getRequest().getGetTile()); } else { url = serverURL; } GetTileRequest request = (GetTileRequest) ((WMTSSpecification) specification) .createGetTileRequest(url, (Properties) null, capabilities); request.getHeaders().putAll(headers); return request; }
builder.setStore(store); List<WMTSLayer> layers = wmtsInfo.getWebMapTileServer(null).getCapabilities().getLayerList(); for (Layer l : layers) { if (l.getName() == null) {
server.getCapabilities(); } catch (IOException | ServiceException e) { IValidationError err =
@Override protected void onSave(WMTSStoreInfo info, AjaxRequestTarget target) throws IllegalArgumentException { if (!info.isEnabled()) { doSaveStore(info); } else { try { // try to see if we can connect getCatalog().getResourcePool().clear(info); // do not call info.getWebMapServer cause it ends up calling // resourcepool.getWebMapServer with the unproxied instance (old values) // info.getWebMapServer(null).getCapabilities(); WebMapTileServer wmts = getCatalog().getResourcePool().getWebMapTileServer(info); wmts.getCapabilities(); doSaveStore(info); } catch (Exception e) { confirmSaveOnConnectionFailure(info, target, e); } } }
builder.setStore(store); WebMapTileServer webMapTileServer = expandedStore.getWebMapTileServer(null); WMTSCapabilities capabilities = webMapTileServer.getCapabilities(); List<WMTSLayer> layers = capabilities.getLayerList(); for (Layer l : layers) {