Skip to content
Permalink
Browse files

Possibility to set url for a feature info schema

  • Loading branch information
mhugent committed Oct 25, 2012
1 parent 1a092f9 commit a622d1b56928bad9e55cf41b34c412437a645af1
@@ -136,6 +136,8 @@ class QgsConfigParser
virtual QString featureInfoDocumentElement( const QString& defaultValue ) const { return defaultValue; }
/**Returns document element namespace in GetFeatureInfo response or empty string*/
virtual QString featureInfoDocumentElementNS() const { return ""; }
/**Returns schema url for feature info xsd (or an empty string if there is no schema)*/
virtual QString featureInfoSchema() const { return ""; }

/**Return feature info in format SIA2045?*/
virtual bool featureInfoFormatSIA2045() const { return false; }
@@ -1929,6 +1929,21 @@ QString QgsProjectParser::featureInfoDocumentElementNS() const
return featureInfoDocumentNSElem.text();
}

QString QgsProjectParser::featureInfoSchema() const
{
QDomElement propertiesElem = mXMLDoc->documentElement().firstChildElement( "properties" );
if ( propertiesElem.isNull() )
{
return "";
}
QDomElement featureInfoSchemaElem = propertiesElem.firstChildElement( "WMSFeatureInfoSchema" );
if ( featureInfoSchemaElem.isNull() )
{
return "";
}
return featureInfoSchemaElem.text();
}

bool QgsProjectParser::featureInfoFormatSIA2045() const
{
if ( !mXMLDoc )
@@ -118,6 +118,8 @@ class QgsProjectParser: public QgsConfigParser

virtual QString featureInfoDocumentElementNS() const;

virtual QString featureInfoSchema() const;

/**Return feature info in format SIA2045?*/
bool featureInfoFormatSIA2045() const;

@@ -740,6 +740,14 @@ int QgsWMSServer::getFeatureInfo( QDomDocument& result, QString version )
{
getFeatureInfoElement = result.createElementNS( featureInfoElemNS, featureInfoElemName );
}
//feature info schema
QString featureInfoSchema = mConfigParser->featureInfoSchema();
if ( !featureInfoSchema.isEmpty() )
{
getFeatureInfoElement.setAttribute( "xmlns:xsi", "http://www.w3.org/2001/XMLSchema-instance" );
getFeatureInfoElement.setAttribute( "xsi:schemaLocation", featureInfoSchema );
}

result.appendChild( getFeatureInfoElement );

QStringList nonIdentifiableLayers = mConfigParser->identifyDisabledLayers();

0 comments on commit a622d1b

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