Skip to content

Commit 48b39b6

Browse files
committed
Add GetContext request to QGIS WMS Server
This non standard request retruns the QGIS project as an OWSContext document version 0.3.1. This request gives more interoperability to QGIS Server that can be directly used in client supporting OWSContext as config file. This function has been funded by Ifremer.
1 parent ce92549 commit 48b39b6

7 files changed

+455
-3
lines changed

src/mapserver/qgis_map_serv.cpp

+16
Original file line numberDiff line numberDiff line change
@@ -550,6 +550,22 @@ int main( int argc, char * argv[] )
550550
delete theServer;
551551
continue;
552552
}
553+
else if ( request.compare( "GetContext", Qt::CaseInsensitive ) == 0 )
554+
{
555+
try
556+
{
557+
QDomDocument doc = theServer->getContext();
558+
theRequestHandler->sendGetStyleResponse( doc );
559+
}
560+
catch ( QgsMapServiceException& ex )
561+
{
562+
theRequestHandler->sendServiceException( ex );
563+
}
564+
565+
delete theRequestHandler;
566+
delete theServer;
567+
continue;
568+
}
553569
else if ( request.compare( "GetStyles", Qt::CaseInsensitive ) == 0 || request.compare( "GetStyle", Qt::CaseInsensitive ) == 0 ) // GetStyle for compatibility with earlier QGIS versions
554570
{
555571
try

src/mapserver/qgsconfigparser.h

+2
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ class QgsConfigParser
4545

4646
virtual void featureTypeList( QDomElement& parentElement, QDomDocument& doc ) const = 0;
4747

48+
virtual void owsGeneralAndResourceList( QDomElement& parentElement, QDomDocument& doc, const QString& strHref ) const = 0;
49+
4850
virtual void describeFeatureType( const QString& aTypeName, QDomElement& parentElement, QDomDocument& doc ) const = 0;
4951
/**Returns one or possibly several maplayers for a given type name. If no layers/style are found, an empty list is returned*/
5052
virtual QList<QgsMapLayer*> mapLayerFromTypeName( const QString& tName, bool useCache = true ) const = 0;

0 commit comments

Comments
 (0)