Skip to content
Permalink
Browse files

Update insert, update and delete operations element

  • Loading branch information
pblottiere committed Sep 18, 2018
1 parent e295eb6 commit 1e5c5258bc862098504c5c71e2d8809f4d4133b7
Showing with 16 additions and 7 deletions.
  1. +16 −7 src/server/services/wfs/qgswfsgetcapabilities.cpp
@@ -531,9 +531,10 @@ namespace QgsWfs
// QDomElement queryElement = doc.createElement( QStringLiteral( "Query" )/*wfs:Query*/ );
// operationsElement.appendChild( queryElement );
QDomElement operationElement = doc.createElement( QStringLiteral( "Operation" ) );
QDomText queryText = doc.createTextNode( "Query" );
QDomText queryText = doc.createTextNode( QStringLiteral( "Query" ) );
operationElement.appendChild( queryText );
operationsElement.appendChild( operationElement );

if ( wfstUpdateLayersId.contains( layer->id() ) ||
wfstInsertLayersId.contains( layer->id() ) ||
wfstDeleteLayersId.contains( layer->id() ) )
@@ -543,22 +544,30 @@ namespace QgsWfs
if ( ( provider->capabilities() & QgsVectorDataProvider::AddFeatures ) && wfstInsertLayersId.contains( layer->id() ) )
{
//wfs:Insert element
QDomElement insertElement = doc.createElement( QStringLiteral( "Insert" )/*wfs:Insert*/ );
operationsElement.appendChild( insertElement );
QDomElement operationElement = doc.createElement( QStringLiteral( "Operation" ) );
QDomText insertText = doc.createTextNode( QStringLiteral( "Insert" )/*wfs:Insert*/ );
operationElement.appendChild( insertText );
operationsElement.appendChild( operationElement );
}

if ( ( provider->capabilities() & QgsVectorDataProvider::ChangeAttributeValues ) &&
( provider->capabilities() & QgsVectorDataProvider::ChangeGeometries ) &&
wfstUpdateLayersId.contains( layer->id() ) )
{
//wfs:Update element
QDomElement updateElement = doc.createElement( QStringLiteral( "Update" )/*wfs:Update*/ );
operationsElement.appendChild( updateElement );
QDomElement operationElement = doc.createElement( QStringLiteral( "Operation" ) );
QDomText updateText = doc.createTextNode( QStringLiteral( "Update" )/*wfs:Update*/ );
operationElement.appendChild( updateText );
operationsElement.appendChild( operationElement );
}

if ( ( provider->capabilities() & QgsVectorDataProvider::DeleteFeatures ) && wfstDeleteLayersId.contains( layer->id() ) )
{
//wfs:Delete element
QDomElement deleteElement = doc.createElement( QStringLiteral( "Delete" )/*wfs:Delete*/ );
operationsElement.appendChild( deleteElement );
QDomElement operationElement = doc.createElement( QStringLiteral( "Operation" ) );
QDomText deleteText = doc.createTextNode( QStringLiteral( "Delete" )/*wfs:Delete*/ );
operationElement.appendChild( deleteText );
operationsElement.appendChild( operationElement );
}
}

0 comments on commit 1e5c525

Please sign in to comment.
You can’t perform that action at this time.