Skip to content

Commit

Permalink
[BUGFIX] WFS GetCapabilities respons misses <keywords> key
Browse files Browse the repository at this point in the history
Fixes #13037 WFS GetCapabilities respons misses <keywords> key

Replace KeywordList by Keywords in WFS Getcapabilities and keywords in WCS GetCapabilities.
  • Loading branch information
rldhont committed Dec 18, 2015
1 parent 52f6b73 commit 746af79
Showing 1 changed file with 30 additions and 12 deletions.
42 changes: 30 additions & 12 deletions src/server/qgsserverprojectparser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -420,22 +420,40 @@ void QgsServerProjectParser::serviceCapabilities( QDomElement& parentElement, QD
QDomElement keywordListElem = propertiesElement.firstChildElement( "WMSKeywordList" );
if ( !keywordListElem.isNull() && !keywordListElem.text().isEmpty() )
{
QDomElement wmsKeywordElem = doc.createElement( "KeywordList" );
QDomNodeList keywordList = keywordListElem.elementsByTagName( "value" );
for ( int i = 0; i < keywordList.size(); ++i )
if ( service.compare( "WMS", Qt::CaseInsensitive ) == 0 )
{
QDomElement keywordElem = doc.createElement( "Keyword" );
QDomText keywordText = doc.createTextNode( keywordList.at( i ).toElement().text() );
keywordElem.appendChild( keywordText );
if ( sia2045 )
QDomElement wmsKeywordElem = doc.createElement( "KeywordList" );
QDomNodeList keywordList = keywordListElem.elementsByTagName( "value" );
for ( int i = 0; i < keywordList.size(); ++i )
{
keywordElem.setAttribute( "vocabulary", "SIA_Geo405" );
QDomElement keywordElem = doc.createElement( "Keyword" );
QDomText keywordText = doc.createTextNode( keywordList.at( i ).toElement().text() );
keywordElem.appendChild( keywordText );
if ( sia2045 )
{
keywordElem.setAttribute( "vocabulary", "SIA_Geo405" );
}
wmsKeywordElem.appendChild( keywordElem );
}
wmsKeywordElem.appendChild( keywordElem );
}

if ( keywordList.size() > 0 )
if ( keywordList.size() > 0 )
{
serviceElem.appendChild( wmsKeywordElem );
}
}
else
{
QDomNodeList keywordNodeList = keywordListElem.elementsByTagName( "value" );
QStringList keywordList;
for ( int i = 0; i < keywordNodeList.size(); ++i )
{
keywordList.push_back( keywordNodeList.at( i ).toElement().text() );
}
QDomElement wmsKeywordElem = doc.createElement( "Keywords" );
if ( service.compare( "WCS", Qt::CaseInsensitive ) == 0 )
wmsKeywordElem = doc.createElement( "keywords" );
QDomText keywordText = doc.createTextNode( keywordList.join( ", " ) );
wmsKeywordElem.appendChild( keywordText );
serviceElem.appendChild( wmsKeywordElem );
}
}
Expand Down Expand Up @@ -1072,7 +1090,7 @@ QSet<QString> QgsServerProjectParser::findRestrictedLayers() const
}
}
}

// wmsLayerRestrictionValues contains LayerIDs
if ( mUseLayerIDs )
{
Expand Down

0 comments on commit 746af79

Please sign in to comment.