From: remillet Date: Mon, 27 Feb 2017 18:34:06 +0000 (-0800) Subject: DRYD-92: Fixed RefNameServiceUtils.cloneAuthRefDocItem() method to clone all fields... X-Git-Url: https://git.aero2k.de/?a=commitdiff_plain;h=f39b9bf474c7161018579f399536544c41c6cd86;p=tmp%2Fjakarta-migration.git DRYD-92: Fixed RefNameServiceUtils.cloneAuthRefDocItem() method to clone all fields -including refname, workflowstate, and updatedate. --- diff --git a/services/common/src/main/java/org/collectionspace/services/common/vocabulary/RefNameServiceUtils.java b/services/common/src/main/java/org/collectionspace/services/common/vocabulary/RefNameServiceUtils.java index 58a6ce1a9..189798e77 100644 --- a/services/common/src/main/java/org/collectionspace/services/common/vocabulary/RefNameServiceUtils.java +++ b/services/common/src/main/java/org/collectionspace/services/common/vocabulary/RefNameServiceUtils.java @@ -441,7 +441,7 @@ public class RefNameServiceUtils { * */ - String fieldList = "docType|docId|docNumber|docName|sourceField|uri|refName|updatedAt|workflowState"; + String fieldList = "docType|docId|docNumber|docName|sourceField|uri|refName|updatedAt|workflowState"; // FIXME: Should not be hard-coded string commonList.setFieldsReturned(fieldList); // As a side-effect, the method called below modifies the value of @@ -966,6 +966,13 @@ public class RefNameServiceUtils { return nRefsFoundTotal; } + /** + * Clone an AuthorityRefDocItem which is a JAX-B generated class. Be sure we're copying every field defined in the XSD (XML Schema) that is + * found here services\jaxb\src\main\resources\authorityrefdocs.xsd + * @param ilistItem + * @param sourceField + * @return + */ private static AuthorityRefDocList.AuthorityRefDocItem cloneAuthRefDocItem( AuthorityRefDocList.AuthorityRefDocItem ilistItem, String sourceField) { AuthorityRefDocList.AuthorityRefDocItem newlistItem = new AuthorityRefDocList.AuthorityRefDocItem(); @@ -975,6 +982,9 @@ public class RefNameServiceUtils { newlistItem.setDocType(ilistItem.getDocType()); newlistItem.setUri(ilistItem.getUri()); newlistItem.setSourceField(sourceField); + newlistItem.setRefName(ilistItem.getRefName()); + newlistItem.setUpdatedAt(ilistItem.getUpdatedAt()); + newlistItem.setWorkflowState(ilistItem.getWorkflowState()); return newlistItem; }