From 274ad514c6a470b4e981780b0cc58c8f8c1819cf Mon Sep 17 00:00:00 2001 From: Reuben Roberts Date: Fri, 23 Nov 2018 13:04:23 +0000 Subject: [PATCH] Respect data-resource-uid parameter Was being ignored, as far as I could tell. --- .../scala/au/org/ala/biocache/export/DwCACreator.scala | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/main/scala/au/org/ala/biocache/export/DwCACreator.scala b/src/main/scala/au/org/ala/biocache/export/DwCACreator.scala index f7330cdd8..ca0c71fa7 100644 --- a/src/main/scala/au/org/ala/biocache/export/DwCACreator.scala +++ b/src/main/scala/au/org/ala/biocache/export/DwCACreator.scala @@ -101,7 +101,12 @@ object DwCACreator extends Tool { dwcc.addImageExportsToArchives(directory) } else { try { - val dataResource2OutputStreams = getDataResourceUids.map { uid => (uid, dwcc.createOutputForCSV(directory, uid) ) }.toMap + var dataResource2OutputStreams = Map[String, Option[(ZipOutputStream, CSVWriter)]]() + if (resourceUid == "" || resourceUid == "all") { + dataResource2OutputStreams = getDataResourceUids.map { uid => (uid, dwcc.createOutputForCSV(directory, uid)) }.toMap + } else { + dataResource2OutputStreams = Map(resourceUid -> dwcc.createOutputForCSV(directory, resourceUid)) + } Config.persistenceManager.pageOverSelect("occ", (key, map) => { synchronized { val dr = map.getOrElse("dataResourceUid", "") @@ -581,4 +586,4 @@ class DwCACreator { None } } -} \ No newline at end of file +}