/** * @param si * @return null, if si is null */ public static ServiceIdentification convertFromJAXB( ServiceIdentificationType si ) { if ( si == null ) { return null; } List<Pair<List<LanguageString>, CodeType>> keywords = null; if ( si.getKeywords() != null ) { keywords = map( si.getKeywords(), KW_MAPPER ); } List<LanguageString> titles = map( si.getTitle(), LANG_MAPPER ); List<LanguageString> abstracts = map( si.getAbstract(), LANG_MAPPER ); String fees = si.getFees(); List<String> accessConstraints = si.getAccessConstraints(); return new ServiceIdentification( null, titles, abstracts, keywords, null, null, null, fees, accessConstraints ); }
/** * Create an instance of {@link ServiceIdentificationType } * */ public ServiceIdentificationType createServiceIdentificationType() { return new ServiceIdentificationType(); }
writer.writeStartElement( "http://www.opengis.net/ows", Sections.ServiceIdentification.toString() ); for ( String oneTitle : identification.getTitle() ) { writeElement( writer, "http://www.opengis.net/ows", "Title", oneTitle ); for ( String oneAbstract : identification.getAbstract() ) { writeElement( writer, "http://www.opengis.net/ows", "Abstract", oneAbstract ); exportKeywords( writer, identification.getKeywords() ); if ( serviceTypeCodeSpace != null ) { writeElement( writer, "http://www.opengis.net/ows", "ServiceType", serviceType, null, null, "codeSpace", String fees = identification.getFees(); if ( fees == null || fees.length() == 0 ) { identification.setFees( "NONE" ); fees = identification.getFees();
if ( identification != null ) { exportKeywords( writer, identification.getKeywords() ); if ( identification != null ) { fees = identification.getFees(); if ( isEmpty( fees ) ) { identification.setFees( "NONE" ); fees = identification.getFees(); accessConstraints = identification.getAccessConstraints();
private static void exportServiceIdentification( XMLStreamWriter writer, ServiceIdentificationType ident ) throws XMLStreamException { writer.writeStartElement( OWS_NS, "ServiceIdentification" ); if ( ident == null ) { writeElement( writer, OWS_NS, "Title", "deegree 3 WPS" ); writeElement( writer, OWS_NS, "Abstract", "deegree 3 WPS implementation" ); } else { List<String> title = ident.getTitle(); writeElement( writer, OWS_NS, "Title", title.isEmpty() ? "deegree 3 WPS" : title.get( 0 ) ); List<String> _abstract = ident.getAbstract(); writeElement( writer, OWS_NS, "Abstract", _abstract.isEmpty() ? "deegree 3 WPS implementation" : _abstract.get( 0 ) ); } writeElement( writer, OWS_NS, "ServiceType", "WPS" ); writeElement( writer, OWS_NS, "ServiceTypeVersion", "1.0.0" ); writer.writeEndElement(); }
private void exportAccessConstraints( XMLStreamWriter writer, ServiceIdentificationType identification ) throws XMLStreamException { List<String> accessConstraints = identification.getAccessConstraints(); if ( accessConstraints.isEmpty() ) { accessConstraints.add( "NONE" ); } else { for ( String ac : accessConstraints ) { if ( !ac.isEmpty() ) { writeElement( writer, "http://www.opengis.net/ows", "AccessConstraints", ac ); } } } }
exportSimpleStrings( writer, serviceID.getTitle(), OWS110_NS, "Title" ); exportSimpleStrings( writer, serviceID.getAbstract(), OWS110_NS, "Abstract" ); exportKeyWords110( writer, serviceID.getKeywords() ); if ( serviceID.getFees() != null && !"".equals( serviceID.getFees() ) ) { writeElement( writer, OWS110_NS, "Fees", serviceID.getFees() ); exportSimpleStrings( writer, serviceID.getAccessConstraints(), OWS110_NS, "AccessConstraints" );