Skip to content

Commit a7de4da

Browse files
committedDec 4, 2014
[QGIS-Server] Clean GetCapabilities
Remove GetPrint request and ComposerTemplates from GetCapabilities for a better interoperability
1 parent c2b5da3 commit a7de4da

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed
 

‎src/server/qgswmsserver.cpp

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -437,18 +437,21 @@ QDomDocument QgsWMSServer::getCapabilities( QString version, bool fullProjectInf
437437
elem.appendChild( dcpTypeElement.cloneNode().toElement() ); //this is the same as for 'GetCapabilities'
438438
requestElement.appendChild( elem );
439439

440-
//wms:GetPrint
441-
elem = doc.createElement( ( version == "1.1.1" ? "GetPrint" : "qgs:GetPrint" ) /*wms:GetPrint*/ );
442-
appendFormats( doc, elem, QStringList() << "svg" << "png" << "pdf" );
443-
elem.appendChild( dcpTypeElement.cloneNode().toElement() ); //this is the same as for 'GetCapabilities'
444-
requestElement.appendChild( elem );
440+
if ( fullProjectInformation ) //remove composer templates from GetCapabilities in the long term
441+
{
442+
//wms:GetPrint
443+
elem = doc.createElement( "GetPrint" /*wms:GetPrint*/ );
444+
appendFormats( doc, elem, QStringList() << "svg" << "png" << "pdf" );
445+
elem.appendChild( dcpTypeElement.cloneNode().toElement() ); //this is the same as for 'GetCapabilities'
446+
requestElement.appendChild( elem );
447+
}
445448

446449
//Exception element is mandatory
447450
elem = doc.createElement( "Exception" );
448451
appendFormats( doc, elem, QStringList() << ( version == "1.1.1" ? "application/vnd.ogc.se_xml" : "text/xml" ) );
449452
capabilityElement.appendChild( elem );
450453

451-
if ( mConfigParser /*&& fullProjectInformation*/ ) //remove composer templates from GetCapabilities in the long term
454+
if ( mConfigParser && fullProjectInformation ) //remove composer templates from GetCapabilities in the long term
452455
{
453456
//Insert <ComposerTemplate> elements derived from wms:_ExtendedCapabilities
454457
mConfigParser->printCapabilities( capabilityElement, doc );

0 commit comments

Comments
 (0)
Please sign in to comment.