From: Aron Roberts Date: Fri, 6 May 2011 20:01:48 +0000 (+0000) Subject: CSPACE-3865: Full taxonomy service module now builds. Need to integrate this into... X-Git-Url: https://git.aero2k.de/?a=commitdiff_plain;h=612b03bcc9b91b46cedeec071aaf276e575906a9;p=tmp%2Fjakarta-migration.git CSPACE-3865: Full taxonomy service module now builds. Need to integrate this into the services project and run/debug tests. --- diff --git a/services/taxonomy/client/src/main/java/org/collectionspace/services/client/TaxonomyAuthorityClientUtils.java b/services/taxonomy/client/src/main/java/org/collectionspace/services/client/TaxonomyAuthorityClientUtils.java index 58aba6fe9..9d04693d9 100644 --- a/services/taxonomy/client/src/main/java/org/collectionspace/services/client/TaxonomyAuthorityClientUtils.java +++ b/services/taxonomy/client/src/main/java/org/collectionspace/services/client/TaxonomyAuthorityClientUtils.java @@ -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()){ diff --git a/services/taxonomy/client/src/test/java/org/collectionspace/services/client/test/TaxonomyAuthorityServiceTest.java b/services/taxonomy/client/src/test/java/org/collectionspace/services/client/test/TaxonomyAuthorityServiceTest.java index c409a701f..7a80e2242 100644 --- a/services/taxonomy/client/src/test/java/org/collectionspace/services/client/test/TaxonomyAuthorityServiceTest.java +++ b/services/taxonomy/client/src/test/java/org/collectionspace/services/client/test/TaxonomyAuthorityServiceTest.java @@ -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 shelf1Map = new HashMap(); // 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 nonexMap = new HashMap(); - 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 = diff --git a/services/taxonomy/jaxb/src/main/java/org/collectionspace/services/TaxonomyJAXBSchema.java b/services/taxonomy/jaxb/src/main/java/org/collectionspace/services/TaxonomyJAXBSchema.java index 9f6129920..4bf6824af 100644 --- a/services/taxonomy/jaxb/src/main/java/org/collectionspace/services/TaxonomyJAXBSchema.java +++ b/services/taxonomy/jaxb/src/main/java/org/collectionspace/services/TaxonomyJAXBSchema.java @@ -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"; } diff --git a/services/taxonomy/service/src/main/java/org/collectionspace/services/taxonomy/TaxonomyAuthorityResource.java b/services/taxonomy/service/src/main/java/org/collectionspace/services/taxonomy/TaxonomyAuthorityResource.java index 41291600f..9e61475c6 100644 --- a/services/taxonomy/service/src/main/java/org/collectionspace/services/taxonomy/TaxonomyAuthorityResource.java +++ b/services/taxonomy/service/src/main/java/org/collectionspace/services/taxonomy/TaxonomyAuthorityResource.java @@ -79,7 +79,7 @@ import org.slf4j.LoggerFactory; @Consumes("application/xml") @Produces("application/xml") public class TaxonomyAuthorityResource - extends AuthorityResource { 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 getCommonPartClass() { - return TaxonomyauthoritiesCommon.class; + public Class getCommonPartClass() { + return TaxonomyauthorityCommon.class; } }