QGIS API Documentation  3.26.3-Buenos Aires (65e4edfdad)
qgsserverstatichandler.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgsserverstatichandler.h - QgsServerStaticHandler
3 
4  ---------------------
5  begin : 30.7.2020
6  copyright : (C) 2020 by Alessandro Pasotti
7  email : elpaso at itopen dot it
8  ***************************************************************************
9  * *
10  * This program is free software; you can redistribute it and/or modify *
11  * it under the terms of the GNU General Public License as published by *
12  * the Free Software Foundation; either version 2 of the License, or *
13  * (at your option) any later version. *
14  * *
15  ***************************************************************************/
16 #ifndef QGSSERVERSTATICHANDLER_H
17 #define QGSSERVERSTATICHANDLER_H
18 
19 #include "qgsserverogcapihandler.h"
20 #include "qgis_server.h"
21 
29 {
30  public:
31 
39  QgsServerStaticHandler( const QString &pathRegExp = QStringLiteral( "/static/(?<staticFilePath>.*)$" ), const QString &staticPathSuffix = QString( ) );
40 
41  void handleRequest( const QgsServerApiContext &context ) const override;
42 
43  // QgsServerOgcApiHandler interface
44  QRegularExpression path() const override { return mPathRegExp; }
45  std::string operationId() const override { return "static"; }
46  std::string summary() const override { return "Serves static files"; }
47  std::string description() const override { return "Serves static files"; }
48  std::string linkTitle() const override { return "Serves static files"; }
49  QgsServerOgcApi::Rel linkType() const override { return QgsServerOgcApi::Rel::data; }
50 
51  private:
52 
53  QRegularExpression mPathRegExp;
54  QString mStaticPathSuffix;
55 };
56 
57 
58 #endif // QGSSERVERSTATICHANDLER_H
QgsServerApiContext
The QgsServerApiContext class encapsulates the resources for a particular client request: the request...
Definition: qgsserverapicontext.h:38
QgsServerOgcApiHandler::summary
virtual std::string summary() const =0
Summary.
QgsServerOgcApiHandler::description
virtual std::string description() const =0
Description.
QgsServerStaticHandler
The QgsServerStaticHandler class serves static files from the static path (resources/server/api/wfs3/...
Definition: qgsserverstatichandler.h:28
QgsServerOgcApiHandler::linkTitle
virtual std::string linkTitle() const =0
Title for the handler link.
qgsserverogcapihandler.h
QgsServerOgcApi::Rel
Rel
Rel link types.
Definition: qgsserverogcapi.h:57
QgsServerOgcApiHandler
The QgsServerOgcApiHandler abstract class represents a OGC API handler to be registered in QgsServerO...
Definition: qgsserverogcapihandler.h:94
QgsServerOgcApiHandler::handleRequest
virtual void handleRequest(const QgsServerApiContext &context) const SIP_THROW(QgsServerApiBadRequestException)
Handles the request within its context.
Definition: qgsserverogcapihandler.cpp:80
QgsServerOgcApiHandler::operationId
virtual std::string operationId() const =0
Returns the operation id for template file names and other internal references.
QgsServerOgcApiHandler::path
virtual QRegularExpression path() const =0
URL pattern for this handler, named capture group are automatically extracted and returned by values(...
QgsServerOgcApiHandler::linkType
virtual QgsServerOgcApi::Rel linkType() const =0
Main role for the resource link.