diff --git a/build.gradle b/build.gradle index 49e2508..0d7fd2b 100644 --- a/build.gradle +++ b/build.gradle @@ -53,16 +53,16 @@ dependencies { implementation group: 'org.tinylog', name: 'tinylog-impl', version: '2.7.0' runtimeOnly group: 'org.tinylog', name: 'slf4j-tinylog', version: '2.7.0' - implementation group: 'org.eclipse.jetty', name: 'jetty-server', version: '11.0.22' // v12.x not compatible with Java 11 - implementation group: 'org.eclipse.jetty', name: 'jetty-security', version: '11.0.22' - implementation group: 'org.eclipse.jetty.http2', name: 'http2-server', version: '11.0.22' - implementation group: 'org.eclipse.jetty', name: 'jetty-alpn-java-server', version: '11.0.22' + implementation group: 'org.eclipse.jetty', name: 'jetty-server', version: '11.0.24' // v12.x not compatible with Java 11 + implementation group: 'org.eclipse.jetty', name: 'jetty-security', version: '11.0.24' + implementation group: 'org.eclipse.jetty.http2', name: 'http2-server', version: '11.0.24' + implementation group: 'org.eclipse.jetty', name: 'jetty-alpn-java-server', version: '11.0.24' implementation group: 'org.json', name: 'json', version: '20240303' implementation group: 'org.yaml', name: 'snakeyaml', version: '1.33' // TODO: check compatibility with newer version 2.x - implementation group: 'de.siegmar', name: 'fastcsv', version: '3.2.0' + implementation group: 'de.siegmar', name: 'fastcsv', version: '3.3.1' implementation group: 'com.opencsv', name: 'opencsv', version: '5.9' - implementation group: 'ch.randelshofer', name: 'fastdoubleparser', version: '1.0.0' + implementation group: 'ch.randelshofer', name: 'fastdoubleparser', version: '1.0.1' implementation group: 'com.github.wendykierp', name: 'JTransforms', version: '3.1' @@ -82,7 +82,7 @@ dependencies { implementation group: 'com.drewnoakes', name: 'metadata-extractor', version: '2.19.0' - implementation group: 'com.h2database', name: 'h2', version: '2.3.230' // old database v2.1.x files not compatible with v2.2.x + implementation group: 'com.h2database', name: 'h2', version: '2.3.232' // old database v2.1.x files not compatible with v2.2.x implementation group: 'org.reflections', name: 'reflections', version: '0.10.2' diff --git a/launch/audio - build.launch b/launch/audio - _package.launch similarity index 100% rename from launch/audio - build.launch rename to launch/audio - _package.launch diff --git a/src/photo/api/Photo2Handler.java b/src/photo/api/Photo2Handler.java index def6927..3ae3a3d 100644 --- a/src/photo/api/Photo2Handler.java +++ b/src/photo/api/Photo2Handler.java @@ -25,7 +25,6 @@ import audio.Account; import audio.Broker; -import audio.Sample2; import jakarta.servlet.http.HttpServletResponse; import jakarta.servlet.http.HttpSession; import photo.Photo2; diff --git a/src/photo/task/Task_photo_export_Camtrap_DP.java b/src/photo/task/Task_photo_export_Camtrap_DP.java index 3aacb0a..55c784f 100644 --- a/src/photo/task/Task_photo_export_Camtrap_DP.java +++ b/src/photo/task/Task_photo_export_Camtrap_DP.java @@ -27,7 +27,7 @@ import util.yaml.YamlMap; @Tag("photo") -@Description("Export photo meta data to CSV files in structure of Camtrap DP.") +@Description("Export photo metadata according to the Camtrap DP standard.") @Role("admin") public class Task_photo_export_Camtrap_DP extends Task { @@ -88,8 +88,7 @@ public void run() { } HashSet scientificNameSet = new HashSet(); - LocalDateTime[] deplMin = new LocalDateTime[] {MAX_DATE}; - LocalDateTime[] deplMax = new LocalDateTime[] {MIN_DATE}; + LocalDateTime[] deplRange = new LocalDateTime[] {MAX_DATE, MIN_DATE}; HashMap rangeMap = new HashMap(); try ( @@ -156,11 +155,11 @@ public void run() { String favorite = ""; // optional String mediaComments = ""; // optional - if(deplMin[0].isAfter(photo.date)) { - deplMin[0] = photo.date; + if(deplRange[0].isAfter(photo.date)) { + deplRange[0] = photo.date; } - if(deplMax[0].isBefore(photo.date)) { - deplMax[0] = photo.date; + if(deplRange[1].isBefore(photo.date)) { + deplRange[1] = photo.date; } LocalDateTime[] range = rangeMap.get(photo.location); @@ -431,12 +430,14 @@ public void run() { json.key("profile"); json.value("https://raw.githubusercontent.com/tdwg/camtrap-dp/1.0.1/camtrap-dp-profile.json"); json.key("created"); - json.value(LocalDateTime.now().toString()); + json.value(localDateTimeToString(LocalDateTime.now())); json.key("contributors"); json.array(); json.object(); json.key("title"); json.value("PhotoDB"); + json.key("role"); + json.value("publisher"); json.endObject(); json.endArray(); json.key("project"); @@ -469,9 +470,9 @@ public void run() { json.key("temporal"); json.object(); json.key("start"); - json.value(localDateTimeToString(deplMin[0])); + json.value(localDateTimeToString(deplRange[0])); json.key("end"); - json.value(localDateTimeToString(deplMax[0])); + json.value(localDateTimeToString(deplRange[1])); json.endObject(); json.key("taxonomic"); json.array(); diff --git a/src/util/yaml/YamlMap.java b/src/util/yaml/YamlMap.java index ff17d2d..e8ea56b 100644 --- a/src/util/yaml/YamlMap.java +++ b/src/util/yaml/YamlMap.java @@ -17,13 +17,9 @@ import java.util.function.IntConsumer; import java.util.function.Supplier; - -import org.tinylog.Logger; - import util.collections.ReadonlyList; -public class YamlMap { - +public class YamlMap { public static final YamlMap EMPTY_MAP = new YamlMap(new HashMap<>());