Skip to content

Commit e17a7d4

Browse files
committed
Move wcs as service module
1 parent 56b2f08 commit e17a7d4

35 files changed

Lines changed: 1026 additions & 886 deletions

‎doc/CMakeLists.txt‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,11 +84,16 @@ IF(WITH_APIDOC)
8484
${DOXYGEN_INPUT}
8585
${CMAKE_SOURCE_DIR}/src/server/qgsserver.h
8686
${CMAKE_SOURCE_DIR}/src/server/qgscapabilitiescache.h
87-
${CMAKE_SOURCE_DIR}/src/server/qgsmapserviceexception.h
87+
${CMAKE_SOURCE_DIR}/src/server/qgsserverexception.h
8888
${CMAKE_SOURCE_DIR}/src/server/qgsrequesthandler.h
8989
${CMAKE_SOURCE_DIR}/src/server/qgsserverfilter.h
9090
${CMAKE_SOURCE_DIR}/src/server/qgsaccesscontrolfilter.h
9191
${CMAKE_SOURCE_DIR}/src/server/qgsserverinterface.h
92+
${CMAKE_SOURCE_DIR}/src/server/qgsserverrequest.h
93+
${CMAKE_SOURCE_DIR}/src/server/qgsserverresponse.h
94+
${CMAKE_SOURCE_DIR}/src/server/qgsserverrequest.h
95+
${CMAKE_SOURCE_DIR}/src/server/qgsservice.h
96+
${CMAKE_SOURCE_DIR}/src/server/qgsserviceregistry.h
9297
)
9398
ENDIF(WITH_SERVER_PLUGINS)
9499

‎doc/api_break.dox‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1898,6 +1898,13 @@ optional property map passing down layer level properties to the SLD encoders. I
18981898
- usedAttributes is now a const method and returns QSet<QString> instead of QStringList
18991899

19001900

1901+
QgsRequestHandler {#qgis_api_break_3_0_QgsRequestHandler}
1902+
-----------------
1903+
1904+
- Removed infoFormat and setInfoFormat methods: the format of the response is given and set with the "Content-Type" header.
1905+
- Removed setCoverageResponse
1906+
1907+
19011908
Processing {#qgis_api_break_3_0_Processing}
19021909
----------
19031910

‎python/server/qgsrequesthandler.sip‎

Lines changed: 0 additions & 9 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 setGetCoverageResponse( QByteArray* ba );
34-
3532
/** Set an HTTP header*/
3633
void setHeader( const QString &name, const QString &value );
3734

@@ -50,9 +47,6 @@ class QgsRequestHandler /Abstract/
5047
/** Append the bytestream to response body*/
5148
void appendBody( const QByteArray &body );
5249

53-
/** Set the info format string such as "text/xml"*/
54-
void setInfoFormat( const QString &format );
55-
5650
/** Send out HTTP headers and flush output buffer*/
5751
void sendResponse();
5852

@@ -77,9 +71,6 @@ class QgsRequestHandler /Abstract/
7771
/** Return the requested format string*/
7872
QString format() const;
7973

80-
/** Return the mime type for the response*/
81-
QString infoFormat() const;
82-
8374
/** Return true if the HTTP headers were already sent to the client*/
8475
bool headersSent() const;
8576
};

‎python/server/qgsserverexception.sip‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ class QgsOgcServiceException
4747
QString message() const;
4848
QString code() const;
4949
QString locator() const;
50+
QString version() const;
5051

5152
virtual QByteArray formatResponse( QString& responseFormat / Out / ) const;
5253
};

‎python/server/qgsserverrequest.sip‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,21 @@ class QgsServerRequest
7979
*/
8080
QMap<QString, QString> parameters() const;
8181

82+
/**
83+
* Set a parameter
84+
*/
85+
void setParameter( const QString& key, const QString& value );
86+
87+
/**
88+
* Get a parameter value
89+
*/
90+
QString getParameter( const QString& key ) const;
91+
92+
/**
93+
* Remove a parameter
94+
*/
95+
void removeParameter( const QString& key );
96+
8297
/**
8398
* Return post/put data
8499
* Check for QByteArray::isNull() to check if data

‎src/server/CMakeLists.txt‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,6 @@ SET ( qgis_mapserv_SRCS
2424
qgscapabilitiescache.cpp
2525
qgsconfigcache.cpp
2626
qgsrequesthandler.cpp
27-
qgsowsserver.cpp
28-
qgswcsserver.cpp
2927
qgsserversettings.cpp
3028
qgsserverexception.cpp
3129
qgsmslayercache.cpp

‎src/server/qgsowsserver.cpp‎

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

‎src/server/qgsowsserver.h‎

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

‎src/server/qgsrequesthandler.cpp‎

Lines changed: 0 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -53,20 +53,6 @@ QMap<QString, QString> QgsRequestHandler::parameterMap() const
5353
return mRequest.parameters();
5454
}
5555

56-
void QgsRequestHandler::setHttpResponse( const QByteArray& ba, const QString &format )
57-
{
58-
QgsMessageLog::logMessage( QStringLiteral( "Checking byte array is ok to set..." ) );
59-
60-
if ( ba.size() < 1 )
61-
{
62-
return;
63-
}
64-
65-
QgsMessageLog::logMessage( QStringLiteral( "Byte array looks good, setting response..." ) );
66-
appendBody( ba );
67-
setInfoFormat( format );
68-
}
69-
7056
bool QgsRequestHandler::exceptionRaised() const
7157
{
7258
return mExceptionRaised;
@@ -107,70 +93,19 @@ void QgsRequestHandler::appendBody( const QByteArray &body )
10793
mResponse.write( body );
10894
}
10995

110-
void QgsRequestHandler::setInfoFormat( const QString &format )
111-
{
112-
mInfoFormat = format;
113-
114-
// Update header
115-
QString fmt = mInfoFormat;
116-
if ( mInfoFormat.startsWith( QLatin1String( "text/" ) ) || mInfoFormat.startsWith( QLatin1String( "application/vnd.ogc.gml" ) ) )
117-
{
118-
fmt.append( "; charset=utf-8" );
119-
}
120-
setHeader( QStringLiteral( "Content-Type" ), fmt );
121-
122-
}
123-
12496
void QgsRequestHandler::sendResponse()
12597
{
12698
// Send data to output
12799
mResponse.flush();
128100
}
129101

130-
131-
132-
QString QgsRequestHandler::formatToMimeType( const QString& format ) const
133-
{
134-
if ( format.compare( QLatin1String( "png" ), Qt::CaseInsensitive ) == 0 )
135-
{
136-
return QStringLiteral( "image/png" );
137-
}
138-
else if ( format.compare( QLatin1String( "jpg" ), Qt::CaseInsensitive ) == 0 )
139-
{
140-
return QStringLiteral( "image/jpeg" );
141-
}
142-
else if ( format.compare( QLatin1String( "svg" ), Qt::CaseInsensitive ) == 0 )
143-
{
144-
return QStringLiteral( "image/svg+xml" );
145-
}
146-
else if ( format.compare( QLatin1String( "pdf" ), Qt::CaseInsensitive ) == 0 )
147-
{
148-
return QStringLiteral( "application/pdf" );
149-
}
150-
return format;
151-
}
152-
153-
void QgsRequestHandler::setGetCapabilitiesResponse( const QDomDocument& doc )
154-
{
155-
QByteArray ba = doc.toByteArray();
156-
setHttpResponse( ba, QStringLiteral( "text/xml" ) );
157-
}
158-
159102
void QgsRequestHandler::setServiceException( const QgsServerException& ex )
160103
{
161104
// Safety measure to avoid potential leaks if called repeatedly
162105
mExceptionRaised = true;
163106
mResponse.write( ex );
164107
}
165108

166-
void QgsRequestHandler::setGetCoverageResponse( QByteArray* ba )
167-
{
168-
if ( ba )
169-
{
170-
setHttpResponse( *ba, QStringLiteral( "image/tiff" ) );
171-
}
172-
}
173-
174109
void QgsRequestHandler::setupParameters()
175110
{
176111
const QgsServerRequest::Parameters parameters = mRequest.parameters();

0 commit comments

Comments
 (0)