Skip to content
Permalink
Browse files
Consider attribute aliases and hidden attributes in GetProjectSetting…
…s. Don't show WFS layers in GetCapabilities
  • Loading branch information
mhugent committed Oct 19, 2012
1 parent 07d3378 commit f0a8c6d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
@@ -583,6 +583,7 @@ void QgsProjectParser::addLayerProjectSettings( QDomElement& layerElem, QDomDocu
if ( currentLayer->type() == QgsMapLayer::VectorLayer )
{
QgsVectorLayer* vLayer = static_cast<QgsVectorLayer*>( currentLayer );
const QSet<QString>& excludedAttributes = vLayer->excludeAttributesWMS();

//displayfield
layerElem.setAttribute( "displayField", vLayer->displayField() );
@@ -593,8 +594,12 @@ void QgsProjectParser::addLayerProjectSettings( QDomElement& layerElem, QDomDocu
QgsFieldMap::const_iterator fieldIt = layerFields.constBegin();
for ( ; fieldIt != layerFields.constEnd(); ++fieldIt )
{
if ( excludedAttributes.contains( fieldIt->name() ) )
{
continue;
}
QDomElement attributeElem = doc.createElement( "Attribute" );
attributeElem.setAttribute( "name", fieldIt->name() );
attributeElem.setAttribute( "name", vLayer->attributeDisplayName( fieldIt.key() ) );
attributeElem.setAttribute( "type", QVariant::typeToName( fieldIt->type() ) );

//edit type to text
@@ -209,7 +209,10 @@ QDomDocument QgsWMSServer::getCapabilities( QString version, bool fullProjectInf
{
//Insert <ComposerTemplate> elements derived from wms:_ExtendedCapabilities
mConfigParser->printCapabilities( capabilityElement, doc );
}

if ( mConfigParser && fullProjectInformation )
{
//WFS layers
QStringList wfsLayers = mConfigParser->wfsLayerNames();
if ( wfsLayers.size() > 0 )

0 comments on commit f0a8c6d

Please sign in to comment.