From: Ray Lee Date: Sat, 22 May 2021 03:25:14 +0000 (-0400) Subject: DRYD-891: Use only display name of objectName when computing collectionobject title... X-Git-Url: https://git.aero2k.de/?a=commitdiff_plain;h=de6e6850e6bdb41719bdd8e28195f446e81e4e4e;p=tmp%2Fjakarta-migration.git DRYD-891: Use only display name of objectName when computing collectionobject title for es index. --- 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;