Package org.geoserver.config

Examples of org.geoserver.config.GeoServerInfo


    }
   
    @Test
    public void testSkipMisconfiguredLayers() throws Exception {
        // configure geoserver to skip misconfigured layers
        GeoServerInfo global = getGeoServer().getGlobal();
        global.setResourceErrorHandling(ResourceErrorHandling.SKIP_MISCONFIGURED_LAYERS);
        getGeoServer().save(global);

        // introduce misconfiguration
        FeatureTypeInfo ftype = getCatalog().getFeatureTypeByName(CiteTestData.UPDATES.getLocalPart());
        ftype.setLatLonBoundingBox(null);
View Full Code Here


     */
    @Test
    public void testProxyBaseURL() throws Exception {
        GeoServer gs = getGeoServer();
        try {
            GeoServerInfo info = gs.getGlobal();
            info.getSettings().setProxyBaseUrl("http://myhost:9999/gs");
            gs.save(info);

            final String requestUrl = "wms/kml?layers=" + getLayerId(MockData.BRIDGES)
                    + "&styles=Bridge&mode=download";
            Document dom = getAsDOM(requestUrl);

            // make sure we are using the proxy base URL
            XMLAssert.assertXpathEvaluatesTo("http://myhost:9999/gs/styles/bridge.png",
                    "//kml:Style/kml:IconStyle/kml:Icon/kml:href", dom);
        } finally {
            GeoServerInfo info = gs.getGlobal();
            info.getSettings().setProxyBaseUrl(null);
            gs.save(info);
        }
    }
View Full Code Here

    }

    @Override
    protected void setUpInternal() throws Exception {
        GeoServer gs = getGeoServer();
        GeoServerInfo global = gs.getGlobal();
        SettingsInfo settings = global.getSettings();
        ContactInfo contact = settings.getContact();
        contact.setContactOrganization("GeoServer");
        contact.setOnlineResource("http://www.geoserver.org");
        gs.save(global);
View Full Code Here

        reinitializeLogging();
    }

    @Override
    public GeoServerInfo getGlobal() {
        GeoServerInfo global = db.getById(GLOBAL_ID, GeoServerInfo.class);
        return global;
    }
View Full Code Here

        if (null == getGlobal()) {
            db.add(global);
        } else {
            db.save(ModificationProxy.create(global, GeoServerInfo.class));
        }
        GeoServerInfo saved = getGlobal();
        Preconditions.checkNotNull(saved);
    }
View Full Code Here

    }
    @Test
    public void testGlobal() throws Exception {
        assertNull(dao.getGlobal());
       
        GeoServerInfo global = dao.getGeoServer().getFactory().createGlobal();
        dao.setGlobal(global);
       
        assertEquals(global, dao.getGlobal());
       
        global = dao.getGlobal();
        global.setAdminPassword("somePassword");
        dao.setGlobal(global);
       
        assertEquals(global, dao.getGlobal());
       
        global = dao.getGlobal();
        global.setAdminUsername("someUsername");
        dao.save(global);
       
        assertEquals(global, dao.getGlobal());
    }
View Full Code Here

        DeleteDbFiles.execute("target", "geoserver", true);
        super.setUp();
       
        GeoServerFacade dao = geoServer.getFacade();
        for (ServiceInfo s : dao.getServices()) { dao.remove(s); }
        GeoServerInfo global = dao.getGlobal();
        if (global != null) {
            //global.setAdminPassword(null);
            //dao.save(global);
            dao.setGlobal(null);
        }
View Full Code Here

    //
   
    @Override
    @Test
    public void testModifyGlobal() throws Exception {
        GeoServerInfo global = geoServer.getFactory().createGlobal();
        geoServer.setGlobal( global );

        GeoServerInfo g1 = geoServer.getGlobal();
        g1.setAdminPassword( "newAdminPassword" );
        geoServer.save( g1 );
       
        GeoServerInfo g2 = geoServer.getGlobal();
        assertEquals( "newAdminPassword", g2.getAdminPassword() );
    }
View Full Code Here

        Kml kml = nlBuilder.buildKMLDocument();

        Document doc = (Document) kml.getFeature();
        doc.createAndSetAtomAuthor();
        doc.setOpen(true);
        GeoServerInfo gsInfo = encodingContext.getWms().getGeoServer().getGlobal();
        String authorName = gsInfo.getSettings().getContact().getContactPerson();
        Author author = doc.createAndSetAtomAuthor();
        author.addToNameOrUriOrEmail(authorName);
        doc.createAndSetAtomLink(gsInfo.getSettings().getOnlineResource());
       
        WMSMapContent mapContent = encodingContext.getMapContent();
        doc.setDescription(buildDescription(mapContent));

        // see if we have to include sample data
View Full Code Here

        assertEquals("xsd:schema", doc.getDocumentElement().getNodeName());
        XMLAssert.assertXpathEvaluatesTo("1",
                "count(//xsd:import[contains(@schemaLocation, 'AggregateGeoFeature')])", doc);
       
        // enable skipping of misconfigured layers
        GeoServerInfo global = getGeoServer().getGlobal();
        global.setResourceErrorHandling(ResourceErrorHandling.SKIP_MISCONFIGURED_LAYERS);
        getGeoServer().save(global);
       
        // misconfigure a layer
        FeatureTypeInfo ftype =
                getCatalog().getFeatureTypeByName(CiteTestData.AGGREGATEGEOFEATURE.getLocalPart());
View Full Code Here

TOP

Related Classes of org.geoserver.config.GeoServerInfo

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.