@Override protected boolean onSubmit(AjaxRequestTarget target, Component contents) { doSaveStore(info); accepted = true; return true; }
/** Creates a new edit page directly from a store object. */ public WMTSStoreEditPage(WMTSStoreInfo store) { initUI(store); }
@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); } } }
/** * Performs the save of the store. * * <p>This method may be subclasses to provide custom save functionality. */ protected void doSaveStore(WMTSStoreInfo info) { Catalog catalog = getCatalog(); // Cloning into "expandedStore" through the super class "clone" method WMTSStoreInfo expandedStore = (WMTSStoreInfo) catalog.getResourcePool().clone(info, true); getCatalog().validate(expandedStore, false).throwIfInvalid(); getCatalog().save(info); doReturn(StorePage.class); }
/** * Uses a "name" parameter to locate the datastore * * @param parameters */ public WMTSStoreEditPage(PageParameters parameters) { String wsName = parameters.get(WS_NAME).toOptionalString(); String storeName = parameters.get(STORE_NAME).toString(); WMTSStoreInfo store = getCatalog().getStoreByName(wsName, storeName, WMTSStoreInfo.class); initUI(store); }
final Exception error) { getCatalog().getResourcePool().clear(info);