Skip to content
Permalink
Browse files

Add Service online resource element to WMS capability response. This …

…element is mandatory according to the 1.3 spec
  • Loading branch information
mhugent committed Jul 18, 2011
1 parent c9bb721 commit 707ab4e7bc106540e0f0ebb1fd0c3598c534fba2
Showing with 32 additions and 8 deletions.
  1. +2 −0 src/app/qgsprojectproperties.cpp
  2. +12 −0 src/mapserver/qgsprojectparser.cpp
  3. +18 −8 src/ui/qgsprojectpropertiesbase.ui
@@ -168,6 +168,7 @@ QgsProjectProperties::QgsProjectProperties( QgsMapCanvas* mapCanvas, QWidget *pa
mWMSContactMail->setText( QgsProject::instance()->readEntry( "WMSContactMail", "/", "" ) );
mWMSContactPhone->setText( QgsProject::instance()->readEntry( "WMSContactPhone", "/", "" ) );
mWMSAbstract->setPlainText( QgsProject::instance()->readEntry( "WMSServiceAbstract", "/", "" ) );
mWMSOnlineResourceLineEdit->setText( QgsProject::instance()->readEntry( "WMSOnlineResource", "/", "" ) );

bool ok;
QStringList values;
@@ -372,6 +373,7 @@ void QgsProjectProperties::apply()
QgsProject::instance()->writeEntry( "WMSContactMail", "/", mWMSContactMail->text() );
QgsProject::instance()->writeEntry( "WMSContactPhone", "/", mWMSContactPhone->text() );
QgsProject::instance()->writeEntry( "WMSServiceAbstract", "/", mWMSAbstract->toPlainText() );
QgsProject::instance()->writeEntry( "WMSOnlineResource", "/", mWMSOnlineResourceLineEdit->text() );

if ( grpWMSExt->isChecked() )
{
@@ -1284,6 +1284,18 @@ void QgsProjectParser::serviceCapabilities( QDomElement& parentElement, QDomDocu
serviceElem.appendChild( wmsAbstractElem );
}

//OnlineResource element is mandatory according to the WMS specification
QDomElement wmsOnlineResourceElem = propertiesElem.firstChildElement( "WMSOnlineResource" );
QDomElement onlineResourceElem = doc.createElement( "OnlineResource" );
onlineResourceElem.setAttribute( "xmlns:xlink", "http://www.w3.org/1999/xlink" );
onlineResourceElem.setAttribute( "xlink:type", "simple" );
if ( !wmsOnlineResourceElem.isNull() )
{
onlineResourceElem.setAttribute( "xlink:href", wmsOnlineResourceElem.text() );
}

serviceElem.appendChild( onlineResourceElem );

//Contact information
QDomElement contactInfoElem = doc.createElement( "ContactInformation" );

@@ -393,7 +393,7 @@
<item row="0" column="2">
<widget class="QLineEdit" name="mWMSTitle"/>
</item>
<item row="2" column="0">
<item row="3" column="0">
<widget class="QLabel" name="label_7">
<property name="text">
<string>Person</string>
@@ -403,10 +403,10 @@
</property>
</widget>
</item>
<item row="2" column="2">
<item row="3" column="2">
<widget class="QLineEdit" name="mWMSContactPerson"/>
</item>
<item row="5" column="0">
<item row="6" column="0">
<widget class="QLabel" name="label_8">
<property name="text">
<string>Phone</string>
@@ -416,13 +416,13 @@
</property>
</widget>
</item>
<item row="5" column="2">
<item row="6" column="2">
<widget class="QLineEdit" name="mWMSContactPhone"/>
</item>
<item row="7" column="2">
<item row="8" column="2">
<widget class="QTextEdit" name="mWMSAbstract"/>
</item>
<item row="7" column="0">
<item row="8" column="0">
<widget class="QLabel" name="label_5">
<property name="text">
<string>Abstract</string>
@@ -432,14 +432,14 @@
</property>
</widget>
</item>
<item row="4" column="0">
<item row="5" column="0">
<widget class="QLabel" name="label_13">
<property name="text">
<string>E-Mail</string>
</property>
</widget>
</item>
<item row="4" column="2">
<item row="5" column="2">
<widget class="QLineEdit" name="mWMSContactMail"/>
</item>
<item row="1" column="0">
@@ -455,6 +455,16 @@
<item row="1" column="2">
<widget class="QLineEdit" name="mWMSContactOrganization"/>
</item>
<item row="2" column="2">
<widget class="QLineEdit" name="mWMSOnlineResourceLineEdit"/>
</item>
<item row="2" column="0">
<widget class="QLabel" name="mWMSOnlineResourceLabel">
<property name="text">
<string>Online resource</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>

0 comments on commit 707ab4e

Please sign in to comment.
You can’t perform that action at this time.