private OnlineResource buildOnlineResource(WMSResponse wmsResponse, String key, String title) {
   OnlineResource oRGet = new OnlineResource();
   String map = (String) properties.getProperty(key);
   if (map == null) {
     oRGet.setHref(wmsResponse.getRequestUrl());
   } else {
     oRGet.setHref(map);
   }
   oRGet.setTitle(title);
   return oRGet;
 }
 /**
  * Prepare the Service JAXB object in order to build the XML response.
  *
  * @return A Service instance
  */
 private Service getService() {
   Service s = new Service();
   s.setName("WMS");
   s.setTitle((String) properties.getProperty(WMSProperties.TITLE));
   OnlineResource oR = new OnlineResource();
   oR.setHref((String) properties.getProperty(WMSProperties.RESOURCE_URL));
   oR.setTitle((String) properties.getProperty(WMSProperties.RESOURCE_NAME));
   s.setOnlineResource(oR);
   ContactInformation cI = new ContactInformation();
   cI.setContactElectronicMailAddress("*****@*****.**");
   s.setContactInformation(cI);
   return s;
 }
Ejemplo n.º 3
0
  /** @return a XML representation of this Contact. */
  public String toXML() {
    String res =
        "<Contact"
            + " hoursOfService=\""
            + hoursOfService
            + "\""
            + " contactInstructions=\""
            + contactInstructions
            + "\">";

    if (fax != telephone) {
      for (String s : telephone) {
        res += "<Telephone>";
        res += s;
        res += "</Telephone>";
      }
    }

    if (fax != null) {
      for (String s : fax) {
        res += "<Fax>";
        res += s;
        res += "</Fax>";
      }
    }

    if (address != null) {
      res += address.toXML();
    }

    if (onlineResource != null) {
      res += onlineResource.toXML();
    }

    res += "</Contact>";
    return res;
  }