From 9d3618976059c9b3e23501753d99ceeaa739bf16 Mon Sep 17 00:00:00 2001 From: Aron Roberts Date: Fri, 11 May 2012 14:31:49 -0700 Subject: [PATCH] CSPACE-5132: Changed field name to termDisplayName from displayName in each item emitted in lists of authority items, to align with P/NP work in the App layer. --- .../vocabulary/AuthorityItemJAXBSchema.java | 76 +++++++++---------- .../AuthorityItemDocumentModelHandler.java | 11 ++- .../tenants/tenant-bindings-proto.xml | 12 +-- .../test/ConceptAuthorityServiceTest.java | 10 +-- .../test/LocationAuthorityServiceTest.java | 4 +- .../client/test/OrgAuthorityServiceTest.java | 4 +- .../test/PersonAuthorityServiceTest.java | 4 +- .../test/PlaceAuthorityServiceTest.java | 4 +- .../test/TaxonomyAuthorityServiceTest.java | 4 +- 9 files changed, 69 insertions(+), 60 deletions(-) diff --git a/services/authority/jaxb/src/main/java/org/collectionspace/services/common/vocabulary/AuthorityItemJAXBSchema.java b/services/authority/jaxb/src/main/java/org/collectionspace/services/common/vocabulary/AuthorityItemJAXBSchema.java index e5e47982e..b2f9caa9b 100644 --- a/services/authority/jaxb/src/main/java/org/collectionspace/services/common/vocabulary/AuthorityItemJAXBSchema.java +++ b/services/authority/jaxb/src/main/java/org/collectionspace/services/common/vocabulary/AuthorityItemJAXBSchema.java @@ -1,48 +1,48 @@ /** - * This document is a part of the source code and related artifacts - * for CollectionSpace, an open source collections management system - * for museums and related institutions: - - * http://www.collectionspace.org - * http://wiki.collectionspace.org - - * Copyright 2009 University of California at Berkeley - - * Licensed under the Educational Community License (ECL), Version 2.0. - * You may not use this file except in compliance with this License. - - * You may obtain a copy of the ECL 2.0 License at - - * https://source.collectionspace.org/collection-space/LICENSE.txt - - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * This document is a part of the source code and related artifacts for + * CollectionSpace, an open source collections management system for museums and + * related institutions: + * + * http://www.collectionspace.org http://wiki.collectionspace.org + * + * Copyright 2009 University of California at Berkeley + * + * Licensed under the Educational Community License (ECL), Version 2.0. You may + * not use this file except in compliance with this License. + * + * You may obtain a copy of the ECL 2.0 License at + * + * https://source.collectionspace.org/collection-space/LICENSE.txt + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. */ package org.collectionspace.services.common.vocabulary; /** * @author pschmitz - * + * */ public interface AuthorityItemJAXBSchema { - final static String IN_AUTHORITY = "inAuthority"; - final static String REF_NAME = "refName"; - final static String ORDER = "order"; - final static String SHORT_IDENTIFIER = "shortIdentifier"; - final static String CSID = "csid"; + + final static String IN_AUTHORITY = "inAuthority"; + final static String REF_NAME = "refName"; + final static String ORDER = "order"; + final static String SHORT_IDENTIFIER = "shortIdentifier"; + final static String CSID = "csid"; final static String DISPLAY_NAME = "displayName"; // This is the display name element for the Vocabulary service's item - final static String TERM_DISPLAY_NAME = "termDisplayName"; - final static String TERM_NAME = "termName"; - final static String TERM_STATUS = "termStatus"; - final static String TERM_INFO_GROUP_SCHEMA_NAME = ""; // FIXME: REM - Needs - // to be defined. - // CSPACE-4813 - Remove all the below values and recompile all authorityitem - // related classes - final static String DISPLAY_NAME_COMPUTED = "displayNameComputed"; - final static String SHORT_DISPLAY_NAME = "shortDisplayName"; - final static String SHORT_DISPLAY_NAME_COMPUTED = "shortDisplayNameComputed"; - // final static String TERM_STATUS = "termStatus"; + final static String TERM_DISPLAY_NAME = "termDisplayName"; // This is the display name element for all Authority services' items + final static String TERM_NAME = "termName"; + final static String TERM_STATUS = "termStatus"; + final static String TERM_INFO_GROUP_SCHEMA_NAME = ""; // FIXME: REM - Needs + // to be defined. + // CSPACE-4813 - Remove all the below values and recompile all authorityitem + // related classes + final static String DISPLAY_NAME_COMPUTED = "displayNameComputed"; + final static String SHORT_DISPLAY_NAME = "shortDisplayName"; + final static String SHORT_DISPLAY_NAME_COMPUTED = "shortDisplayNameComputed"; + // final static String TERM_STATUS = "termStatus"; } diff --git a/services/authority/service/src/main/java/org/collectionspace/services/common/vocabulary/nuxeo/AuthorityItemDocumentModelHandler.java b/services/authority/service/src/main/java/org/collectionspace/services/common/vocabulary/nuxeo/AuthorityItemDocumentModelHandler.java index c38ade306..ff419eab6 100644 --- a/services/authority/service/src/main/java/org/collectionspace/services/common/vocabulary/nuxeo/AuthorityItemDocumentModelHandler.java +++ b/services/authority/service/src/main/java/org/collectionspace/services/common/vocabulary/nuxeo/AuthorityItemDocumentModelHandler.java @@ -150,10 +150,19 @@ public abstract class AuthorityItemDocumentModelHandler // for backwards compatibility, although its value is obtained // from the termDisplayName field. // + // Update: this name is now being changed to 'termDisplayName', both + // because this is the actual field name and because the app layer + // work to convert over to this field is underway. Per Patrick, the + // app layer treats lists, in at least some context(s), as sparse record + // payloads, and thus fields in list results must all be present in + // (i.e. represent a strict subset of the fields in) record schemas. + // - ADR 2012-05-11 + // + // // 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). - result.setElement(AuthorityItemJAXBSchema.DISPLAY_NAME); + result.setElement(AuthorityItemJAXBSchema.TERM_DISPLAY_NAME); result.setXpath(NuxeoUtils.getPrimaryXPathPropertyName( authorityItemCommonSchemaName, getItemTermInfoGroupXPathBase(), AuthorityItemJAXBSchema.TERM_DISPLAY_NAME)); diff --git a/services/common/src/main/cspace/config/services/tenants/tenant-bindings-proto.xml b/services/common/src/main/cspace/config/services/tenants/tenant-bindings-proto.xml index 8fd4e6782..4daff94c6 100644 --- a/services/common/src/main/cspace/config/services/tenants/tenant-bindings-proto.xml +++ b/services/common/src/main/cspace/config/services/tenants/tenant-bindings-proto.xml @@ -1743,7 +1743,7 @@ objectNameProperty - displayName + termDisplayName objectNumberProperty @@ -1921,7 +1921,7 @@ objectNameProperty - displayName + termDisplayName objectNumberProperty @@ -2100,7 +2100,7 @@ objectNameProperty - displayName + termDisplayName objectNumberProperty @@ -2245,7 +2245,7 @@ objectNameProperty - displayName + termDisplayName objectNumberProperty @@ -2436,7 +2436,7 @@ objectNameProperty - displayName + termDisplayName objectNumberProperty @@ -2614,7 +2614,7 @@ objectNameProperty - displayName + termDisplayName objectNumberProperty diff --git a/services/concept/client/src/test/java/org/collectionspace/services/client/test/ConceptAuthorityServiceTest.java b/services/concept/client/src/test/java/org/collectionspace/services/client/test/ConceptAuthorityServiceTest.java index 6d33ed7d5..b9afc75e6 100644 --- a/services/concept/client/src/test/java/org/collectionspace/services/client/test/ConceptAuthorityServiceTest.java +++ b/services/concept/client/src/test/java/org/collectionspace/services/client/test/ConceptAuthorityServiceTest.java @@ -24,6 +24,7 @@ package org.collectionspace.services.client.test; import java.util.List; import java.util.Map; +import org.collectionspace.services.ConceptJAXBSchema; import org.collectionspace.services.client.AbstractCommonListUtils; import org.collectionspace.services.client.AuthorityClient; import org.collectionspace.services.client.CollectionSpaceClient; @@ -31,6 +32,7 @@ import org.collectionspace.services.client.ConceptAuthorityClient; import org.collectionspace.services.client.ConceptAuthorityClientUtils; import org.collectionspace.services.client.PoxPayloadOut; import org.collectionspace.services.common.datetime.GregorianCalendarDateTimeUtils; +import org.collectionspace.services.common.vocabulary.AuthorityItemJAXBSchema; import org.collectionspace.services.concept.ConceptTermGroup; import org.collectionspace.services.concept.ConceptTermGroupList; import org.collectionspace.services.concept.ConceptauthoritiesCommon; @@ -56,8 +58,6 @@ public class ConceptAuthorityServiceTest extends AbstractAuthorityServiceTest