Skip to content

Commit

Permalink
Add element to group composer templates in WMS capabilities
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@15082 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
mhugent committed Jan 26, 2011
1 parent 12f2691 commit 46ceae5
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions src/mapserver/qgsprojectparser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -951,6 +951,16 @@ void QgsProjectParser::printCapabilities( QDomElement& parentElement, QDomDocume
}

QDomNodeList composerNodeList = mXMLDoc->elementsByTagName( "Composer" );
if ( composerNodeList.size() < 1 )
{
return;
}

QDomElement composerTemplatesElem = doc.createElement( "ComposerTemplates" );
composerTemplatesElem.setAttribute( "xmlns:wms", "http://www.opengis.net/wms" );
composerTemplatesElem.setAttribute( "xmlns:xsi", "http://www.w3.org/2001/XMLSchema-instance" );
composerTemplatesElem.setAttribute( "xsi:type", "wms:_ExtendedCapabilities" );

for ( int i = 0; i < composerNodeList.size(); ++i )
{
QDomElement composerTemplateElem = doc.createElement( "ComposerTemplate" );
Expand All @@ -961,9 +971,6 @@ void QgsProjectParser::printCapabilities( QDomElement& parentElement, QDomDocume
}

composerTemplateElem.setAttribute( "name", currentComposerElem.attribute( "title" ) );
composerTemplateElem.setAttribute( "xmlns:wms", "http://www.opengis.net/wms" );
composerTemplateElem.setAttribute( "xmlns:xsi", "http://www.w3.org/2001/XMLSchema-instance" );
composerTemplateElem.setAttribute( "xsi:type", "wms:_ExtendedCapabilities" );

//get paper width and hight in mm from composition
QDomElement compositionElem = currentComposerElem.firstChildElement( "Composition" );
Expand Down Expand Up @@ -1008,8 +1015,9 @@ void QgsProjectParser::printCapabilities( QDomElement& parentElement, QDomDocume
composerTemplateElem.appendChild( composerLabelElem );
}

parentElement.appendChild( composerTemplateElem );
composerTemplatesElem.appendChild( composerTemplateElem );
}
parentElement.appendChild( composerTemplatesElem );
}

QDomElement QgsProjectParser::composerByName( const QString& composerName ) const
Expand Down

0 comments on commit 46ceae5

Please sign in to comment.