Package org.geoserver.wms.dimension

Examples of org.geoserver.wms.dimension.DefaultValueConfigurations


    private List<DefaultValueConfiguration> getConfigurations(IModel<LayerInfo> layerModel,
            IModel<DefaultValueConfigurations> configModel) {
        ArrayList<DefaultValueConfiguration> result = new ArrayList<DefaultValueConfiguration>();

        // see if we have configs already
        DefaultValueConfigurations configs = configModel.getObject();
        if (configs != null) {
            result.addAll(configs.getConfigurations());
        } else {
            configs = new DefaultValueConfigurations(new ArrayList<DefaultValueConfiguration>());
        }

        // add missing dimension configs
        Set<String> dimensionNames = getEnabledDimensionNames(layerModel.getObject());
        for (String dimensionName : dimensionNames) {
            addIfMissing(dimensionName, result);
        }

        // remove unknown ones
        for (Iterator it = result.iterator(); it.hasNext();) {
            DefaultValueConfiguration config = (DefaultValueConfiguration) it.next();
            if (!dimensionNames.contains(config.getDimension())) {
                it.remove();
            }

        }

        configs.getConfigurations().clear();
        configs.getConfigurations().addAll(result);
        return result;
    }
View Full Code Here


            add(new IValidator<DefaultValueConfigurations>() {

                @Override
                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 Object component(Component component) {
                    ((FormComponent) component).updateModel();
                    return null;
                }
            });
            setConvertedInput(new DefaultValueConfigurations(configurations));
        }
View Full Code Here

    }

    protected void setupDynamicDimensions(String resourceName,
            DefaultValueConfiguration... configurations) {
        ResourceInfo info = getCatalog().getResourceByName(resourceName, ResourceInfo.class);
        DefaultValueConfigurations configs = new DefaultValueConfigurations(
                Arrays.asList(configurations));
        info.getMetadata().put(DefaultValueConfigurations.KEY, configs);
        getCatalog().save(info);
    }
View Full Code Here

TOP

Related Classes of org.geoserver.wms.dimension.DefaultValueConfigurations

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.