Skip to content

Commit

Permalink
Update insert, update and delete operations element
Browse files Browse the repository at this point in the history
  • Loading branch information
pblottiere committed Sep 18, 2018
1 parent e295eb6 commit 1e5c525
Showing 1 changed file with 16 additions and 7 deletions.
23 changes: 16 additions & 7 deletions src/server/services/wfs/qgswfsgetcapabilities.cpp
Expand Up @@ -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() ) )
Expand All @@ -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 );
}
}

Expand Down

0 comments on commit 1e5c525

Please sign in to comment.