From 84f1cde1fd68c0adc2047660d9bec2d01b3d05b3 Mon Sep 17 00:00:00 2001 From: amber Date: Wed, 19 Nov 2025 16:32:09 +1100 Subject: [PATCH 1/4] update email template --- .../enumeration/DatasetDownloadEnums.java | 2 +- .../ogcapi/server/core/util/EmailUtils.java | 330 +++-- .../ogcapi/server/processes/RestServices.java | 11 +- server/src/main/resources/img/download.txt | 1 - .../src/main/resources/job-started-email.html | 1247 +++++++++++++---- .../server/core/util/EmailUtilsTest.java | 6 +- 6 files changed, 1238 insertions(+), 359 deletions(-) delete mode 100644 server/src/main/resources/img/download.txt diff --git a/server/src/main/java/au/org/aodn/ogcapi/server/core/model/enumeration/DatasetDownloadEnums.java b/server/src/main/java/au/org/aodn/ogcapi/server/core/model/enumeration/DatasetDownloadEnums.java index ea6d7878..bb1746d5 100644 --- a/server/src/main/java/au/org/aodn/ogcapi/server/core/model/enumeration/DatasetDownloadEnums.java +++ b/server/src/main/java/au/org/aodn/ogcapi/server/core/model/enumeration/DatasetDownloadEnums.java @@ -42,7 +42,7 @@ public enum Type { @Getter public enum JobDefinition { - GENERATE_CSV_DATA_FILE("generate-csv-data-file"); + GENERATE_CSV_DATA_FILE("generate-csv-data-file-dev"); private final String value; diff --git a/server/src/main/java/au/org/aodn/ogcapi/server/core/util/EmailUtils.java b/server/src/main/java/au/org/aodn/ogcapi/server/core/util/EmailUtils.java index 4386410f..60701305 100644 --- a/server/src/main/java/au/org/aodn/ogcapi/server/core/util/EmailUtils.java +++ b/server/src/main/java/au/org/aodn/ogcapi/server/core/util/EmailUtils.java @@ -21,6 +21,7 @@ public class EmailUtils { /** * Read a base64 encoded image from resources + * * @param filename - the filename in /img/ directory * @return base64 encoded image as data URL * @throws IOException if resource not found @@ -93,6 +94,7 @@ public static String generateSubsettingSection( /** * Generate HTML content for bounding box data only (without wrapper) + * * @param multipolygon - the multipolygon object * @param objectMapper - Jackson ObjectMapper for JSON processing * @return HTML string for bbox data rows @@ -293,95 +295,183 @@ private static List>>> extractCoordinates(Object mult * Build the subsetting section header */ private static String buildSubsettingHeader() { - return "" + - "
" + - "" + - "" + + "" + + "" + + "
" + - "" + - "
" + + return "" + + "
" + + "" + + "" + + "" + + "
" + + "" + + "
" + "" + - "" + + "" + + "
" + + "
" + "" + - "
" + - "
" + - "
" + - "

Subsetting for this collection:

" + - "
" + - "
" + - "" + - "
" + - "
" + - "" + - "
" + - "
" + - "" + - "" + - "
" + - "
"; + "
" + + "" + + "" + + "" + + "" + + "
" + + "
" + + "

Subsetting for this collection

" + + "
" + + "
" + + "
" + + "" + + "" + + "" + + "" + + "
" + + "" + + "" + + "" + + "" + + "" + + "" + + ""; } /** * Build bbox wrapper with table structure */ private static String buildBboxWrapper(String bboxContent) { - return "" + - "
" + - "" + - "" + bboxContent + "" + + "
" + - "" + - "
" + + return "
" + + "" + + "" + + "" + + "
" + + "" + + "
" + "" + - "" + bboxContent + "
" + - "
"; + "
" + + "
" + + "" + + "" + + "" + + "" + + "" + + "" + + ""; } /** * Build spacer section between bbox and time range */ private static String buildSpacerSection() { - return "" + - "
" + - "" + + "" + + "" + + "
" + - "" + + return "
" + + "" + + "" + + "" + + "
" + + "" + "
" + - "
" + - "" + - "" + - "
" + - "
"; + "" + + "" + + "" + + "" + + "" + + "" + + "
" + + "" + + "" + + "" + + "" + + "" + + "" + + "
" + + "
" + + "
" + + "
" + + "" + + "" + + "
" + + "
" + + ""; } /** * Build time range wrapper with content */ private static String buildTimeRangeWrapper(String startDate, String endDate) { - return "" + - "
" + - "" + - "" + + "" + + "
" + - "" + - "
" + + return "
" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "
" + + "" + + "
" + "" + - "" + + "" + + "" + + "" + + "
" + + "
" + "" + - "" + + "" + + "" + "" + "" + - "" + - "" + + "" + + "
" + - "
" + - "
" + + "" + + "" + + "" + + "" + + "
" + + "
" + - "" + - "
" + + "" + + "" + + "
" + "
" + - "

Time Range

" + + "

Time Range

" + + "" + + "
" + + "
" + + "
" + + "
" + + "
" + "" + - "
" + - "" + + "" + - "
" + + "
" + + "" + + "" + + "
" + "
" + - "

"+startDate+" - "+endDate+"

" + - "
"; + "

" + startDate + " - " + endDate + "

" + + "
" + + "
" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "
" + + "" + + "" + + "" + + "" + + "" + + "" + + ""; } protected static String buildBboxSection(String north, String south, String west, String east, int index) { @@ -390,41 +480,107 @@ protected static String buildBboxSection(String north, String south, String west return "" + "" + "" + - "" + + "" + + "" + "" + "" + - "" + - "" + + "" + + "
" + - "
" + - "
" + + "" + + "" + + "" + + "" + + "
" + + "
" + - "" + - "
" + + "" + + "" + + "
" + "
" + - "

" + title + "

" + + "

" + title + "

" + + "" + + "
" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "
" + + "" + + "" + + "" + + "" + "" + - "" + + "

E: " + east + "

" + + "" + + "" + + "" + + "
" + - "" + + "" + - "" + - "" + + "" + + "" + + "" + + "" + + "" + + "" + - "" + - "" + + "" + + "" + + "" + + "" + + "" + + "" + - "" + - "" + + "" + + "" + + "" + + "" + + "" + + "" + - "
" + + "
" + + "" + + "" + + "
" + "
" + - "

N: " + north + "

" + - "
" + - "" + + "" + + "
" + + "

N: " + north + "

" + + "" + + "
" + + "
" + + "
" + + "
" + + "" + + "" + + "
" + "
" + - "

S: " + south + "

" + - "
" + - "" + + "" + + "
" + + "

S: " + south + "

" + + "" + + "
" + + "
" + + "
" + + "
" + + "" + + "" + + "
" + "
" + - "

W: " + west + "

" + - "
" + - "" + + "" + + "
" + + "

W: " + west + "

" + + "" + + "
" + + "
" + + "
" + + "
" + + "" + + "" + + "
" + "
" + - "

E: " + east + "

" + + "" + + "" + + "" + + "" + ""; } } diff --git a/server/src/main/java/au/org/aodn/ogcapi/server/processes/RestServices.java b/server/src/main/java/au/org/aodn/ogcapi/server/processes/RestServices.java index 22faea8a..46c50771 100644 --- a/server/src/main/java/au/org/aodn/ogcapi/server/processes/RestServices.java +++ b/server/src/main/java/au/org/aodn/ogcapi/server/processes/RestServices.java @@ -157,20 +157,17 @@ private String generateStartedEmailContent( // Replace all variables in one chain return template - .replace("{{uuid}}", uuid) + .replace("{{HEADER_IMG}}", EmailUtils.readBase64Image("header.txt")) .replace("{{collectionTitle}}", collectionTitle != null ? collectionTitle : "") - .replace("{{fullMetadataLink}}", fullMetadataLink != null ? fullMetadataLink : "") - .replace("{{suggestedCitation}}", suggestedCitation != null ? suggestedCitation : "") .replace("{{subsettingSection}}", subsettingSection) - .replace("{{HEADER_IMG}}", EmailUtils.readBase64Image("header.txt")) - .replace("{{DOWNLOAD_ICON}}", EmailUtils.readBase64Image("download.txt")) .replace("{{BBOX_IMG}}", EmailUtils.readBase64Image("bbox.txt")) .replace("{{TIME_RANGE_IMG}}", EmailUtils.readBase64Image("time-range.txt")) .replace("{{ATTRIBUTES_IMG}}", EmailUtils.readBase64Image("attributes.txt")) - .replace("{{FACEBOOK_IMG}}", EmailUtils.readBase64Image("facebook.txt")) + .replace("{{fullMetadataLink}}", fullMetadataLink != null ? fullMetadataLink : "") + .replace("{{suggestedCitation}}", suggestedCitation != null ? suggestedCitation : "") .replace("{{INSTAGRAM_IMG}}", EmailUtils.readBase64Image("instagram.txt")) + .replace("{{FACEBOOK_IMG}}", EmailUtils.readBase64Image("facebook.txt")) .replace("{{BLUESKY_IMG}}", EmailUtils.readBase64Image("bluesky.txt")) - .replace("{{CONTACT_IMG}}", EmailUtils.readBase64Image("email.txt")) .replace("{{LINKEDIN_IMG}}", EmailUtils.readBase64Image("linkedin.txt")); } catch (IOException e) { diff --git a/server/src/main/resources/img/download.txt b/server/src/main/resources/img/download.txt deleted file mode 100644 index a2fd9763..00000000 --- a/server/src/main/resources/img/download.txt +++ /dev/null @@ -1 +0,0 @@ -iVBORw0KGgoAAAANSUhEUgAAACwAAAAsBAMAAADsqkcyAAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAAAJcEhZcwAAFiUAABYlAUlSJPAAAAAtUExURUdwTP///////////////////////////////////////////////////////81e3QIAAAAOdFJOUwBLix7f7oAyxHFCfmCosRnbLAAAALBJREFUKM9jYKAqMBQUXIwpyhz37t0TAwxhtndAkIAhzAQSVhjWwuzb0jJAwm1p2cjBwvIODgKQhDkQwg7IoeoHE0UNWxOYsDNqJPhhU8zAYIpNMdCJcSDRpwXo3ikFCYdj+JILJLwAM+qPvnv3EEs64Xz3bgK29HPuJdZkxV7AQGXAGfcOAzzZwLDvHRbwksEPm/BThndYAUMcdtV92ITfIqILGTQzMCwUxADi1PE7AEkbCZHrk71RAAAAAElFTkSuQmCC diff --git a/server/src/main/resources/job-started-email.html b/server/src/main/resources/job-started-email.html index e5c8cb20..dfbfa9c8 100644 --- a/server/src/main/resources/job-started-email.html +++ b/server/src/main/resources/job-started-email.html @@ -1,14 +1,13 @@ - AODN Portal Dataset Download + @@ -35,51 +33,36 @@ - @@ -121,12 +105,12 @@ -
AODN Portal Dataset Download
- -
- + +
+
- -
- - - - - - -
- - - -
-
-
- -
+ +
@@ -187,90 +163,259 @@
- -
- + + + + +
+
+ +
+ + + +
+ +
+ - - - -
- - - +
+ +
+ + + + + + +
+
+

Hi,

+

 

+

Your AODN data download request has been received. When your data request is ready, an email will be sent with a link for you to download the data.

+
+
+
+
- -
-
- -
- - - - +
- -
- + +
+
- + + +
- -
+
+ +
- + + +
-

Hi,

 

Your AODN data download request has been received. When your data request is ready, an email will be sent with a link for you to download the data.

 

+
+ + + + +
+ + + + +
+
+

Collection

+
+
+
+
+
+ +
+
+ +
+ + + +
+ +
+ + + +
+ + + + + + +
- +
- -
- + +
+
- -
+ +
- + + +

Collection: {{collectionTitle}}

+ + + + +
+
+

{{collectionTitle}}

+
+
+
- +
- -
+ +
- +
@@ -290,20 +435,96 @@
- +
+ -
+
+ + + - - -
+ +
+ + + + + + +
+ +
+ + + + + + +
+ + + + +
+ + + + +
+
+

Metadata link: {{fullMetadataLink}}

+
+
+
+
+
+ +
+
+ +
- +
@@ -323,19 +544,95 @@
- +
- -
+ +
+ + + + + + +
+ +
+ + + + + + +
+ + + + +
+ + + + +
+
+

Suggested Citation

+
+
+
+
+
+ +
+
+ +
- +
@@ -355,71 +652,203 @@
- +
- -
- + +
+
- + + +
- -
+
+ +
+ + +
- + + + +

Metadata Link: {{fullMetadataLink}}

+ + + + +
+
+

{{suggestedCitation}}

+
+
+
+
+
+ +
+
+ +
+ + + +
+ +
+ + + +
+ + + + + +
- +
- -
- + +
+
-
- -
+
+ +
-
-
-

{{suggestedCitation}}

-
+
+ + + + +
+ + + + +
+
+

Usage Constrains

+
+
+
- +
- -
+ +
- +
@@ -439,96 +868,332 @@
- +
- -
- + +
+
-
- -
+
+ +
-
-

If you require assistance with this service please contact us with info@aodn.org.au.

 

Kind regards,

Australian Ocean Data Network

+
+ + + + +
+ + + + +
+
+

Any users of IMOS data are required to clearly acknowledge the source of the material derived from IMOS in the format: "Data was sourced from Australia's Integrated Marine Observing System (IMOS) - IMOS is enabled by the National Collaborative Research Infrastructure strategy (NCRIS)." If relevant, also credit other organisations involved in collection of this particular datastream (as listed in 'credit' in the metadata record).

+
+
+
- +
- -
- - -
- - - -
- -
- + +
+
-
- - - +
+ +
+ + + + + + +
+ + + + + + +
+
+
+
- -
- + +
+
- + + +
- - + + + +
+ +
+ + + + + + +
+ + + + +
+ + + + +
+
+

If using data from the Ningaloo (TAN100) mooring, please add to the citation - "Department of Jobs, Tourism, Science and Innovation (DJTSI), Western Australian Government". If using data from the Ocean Reference Station 65m (ORS065) mooring, please add to the citation - "Sydney Water Corporation".

+

Data, products and services from IMOS are provided "as is" without any warranty as to fitness for a particular purpose. By using this data you are accepting the license agreement and terms specified above. You accept all risks and responsibility for losses, damages, costs and other consequences resulting directly or indirectly from using this site and any information or material available from it.

+
+
+
+
+
+ +
+ + +
+ + + + + + +
+ +
+ + + + + + +
+ + + + + + +
+
+
+ +
+
+ +
+ + + +
+ +
+ + + + + + +
+
+

The download will be available for 7 days.

+

If you require assistance with this service please contact us with info@aodn.org.au.

+

 

+

Kind regards,

+

Australian Ocean Data Network

+
+
+
+
- -
+ +
+
+ +
+ + + +
+ +
- @@ -536,48 +1201,75 @@
+ + + + + + +
+
+

The Australian Ocean Data Network (AODN) stands at the forefront of marine data management in Australia, providing an essential infrastructure for the discovery, sharing and reuse of comprehensive marine and climate data. Our commitment to making these data freely available underscores our dedication to fostering an informed and engaged public, promoting sustainable environmental practices and driving economic growth through innovation.

+
+
- +
- -
- + +
+
" + - "" + + "" + "" + - "" + + "" + "
- -
+ +
- - +
- -
+ +
- +
- @@ -587,22 +1279,27 @@
- -
+ +
- - +
- +
@@ -624,23 +1321,28 @@
- -
+ +
- - +
- -
+ +
@@ -661,23 +1363,28 @@
- -
+ +
- - +
- -
+ +
@@ -698,57 +1405,67 @@
- -
+ +
- - +
- +
- -
- + +
+
@@ -480,7 +480,7 @@ @@ -588,7 +588,7 @@ @@ -804,7 +804,7 @@ From df80ad35ac71db6becb8a09439e251b409217c92 Mon Sep 17 00:00:00 2001 From: amber Date: Wed, 19 Nov 2025 17:19:27 +1100 Subject: [PATCH 3/4] remove grey block --- .../java/au/org/aodn/ogcapi/server/core/util/EmailUtils.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/src/main/java/au/org/aodn/ogcapi/server/core/util/EmailUtils.java b/server/src/main/java/au/org/aodn/ogcapi/server/core/util/EmailUtils.java index 60701305..b8b8b110 100644 --- a/server/src/main/java/au/org/aodn/ogcapi/server/core/util/EmailUtils.java +++ b/server/src/main/java/au/org/aodn/ogcapi/server/core/util/EmailUtils.java @@ -422,7 +422,7 @@ private static String buildTimeRangeWrapper(String startDate, String endDate) { "" + "
- +
-

Collection

+

Collection

-

Metadata link: {{fullMetadataLink}}

+

Metadata link: {{fullMetadataLink}}

-

Suggested Citation

+

Suggested Citation

-

Usage Constrains

+

Usage Constrains

" + "
" + "" + "" + @@ -488,7 +488,7 @@ protected static String buildBboxSection(String north, String south, String west "" + "
" + "
" + "" + "" + From 9deeefa89ba47d2d9b08faf6e78cc1f230826d6a Mon Sep 17 00:00:00 2001 From: amber Date: Wed, 19 Nov 2025 17:28:16 +1100 Subject: [PATCH 4/4] remove dev --- .../server/core/model/enumeration/DatasetDownloadEnums.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/src/main/java/au/org/aodn/ogcapi/server/core/model/enumeration/DatasetDownloadEnums.java b/server/src/main/java/au/org/aodn/ogcapi/server/core/model/enumeration/DatasetDownloadEnums.java index bb1746d5..ea6d7878 100644 --- a/server/src/main/java/au/org/aodn/ogcapi/server/core/model/enumeration/DatasetDownloadEnums.java +++ b/server/src/main/java/au/org/aodn/ogcapi/server/core/model/enumeration/DatasetDownloadEnums.java @@ -42,7 +42,7 @@ public enum Type { @Getter public enum JobDefinition { - GENERATE_CSV_DATA_FILE("generate-csv-data-file-dev"); + GENERATE_CSV_DATA_FILE("generate-csv-data-file"); private final String value;