Examples of GeoServerInfo


Examples of org.geoserver.config.GeoServerInfo

        //ServiceProvider
        ServiceProviderType sp = owsf.createServiceProviderType();
        caps.setServiceProvider( sp );
       
        //TODO: set provder name from context
        GeoServerInfo geoServer = wps.getGeoServer().getGlobal();
        if ( geoServer.getContact().getContactOrganization() != null ) {
            sp.setProviderNamegeoServer.getContact().getContactOrganization()  );   
        }
        else {
            sp.setProviderName( "GeoServer" );
        }
       
       
        sp.setProviderSite(owsf.createOnlineResourceType());
        sp.getProviderSite().setHref( geoServer.getOnlineResource() );
        sp.setServiceContact( responsibleParty( geoServer, owsf ) );
       
        //OperationsMetadata
        OperationsMetadataType om = owsf.createOperationsMetadataType();
        caps.setOperationsMetadata( om );
View Full Code Here

Examples of org.geoserver.config.GeoServerInfo

import org.geoserver.config.GeoServerInfo;
import org.geoserver.web.GeoServerWicketTestSupport;

public class GlobalSettingsPageTest extends GeoServerWicketTestSupport {
    public void testValues() {
        GeoServerInfo info = getGeoServerApplication().getGeoServer().getGlobal();

        login();
        tester.startPage(GlobalSettingsPage.class);
        tester.assertComponent("form:verbose", CheckBox.class);
        tester.assertModelValue("form:verbose", info.isVerbose());
    }
View Full Code Here

Examples of org.geoserver.config.GeoServerInfo

    }

    protected void write(FeatureTypeInfo[] featureTypeInfos, OutputStream output,
        Operation describeFeatureType) throws IOException {
       
        GeoServerInfo global = wfs.getGeoServer().getGlobal();
        //create the schema
        DescribeFeatureTypeType req = (DescribeFeatureTypeType)describeFeatureType.getParameters()[0];
        XSDSchema schema = schemaBuilder.build(featureTypeInfos, req.getBaseUrl());

        //serialize
        schema.updateElement();
        final String encoding = global.getCharset();
        XSDResourceImpl.serialize(output, schema.getElement(), encoding);
    }
View Full Code Here

Examples of org.geoserver.config.GeoServerInfo

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

        GeoServerInfo global = geoServer.getGlobal();
       
        if (numDecimals == -1) {
            numDecimals = global.getNumDecimals();
        }
       
        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

        importer = new LegacyConfigurationImporter( gs );
        importer.imprt(DataUtilities.urlToFile(getClass().getResource("services.xml")).getParentFile());
    }
   
    public void testGlobal() throws Exception {
        GeoServerInfo info = importer.getConfiguration().getGlobal();
        assertNotNull( info );
       
        LoggingInfo logging = importer.getConfiguration().getLogging();
        assertNotNull( logging );
       
        assertEquals( "DEFAULT_LOGGING.properties", logging.getLevel() );
        assertTrue( logging.isStdOutLogging() );
        assertEquals( "logs/geoserver.log", logging.getLocation() );
        assertFalse( info.isVerbose() );
        assertFalse( info.isVerboseExceptions() )
        assertEquals( 8, info.getNumDecimals() );
        assertEquals( "UTF-8", info.getCharset() );
        assertEquals( 3, info.getUpdateSequence() );
    }
View Full Code Here

Examples of org.geoserver.config.GeoServerInfo

        if (obj == null)
            return false;
        if (!( obj instanceof GeoServerInfo ) ) {
            return false;
        }
        final GeoServerInfo other = (GeoServerInfo) obj;
        if (adminPassword == null) {
            if (other.getAdminPassword() != null)
                return false;
        } else if (!adminPassword.equals(other.getAdminPassword()))
            return false;
        if (adminUsername == null) {
            if (other.getAdminUsername() != null)
                return false;
        } else if (!adminUsername.equals(other.getAdminUsername()))
            return false;
        if (charset == null) {
            if (other.getCharset() != null)
                return false;
        } else if (!charset.equals(other.getCharset()))
            return false;
        if (contact == null) {
            if (other.getContact() != null)
                return false;
        } else if (!contact.equals(other.getContact()))
            return false;
        if (id == null) {
            if (other.getId() != null)
                return false;
        } else if (!id.equals(other.getId()))
            return false;
        if (numDecimals != other.getNumDecimals())
            return false;
        if (onlineResource == null) {
            if (other.getOnlineResource() != null)
                return false;
        } else if (!onlineResource.equals(other.getOnlineResource()))
            return false;
        if (proxyBaseUrl == null) {
            if (other.getProxyBaseUrl() != null)
                return false;
        } else if (!proxyBaseUrl.equals(other.getProxyBaseUrl()))
            return false;
        if (schemaBaseUrl == null) {
            if (other.getSchemaBaseUrl() != null)
                return false;
        } else if (!schemaBaseUrl.equals(other.getSchemaBaseUrl()))
            return false;
        if (title == null) {
            if (other.getTitle() != null)
                return false;
        } else if (!title.equals(other.getTitle()))
            return false;
        if (updateSequence != other.getUpdateSequence())
            return false;
        if (verbose != other.isVerbose())
            return false;
        if (verboseExceptions != other.isVerboseExceptions())
            return false;
        return true;
    }
View Full Code Here

Examples of org.geoserver.config.GeoServerInfo

        reader.read(servicesFile);

        //
        //global
        //
        GeoServerInfo info = factory.createGlobal();
        Map<String,Object> global = reader.global();
       
        //info.setMaxFeatures( get( global, "maxFeatures", Integer.class ) );
        info.setVerbose( get( global, "verbose", boolean.class ) );
        info.setVerboseExceptions( get( global, "verboseExceptions", boolean.class ) );
        info.setNumDecimals( get( global, "numDecimals", int.class, 4 ) );
        info.setCharset( (String) global.get( "charSet" ) );
        info.setUpdateSequence( get( global, "updateSequence", int.class ) );
        info.setOnlineResource( get( global, "onlineResource", String.class ) );
        info.setProxyBaseUrl( get( global, "ProxyBaseUrl", String.class ) );
       
        //contact
        Map<String,Object> contact = reader.contact();
        ContactInfo contactInfo = factory.createContact();
      
        contactInfo.setContactPerson( (String) contact.get( "ContactPerson") );
        contactInfo.setContactOrganization( (String) contact.get( "ContactOrganization") );
        contactInfo.setContactVoice( (String) contact.get( "ContactVoiceTelephone" ) );
        contactInfo.setContactFacsimile( (String) contact.get( "ContactFacsimileTelephone" ) );
        contactInfo.setContactPosition( (String) contact.get( "ContactPosition" ) );
        contactInfo.setContactEmail( (String) contact.get( "ContactElectronicMailAddress" ) );
       
        contactInfo.setAddress( (String) contact.get( "Address") );
        contactInfo.setAddressType( (String) contact.get( "AddressType") );
        contactInfo.setAddressCity( (String) contact.get( "City") );
        contactInfo.setAddressCountry( (String) contact.get( "Country") );
        contactInfo.setAddressState( (String) contact.get( "StateOrProvince") );
        contactInfo.setAddressPostalCode( (String) contact.get( "PostCode") );
        info.setContact( contactInfo );
       
        //jai
        JAIInfo jai = new JAIInfoImpl();
        jai.setMemoryCapacity( (Double) value( global.get( "JaiMemoryCapacity"),JAIInfoImpl.DEFAULT_MemoryCapacity ) );
        jai.setMemoryThreshold( (Double) value( global.get( "JaiMemoryThreshold"), JAIInfoImpl.DEFAULT_MemoryThreshold) );
        jai.setTileThreads( (Integer) value( global.get( "JaiTileThreads"), JAIInfoImpl.DEFAULT_TileThreads ) );
        jai.setTilePriority( (Integer) value( global.get( "JaiTilePriority"), JAIInfoImpl.DEFAULT_TilePriority ) );
        jai.setImageIOCache( (Boolean) value( global.get( "ImageIOCache" ), JAIInfoImpl.DEFAULT_ImageIOCache) );
        jai.setJpegAcceleration( (Boolean) value( global.get( "JaiJPEGNative" ),JAIInfoImpl.DEFAULT_JPEGNative ) );
        jai.setPngAcceleration( (Boolean) value( global.get( "JaiPNGNative" ), JAIInfoImpl.DEFAULT_PNGNative)  );
        jai.setRecycling( (Boolean) value( global.get( "JaiRecycling" ), JAIInfoImpl.DEFAULT_Recycling)  );
        jai.setAllowNativeMosaic((Boolean) value( global.get( "JaiMosaicNative" ), JAIInfoImpl.DEFAULT_MosaicNative) );
        info.setJAI( jai );
        
        geoServer.setGlobal( info );
       
        //logging
        LoggingInfo logging = factory.createLogging();
View Full Code Here

Examples of org.geoserver.config.GeoServerInfo

            reqUS = Long.parseLong(capreq.getUpdateSequence());
          } catch (NumberFormatException nfe) {
            throw new ServiceException("GeoServer only accepts numbers in the updateSequence parameter");
          }
        }
        GeoServerInfo gsInfo = request.getServiceConfig().getGeoServer().getGlobal();
  long geoUS = gsInfo.getUpdateSequence();
      if (reqUS > geoUS) {
        throw new WcsException("Client supplied an updateSequence that is greater than the current sever updateSequence", WcsExceptionCode.InvalidUpdateSequence, "");
      }
      if (reqUS == geoUS) {
        throw new WcsException("WCS capabilities document is current (updateSequence = " + geoUS + ")", WcsExceptionCode.CurrentUpdateSequence, "");
      }
      //otherwise it's a normal response...

        WCSCapsTransformer transformer = new WCSCapsTransformer(request
        .getBaseUrl(), applicationContext);

        transformer.setIndentation(2);
        transformer.setEncoding(Charset.forName(gsInfo.getCharset()));
       
        ByteArrayOutputStream out = new ByteArrayOutputStream();
        try {
            transformer.transform(request, out);
        } catch (TransformerException e) {
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
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.