Package org.geoserver.config

Examples of org.geoserver.config.GeoServer


        xpath = XMLUnit.newXpathEngine();
    }

    @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);

        ppio = new KMLPPIO(gs);
    }
View Full Code Here


        namespaces.put("xsi", "http://www.w3.org/2001/XMLSchema-instance");
        CiteTestData.registerNamespaces(namespaces);
        XMLUnit.setXpathNamespaceContext(new SimpleNamespaceContext(namespaces));

        // setup limited srs
        GeoServer gs = getGeoServer();
        WMSInfo wms = gs.getService(WMSInfo.class);
        wms.getSRS().add("EPSG:4326");
        gs.save(wms);
       
        GeoServerUserGroupService service = getSecurityManager().loadUserGroupService("default");
        GeoServerUserGroupStore store  = service.createStore();
        store.load();
        store.addUser(store.createUserObject("cite","cite",true));
View Full Code Here

   
    @Override
    protected WFSGetFeatureOutputFormat createOutputFormat(PythonFormatAdapter adapter) {
        //workaround, because this is an extension provider it can not depend on GeoServer or
        // a circular bean reference is created so we lazily obtain a reference to gs
        GeoServer gs = GeoServerExtensions.bean(GeoServer.class);
        return new PythonGetFeatureOutputFormat((PythonVectorFormatAdapter) adapter, gs);
    }
View Full Code Here

       * me the collection bbox is not required:
       * "To include information on the coordinate range for geometries, features,
       * or feature collections, a GeoJSON object may have a member named "bbox""
       * disable Feature bounding */
       
      GeoServer gs = getGeoServer();
       
        WFSInfo wfs = getWFS();
        boolean before = wfs.isFeatureBounding();
        wfs.setFeatureBounding(false);
        try {
            gs.save( wfs );
            
          String out = getAsString("wfs?request=GetFeature&version=1.0.0&typename=sf:AggregateGeoFeature&maxfeatures=3&outputformat="+JSONType.json);
          JSONObject rootObject = JSONObject.fromObject( out );
          
          JSONObject bbox = rootObject.getJSONObject("bbox");
          assertEquals(JSONNull.getInstance(), bbox);
        } finally {
          wfs.setFeatureBounding(before);
            gs.save( wfs );
        }
     
    }
View Full Code Here

        final QName typeName = CiteTestData.STREAMS;
        // make sure typeName _is_ in the default namespace
        Catalog catalog = getCatalog();
        NamespaceInfo defaultNs = catalog.getDefaultNamespace();
       
        GeoServer geoServer = getGeoServer();
        WFSInfo service = geoServer.getService(WFSInfo.class);
        try {
            // make sure typeName _is_ in the default namespace
            catalog.setDefaultNamespace(catalog.getNamespaceByURI(typeName.getNamespaceURI()));
            FeatureTypeInfo typeInfo = catalog.getFeatureTypeByName(typeName.getNamespaceURI(), typeName.getLocalPart());
            typeInfo.setEnabled(true);
            catalog.save(typeInfo);
            DataStoreInfo store = typeInfo.getStore();
            store.setEnabled(true);
            catalog.save(store);
           
            // and request typeName without prefix
            String path = "ows?service=WFS&version=2.0.0&request=DescribeFeatureType&typeName="
                + typeName.getLocalPart();
            Document doc;
       
            //first, non cite compliant mode should find the type even if namespace is not specified
            service.setCiteCompliant(false);
            geoServer.save(service);
            doc = getAsDOM(path);
            print(doc);
            assertSchema(doc, typeName);
           
   
            //then, in cite compliance more, it should not find the type name
            service.setCiteCompliant(true);
            geoServer.save(service);
            doc = getAsDOM(path);
            //print(doc);
            assertEquals("ows:ExceptionReport", doc.getDocumentElement().getNodeName());
        } finally {
            catalog.setDefaultNamespace(defaultNs);
            service.setCiteCompliant(false);
            geoServer.save(service);
        }
    }
View Full Code Here

     *
     * @throws Exception
     */
    @Test
    public void testPrefixedGetStrictCite() throws Exception {
        GeoServer geoServer = getGeoServer();
        WFSInfo service = geoServer.getService(WFSInfo.class);
        try {
            service.setCiteCompliant(true);
            geoServer.save(service);
           
            final QName typeName = CiteTestData.POLYGONS;
            String path = "ows?service=WFS&version=2.0.0&request=DescribeFeatureType&typeName="
                    + getLayerId(typeName);
            Document doc = getAsDOM(path);
            assertSchema(doc, CiteTestData.POLYGONS);
        } finally {
            service.setCiteCompliant(false);
            geoServer.save(service);
        }
    }
View Full Code Here

public class WPSConfigProcessFilterTest extends AbstractProcessFilterTest {
   
    @Before
    public void setUpInternal() throws Exception {
       
        GeoServer gs = getGeoServer();
        WPSInfo wps = gs.getService(WPSInfo.class);
       
        // remove all jts processes but buffer
        NameImpl bufferName = new NameImpl("JTS", "buffer");
        ProcessFactory jts = Processors.createProcessFactory(bufferName);
        ProcessGroupInfo jtsGroup = new ProcessGroupInfoImpl();
        jtsGroup.setFactoryClass(jts.getClass());
        jtsGroup.setEnabled(true);
        List<Name> jtsNames = new ArrayList<Name>(jts.getNames());
        jtsNames.remove(bufferName);
        jtsGroup.getFilteredProcesses().addAll(jtsNames);
        List<ProcessGroupInfo> pgs = wps.getProcessGroups();
        pgs.clear();
        pgs.add(jtsGroup);
       
        // remove the feature gs factory
        ProcessGroupInfo gsGroup = new ProcessGroupInfoImpl();
        gsGroup.setFactoryClass(VectorProcessFactory.class);
        gsGroup.setEnabled(false);
        pgs.add(gsGroup);
       
        gs.save(wps);
    }
View Full Code Here

        gs.save(wps);
    }
   
    @After
    public void cleanup() {
        GeoServer gs = getGeoServer();
        WPSInfo wps = gs.getService(WPSInfo.class);
        wps.getProcessGroups().clear();
        gs.save(wps);
    }
View Full Code Here

    /**
     * Test setting a WPS title.
     */
    @Test
    public void testWpsTitle() {
        final GeoServer geoserver = getGeoServer();
        WPSInfo wps = geoserver.getService(WPSInfo.class);
        assertEquals("Prototype GeoServer WPS", wps.getTitle());

        final String updatedTitle = "WPS latest title";
        wps.setTitle(updatedTitle);
        geoserver.save(wps);
        wps = geoserver.getService(WPSInfo.class);
        assertEquals(updatedTitle, wps.getTitle());

    }
View Full Code Here

        final QName typeName = CiteTestData.STREAMS;
        // make sure typeName _is_ in the default namespace
        Catalog catalog = getCatalog();
        NamespaceInfo defaultNs = catalog.getDefaultNamespace();
       
        GeoServer geoServer = getGeoServer();
        WFSInfo service = geoServer.getService(WFSInfo.class);
        try {
            catalog.setDefaultNamespace(catalog.getNamespaceByURI(typeName.getNamespaceURI()));
            FeatureTypeInfo typeInfo = catalog.getFeatureTypeByName(typeName.getNamespaceURI(), typeName.getLocalPart());
            typeInfo.setEnabled(true);
            catalog.save(typeInfo);
            DataStoreInfo store = typeInfo.getStore();
            store.setEnabled(true);
            catalog.save(store);
           
            // and request typeName without prefix
            String path = "ows?service=WFS&version=1.1.0&request=DescribeFeatureType&typeName="
                + typeName.getLocalPart();
            Document doc;
       
            //first, non cite compliant mode should find the type even if namespace is not specified
            service.setCiteCompliant(false);
            geoServer.save(service);
            doc = getAsDOM(path);
            //print(doc);
            assertEquals("xsd:schema", doc.getDocumentElement().getNodeName());
   
            //then, in cite compliance more, it should not find the type name
            service.setCiteCompliant(true);
            geoServer.save(service);
            doc = getAsDOM(path);
            //print(doc);
            assertEquals("ows:ExceptionReport", doc.getDocumentElement().getNodeName());
        } finally {
            catalog.setDefaultNamespace(defaultNs);
            service.setCiteCompliant(false);
            geoServer.save(service);
        }
    }
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.