Skip to content
Permalink
Browse files
Fix joins and value relations in WMS server
  • Loading branch information
mhugent committed May 21, 2014
1 parent c00bcb1 commit 95513492f9ce4a3f8456551cb405b3299066e766
@@ -78,8 +78,6 @@ void QgsServerProjectParser::projectLayerMap( QMap<QString, QgsMapLayer*>& layer
QList<QDomElement>::const_iterator layerElemIt = mProjectLayerElements.constBegin();
for ( ; layerElemIt != mProjectLayerElements.constEnd(); ++layerElemIt )
{
addJoinLayersForElement( *layerElemIt );
addValueRelationLayersForElement( *layerElemIt );
QgsMapLayer *layer = createLayerFromElement( *layerElemIt );
if ( layer )
{
@@ -147,6 +145,9 @@ QgsMapLayer* QgsServerProjectParser::createLayerFromElement( const QDomElement&
return 0;
}

addJoinLayersForElement( elem, useCache );
addValueRelationLayersForElement( elem, useCache );

QDomElement dataSourceElem = elem.firstChildElement( "datasource" );
QString uri = dataSourceElem.text();
QString absoluteUri;
@@ -844,9 +845,6 @@ void QgsServerProjectParser::layerFromLegendLayer( const QDomElement& legendLaye
QHash< QString, QDomElement >::const_iterator layerIt = mProjectLayerElementsById.find( id );
if ( layerIt != mProjectLayerElementsById.constEnd() )
{

addJoinLayersForElement( layerIt.value(), useCache );
addValueRelationLayersForElement( layerIt.value(), useCache );
QgsMapLayer* layer = createLayerFromElement( layerIt.value(), useCache );
if ( layer )
{
@@ -172,7 +172,6 @@ void QgsWFSProjectParser::featureTypeList( QDomElement& parentElement, QDomDocum
QString type = elem.attribute( "type" );
if ( type == "vector" )
{
mProjectParser.addJoinLayersForElement( elem );
QgsMapLayer *layer = mProjectParser.createLayerFromElement( elem );
if ( layer && wfsLayersId.contains( layer->id() ) )
{
@@ -421,7 +420,6 @@ void QgsWFSProjectParser::describeFeatureType( const QString& aTypeName, QDomEle
QString type = elem.attribute( "type" );
if ( type == "vector" )
{
mProjectParser.addJoinLayersForElement( elem );
QgsMapLayer *mLayer = mProjectParser.createLayerFromElement( elem );
QgsVectorLayer* layer = dynamic_cast<QgsVectorLayer*>( mLayer );
if ( !layer )
@@ -580,7 +578,6 @@ QList<QgsMapLayer*> QgsWFSProjectParser::mapLayerFromTypeName( const QString& aT
QString type = elem.attribute( "type" );
if ( type == "vector" )
{
mProjectParser.addJoinLayersForElement( elem, useCache );
QgsMapLayer *mLayer = mProjectParser.createLayerFromElement( elem );
QgsVectorLayer* layer = dynamic_cast<QgsVectorLayer*>( mLayer );
if ( !layer )
@@ -849,7 +849,6 @@ void QgsWMSProjectParser::addLayers( QDomDocument &doc,
const QList<QDomElement>& embeddedProjectLayerElements = pp.projectLayerElements();
foreach ( const QDomElement &elem, embeddedProjectLayerElements )
{
pp.addJoinLayersForElement( elem );
pLayerMap.insert( pp.layerId( elem ), pp.createLayerFromElement( elem ) );
}

@@ -1222,7 +1221,6 @@ void QgsWMSProjectParser::addOWSLayers( QDomDocument &doc,
const QList<QDomElement>& embeddedProjectLayerElements = pp.projectLayerElements();
foreach ( const QDomElement &elem, embeddedProjectLayerElements )
{
pp.addJoinLayersForElement( elem );
pLayerMap.insert( pp.layerId( elem ), pp.createLayerFromElement( elem ) );
}

0 comments on commit 9551349

Please sign in to comment.