try { organizationName = mainControllerConf.getServiceProvider().getProviderName(); List<String> emailAddresses = mainControllerConf.getServiceProvider().getServiceContact().getElectronicMailAddress(); if ( !emailAddresses.isEmpty() ) { emailAddress = emailAddresses.get( 0 ).trim();
|| serviceContact.getAddress() != null || serviceContact.getElectronicMailAddress() != null || serviceContact.getOnlineResource() != null || serviceContact.getHoursOfService() != null || serviceContact.getContactInstructions() != null ) { writeOptionalElement( writer, owsNS, "PostalCode", address.getPostalCode() ); writeOptionalElement( writer, owsNS, "Country", address.getCountry() ); exportSimpleStrings( writer, serviceContact.getElectronicMailAddress(), owsNS, "ElectronicMailAddress" ); writer.writeEndElement();
|| serviceContact.getAddress() != null || serviceContact.getElectronicMailAddress() != null || serviceContact.getOnlineResource() != null || serviceContact.getHoursOfService() != null || serviceContact.getContactInstructions() != null ) { writeOptionalElement( writer, owsNS, "PostalCode", address.getPostalCode() ); writeOptionalElement( writer, owsNS, "Country", address.getCountry() ); exportSimpleStrings( writer, serviceContact.getElectronicMailAddress(), owsNS, "ElectronicMailAddress" ); writer.writeEndElement();
exportAddress( writer, serviceContactType.getAddress(), serviceContactType.getElectronicMailAddress() );
public static ResponsibleParty convertFromJAXB( ServiceContactType sc ) { if ( sc == null ) { return null; } ResponsibleParty res = new ResponsibleParty(); res.setIndividualName( sc.getIndividualName() ); res.setPositionName( sc.getPositionName() ); res.setRole( new CodeType( sc.getRole() ) ); ContactInfo info = new ContactInfo(); info.setContactInstructions( sc.getContactInstructions() ); info.setHoursOfService( sc.getHoursOfService() ); try { info.setOnlineResource( new URL( sc.getOnlineResource() ) ); } catch ( MalformedURLException e ) { // ignore this, schemas should be fixed so it already is an URL } Telephone phone = new Telephone(); phone.setFacsimile( Collections.singletonList( sc.getFacsimile() ) ); phone.setVoice( Collections.singletonList( sc.getPhone() ) ); info.setPhone( phone ); Address ad = convertFromJAXB( sc.getAddress() ); if ( ad != null ) { ad.setElectronicMailAddress( sc.getElectronicMailAddress() ); info.setAddress( ad ); } res.setContactInfo( info ); return res; }