Package org.geoserver.config

Examples of org.geoserver.config.GeoServer


* @author Andrea Aime - GeoSolutions
*/
public abstract class AbstractGeoSearchDecorator implements KmlDecorator {

    protected String getFeatureTypeURL(KmlEncodingContext context) throws IOException {
        GeoServer gs = context.getWms().getGeoServer();
        Catalog catalog = gs.getCatalog();
        Layer layer = context.getCurrentLayer();
        FeatureSource featureSource = layer.getFeatureSource();
        Name typeName = featureSource.getSchema().getName();
        String nsUri = typeName.getNamespaceURI();
        NamespaceInfo ns = catalog.getNamespaceByURI(nsUri);
View Full Code Here


        form.add(imageIOCacheThreshold);
               
        Button submit = new Button("submit", new StringResourceModel("submit", this, null)) {
            @Override
            public void onSubmit() {
                GeoServer gs = (GeoServer) geoServerModel.getObject();
                GeoServerInfo global = gs.getGlobal();
                global.setCoverageAccess( (CoverageAccessInfo)coverageModel.getObject() );
                gs.save(global);
                doReturn();
            }
        };
        form.add(submit);
       
View Full Code Here

    void createAppContext(String proxyBaseUrl) {
        SettingsInfo settings = createNiceMock(SettingsInfo.class);
        expect(settings.getProxyBaseUrl()).andReturn(proxyBaseUrl).anyTimes();
        replay(settings);
       
        GeoServer geoServer = createNiceMock(GeoServer.class);
        expect(geoServer.getSettings()).andReturn(settings).anyTimes();
        replay(geoServer);
       
        ProxifyingURLMangler mangler = new ProxifyingURLMangler(geoServer);
        ApplicationContext appContext = createNiceMock(ApplicationContext.class);
        expect(appContext.getBeanNamesForType(URLMangler.class)).andReturn(new String[]{"mangler"});
View Full Code Here

            }
            AttributesImpl attributes = attributes("xlink:type", "simple", "xlink:href",
                    onlineResource);
            element("OnlineResource", null, attributes);

            GeoServer geoServer = wmsConfig.getGeoServer();
            ContactInfo contact = geoServer.getSettings().getContact();
            handleContactInfo(contact);

            String fees = serviceInfo.getFees();
            element("Fees", fees == null ? "none" : fees);
            String constraints = serviceInfo.getAccessConstraints();
View Full Code Here

    LayerGroupInfo global, global2, sf, cite, nested;

    @Before
    public void prepare() throws Exception {
        // get a shorter list of SRS
        GeoServer gs = getGeoServer();
        WMSInfo wms = gs.getService(WMSInfo.class);
        wms.getSRS().add("4326");
        gs.save(wms);
       
        Catalog cat = getCatalog();

        global = createLayerGroup(cat, "base", "base default",
            layer(cat, MockData.LAKES), layer(cat, MockData.FORESTS));
View Full Code Here

    }

    @Override
    protected void onSetUp(SystemTestData testData) throws Exception {
        super.onSetUp(testData);
        GeoServer geoServer = getGeoServer();
        WorkspaceInfo ws = geoServer.getCatalog().getWorkspaceByName("sf");
        LocalWorkspace.set(ws);
        WFSInfo wfsInfo = geoServer.getService(WFSInfo.class);
        wfsInfo.setWorkspace(ws);
        geoServer.save(wfsInfo);
    }
View Full Code Here

        }
        assertEquals(true, thrown);
    }

    private void removeLocalWorkspace() {
        GeoServer geoServer = getGeoServer();
        WorkspaceInfo ws = geoServer.getCatalog().getWorkspaceByName("sf");
        WFSInfo wfsInfo = geoServer.getService(ws, WFSInfo.class);
        geoServer.remove(wfsInfo);
    }
View Full Code Here

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

            Layer layer = createMapLayer(MockData.POINTS, "Bridge");
            FeatureSource<SimpleFeatureType, SimpleFeature> featureSource;
            featureSource = (FeatureSource<SimpleFeatureType, SimpleFeature>) layer
                    .getFeatureSource();
            int nfeatures = featureSource.getFeatures().size();

            WMSMapContent mapContent = new WMSMapContent(createGetMapRequest(MockData.POINTS));
            Document document;

            try {
                mapContent.addLayer(layer);
                KMLVectorTransformer transformer = new KMLVectorTransformer(getWMS(), mapContent,
                        layer);
                transformer.setIndentation(2);

                document = WMSTestSupport.transform(featureSource.getFeatures(), transformer);
                // print(document);
            } finally {
                mapContent.dispose();
            }
            // make sure we are using the proxy base URL
            XMLAssert.assertXpathEvaluatesTo("http://myhost:9999/gs/styles/bridge.png",
                    "//Style/IconStyle/Icon/href", document);
        } finally {
            GeoServerInfo info = gs.getGlobal();
            info.setProxyBaseUrl(null);
            gs.save(info);
        }
    }
View Full Code Here

public class LogPageTest extends GeoServerWicketTestSupport {

    @Test
    public void testDefaultLocation() {
        GeoServer gs = getGeoServerApplication().getGeoServer();
        LoggingInfo logging = gs.getLogging();
        logging.setLocation("logs/geoserver.log");
        gs.save(logging);

        login();
        tester.startPage(LogPage.class);
        tester.assertRenderedPage(LogPage.class);
    }
View Full Code Here

        tester.assertRenderedPage(LogPage.class);
    }

    @Test
    public void testNullLocation() {
        GeoServer gs = getGeoServerApplication().getGeoServer();
        LoggingInfo logging = gs.getLogging();
        logging.setLocation(null);
        gs.save(logging);

        login();
        tester.startPage(LogPage.class);
        tester.assertRenderedPage(LogPage.class);
    }
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.