@@ -37,7 +37,7 @@ class QDomDocument;
37
37
class QImage ;
38
38
class QgsMapServiceException ;
39
39
40
- /* *This class is an interface hiding the details of reading input and writing output from/to a wms request mechanism.
40
+ /* * This class is an interface hiding the details of reading input and writing output from/to a wms request mechanism.
41
41
Examples of possible mechanisms are cgi Get, cgi Post, SOAP or the usage as a standalone command line executable*/
42
42
class QgsRequestHandler
43
43
{
@@ -49,13 +49,13 @@ class QgsRequestHandler
49
49
, mException ( 0 )
50
50
{}
51
51
virtual ~QgsRequestHandler ( ) {}
52
- /* *Parses the input and creates a request neutral Parameter/Value map*/
52
+ /* * Parses the input and creates a request neutral Parameter/Value map*/
53
53
virtual void parseInput () = 0;
54
- /* *Sends the map image back to the client*/
54
+ /* * Sends the map image back to the client*/
55
55
virtual void setGetMapResponse ( const QString& service, QImage* img, int imageQuality ) = 0;
56
56
virtual void setGetCapabilitiesResponse ( const QDomDocument& doc ) = 0;
57
57
virtual void setGetFeatureInfoResponse ( const QDomDocument& infoDoc, const QString& infoFormat ) = 0;
58
- /* *Allow plugins to return a QgsMapServiceException*/
58
+ /* * Allow plugins to return a QgsMapServiceException*/
59
59
virtual void setServiceException ( QgsMapServiceException ex ) = 0;
60
60
virtual void setXmlResponse ( const QDomDocument& doc ) = 0;
61
61
virtual void setXmlResponse ( const QDomDocument& doc, const QString& mimeType ) = 0;
@@ -64,45 +64,46 @@ class QgsRequestHandler
64
64
virtual void setGetFeatureResponse ( QByteArray* ba ) = 0;
65
65
virtual void endGetFeatureResponse ( QByteArray* ba ) = 0;
66
66
virtual void setGetCoverageResponse ( QByteArray* ba ) = 0;
67
- /* *Set an HTTP header*/
67
+ virtual void setDefaultHeaders () {}
68
+ /* * Set an HTTP header*/
68
69
virtual void setHeader ( const QString &name, const QString &value ) = 0;
69
- /* *Remove an HTTP header*/
70
+ /* * Remove an HTTP header*/
70
71
virtual int removeHeader ( const QString &name ) = 0;
71
- /* *Delete all HTTP headers*/
72
+ /* * Delete all HTTP headers*/
72
73
virtual void clearHeaders ( ) = 0;
73
- /* *Append the bytestream to response body*/
74
+ /* * Append the bytestream to response body*/
74
75
virtual void appendBody ( const QByteArray &body ) = 0;
75
- /* *Clears the response body*/
76
+ /* * Clears the response body*/
76
77
virtual void clearBody ( ) = 0;
77
- /* *Return the response body*/
78
+ /* * Return the response body*/
78
79
virtual QByteArray body () { return mBody ; }
79
- /* *Set the info format string such as "text/xml"*/
80
+ /* * Set the info format string such as "text/xml"*/
80
81
virtual void setInfoFormat ( const QString &format ) = 0;
81
- /* *Check whether there is any header set or the body is not empty*/
82
+ /* * Check whether there is any header set or the body is not empty*/
82
83
virtual bool responseReady () const = 0;
83
- /* *Send out HTTP headers and flush output buffer*/
84
+ /* * Send out HTTP headers and flush output buffer*/
84
85
virtual void sendResponse ( ) = 0;
85
- /* *Pointer to last raised exception*/
86
+ /* * Pointer to last raised exception*/
86
87
virtual bool exceptionRaised () const = 0;
87
- /* *Return a copy of the parsed parameters as a key-value pair, to modify
88
+ /* * Return a copy of the parsed parameters as a key-value pair, to modify
88
89
* a parameter setParameter( const QString &key, const QString &value)
89
90
* and removeParameter(const QString &key) must be used
90
91
*/
91
92
QMap<QString, QString> parameterMap () { return mParameterMap ; }
92
- /* *Set a request parameter*/
93
+ /* * Set a request parameter*/
93
94
virtual void setParameter ( const QString &key, const QString &value ) = 0;
94
- /* *Remove a request parameter*/
95
+ /* * Remove a request parameter*/
95
96
virtual int removeParameter ( const QString &key ) = 0;
96
- /* *Return a request parameter*/
97
+ /* * Return a request parameter*/
97
98
virtual QString parameter ( const QString &key ) const = 0;
98
- /* *Return the requested format string*/
99
+ /* * Return the requested format string*/
99
100
QString format () const { return mFormat ; }
100
- /* *Return the mime type for the response*/
101
+ /* * Return the mime type for the response*/
101
102
QString infoFormat () const { return mInfoFormat ; }
102
- /* *Return true if the HTTP headers were already sent to the client*/
103
+ /* * Return true if the HTTP headers were already sent to the client*/
103
104
bool headersSent () { return mHeadersSent ; }
104
105
#ifdef HAVE_SERVER_PYTHON_PLUGINS
105
- /* *Allow core services to call plugin hooks through sendResponse() */
106
+ /* * Allow core services to call plugin hooks through sendResponse() */
106
107
virtual void setPluginFilters ( QgsServerFiltersMap pluginFilters ) = 0;
107
108
#endif
108
109
// TODO: if HAVE_SERVER_PYTHON
@@ -118,7 +119,7 @@ class QgsRequestHandler
118
119
QgsServerFiltersMap mPluginFilters ;
119
120
#endif
120
121
QByteArray mBody ; // The response payload
121
- /* *This is set by the parseInput methods of the subclasses (parameter FORMAT, e.g. 'FORMAT=PNG')*/
122
+ /* * This is set by the parseInput methods of the subclasses (parameter FORMAT, e.g. 'FORMAT=PNG')*/
122
123
QString mFormat ;
123
124
QString mFormatString ; // format string as it is passed in the request (with base)
124
125
bool mHeadersSent ;
0 commit comments