Package org.geoserver.web.wicket

Examples of org.geoserver.web.wicket.ParamResourceModel


    public Object getDisplayValue(Object o) {
      File f = (File) o;
     
      if(f == USER_HOME) {
          return new ParamResourceModel("userHome", GeoServerFileChooser.this).getString();
      } else {
          GeoServerResourceLoader loader = GeoServerExtensions.bean(GeoServerResourceLoader.class);
         
          if(f.equals(loader.getBaseDirectory())) {
              return new ParamResourceModel("dataDirectory", GeoServerFileChooser.this).getString();
          }
      }
     
      try {
          final String displayName= FileSystemView.getFileSystemView().getSystemDisplayName(f);
View Full Code Here


                public void validate(IValidatable<DefaultValueConfigurations> validatable) {
                    DefaultValueConfigurations configurations = validatable.getValue();
                    for (DefaultValueConfiguration config : configurations.getConfigurations()) {
                        if (config.getPolicy() == DefaultValuePolicy.EXPRESSION
                                && config.getDefaultValueExpression() == null) {
                            error(new ParamResourceModel("expressionRequired",
                                    DynamicDimensionsTabPanel.this).getString());
                        }
                    }

                }
View Full Code Here

    public ScriptEditPage(PageParameters parameters) {
        String fileName = parameters.getString("file");
        File file = new File(fileName);
        Script script = new Script(file);
        if (script == null) {
            error(new ParamResourceModel("ScriptEditPage.notFound", this, script).getString());
            doReturn(ScriptPage.class);
            return;
        }

        init(script);
View Full Code Here

        final IModel paramsModel = new PropertyModel(model, "connectionParameters");
        new MapModel(paramsModel, CONFIGURATION.key).setObject(null);

        add(new TextParamPanel("parallelism", new MapModel(paramsModel, PARALLELISM.key),
                new ParamResourceModel("parallelism", this), true));

        add(new CheckBoxParamPanel("tolerateErrors", new MapModel(paramsModel,
                TOLERATE_CONNECTION_FAILURE.key), new ParamResourceModel("tolerateErrors", this)));

        configModel = new ConfigModel(new MapModel(paramsModel, CONFIGURATION_XML.key));
        configs = configModel.getObject();
        if(configs == null) {
            configs = new ArrayList<AggregateTypeConfiguration>();
View Full Code Here

            protected IAjaxCallDecorator getAjaxCallDecorator() {
                return new AjaxPreprocessingCallDecorator(null) {

                    @Override
                    public CharSequence preDecorateScript(CharSequence script) {
                        String msg = new ParamResourceModel("confirmTypeRemoval",
                                AggregateStoreEditPanel.this, entry.getName()).getString();
                        return "if(!confirm('" + msg +"')) return false;" + script;
                    }
                };
            }
        };
        link.getImage().add(new AttributeModifier("alt", true, new ParamResourceModel("AggregateStoreEditPanel.th.remove", link)));
        return link;
    }
View Full Code Here

        final FeatureTypeInfo fti = (FeatureTypeInfo) model.getObject();
        final ResourceConfigurationPanel current = this;

        final ModalWindow modal = new ModalWindow("modal");
        modal.setInitialWidth(800);
        modal.setTitle(new ParamResourceModel("modalTitle", SolrConfigurationPanel.this));
        modal.setWindowClosedCallback(new ModalWindow.WindowClosedCallback() {
            @Override
            public void onClose(AjaxRequestTarget target) {
                if (_layerInfo != null) {
                    GeoServerApplication app = (GeoServerApplication) getApplication();
View Full Code Here

            fti.getMetadata().put(FeatureTypeInfo.JDBC_VIRTUAL_TABLE, vt);
            LayerInfo layerInfo = builder.buildLayer(fti);
            setResponsePage(new ResourceConfigurationPage(layerInfo, true));
        } catch (Exception e) {
            LOGGER.log(Level.SEVERE, "Failed to create feature type", e);
            error(new ParamResourceModel("creationFailure", this, getFirstErrorMessage(e))
                    .getString());
        }
    }
View Full Code Here

                        sridSet = true;
                    }
                }
            }
            if (!pkSet) {
                error(new ParamResourceModel("pkEmptyFailure", SolrConfigurationPage.this)
                        .getString());
            }
            if (!geomSet) {
                error(new ParamResourceModel("geomEmptyFailure", SolrConfigurationPage.this)
                        .getString());
            }
            if (!sridSet) {
                error(new ParamResourceModel("sridEmptyFailure", SolrConfigurationPage.this)
                        .getString());
            }
            if (!pkSet || !geomSet || !sridSet) {
                target.addComponent(feedbackPanel);
                return;
            }

            Catalog catalog = ((GeoServerApplication) this.getPage().getApplication()).getCatalog();
            LayerInfo layerInfo = catalog.getLayerByName(ri.getQualifiedName());
            FeatureTypeInfo typeInfo;
            Boolean isNew = true;
            if (layerInfo == null) {
                // New
                DataStoreInfo dsInfo = catalog.getStore(ri.getStore().getId(), DataStoreInfo.class);
                SolrDataStore ds = (SolrDataStore) dsInfo.getDataStore(null);
                CatalogBuilder builder = new CatalogBuilder(catalog);
                builder.setStore(dsInfo);
                ds.setSolrConfigurations(layerConfiguration);
                typeInfo = builder.buildFeatureType(ds.getFeatureSource(ri.getQualifiedName()));
                typeInfo.getMetadata().put(SolrLayerConfiguration.KEY, layerConfiguration);
                layerInfo = builder.buildLayer(typeInfo);
            } else {
                // Update
                isNew = false;
                ResourceInfo resourceInfo = layerInfo.getResource();
                FeatureTypeInfo featureTypeInfo = (FeatureTypeInfo) resourceInfo;
                featureTypeInfo.getMetadata().put(SolrLayerConfiguration.KEY, layerConfiguration);
            }
            done(target, layerInfo, isNew);

        } catch (Exception e) {
            LOGGER.log(Level.SEVERE, e.getMessage(), e);
            error(new ParamResourceModel("creationFailure", this, e).getString());
        }
    }
View Full Code Here

        RepeatingView view = (RepeatingView) component;
        Iterator<? extends Component> iterator = view.iterator();
        // Check that GeoPackage has been found
        boolean gpkgFound = false;
        // Get the string for the application/x-gpkg mimetype
        ParamResourceModel rm = new ParamResourceModel("format.wms.application/x-gpkg", null, "");
        String mbtiles = rm.getString();
        while (iterator.hasNext()) {
            Component comp = iterator.next();
            assertTrue(comp instanceof Label);
            Label lb = (Label) comp;
            String test = lb.getDefaultModelObjectAsString();
View Full Code Here

        String lgName = lg.getName();
        if(lg.getWorkspace() != null) {
            String wsName = lg.getWorkspace().getName();
            preExisting = getCatalog().getLayerGroupByName(wsName, lgName);
            if(preExisting != null) {
                error(new ParamResourceModel("layerGroupAlreadyExistsInWorkspace", this, lgName, wsName).getString());
                return;
            }
        } else {
            preExisting = getCatalog().getLayerGroupByName(lgName);
            if(preExisting != null) {
                error(new ParamResourceModel("layerGroupAlreadyExists", this, lgName).getString());
                return;
            }
        }
       
        Catalog catalog = getCatalog();
View Full Code Here

TOP

Related Classes of org.geoserver.web.wicket.ParamResourceModel

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.