Skip to content

Commit 56b2f08

Browse files
committed
Move wfs as service module
1 parent c80e5d1 commit 56b2f08

28 files changed

Lines changed: 2745 additions & 2526 deletions

‎python/server/qgsrequesthandler.sip‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,6 @@ class QgsRequestHandler /Abstract/
2929
/** Allow plugins to return a QgsServerException*/
3030
void setServiceException( const QgsServerException& ex );
3131

32-
//! @note not available in Python bindings
33-
void endGetFeatureResponse( QByteArray* ba );
34-
3532
//! @note not available in Python bindings
3633
void setGetCoverageResponse( QByteArray* ba );
3734

‎src/server/CMakeLists.txt‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ SET ( qgis_mapserv_SRCS
2525
qgsconfigcache.cpp
2626
qgsrequesthandler.cpp
2727
qgsowsserver.cpp
28-
qgswfsserver.cpp
2928
qgswcsserver.cpp
3029
qgsserversettings.cpp
3130
qgsserverexception.cpp
@@ -43,7 +42,6 @@ SET ( qgis_mapserv_SRCS
4342
qgswmsconfigparser.cpp
4443
qgswmsprojectparser.cpp
4544
qgsserverprojectparser.cpp
46-
qgsserverstreamingdevice.cpp
4745
qgssldconfigparser.cpp
4846
qgsconfigparserutils.cpp
4947
qgsserver.cpp
@@ -56,6 +54,7 @@ SET ( qgis_mapserv_SRCS
5654
qgsfcgiserverresponse.cpp
5755
qgsbufferserverresponse.cpp
5856
qgsfilterresponsedecorator.cpp
57+
qgsfilterrestorer.cpp
5958
#----------------------------
6059
)
6160
IF("${Qt5Network_VERSION}" VERSION_LESS "5.0.0")
@@ -76,7 +75,6 @@ SET (qgis_mapserv_MOC_HDRS
7675
qgsmslayercache.h
7776
qgsserverlogger.h
7877
qgsserversettings.h
79-
qgsserverstreamingdevice.h
8078
)
8179

8280
IF("${Qt5Network_VERSION}" VERSION_LESS "5.0.0")
File renamed without changes.

src/server/services/wms/qgsfilterrestorer.h renamed to src/server/qgsfilterrestorer.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,15 @@
1919
#define QGSFILTERRESTORER_H
2020

2121
#include "qgsaccesscontrol.h"
22+
#include "qgis_server.h"
2223

2324
#include <QHash>
2425

2526
class QgsMapLayer;
2627

2728
/** RAII class to restore layer filters on destruction
2829
*/
29-
class QgsOWSServerFilterRestorer
30+
class SERVER_EXPORT QgsOWSServerFilterRestorer
3031
{
3132
public:
3233

‎src/server/qgsrequesthandler.cpp‎

Lines changed: 0 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -156,77 +156,13 @@ void QgsRequestHandler::setGetCapabilitiesResponse( const QDomDocument& doc )
156156
setHttpResponse( ba, QStringLiteral( "text/xml" ) );
157157
}
158158

159-
void QgsRequestHandler::setXmlResponse( const QDomDocument& doc )
160-
{
161-
QByteArray ba = doc.toByteArray();
162-
setHttpResponse( ba, QStringLiteral( "text/xml" ) );
163-
}
164-
165-
void QgsRequestHandler::setXmlResponse( const QDomDocument& doc, const QString& mimeType )
166-
{
167-
QByteArray ba = doc.toByteArray();
168-
setHttpResponse( ba, mimeType );
169-
}
170-
171159
void QgsRequestHandler::setServiceException( const QgsServerException& ex )
172160
{
173161
// Safety measure to avoid potential leaks if called repeatedly
174162
mExceptionRaised = true;
175163
mResponse.write( ex );
176164
}
177165

178-
bool QgsRequestHandler::startGetFeatureResponse( QByteArray* ba, const QString& infoFormat )
179-
{
180-
if ( !ba )
181-
{
182-
return false;
183-
}
184-
185-
if ( ba->size() < 1 )
186-
{
187-
return false;
188-
}
189-
190-
QString format;
191-
if ( infoFormat == QLatin1String( "GeoJSON" ) )
192-
format = QStringLiteral( "text/plain" );
193-
else
194-
format = QStringLiteral( "text/xml" );
195-
196-
setInfoFormat( format );
197-
appendBody( *ba );
198-
// Streaming
199-
sendResponse();
200-
return true;
201-
}
202-
203-
void QgsRequestHandler::setGetFeatureResponse( QByteArray* ba )
204-
{
205-
if ( !ba )
206-
{
207-
return;
208-
}
209-
210-
if ( ba->size() < 1 )
211-
{
212-
return;
213-
}
214-
appendBody( *ba );
215-
// Streaming
216-
sendResponse();
217-
}
218-
219-
void QgsRequestHandler::endGetFeatureResponse( QByteArray* ba )
220-
{
221-
if ( !ba )
222-
{
223-
return;
224-
}
225-
appendBody( *ba );
226-
// do NOT call sendResponse()
227-
// finish will be called at the end of the transaction
228-
}
229-
230166
void QgsRequestHandler::setGetCoverageResponse( QByteArray* ba )
231167
{
232168
if ( ba )

‎src/server/qgsrequesthandler.h‎

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -60,21 +60,6 @@ class SERVER_EXPORT QgsRequestHandler
6060
//! Allow plugins to return a QgsMapServiceException
6161
void setServiceException( const QgsServerException &ex );
6262

63-
//! @note not available in Python bindings
64-
void setXmlResponse( const QDomDocument& doc );
65-
66-
//! @note not available in Python bindings
67-
void setXmlResponse( const QDomDocument& doc, const QString& mimeType );
68-
69-
//! @note not available in Python bindings
70-
bool startGetFeatureResponse( QByteArray* ba, const QString& infoFormat );
71-
72-
//! @note not available in Python bindings
73-
void setGetFeatureResponse( QByteArray* ba );
74-
75-
//! @note not available in Python bindings
76-
void endGetFeatureResponse( QByteArray* ba );
77-
7863
//! @note not available in Python bindings
7964
void setGetCoverageResponse( QByteArray* ba );
8065

‎src/server/qgsserver.cpp‎

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@
3131
#include "qgsproject.h"
3232
#include "qgsproviderregistry.h"
3333
#include "qgslogger.h"
34-
#include "qgswfsserver.h"
3534
#include "qgswcsserver.h"
3635
#include "qgsmapserviceexception.h"
3736
#include "qgspallabeling.h"
@@ -464,30 +463,6 @@ void QgsServer::handleRequest( QgsServerRequest& request, QgsServerResponse& res
464463
wcsServer.executeRequest();
465464
}
466465
}
467-
else if ( serviceString == QLatin1String( "WFS" ) )
468-
{
469-
QgsWfsProjectParser* p = QgsConfigCache::instance()->wfsConfiguration(
470-
configFilePath
471-
, accessControl
472-
);
473-
if ( !p )
474-
{
475-
theRequestHandler.setServiceException( QgsMapServiceException( QStringLiteral( "Project file error" ),
476-
QStringLiteral( "Error reading the project file" ) ) );
477-
}
478-
else
479-
{
480-
QgsWfsServer wfsServer(
481-
configFilePath
482-
, sSettings
483-
, parameterMap
484-
, p
485-
, &theRequestHandler
486-
, accessControl
487-
);
488-
wfsServer.executeRequest();
489-
}
490-
}
491466
else
492467
{
493468
throw QgsOgcServiceException( QStringLiteral( "Service configuration error" ),

‎src/server/qgsserverstreamingdevice.cpp‎

Lines changed: 0 additions & 58 deletions
This file was deleted.

‎src/server/qgsserverstreamingdevice.h‎

Lines changed: 0 additions & 45 deletions
This file was deleted.

0 commit comments

Comments
 (0)