Skip to content
Permalink
Browse files

write metadata with XML

  • Loading branch information
Gustry committed Sep 8, 2017
1 parent 32dee44 commit 814ef7873215d2410d64432623f3d7ecc8099832
@@ -382,6 +382,13 @@ class QgsLayerMetadata
:rtype: QgsLayerMetadata.ConstraintList
%End

void addConstraint( const QgsLayerMetadata::Constraint &constraint );
%Docstring
Adds an individual constraint to the existing constraints.
.. seealso:: constraints()
.. seealso:: setConstraints()
%End

void setConstraints( const QgsLayerMetadata::ConstraintList &constraints );
%Docstring
Sets the list of ``constraints`` associated with using the resource.
@@ -641,6 +648,25 @@ class QgsLayerMetadata
.. seealso:: saveToLayer()
%End

bool readMetadataXml( const QDomElement &metadataElement );
%Docstring
Sets state from Dom document
\param metadataElement The Dom element corresponding to ``resourceMetadata'' tag

:return: true if successful
:rtype: bool
%End

bool writeMetadataXml( QDomElement &metadataElement, QDomDocument &document ) const;
%Docstring
Stores state in Dom node
\param metadataElement is a Dom element corresponding to ``resourceMetadata'' tag
\param document is a the dom document being written

:return: true if successful
:rtype: bool
%End

};


@@ -15,13 +15,21 @@
</keywords>
<fees>None</fees>
<constraints type="access">None</constraints>
<constraints type="other">None</constraints>
<rights>Copyright foo 2017</rights>
<license>License 1</license>
<license>License 2</license>
<encoding>utf-8</encoding>
<crs>EPSG:4326</crs>
<extent>
<spatial dimensions="2" crs="EPSG:4326" minx="-180" miny="-90" maxx="180" maxy="90"/>
<spatial dimensions="2" crs="EPSG:4326" minx="-180" miny="-90" maxx="180" maxy="90" minz="10" maxz="50"/>
<temporal>
<instant>2001-12-17T09:30:47Z</instant>
<period>
<start>2001-12-17T09:30:47Z</start>
<end>2020-12-17T09:30:47Z</end>
</period>
</temporal>
</extent>
<contact>
@@ -46,4 +54,6 @@
<link name="geonode:roads" type="OGC:WFS" description="my GeoNode road layer" url="http://example.org/wfs"/>
<link name="roads" type="WWW:LINK" description="full dataset download" url="http://example.org/roads.tgz" format="ESRI Shapefile" mimeType="application/gzip" size="283676"/>
</links>
<history>Buffering</history>
<history>Reprojecting</history>
</ResourceMetadata>
@@ -84,7 +84,7 @@
<xs:element name="license" type="xs:string" minOccurs="1" maxOccurs="unbounded">
<xs:annotation>
<xs:documentation>License associated with a given resource (examples: http://opendefinition.org/licenses/).</xs:documentation>
</xs:annotation>
</xs:annotation>
</xs:element>
<xs:element name="encoding" type="xs:string" minOccurs="0">
<xs:annotation>
@@ -122,7 +122,7 @@
<xs:annotation>
<xs:documentation>Freeform description of the history or lineage of the resource.</xs:documentation>
</xs:annotation>
</xs:element>
</xs:element>
</xs:sequence>
<xs:attribute name="version" use="required" fixed="1.0">
<xs:annotation>
@@ -339,11 +339,11 @@
<xs:attributeGroup ref="rm:linkAttrs"/>
</xs:complexType>
<xs:attributeGroup name="linkAttrs">
<xs:attribute name="name" type="xs:string"/>
<xs:attribute name="type" type="xs:string"/>
<xs:attribute name="description" type="xs:string" use="optional"/>
<xs:attribute name="name" type="xs:string" use="required"/>
<xs:attribute name="type" type="xs:string" use="required"/>
<xs:attribute name="url" type="xs:anyURI" use="required"/>
<xs:attribute name="format" type="xs:string" use="optional"/>
<xs:attribute name="description" type="xs:string" use="optional"/>
<xs:attribute name="format" type="xs:string" use="optional"/>
<xs:attribute name="mimeType" type="xs:string" use="optional"/>
<xs:attribute name="size" type="xs:string" use="optional"/>
</xs:attributeGroup>

0 comments on commit 814ef78

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