]> git.aero2k.de Git - tmp/jakarta-migration.git/commitdiff
CSPACE-5119,CSPACE-5135,CSPACE-5138,CSPACE-5132: Reverted name of field in lists...
authorAron Roberts <aron@socrates.berkeley.edu>
Thu, 3 May 2012 01:12:21 +0000 (18:12 -0700)
committerAron Roberts <aron@socrates.berkeley.edu>
Thu, 3 May 2012 01:12:21 +0000 (18:12 -0700)
services/authority/service/src/main/java/org/collectionspace/services/common/vocabulary/nuxeo/AuthorityItemDocumentModelHandler.java
services/person/client/src/test/java/org/collectionspace/services/client/test/PersonAuthorityServiceTest.java

index c440b5a096aeb78387676b670f2613dc2d89c6e8..fb58dcd1af884995606e2ae04a163b8570eada43 100644 (file)
@@ -167,7 +167,14 @@ public abstract class AuthorityItemDocumentModelHandler<AICommon>
         ListResultField field;
         if (!hasDisplayName) {
             field = new ListResultField();
-            field.setElement(AuthorityItemJAXBSchema.TERM_DISPLAY_NAME);
+            // Per CSPACE-5132, the name of this element remains 'displayName'
+            // for backwards compatibility, although its value is obtained
+            // from the termDisplayName field.
+            //
+            // In CSPACE-5134, these list results will change substantially
+            // to return display names for both the preferred term and for
+            // each non-preferred term (if any).
+            field.setElement(AuthorityItemJAXBSchema.DISPLAY_NAME);
             field.setXpath(NuxeoUtils.getPrimaryXPathPropertyName(
                     authorityItemCommonSchemaName, getItemTermInfoGroupXPathBase(), AuthorityItemJAXBSchema.TERM_DISPLAY_NAME));
             list.add(field);
index a85a861602508eee41f6cec067598519b3400427..5f234d5a8cce48f8ef5ff6e651dc729948f13046 100644 (file)
@@ -824,8 +824,11 @@ public class PersonAuthorityServiceTest extends AbstractAuthorityServiceTest<Per
                     AbstractCommonListUtils.ListItemGetElementValue(item, AuthorityItemJAXBSchema.REF_NAME);
             Assert.assertTrue((null != value), "Item refName is null!");
             
+            // Per CSPACE-5132, lists items still return a field named displayName,
+            // not termDisplayName, for backward compatibility.
+            // (The format of list items will change significantly in CSPACE-5134.)
             value =
-                    AbstractCommonListUtils.ListItemGetElementValue(item, AuthorityItemJAXBSchema.TERM_DISPLAY_NAME);
+                    AbstractCommonListUtils.ListItemGetElementValue(item, AuthorityItemJAXBSchema.DISPLAY_NAME);
             Assert.assertTrue((null != value), "Item displayName is null!");
         }
         if (logger.isTraceEnabled()) {