118 if (
mKeywords.contains( QStringLiteral(
"gmd:topicCategory" ) ) )
120 return mKeywords.value( QStringLiteral(
"gmd:topicCategory" ) );
124 return QStringList();
130 mKeywords.insert( QStringLiteral(
"gmd:topicCategory" ), category );
179 mnl = metadataElement.namedItem( QStringLiteral(
"identifier" ) );
183 mnl = metadataElement.namedItem( QStringLiteral(
"parentidentifier" ) );
187 mnl = metadataElement.namedItem( QStringLiteral(
"language" ) );
191 mnl = metadataElement.namedItem( QStringLiteral(
"type" ) );
192 mType = mnl.toElement().text();
195 mnl = metadataElement.namedItem( QStringLiteral(
"title" ) );
196 mTitle = mnl.toElement().text();
199 mnl = metadataElement.namedItem( QStringLiteral(
"abstract" ) );
203 QDomNodeList
keywords = metadataElement.elementsByTagName( QStringLiteral(
"keywords" ) );
205 for (
int i = 0; i <
keywords.size(); i++ )
207 QStringList keywordsList;
209 mne = mnl.toElement();
211 QDomNodeList el = mne.elementsByTagName( QStringLiteral(
"keyword" ) );
212 for (
int j = 0; j < el.size(); j++ )
214 keywordsList.append( el.at( j ).toElement().text() );
216 addKeywords( mne.attribute( QStringLiteral(
"vocabulary" ) ), keywordsList );
220 QDomNodeList contactsList = metadataElement.elementsByTagName( QStringLiteral(
"contact" ) );
222 for (
int i = 0; i < contactsList.size(); i++ )
224 mnl = contactsList.at( i );
225 mne = mnl.toElement();
228 oneContact.
name = mne.namedItem( QStringLiteral(
"name" ) ).toElement().text();
229 oneContact.
organization = mne.namedItem( QStringLiteral(
"organization" ) ).toElement().text();
230 oneContact.
position = mne.namedItem( QStringLiteral(
"position" ) ).toElement().text();
231 oneContact.
voice = mne.namedItem( QStringLiteral(
"voice" ) ).toElement().text();
232 oneContact.
fax = mne.namedItem( QStringLiteral(
"fax" ) ).toElement().text();
233 oneContact.
email = mne.namedItem( QStringLiteral(
"email" ) ).toElement().text();
234 oneContact.
role = mne.namedItem( QStringLiteral(
"role" ) ).toElement().text();
236 QList< QgsAbstractMetadataBase::Address > addresses;
237 QDomNodeList addressList = mne.elementsByTagName( QStringLiteral(
"contactAddress" ) );
238 for (
int j = 0; j < addressList.size(); j++ )
240 QDomElement addressElement = addressList.at( j ).toElement();
242 oneAddress.
address = addressElement.namedItem( QStringLiteral(
"address" ) ).toElement().text();
243 oneAddress.
administrativeArea = addressElement.namedItem( QStringLiteral(
"administrativearea" ) ).toElement().text();
244 oneAddress.
city = addressElement.namedItem( QStringLiteral(
"city" ) ).toElement().text();
245 oneAddress.
country = addressElement.namedItem( QStringLiteral(
"country" ) ).toElement().text();
246 oneAddress.
postalCode = addressElement.namedItem( QStringLiteral(
"postalcode" ) ).toElement().text();
247 oneAddress.
type = addressElement.namedItem( QStringLiteral(
"type" ) ).toElement().text();
248 addresses << oneAddress;
255 mnl = metadataElement.namedItem( QStringLiteral(
"links" ) );
256 mne = mnl.toElement();
258 QDomNodeList el = mne.elementsByTagName( QStringLiteral(
"link" ) );
259 for (
int i = 0; i < el.size(); i++ )
261 mne = el.at( i ).toElement();
263 oneLink.
name = mne.attribute( QStringLiteral(
"name" ) );
264 oneLink.
type = mne.attribute( QStringLiteral(
"type" ) );
265 oneLink.
url = mne.attribute( QStringLiteral(
"url" ) );
266 oneLink.
description = mne.attribute( QStringLiteral(
"description" ) );
267 oneLink.
format = mne.attribute( QStringLiteral(
"format" ) );
268 oneLink.
mimeType = mne.attribute( QStringLiteral(
"mimeType" ) );
269 oneLink.
size = mne.attribute( QStringLiteral(
"size" ) );
274 QDomNodeList historyNodeList = metadataElement.elementsByTagName( QStringLiteral(
"history" ) );
275 QStringList historyList;
276 for (
int i = 0; i < historyNodeList.size(); i++ )
278 mnl = historyNodeList.at( i );
279 mne = mnl.toElement();
280 historyList.append( mne.text() );
290 QDomElement
identifier = document.createElement( QStringLiteral(
"identifier" ) );
291 QDomText identifierText = document.createTextNode(
mIdentifier );
296 QDomElement
parentIdentifier = document.createElement( QStringLiteral(
"parentidentifier" ) );
302 QDomElement
language = document.createElement( QStringLiteral(
"language" ) );
303 QDomText languageText = document.createTextNode(
mLanguage );
304 language.appendChild( languageText );
305 metadataElement.appendChild(
language );
308 QDomElement
type = document.createElement( QStringLiteral(
"type" ) );
309 QDomText typeText = document.createTextNode(
mType );
310 type.appendChild( typeText );
311 metadataElement.appendChild(
type );
314 QDomElement
title = document.createElement( QStringLiteral(
"title" ) );
315 QDomText titleText = document.createTextNode(
mTitle );
316 title.appendChild( titleText );
317 metadataElement.appendChild(
title );
320 QDomElement
abstract = document.createElement( QStringLiteral(
"abstract" ) );
321 QDomText abstractText = document.createTextNode(
mAbstract );
322 abstract.appendChild( abstractText );
323 metadataElement.appendChild(
abstract );
326 QMapIterator<QString, QStringList> i(
mKeywords );
327 while ( i.hasNext() )
330 QDomElement keywordsElement = document.createElement( QStringLiteral(
"keywords" ) );
331 keywordsElement.setAttribute( QStringLiteral(
"vocabulary" ), i.key() );
332 const QStringList values = i.value();
333 for (
const QString &kw : values )
335 QDomElement keyword = document.createElement( QStringLiteral(
"keyword" ) );
336 QDomText keywordText = document.createTextNode( kw );
337 keyword.appendChild( keywordText );
338 keywordsElement.appendChild( keyword );
340 metadataElement.appendChild( keywordsElement );
346 QDomElement contactElement = document.createElement( QStringLiteral(
"contact" ) );
347 QDomElement nameElement = document.createElement( QStringLiteral(
"name" ) );
348 QDomElement organizationElement = document.createElement( QStringLiteral(
"organization" ) );
349 QDomElement positionElement = document.createElement( QStringLiteral(
"position" ) );
350 QDomElement voiceElement = document.createElement( QStringLiteral(
"voice" ) );
351 QDomElement faxElement = document.createElement( QStringLiteral(
"fax" ) );
352 QDomElement emailElement = document.createElement( QStringLiteral(
"email" ) );
353 QDomElement roleElement = document.createElement( QStringLiteral(
"role" ) );
355 QDomText nameText = document.createTextNode( contact.name );
356 QDomText orgaText = document.createTextNode( contact.organization );
357 QDomText positionText = document.createTextNode( contact.position );
358 QDomText voiceText = document.createTextNode( contact.voice );
359 QDomText faxText = document.createTextNode( contact.fax );
360 QDomText emailText = document.createTextNode( contact.email );
361 QDomText roleText = document.createTextNode( contact.role );
365 QDomElement addressElement = document.createElement( QStringLiteral(
"contactAddress" ) );
366 QDomElement typeElement = document.createElement( QStringLiteral(
"type" ) );
367 QDomElement addressDetailedElement = document.createElement( QStringLiteral(
"address" ) );
368 QDomElement cityElement = document.createElement( QStringLiteral(
"city" ) );
369 QDomElement administrativeAreaElement = document.createElement( QStringLiteral(
"administrativearea" ) );
370 QDomElement postalCodeElement = document.createElement( QStringLiteral(
"postalcode" ) );
371 QDomElement countryElement = document.createElement( QStringLiteral(
"country" ) );
373 typeElement.appendChild( document.createTextNode( oneAddress.
type ) );
374 addressDetailedElement.appendChild( document.createTextNode( oneAddress.
address ) );
375 cityElement.appendChild( document.createTextNode( oneAddress.
city ) );
376 administrativeAreaElement.appendChild( document.createTextNode( oneAddress.
administrativeArea ) );
377 postalCodeElement.appendChild( document.createTextNode( oneAddress.
postalCode ) );
378 countryElement.appendChild( document.createTextNode( oneAddress.
country ) );
380 addressElement.appendChild( typeElement );
381 addressElement.appendChild( addressDetailedElement );
382 addressElement.appendChild( cityElement );
383 addressElement.appendChild( administrativeAreaElement );
384 addressElement.appendChild( postalCodeElement );
385 addressElement.appendChild( countryElement );
386 contactElement.appendChild( addressElement );
389 nameElement.appendChild( nameText );
390 organizationElement.appendChild( orgaText );
391 positionElement.appendChild( positionText );
392 voiceElement.appendChild( voiceText );
393 faxElement.appendChild( faxText );
394 emailElement.appendChild( emailText );
395 roleElement.appendChild( roleText );
397 contactElement.appendChild( nameElement );
398 contactElement.appendChild( organizationElement );
399 contactElement.appendChild( positionElement );
400 contactElement.appendChild( voiceElement );
401 contactElement.appendChild( faxElement );
402 contactElement.appendChild( emailElement );
403 contactElement.appendChild( roleElement );
404 metadataElement.appendChild( contactElement );
408 QDomElement
links = document.createElement( QStringLiteral(
"links" ) );
411 QDomElement linkElement = document.createElement( QStringLiteral(
"link" ) );
412 linkElement.setAttribute( QStringLiteral(
"name" ), link.name );
413 linkElement.setAttribute( QStringLiteral(
"type" ), link.type );
414 linkElement.setAttribute( QStringLiteral(
"url" ), link.url );
415 linkElement.setAttribute( QStringLiteral(
"description" ), link.description );
416 linkElement.setAttribute( QStringLiteral(
"format" ), link.format );
417 linkElement.setAttribute( QStringLiteral(
"mimeType" ), link.mimeType );
418 linkElement.setAttribute( QStringLiteral(
"size" ), link.size );
419 links.appendChild( linkElement );
421 metadataElement.appendChild(
links );
426 QDomElement historyElement = document.createElement( QStringLiteral(
"history" ) );
427 QDomText historyText = document.createTextNode(
history );
428 historyElement.appendChild( historyText );
429 metadataElement.appendChild( historyElement );
464 return name == other.
name &&
477 city == other.
city &&