Fixed timeseries record creation

This commit is contained in:
Luca Frosini 2024-04-08 14:24:16 +02:00
parent ce259b0dac
commit fa0b54ebf8
1 changed files with 3 additions and 1 deletions

View File

@ -75,6 +75,7 @@ public abstract class Record extends CKANPackage {
public static final String TIMESERIES_ELEMENT_FILENAME_PROPERTY = "filename";
public static final String TIMESERIES_MIMETYPE = "text/csv";
public static final String TIMESERIES_FORMAT = "CSV";
public static final String TYPE_QUERY_FILTER_KEY = "extras_systemtype";
@ -328,9 +329,10 @@ public abstract class Record extends CKANPackage {
ObjectNode resourceNode = objectMapper.createObjectNode();
resourceNode.put(NAME_PROPERTY, fileName);
resourceNode.put(NAME_PROPERTY, fileName.replace(".csv", ""));
resourceNode.put(RESOURCE_ELEMENT_URL_PROPERTY, url.toString());
resourceNode.put(CKANResource.MIME_TYPE_KEY, TIMESERIES_MIMETYPE);
resourceNode.put(CKANResource.FORMAT_KEY, TIMESERIES_FORMAT);
resources.add(resourceNode);
((ObjectNode)jsonNode).replace(RESOURCES_PROPERTY, resources);