Package org.geoserver.catalog

Examples of org.geoserver.catalog.StyleInfo


       
        List<StyleInfo> styles = catalog.getStyles();
        NodeList links = xp.getMatchingNodes("//html:a", dom);

        for ( int i = 0; i < styles.size(); i++ ) {
            StyleInfo s = (StyleInfo) styles.get( i );
            Element link = (Element) links.item( i );
           
            assertTrue( link.getAttribute("href").endsWith( s.getName()+ ".html"));
        }
    }
View Full Code Here


       
        assertNotNull( catalog.getStyleByName( "bar" ) );
    }
   
    public void testPut() throws Exception {
        StyleInfo style = catalog.getStyleByName( "Ponds");
        assertEquals( "Ponds.sld", style.getFilename() );
       
        String xml =
            "<style>" +
              "<name>Ponds</name>" +
              "<filename>Forests.sld</filename>" +
            "</style>";
       
        MockHttpServletResponse response =
            putAsServletResponse("/rest/styles/Ponds", xml.getBytes(), "text/xml");
        assertEquals( 200, response.getStatusCode() );
       
        style = catalog.getStyleByName( "Ponds");
        assertEquals( "Forests.sld", style.getFilename() );
    }
View Full Code Here

        map.setMapHeight(300);
        map.setBgColor(Color.red);
        map.setTransparent(false);
        map.setRequest(new GetMapRequest(getWMS()));

        StyleInfo styleByName = catalog.getStyleByName("Default");
        Style basicStyle = styleByName.getStyle();
        map.addLayer(fs, basicStyle);

        this.rasterMapProducer.setOutputFormat(getMapFormat());
        this.rasterMapProducer.setMapContext(map);
        this.rasterMapProducer.produceMap();
View Full Code Here

    private void addToMap(final WMSMapContext map, final QName typeName) throws IOException {
        final FeatureTypeInfo ftInfo = getCatalog().getFeatureTypeByName(typeName.getNamespaceURI(), typeName.getLocalPart());
       
        List<LayerInfo> layers = getCatalog().getLayers(ftInfo);
        StyleInfo defaultStyle = layers.get(0).getDefaultStyle();
        Style style = defaultStyle.getStyle();
       
        map.addLayer(new FeatureSourceMapLayer(ftInfo.getFeatureSource(null, null), style));
    }
View Full Code Here

                throw new RuntimeException(renderExceptionToThrow);
                // return delegate.getFeatures(query);
            }
        };
       
        StyleInfo someStyle = getCatalog().getStyles().get(0);
        map.addLayer(source, someStyle.getStyle());
        this.rasterMapProducer.setOutputFormat(getMapFormat());
        this.rasterMapProducer.setMapContext(map);
        this.rasterMapProducer.produceMap();

        return this.rasterMapProducer.getImage();
View Full Code Here

    public void testStyle() {
        System.out.println("========== testStyle()");

        removeExistingStyles();

        StyleInfo style = catalog.getFactory().createStyle();
        style.setName("style1");
        style.setFilename("style1");
        catalog.add(style);

        style = catalog.getFactory().createStyle();
        style.setName("style2");
        style.setFilename("style2");
        catalog.add(style);

        endTransaction();

        startNewTransaction();

        List<StyleInfo> styles = catalog.getStyles();
        assertFalse(styles.isEmpty());
        StyleInfo s1 = styles.get(0);

        assertTrue(styles.size() == 2);
        StyleInfo s2 = styles.get(1);

        if ("style2".equals(s1.getName())) {
            StyleInfo t = s1;
            s1 = s2;
            s2 = t;
        }

        assertEquals("style1", s1.getName());
View Full Code Here

        // store needs a workspace...
        WorkspaceInfo ws = catalog.getFactory().createWorkspace();
        ws.setName("testFeatureTypeWorkspace");
        catalog.add(ws);

        StyleInfo style = catalog.getFactory().createStyle();
        style.setName("style_testFeatureType");
        style.setFilename("style_testFeatureType");
        catalog.add(style);

        DataStoreInfo dataStore = catalog.getFactory().createDataStore();
        dataStore.setName("dataStore2");
        dataStore.setDescription("store description");
View Full Code Here

        NamespaceInfo namespace = catalog.getFactory().createNamespace();
        namespace.setPrefix(getName());
        namespace.setURI("http://" + getName() + ".openplans.org");
        catalog.add(namespace);

        StyleInfo style = catalog.getFactory().createStyle();
        style.setName("style_testCoverage");
        style.setFilename("style_testCoverage");
        catalog.add(style);

        // store needs a workspace...
        WorkspaceInfo ws = catalog.getFactory().createWorkspace();
        ws.setName("testCoverageWorkspace");
View Full Code Here

        layerGroupInfo.getLayers().add(layer2);

        ReferencedEnvelope re = new ReferencedEnvelope(10, 20, -20, -10, DefaultGeographicCRS.WGS84);
        layerGroupInfo.setBounds(re);

        StyleInfo style = catalog.getFactory().createStyle();
        style.setName("style_test");
        style.setFilename("style_test");
        catalog.add(style);

        layerGroupInfo.getStyles().add(style);
        layerGroupInfo.getStyles().add(null);
View Full Code Here

        // FIXME we are replacing some referenced object here because hib would recognized original
        // ones as unattached.
        if (entity.getDefaultStyle() != null) {
            Query query = buildQuery("from ", StyleInfo.class, " where id = ", param(entity.getDefaultStyle().getId()));
            StyleInfo style = (StyleInfo) first(query);
            entity.setDefaultStyle(style);
        }

        super.save(entity);
    }
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.