Examples of GeoServerInfo


Examples of org.geoserver.config.GeoServerInfo

            }

            metas.add(meta);
        }

        GeoServerInfo global = wfs.getGeoServer().getGlobal();
        Encoder encoder = new Encoder(configuration, configuration.schema());
        encoder.setEncoding(Charset.forName( global.getCharset() ));

        // declare wfs schema location
        BaseRequestType gft = (BaseRequestType) getFeature.getParameters()[0];

        encoder.setSchemaLocation(org.geoserver.wfsv.xml.v1_1_0.WFSV.NAMESPACE,
View Full Code Here

Examples of org.geoserver.config.GeoServerInfo

                    numDecimals = numDecimals == -1 ? ftiDecimals : Math.max(numDecimals, ftiDecimals);
                }
            }
        }

        GeoServerInfo global = geoServer.getGlobal();
       
        if (numDecimals == -1) {
            numDecimals = global.getNumDecimals();
        }
       
        WFSInfo wfs = getInfo();
       
        transformer.setIndentation(wfs.isVerbose() ? INDENT_SIZE : (NO_FORMATTING));
        transformer.setNumDecimals(numDecimals);
        transformer.setFeatureBounding(wfs.isFeatureBounding());
        transformer.setCollectionBounding(wfs.isFeatureBounding());
        transformer.setEncoding(Charset.forName(global.getCharset()));

        if (wfs.isCanonicalSchemaLocation()) {
            transformer.addSchemaLocation(WFS.NAMESPACE, wfsCanonicalSchemaLocation());
        } else {
            String wfsSchemaloc = wfsSchemaLocation(global,request.getBaseUrl());
View Full Code Here

Examples of org.geoserver.config.GeoServerInfo

         * @throws SAXException
         *             For any errors.
         */
        private void handleServiceProvider() {
            start("ows:ServiceProvider");
            GeoServerInfo gs = wcs.getGeoServer().getGlobal();
      element("ows:ProviderName", gs.getContact().getContactOrganization());
            AttributesImpl attributes = new AttributesImpl();
            attributes.addAttribute("", "xlink:href", "xlink:href", "", gs.getOnlineResource());
            element("ows:ProviderSite", null, attributes);

            handleContact();

            end("ows:ServiceProvider");
View Full Code Here

Examples of org.geoserver.config.GeoServerInfo

    GeoServer gs;
   
    public void initialize(GeoServer geoServer) throws Exception {
        this.gs = geoServer;
       
        final GeoServerInfo global = geoServer.getGlobal();
        final int cacheSize = global.getFeatureTypeCacheSize();
        if (cacheSize > 0) {
            gs.getCatalog().getResourcePool().setFeatureTypeCacheSize(cacheSize);
        }
       
        geoServer.addListener(new ConfigurationListenerAdapter() {
            @Override
            public void handleGlobalChange(GeoServerInfo global, List<String> propertyNames,
                    List<Object> oldValues, List<Object> newValues) {
                int i = propertyNames.indexOf( "featureTypeCacheSize" );
                if (i > -1) {
                    Number featureTypeCacheSize = (Number) newValues.get(i);
                    gs.getCatalog().getResourcePool().setFeatureTypeCacheSize(featureTypeCacheSize.intValue());
                }
                gs.getCatalog().getResourcePool().setCoverageExecutor(global.getCoverageAccess().getThreadPoolExecutor());
            }
        });
    }
View Full Code Here

Examples of org.geoserver.config.GeoServerInfo

    }
    @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

Examples of org.geoserver.config.GeoServerInfo

        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

Examples of org.geoserver.config.GeoServerInfo

    // default catalog implementation, we need a proper GeoServer api test
    //
   
    @Override
    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

Examples of org.geoserver.config.GeoServerInfo

        factory = new GeoServerImpl().getFactory();
        persister = new XStreamPersisterFactory().createXMLPersister();
    }
   
    public void testGlobal() throws Exception {
        GeoServerInfo g1 = factory.createGlobal();
        g1.setAdminPassword( "foo" );
        g1.setAdminUsername( "bar" );
        g1.setCharset( "ISO-8859-1" );
       
        ContactInfo contact = factory.createContact();
        g1.setContact( contact );
        contact.setAddress( "123" );
        contact.setAddressCity( "Victoria" );
        contact.setAddressCountry( "Canada" );
        contact.setAddressPostalCode( "V1T3T8");
        contact.setAddressState( "BC" );
        contact.setAddressType( "house" );
        contact.setContactEmail( "bob@acme.org" );
        contact.setContactFacsimile("+1 250 123 4567" );
        contact.setContactOrganization( "Acme" );
        contact.setContactPerson( "Bob" );
        contact.setContactPosition( "hacker" );
        contact.setContactVoice( "+1 250 765 4321" );
       
        g1.setNumDecimals( 2 );
        g1.setOnlineResource( "http://acme.org" );
        g1.setProxyBaseUrl( "http://proxy.acme.org" );
        g1.setSchemaBaseUrl( "http://schemas.acme.org");
       
        g1.setTitle( "Acme's GeoServer" );
        g1.setUpdateSequence( 123 );
        g1.setVerbose( true );
        g1.setVerboseExceptions( true );
       
        g1.getMetadata().put( "one", new Integer(1) );
        g1.getMetadata().put( "two", new Double(2.2) );
       
        ByteArrayOutputStream out = out();
       
        persister.save( g1, out );
       
        GeoServerInfo g2 = persister.load(in(out),GeoServerInfo.class);
        assertEquals( g1, g2 );
       
        Document dom = dom( in( out ) );
        assertEquals( "global", dom.getDocumentElement().getNodeName() );
    }
View Full Code Here

Examples of org.geoserver.config.GeoServerInfo

        Document dom = dom( in( out ) );
        assertEquals( "logging", dom.getDocumentElement().getNodeName() );
       
    }
    public void testGobalContactDefault() throws Exception {
        GeoServerInfo g1 = factory.createGlobal();
        ContactInfo contact = factory.createContact();
        g1.setContact( contact );
       
        ByteArrayOutputStream out = out();
        persister.save(g1, out);
       
        ByteArrayInputStream in = in( out );
        Document dom = dom( in );
       
        Element e = (Element) dom.getElementsByTagName( "contact" ).item(0);
        e.removeAttribute( "class" );
        in = in( dom );
       
        GeoServerInfo g2 = persister.load( in, GeoServerInfo.class );
        assertEquals( g1, g2 );
    }
View Full Code Here

Examples of org.geoserver.config.GeoServerInfo

        assertEquals("foo", lakes.getTitle());
    }
   
    public void testConfigureFeatureTypeCacheSize() {
        GeoServer gs = getGeoServer();
        GeoServerInfo global = gs.getGlobal();
        global.setFeatureTypeCacheSize(200);
        gs.save(global);

        Catalog catalog = getCatalog();
        assertEquals(200, catalog.getResourcePool().featureTypeCache.maxSize());
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.