Skip to content

Commit

Permalink
Update getcontext
Browse files Browse the repository at this point in the history
  • Loading branch information
pblottiere committed Mar 9, 2021
1 parent ca43236 commit daab06c
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 16 deletions.
2 changes: 1 addition & 1 deletion src/server/services/wms/qgswms.cpp
Expand Up @@ -126,7 +126,7 @@ namespace QgsWms
}
else if ( QSTR_COMPARE( req, "GetContext" ) )
{
writeGetContext( mServerIface, project, version, request, response );
writeGetContext( mServerIface, project, request, response );
}
else if ( QSTR_COMPARE( req, "GetSchemaExtension" ) )
{
Expand Down
22 changes: 11 additions & 11 deletions src/server/services/wms/qgswmsgetcontext.cpp
Expand Up @@ -19,6 +19,7 @@
* *
***************************************************************************/
#include "qgswmsutils.h"
#include "qgswmsrequest.h"
#include "qgswmsgetcontext.h"
#include "qgsserverprojectutils.h"

Expand All @@ -40,18 +41,18 @@ namespace QgsWms
QDomElement &parentLayer,
QgsServerInterface *serverIface,
const QgsProject *project,
const QgsServerRequest &request,
const QgsWmsRequest &request,
const QgsLayerTreeGroup *layerTreeGroup,
QgsRectangle &combinedBBox,
const QString &strGroup );

void appendOwsGeneralAndResourceList( QDomDocument &doc, QDomElement &parentElement,
QgsServerInterface *serverIface, const QgsProject *project,
const QgsServerRequest &request );
const QgsWmsRequest &request );
}

void writeGetContext( QgsServerInterface *serverIface, const QgsProject *project,
const QString &version, const QgsServerRequest &request,
const QgsWmsRequest &request,
QgsServerResponse &response )
{
#ifdef HAVE_SERVER_PYTHON_PLUGINS
Expand All @@ -69,7 +70,7 @@ namespace QgsWms
}
else //context xml not in cache. Create a new one
{
doc = getContext( serverIface, project, version, request );
doc = getContext( serverIface, project, request );

if ( cacheManager )
{
Expand All @@ -78,19 +79,18 @@ namespace QgsWms
contextDocument = &doc;
}
#else
doc = getContext( serverIface, project, version, request );
doc = getContext( serverIface, project, request );
contextDocument = &doc;
#endif
response.setHeader( QStringLiteral( "Content-Type" ), QStringLiteral( "text/xml; charset=utf-8" ) );
response.write( contextDocument->toByteArray() );
}


QDomDocument getContext( QgsServerInterface *serverIface, const QgsProject *project,
const QString &version, const QgsServerRequest &request )
QDomDocument getContext( QgsServerInterface *serverIface,
const QgsProject *project,
const QgsWmsRequest &request )
{
Q_UNUSED( version )

QDomDocument doc;
QDomProcessingInstruction xmlDeclaration = doc.createProcessingInstruction( QStringLiteral( "xml" ),
QStringLiteral( "version=\"1.0\" encoding=\"utf-8\"" ) );
Expand Down Expand Up @@ -121,7 +121,7 @@ namespace QgsWms
{
void appendOwsGeneralAndResourceList( QDomDocument &doc, QDomElement &parentElement,
QgsServerInterface *serverIface, const QgsProject *project,
const QgsServerRequest &request )
const QgsWmsRequest &request )
{
parentElement.setAttribute( QStringLiteral( "id" ), "ows-context-" + project->baseName() );

Expand Down Expand Up @@ -219,7 +219,7 @@ namespace QgsWms
QDomElement &parentLayer,
QgsServerInterface *serverIface,
const QgsProject *project,
const QgsServerRequest &request,
const QgsWmsRequest &request,
const QgsLayerTreeGroup *layerTreeGroup,
QgsRectangle &combinedBBox,
const QString &strGroup )
Expand Down
10 changes: 6 additions & 4 deletions src/server/services/wms/qgswmsgetcontext.h
Expand Up @@ -25,15 +25,17 @@ namespace QgsWms
/**
* Output GetContext response
*/
void writeGetContext( QgsServerInterface *serverIface, const QgsProject *project,
const QString &version, const QgsServerRequest &request,
void writeGetContext( QgsServerInterface *serverIface,
const QgsProject *project,
const QgsWmsRequest &request,
QgsServerResponse &response );

/**
* Returns XML document for the 'GetContext' request
*/
QDomDocument getContext( QgsServerInterface *serverIface, const QgsProject *project,
const QString &version, const QgsServerRequest &request );
QDomDocument getContext( QgsServerInterface *serverIface,
const QgsProject *project,
const QgsWmsRequest &request );

} // namespace QgsWms

Expand Down

0 comments on commit daab06c

Please sign in to comment.