/** * @param serviceContactEl * context {@link OMElement} * @return an {@link ResponsibleParty} instance, never <code>null</code> */ protected ResponsibleParty parseServiceContact( OMElement serviceContactEl ) { ResponsibleParty serviceContact = new ResponsibleParty(); XPath xpath = new XPath( "ows:IndividualName", nsContext ); serviceContact.setIndividualName( getNodeAsString( serviceContactEl, xpath, null ) ); xpath = new XPath( "ows:PositionName", nsContext ); serviceContact.setPositionName( getNodeAsString( serviceContactEl, xpath, null ) ); xpath = new XPath( "ows:ContactInfo", nsContext ); ContactInfo contactInfo = parseContactInfo( getElement( serviceContactEl, xpath ) ); serviceContact.setContactInfo( contactInfo ); xpath = new XPath( "ows:Role", nsContext ); OMElement roleEl = getElement( serviceContactEl, xpath ); if ( roleEl != null ) { serviceContact.setRole( parseCodeSpace( roleEl ) ); } return serviceContact; }
private String getServiceUrl() { String url = getUrl; if ( provider != null && provider.getServiceContact() != null && provider.getServiceContact().getContactInfo() != null && provider.getServiceContact().getContactInfo().getOnlineResource() != null ) { url = provider.getServiceContact().getContactInfo().getOnlineResource().toExternalForm(); } return url; }
writer.writeStartElement( owsNS, "ServiceContact" ); if ( serviceContact.getIndividualName() != null && !"".equals( serviceContact.getIndividualName().trim() ) ) { writeElement( writer, owsNS, "IndividualName", serviceContact.getIndividualName() ); if ( serviceContact.getPositionName() != null && !"".equals( serviceContact.getPositionName().trim() ) ) { writeElement( writer, owsNS, "PositionName", serviceContact.getPositionName() ); if ( serviceContact.getRole() != null ) { writeElement( writer, owsNS, "Role", serviceContact.getRole().getCode() );
writer.writeStartElement( WMSNS, "ContactInformation" ); if ( contact.getIndividualName() != null ) { writer.writeStartElement( WMSNS, "ContactPersonPrimary" ); writeElement( writer, WMSNS, "ContactPerson", contact.getIndividualName() ); writeElement( writer, WMSNS, "ContactOrganization", provider.getProviderName() ); writer.writeEndElement(); maybeWriteElementNS( writer, WMSNS, "ContactPosition", contact.getPositionName() ); final Address addr = contact.getContactInfo().getAddress(); if ( addr != null && addr.isPhysicalInfoAvailable() ) { writer.writeStartElement( WMSNS, "ContactAddress" ); contact.getContactInfo().getPhone().getVoice().get( 0 ) ); maybeWriteElementNS( writer, WMSNS, "ContactFacsimileTelephone", contact.getContactInfo().getPhone().getFacsimile().get( 0 ) ); if ( addr != null && !addr.getElectronicMailAddress().isEmpty() ) { maybeWriteElementNS( writer, WMSNS, "ContactElectronicMailAddress",
writer.writeStartElement( "ContactInformation" ); if ( contact.getIndividualName() != null ) { writer.writeStartElement( "ContactPersonPrimary" ); writeElement( writer, "ContactPerson", contact.getIndividualName() ); writeElement( writer, "ContactOrganization", provider.getProviderName() ); writer.writeEndElement(); maybeWriteElement( writer, "ContactPosition", contact.getPositionName() ); final Address addr = contact.getContactInfo().getAddress(); if ( addr != null && addr.isPhysicalInfoAvailable() ) { writer.writeStartElement( "ContactAddress" ); contact.getContactInfo().getPhone().getVoice().get( 0 ) ); maybeWriteElement( writer, "ContactFacsimileTelephone", contact.getContactInfo().getPhone().getFacsimile().get( 0 ) ); if ( addr != null && !addr.getElectronicMailAddress().isEmpty() ) { maybeWriteElement( writer, "ContactElectronicMailAddress", addr.getElectronicMailAddress().get( 0 ) );
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; }
private String getServiceUrl() { String url = getUrl; if ( provider != null && provider.getServiceContact() != null && provider.getServiceContact().getContactInfo() != null && provider.getServiceContact().getContactInfo().getOnlineResource() != null ) { url = provider.getServiceContact().getContactInfo().getOnlineResource().toExternalForm(); } return url; }
throws XMLStreamException { ContactInfo serviceContact = party.getContactInfo(); if ( serviceContact != null ) { writer.writeStartElement( owsNS, "ContactInfo" );