Skip to content
Permalink
Browse files
Merge pull request #4415 from rldhont/server-wms-configparser-getcapa…
…bilities-part1

[Server] WMS GetCapabilities refactoring - Part 1
  • Loading branch information
rldhont committed Apr 25, 2017
2 parents 96151e7 + 27a9053 commit 70a21d47e9fd7929ba4f4e8825f67d93dd107951
@@ -87,6 +87,58 @@ int QgsServerProjectUtils::wmsMaxHeight( const QgsProject &project )
return project.readNumEntry( QStringLiteral( "WMSMaxHeight" ), QStringLiteral( "/" ), -1 );
}

bool QgsServerProjectUtils::wmsUseLayerIds( const QgsProject &project )
{
return project.readBoolEntry( QStringLiteral( "WMSUseLayerIDs" ), QStringLiteral( "/" ) );
}

bool QgsServerProjectUtils::wmsInfoFormatSIA2045( const QgsProject &project )
{
QString sia2045 = project.readEntry( QStringLiteral( "WMSInfoFormatSIA2045" ), QStringLiteral( "/" ), "" );

if ( sia2045.compare( QLatin1String( "enabled" ), Qt::CaseInsensitive ) == 0
|| sia2045.compare( QLatin1String( "true" ), Qt::CaseInsensitive ) == 0 )
{
return true;
}
return false;
}

bool QgsServerProjectUtils::wmsInspireActivated( const QgsProject &project )
{
return project.readBoolEntry( QStringLiteral( "WMSInspire" ), QStringLiteral( "/activated" ) );
}

QString QgsServerProjectUtils::wmsInspireLanguage( const QgsProject &project )
{
return project.readEntry( QStringLiteral( "WMSInspire" ), QStringLiteral( "/language" ) );
}

QString QgsServerProjectUtils::wmsInspireMetadataUrl( const QgsProject &project )
{
return project.readEntry( QStringLiteral( "WMSInspire" ), QStringLiteral( "/metadataUrl" ) );
}

QString QgsServerProjectUtils::wmsInspireMetadataUrlType( const QgsProject &project )
{
return project.readEntry( QStringLiteral( "WMSInspire" ), QStringLiteral( "/metadataUrlType" ) );
}

QString QgsServerProjectUtils::wmsInspireTemporalReference( const QgsProject &project )
{
return project.readEntry( QStringLiteral( "WMSInspire" ), QStringLiteral( "/temporalReference" ) );
}

QString QgsServerProjectUtils::wmsInspireMetadataDate( const QgsProject &project )
{
return project.readEntry( QStringLiteral( "WMSInspire" ), QStringLiteral( "/metadataDate" ) );
}

QStringList QgsServerProjectUtils::wmsRestrictedComposers( const QgsProject &project )
{
return project.readListEntry( QStringLiteral( "WMSRestrictedComposers" ), QStringLiteral( "/" ), QStringList() );
}

QString QgsServerProjectUtils::wmsServiceUrl( const QgsProject &project )
{
return project.readEntry( QStringLiteral( "WMSUrl" ), QStringLiteral( "/" ), "" );
@@ -113,6 +113,60 @@ namespace QgsServerProjectUtils
*/
SERVER_EXPORT int wmsMaxHeight( const QgsProject &project );

/** Returns if layer ids are used as name in WMS.
* \param project the QGIS project
* \returns if layer ids are used as name.
*/
SERVER_EXPORT bool wmsUseLayerIds( const QgsProject &project );

/** Returns if the info format is SIA20145.
* \param project the QGIS project
* \returns if the info format is SIA20145.
*/
SERVER_EXPORT bool wmsInfoFormatSIA2045( const QgsProject &project );

/** Returns if Inspire is activated.
* \param project the QGIS project
* \returns if Inspire is activated.
*/
SERVER_EXPORT bool wmsInspireActivated( const QgsProject &project );

/** Returns the Inspire language.
* \param project the QGIS project
* \returns the Inspire language if defined in project.
*/
SERVER_EXPORT QString wmsInspireLanguage( const QgsProject &project );

/** Returns the Inspire metadata URL.
* \param project the QGIS project
* \returns the Inspire metadata URL if defined in project.
*/
SERVER_EXPORT QString wmsInspireMetadataUrl( const QgsProject &project );

/** Returns the Inspire metadata URL type.
* \param project the QGIS project
* \returns the Inspire metadata URL type if defined in project.
*/
SERVER_EXPORT QString wmsInspireMetadataUrlType( const QgsProject &project );

/** Returns the Inspire temporal reference.
* \param project the QGIS project
* \returns the Inspire temporal reference if defined in project.
*/
SERVER_EXPORT QString wmsInspireTemporalReference( const QgsProject &project );

/** Returns the Inspire metadata date.
* \param project the QGIS project
* \returns the Inspire metadata date if defined in project.
*/
SERVER_EXPORT QString wmsInspireMetadataDate( const QgsProject &project );

/** Returns the restricted composer list.
* \param project the QGIS project
* \returns the restricted composer list if defined in project.
*/
SERVER_EXPORT QStringList wmsRestrictedComposers( const QgsProject &project );

/** Returns the WMS service url defined in a QGIS project.
* \param project the QGIS project
* \returns url if defined in project, an empty string otherwise.
Loading

0 comments on commit 70a21d4

Please sign in to comment.