]> git.aero2k.de Git - tmp/jakarta-migration.git/commitdiff
CSPACE-5122: Updated Taxon authority item schema to reflect latest wiki schema.
authorAron Roberts <aron@socrates.berkeley.edu>
Wed, 9 May 2012 19:34:50 +0000 (12:34 -0700)
committerAron Roberts <aron@socrates.berkeley.edu>
Wed, 9 May 2012 19:34:50 +0000 (12:34 -0700)
services/common/src/main/cspace/config/services/tenants/tenant-bindings-proto.xml
services/taxonomy/3rdparty/nuxeo-platform-cs-taxonomy/src/main/resources/schemas/taxon_common.xsd
services/taxonomy/client/src/main/java/org/collectionspace/services/client/TaxonomyAuthorityClientUtils.java
services/taxonomy/client/src/test/java/org/collectionspace/services/client/test/TaxonomyAuthorityServiceTest.java
services/taxonomy/jaxb/src/main/resources/taxon_common.xsd

index c9ee8f2df92deacadb9db7dafe4384df5b9793af..ebdc654e1cfacaedb460839bad4178694ca88497 100644 (file)
                 <service:params>
                     <service:ListResultsFields>
                         <!-- Omit the standard AuthorityItem items (they are handled by the code) -->
+                        <!-- Uncomment when bug in returning list result values from complex types,
+                             currently in the CSPACE-4813 branch (P/NP term work in services), is fixed -->
+                        <!--
                         <service:ListResultField>
                             <service:element>taxonFullName</service:element>
-                            <service:xpath>taxonFullName</service:xpath>
+                            <service:xpath>taxonTermGroup/[0]/termName</service:xpath>
                         </service:ListResultField>
+                        -->
                     </service:ListResultsFields>
                 </service:params>
             </service:DocHandlerParams>
                             <types:key>authRef</types:key>
                             <types:value>taxonAuthorGroupList/*/taxonAuthor</types:value>
                         </types:item>
+                        <!-- Uncomment when Citation Authority is implemented -->
+                        <!--
+                        <types:item xmlns:types="http://collectionspace.org/services/config/types">
+                            <types:key>authRef</types:key>
+                            <types:value>commonNameGroupList/*/commonNameSource</types:value>
+                        </types:item>
+                        -->
                         <!-- Fields containing term list / controlled vocabulary references -->
                         <types:item xmlns:types="http://collectionspace.org/services/config/types">
                             <types:key>termRef</types:key>
                             <types:key>termRef</types:key>
                             <types:value>taxonAuthorGroupList/*/taxonAuthorType</types:value>
                         </types:item>
+                        <types:item xmlns:types="http://collectionspace.org/services/config/types">
+                            <types:key>termRef</types:key>
+                            <types:value>commonNameGroupList/*/commonNameLanguage</types:value>
+                        </types:item>
                         <types:item xmlns:types="http://collectionspace.org/services/config/types">
                             <types:key>termRef</types:key>
                             <types:value>taxonomicStatus</types:value>
index 2f8e427f40309e8d9f5c7a934e914cb105356418..34ad97d0d55a7fa3a11225f11b2d206858a06c7b 100644 (file)
     
     <!-- Term Information repeatable group -->
     <xs:element name="taxonTermGroupList" type="taxonTermGroupList"/>
-    
-    <!-- FIXME: See comments on CSPACE-5122 for any additional changes -->
-    <!-- to the set of fields below -->
+
     <xs:element name="description" type="xs:string"/>
-    <xs:element name="taxonFullName" type="xs:string"/>
     <xs:element name="taxonRank" type="xs:string"/>
     <xs:element name="taxonCurrency" type="xs:string"/>
     <xs:element name="taxonAuthorGroupList" type="taxonAuthorGroupList"/>
     <xs:element name="taxonYear" type="xs:string"/>
     <xs:element name="taxonCitationList" type="taxonCitationList"/>
-    <xs:element name="taxonomicStatus" type="xs:string"/>
-    <xs:element name="taxonNameSource" type="xs:string"/>
-    <xs:element name="taxonNameSourceCode" type="xs:string"/>
-    <xs:element name="taxonGUID" type="xs:string"/>
     <xs:element name="taxonNote" type="xs:string"/>
-    <xs:element name="taxonIsNamedHybrid" type="xs:string"/>
+    <xs:element name="taxonIsNamedHybrid" type="xs:boolean"/>
+    <xs:element name="commonNameGroupList" type="commonNameGroupList"/>
 
     <xs:complexType name="taxonAuthorGroupList">
         <xs:sequence>
         </xs:sequence>
     </xs:complexType>
     
+    <xs:complexType name="commonNameGroupList">
+        <xs:sequence>
+            <xs:element name="commonNameGroup" type="commonNameGroup" minOccurs="0" maxOccurs="unbounded"/>
+        </xs:sequence>
+    </xs:complexType>
+
+    <xs:complexType name="commonNameGroup">
+        <xs:sequence>
+            <xs:element name="commonName" type="xs:string"/>
+            <xs:element name="commonNameLanguage" type="xs:string"/>
+            <xs:element name="commonNameSource" type="xs:string"/>
+        </xs:sequence>
+    </xs:complexType>
+    
     <xs:complexType name="taxonTermGroupList">
         <xs:sequence>
             <xs:element name="taxonTermGroup" type="taxonTermGroup" minOccurs="0" maxOccurs="unbounded"/>
@@ -85,7 +93,7 @@
             <xs:element name="termSourceID" type="xs:string"/>
             <xs:element name="termSourceNote" type="xs:string"/>
             <!-- Specific to Taxon terms -->
-            <!-- FIXME: See comments on CSPACE-5122 for any additions here -->
+            <xs:element name="taxonomicStatus" type="xs:string"/>
         </xs:sequence>
     </xs:complexType>
     
index 71656e40c4819969dad18700af04c4e13329e7db..886e799816e2baace6be891de63740f8c3e76306 100644 (file)
@@ -5,16 +5,20 @@ import java.util.ArrayList;
 import java.util.Date;
 import java.util.List;
 import java.util.Map;
-
 import javax.ws.rs.core.MediaType;
 import javax.ws.rs.core.MultivaluedMap;
 import javax.ws.rs.core.Response;
-
 import org.apache.commons.io.FileUtils;
 import org.collectionspace.services.TaxonJAXBSchema;
 import org.collectionspace.services.client.test.ServiceRequestType;
 import org.collectionspace.services.common.api.Tools;
-import org.collectionspace.services.taxonomy.*;
+import org.collectionspace.services.taxonomy.CommonNameGroupList;
+import org.collectionspace.services.taxonomy.TaxonAuthorGroupList;
+import org.collectionspace.services.taxonomy.TaxonCitationList;
+import org.collectionspace.services.taxonomy.TaxonCommon;
+import org.collectionspace.services.taxonomy.TaxonTermGroup;
+import org.collectionspace.services.taxonomy.TaxonTermGroupList;
+import org.collectionspace.services.taxonomy.TaxonomyauthorityCommon;
 import org.dom4j.DocumentException;
 import org.jboss.resteasy.client.ClientResponse;
 import org.slf4j.Logger;
@@ -27,8 +31,9 @@ public class TaxonomyAuthorityClientUtils {
 
     /**
      * Creates a new Taxonomy Authority
+     *
      * @param displayName      The displayName used in UI, etc.
-     * @param refName          The proper refName for this authority
+     * @param refName  The proper refName for this authority
      * @param headerLabel      The common part label
      * @return The PoxPayloadOut payload for the create call
      */
@@ -53,17 +58,20 @@ public class TaxonomyAuthorityClientUtils {
     }
 
     /**
-     * @param taxonomyAuthRefName  The proper refName for this authority.
-     * @param taxonInfo the properties for the new instance of a term in this authority.
-     * @param taxonAuthorGroupList an author group list (values of a repeatable group in the term record).
-     * @param taxonCitationList a citation list (values of a repeatable scalar in the term record).
+     * @param taxonomyAuthRefName The proper refName for this authority.
+     * @param taxonInfo the properties for the new instance of a term in this
+     * authority.
+     * @param taxonAuthorGroupList an author group list (values of a repeatable
+     * group in the term record).
+     * @param taxonCitationList a citation list (values of a repeatable scalar
+     * in the term record).
      * @param headerLabel      The common part label
      * @return The PoxPayloadOut payload for the create call
      */
     public static PoxPayloadOut createTaxonInstance(
-            String taxonomyAuthRefName, Map<String, String> taxonInfo, List<TaxonTermGroup> terms,
-            TaxonAuthorGroupList taxonAuthorGroupList, TaxonCitationList taxonCitationList,
-            String headerLabel) {
+            String taxonomyAuthRefName, Map<String, String> taxonInfo,
+            List<TaxonTermGroup> terms, TaxonAuthorGroupList taxonAuthorGroupList,
+            TaxonCitationList taxonCitationList, CommonNameGroupList commonNameGroupList, String headerLabel) {
         TaxonCommon taxon = new TaxonCommon();
         String shortId = taxonInfo.get(TaxonJAXBSchema.SHORT_IDENTIFIER);
         taxon.setShortIdentifier(shortId);
@@ -78,15 +86,15 @@ public class TaxonomyAuthorityClientUtils {
                 terms = getTermGroupInstance(getGeneratedIdentifier());
             }
         }
+        terms.get(0).setTermDisplayName(taxonInfo.get(TaxonJAXBSchema.NAME));
+        terms.get(0).setTermName(taxonInfo.get(TaxonJAXBSchema.NAME));
         terms.get(0).setTermStatus(taxonInfo.get(TaxonJAXBSchema.TERM_STATUS));
-        termList.getTaxonTermGroup().addAll(terms); 
-        taxon.setTaxonTermGroupList(termList);        
-        
+        terms.get(0).setTaxonomicStatus(taxonInfo.get(TaxonJAXBSchema.TAXONOMIC_STATUS));
+        termList.getTaxonTermGroup().addAll(terms);
+        taxon.setTaxonTermGroupList(termList);
+
         String value = null;
         // Fields specific to this authority record type.
-        if ((value = (String) taxonInfo.get(TaxonJAXBSchema.NAME)) != null) {
-            taxon.setTaxonFullName(value);
-        }
         if ((value = (String) taxonInfo.get(TaxonJAXBSchema.TAXON_RANK)) != null) {
             taxon.setTaxonRank(value);
         }
@@ -96,21 +104,18 @@ public class TaxonomyAuthorityClientUtils {
         if ((value = (String) taxonInfo.get(TaxonJAXBSchema.TAXON_YEAR)) != null) {
             taxon.setTaxonYear(value);
         }
-        if ((value = (String) taxonInfo.get(TaxonJAXBSchema.TAXONOMIC_STATUS)) != null) {
-            taxon.setTaxonomicStatus(value);
-        }
-        if ((value = (String) taxonInfo.get(TaxonJAXBSchema.TAXON_IS_NAMED_HYBRID)) != null) {
-            taxon.setTaxonIsNamedHybrid(value);
-        }
         if (taxonCitationList != null) {
             taxon.setTaxonCitationList(taxonCitationList);
         }
-
         if (taxonAuthorGroupList != null) {
             taxon.setTaxonAuthorGroupList(taxonAuthorGroupList);
         }
+        if (commonNameGroupList != null) {
+            taxon.setCommonNameGroupList(commonNameGroupList);
+        }
 
-        // FIXME: When the field isNamedHybrid becomes Boolean, add it as such to sample instances.
+        taxon.setTaxonIsNamedHybrid(Boolean.parseBoolean(
+                taxonInfo.get(TaxonJAXBSchema.TAXON_IS_NAMED_HYBRID)));
 
         PoxPayloadOut multipart = new PoxPayloadOut(TaxonomyAuthorityClient.SERVICE_ITEM_PAYLOAD_NAME);
         PayloadOutputPart commonPart = multipart.addPart(taxon,
@@ -134,7 +139,8 @@ public class TaxonomyAuthorityClientUtils {
     public static String createItemInAuthority(String vcsid,
             String TaxonomyauthorityRefName, Map<String, String> taxonMap,
             List<TaxonTermGroup> terms, TaxonAuthorGroupList taxonAuthorGroupList,
-            TaxonCitationList taxonCitationList, TaxonomyAuthorityClient client) {
+            TaxonCitationList taxonCitationList, CommonNameGroupList commonNameGroupList,
+            TaxonomyAuthorityClient client) {
         // Expected status code: 201 Created
         int EXPECTED_STATUS_CODE = Response.Status.CREATED.getStatusCode();
         // Type of service request being tested
@@ -159,7 +165,7 @@ public class TaxonomyAuthorityClientUtils {
         }
         PoxPayloadOut multipart =
                 createTaxonInstance(TaxonomyauthorityRefName,
-                taxonMap, terms, taxonAuthorGroupList, taxonCitationList, client.getItemCommonPartName());
+                taxonMap, terms, taxonAuthorGroupList, taxonCitationList, commonNameGroupList, client.getItemCommonPartName());
         String newID = null;
         ClientResponse<Response> res = client.createItem(vcsid, multipart);
         try {
@@ -296,10 +302,11 @@ public class TaxonomyAuthorityClientUtils {
      * specific call to a service does not fall within a set of valid status
      * codes for that service.
      *
-     * @param serviceRequestType  A type of service request (e.g. CREATE, DELETE).
+     * @param serviceRequestType A type of service request (e.g. CREATE,
+     * DELETE).
      *
-     * @param statusCode  The invalid status code that was returned in the response,
-     *                    from submitting that type of request to the service.
+     * @param statusCode The invalid status code that was returned in the
+     * response, from submitting that type of request to the service.
      *
      * @return An error message.
      */
@@ -310,10 +317,11 @@ public class TaxonomyAuthorityClientUtils {
 
     /**
      * Produces a default displayName from the basic name and dates fields.
+     *
      * @see TaxonomyDocumentModelHandler.prepareDefaultDisplayName() which
      * duplicates this logic, until we define a service-general utils package
      * that is neither client nor service specific.
-     * @param name     
+     * @param name
      * @return
      */
     public static String prepareDefaultDisplayName(
@@ -322,7 +330,7 @@ public class TaxonomyAuthorityClientUtils {
         newStr.append(name);
         return newStr.toString();
     }
-    
+
     public static List<TaxonTermGroup> getTermGroupInstance(String identifier) {
         if (Tools.isBlank(identifier)) {
             identifier = getGeneratedIdentifier();
@@ -334,8 +342,8 @@ public class TaxonomyAuthorityClientUtils {
         terms.add(term);
         return terms;
     }
-    
+
     private static String getGeneratedIdentifier() {
-        return "id" + new Date().getTime(); 
-   }
+        return "id" + new Date().getTime();
+    }
 }
index 45fb4eac1abc19c7f137a1df34f1c160e7625e66..eda82f38f5dca3653b2d863bcd1a68af5e9d8abc 100644 (file)
@@ -1,24 +1,23 @@
 /**
- * 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:
+ * 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
+ * http://www.collectionspace.org http://wiki.collectionspace.org
  *
  * Copyright (c)) 2009 Regents of the University of California
  *
- * Licensed under the Educational Community License (ECL), Version 2.0.
- * You may not use this file except in compliance with this License.
+ * 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.
+ * 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.client.test;
 
@@ -37,6 +36,7 @@ import org.collectionspace.services.client.TaxonomyAuthorityClient;
 import org.collectionspace.services.client.TaxonomyAuthorityClientUtils;
 import org.collectionspace.services.client.TaxonomyAuthorityProxy;
 import org.collectionspace.services.jaxb.AbstractCommonList;
+import org.collectionspace.services.taxonomy.CommonNameGroupList;
 import org.collectionspace.services.taxonomy.TaxonAuthorGroup;
 import org.collectionspace.services.taxonomy.TaxonAuthorGroupList;
 import org.collectionspace.services.taxonomy.TaxonCitationList;
@@ -55,18 +55,18 @@ import org.testng.annotations.AfterClass;
 import org.testng.annotations.Test;
 
 /**
- * TaxonomyAuthorityServiceTest, carries out tests against a
- * deployed and running TaxonomyAuthority Service.
+ * TaxonomyAuthorityServiceTest, carries out tests against a deployed and
+ * running TaxonomyAuthority Service.
  *
- * $LastChangedRevision$
- * $LastChangedDate$
+ * $LastChangedRevision$ $LastChangedDate$
  */
 public class TaxonomyAuthorityServiceTest extends AbstractAuthorityServiceTest<TaxonomyauthorityCommon, TaxonCommon> {
 
-    /** The logger. */
+    /**
+     * The logger.
+     */
     private final String CLASS_NAME = TaxonomyAuthorityServiceTest.class.getName();
     private final Logger logger = LoggerFactory.getLogger(TaxonomyAuthorityServiceTest.class);
-
     private final String TEST_SHORTID = "CentauruspleurexanthemusGreen1832";
     private final String TEST_TERM_STATUS = "accepted";
     private final String TEST_TAXON_FULL_NAME = "Centaurus pleurexanthemus Green 1832";
@@ -83,7 +83,8 @@ public class TaxonomyAuthorityServiceTest extends AbstractAuthorityServiceTest<T
     private final List<TaxonTermGroup> NULL_TAXON_TERMS_LIST = null;
     private final TaxonAuthorGroupList NULL_TAXON_AUTHOR_GROUP_LIST = null;
     private final TaxonCitationList NULL_TAXON_CITATION_LIST = null;
-    
+    private final CommonNameGroupList NULL_COMMON_NAME_GROUP_LIST = null;
+
     private String knownResourceShortIdentifer = null;
     private String knownTaxonomyTypeRefName = null;
 
@@ -100,9 +101,10 @@ public class TaxonomyAuthorityServiceTest extends AbstractAuthorityServiceTest<T
     public String getItemServicePathComponent() {
         return AuthorityClient.ITEMS;
     }
-        
-    /* (non-Javadoc)
-     * @see org.collectionspace.services.client.test.BaseServiceTest#getClientInstance()
+
+    /*
+     * (non-Javadoc) @see
+     * org.collectionspace.services.client.test.BaseServiceTest#getClientInstance()
      */
     @Override
     protected CollectionSpaceClient<AbstractCommonList, PoxPayloadOut, String, TaxonomyAuthorityProxy> getClientInstance() {
@@ -150,6 +152,12 @@ public class TaxonomyAuthorityServiceTest extends AbstractAuthorityServiceTest<T
         taxonAuthorGroup.setTaxonAuthor(TEST_TAXON_AUTHOR);
         taxonAuthorGroup.setTaxonAuthorType(TEST_TAXON_AUTHOR_TYPE);
         taxonAuthorGroups.add(taxonAuthorGroup);
+                
+        CommonNameGroupList commonNameGroupList = new CommonNameGroupList();
+        List<CommonNameGroup> commonNameGroups = commonNameGroupList.getCommonNameGroup();
+        CommonNameGroup commonNameGroup = new CommonNameGroup();
+        commonNameGroup.setCommonName(TEST_TAXON_FULL_NAME);
+        commonNameGroups.add(commonNameGroup);
 
         // FIXME: Add additional fields in the Taxon record here,
         // including at least one each of:
@@ -157,7 +165,8 @@ public class TaxonomyAuthorityServiceTest extends AbstractAuthorityServiceTest<T
         // * an authref field (when implemented)
 
         String newID = TaxonomyAuthorityClientUtils.createItemInAuthority(vcsid,
-                authRefName, taxonMap, NULL_TAXON_TERMS_LIST, taxonAuthorGroupList, taxonCitationList, client);
+                authRefName, taxonMap, NULL_TAXON_TERMS_LIST, taxonAuthorGroupList,
+                taxonCitationList, commonNameGroupList, client);
 
         // Store the ID returned from the first item resource created
         // for additional tests below.
@@ -185,8 +194,8 @@ public class TaxonomyAuthorityServiceTest extends AbstractAuthorityServiceTest<T
     @Test(dataProvider = "testName")
     public void verifyIllegalItemDisplayName(String testName) throws Exception {
         //
-       // First read in our known resource.
-       //
+        // First read in our known resource.
+        //
         setupRead();
         TaxonomyAuthorityClient client = new TaxonomyAuthorityClient();
         ClientResponse<String> res = client.readItem(knownResourceId, knownItemResourceId);
@@ -199,7 +208,7 @@ public class TaxonomyAuthorityServiceTest extends AbstractAuthorityServiceTest<T
                     client.getItemCommonPartName(), TaxonCommon.class);
             Assert.assertNotNull(taxon);
         } finally {
-               if (res != null) {
+            if (res != null) {
                 res.releaseConnection();
             }
         }
@@ -213,13 +222,13 @@ public class TaxonomyAuthorityServiceTest extends AbstractAuthorityServiceTest<T
         Assert.assertTrue(terms.size() > 0);
         terms.get(0).setTermDisplayName(null);
         terms.get(0).setTermName(null);
-        
+
         PoxPayloadOut output = new PoxPayloadOut(TaxonomyAuthorityClient.SERVICE_ITEM_PAYLOAD_NAME);
         PayloadOutputPart commonPart = output.addPart(client.getItemCommonPartName(), taxon);
         setupUpdateWithInvalidBody(); // we expect a failure here
         res = client.updateItem(knownResourceId, knownItemResourceId, output);
         try {
-               assertStatusCode(res, testName);
+            assertStatusCode(res, testName);
         } finally {
             res.releaseConnection();
         }
@@ -229,7 +238,7 @@ public class TaxonomyAuthorityServiceTest extends AbstractAuthorityServiceTest<T
      * Read item list.
      */
     @Test(dataProvider = "testName", groups = {"readList"},
-               dependsOnMethods = {"readList"})
+    dependsOnMethods = {"readList"})
     public void readItemList(String testName) {
         readItemList(knownAuthorityWithItems, null);
     }
@@ -238,7 +247,7 @@ public class TaxonomyAuthorityServiceTest extends AbstractAuthorityServiceTest<T
      * Read item list by authority name.
      */
     @Test(dataProvider = "testName", groups = {"readList"},
-               dependsOnMethods = {"readItemList"})
+    dependsOnMethods = {"readItemList"})
     public void readItemListByAuthorityName(String testName) {
         readItemList(null, READITEMS_SHORT_IDENTIFIER);
     }
@@ -267,7 +276,7 @@ public class TaxonomyAuthorityServiceTest extends AbstractAuthorityServiceTest<T
         }
         try {
             assertStatusCode(res, testName);
-               AbstractCommonList list = res.getEntity();
+            AbstractCommonList list = res.getEntity();
             int statusCode = res.getStatus();
 
             // Check the status code of the response: does it match
@@ -293,15 +302,15 @@ public class TaxonomyAuthorityServiceTest extends AbstractAuthorityServiceTest<T
             Assert.assertEquals(nItemsReturned, nExpectedItems);
 
             for (AbstractCommonList.ListItem item : items) {
-               String value = 
-                       AbstractCommonListUtils.ListItemGetElementValue(item, TaxonJAXBSchema.REF_NAME);
+                String value =
+                        AbstractCommonListUtils.ListItemGetElementValue(item, TaxonJAXBSchema.REF_NAME);
                 Assert.assertTrue((null != value), "Item refName is null!");
-               value = 
-                       AbstractCommonListUtils.ListItemGetElementValue(item, TaxonJAXBSchema.DISPLAY_NAME);
+                value =
+                        AbstractCommonListUtils.ListItemGetElementValue(item, TaxonJAXBSchema.DISPLAY_NAME);
                 Assert.assertTrue((null != value), "Item displayName is null!");
             }
-            if(logger.isTraceEnabled()){
-               AbstractCommonListUtils.ListItemsInAbstractCommonList(list, logger, testName);
+            if (logger.isTraceEnabled()) {
+                AbstractCommonListUtils.ListItemsInAbstractCommonList(list, logger, testName);
             }
         } finally {
             res.releaseConnection();
@@ -310,26 +319,26 @@ public class TaxonomyAuthorityServiceTest extends AbstractAuthorityServiceTest<T
 
     @Override
     public void delete(String testName) throws Exception {
-       // Do nothing.  See localDelete().  This ensure proper test order.
+        // Do nothing.  See localDelete().  This ensure proper test order.
     }
-    
-    @Test(dataProvider = "testName", dependsOnMethods = {"localDeleteItem"})    
+
+    @Test(dataProvider = "testName", dependsOnMethods = {"localDeleteItem"})
     public void localDelete(String testName) throws Exception {
-       super.delete(testName);
+        super.delete(testName);
     }
 
     @Override
     public void deleteItem(String testName) throws Exception {
-       // Do nothing.  We need to wait until after the test "localDelete" gets run.  When it does,
-       // its dependencies will get run first and then we can call the base class' delete method.
+        // Do nothing.  We need to wait until after the test "localDelete" gets run.  When it does,
+        // its dependencies will get run first and then we can call the base class' delete method.
     }
-    
+
     @Test(dataProvider = "testName", groups = {"delete"},
-       dependsOnMethods = {"verifyIllegalItemDisplayName"})
+    dependsOnMethods = {"verifyIllegalItemDisplayName"})
     public void localDeleteItem(String testName) throws Exception {
-       super.deleteItem(testName);
+        super.deleteItem(testName);
     }
-    
+
     // ---------------------------------------------------------------
     // Cleanup of resources created during testing
     // ---------------------------------------------------------------
@@ -337,9 +346,9 @@ public class TaxonomyAuthorityServiceTest extends AbstractAuthorityServiceTest<T
      * Deletes all resources created by tests, after all tests have been run.
      *
      * This cleanup method will always be run, even if one or more tests fail.
-     * For this reason, it attempts to remove all resources created
-     * at any point during testing, even if some of those resources
-     * may be expected to be deleted by certain tests.
+     * For this reason, it attempts to remove all resources created at any point
+     * during testing, even if some of those resources may be expected to be
+     * deleted by certain tests.
      */
     @AfterClass(alwaysRun = true)
     public void cleanUp() {
@@ -380,17 +389,18 @@ public class TaxonomyAuthorityServiceTest extends AbstractAuthorityServiceTest<T
     // ---------------------------------------------------------------
     // Utility methods used by tests above
     // ---------------------------------------------------------------
-    /* (non-Javadoc)
-     * @see org.collectionspace.services.client.test.BaseServiceTest#getServicePathComponent()
+    /*
+     * (non-Javadoc) @see
+     * org.collectionspace.services.client.test.BaseServiceTest#getServicePathComponent()
      */
     /**
      * Returns the root URL for the item service.
      *
-     * This URL consists of a base URL for all services, followed by
-     * a path component for the owning parent, followed by the
-     * path component for the items.
+     * This URL consists of a base URL for all services, followed by a path
+     * component for the owning parent, followed by the path component for the
+     * items.
      *
-     * @param  parentResourceIdentifier  An identifier (such as a UUID) for the
+     * @param parentResourceIdentifier An identifier (such as a UUID) for the
      * parent authority resource of the relevant item resource.
      *
      * @return The root URL for the item service.
@@ -403,11 +413,11 @@ public class TaxonomyAuthorityServiceTest extends AbstractAuthorityServiceTest<T
      * Returns the URL of a specific item resource managed by a service, and
      * designated by an identifier (such as a universally unique ID, or UUID).
      *
-     * @param  parentResourceIdentifier  An identifier (such as a UUID) for the
+     * @param parentResourceIdentifier An identifier (such as a UUID) for the
      * parent authority resource of the relevant item resource.
      *
-     * @param  itemResourceIdentifier  An identifier (such as a UUID) for an
-     * item resource.
+     * @param itemResourceIdentifier An identifier (such as a UUID) for an item
+     * resource.
      *
      * @return The URL of a specific item resource managed by a service.
      */
@@ -415,18 +425,17 @@ public class TaxonomyAuthorityServiceTest extends AbstractAuthorityServiceTest<T
         return getItemServiceRootURL(parentResourceIdentifier) + "/" + itemResourceIdentifier;
     }
 
-       @Override
-       public void authorityTests(String testName) {
-               // TODO Auto-generated method stub
-       }
-
-       //
-       // Taxonomy authority specific instances
-       //
-       
-       @Override
-       protected PoxPayloadOut createInstance(String commonPartName,
-                       String identifier) {
+    @Override
+    public void authorityTests(String testName) {
+        // TODO Auto-generated method stub
+    }
+
+    //
+    // Taxonomy authority specific instances
+    //
+    @Override
+    protected PoxPayloadOut createInstance(String commonPartName,
+            String identifier) {
         String shortId = identifier;
         String displayName = "displayName-" + shortId;
         String baseRefName =
@@ -435,91 +444,100 @@ public class TaxonomyAuthorityServiceTest extends AbstractAuthorityServiceTest<T
                 TaxonomyAuthorityClientUtils.createTaxonomyAuthorityInstance(
                 displayName, shortId, commonPartName);
         return multipart;
-       }
-       
-       @Override
+    }
+
+    @Override
     protected PoxPayloadOut createNonExistenceInstance(String commonPartName, String identifier) {
         String displayName = "displayName-NON_EXISTENT_ID";
-       PoxPayloadOut result = TaxonomyAuthorityClientUtils.createTaxonomyAuthorityInstance(
-                               displayName, "nonEx", commonPartName);
-       return result;
-    }          
-
-       @Override
-       protected TaxonomyauthorityCommon updateInstance(
-                       TaxonomyauthorityCommon taxonomyAuthority) {
-               TaxonomyauthorityCommon result = new TaxonomyauthorityCommon();
-               
-               result.setDisplayName("updated-" + taxonomyAuthority.getDisplayName());
-               result.setVocabType("updated-" + taxonomyAuthority.getVocabType());
-               
-               return result;
-       }
-
-       @Override
-       protected void compareUpdatedInstances(TaxonomyauthorityCommon original,
-                       TaxonomyauthorityCommon updated) throws Exception {
+        PoxPayloadOut result = TaxonomyAuthorityClientUtils.createTaxonomyAuthorityInstance(
+                displayName, "nonEx", commonPartName);
+        return result;
+    }
+
+    @Override
+    protected TaxonomyauthorityCommon updateInstance(
+            TaxonomyauthorityCommon taxonomyAuthority) {
+        TaxonomyauthorityCommon result = new TaxonomyauthorityCommon();
+
+        result.setDisplayName("updated-" + taxonomyAuthority.getDisplayName());
+        result.setVocabType("updated-" + taxonomyAuthority.getVocabType());
+
+        return result;
+    }
+
+    @Override
+    protected void compareUpdatedInstances(TaxonomyauthorityCommon original,
+            TaxonomyauthorityCommon updated) throws Exception {
         // Verify that the updated resource received the correct data.
         Assert.assertEquals(updated.getDisplayName(),
-                       original.getDisplayName(),
+                original.getDisplayName(),
                 "Display name in updated object did not match submitted data.");
-       }
-       
-       //
-       // Authority item specific overrides
-       //
-
-       @Override
-       protected String createItemInAuthority(String authorityId) {
-               return createItemInAuthority(authorityId, null /*refname*/);
-       }
-       
-       @Override
-       protected TaxonCommon updateItemInstance(TaxonCommon taxonCommon) {
-            TaxonCommon result = taxonCommon;
-            TaxonTermGroupList termList = taxonCommon.getTaxonTermGroupList();
-            Assert.assertNotNull(termList);
-            List<TaxonTermGroup> terms = termList.getTaxonTermGroup();
-            Assert.assertNotNull(terms);
-            Assert.assertTrue(terms.size() > 0);
-            terms.get(0).setTermDisplayName("updated-" + terms.get(0).getTermDisplayName());
-            terms.get(0).setTermName("updated-" + terms.get(0).getTermName());
-           result.setTaxonTermGroupList(termList);
-            return result;
-       }
-
-       @Override
-       protected void compareUpdatedItemInstances(TaxonCommon original,
-                       TaxonCommon updated) throws Exception {
-
-            TaxonTermGroupList originalTermList = original.getTaxonTermGroupList();
-            Assert.assertNotNull(originalTermList);
-            List<TaxonTermGroup> originalTerms = originalTermList.getTaxonTermGroup();
-            Assert.assertNotNull(originalTerms);
-            Assert.assertTrue(originalTerms.size() > 0);
-            
-            TaxonTermGroupList updatedTermList = updated.getTaxonTermGroupList();
-            Assert.assertNotNull(updatedTermList);
-            List<TaxonTermGroup> updatedTerms = updatedTermList.getTaxonTermGroup();
-            Assert.assertNotNull(updatedTerms);
-            Assert.assertTrue(updatedTerms.size() > 0);
-            
-            Assert.assertEquals(updatedTerms.get(0).getTermDisplayName(),
+    }
+
+    //
+    // Authority item specific overrides
+    //
+    @Override
+    protected String createItemInAuthority(String authorityId) {
+        return createItemInAuthority(authorityId, null /*
+                 * refname
+                 */);
+    }
+
+    @Override
+    protected TaxonCommon updateItemInstance(TaxonCommon taxonCommon) {
+        TaxonCommon result = taxonCommon;
+        TaxonTermGroupList termList = taxonCommon.getTaxonTermGroupList();
+        Assert.assertNotNull(termList);
+        List<TaxonTermGroup> terms = termList.getTaxonTermGroup();
+        Assert.assertNotNull(terms);
+        Assert.assertTrue(terms.size() > 0);
+        terms.get(0).setTermDisplayName("updated-" + terms.get(0).getTermDisplayName());
+        terms.get(0).setTermName("updated-" + terms.get(0).getTermName());
+        result.setTaxonTermGroupList(termList);
+        return result;
+    }
+
+    @Override
+    protected void compareUpdatedItemInstances(TaxonCommon original,
+            TaxonCommon updated) throws Exception {
+
+        TaxonTermGroupList originalTermList = original.getTaxonTermGroupList();
+        Assert.assertNotNull(originalTermList);
+        List<TaxonTermGroup> originalTerms = originalTermList.getTaxonTermGroup();
+        Assert.assertNotNull(originalTerms);
+        Assert.assertTrue(originalTerms.size() > 0);
+
+        TaxonTermGroupList updatedTermList = updated.getTaxonTermGroupList();
+        Assert.assertNotNull(updatedTermList);
+        List<TaxonTermGroup> updatedTerms = updatedTermList.getTaxonTermGroup();
+        Assert.assertNotNull(updatedTerms);
+        Assert.assertTrue(updatedTerms.size() > 0);
+
+        Assert.assertEquals(updatedTerms.get(0).getTermDisplayName(),
                 originalTerms.get(0).getTermDisplayName(),
                 "Value in updated record did not match submitted data.");
-       }
+    }
 
-       @Override
-       protected void verifyReadItemInstance(TaxonCommon item) throws Exception {
-        Assert.assertNotNull(item.getTaxonFullName(), "Field value is unexpectedly null.");
-        Assert.assertEquals(item.getTaxonFullName(), TEST_TAXON_FULL_NAME,
-                "Field value " + item.getTaxonFullName()
+    @Override
+    protected void verifyReadItemInstance(TaxonCommon item) throws Exception {
+        
+        TaxonTermGroupList termList = item.getTaxonTermGroupList();
+        Assert.assertNotNull(termList);
+        List<TaxonTermGroup> terms = termList.getTaxonTermGroup();
+        Assert.assertNotNull(terms);
+        Assert.assertTrue(terms.size() > 0);
+        
+        String preferredTermName = terms.get(0).getTermName();
+        Assert.assertNotNull(preferredTermName, "Field value is unexpectedly null.");
+        Assert.assertEquals(preferredTermName, TEST_TAXON_FULL_NAME,
+                "Field value " + preferredTermName
                 + "does not match expected value " + TEST_TAXON_FULL_NAME);
-       }
+    }
 
-       @Override
-       protected PoxPayloadOut createNonExistenceItemInstance(
-                       String commonPartName, String identifier) {
+    @Override
+    protected PoxPayloadOut createNonExistenceItemInstance(
+            String commonPartName, String identifier) {
         Map<String, String> nonexMap = new HashMap<String, String>();
         nonexMap.put(TaxonJAXBSchema.NAME, TEST_TAXON_FULL_NAME);
         nonexMap.put(TaxonJAXBSchema.SHORT_IDENTIFIER, "nonEx");
@@ -528,7 +546,7 @@ public class TaxonomyAuthorityServiceTest extends AbstractAuthorityServiceTest<T
         PoxPayloadOut result =
                 TaxonomyAuthorityClientUtils.createTaxonInstance(EMPTY_REFNAME,
                 nonexMap, NULL_TAXON_TERMS_LIST, NULL_TAXON_AUTHOR_GROUP_LIST, NULL_TAXON_CITATION_LIST,
-                commonPartName);
-               return result;
-       }
+                NULL_COMMON_NAME_GROUP_LIST, commonPartName);
+        return result;
+    }
 }
index c39632fc5cd3f2556f2c4df3ed168acc51edea54..e51c80e33a4934d306fe87ddfc566afe86ba9ca5 100644 (file)
                 <!-- Term Information repeatable group -->
                 <xs:element name="taxonTermGroupList" type="taxonTermGroupList"/>
     
-                <!-- FIXME: See comments on CSPACE-5122 for any additional changes -->
-                <!-- to the set of fields below -->
                 <xs:element name="description" type="xs:string"/>
-                <xs:element name="taxonFullName" type="xs:string"/>
                 <xs:element name="taxonRank" type="xs:string"/>
                 <xs:element name="taxonCurrency" type="xs:string"/>
                 <xs:element name="taxonAuthorGroupList" type="taxonAuthorGroupList"/>
                 <xs:element name="taxonYear" type="xs:string"/>
                 <xs:element name="taxonCitationList" type="taxonCitationList"/>
-                <xs:element name="taxonomicStatus" type="xs:string"/>
-                <xs:element name="taxonNameSource" type="xs:string"/>
-                <xs:element name="taxonNameSourceCode" type="xs:string"/>
-                <xs:element name="taxonGUID" type="xs:string"/>
                 <xs:element name="taxonNote" type="xs:string"/>
-                <xs:element name="taxonIsNamedHybrid" type="xs:string"/>
+                <xs:element name="taxonIsNamedHybrid" type="xs:boolean"/>
+                <xs:element name="commonNameGroupList" type="commonNameGroupList"/>
 
             </xs:sequence>
         </xs:complexType>
         </xs:sequence>
     </xs:complexType>
     
+    <xs:complexType name="commonNameGroupList">
+        <xs:sequence>
+            <xs:element name="commonNameGroup" type="commonNameGroup" minOccurs="0" maxOccurs="unbounded"/>
+        </xs:sequence>
+    </xs:complexType>
+
+    <xs:complexType name="commonNameGroup">
+        <xs:sequence>
+            <xs:element name="commonName" type="xs:string"/>
+            <xs:element name="commonNameLanguage" type="xs:string"/>
+            <xs:element name="commonNameSource" type="xs:string"/>
+        </xs:sequence>
+    </xs:complexType>
+    
     <xs:complexType name="taxonTermGroupList">
         <xs:sequence>
             <xs:element name="taxonTermGroup" type="taxonTermGroup" minOccurs="0" maxOccurs="unbounded"/>
@@ -88,7 +96,7 @@
             <xs:element name="termSourceID" type="xs:string"/>
             <xs:element name="termSourceNote" type="xs:string"/>
             <!-- Specific to Taxon terms -->
-            <!-- FIXME: See comments on CSPACE-5122 for any additions here -->
+            <xs:element name="taxonomicStatus" type="xs:string"/>
         </xs:sequence>
     </xs:complexType>