Package org.geoserver.web.data.store.panel

Examples of org.geoserver.web.data.store.panel.TextParamPanel


        paramsForm.add(new Label("storeType", format.getName()));
        paramsForm.add(new Label("storeTypeDescription", format.getDescription()));

        // name
        PropertyModel nameModel = new PropertyModel(model, "name");
        final TextParamPanel namePanel = new TextParamPanel("namePanel", nameModel,
                new ResourceModel("dataSrcName", "Data Source Name"), true);

        paramsForm.add(namePanel);

        // description and enabled
        paramsForm.add(new TextParamPanel("descriptionPanel", new PropertyModel(model,
                "description"), new ResourceModel("description", "Description"), false));
        paramsForm.add(new CheckBoxParamPanel("enabledPanel", new PropertyModel(model, "enabled"),
                new ResourceModel("enabled", "Enabled")));
        // a custom converter will turn this into a namespace url
        workspacePanel = new WorkspacePanel("workspacePanel",
                new PropertyModel(model, "workspace"), new ResourceModel("workspace", "Workspace"),
                true);
        paramsForm.add(workspacePanel);

        final StoreEditPanel storeEditPanel;
        {
            /*
             * Here's where the extension point is applied in order to give extensions a chance to
             * provide custom behavior/components for the coverage form other than the default
             * single "url" input field
             */
            GeoServerApplication app = getGeoServerApplication();
            storeEditPanel = StoreExtensionPoints.getStoreEditPanel("parametersPanel", paramsForm,
                    store, app);
        }
        paramsForm.add(storeEditPanel);

        // cancel/submit buttons
        paramsForm.add(new BookmarkablePageLink("cancel", StorePage.class));
        paramsForm.add(saveLink());
        paramsForm.setDefaultButton(saveLink());

        // feedback panel for error messages
        paramsForm.add(new FeedbackPanel("feedback"));

        StoreNameValidator storeNameValidator = new StoreNameValidator(workspacePanel
                .getFormComponent(), namePanel.getFormComponent(), store.getId());
        paramsForm.add(storeNameValidator);
    }
View Full Code Here


             */
            final IModel paramValue = new MapModel(paramsModel, TABLE_NAME);
            final String resourceKey = RESOURCE_KEY_PREFIX + "." + TABLE_NAME;
            final IModel paramLabelModel = new ResourceModel(resourceKey, TABLE_NAME);
            final boolean required = true;
            TextParamPanel tableNamePanel;
            tableNamePanel = new TextParamPanel(panelId, paramValue, paramLabelModel, required);
            add(tableNamePanel);

            tableNameComponent = tableNamePanel.getFormComponent();
            tableNameComponent.setEnabled(false);

            final String titleKey = resourceKey + ".title";
            ResourceModel titleModel = new ResourceModel(titleKey);
            String title = String.valueOf(titleModel.getObject());

            tableNamePanel.add(new SimpleAttributeModifier("title", title));
        }

        return tableNameComponent;
    }
View Full Code Here

        final String paramName = param.key;
        final String resourceKey = getClass().getSimpleName() + "." + paramName;

        final boolean required = param.required;

        final TextParamPanel textParamPanel = new TextParamPanel(paramName, new MapModel(
                paramsModel, paramName), new ResourceModel(resourceKey, paramName), required);
        textParamPanel.getFormComponent().setType(param.type);

        String defaultTitle = String.valueOf(param.title);

        ResourceModel titleModel = new ResourceModel(resourceKey + ".title", defaultTitle);
        String title = String.valueOf(titleModel.getObject());

        textParamPanel.add(new SimpleAttributeModifier("title", title));

        add(textParamPanel);
        return textParamPanel.getFormComponent();
    }
View Full Code Here

            final IModel wsLabelModel = new ResourceModel("AbstractDataAccessPage.workspace");
            workspacePanel = new WorkspacePanel("workspacePanel", wsModel, wsLabelModel, true);
        }
        paramsForm.add(workspacePanel);

        final TextParamPanel dataStoreNamePanel;

        dataStoreNamePanel = new TextParamPanel("dataStoreNamePanel", new PropertyModel(model,
                "name"),
                new ResourceModel("AbstractDataAccessPage.dataSrcName", "Data Source Name"), true);
        paramsForm.add(dataStoreNamePanel);

        paramsForm.add(new TextParamPanel("dataStoreDescriptionPanel", new PropertyModel(model,
                "description"), new ResourceModel("description", "Description"), false,
                (IValidator[]) null));

        paramsForm.add(new CheckBoxParamPanel("dataStoreEnabledPanel", new PropertyModel(model,
                "enabled"), new ResourceModel("enabled", "Enabled")));

        final StoreEditPanel storeEditPanel;
        {
            /*
             * Here's where the extension point is applied in order to give extensions a chance to
             * provide custom behavior/components for the coverage form other than the default
             * single "url" input field
             */
            GeoServerApplication app = getGeoServerApplication();
            storeEditPanel = StoreExtensionPoints.getStoreEditPanel("parametersPanel", paramsForm,
                    storeInfo, app);
        }
        paramsForm.add(storeEditPanel);

        paramsForm.add(new FeedbackPanel("feedback"));

        // validate the selected workspace does not already contain a store with the same name
        final String dataStoreInfoId = storeInfo.getId();
        StoreNameValidator storeNameValidator = new StoreNameValidator(workspacePanel
                .getFormComponent(), dataStoreNamePanel.getFormComponent(), dataStoreInfoId);
        paramsForm.add(storeNameValidator);

        paramsForm.add(new BookmarkablePageLink("cancel", StorePage.class));

        paramsForm.add(new AjaxSubmitLink("save", paramsForm) {
View Full Code Here

            String keyName) {
        if (keyName.contains("Color"))
            return new ColorPickerPanel(id, new MapModel(paramsModel, keyName),
                    new org.apache.wicket.model.ResourceModel(keyName, keyName), false);
        else
            return new TextParamPanel(id, new MapModel(paramsModel, keyName),
                    new org.apache.wicket.model.ResourceModel(keyName, keyName), false);
    }
View Full Code Here

                model = new URLModel(paramsModel, paramName);
            } else {
                model = new MapModel(paramsModel, paramName);
            }
           
            TextParamPanel tp = new TextParamPanel(componentId,
                    model, new ResourceModel(paramLabel, paramLabel), required);
            // if it can be a reference to the local filesystem make sure it's valid
            if (paramName.equalsIgnoreCase("url")) {
                tp.getFormComponent().add(new FileExistsValidator());
            }
            // make sure the proper value is returned, but don't set it for strings otherwise
            // we incur in a wicket bug (the empty string is not converter back to a null)
            // GR: it doesn't work for File neither.
            // AA: better not mess with files, the converters turn data dir relative to
            // absolute and bye bye data dir portability
            if (binding != null && !String.class.equals(binding) && !File.class.equals(binding)
                    && !URL.class.equals(binding)) {
                tp.getFormComponent().setType(binding);
            }
            parameterPanel = tp;
        }
        return parameterPanel;
    }
View Full Code Here

    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);
    }
View Full Code Here

             */
            final IModel paramValue = new MapModel(paramsModel, TABLE_NAME);
            final String resourceKey = RESOURCE_KEY_PREFIX + "." + TABLE_NAME;
            final IModel paramLabelModel = new ResourceModel(resourceKey, TABLE_NAME);
            final boolean required = true;
            TextParamPanel tableNamePanel;
            tableNamePanel = new TextParamPanel(panelId, paramValue, paramLabelModel, required);
            add(tableNamePanel);

            tableNameComponent = tableNamePanel.getFormComponent();
            tableNameComponent.setEnabled(false);

            final String titleKey = resourceKey + ".title";
            ResourceModel titleModel = new ResourceModel(titleKey);
            String title = String.valueOf(titleModel.getObject());

            tableNamePanel.add(new SimpleAttributeModifier("title", title));
        }

        return tableNameComponent;
    }
View Full Code Here

        final String paramName = param.key;
        final String resourceKey = getClass().getSimpleName() + "." + paramName;

        final boolean required = param.required;

        final TextParamPanel textParamPanel = new TextParamPanel(paramName, new MapModel(
                paramsModel, paramName), new ResourceModel(resourceKey, paramName), required);
        textParamPanel.getFormComponent().setType(param.type);

        String defaultTitle = String.valueOf(param.title);

        ResourceModel titleModel = new ResourceModel(resourceKey + ".title", defaultTitle);
        String title = String.valueOf(titleModel.getObject());

        textParamPanel.add(new SimpleAttributeModifier("title", title));

        add(textParamPanel);
        return textParamPanel.getFormComponent();
    }
View Full Code Here

            final IModel wsLabelModel = new ResourceModel("AbstractDataAccessPage.workspace");
            workspacePanel = new WorkspacePanel("workspacePanel", wsModel, wsLabelModel, true);
        }
        paramsForm.add(workspacePanel);

        final TextParamPanel dataStoreNamePanel;

        dataStoreNamePanel = new TextParamPanel("dataStoreNamePanel", new PropertyModel(model,
                "name"),
                new ResourceModel("AbstractDataAccessPage.dataSrcName", "Data Source Name"), true);
        paramsForm.add(dataStoreNamePanel);

        paramsForm.add(new TextParamPanel("dataStoreDescriptionPanel", new PropertyModel(model,
                "description"), new ResourceModel("description", "Description"), false,
                (IValidator[]) null));

        paramsForm.add(new CheckBoxParamPanel("dataStoreEnabledPanel", new PropertyModel(model,
                "enabled"), new ResourceModel("enabled", "Enabled")));

        final StoreEditPanel storeEditPanel;
        {
            /*
             * Here's where the extension point is applied in order to give extensions a chance to
             * provide custom behavior/components for the coverage form other than the default
             * single "url" input field
             */
            GeoServerApplication app = getGeoServerApplication();
            storeEditPanel = StoreExtensionPoints.getStoreEditPanel("parametersPanel", paramsForm,
                    storeInfo, app);
        }
        paramsForm.add(storeEditPanel);

        paramsForm.add(new FeedbackPanel("feedback"));

        // validate the selected workspace does not already contain a store with the same name
        final String dataStoreInfoId = storeInfo.getId();
        StoreNameValidator storeNameValidator = new StoreNameValidator(workspacePanel
                .getFormComponent(), dataStoreNamePanel.getFormComponent(), dataStoreInfoId);
        paramsForm.add(storeNameValidator);

        paramsForm.add(new BookmarkablePageLink("cancel", StorePage.class));

        paramsForm.add(new AjaxSubmitLink("save", paramsForm) {
View Full Code Here

TOP

Related Classes of org.geoserver.web.data.store.panel.TextParamPanel

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.