@Override public void convertInput() { PostgresConfigBean bean = new PostgresConfigBean(); // populate the bean String host = hostPanel.getFormComponent().getConvertedInput().toString().trim(); Integer port = Integer.class.cast(portPanel.getFormComponent().getConvertedInput()); String db = dbPanel.getFormComponent().getConvertedInput().toString().trim(); Object schema = schemaPanel.getFormComponent().getConvertedInput(); String username = usernamePanel.getFormComponent().getConvertedInput().toString().trim(); String password = passwordPanel.getFormComponent().getConvertedInput(); bean.setHost(host); bean.setPort(port); bean.setDatabase(db); bean.setUsername(username); bean.setPassword(password); if (schema == null || schema.toString().trim().isEmpty()) { bean.setSchema(null); } else { bean.setSchema(schema.toString().trim()); } setConvertedInput(bean); } }
public WMSStoreNewPage() { try { CatalogBuilder builder = new CatalogBuilder(getCatalog()); WMSStoreInfo store = builder.buildWMSStore(null); initUI(store); capabilitiesURL.getFormComponent().add(new WMSCapabilitiesURLValidator()); } catch (IOException e) { throw new RuntimeException("Could not setup the WMS store: " + e.getMessage(), e); } }
private FormComponent addTextPanel(final IModel paramsModel, final String paramName) { final String resourceKey = getClass().getSimpleName() + "." + paramName; final boolean required = true; final TextParamPanel textParamPanel = new TextParamPanel( paramName, new MapModel(paramsModel, paramName), new ResourceModel(resourceKey, paramName), required); textParamPanel.getFormComponent().setType(String.class); String defaultTitle = paramName; ResourceModel titleModel = new ResourceModel(resourceKey + ".title", defaultTitle); String title = String.valueOf(titleModel.getObject()); textParamPanel.add(AttributeModifier.replace("title", title)); add(textParamPanel); return textParamPanel.getFormComponent(); } }
@Override protected void onValidate(IValidatable validatable) { String url = (String) validatable.getValue(); try { HTTPClient client = new SimpleHttpClient(); usernamePanel.getFormComponent().processInput(); String user = usernamePanel.getFormComponent().getInput(); password.getFormComponent().processInput(); String pwd = password.getFormComponent().getInput(); if (user != null && user.length() > 0 && pwd != null && pwd.length() > 0) { client.setUser(user); client.setPassword(pwd); } WebMapServer server = new WebMapServer(new URL(url), client); server.getCapabilities(); } catch(Exception e) { error(validatable, "WMSCapabilitiesValidator.connectionFailure", Collections.singletonMap("error", e.getMessage())); } }
public WMSStoreNewPage() { try { CatalogBuilder builder = new CatalogBuilder(getCatalog()); WMSStoreInfo store = builder.buildWMSStore(null); initUI(store); final GeoServerEnvironment gsEnvironment = GeoServerExtensions.bean(GeoServerEnvironment.class); // AF: Disable Binding if GeoServer Env Parametrization is enabled! if (gsEnvironment == null || !GeoServerEnvironment.ALLOW_ENV_PARAMETRIZATION) { capabilitiesURL.getFormComponent().add(new WMSCapabilitiesURLValidator()); } } catch (IOException e) { throw new RuntimeException("Could not setup the WMS store: " + e.getMessage(), e); } }
public WMTSStoreNewPage() { try { CatalogBuilder builder = new CatalogBuilder(getCatalog()); WMTSStoreInfo store = builder.buildWMTSStore(null); initUI(store); final GeoServerEnvironment gsEnvironment = GeoServerExtensions.bean(GeoServerEnvironment.class); // AF: Disable Binding if GeoServer Env Parametrization is enabled! if (gsEnvironment == null || !GeoServerEnvironment.ALLOW_ENV_PARAMETRIZATION) { capabilitiesURL.getFormComponent().add(new WMTSCapabilitiesURLValidator()); } } catch (IOException e) { throw new RuntimeException("Could not setup the WMTS store: " + e.getMessage(), e); } }
panel.getFormComponent().setType(valueClass); panel.getFormComponent().add(RangeValidator.minimum(minimum.doubleValue())); panel.getFormComponent().add(RangeValidator.maximum(maximum.doubleValue()));
private FormComponent addTextPanel( final IModel paramsModel, final String paramName, final String paramTitle, final boolean required) { final String resourceKey = getClass().getSimpleName() + "." + paramName; final TextParamPanel textParamPanel = new TextParamPanel( paramName, new MapModel(paramsModel, paramTitle), new ResourceModel(resourceKey, paramName), required); textParamPanel.getFormComponent().setType(String.class /*param.type*/); String defaultTitle = paramTitle; ResourceModel titleModel = new ResourceModel(resourceKey + ".title", defaultTitle); String title = String.valueOf(titleModel.getObject()); textParamPanel.add(AttributeModifier.replace("title", title)); add(textParamPanel); return textParamPanel.getFormComponent(); }
if (null != repoTypeChoice) { String repoName = repoNamePanel.getFormComponent().getConvertedInput().toString().trim(); modelObject.setRepoName(repoName); switch (repoTypeChoice) {
bean.buildUriForRepo( repoNamePanel .getFormComponent() .getConvertedInput() .toString()
try { HTTPClient client = new SimpleHttpClient(); usernamePanel.getFormComponent().processInput(); String user = usernamePanel.getFormComponent().getInput(); password.getFormComponent().processInput(); String pwd = password.getFormComponent().getInput();
try { HTTPClient client = new SimpleHttpClient(); usernamePanel.getFormComponent().processInput(); String user = usernamePanel.getFormComponent().getInput(); password.getFormComponent().processInput(); String pwd = password.getFormComponent().getInput();
@SuppressWarnings("unchecked") private void updateRepository( final Form<DataStoreInfo> form, AjaxRequestTarget target, RepositoryInfo info) { repository.setModelObject(GeoServerGeoGigRepositoryResolver.getURI(info.getRepoName())); branchNameModel.setObject(null); branch.updateChoices(true, form); target.add(repository); target.add(branch); IModel<DataStoreInfo> storeModel = form.getModel(); String dataStoreName = storeModel.getObject().getName(); if (Strings.isNullOrEmpty(dataStoreName)) { Component namePanel = form.get("dataStoreNamePanel"); if (namePanel != null && namePanel instanceof TextParamPanel) { TextParamPanel paramPanel = (TextParamPanel) namePanel; paramPanel.getFormComponent().setModelObject(info.getRepoName()); target.add(form); } } }
public DefaultCoverageStoreEditPanel(final String componentId, final Form storeEditForm) { super(componentId, storeEditForm); final IModel formModel = storeEditForm.getModel(); // url TextParamPanel url = new TextParamPanel("urlPanel", new PropertyModel(formModel, "URL"), new ResourceModel("url", "URL"), true); url.getFormComponent().add(new FileExistsValidator()); add(url); }
public DefaultCoverageStoreEditPanel(final String componentId, final Form storeEditForm) { super(componentId, storeEditForm); final IModel formModel = storeEditForm.getModel(); // url TextParamPanel url = new TextParamPanel( "urlPanel", new PropertyModel(formModel, "URL"), new ResourceModel("url", "URL"), true); url.getFormComponent().add(new FileExistsValidator()); add(url); } }
new ResourceModel("PostgresConfigFormPanel.host", "Host Name"), true); hostPanel.getFormComponent().setType(String.class); add(hostPanel); portPanel = .getFormComponent() .setType(Integer.TYPE) .add( new ResourceModel("PostgresConfigFormPanel.database", "Database Name"), true); dbPanel.getFormComponent().setType(String.class); add(dbPanel); schemaPanel = new ResourceModel("PostgresConfigFormPanel.schema", "Schema Name"), false); schemaPanel.getFormComponent().setType(String.class); add(schemaPanel); usernamePanel = new ResourceModel("PostgresConfigFormPanel.username", "Username"), true); usernamePanel.getFormComponent().setType(String.class); add(usernamePanel); passwordPanel =
new ResourceModel("url", "URL"), true); final FormComponent urlFormComponent = url.getFormComponent(); urlFormComponent.add(new FileExistsValidator()); add(url);
.getFormComponent(), namePanel.getFormComponent(), store.getId()); paramsForm.add(storeNameValidator);
new StoreNameValidator( workspacePanel.getFormComponent(), namePanel.getFormComponent(), store.getId()); paramsForm.add(storeNameValidator);
.getFormComponent(), namePanel.getFormComponent(), store.getId()); form.add(storeNameValidator);