]> git.aero2k.de Git - tmp/jakarta-migration.git/commitdiff
DRYD-92: Fixed RefNameServiceUtils.cloneAuthRefDocItem() method to clone all fields...
authorremillet <remillet@yahoo.com>
Mon, 27 Feb 2017 18:34:06 +0000 (10:34 -0800)
committerremillet <remillet@yahoo.com>
Mon, 27 Feb 2017 18:34:06 +0000 (10:34 -0800)
services/common/src/main/java/org/collectionspace/services/common/vocabulary/RefNameServiceUtils.java

index 58a6ce1a9b67e463857fe91f4cbf9490df1f3af5..189798e7729edba345e594479f33806f2f86a0fd 100644 (file)
@@ -441,7 +441,7 @@ public class RefNameServiceUtils {
              * <xs:element name="workflowState" type="xs:string" minOccurs="1"
              * />
              */
-            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;
     }