Package org.geoserver.catalog

Examples of org.geoserver.catalog.StyleInfo


        super( id );
       
        items = new ArrayList();
        for ( int i = 0; i < layerGroup.getLayers().size(); i++ ) {
            LayerInfo layer = layerGroup.getLayers().get( i );
            StyleInfo style = layerGroup.getStyles().get( i );
            items.add( new LayerGroupEntry( layer, style ) );
        }
       
        add( popupWindow = new ModalWindow( "popup" ) );
       
View Full Code Here


                }
        }));
        styleChoice.add(new AjaxFormComponentUpdatingBehavior("onchange") {
            @Override
            protected void onUpdate(AjaxRequestTarget target) {
                StyleInfo s = (StyleInfo) styleChoice.getModelObject();
                mapPanel.update(null,s,target);
               
                updateSLD();
                target.addComponent(sldTextArea);
            }
        });
        updateStyles(layer);
       
        form.add(new AjaxButton("save", form) {
           
            @Override
            protected void onSubmit(AjaxRequestTarget target, Form form) {
                //sldTextArea.inputChanged();
                //sldTextArea.processInput();
               
                Catalog catalog = ((GeoServerApplication)getApplication()).getCatalog();
                StyleInfo style = (StyleInfo) styleChoice.getModelObject();
               
                try {
                    catalog.getResourcePool().writeStyle(style, new ByteArrayInputStream(sld.getBytes()));
                    catalog.save(style);
                   
View Full Code Here

            if (catalog.getStyleByName(stylename) != null) {
                LOGGER.info("Style " + stylename + "exists.");
                continue;
            }

            StyleInfo style = this.catalog.getFactory().createStyle();
            style.setName(stylename);
            style.setFilename(FilenameUtils.getName(sldfilename));

            try {
                if (LOGGER.isLoggable(Level.INFO))
                    LOGGER.info("Importing SLD " + style.getName() + " in file " + sldfilename);
                catalog.add(style);
            } catch (Exception e) {
                LOGGER
                        .severe("Could not import SLD " + style.getName() + " in file "
                                + sldfilename);
            }
        }

    }
View Full Code Here

            LOGGER.log(Level.SEVERE, "Could not import SLD " + styleName, ex);
            return;
        }

        // create a style for it
        StyleInfo s = catalog.getFactory().createStyle();
        s.setName(styleName);
        s.setFilename(sld);
        catalog.add(s);
    }
View Full Code Here

    }

    // Style methods
    public StyleInfo getStyle(String id) {
        StyleInfo style = catalogDAO.getStyle(id);
        if (style != null) {
            resolve(style);
            return createProxy(style, StyleInfo.class);
        } else
            return null;
View Full Code Here

            return null;

    }

    public StyleInfo getStyleByName(String name) {
        StyleInfo style = catalogDAO.getStyleByName(name);
        if (style != null) {
            resolve(style);
            return createProxy(style, StyleInfo.class);
        } else
            return null;
View Full Code Here

        }
        if (isNull(style.getFilename())) {
            throw new NullPointerException("Style fileName must not be null");
        }

        StyleInfo existing = getStyleByName(style.getName());
        if (existing != null && !existing.getId().equals(style.getId())) {
            throw new IllegalArgumentException("Style named '" + style.getName()
                    + "' already exists.");
        }
    }
View Full Code Here

            if (style.equals(l.getDefaultStyle()) || l.getStyles().contains(style)) {
                throw new IllegalArgumentException("Unable to delete style referenced by '"
                        + l.getName() + "'");
            }
        }
        StyleInfo realObj = catalogDAO.getStyle(style.getId());
        catalogDAO.delete(realObj);
        removed(style);
    }
View Full Code Here

            resolve(resolved);
            lg.getLayers().set(i, resolved);
        }

        for (int i = 0; i < lg.getStyles().size(); i++) {
            StyleInfo s = lg.getStyles().get(i);
            if (s != null) {
                StyleInfo resolved = ResolvingProxy.resolve(this, s);
                ((StyleInfoImpl)resolved).setCatalog(this);
                lg.getStyles().set(i, resolved);
            }
        }
View Full Code Here

        assertXpathEvaluatesTo("1", "count(//Attribution/LogoURL)", doc);
    }
   
    public void testAlternateStyles() throws Exception {
        // add an alternate style to Fifteen
        StyleInfo pointStyle = getCatalog().getStyleByName("point");
        LayerInfo layer = getCatalog().getLayerByName("Fifteen");
        layer.getStyles().add(pointStyle);
        getCatalog().save(layer);
       
        Document doc = getAsDOM("wms?service=WMS&request=getCapabilities", true);
View Full Code Here

TOP

Related Classes of org.geoserver.catalog.StyleInfo

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.