/**
     * Encodes contact information in the WMS capabilities document
     *
     * @param geoServer
     */
    public void handleContactInfo(ContactInfo contact) {
      start("ContactInformation");

      start("ContactPersonPrimary");
      element("ContactPerson", contact.getContactPerson());
      element("ContactOrganization", contact.getContactOrganization());
      end("ContactPersonPrimary");

      element("ContactPosition", contact.getContactPosition());

      start("ContactAddress");
      element("AddressType", contact.getAddressType());
      element("Address", contact.getAddress());
      element("City", contact.getAddressCity());
      element("StateOrProvince", contact.getAddressState());
      element("PostCode", contact.getAddressPostalCode());
      element("Country", contact.getAddressCountry());
      end("ContactAddress");

      element("ContactVoiceTelephone", contact.getContactVoice());
      element("ContactFacsimileTelephone", contact.getContactFacsimile());
      element("ContactElectronicMailAddress", contact.getContactEmail());

      end("ContactInformation");
    }
Esempio n. 2
0
    /**
     * Handles contacts.
     *
     * @param config the service.
     */
    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);
          end("wcs:onlineResource");
        }

        end("wcs:contactInfo");

        end("wcs:responsibleParty");
      }
    }