Package org.geoserver.config

Examples of org.geoserver.config.GeoServer


public class MaxFeaturesTest extends WFSTestSupport {
 
    @Override
    protected void setUpInternal(SystemTestData data) throws Exception {
         // set global max to 5
        GeoServer gs = getGeoServer();
       
        WFSInfo wfs = getWFS();
        wfs.setMaxFeatures( 5 );
        gs.save( wfs );
    }
View Full Code Here


        protected void encodeExtendedData(SimpleFeature feature) {
            // code at the moment is in KML3VectorTransfomer
        }

        protected String getFeatureTypeURL() throws IOException {
            GeoServer gs = wms.getGeoServer();
            Catalog catalog = gs.getCatalog();
            String nsUri = mapLayer.getFeatureSource().getSchema().getName().getNamespaceURI();
            NamespaceInfo ns = catalog.getNamespaceByURI(nsUri);
            String featureTypeName = mapLayer.getFeatureSource().getSchema().getName()
                    .getLocalPart();
            GetMapRequest request = mapContent.getRequest();
View Full Code Here

            KMLGeometryTransformer geometryTransformer = new KMLGeometryTransformer();
            // geometryTransformer.setUseDummyZ( true );
            geometryTransformer.setOmitXMLDeclaration(true);
            geometryTransformer.setNamespaceDeclarationEnabled(true);

            GeoServer config = wms.getGeoServer();
            geometryTransformer.setNumDecimals(config.getSettings().getNumDecimals());

            geometryTranslator = (KMLGeometryTransformer.KMLGeometryTranslator) geometryTransformer
                    .createTranslator(contentHandler, mapContent);
        }
View Full Code Here

        // Login
        login();
        // Selection of the workspace
        citeWorkspace = getCatalog().getWorkspaceByName(MockData.CITE_PREFIX);
        // Removing the settings associated to the workspace
        GeoServer gs = getGeoServer();
        SettingsInfo s = gs.getSettings(citeWorkspace);
        if (s != null) {
            gs.remove(s);
        }
        NamespaceInfo citeNS = getCatalog().getNamespaceByPrefix(MockData.CITE_PREFIX);
        citeNS.setURI(MockData.CITE_URI);
        getCatalog().save(citeNS);
    }
View Full Code Here

        form.setValue("settings:enabled", true);
        form.submit();
        // Check if no error has been found
        tester.assertNoErrorMessage();
        // Get GeoServer object for retrieving the settings associated to the workspace
        GeoServer gs = getGeoServer();
        assertNotNull(gs.getSettings(citeWorkspace));
        // Reload the page
        tester.startPage(new WorkspaceEditPage(citeWorkspace));
        tester.assertRenderedPage(WorkspaceEditPage.class);

        // CQL expression
        String expression = "stringTemplate(path, '(\\w{4})_(\\w{7})_(\\d{3})_(\\d{4})(\\d{2})(\\d{2})T(\\d{7})_(\\d{2})\\.(\\w{4})', "
                + "'/${1}/${4}/${5}/${6}/${0}')";
        // Set the root directory
        FormTester form2 = tester.newFormTester("form");
        form2.setValue("settings:settingsContainer:otherSettings:extensions:0:content:ecqlexp",
                expression);
        form2.submit();
        // Check if no error has been found
        tester.assertNoErrorMessage();
        // Control if the defined root has been correctly set
        assertEquals(
                gs.getSettings(citeWorkspace).getMetadata()
                        .get(RESTUploadECQLPathMapper.EXPRESSION_KEY, String.class), expression);
    }
View Full Code Here

        tester.startPage(new GlobalSettingsPage());
        tester.assertRenderedPage(GlobalSettingsPage.class);
        tester.assertNoErrorMessage();
       
        // Get GeoServer object for searching the global settings
        GeoServer gs = getGeoServer();

        // CQL expression
        String expression = "stringTemplate(path, '(\\w{4})_(\\w{7})_(\\d{3})_(\\d{4})(\\d{2})(\\d{2})T(\\d{7})_(\\d{2})\\.(\\w{4})', "
                + "'/${1}/${4}/${5}/${6}/${0}')";
        // Set the root directory
        FormTester form = tester.newFormTester("form");
        form.setValue("extensions:0:content:ecqlexp", expression);
        form.submit("submit");
        // Check if no error has been found
        tester.assertNoErrorMessage();
        // Control if the defined root has been correctly set
        assertEquals(
                gs.getGlobal().getSettings().getMetadata()
                        .get(RESTUploadECQLPathMapper.EXPRESSION_KEY, String.class), expression);
    }
View Full Code Here

        assertEquals(0, pixel[1]);
        assertEquals(0, pixel[2]);
    }

    private void setInputLimit(int kbytes) {
        GeoServer gs = getGeoServer();
        WCSInfo info = gs.getService(WCSInfo.class);
        info.setMaxInputMemory(kbytes);
        gs.save(info);
    }
View Full Code Here

        gs.save(info);
    }
   

    private void setOutputLimit(int kbytes) {
        GeoServer gs = getGeoServer();
        WCSInfo info = gs.getService(WCSInfo.class);
        info.setMaxOutputMemory(kbytes);
        gs.save(info);
    }
View Full Code Here

     *
     * @throws Exception
     */
    @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

        // 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();
               
        FeatureTypeSchemaBuilder sb = new FeatureTypeSchemaBuilder.GML3(gs);
        WFSConfiguration configuration = new WFSConfiguration(gs, sb, new WFS(sb));
       
        GML3OutputFormat format = new GML3OutputFormat(gs, configuration);
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.