From 654554de167b22e29605fc12c3cfe586f51affbe Mon Sep 17 00:00:00 2001 From: Spiros Dimopulos Date: Thu, 11 Dec 2025 10:22:30 +0200 Subject: [PATCH] DRYD-1952: Public Browser > Add contentPlace field (#486) * DRYD-1952: added contentPlaces in contentSubjectList; * DRYD-1952: added contentPlaces in all tenant bindings that override es config; * DRYD-1952: set using RefNameUtils.getDisplayName for refNames, otherwise directly using the content value; --- .../elasticsearch/DefaultESDocumentWriter.java | 14 +++++++++++++- .../anthro/anthro-tenant-bindings.delta.xml | 5 +++++ .../bonsai/bonsai-tenant-bindings.delta.xml | 5 +++++ .../tenants/fcart/fcart-tenant-bindings.delta.xml | 5 +++++ .../tenants/lhmc/lhmc-tenant-bindings.delta.xml | 5 +++++ .../materials/materials-tenant-bindings.delta.xml | 5 +++++ .../tenants/tenant-bindings-proto-unified.xml | 5 +++++ 7 files changed, 43 insertions(+), 1 deletion(-) diff --git a/3rdparty/nuxeo/nuxeo-platform-elasticsearch/src/main/java/org/collectionspace/services/nuxeo/elasticsearch/DefaultESDocumentWriter.java b/3rdparty/nuxeo/nuxeo-platform-elasticsearch/src/main/java/org/collectionspace/services/nuxeo/elasticsearch/DefaultESDocumentWriter.java index 039b2ec96..e9dea8ffe 100644 --- a/3rdparty/nuxeo/nuxeo-platform-elasticsearch/src/main/java/org/collectionspace/services/nuxeo/elasticsearch/DefaultESDocumentWriter.java +++ b/3rdparty/nuxeo/nuxeo-platform-elasticsearch/src/main/java/org/collectionspace/services/nuxeo/elasticsearch/DefaultESDocumentWriter.java @@ -298,6 +298,7 @@ private void denormExhibitionRecords(CoreSession session, String csid, String te final List fields = Arrays.asList("contentConcepts", "contentEvents", "contentPersons", + "contentPlaces", "contentOrganizations"); for (String field : fields) { @@ -306,7 +307,18 @@ private void denormExhibitionRecords(CoreSession session, String csid, String te for (String content : contentList) { if (content != null) { final ObjectNode node = objectMapper.createObjectNode(); - node.put("subject", RefNameUtils.getDisplayName(content)); + String subjectValue; + + if (RefNameUtils.isTermRefname(content)) { + try { + subjectValue = RefNameUtils.getDisplayName(content); + } catch (Exception e) { + subjectValue = content; + } + } else { + subjectValue = content; + } + node.put("subject", subjectValue); denormContentSubject.add(node); } } diff --git a/services/common/src/main/cspace/config/services/tenants/anthro/anthro-tenant-bindings.delta.xml b/services/common/src/main/cspace/config/services/tenants/anthro/anthro-tenant-bindings.delta.xml index ea4c9abfe..0729f7681 100644 --- a/services/common/src/main/cspace/config/services/tenants/anthro/anthro-tenant-bindings.delta.xml +++ b/services/common/src/main/cspace/config/services/tenants/anthro/anthro-tenant-bindings.delta.xml @@ -58,6 +58,7 @@ "collectionobjects_common:contentEvents", "collectionobjects_common:contentOrganizations", "collectionobjects_common:contentPersons", + "collectionobjects_common:contentPlaces", "collectionobjects_common:fieldCollectionDateGroup", "collectionobjects_common:fieldCollectors", "collectionobjects_common:materialGroupList", @@ -352,6 +353,10 @@ } } }, + "collectionobjects_common:contentPlaces": { + "type": "keyword", + "copy_to": "all_field" + }, "collectionobjects_common:techniqueGroupList": { "type": "object", "properties": { diff --git a/services/common/src/main/cspace/config/services/tenants/bonsai/bonsai-tenant-bindings.delta.xml b/services/common/src/main/cspace/config/services/tenants/bonsai/bonsai-tenant-bindings.delta.xml index 127c7ae7c..2f12109df 100644 --- a/services/common/src/main/cspace/config/services/tenants/bonsai/bonsai-tenant-bindings.delta.xml +++ b/services/common/src/main/cspace/config/services/tenants/bonsai/bonsai-tenant-bindings.delta.xml @@ -29,6 +29,7 @@ "collectionobjects_common:contentEvents", "collectionobjects_common:contentOrganizations", "collectionobjects_common:contentPersons", + "collectionobjects_common:contentPlaces", "collectionobjects_common:materialGroupList", "collectionobjects_common:measuredPartGroupList", "collectionobjects_common:numberOfObjects", @@ -311,6 +312,10 @@ } } }, + "collectionobjects_common:contentPlaces": { + "type": "keyword", + "copy_to": "all_field" + }, "collectionobjects_common:techniqueGroupList": { "type": "object", "properties": { diff --git a/services/common/src/main/cspace/config/services/tenants/fcart/fcart-tenant-bindings.delta.xml b/services/common/src/main/cspace/config/services/tenants/fcart/fcart-tenant-bindings.delta.xml index 65e77ea66..0045ce028 100644 --- a/services/common/src/main/cspace/config/services/tenants/fcart/fcart-tenant-bindings.delta.xml +++ b/services/common/src/main/cspace/config/services/tenants/fcart/fcart-tenant-bindings.delta.xml @@ -38,6 +38,7 @@ "collectionobjects_common:contentEvents", "collectionobjects_common:contentOrganizations", "collectionobjects_common:contentPersons", + "collectionobjects_common:contentPlaces", "collectionobjects_common:materialGroupList", "collectionobjects_common:measuredPartGroupList", "collectionobjects_common:numberOfObjects", @@ -320,6 +321,10 @@ } } }, + "collectionobjects_common:contentPlaces": { + "type": "keyword", + "copy_to": "all_field" + }, "collectionobjects_common:techniqueGroupList": { "type": "object", "properties": { diff --git a/services/common/src/main/cspace/config/services/tenants/lhmc/lhmc-tenant-bindings.delta.xml b/services/common/src/main/cspace/config/services/tenants/lhmc/lhmc-tenant-bindings.delta.xml index e907d2d10..f836218cc 100644 --- a/services/common/src/main/cspace/config/services/tenants/lhmc/lhmc-tenant-bindings.delta.xml +++ b/services/common/src/main/cspace/config/services/tenants/lhmc/lhmc-tenant-bindings.delta.xml @@ -29,6 +29,7 @@ "collectionobjects_common:contentEvents", "collectionobjects_common:contentOrganizations", "collectionobjects_common:contentPersons", + "collectionobjects_common:contentPlaces", "collectionobjects_common:materialGroupList", "collectionobjects_common:measuredPartGroupList", "collectionobjects_common:numberOfObjects", @@ -310,6 +311,10 @@ } } }, + "collectionobjects_common:contentPlaces": { + "type": "keyword", + "copy_to": "all_field" + }, "collectionobjects_common:techniqueGroupList": { "type": "object", "properties": { diff --git a/services/common/src/main/cspace/config/services/tenants/materials/materials-tenant-bindings.delta.xml b/services/common/src/main/cspace/config/services/tenants/materials/materials-tenant-bindings.delta.xml index 3057e9c2f..64e57db8e 100644 --- a/services/common/src/main/cspace/config/services/tenants/materials/materials-tenant-bindings.delta.xml +++ b/services/common/src/main/cspace/config/services/tenants/materials/materials-tenant-bindings.delta.xml @@ -75,6 +75,7 @@ "collectionobjects_common:contentEvents", "collectionobjects_common:contentOrganizations", "collectionobjects_common:contentPersons", + "collectionobjects_common:contentPlaces", "collectionobjects_common:objectHistoryNote", "collectionobjects_common:objectNumber", "collectionobjects_common:objectStatusList", @@ -678,6 +679,10 @@ } } }, + "collectionobjects_common:contentPlaces": { + "type": "keyword", + "copy_to": "all_field" + }, "collectionobjects_common:materialGroupList": { "type": "object", "properties": { diff --git a/services/common/src/main/cspace/config/services/tenants/tenant-bindings-proto-unified.xml b/services/common/src/main/cspace/config/services/tenants/tenant-bindings-proto-unified.xml index 7622f7829..91411631c 100644 --- a/services/common/src/main/cspace/config/services/tenants/tenant-bindings-proto-unified.xml +++ b/services/common/src/main/cspace/config/services/tenants/tenant-bindings-proto-unified.xml @@ -1188,6 +1188,7 @@ "collectionobjects_common:contentEvents", "collectionobjects_common:contentOrganizations", "collectionobjects_common:contentPersons", + "collectionobjects_common:contentPlaces", "collectionobjects_common:materialGroupList", "collectionobjects_common:measuredPartGroupList", "collectionobjects_common:numberOfObjects", @@ -1463,6 +1464,10 @@ } } }, + "collectionobjects_common:contentPlaces": { + "type": "keyword", + "copy_to": "all_field" + }, "collectionobjects_common:techniqueGroupList": { "type": "object", "properties": { -- 2.47.3