if ( serviceID.getTitle( null ) != null ) { writeElement( writer, OWS110_NS, "Title", serviceID.getTitle( null ).getString() ); if ( serviceID.getAbstract( null ) != null ) { writeElement( writer, OWS110_NS, "Abstract", serviceID.getAbstract( null ).getString() ); exportKeyWords110New( writer, serviceID.getKeywords() ); if ( serviceID.getFees() != null && !"".equals( serviceID.getFees() ) ) { writeElement( writer, OWS110_NS, "Fees", serviceID.getFees() ); exportSimpleStrings( writer, serviceID.getAccessConstraints(), OWS110_NS, "AccessConstraints" );
void writeService( XMLStreamWriter writer ) throws XMLStreamException { writer.writeStartElement( "Service" ); writeElement( writer, "Name", "OGC:WMS" ); List<LanguageString> titles = identification == null ? null : identification.getTitles(); String title = ( titles != null && !titles.isEmpty() ) ? titles.get( 0 ).getString() : "deegree 3 WMS"; writeElement( writer, "Title", title ); List<LanguageString> abstracts = identification == null ? null : identification.getAbstracts(); if ( abstracts != null && !abstracts.isEmpty() ) { writeElement( writer, "Abstract", abstracts.get( 0 ).getString() ); } writeKeywords( writer ); writer.writeStartElement( "OnlineResource" ); writer.writeNamespace( XLINK_PREFIX, XLNNS ); writer.writeAttribute( XLNNS, "type", "simple" ); writer.writeAttribute( XLNNS, "href", getServiceUrl() ); writer.writeEndElement(); writeServiceProvider( writer ); writer.writeEndElement(); }
private void writeServiceIdentificationParts( XMLStreamWriter writer ) throws XMLStreamException { if ( identification != null ) { maybeWriteElementNS( writer, WMSNS, "Fees", identification.getFees() ); List<String> constr = identification.getAccessConstraints(); if ( constr != null ) { for ( String cons : constr ) { maybeWriteElementNS( writer, WMSNS, "AccessConstraints", cons ); } } } else { writeElement( writer, WMSNS, "Fees", "none" ); writeElement( writer, WMSNS, "AccessConstraints", "none" ); } }
&& mdProvider.getServiceIdentification().getTitle( null ) != null ) { writeElement( writer, WFS_NS, "Name", mdProvider.getServiceIdentification().getTitle( null ).getString() ); writeElement( writer, WFS_NS, "Title", mdProvider.getServiceIdentification().getTitle( null ).getString() ); } else { writeElement( writer, WFS_NS, "Name", "" ); && mdProvider.getServiceIdentification().getAbstract( null ) != null ) { mdProvider.getServiceIdentification().getAbstract( null ).getString() ); if ( mdProvider.getServiceIdentification() != null && mdProvider.getServiceIdentification().getFees() != null ) { writeElement( writer, WFS_NS, "Fees", mdProvider.getServiceIdentification().getFees() );
void exportServiceIdentification() throws XMLStreamException { writer.writeStartElement( OWS110_NS, "ServiceIdentification" ); if ( identification == null ) { writeElement( writer, OWS110_NS, "Title", "deegree 3 WMTS" ); writeElement( writer, OWS110_NS, "Abstract", "deegree 3 WMTS implementation" ); } else { LanguageString title = identification.getTitle( null ); writeElement( writer, OWS110_NS, "Title", title == null ? "deegree 3 WMTS" : title.getString() ); LanguageString _abstract = identification.getAbstract( null ); writeElement( writer, OWS110_NS, "Abstract", _abstract == null ? "deegree 3 WMTS implementation" : _abstract.getString() ); } writeElement( writer, OWS110_NS, "ServiceType", "WMTS" ); writeElement( writer, OWS110_NS, "ServiceTypeVersion", "1.0.0" ); writer.writeEndElement(); }
return new ServiceIdentification( name, titles, abstracts, keywords, null, null, null, fees, accessConstraints );
if ( serviceId.getTitles().isEmpty() ) { serviceId.setTitles( Collections.singletonList( new LanguageString( "deegree 3 WFS", null ) ) ); if ( serviceId.getAbstracts().isEmpty() ) { serviceId.setAbstracts( Collections.singletonList( new LanguageString( "deegree 3 WFS", null ) ) );
private void writeKeywords( XMLStreamWriter writer ) throws XMLStreamException { List<Pair<List<LanguageString>, CodeType>> keywords = identification == null ? null : identification.getKeywords(); if ( keywords != null && !keywords.isEmpty() ) { writer.writeStartElement( "KeywordList" ); for ( Pair<List<LanguageString>, CodeType> key : keywords ) { for ( LanguageString lanString : key.first ) { writeElement( writer, "Keyword", lanString.getString() ); } } writer.writeEndElement(); } }
return new ServiceIdentification( description.getName(), description.getTitles(), description.getAbstracts(), null, serviceType, serviceTypeVersions, profiles, fees, constraints );
private void writeServiceIdentificationParts( XMLStreamWriter writer ) throws XMLStreamException { if ( identification != null ) { maybeWriteElement( writer, "Fees", identification.getFees() ); List<String> constr = identification.getAccessConstraints(); if ( constr != null ) { for ( String cons : constr ) { maybeWriteElement( writer, "AccessConstraints", cons ); } } } else { writeElement( writer, "Fees", "none" ); writeElement( writer, "AccessConstraints", "none" ); } } private boolean isGetSupported( WMSConstants.WMSRequestType requestType ) {
private void writeKeywords( XMLStreamWriter writer ) throws XMLStreamException { List<Pair<List<LanguageString>, CodeType>> keywords = identification == null ? null : identification.getKeywords(); if ( keywords != null && !keywords.isEmpty() ) { writer.writeStartElement( WMSNS, "KeywordList" ); for ( Pair<List<LanguageString>, CodeType> key : keywords ) { CodeType type = key.second; for ( LanguageString lanString : key.first ) { writer.writeStartElement( WMSNS, "Keyword" ); if ( type != null ) { writer.writeAttribute( "vocabulary", type.getCodeSpace() ); } writer.writeCharacters( lanString.getString() ); writer.writeEndElement(); } } writer.writeEndElement(); } }
if ( serviceIdentification.getTitle( null ) != null ) { writeElement( writer, OWS_NS, "Title", serviceIdentification.getTitle( null ).getString() ); if ( serviceIdentification.getAbstract( null ) != null ) { writeElement( writer, OWS_NS, "Abstract", serviceIdentification.getAbstract( null ).getString() ); if ( serviceIdentification.getKeywords() != null ) { for ( Pair<List<LanguageString>, org.deegree.commons.tom.ows.CodeType> keywords : serviceIdentification.getKeywords() ) { writer.writeStartElement( OWS_PREFIX, "Keywords", OWS_NS ); for ( LanguageString keyword : keywords.first ) { exportVersions( writer, serviceVersions, OWS_NS, "ServiceTypeVersion" ); if ( serviceIdentification.getFees() != null ) { writeElement( writer, OWS_NS, "Fees", serviceIdentification.getFees() ); exportSimpleStrings( writer, serviceIdentification.getAccessConstraints(), OWS_NS, "AccessConstraints" ); writer.writeEndElement();
: new ArrayList<String>(); return new ServiceIdentification( name, titles, abstracts, keywords, serviceType, serviceTypeVersions, new ArrayList<String>(), fees, constraints );
void writeService( XMLStreamWriter writer ) throws XMLStreamException { writer.writeStartElement( WMSNS, "Service" ); writeElement( writer, WMSNS, "Name", "WMS" ); List<LanguageString> titles = identification == null ? null : identification.getTitles(); String title = ( titles != null && !titles.isEmpty() ) ? titles.get( 0 ).getString() : "deegree 3 WMS"; writeElement( writer, WMSNS, "Title", title ); List<LanguageString> abstracts = identification == null ? null : identification.getAbstracts(); if ( abstracts != null && !abstracts.isEmpty() ) { writeElement( writer, WMSNS, "Abstract", abstracts.get( 0 ).getString() ); } writeKeywords( writer ); writer.writeStartElement( WMSNS, "OnlineResource" ); writer.writeAttribute( XLNNS, "type", "simple" ); writer.writeAttribute( XLNNS, "href", getServiceUrl() ); writer.writeEndElement(); writeServiceProvider( writer ); final DeegreeWMS config = controller.getConfig(); maybeWriteElementNS( writer, WMSNS, "LayerLimit", config.getLayerLimit() ); maybeWriteElementNS( writer, WMSNS, "MaxWidth", config.getMaxWidth() ); maybeWriteElementNS( writer, WMSNS, "MaxHeight", config.getMaxHeight() ); writer.writeEndElement(); }
/** * @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 ); }