Package org.geoserver.config

Examples of org.geoserver.config.ContactInfo


        private void handleContact() {
            final GeoServer gs = wcs.getGeoServer();
            String tmp = "";

            SettingsInfo settings = gs.getSettings();
            ContactInfo contact = settings.getContact();

            if (((contact != null) && (contact.getContactPerson() != "")) ||
                ((contact.getContactOrganization() != null) && (contact.getContactOrganization() != ""))) {
                start("wcs:responsibleParty");

                tmp = contact.getContactPerson();
                if ((tmp != null) && (tmp != "")) {
                    element("wcs:individualName", tmp);
                }
                else {
                    //not optional
                    element("wcs:individualName", "");
                }
               
                tmp = contact.getContactOrganization();
                if ((tmp != null) && (tmp != "")) {
                    element("wcs:organisationName", tmp);
                }
               
                tmp = contact.getContactPosition();

                if ((tmp != null) && (tmp != "")) {
                    element("wcs:positionName", tmp);
                }

                start("wcs:contactInfo");

                start("wcs:phone");
                tmp = contact.getContactVoice();

                if ((tmp != null) && (tmp != "")) {
                    element("wcs:voice", tmp);
                }

                tmp = contact.getContactFacsimile();

                if ((tmp != null) && (tmp != "")) {
                    element("wcs:facsimile", tmp);
                }

                end("wcs:phone");

                start("wcs:address");
                tmp = contact.getAddressType();

                if ((tmp != null) && (tmp != "")) {
                    String addr = "";
                    addr = contact.getAddress();

                    if ((addr != null) && (addr != "")) {
                        element("wcs:deliveryPoint", tmp + " " + addr);
                    }
                } else {
                    tmp = contact.getAddress();

                    if ((tmp != null) && (tmp != "")) {
                        element("wcs:deliveryPoint", tmp);
                    }
                }

                tmp = contact.getAddressCity();

                if ((tmp != null) && (tmp != "")) {
                    element("wcs:city", tmp);
                }

                tmp = contact.getAddressState();

                if ((tmp != null) && (tmp != "")) {
                    element("wcs:administrativeArea", tmp);
                }

                tmp = contact.getAddressPostalCode();

                if ((tmp != null) && (tmp != "")) {
                    element("wcs:postalCode", tmp);
                }

                tmp = contact.getAddressCountry();

                if ((tmp != null) && (tmp != "")) {
                    element("wcs:country", tmp);
                }

                tmp = contact.getContactEmail();

                if ((tmp != null) && (tmp != "")) {
                    element("wcs:electronicMailAddress", tmp);
                }

                end("wcs:address");

                tmp = contact.getOnlineResource();

                if ((tmp != null) && (tmp != "")) {
                    AttributesImpl attributes = new AttributesImpl();
                    attributes.addAttribute("", "xlink:href", "xlink:href", "", tmp);
                    start("wcs:onlineResource", attributes);
View Full Code Here


    @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 GPXPPIO(gs);
    }
View Full Code Here

        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");
View Full Code Here

        service.getKeywords().add(new Keyword("test keyword 1"));
        service.getKeywords().add(new Keyword("test keyword 2"));
        service.setMaintainer("test maintainer");
        service.setOnlineResource("http://example.com/geoserver");
        GeoServerInfo global = getGeoServer().getGlobal();
        ContactInfo contact = global.getContact();
        contact.setAddress("__address");
        contact.setAddressCity("__city");
        contact.setAddressCountry("__country");
        contact.setAddressPostalCode("__ZIP");
        contact.setAddressState("__state");
        contact.setAddressType("__type");
        contact.setContactEmail("e@mail");
        contact.setContactOrganization("__org");
        contact.setContactFacsimile("__fax");
        contact.setContactPerson("__me");
        contact.setContactPosition("__position");
        contact.setContactVoice("__phone");
       
        getGeoServer().save(global);
        getGeoServer().save(service);

        Document doc = getAsDOM("wms?service=WMS&request=getCapabilities&version=1.1.1", true);
View Full Code Here

       
    }
    @Test
    public void testGobalContactDefault() throws Exception {
        GeoServerInfo g1 = factory.createGlobal();
        ContactInfo contact = factory.createContact();
        g1.setContact( contact );
       
        ByteArrayOutputStream out = out();
        persister.save(g1, out);
       
View Full Code Here

                //initialize from global settings
                SettingsInfo global = gs.getGlobal().getSettings();

                //hack, we need to copy out composite objects separately to get around proxying
                // madness
                ContactInfo contact = gs.getFactory().createContact();
                OwsUtils.copy(global.getContact(), contact, ContactInfo.class);

                OwsUtils.copy(global, info, SettingsInfo.class);
                info.setContact(contact);
View Full Code Here

            }
            orAtts.addAttribute("", "xlink:href", "xlink:href", "", onlineResource);
            element("OnlineResource", null, orAtts);

            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

    }

    @Override
    protected void handleObjectPut(Object obj) throws Exception {
        GeoServerInfo geoServerInfo = geoServer.getGlobal();
        ContactInfo original = geoServerInfo.getSettings().getContact();
        OwsUtils.copy((ContactInfo) obj, original, ContactInfo.class);
        geoServer.save(geoServerInfo);
    }
View Full Code Here

            cfg.setClassForTemplateLoading(getClass(), "templates");
            cfg.setObjectWrapper(new ObjectToMapWrapper<GeoServerInfo>(GeoServerInfo.class) {
                @Override
                protected void wrapInternal(Map properties, SimpleHash model, GeoServerInfo info) {
                    SettingsInfo settingsInfo = info.getSettings();
                    ContactInfo contactInfo = settingsInfo.getContact();
                    JAIInfo jaiInfo = info.getJAI();
                    CoverageAccessInfo covInfo = info.getCoverageAccess();
                    properties.put("contactPerson",
                            contactInfo.getContactPerson() != null ? contactInfo.getContactPerson()
                                    : "");
                    properties.put(
                            "contactOrganization",
                            contactInfo.getContactOrganization() != null ? contactInfo
                                    .getContactOrganization() : "");
                    properties.put(
                            "contactPosition",
                            contactInfo.getContactPosition() != null ? contactInfo
                                    .getContactPosition() : "");
                    properties.put("addressType",
                            contactInfo.getAddressType() != null ? contactInfo.getAddressType()
                                    : "");
                    properties.put("address",
                            contactInfo.getAddress() != null ? contactInfo.getAddress() : "");
                    properties.put("addressCity",
                            contactInfo.getAddressCity() != null ? contactInfo.getAddressCity()
                                    : "");
                    properties.put("addressState",
                            contactInfo.getAddressState() != null ? contactInfo.getAddressState()
                                    : "");
                    properties.put(
                            "addressPostalCode",
                            contactInfo.getAddressPostalCode() != null ? contactInfo
                                    .getAddressPostalCode() : "");
                    properties.put(
                            "addressCountry",
                            contactInfo.getAddressCountry() != null ? contactInfo
                                    .getAddressCountry() : "");
                    properties.put("contactVoice",
                            contactInfo.getContactVoice() != null ? contactInfo.getContactVoice()
                                    : "");
                    properties.put(
                            "contactFacsimile",
                            contactInfo.getContactFacsimile() != null ? contactInfo
                                    .getContactFacsimile() : "");
                    properties.put("contactEmail",
                            contactInfo.getContactEmail() != null ? contactInfo.getContactEmail()
                                    : "");
                    properties.put("verbose", settingsInfo.isVerbose() ? "true" : "false");
                    properties.put("verboseExceptions", settingsInfo.isVerboseExceptions() ? "true"
                            : "false");
                    properties.put("numDecimals", String.valueOf(settingsInfo.getNumDecimals()));
View Full Code Here

    @Before
    public void init() {
        geoServer = getGeoServer();

        ContactInfo contactInfo = new ContactInfoImpl();
        contactInfo.setAddress("1600 Pennsylvania Avenue");
        contactInfo.setAddressCity("Washington");
        contactInfo.setAddressPostalCode("20001");
        contactInfo.setAddressCountry("United States");
        contactInfo.setAddressState("DC");
       
        GeoServerInfo geoServerInfo = geoServer.getGlobal();
        SettingsInfo settingsInfo = geoServerInfo.getSettings();
        settingsInfo.setContact(contactInfo);
        geoServer.save(geoServerInfo);       
View Full Code Here

TOP

Related Classes of org.geoserver.config.ContactInfo

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.