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 f0a8c6d5a9825e90f095f0b247ec28f720464c2a
Showing with 9 additions and 1 deletion.
  1. +6 −1 src/mapserver/qgsprojectparser.cpp
  2. +3 −0 src/mapserver/qgswmsserver.cpp
@@ -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.
You can’t perform that action at this time.