]> git.aero2k.de Git - tmp/jakarta-migration.git/commitdiff
CSPACE-6949: Adding more SAS authority tests.
authorremillet <remillet@yahoo.com>
Wed, 11 May 2016 04:02:20 +0000 (21:02 -0700)
committerremillet <remillet@yahoo.com>
Wed, 11 May 2016 04:02:20 +0000 (21:02 -0700)
28 files changed:
3rdparty/nuxeo/nuxeo-server/6.0-HF21/config/vcsconfig.sql.txt
services/authority/service/src/main/java/org/collectionspace/services/common/vocabulary/AuthorityResource.java
services/authority/service/src/main/java/org/collectionspace/services/common/vocabulary/nuxeo/AuthorityDocumentModelHandler.java
services/citation/client/src/main/java/org/collectionspace/services/client/CitationAuthorityClient.java
services/client/src/main/java/org/collectionspace/services/client/AuthorityClient.java
services/client/src/main/java/org/collectionspace/services/client/AuthorityClientImpl.java
services/client/src/main/java/org/collectionspace/services/client/AuthorityProxy.java
services/client/src/main/java/org/collectionspace/services/client/GenericAuthorityClientImpl.java
services/client/src/main/java/org/collectionspace/services/client/test/AbstractAuthorityServiceTest.java
services/client/src/main/java/org/collectionspace/services/client/test/AbstractPoxServiceTestImpl.java
services/client/src/main/java/org/collectionspace/services/client/test/AbstractServiceTestImpl.java
services/common/src/main/java/org/collectionspace/services/common/AbstractMultiPartCollectionSpaceResourceImpl.java
services/common/src/main/java/org/collectionspace/services/common/context/ServiceBindingUtils.java
services/common/src/main/java/org/collectionspace/services/common/init/AddIndices.java
services/common/src/main/java/org/collectionspace/services/common/vocabulary/RefNameServiceUtils.java
services/common/src/main/java/org/collectionspace/services/nuxeo/client/java/NuxeoDocumentException.java
services/common/src/main/java/org/collectionspace/services/nuxeo/client/java/RemoteDocumentModelHandlerImpl.java
services/concept/client/src/main/java/org/collectionspace/services/client/ConceptAuthorityClient.java
services/contact/client/src/main/java/org/collectionspace/services/client/AuthorityWithContactsClient.java
services/contact/client/src/main/java/org/collectionspace/services/client/AuthorityWithContactsClientImpl.java
services/location/client/src/main/java/org/collectionspace/services/client/LocationAuthorityClient.java
services/material/client/src/main/java/org/collectionspace/services/client/MaterialAuthorityClient.java
services/organization/client/src/main/java/org/collectionspace/services/client/OrgAuthorityClient.java
services/person/client/src/main/java/org/collectionspace/services/client/PersonAuthorityClient.java
services/place/client/src/main/java/org/collectionspace/services/client/PlaceAuthorityClient.java
services/taxonomy/client/src/main/java/org/collectionspace/services/client/TaxonomyAuthorityClient.java
services/vocabulary/client/src/main/java/org/collectionspace/services/client/VocabularyClient.java
services/work/client/src/main/java/org/collectionspace/services/client/WorkAuthorityClient.java

index 57f78f8fc43952fe6472bb3eef8577d2b8575e0a..275fc1d65778b1d24a522dd0d61b8b88c56eb6f4 100644 (file)
@@ -5,29 +5,6 @@
 
 #CATEGORY: afterTableCreation
 
-#
-# Add a unique constraint to the shortidentifier column of the vocabularies_common table.
-#
-LOG.INFO Adding a unique constraint to the shortidentifier column of the vocabularies_common table
-
-#TEST:
-SELECT constraint_name FROM information_schema.constraint_column_usage WHERE table_name = 'vocabularies_common' AND constraint_name = 'shortid_unique';
-
-#IF: emptyResult
-ALTER TABLE vocabularies_common add CONSTRAINT shortid_unique UNIQUE (shortidentifier);
-
-#
-# Add a unique constraint to the shortidentifier column of the persons_common table.
-#
-LOG.INFO Adding a unique constraint to the shortidentifier column of the persons_common table
-
-#TEST:
-SELECT constraint_name FROM information_schema.constraint_column_usage WHERE table_name = 'persons_common' AND constraint_name = 'persons_shortid_unique';
-
-#IF: emptyResult
-ALTER TABLE persons_common add CONSTRAINT persons_shortid_unique UNIQUE (shortidentifier);
-
-
 #
 # Add a unique constraint to the report 'name' column of the reports_common table.
 #
index a7eeab8e456ce9b37c466220673f72d17e680d35..758ee4e1ec660c6d5fc746dc2c0fc3cf428a930c 100644 (file)
@@ -1416,6 +1416,5 @@ public abstract class AuthorityResource<AuthCommon, AuthItemHandler>
                 uriRegistryEntriesMap.putAll(getUriRegistryEntries(tenantId, getItemDocType(tenantId), UriTemplateFactory.ITEM));
         }
         return uriRegistryEntriesMap;
-    }
-  
+    }  
 }
index d56218d321eb3b37496c6be21bc6bdf2b83430ad..5cf02866df7392825063ced960be976b9f88c0ef 100644 (file)
@@ -132,6 +132,7 @@ public abstract class AuthorityDocumentModelHandler<AuthCommon>
         // Get the rev number of the authority so we can compare with rev number of shared authority
         //
         DocumentModel docModel = NuxeoUtils.getDocFromSpecifier(ctx, getRepositorySession(), authorityCommonSchemaName, specifier);
+        String authorityCsid = docModel.getName();
         Long localRev = (Long) NuxeoUtils.getProperyValue(docModel, AuthorityJAXBSchema.REV);
         String shortId = (String) NuxeoUtils.getProperyValue(docModel, AuthorityJAXBSchema.SHORT_IDENTIFIER);
         //
@@ -160,6 +161,10 @@ public abstract class AuthorityDocumentModelHandler<AuthCommon>
                        ctx.setOutput(payloadOut);
                        result = true;
                }
+               //
+               // We need to transition the authority into a replicated state now that we've sync'd it.
+               //
+               authorityResource.updateWorkflowWithTransition(ctx, authorityCsid, WorkflowClient.WORKFLOWTRANSITION_REPLICATE);
         }
         
         return result;
@@ -571,8 +576,9 @@ public abstract class AuthorityDocumentModelHandler<AuthCommon>
      */
     @Override
     public void handleWorkflowTransition(ServiceContext ctx, DocumentWrapper<DocumentModel> wrapDoc, TransitionDef transitionDef) throws Exception {
-       // Update the revision number
-       updateRevNumbers(wrapDoc);
+       if (this.getShouldUpdateRevNumber() == true) { // We don't update the rev number of synchronization requests
+               updateRevNumbers(wrapDoc);
+       }
     }
     
     @Override
index a7a468295042edd031217bcd784b7cda8c78f6df..5bc99f70f01e715fc70c88d8f4a5113f0f190622 100644 (file)
  */
 package org.collectionspace.services.client;
 
+import org.collectionspace.services.citation.CitationauthoritiesCommon;
 import org.collectionspace.services.citation.CitationsCommon;
 
 /**
  * The Class CitationAuthorityClient.
  */
-public class CitationAuthorityClient extends AuthorityClientImpl<CitationsCommon, CitationAuthorityProxy> {
+public class CitationAuthorityClient extends AuthorityClientImpl<CitationauthoritiesCommon, CitationsCommon, CitationAuthorityProxy> {
 
     public static final String SERVICE_NAME = "citationauthorities";
     public static final String SERVICE_PATH_COMPONENT = SERVICE_NAME;
index 34121443020562077ea93f40d9aa05da029be8c3..4a8d5666f2d81e39cd4b57657f8c03c2c5c21ce4 100644 (file)
@@ -1,11 +1,7 @@
 package org.collectionspace.services.client;
 
-import javax.ws.rs.PathParam;
 import javax.ws.rs.core.Response;
 
-import org.jboss.resteasy.client.ClientResponse;
-import org.collectionspace.services.common.authorityref.AuthorityRefDocList;
-import org.collectionspace.services.common.authorityref.AuthorityRefList;
 import org.collectionspace.services.jaxb.AbstractCommonList;
 
 /*
@@ -13,12 +9,13 @@ import org.collectionspace.services.jaxb.AbstractCommonList;
  * ILT - Authority item list type
  * P - Proxy type
  */
-public interface AuthorityClient<AUTHORITY_ITEM_TYPE, P extends AuthorityProxy> 
+public interface AuthorityClient<AUTHORITY_COMMON_TYPE, AUTHORITY_ITEM_TYPE, P extends AuthorityProxy> 
        extends CollectionSpacePoxClient<AbstractCommonList, P> {
 
     /** The uri path element for items in an authority */
     public static String ITEMS = "items";    //used to construct uri's in service paths for authorities.
     public static final String SHORT_IDENTIFIER = "shortIdentifier";
+    public static final String IN_AUTHORITY = "inAuthority";
     public static final String TERM_DISPLAY_NAME = "termDisplayName";
     public static final String VOCAB_DISPLAY_NAME = "displayName";
     public static final String REF_NAME = "refName";
@@ -31,7 +28,7 @@ public interface AuthorityClient<AUTHORITY_ITEM_TYPE, P extends AuthorityProxy>
     
     // Get the inAuthorityCsid (the item's parent)
     String getInAuthority(AUTHORITY_ITEM_TYPE item);
-       
+    
     // Get the inAuthorityCsid (the item's parent)
     void setInAuthority(AUTHORITY_ITEM_TYPE item, String inAuthorityCsid);
        
@@ -46,6 +43,9 @@ public interface AuthorityClient<AUTHORITY_ITEM_TYPE, P extends AuthorityProxy>
 
     //(U)pdate Item
     Response updateItem(String vcsid, String csid, PoxPayloadOut poxPayloadOut);
+    
+    //(U)pdate Item
+    Response updateNamedItemInNamedAuthority(String authShortId, String itemShortId, PoxPayloadOut poxPayloadOut);
 
     //(D)elete Item
     Response deleteItem(String vcsid, String csid);
index bba11709573c65f5d80c6d69c76cebc323107c18..77bb53b38a3dc941b60c9d9a94d907ef19a5f20e 100644 (file)
@@ -1,14 +1,15 @@
 package org.collectionspace.services.client;
 
 import javax.ws.rs.core.Response;
+
 import org.collectionspace.services.jaxb.AbstractCommonList;
 
 /*
  * P - Proxy type
  */
-public abstract class AuthorityClientImpl<AUTHORITY_ITEM_TYPE, P extends AuthorityProxy>
+public abstract class AuthorityClientImpl<AUTHORITY_COMMON_TYPE, AUTHORITY_ITEM_TYPE, P extends AuthorityProxy>
        extends AbstractPoxServiceClientImpl<AbstractCommonList, P, AUTHORITY_ITEM_TYPE>
-       implements AuthorityClient<AUTHORITY_ITEM_TYPE, P> {
+       implements AuthorityClient<AUTHORITY_COMMON_TYPE, AUTHORITY_ITEM_TYPE, P> {
 
        private static final String INCLUDE_DELETE_TRUE = Boolean.TRUE.toString();
        
@@ -46,6 +47,11 @@ public abstract class AuthorityClientImpl<AUTHORITY_ITEM_TYPE, P extends Authori
        public Response updateItem(String vcsid, String csid, PoxPayloadOut poxPayloadOut) {
        return getProxy().updateItem(vcsid, csid, poxPayloadOut.getBytes());
     }
+    
+    @Override
+    public Response updateNamedItemInNamedAuthority(String authShortId, String itemShortId, PoxPayloadOut poxPayloadOut) {
+       return getProxy().updateNamedItemInNamedAuthority(authShortId, itemShortId, poxPayloadOut.getBytes());
+    }
 
     //(D)elete Item
     @Override
index de0e158241ab8b17837f0de1a84bef3b8e0ad2d9..0fa2f351ae601ff89c7b334de617eba5188abe8c 100644 (file)
@@ -10,12 +10,8 @@ import javax.ws.rs.PathParam;
 import javax.ws.rs.Produces;
 import javax.ws.rs.QueryParam;
 import javax.ws.rs.core.Response;
-import org.jboss.resteasy.client.ClientResponse;
 
 import org.collectionspace.services.client.workflow.WorkflowClient;
-import org.collectionspace.services.common.authorityref.AuthorityRefDocList;
-import org.collectionspace.services.common.authorityref.AuthorityRefList;
-import org.collectionspace.services.jaxb.AbstractCommonList;
 
 /*
  * ILT = Item list type
@@ -43,6 +39,12 @@ public interface AuthorityProxy extends CollectionSpaceCommonListPoxProxy {
     @PUT
     @Path("/{vcsid}/items/{csid}")
     Response updateItem(@PathParam("vcsid") String vcsid, @PathParam("csid") String csid, byte[] xmlPayload);
+    
+    //(U)pdate Item    
+    @PUT
+    @Path("/urn:cspace:name({specifier})/items/urn:cspace:name({itemspecifier})")
+    Response updateNamedItemInNamedAuthority(@PathParam("specifier")String specifier,
+               @PathParam("itemspecifier")String itemspecifier, byte[] xmlPayload);
 
     //(D)elete Item
     @DELETE
index 048b78607d9bec907d1714e0c4191310b3101ac6..18fc7bc48d6bad8db6233c90fe92b1d5c7eb1010 100644 (file)
@@ -1,7 +1,7 @@
 package org.collectionspace.services.client;
 
 public class GenericAuthorityClientImpl extends
-               AuthorityClientImpl<Object, AuthorityProxy> {
+               AuthorityClientImpl<Object, Object, AuthorityProxy> {
 
        @Override
        public String getItemCommonPartName() {
index 609fe3eeb11b451221329c8b3cde473c12e87156..14f7142e7d3e57ec5da6f9223778551f72fb931c 100644 (file)
@@ -1,5 +1,7 @@
 package org.collectionspace.services.client.test;
 
+import java.lang.reflect.Array;
+import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
@@ -16,6 +18,7 @@ import org.collectionspace.services.client.PayloadOutputPart;
 import org.collectionspace.services.client.PoxPayloadIn;
 import org.collectionspace.services.client.PoxPayloadOut;
 import org.collectionspace.services.client.XmlTools;
+import org.collectionspace.services.client.workflow.WorkflowClient;
 import org.collectionspace.services.jaxb.AbstractCommonList;
 import org.dom4j.Document;
 import org.slf4j.Logger;
@@ -43,9 +46,12 @@ public abstract class AbstractAuthorityServiceTest<AUTHORITY_COMMON_TYPE, AUTHOR
        protected String knownAuthorityWithItems = null;
        protected String knownAuthorityWithItemsIdentifier = null;
        
-       protected static final String SAS_IDENTIFIER = "SAS"; 
+       protected static final String SAS_IDENTIFIER = "SAS";
+
+       private static final int SAS_ITEMLIST_SIZE = 5; 
        protected String knownSASAuthorityResourceId = null;
        protected String knownSASAuthorityResourceIdentifier = null;
+       protected List<String> knownSASItemIdentifiersList = new ArrayList<String>();
        protected String knownSASItemResourceId = null;
        protected HashMap<String, String> allSASResourceItemIdsCreated = new HashMap<String, String>(); /* itemURN, parentURN */;
 
@@ -219,8 +225,7 @@ public abstract class AbstractAuthorityServiceTest<AUTHORITY_COMMON_TYPE, AUTHOR
        setupUpdate();
 
        // Submit the request to the service and store the response.
-        AuthorityClientImpl<AUTHORITY_ITEM_TYPE, AuthorityProxy> client = 
-                       (AuthorityClientImpl<AUTHORITY_ITEM_TYPE, AuthorityProxy>)this.getClientInstance();
+        AuthorityClient client = (AuthorityClient)this.getClientInstance();
        Response res = client.readItem(knownResourceId, knownItemResourceId);
        AUTHORITY_ITEM_TYPE vitem = null;
        try {
@@ -298,9 +303,10 @@ public abstract class AbstractAuthorityServiceTest<AUTHORITY_COMMON_TYPE, AUTHOR
         
     /**
      * Sync the local with the SAS
+     * @throws Exception 
      */
-    @Test(dataProvider = "testName", dependsOnMethods = {"createSASItem", "CRUDTests"})
-    public void syncWithSAS(String testName) {
+    @Test(dataProvider = "testName", dependsOnMethods = {"createSASItemList", "CRUDTests"})
+    public void syncWithSAS(String testName) throws Exception {
         //
         // First check to see if the authority supports synchronization.
         //
@@ -327,14 +333,93 @@ public abstract class AbstractAuthorityServiceTest<AUTHORITY_COMMON_TYPE, AUTHOR
        Response response = client.syncByName(knownSASAuthorityResourceIdentifier); // Notice we're using the Short ID (short ID is the same on the local and SAS)
         try {
                int statusCode = response.getStatus();
+               Assert.assertTrue(testRequestType.isValidStatusCode(statusCode),
+                       invalidStatusCodeMessage(testRequestType, statusCode));
+               Assert.assertEquals(statusCode, testExpectedStatusCode);
+        } finally {
+               response.close();
+        }
+        
+        //
+        // Check to see if the parent authority (local) is in the "Replicated" state.
+        //
+        setupRead();
+       response = client.readByName(knownSASAuthorityResourceIdentifier); // Notice we're using the Short ID (short ID is the same on the local and SAS)
+        try {
+               int statusCode = response.getStatus();
+               Assert.assertTrue(testRequestType.isValidStatusCode(statusCode),
+                       invalidStatusCodeMessage(testRequestType, statusCode));
+               Assert.assertEquals(statusCode, testExpectedStatusCode);
+                       String workflowState = this.extractAuthorityWorkflowState(response);
+                       Assert.assertTrue(workflowState.contains(WorkflowClient.WORKFLOWSTATE_REPLICATED));  // After a sync, the parent should be in the "Replicated" state
+        } finally {
+               response.close();
+        }        
+        
+    }
+    
+    /**
+     * Check to make sure the sync with the SAS returned the correct number of items as well as items
+     * with the correct short IDs.
+     * 
+     */
+    @Test(dataProvider = "testName", dependsOnMethods = {"syncWithSAS", "CRUDTests"})
+    public void veryifySyncWithSAS(String testName) {
+        // Perform setup.
+        setupReadList();
+
+        // Submit the request to the service and store the response.
+        AuthorityClient client = (AuthorityClient) getClientInstance();
+        Response res = null;
+        res = client.readItemListForNamedAuthority(knownSASAuthorityResourceIdentifier, null, null);
+
+        try {
+               int statusCode = res.getStatus();
+       
+               // Check the status code of the response: does it match
+               // the expected response(s)?
                if (logger.isDebugEnabled()) {
-                   logger.debug(testName + ": HTTP status = " + statusCode);
+                   logger.debug("  " + testName + ": status = " + statusCode);
                }
                Assert.assertTrue(testRequestType.isValidStatusCode(statusCode),
                        invalidStatusCodeMessage(testRequestType, statusCode));
                Assert.assertEquals(statusCode, testExpectedStatusCode);
+       
+               AbstractCommonList list = res.readEntity(AbstractCommonList.class);
+               List<AbstractCommonList.ListItem> items = list.getListItem();
+               int nItemsReturned = items.size();
+               long nItemsTotal = list.getTotalItems();
+               if (logger.isDebugEnabled()) {
+                   logger.debug("  " + testName + ": Expected "
+                           + nItemsToCreateInList + " items; got: " + nItemsReturned + " of: " + nItemsTotal);
+               }
+               Assert.assertEquals(nItemsTotal, SAS_ITEMLIST_SIZE);
+       
+                       for (AbstractCommonList.ListItem item : items) {
+                               String shortId = AbstractCommonListUtils.ListItemGetElementValue(
+                                               item, AuthorityClient.SHORT_IDENTIFIER);
+                               Assert.assertTrue(knownSASItemIdentifiersList.contains(shortId)); // The local short ID should be in SAS list
+                               
+                               String workflowState = AbstractCommonListUtils.ListItemGetElementValue(
+                                               item, CollectionSpaceClient.COLLECTIONSPACE_CORE_WORKFLOWSTATE);
+                               Assert.assertTrue(workflowState.contains(WorkflowClient.WORKFLOWSTATE_REPLICATED)); // Workflow state must show up in a "replicated" state
+                               
+                               String refName = AbstractCommonListUtils.ListItemGetElementValue(
+                                               item, AuthorityClient.REF_NAME);
+                               Assert.assertTrue((refName != null), "Item refName is null or not set in the item list!");
+                               String termDisplayName = AbstractCommonListUtils.ListItemGetElementValue(item,
+                                               AuthorityClient.TERM_DISPLAY_NAME);
+                               String vocabDisplayName = AbstractCommonListUtils.ListItemGetElementValue(item,
+                                               AuthorityClient.VOCAB_DISPLAY_NAME);
+                               // One of these names needs to be set.
+                               Assert.assertTrue(!(termDisplayName == null && vocabDisplayName == null), "The item's display name is null or not set in the item list!");
+                       }
+               
+               if(logger.isTraceEnabled()){
+                       AbstractCommonListUtils.ListItemsInAbstractCommonList(list, logger, testName);
+               }
         } finally {
-               response.close();
+               res.close();
         }
     }
         
@@ -372,7 +457,7 @@ public abstract class AbstractAuthorityServiceTest<AUTHORITY_COMMON_TYPE, AUTHOR
      * @param testName
      */
     @Test(dataProvider = "testName", dependsOnMethods = {"createSASAuthority", "CRUDTests"})
-    public void createSASItem(String testName) {
+    public void createSASItemList(String testName) {
         //
         // First check to see if the authority supports synchronization.
         //
@@ -384,23 +469,29 @@ public abstract class AbstractAuthorityServiceTest<AUTHORITY_COMMON_TYPE, AUTHOR
         // Perform setup.
         setupCreate();
 
-        String shortId = "SassyActor" + System.currentTimeMillis() + Math.abs(random.nextInt()); // short ID needs to be unique
-        String newID = createItemInAuthority(getSASClientInstance(), knownSASAuthorityResourceId, shortId);
+        for (int i = 0; i < SAS_ITEMLIST_SIZE; i++) {
+               String shortId = "SassyActor" + System.currentTimeMillis() + Math.abs(random.nextInt()); // short ID needs to be unique
+               String newID = createItemInAuthority(getSASClientInstance(), knownSASAuthorityResourceId, shortId);
+       
+                       // Store the ID returned from the first item resource created
+               // for additional tests below.
+               if (knownSASItemResourceId == null) {
+                       knownSASItemResourceId = newID;
+                   if (null != testName && logger.isDebugEnabled()) {
+                       logger.debug(testName + ": knownSASItemResourceId=" + knownSASItemResourceId);
+                   }
+               }
+               
+               knownSASItemIdentifiersList.add(shortId);
 
-               // Store the ID returned from the first item resource created
-        // for additional tests below.
-        if (knownSASItemResourceId == null) {
-               knownSASItemResourceId = newID;
-            if (null != testName && logger.isDebugEnabled()) {
-                logger.debug(testName + ": knownSASItemResourceId=" + knownSASItemResourceId);
-            }
+               //
+               // Keep track of the SAS authority items we create, so we can delete them from
+               // the *local* authority after we perform a sync operation.  We need to keep track
+               // of the URN (not the CSID) since the CSIDs will differ on the SAS vs local.
+               //
+               this.allSASResourceItemIdsCreated.put(this.getUrnIdentifier(shortId), getUrnIdentifier(getSASAuthorityIdentifier()));
         }
-        //
-        // Keep track of the SAS authority items we create, so we can delete them from
-        // the *local* authority after we perform a sync operation.  We need to keep track
-        // of the URN (not the CSID) since the CSIDs will differ on the SAS vs local.
-        //
-        this.allSASResourceItemIdsCreated.put(this.getUrnIdentifier(shortId), getUrnIdentifier(getSASAuthorityIdentifier()));
+        
     }
     
     @Test(dataProvider = "testName", dataProviderClass = AbstractServiceTestImpl.class,
@@ -487,6 +578,7 @@ public abstract class AbstractAuthorityServiceTest<AUTHORITY_COMMON_TYPE, AUTHOR
                
                return result;
        }
+               
        
     /**
      * Extracts the short ID from a service request payload
@@ -495,7 +587,7 @@ public abstract class AbstractAuthorityServiceTest<AUTHORITY_COMMON_TYPE, AUTHOR
      * @return
      * @throws Exception
      */
-       public String extractAuthorityShortId(Response res) throws Exception {
+       protected String extractAuthorityShortId(Response res) throws Exception {
                String result = null;
                
         PoxPayloadIn input = new PoxPayloadIn((String)res.readEntity(getEntityResponseType()));                
@@ -503,7 +595,7 @@ public abstract class AbstractAuthorityServiceTest<AUTHORITY_COMMON_TYPE, AUTHOR
                result = XmlTools.getElementValue(document, "//" + AuthorityClient.SHORT_IDENTIFIER);
 
                return result;
-       }
+       }    
        
     
     @Test(dataProvider = "testName", dataProviderClass = AbstractServiceTestImpl.class,
@@ -710,8 +802,7 @@ public abstract class AbstractAuthorityServiceTest<AUTHORITY_COMMON_TYPE, AUTHOR
         AUTHORITY_ITEM_TYPE theUpdate = null;
 
         // Retrieve the contents of a resource to update.
-        AuthorityClientImpl<AUTHORITY_ITEM_TYPE, AuthorityProxy> client =
-                       (AuthorityClientImpl<AUTHORITY_ITEM_TYPE, AuthorityProxy>)this.getClientInstance();
+        AuthorityClient client = (AuthorityClient)this.getClientInstance();
         Response res = client.readItem(knownResourceId, knownItemResourceId);
         try {
                if (logger.isDebugEnabled()) {
@@ -761,6 +852,81 @@ public abstract class AbstractAuthorityServiceTest<AUTHORITY_COMMON_TYPE, AUTHOR
         }
     }
     
+    @Test(dataProvider = "testName", dataProviderClass = AbstractServiceTestImpl.class,
+               dependsOnMethods = {"readItem", "CRUDTests", "veryifySyncWithSAS"})
+    public void updateLocalItemWithSync(String testName) throws Exception {
+        // Perform setup.
+        setupUpdate();
+        AUTHORITY_ITEM_TYPE theUpdate = null;
+
+        // Retrieve the contents of a shared authority item that we're going to update.
+        AUTHORITY_ITEM_TYPE sasAuthorityItem = null;
+        AuthorityClient sasClient = (AuthorityClient) this.getSASClientInstance();
+        Response res = sasClient.readNamedItemInNamedAuthority(knownSASAuthorityResourceIdentifier, knownSASItemIdentifiersList.get(0));
+        try {
+               if (logger.isDebugEnabled()) {
+                   logger.debug(testName + ": read status = " + res.getStatus());
+               }
+               Assert.assertEquals(res.getStatus(), testExpectedStatusCode);
+       
+               sasAuthorityItem = extractItemCommonPartValue(res);  // This is a SAS authority item
+               Assert.assertNotNull(sasAuthorityItem);
+        } finally {
+               res.close();
+        }
+
+        // Update the contents of this authority item so we can post an UPDATE to the server
+        theUpdate = updateItemInstance(sasAuthorityItem);
+
+        // Submit the updated authority item and check the response.
+        PoxPayloadOut output = this.createItemRequestTypeInstance(theUpdate);
+        res = sasClient.updateNamedItemInNamedAuthority(knownSASAuthorityResourceIdentifier, knownSASItemIdentifiersList.get(0), output);
+        AUTHORITY_ITEM_TYPE updatedAuthorityItem = null;
+        try {
+               int statusCode = res.getStatus();
+       
+               // Check the status code of the response: does it match the expected response(s)?
+               if (logger.isDebugEnabled()) {
+                   logger.debug("updateItem: status = " + statusCode);
+               }
+               Assert.assertTrue(testRequestType.isValidStatusCode(statusCode),
+                       invalidStatusCodeMessage(testRequestType, statusCode));
+               Assert.assertEquals(statusCode, testExpectedStatusCode);
+       
+               // Retrieve the updated authority item and verify that its contents exist.
+               updatedAuthorityItem = extractItemCommonPartValue(res);
+               Assert.assertNotNull(updatedAuthorityItem);
+
+               compareUpdatedItemInstances(theUpdate, updatedAuthorityItem);
+        } finally {
+               res.close();
+        }
+        
+        // Synchronize the item's parent authority and verify the update we just made
+        // to the SAS appears locally
+        setupSync();
+        AuthorityClient localClient = (AuthorityClient) this.getClientInstance();
+       Response response = localClient.syncByName(knownSASAuthorityResourceIdentifier); // Notice we're using the Short ID (short ID is the same on the local and SAS)
+        try {
+               int statusCode = response.getStatus();
+               Assert.assertTrue(testRequestType.isValidStatusCode(statusCode), invalidStatusCodeMessage(testRequestType, statusCode));
+               Assert.assertEquals(statusCode, testExpectedStatusCode);
+        } finally {
+               response.close();
+        }        
+        
+        setupRead();
+        res = localClient.readNamedItemInNamedAuthority(knownSASAuthorityResourceIdentifier, knownSASItemIdentifiersList.get(0));
+        try {
+               Assert.assertEquals(res.getStatus(), testExpectedStatusCode);
+               AUTHORITY_ITEM_TYPE syncedAuthorityItem = extractItemCommonPartValue(res);
+               Assert.assertNotNull(syncedAuthorityItem);
+               compareUpdatedItemInstances(sasAuthorityItem, updatedAuthorityItem);
+        } finally {
+               res.close();
+        }
+    }    
+    
     protected abstract PoxPayloadOut createNonExistenceItemInstance(String commonPartName, String identifier);
     
     /* (non-Javadoc)
@@ -775,8 +941,7 @@ public abstract class AbstractAuthorityServiceTest<AUTHORITY_COMMON_TYPE, AUTHOR
        // Submit the request to the service and store the response.
        // Note: The ID used in this 'create' call may be arbitrary.
        // The only relevant ID may be the one used in update(), below.
-        AuthorityClientImpl<AUTHORITY_ITEM_TYPE, AuthorityProxy> client =
-                       (AuthorityClientImpl<AUTHORITY_ITEM_TYPE, AuthorityProxy>)this.getClientInstance();
+        AuthorityClient client = (AuthorityClient)this.getClientInstance();
        PoxPayloadOut multipart = createNonExistenceItemInstance(client.getItemCommonPartName(), NON_EXISTENT_ID);
        Response res = client.updateItem(knownResourceId, NON_EXISTENT_ID, multipart);
        try {
index 362b31ccc0d1c177534475d581ec18754d41cf77..9729892811a00f8ae2945e2d03ca1ca42fce9b1b 100644 (file)
@@ -2,13 +2,17 @@ package org.collectionspace.services.client.test;
 
 import javax.ws.rs.core.Response;
 
+import org.collectionspace.services.client.AuthorityClient;
 import org.collectionspace.services.client.CollectionSpaceClient;
 import org.collectionspace.services.client.PayloadInputPart;
 import org.collectionspace.services.client.PayloadOutputPart;
 import org.collectionspace.services.client.PoxPayloadIn;
 import org.collectionspace.services.client.PoxPayloadOut;
 import org.collectionspace.services.client.AbstractCommonListUtils;
+import org.collectionspace.services.client.XmlTools;
+import org.collectionspace.services.client.workflow.WorkflowClient;
 import org.collectionspace.services.jaxb.AbstractCommonList;
+import org.dom4j.Document;
 import org.jboss.resteasy.client.ClientResponse;
 import org.testng.Assert;
 
@@ -45,6 +49,38 @@ public abstract class AbstractPoxServiceTestImpl<CLT extends AbstractCommonList,
        return list.getTotalItems();            
     }
     
+    /**
+     * Extracts the workflow state of PoxPayloadIn
+     * 
+     * @param res
+     * @return
+     * @throws Exception
+     */
+       protected String extractAuthorityWorkflowState(PoxPayloadIn input) throws Exception {
+               String result = null;
+               
+               Document document = input.getDOMDocument();
+               result = XmlTools.getElementValue(document, "//" + WorkflowClient.WORKFLOWSTATE_XML_ELEMENT_NAME);
+
+               return result;
+       }
+    
+    /**
+     * Extracts the workflow state of a response payload
+     * 
+     * @param res
+     * @return
+     * @throws Exception
+     */
+       protected String extractAuthorityWorkflowState(Response res) throws Exception {
+               String result = null;
+               
+        PoxPayloadIn input = new PoxPayloadIn((String)res.readEntity(getEntityResponseType()));                
+        result = extractAuthorityWorkflowState(input);
+                       
+               return result;
+       }
+    
     /**
      * The entity type expected from the JAX-RS Response object
      */
index 5231bce2cb7dda1f1904fa344278309701b38054..f34eb0d3fe1ace7397632c9fa510a6af45198b50 100644 (file)
@@ -24,8 +24,6 @@
 package org.collectionspace.services.client.test;
 
 import java.io.File;
-import java.lang.reflect.ParameterizedType;
-import java.lang.reflect.TypeVariable;
 
 import org.collectionspace.services.jaxb.AbstractCommonList;
 import org.collectionspace.services.workflow.WorkflowCommon;
@@ -37,13 +35,11 @@ import org.collectionspace.services.client.PayloadOutputPart;
 import org.collectionspace.services.client.PoxPayloadIn;
 import org.collectionspace.services.client.PoxPayloadOut;
 import org.collectionspace.services.client.workflow.WorkflowClient;
-import org.jboss.resteasy.client.ClientResponse;
+
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.testng.Assert;
 import org.testng.annotations.Test;
-
-import javax.ws.rs.core.GenericType;
 import javax.ws.rs.core.Response;
 
 /**
@@ -1252,7 +1248,6 @@ public abstract class AbstractServiceTestImpl<CLT, CPT, REQUEST_TYPE, RESPONSE_T
         //
         Assert.assertEquals(updatedWorkflowCommons.getCurrentLifeCycleState(), lifeCycleState);
     }
-
 }
 
 
index 19b2513f994256a41f4e031e9027c291cafde036..28e404971cc31c396db5659695a758f270d90d26 100644 (file)
@@ -233,30 +233,23 @@ public abstract class AbstractMultiPartCollectionSpaceResourceImpl extends Abstr
        return result;
     }
     
-    /*
-     * We should change this code.  The RepositoryClient (from call to getRepositoryClient) should support a call doWorkflowTransition() instead.
-     */
-    //FIXME: This method is almost identical to the method org.collectionspace.services.common.vocabulary.updateWorkflowWithTransition() so
-    // they should be consolidated -be DRY (don't repeat yourself).
+    public PoxPayloadOut updateWorkflowWithTransition(ServiceContext existingContext,
+               String csid,
+               String transition) {
 
-    @PUT
-    @Path("{csid}" + WorkflowClient.SERVICE_PATH + "/" + "{transition}")
-    public byte[] updateWorkflowWithTransition(
-               @Context UriInfo uriInfo,
-               @PathParam("csid") String csid,
-               @PathParam("transition") String transition) {
         PoxPayloadOut result = null;
                 
         try {
+               MultipartServiceContext ctx = (MultipartServiceContext)existingContext;
                //
                // Create an empty workflow_commons input part and set it into a new "workflow" sub-resource context
                PoxPayloadIn input = new PoxPayloadIn(WorkflowClient.SERVICE_PAYLOAD_NAME, new WorkflowCommon(), 
                                WorkflowClient.SERVICE_COMMONPART_NAME);
-            MultipartServiceContext ctx = (MultipartServiceContext) createServiceContext(WorkflowClient.SERVICE_NAME, input, uriInfo);
+            ctx.setInput(input);
                
             // Create a service context and document handler for the parent resource.
-            ServiceContext<PoxPayloadIn, PoxPayloadOut> parentCtx = createServiceContext(uriInfo);
-            DocumentHandler targetDocHandler = this.createDocumentHandler(parentCtx);      
+            ServiceContext<PoxPayloadIn, PoxPayloadOut> parentCtx = createServiceContext(ctx.getUriInfo());
+            DocumentHandler targetDocHandler = createDocumentHandler(parentCtx);  
             ctx.setProperty(WorkflowClient.TARGET_DOCHANDLER, targetDocHandler); //added as a context param for the workflow document handler -it will call the parent's dochandler "prepareForWorkflowTranstion" method
 
             // When looking for the document, we need to use the parent's workspace name -not the "workflow" workspace name
@@ -277,6 +270,29 @@ public abstract class AbstractMultiPartCollectionSpaceResourceImpl extends Abstr
         } catch (Exception e) {
             throw bigReThrow(e, ServiceMessages.UPDATE_FAILED + WorkflowClient.SERVICE_PAYLOAD_NAME, csid);
         }
+        
+        return result;
+    
+    }
+    
+    /*
+     * We should consider changing this code.  The RepositoryClient (from call to getRepositoryClient) could support a call doWorkflowTransition() instead?
+     */
+    @PUT
+    @Path("{csid}" + WorkflowClient.SERVICE_PATH + "/" + "{transition}")
+    public byte[] updateWorkflowWithTransition(
+               @Context UriInfo uriInfo,
+               @PathParam("csid") String csid,
+               @PathParam("transition") String transition) {
+        PoxPayloadOut result = null;
+                
+        try {
+               ServiceContext ctx = (ServiceContext) createServiceContext(WorkflowClient.SERVICE_NAME, uriInfo);
+               result = this.updateWorkflowWithTransition(ctx, csid, transition);
+        } catch (Exception e) {
+            throw bigReThrow(e, ServiceMessages.UPDATE_FAILED + WorkflowClient.SERVICE_PAYLOAD_NAME, csid);
+        }
+        
         return result.getBytes();
     }
     
index 84b8f2cc51feefb07c79f5b9390fd7ea5e7d1ea5..3d2afa09d6c49295af8b3f5a128dadbe8ad043c8 100644 (file)
@@ -34,6 +34,7 @@ public class ServiceBindingUtils {
        public static final String SERVICE_TYPE_OBJECT = "object";
        public static final String SERVICE_TYPE_PROCEDURE = "procedure";
        public static final String SERVICE_TYPE_AUTHORITY = "authority";
+       public static final String SERVICE_TYPE_VOCABULARY = "vocabulary";
        public static final String SERVICE_TYPE_UTILITY = "utility";
        public static final String SERVICE_TYPE_SECURITY = "security";
        public static final String SERVICE_COMMONPART_ID = "1";
index d4e0b1d31dfad4ea32c5a6bb81f0f15cbe816d04..24bacdef70d2d545f0c399be8701445213488ecf 100644 (file)
@@ -86,6 +86,10 @@ public class AddIndices extends InitHandler implements IInitHandler {
     private final static String INDEX_SEP = "_";
     private final static String INDEX_SUFFIX = INDEX_SEP + "idx";
     private final static String SHORT_ID = AuthorityClient.SHORT_IDENTIFIER.toLowerCase();
+    private final static String IN_AUTHORITY = AuthorityClient.IN_AUTHORITY.toLowerCase();
+    
+    private final static String AUTHORITY_TYPE = ServiceBindingUtils.SERVICE_TYPE_AUTHORITY;
+    private final static String VOCABULARY_TYPE = ServiceBindingUtils.SERVICE_TYPE_VOCABULARY;
 
 
     /** See the class javadoc for this class: it shows the syntax supported in the configuration params.
@@ -139,7 +143,8 @@ public class AddIndices extends InitHandler implements IInitHandler {
      * @return
      * @throws Exception
      */
-    private boolean shortIdConstraintExists(String dataSourceName,
+    private boolean shortIdConstraintExists(ServiceBindingType sbt,
+               String dataSourceName,
                String repositoryName,
                String cspaceInstanceId,
                String tableName) throws Exception {
@@ -195,7 +200,8 @@ public class AddIndices extends InitHandler implements IInitHandler {
        return result;
     }
     
-    private boolean createShortIdConstraint(String dataSourceName,
+    private boolean createShortIdConstraint(ServiceBindingType sbt,
+               String dataSourceName,
                String repositoryName,
                String cspaceInstanceId,
                String tableName) {
@@ -207,8 +213,18 @@ public class AddIndices extends InitHandler implements IInitHandler {
                DatabaseProductType databaseProductType = JDBCTools.getDatabaseProductType(dataSourceName, repositoryName);
                if (databaseProductType == DatabaseProductType.POSTGRESQL) {
                        String constraintName = String.format("%s_%s_unique", tableName, SHORT_ID);
-                       sql = String.format("ALTER TABLE %s add CONSTRAINT %s UNIQUE (%s)",
-                                       tableName, constraintName, SHORT_ID);
+                       //
+                       // Check if we've got a parent or an item.  Parents need the constraint on the short id, but items
+                       // have the constraint on the combined shortidentifier and inauthority (parent's CSID) columns
+                       //
+                       String serviceType = sbt.getType();
+                       if (serviceType.equalsIgnoreCase(AUTHORITY_TYPE) || serviceType.equalsIgnoreCase(VOCABULARY_TYPE)) { 
+                               sql = String.format("ALTER TABLE %s add CONSTRAINT %s UNIQUE (%s, %s)",         // constraint for an item
+                                               tableName, constraintName, SHORT_ID, IN_AUTHORITY);
+                       } else {
+                               sql = String.format("ALTER TABLE %s add CONSTRAINT %s UNIQUE (%s)",                     // constraint for a parent
+                                               tableName, constraintName, SHORT_ID);                   
+                       }
                } else {
                    errorMsg = String.format("Database server type '%s' is not supported by CollectionSpace.  Could not create constraint on column '%s' of table '%s'.",
                                databaseProductType.getName(), SHORT_ID, tableName);
@@ -295,8 +311,8 @@ public class AddIndices extends InitHandler implements IInitHandler {
                //
                // If the constraint doesn't exist, create it.
                //
-               if (shortIdConstraintExists(dataSourceName, repositoryName, cspaceInstanceId, tableName) == false) {
-                       if (createShortIdConstraint(dataSourceName, repositoryName, cspaceInstanceId, tableName) == true) {
+               if (shortIdConstraintExists(sbt, dataSourceName, repositoryName, cspaceInstanceId, tableName) == false) {
+                       if (createShortIdConstraint(sbt, dataSourceName, repositoryName, cspaceInstanceId, tableName) == true) {
                                logger.info(String.format("Created uniqueness constraint on '%s' column of table '%s' in repository '%s'.",
                                                SHORT_ID, tableName, repositoryName));                  
                        } else {
index 3a64e357b8b39b5250cc7502306efdc4e96a2656..6db4c8d154be53812e3d9d34488d14133c763a9e 100644 (file)
@@ -714,7 +714,7 @@ public class RefNameServiceUtils {
                 + " AND " + (authTermInfo.inAuthority.name != null
                 ? authTermInfo.inAuthority.name : authTermInfo.inAuthority.csid)
                 + " AND " + (authTermInfo.name != null
-                ? authTermInfo.name : authTermInfo.csid); // REM - This seems likely to cause trouble.  We should consider searching for the full refname -excluding the display name suffix
+                ? authTermInfo.name : authTermInfo.csid); // REM - This seems likely to cause trouble?  We should consider searching for the full refname -excluding the display name suffix?
 
         String whereClauseStr = QueryManager.createWhereClauseFromKeywords(keywords);
 
index 67b60efebc60626f9e8918b43f7cce5c43d757bf..1ed3cfe00d7e3198bfa0a9fe215a40cebc020d73 100644 (file)
@@ -2,6 +2,9 @@ package org.collectionspace.services.nuxeo.client.java;
 
 import org.collectionspace.services.common.CSWebApplicationException;
 import org.collectionspace.services.common.document.DocumentException;
+import org.apache.http.HttpStatus;
+
+import org.nuxeo.ecm.core.api.ConcurrentUpdateException;
 import org.nuxeo.ecm.core.api.WrappedException;
 
 public class NuxeoDocumentException extends DocumentException {
@@ -37,7 +40,9 @@ public class NuxeoDocumentException extends DocumentException {
 
        public NuxeoDocumentException(Throwable cause) {
                super(cause);
-               // TODO Auto-generated constructor stub
+               if (cause instanceof ConcurrentUpdateException) {
+                       this.setErrorCode(HttpStatus.SC_CONFLICT); // HttpStatus.CONFLICT_409
+               }
        }
        
        private static String getExceptionClassName(Throwable exception) {
index 0d46995d5414f9ee133d1981ae4f7f24f53454c9..94e0d35332adf3807a4361d4170863687f42c0b2 100644 (file)
@@ -193,7 +193,7 @@ public abstract class   RemoteDocumentModelHandlerImpl<T, TL>
        @Override
        public void handleWorkflowTransition(ServiceContext ctx, DocumentWrapper<DocumentModel> wrapDoc, TransitionDef transitionDef)
                        throws Exception {
-               // Do nothing by default, but children can override if they want.  The real workflow transition happens in the WorkflowDocumemtModelHandler class
+               // Do nothing by default, but children can override if they want.  The real workflow transition happens in the WorkflowDocumentModelHandler class
        }
        
     @Override
index 59676e355258c6350345392df1a8e1020217619b..ff1688fe4480183a7a2b1bee48d7340bd03450a4 100644 (file)
  */
 package org.collectionspace.services.client;
 
+import org.collectionspace.services.concept.ConceptauthoritiesCommon;
 import org.collectionspace.services.concept.ConceptsCommon;
 
 /**
  * The Class ConceptAuthorityClient.
  */
-public class ConceptAuthorityClient extends AuthorityClientImpl<ConceptsCommon, ConceptAuthorityProxy> {
+public class ConceptAuthorityClient extends AuthorityClientImpl<ConceptauthoritiesCommon, ConceptsCommon, ConceptAuthorityProxy> {
 
     public static final String SERVICE_NAME = "conceptauthorities";
     public static final String SERVICE_PATH_COMPONENT = SERVICE_NAME;
index 55b87c584c675e599c90733a79b894980f0242f5..1c36c35605ae853c0b9e008bd6cbb51873ef6588 100644 (file)
@@ -10,8 +10,8 @@ import org.jboss.resteasy.client.ClientResponse;
  * ILT - Authority item list type
  * P - Proxy type
  */
-public interface AuthorityWithContactsClient<AUTHORITY_ITEM_TYPE, P extends AuthorityProxy>
-       extends AuthorityClient<AUTHORITY_ITEM_TYPE, P> {
+public interface AuthorityWithContactsClient<AUTHORITY_COMMON_TYPE, AUTHORITY_ITEM_TYPE, P extends AuthorityProxy>
+       extends AuthorityClient<AUTHORITY_COMMON_TYPE, AUTHORITY_ITEM_TYPE, P> {
     /**
      * Creates the contact.
      *
index 6429f633f9cef17ce7a67efe24f23a672add7914..b69f4ce7805d435d07ea7461eb895dcdc630d6c5 100644 (file)
@@ -10,9 +10,9 @@ import org.collectionspace.services.jaxb.AbstractCommonList;
  * ILT - Authority item list type
  * P - Proxy type
  */
-public abstract class AuthorityWithContactsClientImpl<AUTHORITY_ITEM_TYPE, P extends AuthorityWithContactsProxy>
-       extends AuthorityClientImpl<AUTHORITY_ITEM_TYPE, P>
-       implements AuthorityWithContactsClient<AUTHORITY_ITEM_TYPE, P> {
+public abstract class AuthorityWithContactsClientImpl<AUTHORITY_COMMON_TYPE, AUTHORITY_ITEM_TYPE, P extends AuthorityWithContactsProxy>
+       extends AuthorityClientImpl<AUTHORITY_COMMON_TYPE, AUTHORITY_ITEM_TYPE, P>
+       implements AuthorityWithContactsClient<AUTHORITY_COMMON_TYPE, AUTHORITY_ITEM_TYPE, P> {
        
        public AuthorityWithContactsClientImpl(String clientPropertiesFilename) {
                super(clientPropertiesFilename);
index 1d77e339c47df1f0b70e1f7cf28639be11a024b8..bb08ef00020168218a00ff9698717d8d79a146a7 100644 (file)
  */
 package org.collectionspace.services.client;
 
+import org.collectionspace.services.location.LocationauthoritiesCommon;
 import org.collectionspace.services.location.LocationsCommon;
 
 /**
  * The Class LocationAuthorityClient.
  */
-public class LocationAuthorityClient extends AuthorityClientImpl<LocationsCommon, LocationAuthorityProxy> {
+public class LocationAuthorityClient extends AuthorityClientImpl<LocationauthoritiesCommon, LocationsCommon, LocationAuthorityProxy> {
 
     public static final String SERVICE_NAME = "locationauthorities";
     public static final String SERVICE_PATH_COMPONENT = SERVICE_NAME;
index 789bb9d926637ade93a099c192d67b989217ca16..75cae9f9d7833a20d9d77bab91ac8f189f4209f1 100644 (file)
  */
 package org.collectionspace.services.client;
 
+import org.collectionspace.services.material.MaterialauthoritiesCommon;
 import org.collectionspace.services.material.MaterialsCommon;
 
 /**
  * The Class MaterialAuthorityClient.
  */
-public class MaterialAuthorityClient extends AuthorityClientImpl<MaterialsCommon, MaterialAuthorityProxy> {
+public class MaterialAuthorityClient extends AuthorityClientImpl<MaterialauthoritiesCommon, MaterialsCommon, MaterialAuthorityProxy> {
 
     public static final String SERVICE_NAME = "materialauthorities";
     public static final String SERVICE_PATH_COMPONENT = SERVICE_NAME;
index 9ccf7c46ba8c578128def8bc024c5c84937e1f81..5898a026bfa1a41596a450ca2947680a804b2e81 100644 (file)
 package org.collectionspace.services.client;
 
 import org.collectionspace.services.organization.OrganizationsCommon;
+import org.collectionspace.services.organization.OrgauthoritiesCommon;
 
 /**
  * The Class OrgAuthorityClient.
  */
-public class OrgAuthorityClient extends AuthorityWithContactsClientImpl<OrganizationsCommon, OrgAuthorityProxy> {
+public class OrgAuthorityClient extends AuthorityWithContactsClientImpl<OrgauthoritiesCommon, OrganizationsCommon, OrgAuthorityProxy> {
 
     public static final String SERVICE_NAME = "orgauthorities";
     public static final String SERVICE_PATH_COMPONENT = SERVICE_NAME;
index 9d10f853a96162b6d94b00231eab8a7049ff70e5..b16c5406c81c1ae881b11e12d61c5cea87b2da1e 100644 (file)
  */
 package org.collectionspace.services.client;
 
+import org.collectionspace.services.person.PersonauthoritiesCommon;
 import org.collectionspace.services.person.PersonsCommon;
 
 /**
  * The Class PersonAuthorityClient.
  */
-public class PersonAuthorityClient extends AuthorityWithContactsClientImpl<PersonsCommon, PersonAuthorityProxy> {
+public class PersonAuthorityClient extends AuthorityWithContactsClientImpl<PersonauthoritiesCommon, PersonsCommon, PersonAuthorityProxy> {
 
     public static final String SERVICE_NAME = "personauthorities";
     public static final String SERVICE_PATH_COMPONENT = SERVICE_NAME;
index 1bd6ebefcd80fc8d096b1a40f7f61bc59256a9f7..512cc54c0a589ed40cf3af16a5f8fd4f6daa6161 100644 (file)
  */
 package org.collectionspace.services.client;
 
+import org.collectionspace.services.place.PlaceauthoritiesCommon;
 import org.collectionspace.services.place.PlacesCommon;
 
 /**
  * The Class PlaceAuthorityClient.
  */
-public class PlaceAuthorityClient extends AuthorityClientImpl<PlacesCommon, PlaceAuthorityProxy> {
+public class PlaceAuthorityClient extends AuthorityClientImpl<PlaceauthoritiesCommon, PlacesCommon, PlaceAuthorityProxy> {
 
     public static final String SERVICE_NAME = "placeauthorities";
     public static final String SERVICE_PATH_COMPONENT = SERVICE_NAME;
index 99a45d75783a79fca7236c0feb2429a1ca0a21d3..1e5841a34b2c102c60d017224edfb8df41711e01 100644 (file)
 package org.collectionspace.services.client;
 
 import org.collectionspace.services.taxonomy.TaxonCommon;
+import org.collectionspace.services.taxonomy.TaxonomyauthorityCommon;
 
 /**
  * The Class TaxonomyAuthorityClient.
  */
-public class TaxonomyAuthorityClient extends AuthorityClientImpl<TaxonCommon, TaxonomyAuthorityProxy> {
+public class TaxonomyAuthorityClient extends AuthorityClientImpl<TaxonomyauthorityCommon, TaxonCommon, TaxonomyAuthorityProxy> {
 
     public static final String SERVICE_NAME = "taxonomyauthority";
     public static final String SERVICE_PATH_COMPONENT = SERVICE_NAME;
index c9822ec14017776d48835502b54a9c335d8801cf..af335dabbfe4d29884e201f8c67097fbd5b092db 100644 (file)
  */
 package org.collectionspace.services.client;
 
+import org.collectionspace.services.vocabulary.VocabulariesCommon;
 import org.collectionspace.services.vocabulary.VocabularyitemsCommon;
 
 /**
  * The Class VocabularyClient.
  */
-public class VocabularyClient extends AuthorityClientImpl<VocabularyitemsCommon, VocabularyProxy> {
+public class VocabularyClient extends AuthorityClientImpl<VocabulariesCommon, VocabularyitemsCommon, VocabularyProxy> {
        public static final String SERVICE_NAME = "vocabularies";
        public static final String SERVICE_PATH_COMPONENT = SERVICE_NAME;       
        public static final String SERVICE_PATH = "/" + SERVICE_PATH_COMPONENT;
index 6809c39f75e430a8a9033c061942ef1bfb83bb54..4c1d84183d38451691598e2412b4ebf3bdb20654 100644 (file)
  */
 package org.collectionspace.services.client;
 
+import org.collectionspace.services.work.WorkauthoritiesCommon;
 import org.collectionspace.services.work.WorksCommon;
 
 /**
  * The Class WorkAuthorityClient.
  */
-public class WorkAuthorityClient extends AuthorityClientImpl<WorksCommon, WorkAuthorityProxy> {
+public class WorkAuthorityClient extends AuthorityClientImpl<WorkauthoritiesCommon, WorksCommon, WorkAuthorityProxy> {
 
     public static final String SERVICE_NAME = "workauthorities";
     public static final String SERVICE_PATH_COMPONENT = SERVICE_NAME;