Repository: gisaia/ARLAS-server (language: python)

Issue:
Add a new endpoint to patch the display_names of the fields and shape fields of a given collection
Under the collections API :
- [x] add a `PATCH /collections/{collection}/display_names/fields` . The body is a json map: field_path->field_display_name
- [x] add a `PATCH /collections/{collection}/display_names/shape_columns`. The body is a json map: field_path->field_shape_name

The endpoint shall return the new collection.


Discussion / hints:

Fix patch:
diff --git a/Dockerfile b/Dockerfile
index ac84b870f..00b951a80 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -17,7 +17,7 @@ RUN mvn install \
 ###################
 # PACKAGING STAGE #
 ###################
-FROM gisaia/arlas-openjdk-17-distroless:20240821142139
+FROM gisaia/arlas-openjdk-17-distroless:20240926175122
 
 # application placed into /opt/app
 WORKDIR /opt/app
diff --git a/Dockerfile-package-only b/Dockerfile-package-only
index ae1770203..d8a2dd26f 100644
--- a/Dockerfile-package-only
+++ b/Dockerfile-package-only
@@ -1,7 +1,7 @@
 ###################
 # PACKAGING STAGE #
 ###################
-FROM gisaia/arlas-openjdk-17-distroless:20240821142139
+FROM gisaia/arlas-openjdk-17-distroless:20240926175122
 
 # application placed into /opt/app
 WORKDIR /opt/app
diff --git a/arlas-core/src/main/java/io/arlas/server/core/model/CollectionReference.java b/arlas-core/src/main/java/io/arlas/server/core/model/CollectionReference.java
index 8bec88055..d10858685 100644
--- a/arlas-core/src/main/java/io/arlas/server/core/model/CollectionReference.java
+++ b/arlas-core/src/main/java/io/arlas/server/core/model/CollectionReference.java
@@ -42,6 +42,7 @@ public class CollectionReference implements Serializable {
     public static final String DISPLAY_NAMES = "display_names";
     public static final String COLLECTION_DISPLAY_NAME = "collection";
     public static final String FIELD_DISPLAY_NAME = "fields";
+    public static final String SHAPE_COLUMN_DISPLAY_NAME = "shape_columns";
     public static final String ORGANISATIONS = "organisations";
     public static final String ORGANISATIONS_OWNER = "owner";
     public static final String ORGANISATIONS_SHARED = "shared";
diff --git a/arlas-core/src/main/java/io/arlas/server/core/services/CollectionReferenceService.java b/arlas-core/src/main/java/io/arlas/server/core/services/CollectionReferenceService.java
index 380291709..a810db93c 100644
--- a/arlas-core/src/main/java/io/arlas/server/core/services/CollectionReferenceService.java
+++ b/arlas-core/src/main/java/io/arlas/server/core/services/CollectionReferenceService.java
@@ -109,9 +109,10 @@ public CollectionReference putCollectionReference(CollectionReference collection
         return collectionReference;
     }
 
-    public CollectionReference updateCollectionDisplayNameCollectionReference(String collection,
-                                                          String organisations,
-                                                          String columnFilter, String displayName)
+    public CollectionReference updateDisplayNamesCollectionReference(String collection, String organisations,String columnFilter,
+                                                                     String collectionDisplayName,
+                                                                           Map<String,String> fieldsDisplayNames,
+                                                                           Map<String,String> shapeColumnsDisplayNames)
             throws ArlasException {
         CollectionReference collectionReference = getCollectionReference(collection, Optional.ofNullable(organisations));
         ColumnFilterUtil.assertCollectionsAllowed(Optional.ofNullable(columnFilter), List.of(collectionReference));
@@ -119,11 +120,16 @@ public CollectionReference updateCollectionDisplayNameCollectionReference(String
         if (collectionReference.params.collectionDisplayNames == null) {
             collectionReference.params.collectionDisplayNames = new CollectionDisplayNames();
         }
-        collectionReference.params.collectionDisplayNames.collection = displayName;
-        putCollectionReferenceWithDao(collectionReference);
-        cacheManager.removeCollectionReference(collectionReference.collectionName);
-        cacheManager.removeMapping(collectionReference.params.indexName);
-        return collectionReference;
+        if(fieldsDisplayNames != null){
+            collectionReference.params.collectionDisplayNames.fields = fieldsDisplayNames;
+        }
+        if(shapeColumnsDisplayNames != null){
+            collectionReference.params.collectionDisplayNames.shapeColumns = shapeColumnsDisplayNames;
+        }
+        if(collectionDisplayName != null){
+            collectionReference.params.collectionDisplayNames.collection = collectionDisplayName;
+        }
+        return putCollectionReference(collectionReference, true);
     }
 
     public CollectionReference updateOrganisationsParamsCollectionReference(String collection,
@@ -137,10 +143,7 @@ public CollectionReference updateOrganisationsParamsCollectionReference(String c
         checkIfAllowedForOrganisations(collectionReference, Optional.ofNullable(organisations), true);
         collectionReference.params.collectionOrganisations.isPublic = isPublic;
         collectionReference.params.collectionOrganisations.sharedWith = sharedWith;
-        putCollectionReferenceWithDao(collectionReference);
-        cacheManager.removeCollectionReference(collectionReference.collectionName);
-        cacheManager.removeMapping(collectionReference.params.indexName);
-        return collectionReference;
+        return putCollectionReference(collectionReference, true);
     }
 
     public List<CollectionReferenceDescription> describeAllCollections(List<CollectionReference> collectionReferenceList,
diff --git a/arlas-rest/src/main/java/io/arlas/server/rest/collections/CollectionService.java b/arlas-rest/src/main/java/io/arlas/server/rest/collections/CollectionService.java
index f1e7c0a92..54718fb56 100644
--- a/arlas-rest/src/main/java/io/arlas/server/rest/collections/CollectionService.java
+++ b/arlas-rest/src/main/java/io/arlas/server/rest/collections/CollectionService.java
@@ -389,7 +389,110 @@ public Response patchCollectionDisplayName(
         if (collection != null && collection.equals(META_COLLECTION_NAME)) {
             throw new NotAllowedException("'" + META_COLLECTION_NAME + "' cannot be updated");
         }
-        return ResponseFormatter.getResultResponse(collectionReferenceService.updateCollectionDisplayNameCollectionReference(collection, organisations, columnFilter,collectionDisplayName ));
+        return ResponseFormatter.getResultResponse(collectionReferenceService.updateDisplayNamesCollectionReference(collection, organisations, columnFilter,collectionDisplayName, null, null ));
+    }
+
+
+    @Timed
+    @Path("{collection}/display_names/fields")
+    @PATCH
+    @Produces(UTF8JSON)
+    @Consumes(UTF8JSON)
+    @Operation(
+            summary = "Update a collection reference's display fields name attribute.",
+            description = "Update a collection reference's display fields name attribute."
+    )
+    @ApiResponses(value = {
+            @ApiResponse(responseCode = "200", description = "Successful operation",
+                    content = @Content(schema = @Schema(implementation = CollectionReference.class))),
+            @ApiResponse(responseCode = "400", description = "JSON parameter malformed.",
+                    content = @Content(schema = @Schema(implementation = Error.class))),
+            @ApiResponse(responseCode = "404", description = "Collection not found.",
+                    content = @Content(schema = @Schema(implementation = Error.class))),
+            @ApiResponse(responseCode = "500", description = "Arlas Server Error.",
+                    content = @Content(schema = @Schema(implementation = Error.class)))
+    })
+    public Response patchFieldsDisplayNames(
+            @Context HttpHeaders headers,
+            @Parameter(name = "collection",
+                    description = "collection",
+                    required = true)
+            @PathParam(value = "collection") String collection,
+
+            @Parameter(name = "fieldsDisplayNames",
+                    description = "fieldsDisplayNames",
+                    required = true)
+            @NotNull Map<String,String> fieldsDisplayNames,
+
+            @Parameter(hidden = true)
+            @HeaderParam(value = COLUMN_FILTER) String columnFilter,
+
+            @Parameter(hidden = true)
+            @HeaderParam(value = ARLAS_ORGANISATION) String organisations,
+            // --------------------------------------------------------
+            // ----------------------- FORM -----------------------
+            // --------------------------------------------------------
+            @Parameter(name = "pretty",
+                    description = Documentation.FORM_PRETTY,
+                    schema = @Schema(defaultValue = "false"))
+            @QueryParam(value = "pretty") Boolean pretty
+
+    ) throws ArlasException {
+        if (collection != null && collection.equals(META_COLLECTION_NAME)) {
+            throw new NotAllowedException("'" + META_COLLECTION_NAME + "' cannot be updated");
+        }
+        return ResponseFormatter.getResultResponse(collectionReferenceService.updateDisplayNamesCollectionReference(collection, organisations, columnFilter, null, fieldsDisplayNames, null ));
+    }
+
+    @Timed
+    @Path("{collection}/display_names/shape_columns")
+    @PATCH
+    @Produces(UTF8JSON)
+    @Consumes(UTF8JSON)
+    @Operation(
+            summary = "Update a collection reference's display shape columns name attribute.",
+            description = "Update a collection reference's display shape columns name attribute."
+    )
+    @ApiResponses(value = {
+            @ApiResponse(responseCode = "200", description = "Successful operation",
+                    content = @Content(schema = @Schema(implementation = CollectionReference.class))),
+            @ApiResponse(responseCode = "400", description = "JSON parameter malformed.",
+                    content = @Content(schema = @Schema(implementation = Error.class))),
+            @ApiResponse(responseCode = "404", description = "Collection not found.",
+                    content = @Content(schema = @Schema(implementation = Error.class))),
+            @ApiResponse(responseCode = "500", description = "Arlas Server Error.",
+                    content = @Content(schema = @Schema(implementation = Error.class)))
+    })
+    public Response patchShapeColumnsDisplayNames(
+            @Context HttpHeaders headers,
+            @Parameter(name = "collection",
+                    description = "collection",
+                    required = true)
+            @PathParam(value = "collection") String collection,
+
+            @Parameter(name = "shapeColumnsDisplayNames",
+                    description = "shapeColumnsDisplayNames",
+                    required = true)
+            @NotNull Map<String,String> shapeColumnsDisplayNames,
+
+            @Parameter(hidden = true)
+            @HeaderParam(value = COLUMN_FILTER) String columnFilter,
+
+            @Parameter(hidden = true)
+            @HeaderParam(value = ARLAS_ORGANISATION) String organisations,
+            // --------------------------------------------------------
+            // ----------------------- FORM -----------------------
+            // --------------------------------------------------------
+            @Parameter(name = "pretty",
+                    description = Documentation.FORM_PRETTY,
+                    schema = @Schema(defaultValue = "false"))
+            @QueryParam(value = "pretty") Boolean pretty
+
+    ) throws ArlasException {
+        if (collection != null && collection.equals(META_COLLECTION_NAME)) {
+            throw new NotAllowedException("'" + META_COLLECTION_NAME + "' cannot be updated");
+        }
+        return ResponseFormatter.getResultResponse(collectionReferenceService.updateDisplayNamesCollectionReference(collection, organisations, columnFilter,null,null,shapeColumnsDisplayNames ));
     }
 
     public CollectionReference save(String collection, CollectionReferenceParameters collectionReferenceParameters,


Test patch:
diff --git a/arlas-tests/src/test/java/io/arlas/server/tests/rest/collections/CollectionServiceIT.java b/arlas-tests/src/test/java/io/arlas/server/tests/rest/collections/CollectionServiceIT.java
index 663c339f9..1f6f13eda 100644
--- a/arlas-tests/src/test/java/io/arlas/server/tests/rest/collections/CollectionServiceIT.java
+++ b/arlas-tests/src/test/java/io/arlas/server/tests/rest/collections/CollectionServiceIT.java
@@ -412,7 +412,7 @@ public void test09Organisations() throws Exception {
 
 
     @Test
-    public void test10DisplayName() throws Exception {
+    public void test10CollectionDisplayName() throws Exception {
         Map<String, Object> jsonAsMap = getJsonAsMap("bar.com", null, false);
         jsonAsMap.put(CollectionReference.INSPIRE_PATH, getInspireJsonAsMap());
         jsonAsMap.put(CollectionReference.DUBLIN_CORE_PATH, getDublinJsonAsMap());
@@ -462,6 +462,227 @@ public void test10DisplayName() throws Exception {
 
     }
 
+    @Test
+    public void test11FieldsDisplayName() throws Exception {
+        Map<String, Object> jsonAsMap = getJsonAsMap("bar.com", null, false);
+        jsonAsMap.put(CollectionReference.INSPIRE_PATH, getInspireJsonAsMap());
+        jsonAsMap.put(CollectionReference.DUBLIN_CORE_PATH, getDublinJsonAsMap());
+        jsonAsMap.put(CollectionReference.DISPLAY_NAMES, getCollectionDescriptionJsonAsMap());
+        // PUT new collection
+        given().contentType("application/json")
+                .body(jsonAsMap)
+                .when().put(arlasPath + "collections/bar")
+                .then().statusCode(200);
+
+        // GET collection
+        when().get(arlasPath + "collections/bar")
+                .then().statusCode(200)
+                .body("collection_name", equalTo("bar"))
+                .body("params.index_name", equalTo(DataSetTool.DATASET_INDEX_NAME))
+                .body("params.id_path", equalTo(DataSetTool.DATASET_ID_PATH))
+                .body("params.geometry_path", equalTo(DataSetTool.DATASET_GEOMETRY_PATH))
+                .body("params.centroid_path", equalTo(DataSetTool.DATASET_CENTROID_PATH))
+                .body("params.timestamp_path", equalTo(DataSetTool.DATASET_TIMESTAMP_PATH))
+                .body("params.exclude_fields", equalTo(DataSetTool.DATASET_EXCLUDE_FIELDS))
+                .body("params.exclude_wfs_fields", equalTo(DataSetTool.DATASET_EXCLUDE_WFS_FIELDS))
+                .body("params.organisations.owner", equalTo("bar.com"))
+                .body("params.organisations.shared", hasSize(0))
+                .body("params.organisations.public", equalTo(Boolean.FALSE))
+                .body("params.display_names.collection", equalTo(DataSetTool.DATASET_COLLECTION_DISPLAY_NAME))
+                .body("params.display_names.fields.id", equalTo(DataSetTool.DATASET_ID_DESC))
+                .body("params.display_names.shape_columns.id", equalTo(DataSetTool.DATASET_ID_DESC));
+        Map<String, String> newFieldsNames = new HashMap<>();
+        newFieldsNames.put(DataSetTool.DATASET_ID_PATH,"new_id");
+
+        // PATCH collection display name
+        given().contentType("application/json")
+                .body(newFieldsNames)
+                .when().patch(arlasPath + "collections/bar/display_names/fields")
+                .then().statusCode(200)
+                .body("collection_name", equalTo("bar"))
+                .body("params.index_name", equalTo(DataSetTool.DATASET_INDEX_NAME))
+                .body("params.id_path", equalTo(DataSetTool.DATASET_ID_PATH))
+                .body("params.geometry_path", equalTo(DataSetTool.DATASET_GEOMETRY_PATH))
+                .body("params.centroid_path", equalTo(DataSetTool.DATASET_CENTROID_PATH))
+                .body("params.timestamp_path", equalTo(DataSetTool.DATASET_TIMESTAMP_PATH))
+                .body("params.exclude_fields", equalTo(DataSetTool.DATASET_EXCLUDE_FIELDS))
+                .body("params.exclude_wfs_fields", equalTo(DataSetTool.DATASET_EXCLUDE_WFS_FIELDS))
+                .body("params.organisations.owner", equalTo("bar.com"))
+                .body("params.organisations.shared", hasSize(0))
+                .body("params.organisations.public", equalTo(Boolean.FALSE))
+                .body("params.display_names.collection", equalTo(DataSetTool.DATASET_COLLECTION_DISPLAY_NAME))
+                .body("params.display_names.fields.id", equalTo("new_id"))
+                .body("params.display_names.shape_columns.id", equalTo(DataSetTool.DATASET_ID_DESC));
+
+        // DELETE collection
+        when().delete(arlasPath + "collections/bar")
+                .then().statusCode(200);
+
+    }
+
+
+    @Test
+    public void test12FieldsDisplayName() throws Exception {
+        Map<String, Object> jsonAsMap = getJsonAsMap("bar.com", null, false);
+        jsonAsMap.put(CollectionReference.INSPIRE_PATH, getInspireJsonAsMap());
+        jsonAsMap.put(CollectionReference.DUBLIN_CORE_PATH, getDublinJsonAsMap());
+        // PUT new collection
+        given().contentType("application/json")
+                .body(jsonAsMap)
+                .when().put(arlasPath + "collections/bar")
+                .then().statusCode(200);
+
+        // GET collection
+        when().get(arlasPath + "collections/bar")
+                .then().statusCode(200)
+                .body("collection_name", equalTo("bar"))
+                .body("params.index_name", equalTo(DataSetTool.DATASET_INDEX_NAME))
+                .body("params.id_path", equalTo(DataSetTool.DATASET_ID_PATH))
+                .body("params.geometry_path", equalTo(DataSetTool.DATASET_GEOMETRY_PATH))
+                .body("params.centroid_path", equalTo(DataSetTool.DATASET_CENTROID_PATH))
+                .body("params.timestamp_path", equalTo(DataSetTool.DATASET_TIMESTAMP_PATH))
+                .body("params.exclude_fields", equalTo(DataSetTool.DATASET_EXCLUDE_FIELDS))
+                .body("params.exclude_wfs_fields", equalTo(DataSetTool.DATASET_EXCLUDE_WFS_FIELDS))
+                .body("params.organisations.owner", equalTo("bar.com"))
+                .body("params.organisations.shared", hasSize(0))
+                .body("params.organisations.public", equalTo(Boolean.FALSE));
+        Map<String, String> newFieldsNames = new HashMap<>();
+        newFieldsNames.put(DataSetTool.DATASET_ID_PATH,"new_id");
+
+        // PATCH collection display name
+        given().contentType("application/json")
+                .body(newFieldsNames)
+                .when().patch(arlasPath + "collections/bar/display_names/fields")
+                .then().statusCode(200)
+                .body("collection_name", equalTo("bar"))
+                .body("params.index_name", equalTo(DataSetTool.DATASET_INDEX_NAME))
+                .body("params.id_path", equalTo(DataSetTool.DATASET_ID_PATH))
+                .body("params.geometry_path", equalTo(DataSetTool.DATASET_GEOMETRY_PATH))
+                .body("params.centroid_path", equalTo(DataSetTool.DATASET_CENTROID_PATH))
+                .body("params.timestamp_path", equalTo(DataSetTool.DATASET_TIMESTAMP_PATH))
+                .body("params.exclude_fields", equalTo(DataSetTool.DATASET_EXCLUDE_FIELDS))
+                .body("params.exclude_wfs_fields", equalTo(DataSetTool.DATASET_EXCLUDE_WFS_FIELDS))
+                .body("params.organisations.owner", equalTo("bar.com"))
+                .body("params.organisations.shared", hasSize(0))
+                .body("params.organisations.public", equalTo(Boolean.FALSE))
+                .body("params.display_names.fields.id", equalTo("new_id"));
+
+        // DELETE collection
+        when().delete(arlasPath + "collections/bar")
+                .then().statusCode(200);
+
+    }
+
+    @Test
+    public void test13ShapeColumnsDisplayName() throws Exception {
+        Map<String, Object> jsonAsMap = getJsonAsMap("bar.com", null, false);
+        jsonAsMap.put(CollectionReference.INSPIRE_PATH, getInspireJsonAsMap());
+        jsonAsMap.put(CollectionReference.DUBLIN_CORE_PATH, getDublinJsonAsMap());
+        jsonAsMap.put(CollectionReference.DISPLAY_NAMES, getCollectionDescriptionJsonAsMap());
+        // PUT new collection
+        given().contentType("application/json")
+                .body(jsonAsMap)
+                .when().put(arlasPath + "collections/bar")
+                .then().statusCode(200);
+
+        // GET collection
+        when().get(arlasPath + "collections/bar")
+                .then().statusCode(200)
+                .body("collection_name", equalTo("bar"))
+                .body("params.index_name", equalTo(DataSetTool.DATASET_INDEX_NAME))
+                .body("params.id_path", equalTo(DataSetTool.DATASET_ID_PATH))
+                .body("params.geometry_path", equalTo(DataSetTool.DATASET_GEOMETRY_PATH))
+                .body("params.centroid_path", equalTo(DataSetTool.DATASET_CENTROID_PATH))
+                .body("params.timestamp_path", equalTo(DataSetTool.DATASET_TIMESTAMP_PATH))
+                .body("params.exclude_fields", equalTo(DataSetTool.DATASET_EXCLUDE_FIELDS))
+                .body("params.exclude_wfs_fields", equalTo(DataSetTool.DATASET_EXCLUDE_WFS_FIELDS))
+                .body("params.organisations.owner", equalTo("bar.com"))
+                .body("params.organisations.shared", hasSize(0))
+                .body("params.organisations.public", equalTo(Boolean.FALSE))
+                .body("params.display_names.collection", equalTo(DataSetTool.DATASET_COLLECTION_DISPLAY_NAME))
+                .body("params.display_names.fields.id", equalTo(DataSetTool.DATASET_ID_DESC))
+                .body("params.display_names.shape_columns.id", equalTo(DataSetTool.DATASET_ID_DESC));
+        Map<String, String> newShapesColumnsNames = new HashMap<>();
+        newShapesColumnsNames.put(DataSetTool.DATASET_ID_PATH,"new_id");
+
+        // PATCH collection display name
+        given().contentType("application/json")
+                .body(newShapesColumnsNames)
+                .when().patch(arlasPath + "collections/bar/display_names/shape_columns")
+                .then().statusCode(200)
+                .body("collection_name", equalTo("bar"))
+                .body("params.index_name", equalTo(DataSetTool.DATASET_INDEX_NAME))
+                .body("params.id_path", equalTo(DataSetTool.DATASET_ID_PATH))
+                .body("params.geometry_path", equalTo(DataSetTool.DATASET_GEOMETRY_PATH))
+                .body("params.centroid_path", equalTo(DataSetTool.DATASET_CENTROID_PATH))
+                .body("params.timestamp_path", equalTo(DataSetTool.DATASET_TIMESTAMP_PATH))
+                .body("params.exclude_fields", equalTo(DataSetTool.DATASET_EXCLUDE_FIELDS))
+                .body("params.exclude_wfs_fields", equalTo(DataSetTool.DATASET_EXCLUDE_WFS_FIELDS))
+                .body("params.organisations.owner", equalTo("bar.com"))
+                .body("params.organisations.shared", hasSize(0))
+                .body("params.organisations.public", equalTo(Boolean.FALSE))
+                .body("params.display_names.collection", equalTo(DataSetTool.DATASET_COLLECTION_DISPLAY_NAME))
+                .body("params.display_names.shape_columns.id", equalTo("new_id"))
+                .body("params.display_names.fields.id", equalTo(DataSetTool.DATASET_ID_DESC));
+
+        // DELETE collection
+        when().delete(arlasPath + "collections/bar")
+                .then().statusCode(200);
+
+    }
+
+    @Test
+    public void test14ShapeColumnsDisplayName() throws Exception {
+        Map<String, Object> jsonAsMap = getJsonAsMap("bar.com", null, false);
+        jsonAsMap.put(CollectionReference.INSPIRE_PATH, getInspireJsonAsMap());
+        jsonAsMap.put(CollectionReference.DUBLIN_CORE_PATH, getDublinJsonAsMap());
+        // PUT new collection
+        given().contentType("application/json")
+                .body(jsonAsMap)
+                .when().put(arlasPath + "collections/bar")
+                .then().statusCode(200);
+
+        // GET collection
+        when().get(arlasPath + "collections/bar")
+                .then().statusCode(200)
+                .body("collection_name", equalTo("bar"))
+                .body("params.index_name", equalTo(DataSetTool.DATASET_INDEX_NAME))
+                .body("params.id_path", equalTo(DataSetTool.DATASET_ID_PATH))
+                .body("params.geometry_path", equalTo(DataSetTool.DATASET_GEOMETRY_PATH))
+                .body("params.centroid_path", equalTo(DataSetTool.DATASET_CENTROID_PATH))
+                .body("params.timestamp_path", equalTo(DataSetTool.DATASET_TIMESTAMP_PATH))
+                .body("params.exclude_fields", equalTo(DataSetTool.DATASET_EXCLUDE_FIELDS))
+                .body("params.exclude_wfs_fields", equalTo(DataSetTool.DATASET_EXCLUDE_WFS_FIELDS))
+                .body("params.organisations.owner", equalTo("bar.com"))
+                .body("params.organisations.shared", hasSize(0))
+                .body("params.organisations.public", equalTo(Boolean.FALSE));
+        Map<String, String> newShapesColumnsNames = new HashMap<>();
+        newShapesColumnsNames.put(DataSetTool.DATASET_ID_PATH,"new_id");
+
+        // PATCH collection display name
+        given().contentType("application/json")
+                .body(newShapesColumnsNames)
+                .when().patch(arlasPath + "collections/bar/display_names/shape_columns")
+                .then().statusCode(200)
+                .body("collection_name", equalTo("bar"))
+                .body("params.index_name", equalTo(DataSetTool.DATASET_INDEX_NAME))
+                .body("params.id_path", equalTo(DataSetTool.DATASET_ID_PATH))
+                .body("params.geometry_path", equalTo(DataSetTool.DATASET_GEOMETRY_PATH))
+                .body("params.centroid_path", equalTo(DataSetTool.DATASET_CENTROID_PATH))
+                .body("params.timestamp_path", equalTo(DataSetTool.DATASET_TIMESTAMP_PATH))
+                .body("params.exclude_fields", equalTo(DataSetTool.DATASET_EXCLUDE_FIELDS))
+                .body("params.exclude_wfs_fields", equalTo(DataSetTool.DATASET_EXCLUDE_WFS_FIELDS))
+                .body("params.organisations.owner", equalTo("bar.com"))
+                .body("params.organisations.shared", hasSize(0))
+                .body("params.organisations.public", equalTo(Boolean.FALSE))
+                .body("params.display_names.shape_columns.id", equalTo("new_id"));
+
+        // DELETE collection
+        when().delete(arlasPath + "collections/bar")
+                .then().statusCode(200);
+
+    }
+
     private void handleInvalidCollectionParameters(ValidatableResponse then) throws Exception {
         then.statusCode(400);
     }
@@ -513,6 +734,8 @@ private Object getCollectionDescriptionJsonAsMap() {
         Map<String, Object> jsonAsMap = new HashMap<>();
         jsonAsMap.put(CollectionReference.COLLECTION_DISPLAY_NAME, DataSetTool.DATASET_COLLECTION_DISPLAY_NAME);
         jsonAsMap.put(CollectionReference.FIELD_DISPLAY_NAME, getFieldDescriptionsJsonAsMap());
+        jsonAsMap.put(CollectionReference.SHAPE_COLUMN_DISPLAY_NAME, getFieldDescriptionsJsonAsMap());
+
         return jsonAsMap;
     }