]> git.aero2k.de Git - tmp/jakarta-migration.git/commitdiff
DRYD-891: Use only display name of objectName when computing collectionobject title...
authorRay Lee <ray.lee@lyrasis.org>
Sat, 22 May 2021 03:25:14 +0000 (23:25 -0400)
committerRay Lee <ray.lee@lyrasis.org>
Sat, 22 May 2021 03:26:44 +0000 (23:26 -0400)
3rdparty/nuxeo/nuxeo-platform-elasticsearch/src/main/java/org/collectionspace/services/nuxeo/elasticsearch/DefaultESDocumentWriter.java

index 3cf670db0de1b4f4cf26ae31431862b688c1e7b2..bf9ffbbaac2beb14c06814e749a17981636f43cc 100644 (file)
@@ -213,6 +213,17 @@ private void denormExhibitionRecords(CoreSession session, String csid, String te
                if (objectNameGroups.size() > 0) {
                        Map<String, Object> 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;