]> git.aero2k.de Git - tmp/jakarta-migration.git/commitdiff
CSPACE-3865: Full taxonomy service module now builds. Need to integrate this into...
authorAron Roberts <aron@socrates.berkeley.edu>
Fri, 6 May 2011 20:01:48 +0000 (20:01 +0000)
committerAron Roberts <aron@socrates.berkeley.edu>
Fri, 6 May 2011 20:01:48 +0000 (20:01 +0000)
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/java/org/collectionspace/services/TaxonomyJAXBSchema.java
services/taxonomy/service/src/main/java/org/collectionspace/services/taxonomy/TaxonomyAuthorityResource.java

index 58aba6fe9ab5e48646c485c122757135d42e500e..9d04693d958e0c2a3e0fb8878b2c6fa443731b36 100644 (file)
@@ -72,9 +72,9 @@ public class TaxonomyAuthorityClientUtils {
        value = taxonomyInfo.get(TaxonomyJAXBSchema.DISPLAY_NAME_COMPUTED);
        boolean displayNameComputed = (value==null) || value.equalsIgnoreCase("true"); 
        taxonomy.setDisplayNameComputed(displayNameComputed);
-        if((value = (String)taxonomyInfo.get(TaxonomyJAXBSchema.FULL_NAME))!=null)
+        if((value = (String)taxonomyInfo.get(TaxonomyJAXBSchema.NAME))!=null)
                taxonomy.setTaxonFullName(value);
-        if((value = (String)taxonomyInfo.get(TaxonomyJAXBSchema.TAXON_RANK))!=null)
+        if((value = (String)taxonomyInfo.get(TaxonomyJAXBSchema.RANK))!=null)
                taxonomy.setTaxonRank(value);
         if((value = (String)taxonomyInfo.get(TaxonomyJAXBSchema.TERM_STATUS))!=null)
                taxonomy.setTermStatus(value);
@@ -116,7 +116,7 @@ public class TaxonomyAuthorityClientUtils {
                }
                displayName = 
                        prepareDefaultDisplayName(
-                       taxonomyMap.get(TaxonomyJAXBSchema.FULL_NAME));
+                       taxonomyMap.get(TaxonomyJAXBSchema.NAME));
        }
        
        if(logger.isDebugEnabled()){
index c409a701f94a2e81761d708ab2b9cfde81d94728..7a80e2242bba2531af17fcc6396a02429060bfcd 100644 (file)
@@ -83,7 +83,7 @@ public class TaxonomyAuthorityServiceTest extends AbstractServiceTestImpl { //FI
         return AuthorityClient.ITEMS;
     }
     
-    final String TEST_FULL_NAME = "Centaurus pleurexanthemus Green 1832-";
+    final String TEST_NAME = "Centaurus pleurexanthemus Green 1832-";
     final String TEST_SHORTID = "CentauruspleurexanthemusGreen1832";
     // TODO Make rank be a controlled vocab term, assuming that's how we'll implement it.
     final String TEST_RANK = "5";
@@ -249,8 +249,8 @@ public class TaxonomyAuthorityServiceTest extends AbstractServiceTestImpl { //FI
         TaxonomyAuthorityClient client = new TaxonomyAuthorityClient();
         Map<String, String> shelf1Map = new HashMap<String,String>();
         // TODO Make loc type and status be controlled vocabs.
-        shelf1Map.put(TaxonomyJAXBSchema.FULL_NAME, TEST_FULL_NAME);
-        shelf1Map.put(TaxonomyJAXBSchema.TAXON_RANK, TEST_RANK);
+        shelf1Map.put(TaxonomyJAXBSchema.NAME, TEST_NAME);
+        shelf1Map.put(TaxonomyJAXBSchema.RANK, TEST_RANK);
         shelf1Map.put(TaxonomyJAXBSchema.TERM_STATUS, TEST_STATUS);
         
         String newID = TaxonomyAuthorityClientUtils.createItemInAuthority(vcsid,
@@ -512,15 +512,15 @@ public class TaxonomyAuthorityServiceTest extends AbstractServiceTestImpl { //FI
                String displayName = taxonomy.getDisplayName();
                // Make sure displayName matches computed form
                String expectedDisplayName = 
-                   TaxonomyAuthorityClientUtils.prepareDefaultDisplayName(TEST_FULL_NAME);
+                   TaxonomyAuthorityClientUtils.prepareDefaultDisplayName(TEST_NAME);
                Assert.assertNotNull(displayName, expectedDisplayName);
                
                // Update the shortName and verify the computed name is updated.
                taxonomy.setCsid(null);
                taxonomy.setDisplayNameComputed(true);
-               taxonomy.setTaxonFullName("updated-" + TEST_FULL_NAME);
+               taxonomy.setTaxonFullName("updated-" + TEST_NAME);
                expectedDisplayName = 
-                   TaxonomyAuthorityClientUtils.prepareDefaultDisplayName("updated-" + TEST_FULL_NAME);
+                   TaxonomyAuthorityClientUtils.prepareDefaultDisplayName("updated-" + TEST_NAME);
        
                // Submit the updated resource to the service and store the response.
                PoxPayloadOut output = new PoxPayloadOut(TaxonomyAuthorityClient.SERVICE_ITEM_PAYLOAD_NAME);
@@ -1120,7 +1120,7 @@ public class TaxonomyAuthorityServiceTest extends AbstractServiceTestImpl { //FI
         // The only relevant ID may be the one used in update(), below.
         TaxonomyAuthorityClient client = new TaxonomyAuthorityClient();
         Map<String, String> nonexMap = new HashMap<String,String>();
-        nonexMap.put(TaxonomyJAXBSchema.FULL_NAME, TEST_FULL_NAME);
+        nonexMap.put(TaxonomyJAXBSchema.NAME, TEST_NAME);
         nonexMap.put(TaxonomyJAXBSchema.SHORT_IDENTIFIER, "nonEx");
         nonexMap.put(TaxonomyJAXBSchema.TERM_STATUS, TEST_STATUS);
         PoxPayloadOut multipart = 
index 9f61299208d81fe88e0619cb483d0373411cc4ac..4bf6824af2b341ec9bcd534c8b0626743cd5a0fc 100644 (file)
@@ -10,8 +10,8 @@ import org.collectionspace.services.common.vocabulary.AuthorityItemJAXBSchema;
  */
 public interface TaxonomyJAXBSchema extends AuthorityItemJAXBSchema {
        final static String TAXONOMY_COMMON = "taxonomy_common";
-       final static String FULL_NAME = "fullName";
-       final static String TAXON_RANK = "taxonRank";
+       final static String NAME = "fullName";
+       final static String RANK = "taxonRank";
 
 }
 
index 41291600f7ce25b48e3259c5feee6e8f712462aa..9e61475c6879b870d82b7065ef2be5149d4af07d 100644 (file)
@@ -79,7 +79,7 @@ import org.slf4j.LoggerFactory;
 @Consumes("application/xml")
 @Produces("application/xml")
 public class TaxonomyAuthorityResource 
-       extends AuthorityResource<TaxonomyauthoritiesCommon, TaxonomyauthoritiesCommonList, 
+       extends AuthorityResource<TaxonomyauthorityCommon, TaxonomyauthorityCommonList, 
                                                        TaxonomyCommon, TaxonomyDocumentModelHandler> {
 
     private final static String taxonomyAuthorityServiceName = "taxonomyauthorities";
@@ -98,7 +98,7 @@ public class TaxonomyAuthorityResource
      * Instantiates a new taxonomy authority resource.
      */
     public TaxonomyAuthorityResource() {
-               super(TaxonomyauthoritiesCommon.class, TaxonomyAuthorityResource.class,
+               super(TaxonomyauthorityCommon.class, TaxonomyAuthorityResource.class,
                                LOCATIONAUTHORITIES_COMMON, LOCATIONS_COMMON);
     }
 
@@ -120,7 +120,7 @@ public class TaxonomyAuthorityResource
     }
 
     @Override
-    public Class<TaxonomyauthoritiesCommon> getCommonPartClass() {
-       return TaxonomyauthoritiesCommon.class;
+    public Class<TaxonomyauthorityCommon> getCommonPartClass() {
+       return TaxonomyauthorityCommon.class;
     }
 }