コード例 #1
0
 /**
  *
  * <!-- CONTACTS
  * MANDATORY: operator, publisher
  * 10/25/2012. FOR A NETWORK PROCEDURE, operator DOESN'T MAKE SENSE.
  * (unless it really does apply to every station asset) -->
  * <sml:contact xlink:role="http://mmisw.org/ont/ioos/definition/publisher">
  * <sml:ResponsibleParty> <sml:organizationName>NANOOS</sml:organizationName> <sml:contactInfo>
  * <sml:address> <sml:country>USA</sml:country>
  * <sml:electronicMailAddress>[email protected]</sml:electronicMailAddress>
  * </sml:address> <sml:onlineResource xlink:href="http://nanoos.org"/> </sml:contactInfo>
  * </sml:ResponsibleParty> </sml:contact>
  */
 private void createContactOperator() {
   if (publisherInfo != null) {
     Contact xbContact = xbSystem.addNewContact();
     xbContact.setRole("http://mmisw.org/ont/ioos/definition/publisher");
     ResponsibleParty xbResponsibleParty = xbContact.addNewResponsibleParty();
     xbResponsibleParty.setOrganizationName(publisherInfo.getName());
     ContactInfo xbContactInfo = xbResponsibleParty.addNewContactInfo();
     Address xbAddress = xbContactInfo.addNewAddress();
     xbAddress.setCountry(publisherInfo.getCountry());
     xbAddress.setElectronicMailAddress(publisherInfo.getEmail());
     xbContactInfo.addNewOnlineResource().setHref(publisherInfo.getWebAddress());
   }
 }
コード例 #2
0
 private SmlResponsibleParty parseResponsibleParty(ResponsibleParty responsibleParty) {
   SmlResponsibleParty smlRespParty = new SmlResponsibleParty();
   if (responsibleParty != null) {
     if (!Strings.isNullOrEmpty(responsibleParty.getIndividualName())) {
       smlRespParty.setIndividualName(responsibleParty.getIndividualName());
     }
     if (!Strings.isNullOrEmpty(responsibleParty.getOrganizationName())) {
       smlRespParty.setOrganizationName(responsibleParty.getOrganizationName());
     }
     if (!Strings.isNullOrEmpty(responsibleParty.getPositionName())) {
       smlRespParty.setPositionName(responsibleParty.getPositionName());
     }
     if (responsibleParty.getContactInfo() != null) {
       ContactInfo contactInfo = responsibleParty.getContactInfo();
       if (contactInfo.getAddress() != null) {
         Address address = contactInfo.getAddress();
         if (!Strings.isNullOrEmpty(address.getAdministrativeArea())) {
           smlRespParty.setAdministrativeArea(address.getAdministrativeArea());
         }
         if (!Strings.isNullOrEmpty(address.getCity())) {
           smlRespParty.setCity(address.getCity());
         }
         if (!Strings.isNullOrEmpty(address.getCountry())) {
           smlRespParty.setCountry(address.getCountry());
         }
         if (address.getDeliveryPointArray() != null
             && address.getDeliveryPointArray().length > 0) {
           for (String deliveryPoint : address.getDeliveryPointArray()) {
             smlRespParty.addDeliveryPoint(deliveryPoint);
           }
         }
         if (!Strings.isNullOrEmpty(address.getElectronicMailAddress())) {
           smlRespParty.setEmail(address.getElectronicMailAddress());
         }
         if (!Strings.isNullOrEmpty(address.getPostalCode())) {
           smlRespParty.setPostalCode(address.getPostalCode());
         }
       }
       if (!Strings.isNullOrEmpty(contactInfo.getContactInstructions())) {
         smlRespParty.setContactInstructions(contactInfo.getContactInstructions());
       }
       if (!Strings.isNullOrEmpty(contactInfo.getHoursOfService())) {
         smlRespParty.setHoursOfService(contactInfo.getHoursOfService());
       }
       if (contactInfo.getOnlineResourceArray() != null
           && contactInfo.getOnlineResourceArray().length > 0) {
         for (OnlineResource onlineResource : contactInfo.getOnlineResourceArray()) {
           if (!Strings.isNullOrEmpty(onlineResource.getHref())) {
             smlRespParty.addOnlineResource(onlineResource.getHref());
           }
         }
       }
       if (contactInfo.getPhone() != null) {
         Phone phone = contactInfo.getPhone();
         if (phone.getVoiceArray() != null && phone.getVoiceArray().length > 0) {
           for (String phoneVoice : phone.getVoiceArray()) {
             smlRespParty.addPhoneVoice(phoneVoice);
           }
         }
         if (phone.getFacsimileArray() != null && phone.getFacsimileArray().length > 0) {
           for (String phoneFax : phone.getFacsimileArray()) {
             smlRespParty.addPhoneFax(phoneFax);
           }
         }
       }
     }
   }
   return smlRespParty;
 }