From de6e6850e6bdb41719bdd8e28195f446e81e4e4e Mon Sep 17 00:00:00 2001 From: Ray Lee Date: Fri, 21 May 2021 23:25:14 -0400 Subject: [PATCH] DRYD-891: Use only display name of objectName when computing collectionobject title for es index. --- .../nuxeo/elasticsearch/DefaultESDocumentWriter.java | 11 +++++++++++ 1 file changed, 11 insertions(+) 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 3cf670db0..bf9ffbbaa 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 @@ -213,6 +213,17 @@ private void denormExhibitionRecords(CoreSession session, String csid, String te if (objectNameGroups.size() > 0) { Map primaryObjectNameGroup = objectNameGroups.get(0); primaryObjectName = (String) primaryObjectNameGroup.get("objectName"); + + // The object might be a refname in some profiles/tenants. If it is, use only the display name. + + try { + String displayName = RefNameUtils.getDisplayName(primaryObjectName); + + if (displayName != null) { + primaryObjectName = displayName; + } + } + catch (Exception e) {} } return primaryObjectName; -- 2.47.3