Package org.geoserver.config

Examples of org.geoserver.config.GeoServer


        verify(cat, times(1)).remove(isA(LayerInfo.class));
    }

    @Test
    public void testPut() throws Exception {
        GeoServer gs = MockGeoServer.get().catalog()
            .workspace("foo", "http://scratch.org", true)
                .layer("one").info("The layer", "This layer is cool!")
                .featureType().defaults().store("one")
                .geoServer().build(geoServer);

        JSONObj obj = new JSONObj().put("title", "new title");
        MockHttpServletRequestBuilder req = put("/api/layers/foo/one")
            .contentType(MediaType.APPLICATION_JSON)
            .content(obj.toString());

        mvc.perform(req).andExpect(status().isOk()).andReturn();

        LayerInfo l = gs.getCatalog().getLayerByName("foo:one");
        verify(l, times(1)).setTitle("new title");
    }
View Full Code Here


        return new String(((ByteArrayOutputStream)r.out()).toByteArray());
    }
   
    @Test
    public void testRecentLayers() throws Exception {
        @SuppressWarnings("unused")
        GeoServer gs = MockGeoServer.get().catalog()
            .workspace("foo", "http://scratch.org", true)
                .layer("layer1", "layer1")
                    .featureType().defaults().store("foo").workspace()
                .layer("layer2", "layer2")
View Full Code Here

        });
    }

    @Test
    public void testGet() throws Exception {
        @SuppressWarnings("unused")
        GeoServer gs = MockGeoServer.get().catalog()
          .resources()
            .resource("workspaces/foo/layergroups/map.xml", "layergroup placeholder")
          .geoServer()
            .catalog()
View Full Code Here

        assertNotNull(obj.get("modified"));
    }

    @Test
    public void testGetLayers() throws Exception {
        @SuppressWarnings("unused")
        GeoServer gs = MockGeoServer.get().catalog()
            .workspace("foo", "http://scratch.org", true)
                .map("map")
                    .defaults()
                    .layer("one").coverage().defaults().store("store").map()
View Full Code Here

        assertEquals("raster", obj.str("type"));
    }

    @Test
    public void testPutLayers() throws Exception {
        @SuppressWarnings("unused")
        GeoServer gs = MockGeoServer.get().catalog()
            .workspace("foo", "http://scratch.org", true)
                .map("map")
                    .defaults()
                    .layer("one")
View Full Code Here

        assertEquals( "two.ysld", m.getStyles().get(1).getFilename() );
    }
   
    @Test
    public void testRecentMaps() throws Exception {
        @SuppressWarnings("unused")
        GeoServer gs = MockGeoServer.get().catalog()
            .workspace("foo", "http://scratch.org", true)
            .map("map1", "map1")
              .defaults()
              .layer("one").featureType().defaults().store("foo").map().workspace()
View Full Code Here

        form.add(new Button("submit") {
            private static final long serialVersionUID = 1L;

            @Override
            public void onSubmit() {
                GeoServer gs = getGeoServer();
                WMSInfo wmsInfo = wmsInfoModel.getObject();
                gs.save(wmsInfo);
                if (diskQuotaDisabled) {
                    setResponsePage(GeoServerHomePage.class);
                    return;
                }
                GWC gwc = getGWC();
View Full Code Here

         *
         * @param config
         *            the service.
         */
        private void handleContact() {
            final GeoServer gs = wcs.getGeoServer();
            String tmp = "";

            if (((gs.getGlobal().getContact() != null) && (gs.getGlobal().getContact()
                    .getContactPerson() != ""))
                    || ((gs.getGlobal().getContact().getContactOrganization() != null) && (gs
                            .getGlobal().getContact().getContactOrganization() != ""))) {
                start("wcs:responsibleParty");

                tmp = gs.getGlobal().getContact().getContactPerson();
                if ((tmp != null) && (tmp != "")) {
                    element("wcs:individualName", tmp);
                }
                else {
                    //not optional
                    element("wcs:individualName", "");
                }
               
                tmp = gs.getGlobal().getContact().getContactOrganization();
                if ((tmp != null) && (tmp != "")) {
                    element("wcs:organisationName", tmp);
                }
               
                tmp = gs.getGlobal().getContact().getContactPosition();

                if ((tmp != null) && (tmp != "")) {
                    element("wcs:positionName", tmp);
                }

                start("wcs:contactInfo");

                start("wcs:phone");
                tmp = gs.getGlobal().getContact().getContactVoice();

                if ((tmp != null) && (tmp != "")) {
                    element("wcs:voice", tmp);
                }

                tmp = gs.getGlobal().getContact().getContactFacsimile();

                if ((tmp != null) && (tmp != "")) {
                    element("wcs:facsimile", tmp);
                }

                end("wcs:phone");

                start("wcs:address");
                tmp = gs.getGlobal().getContact().getAddressType();

                if ((tmp != null) && (tmp != "")) {
                    String addr = "";
                    addr = gs.getGlobal().getContact().getAddress();

                    if ((addr != null) && (addr != "")) {
                        element("wcs:deliveryPoint", tmp + " " + addr);
                    }
                } else {
                    tmp = gs.getGlobal().getContact().getAddress();

                    if ((tmp != null) && (tmp != "")) {
                        element("wcs:deliveryPoint", tmp);
                    }
                }

                tmp = gs.getGlobal().getContact().getAddressCity();

                if ((tmp != null) && (tmp != "")) {
                    element("wcs:city", tmp);
                }

                tmp = gs.getGlobal().getContact().getAddressState();

                if ((tmp != null) && (tmp != "")) {
                    element("wcs:administrativeArea", tmp);
                }

                tmp = gs.getGlobal().getContact().getAddressPostalCode();

                if ((tmp != null) && (tmp != "")) {
                    element("wcs:postalCode", tmp);
                }

                tmp = gs.getGlobal().getContact().getAddressCountry();

                if ((tmp != null) && (tmp != "")) {
                    element("wcs:country", tmp);
                }

                tmp = gs.getGlobal().getContact().getContactEmail();

                if ((tmp != null) && (tmp != "")) {
                    element("wcs:electronicMailAddress", tmp);
                }

                end("wcs:address");

                tmp = gs.getGlobal().getContact().getOnlineResource();

                if ((tmp != null) && (tmp != "")) {
                    AttributesImpl attributes = new AttributesImpl();
                    attributes.addAttribute("", "xlink:href", "xlink:href", "", tmp);
                    start("wcs:onlineResource", attributes);
View Full Code Here

    }

    @Override
    protected void setUpInternal() throws Exception {
        // configure the GSS service
        GeoServer gs = getGeoServer();
        GSSInfo gssInfo = gs.getService(GSSInfo.class);
        gssInfo.setMode(GSSMode.Central);
        gssInfo.setVersioningDataStore(getCatalog().getDataStoreByName("synch"));
        gs.save(gssInfo);

        // initialize the GSS service
        Map gssBeans = applicationContext
                .getBeansOfType(DefaultGeoServerSynchronizationService.class);
        gss = (DefaultGeoServerSynchronizationService) gssBeans.values().iterator().next();
View Full Code Here

        // this is a dummy wrapper around our 'request' object so that the new Dispatcher will
        // accept it.
        Service serviceDesc = new Service("wms", null, null, Collections.EMPTY_LIST);
        Operation opDescriptor = new Operation("", serviceDesc, null, new Object[] { gfreq });

        final GeoServer gs = wms.getGeoServer();
        GML2OutputFormat format = new GML2OutputFormat(gs);
        format.write(features, out, opDescriptor);
    }
View Full Code Here

TOP

Related Classes of org.geoserver.config.GeoServer

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.