]> git.aero2k.de Git - tmp/jakarta-migration.git/commitdiff
DRYD-458: Allowing Person and Org payloads to include contacts_common payload in...
authorRichard Millet <remillet@yahoo.com>
Tue, 21 Aug 2018 02:59:51 +0000 (19:59 -0700)
committerRichard Millet <remillet@yahoo.com>
Tue, 21 Aug 2018 02:59:51 +0000 (19:59 -0700)
42 files changed:
services/acquisition/client/src/test/java/org/collectionspace/services/client/test/AcquisitionAuthRefsTest.java
services/authority/service/pom.xml
services/authority/service/src/main/java/org/collectionspace/services/common/vocabulary/AuthorityResourceWithContacts.java [moved from services/contact/service/src/main/java/org/collectionspace/services/contact/AuthorityResourceWithContacts.java with 94% similarity]
services/authority/service/src/main/java/org/collectionspace/services/common/vocabulary/nuxeo/AuthorityItemWithContactsDocumentModelHandler.java [new file with mode: 0644]
services/blob/client/src/test/java/org/collectionspace/services/client/test/BlobAuthRefsTest.java
services/claim/client/src/test/java/org/collectionspace/services/client/test/ClaimAuthRefsTest.java
services/collectionobject/client/src/test/java/org/collectionspace/services/client/test/CollectionObjectAuthRefsTest.java
services/common/src/main/java/org/collectionspace/services/nuxeo/client/java/RemoteDocumentModelHandlerImpl.java
services/conditioncheck/client/src/test/java/org/collectionspace/services/client/test/ConditioncheckAuthRefsTest.java
services/conservation/client/src/test/java/org/collectionspace/services/client/test/ConservationAuthRefsTest.java
services/contact/service/pom.xml
services/intake/client/src/test/java/org/collectionspace/services/client/test/IntakeAuthRefsTest.java
services/intake/client/src/test/java/org/collectionspace/services/client/test/OrganizationAuthRefDocsTest.java
services/intake/client/src/test/java/org/collectionspace/services/client/test/PersonAuthRefDocsTest.java
services/loanin/client/src/test/java/org/collectionspace/services/client/test/LoaninAuthRefsTest.java
services/loanout/client/src/test/java/org/collectionspace/services/client/test/LoanoutAuthRefsTest.java
services/media/client/src/test/java/org/collectionspace/services/client/test/MediaAuthRefsTest.java
services/movement/client/src/test/java/org/collectionspace/services/client/test/MovementAuthRefsTest.java
services/objectexit/client/src/test/java/org/collectionspace/services/client/test/ObjectExitAuthRefsTest.java
services/organization/client/src/main/java/org/collectionspace/services/client/OrgAuthorityClient.java
services/organization/client/src/main/java/org/collectionspace/services/client/OrgAuthorityClientUtils.java
services/organization/client/src/main/java/org/collectionspace/services/client/OrgAuthorityProxy.java
services/organization/client/src/main/java/org/collectionspace/services/client/OrganizationClient.java [new file with mode: 0644]
services/organization/client/src/test/java/org/collectionspace/services/client/test/OrgAuthorityAuthRefsTest.java
services/organization/client/src/test/java/org/collectionspace/services/client/test/OrgAuthorityServiceTest.java
services/organization/service/src/main/java/org/collectionspace/services/organization/OrgAuthorityResource.java
services/organization/service/src/main/java/org/collectionspace/services/organization/nuxeo/OrgAuthorityDocumentModelHandler.java
services/organization/service/src/main/java/org/collectionspace/services/organization/nuxeo/OrganizationDocumentModelHandler.java
services/person/client/src/main/java/org/collectionspace/services/client/PersonAuthorityClient.java
services/person/client/src/main/java/org/collectionspace/services/client/PersonAuthorityClientUtils.java
services/person/client/src/main/java/org/collectionspace/services/client/PersonAuthorityProxy.java
services/person/client/src/main/java/org/collectionspace/services/client/PersonClient.java [new file with mode: 0644]
services/person/client/src/test/java/org/collectionspace/services/client/test/PersonAuthoritySearchTest.java
services/person/client/src/test/java/org/collectionspace/services/client/test/PersonAuthorityServicePerfTest.java
services/person/client/src/test/java/org/collectionspace/services/client/test/PersonAuthorityServiceTest.java
services/person/service/src/main/java/org/collectionspace/services/person/PersonAuthorityResource.java
services/person/service/src/main/java/org/collectionspace/services/person/nuxeo/PersonAuthorityDocumentModelHandler.java
services/person/service/src/main/java/org/collectionspace/services/person/nuxeo/PersonDocumentModelHandler.java
services/pottag/client/src/test/java/org/collectionspace/services/client/test/PottagAuthRefsTest.java
services/propagation/client/src/test/java/org/collectionspace/services/client/test/PropagationAuthRefsTest.java
services/relation/client/src/test/java/org/collectionspace/services/client/test/RelationServiceTest.java
services/uoc/client/src/test/java/org/collectionspace/services/client/test/UocAuthRefsTest.java

index 41ea72852f087bf760bbe8967e1942c929c3e6e8..ad6a2f950ace7ab5df19f2866cc4b9db0589ef37 100644 (file)
@@ -33,7 +33,7 @@ import org.collectionspace.services.PersonJAXBSchema;
 import org.collectionspace.services.client.AcquisitionClient;
 import org.collectionspace.services.client.CollectionSpaceClient;
 import org.collectionspace.services.client.PayloadOutputPart;
-import org.collectionspace.services.client.PersonAuthorityClient;
+import org.collectionspace.services.client.PersonClient;
 import org.collectionspace.services.client.PersonAuthorityClientUtils;
 import org.collectionspace.services.client.PoxPayloadIn;
 import org.collectionspace.services.client.PoxPayloadOut;
@@ -155,7 +155,7 @@ public class AcquisitionAuthRefsTest extends BaseServiceTest<AbstractCommonList>
        }
 
        protected void createPersonRefs() throws Exception{
-               PersonAuthorityClient personAuthClient = new PersonAuthorityClient();
+               PersonClient personAuthClient = new PersonClient();
                PoxPayloadOut multipart = PersonAuthorityClientUtils.createPersonAuthorityInstance(
                                PERSON_AUTHORITY_NAME, PERSON_AUTHORITY_NAME, personAuthClient.getCommonPartName());
                Response res = personAuthClient.create(multipart);
@@ -212,7 +212,7 @@ public class AcquisitionAuthRefsTest extends BaseServiceTest<AbstractCommonList>
                 personTerms.add(term);
         String result = null;
         
-               PersonAuthorityClient personAuthClient = new PersonAuthorityClient();
+               PersonClient personAuthClient = new PersonClient();
                PoxPayloadOut multipart = PersonAuthorityClientUtils.createPersonInstance(personAuthCSID, 
                                        authRefName, personInfo, personTerms, personAuthClient.getItemCommonPartName());
                Response res = personAuthClient.createItem(personAuthCSID, multipart);
@@ -356,7 +356,7 @@ public class AcquisitionAuthRefsTest extends BaseServiceTest<AbstractCommonList>
                        // Note: Any non-success responses are ignored and not reported.
                        acquisitionClient.delete(resourceId).close();
                }
-               PersonAuthorityClient personAuthClient = new PersonAuthorityClient();
+               PersonClient personAuthClient = new PersonClient();
                // Delete persons before PersonAuth
                for (String resourceId : personIdsCreated) {
                        // Note: Any non-success responses are ignored and not reported.
index 5dcca17df8bcb17e9f2970392e69500cec4e05e5..34e050c23cf348d9126669b58b5ec63aadbab8ee 100644 (file)
 
        <dependencies>
                <!-- CollectionSpace dependencies -->
+               <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.contact.service</artifactId>
+            <version>${project.version}</version>
+        </dependency>
                <dependency>
                        <groupId>org.collectionspace.services</groupId>
                        <artifactId>org.collectionspace.services.config</artifactId>
@@ -21,9 +21,8 @@
  *  See the License for the specific language governing permissions and
  *  limitations under the License.
  */
-package org.collectionspace.services.contact;
+package org.collectionspace.services.common.vocabulary;
 
-import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
@@ -35,7 +34,6 @@ import javax.ws.rs.PUT;
 import javax.ws.rs.Path;
 import javax.ws.rs.PathParam;
 import javax.ws.rs.Produces;
-import javax.ws.rs.WebApplicationException;
 import javax.ws.rs.core.Context;
 import javax.ws.rs.core.MultivaluedMap;
 import javax.ws.rs.core.Response;
@@ -130,6 +128,7 @@ public abstract class AuthorityResourceWithContacts<AuthCommon, AuthItemHandler>
             ServiceContext ctx = createServiceContext(getContactServiceName(), input);
             DocumentHandler handler = createContactDocumentHandler(ctx, parentcsid, itemcsid, ui);
             String csid = getRepositoryClient(ctx).create(ctx, handler);
+
             UriBuilder path = UriBuilder.fromResource(resourceClass);
             path.path("" + parentcsid + "/items/" + itemcsid + "/contacts/" + csid);
             Response response = Response.created(path.build()).build();
@@ -141,6 +140,23 @@ public abstract class AuthorityResourceWithContacts<AuthCommon, AuthItemHandler>
                     itemspecifier);
         }
     }
+    
+    public String createContact(ServiceContext existingCtx, String parentCsid, String itemCsid, PoxPayloadIn input,
+            UriInfo ui) throws Exception {
+        ServiceContext ctx = createServiceContext(getContactServiceName(), input);
+        if (existingCtx != null) {
+            Object repoSession = existingCtx.getCurrentRepositorySession();
+            if (repoSession != null) {
+                ctx.setCurrentRepositorySession(repoSession);
+                ctx.setProperties(existingCtx.getProperties());
+            }
+        }
+        
+        DocumentHandler handler = createContactDocumentHandler(ctx, parentCsid, itemCsid, ui);
+        String csid = getRepositoryClient(ctx).create(ctx, handler);
+
+        return csid;
+    }
 
     /**
      * Gets the contact list.
diff --git a/services/authority/service/src/main/java/org/collectionspace/services/common/vocabulary/nuxeo/AuthorityItemWithContactsDocumentModelHandler.java b/services/authority/service/src/main/java/org/collectionspace/services/common/vocabulary/nuxeo/AuthorityItemWithContactsDocumentModelHandler.java
new file mode 100644 (file)
index 0000000..8b5dad9
--- /dev/null
@@ -0,0 +1,49 @@
+package org.collectionspace.services.common.vocabulary.nuxeo;
+
+import org.collectionspace.services.client.ContactClient;
+import org.collectionspace.services.client.PayloadInputPart;
+import org.collectionspace.services.client.PoxPayloadIn;
+import org.collectionspace.services.client.PoxPayloadOut;
+import org.collectionspace.services.common.context.ServiceContext;
+import org.collectionspace.services.common.document.DocumentWrapper;
+import org.collectionspace.services.common.vocabulary.AuthorityResourceWithContacts;
+import org.nuxeo.ecm.core.api.DocumentModel;
+
+public abstract class AuthorityItemWithContactsDocumentModelHandler<AICommon> extends AuthorityItemDocumentModelHandler<AICommon> {
+
+    public AuthorityItemWithContactsDocumentModelHandler(String authorityCommonSchemaName,
+            String authorityItemCommonSchemaName) {
+        super(authorityCommonSchemaName, authorityItemCommonSchemaName);
+        // TODO Auto-generated constructor stub
+    }
+
+    @Override
+    public void completeCreate(DocumentWrapper<DocumentModel> wrapDoc) throws Exception {
+        super.completeCreate(wrapDoc);
+        handleContactPayload(wrapDoc);
+    }
+
+    private void handleContactPayload(DocumentWrapper<DocumentModel> wrapDoc) throws Exception {
+        ContactClient contactClient = new ContactClient();
+        ServiceContext<PoxPayloadIn, PoxPayloadOut> ctx = getServiceContext();
+        PoxPayloadIn input = ctx.getInput();
+        PayloadInputPart contactPart = input.getPart(contactClient.getCommonPartName());
+        if (contactPart != null) {
+            DocumentModel docModel = wrapDoc.getWrappedObject();
+            String authorityCsid = this.getInAuthorityCsid();
+            String itemCsid = this.getCsid(docModel);
+            createContact(authorityCsid, itemCsid, contactPart);
+        }
+    }
+
+    private void createContact(String authorityCsid, String itemCsid, PayloadInputPart contactPart) throws Exception {
+        ContactClient contactClient = new ContactClient();
+        String payloadTemplate = "<?xml version='1.0' encoding='UTF-8'?><document>%s</document>";
+        String xmlPayload = String.format(payloadTemplate, contactPart.asXML());
+        PoxPayloadIn input = new PoxPayloadIn(xmlPayload);
+                
+        AuthorityResourceWithContacts contactResource = (AuthorityResourceWithContacts) getServiceContext().getResource();
+        
+        contactResource.createContact(getServiceContext(), authorityCsid, itemCsid, input, null);
+    }
+}
index 04f97b9858bcda1e7ecaf2a024ded2115700bf95..b81924f20d29f38686f255587c9acbbb0b958519 100644 (file)
@@ -33,7 +33,7 @@ import org.collectionspace.services.PersonJAXBSchema;
 import org.collectionspace.services.client.CollectionSpaceClient;
 import org.collectionspace.services.client.BlobClient;
 import org.collectionspace.services.client.PayloadOutputPart;
-import org.collectionspace.services.client.PersonAuthorityClient;
+import org.collectionspace.services.client.PersonClient;
 import org.collectionspace.services.client.PersonAuthorityClientUtils;
 import org.collectionspace.services.client.PoxPayloadIn;
 import org.collectionspace.services.client.PoxPayloadOut;
@@ -125,7 +125,7 @@ public class BlobAuthRefsTest extends BaseServiceTest<AbstractCommonList> {
     }
 
     protected void createPersonRefs() throws Exception {
-        PersonAuthorityClient personAuthClient = new PersonAuthorityClient();
+        PersonClient personAuthClient = new PersonClient();
         // Create a temporary PersonAuthority resource, and its corresponding refName by which it can be identified.
         PoxPayloadOut multipart = PersonAuthorityClientUtils.createPersonAuthorityInstance(PERSON_AUTHORITY_NAME, PERSON_AUTHORITY_NAME, personAuthClient.getCommonPartName());
         Response res = personAuthClient.create(multipart);
@@ -153,7 +153,7 @@ public class BlobAuthRefsTest extends BaseServiceTest<AbstractCommonList> {
     protected String createPerson(String firstName, String surName, String shortId, String authRefName) throws Exception {
        String result = null;
        
-        PersonAuthorityClient personAuthClient = new PersonAuthorityClient();
+        PersonClient personAuthClient = new PersonClient();
         Map<String, String> personInfo = new HashMap<String, String>();
         personInfo.put(PersonJAXBSchema.FORE_NAME, firstName);
         personInfo.put(PersonJAXBSchema.SUR_NAME, surName);
@@ -250,7 +250,7 @@ public class BlobAuthRefsTest extends BaseServiceTest<AbstractCommonList> {
             return;
         }
         logger.debug("Cleaning up temporary resources created for testing ...");
-        PersonAuthorityClient personAuthClient = new PersonAuthorityClient();
+        PersonClient personAuthClient = new PersonClient();
         // Delete Person resource(s) (before PersonAuthority resources).
         for (String resourceId : personIdsCreated) {
             // Note: Any non-success responses are ignored and not reported.
index 8cc3ba40c87cb03235f7d5d45a01ae298ad6df9a..0faf71cd14ff625b95f06bca57f832d4296e19a0 100644 (file)
@@ -33,7 +33,7 @@ import javax.ws.rs.core.Response;
 import org.collectionspace.services.PersonJAXBSchema;
 import org.collectionspace.services.client.CollectionSpaceClient;
 import org.collectionspace.services.client.ClaimClient;
-import org.collectionspace.services.client.PersonAuthorityClient;
+import org.collectionspace.services.client.PersonClient;
 import org.collectionspace.services.client.PersonAuthorityClientUtils;
 import org.collectionspace.services.client.PayloadOutputPart;
 import org.collectionspace.services.client.PoxPayloadIn;
@@ -136,7 +136,7 @@ public class ClaimAuthRefsTest extends BaseServiceTest<AbstractCommonList> {
     protected void createPersonRefs() throws Exception{
         // Create a temporary PersonAuthority resource, and its corresponding
         // refName by which it can be identified.
-        PersonAuthorityClient personAuthClient = new PersonAuthorityClient();
+        PersonClient personAuthClient = new PersonClient();
        PoxPayloadOut multipart = PersonAuthorityClientUtils.createPersonAuthorityInstance(
            PERSON_AUTHORITY_NAME, PERSON_AUTHORITY_NAME, personAuthClient.getCommonPartName());
         Response res = personAuthClient.create(multipart);
@@ -164,7 +164,7 @@ public class ClaimAuthRefsTest extends BaseServiceTest<AbstractCommonList> {
     }
     
     protected String createPerson(String firstName, String surName, String shortId, String authRefName ) throws Exception {
-        PersonAuthorityClient personAuthClient = new PersonAuthorityClient();
+        PersonClient personAuthClient = new PersonClient();
         Map<String, String> personInfo = new HashMap<String,String>();
         personInfo.put(PersonJAXBSchema.FORE_NAME, firstName);
         personInfo.put(PersonJAXBSchema.SUR_NAME, surName);
@@ -293,7 +293,7 @@ public class ClaimAuthRefsTest extends BaseServiceTest<AbstractCommonList> {
         
         //
         // Delete Person resource(s) (before PersonAuthority resources). 
-        PersonAuthorityClient personAuthClient = new PersonAuthorityClient();
+        PersonClient personAuthClient = new PersonClient();
         for (String resourceId : personIdsCreated) {
             // Note: Any non-success responses are ignored and not reported.
             personAuthClient.deleteItem(personAuthCSID, resourceId).close();
index 429232c217f1f6e0d6412b263b0c8f3cf98e7e93..8d5ca6d3dadbf3dc9e52764bd65b02cb2b0d6a68 100644 (file)
@@ -34,10 +34,10 @@ import org.collectionspace.services.OrganizationJAXBSchema;
 import org.collectionspace.services.PersonJAXBSchema;
 import org.collectionspace.services.client.CollectionObjectClient;
 import org.collectionspace.services.client.CollectionSpaceClient;
-import org.collectionspace.services.client.OrgAuthorityClient;
+import org.collectionspace.services.client.OrganizationClient;
 import org.collectionspace.services.client.OrgAuthorityClientUtils;
 import org.collectionspace.services.client.PayloadOutputPart;
-import org.collectionspace.services.client.PersonAuthorityClient;
+import org.collectionspace.services.client.PersonClient;
 import org.collectionspace.services.client.PersonAuthorityClientUtils;
 import org.collectionspace.services.client.PoxPayloadIn;
 import org.collectionspace.services.client.PoxPayloadOut;
@@ -220,7 +220,7 @@ public class CollectionObjectAuthRefsTest extends BaseServiceTest<AbstractCommon
      */
     private void createPersonAuthority(String displayName, String shortIdentifier) throws Exception {
         testSetup(STATUS_CREATED, ServiceRequestType.CREATE);
-        PersonAuthorityClient personAuthClient = new PersonAuthorityClient();
+        PersonClient personAuthClient = new PersonClient();
        PoxPayloadOut multipart = PersonAuthorityClientUtils.createPersonAuthorityInstance(
                        displayName, shortIdentifier, personAuthClient.getCommonPartName());
         Response res = personAuthClient.create(multipart);
@@ -258,7 +258,7 @@ public class CollectionObjectAuthRefsTest extends BaseServiceTest<AbstractCommon
         term.setTermDisplayName(termName);
         term.setTermName(termName);
         personTerms.add(term);
-        PersonAuthorityClient personAuthClient = new PersonAuthorityClient();
+        PersonClient personAuthClient = new PersonClient();
        PoxPayloadOut multipart = PersonAuthorityClientUtils.createPersonInstance(personAuthCSID,
                                personAuthRefName, personInfo, personTerms, personAuthClient.getItemCommonPartName());
         Response res = personAuthClient.createItem(personAuthCSID, multipart);
@@ -333,7 +333,7 @@ public class CollectionObjectAuthRefsTest extends BaseServiceTest<AbstractCommon
      */
     private void createOrgAuthority(String displayName, String shortIdentifier) throws Exception {
         testSetup(STATUS_CREATED, ServiceRequestType.CREATE);
-        OrgAuthorityClient orgAuthClient = new OrgAuthorityClient();
+        OrganizationClient orgAuthClient = new OrganizationClient();
         PoxPayloadOut multipart = OrgAuthorityClientUtils.createOrgAuthorityInstance(
                        displayName, shortIdentifier, orgAuthClient.getCommonPartName());
         Response res = orgAuthClient.create(multipart);
@@ -372,7 +372,7 @@ public class CollectionObjectAuthRefsTest extends BaseServiceTest<AbstractCommon
         term.setTermName(shortName);
         orgTerms.add(term);
         
-        OrgAuthorityClient orgAuthClient = new OrgAuthorityClient();
+        OrganizationClient orgAuthClient = new OrganizationClient();
        PoxPayloadOut multipart =
                OrgAuthorityClientUtils.createOrganizationInstance(orgAuthRefName, orgInfo, orgTerms, orgAuthClient.getItemCommonPartName());
         Response res = orgAuthClient.createItem(orgAuthCSID, multipart);
@@ -531,7 +531,7 @@ public class CollectionObjectAuthRefsTest extends BaseServiceTest<AbstractCommon
         
         //
         // Delete persons before PersonAuth
-        PersonAuthorityClient personAuthClient = new PersonAuthorityClient();
+        PersonClient personAuthClient = new PersonClient();
         for (String resourceId : personIdsCreated) {
             // Note: Any non-success responses are ignored and not reported.
             personAuthClient.deleteItem(personAuthCSID, resourceId).close();
@@ -540,7 +540,7 @@ public class CollectionObjectAuthRefsTest extends BaseServiceTest<AbstractCommon
         
         //
         // Delete organizations before OrgAuth
-        OrgAuthorityClient orgAuthClient = new OrgAuthorityClient();
+        OrganizationClient orgAuthClient = new OrganizationClient();
         for (String resourceId : orgIdsCreated) {
             // Note: Any non-success responses are ignored and not reported.
             orgAuthClient.deleteItem(orgAuthCSID, resourceId).close();
index 9230c25bdf062f0efc0772c7fcefc9d625b3e574..2844812bd2cd9a0f0e89184b7230c2b342d8684d 100644 (file)
@@ -1596,7 +1596,7 @@ public abstract class   RemoteDocumentModelHandlerImpl<T, TL>
     // since a save on Create might fail, and we would not want to create relations for something
     // that may not be created...
     private void handleRelationsPayload(DocumentWrapper<DocumentModel> wrapDoc, boolean forUpdate) throws Exception {
-       ServiceContext<PoxPayloadIn, PoxPayloadOut> ctx = getServiceContext();
+           ServiceContext<PoxPayloadIn, PoxPayloadOut> ctx = getServiceContext();
         PoxPayloadIn input = ctx.getInput();
         DocumentModel documentModel = (wrapDoc.getWrappedObject());
         String itemCsid = documentModel.getName();
index af8196de0870874fa82de7a4b6932a7ca5786c51..1a7ef765d225af988d30af48ed4e266fbea84211 100644 (file)
@@ -32,7 +32,7 @@ import javax.ws.rs.core.Response;
 import org.collectionspace.services.PersonJAXBSchema;
 import org.collectionspace.services.client.CollectionSpaceClient;
 import org.collectionspace.services.client.ConditioncheckClient;
-import org.collectionspace.services.client.PersonAuthorityClient;
+import org.collectionspace.services.client.PersonClient;
 import org.collectionspace.services.client.PersonAuthorityClientUtils;
 import org.collectionspace.services.client.PayloadOutputPart;
 import org.collectionspace.services.client.PoxPayloadIn;
@@ -146,7 +146,7 @@ public class ConditioncheckAuthRefsTest extends BaseServiceTest<AbstractCommonLi
     }
     
     protected void createPersonRefs() throws Exception{
-        PersonAuthorityClient personAuthClient = new PersonAuthorityClient();
+        PersonClient personAuthClient = new PersonClient();
         // Create a temporary PersonAuthority resource, and its corresponding
         // refName by which it can be identified.
         PoxPayloadOut multipart = PersonAuthorityClientUtils.createPersonAuthorityInstance(
@@ -173,7 +173,7 @@ public class ConditioncheckAuthRefsTest extends BaseServiceTest<AbstractCommonLi
     protected String createPerson(String firstName, String surName, String shortId, String authRefName ) throws Exception {
        String result = null;
        
-        PersonAuthorityClient personAuthClient = new PersonAuthorityClient();
+        PersonClient personAuthClient = new PersonClient();
         Map<String, String> personInfo = new HashMap<String,String>();
         personInfo.put(PersonJAXBSchema.FORE_NAME, firstName);
         personInfo.put(PersonJAXBSchema.SUR_NAME, surName);
@@ -300,7 +300,7 @@ public class ConditioncheckAuthRefsTest extends BaseServiceTest<AbstractCommonLi
         if (logger.isDebugEnabled()) {
             logger.debug("Cleaning up temporary resources created for testing ...");
         }
-        PersonAuthorityClient personAuthClient = new PersonAuthorityClient();
+        PersonClient personAuthClient = new PersonClient();
         // Delete Person resource(s) (before PersonAuthority resources).
         
         for (String resourceId : personIdsCreated) {
index 9892a8c3de92f678826cb7298dd3bee82f7de377..7f567fc0ea52ff652b2e32ac69e3275170bd86eb 100644 (file)
@@ -32,7 +32,7 @@ import javax.ws.rs.core.Response;
 import org.collectionspace.services.PersonJAXBSchema;
 import org.collectionspace.services.client.CollectionSpaceClient;
 import org.collectionspace.services.client.ConservationClient;
-import org.collectionspace.services.client.PersonAuthorityClient;
+import org.collectionspace.services.client.PersonClient;
 import org.collectionspace.services.client.PersonAuthorityClientUtils;
 import org.collectionspace.services.client.PayloadOutputPart;
 import org.collectionspace.services.client.PoxPayloadIn;
@@ -164,7 +164,7 @@ public class ConservationAuthRefsTest extends BaseServiceTest<AbstractCommonList
     }
     
     protected void createPersonRefs() throws Exception{
-        PersonAuthorityClient personAuthClient = new PersonAuthorityClient();
+        PersonClient personAuthClient = new PersonClient();
         // Create a temporary PersonAuthority resource, and its corresponding
         // refName by which it can be identified.
        PoxPayloadOut multipart = PersonAuthorityClientUtils.createPersonAuthorityInstance(
@@ -211,7 +211,7 @@ public class ConservationAuthRefsTest extends BaseServiceTest<AbstractCommonList
     protected String createPerson(String firstName, String surName, String shortId, String authRefName ) throws Exception {
         String result = null;
        
-        PersonAuthorityClient personAuthClient = new PersonAuthorityClient();
+        PersonClient personAuthClient = new PersonClient();
         Map<String, String> personInfo = new HashMap<String,String>();
         personInfo.put(PersonJAXBSchema.FORE_NAME, firstName);
         personInfo.put(PersonJAXBSchema.SUR_NAME, surName);
@@ -340,7 +340,7 @@ public class ConservationAuthRefsTest extends BaseServiceTest<AbstractCommonList
         if (logger.isDebugEnabled()) {
             logger.debug("Cleaning up temporary resources created for testing ...");
         }
-        PersonAuthorityClient personAuthClient = new PersonAuthorityClient();
+        PersonClient personAuthClient = new PersonClient();
         // Delete Person resource(s) (before PersonAuthority resources).
         
         for (String resourceId : personIdsCreated) {
index ecdd7b0fb552d818e1e66ca9c788076cbc361331..447d043f5012f0fce677ee04d59ea7aa48eed4f1 100644 (file)
             <artifactId>org.collectionspace.services.config</artifactId>
             <version>${project.version}</version>
         </dependency>
-        <dependency>
+<!--         <dependency>
             <groupId>org.collectionspace.services</groupId>
             <artifactId>org.collectionspace.services.authority.service</artifactId>
             <optional>true</optional>
             <version>${project.version}</version>
         </dependency>        
-        <dependency>
-->        <dependency>
             <groupId>org.collectionspace.services</groupId>
             <artifactId>org.collectionspace.services.common</artifactId>
         </dependency>
index eebe5109d514c1452bcbd22e6d9a7f06bc0c87e6..24b96e4cc3947b24cf6fc4ad941f89b8e582a87c 100644 (file)
@@ -33,7 +33,7 @@ import org.collectionspace.services.PersonJAXBSchema;
 import org.collectionspace.services.client.CollectionSpaceClient;
 import org.collectionspace.services.client.IntakeClient;
 import org.collectionspace.services.client.PayloadOutputPart;
-import org.collectionspace.services.client.PersonAuthorityClient;
+import org.collectionspace.services.client.PersonClient;
 import org.collectionspace.services.client.PersonAuthorityClientUtils;
 import org.collectionspace.services.client.PoxPayloadIn;
 import org.collectionspace.services.client.PoxPayloadOut;
@@ -166,7 +166,7 @@ public class IntakeAuthRefsTest extends BaseServiceTest<AbstractCommonList> {
        //
        // First, create a new person authority
        //
-        PersonAuthorityClient personAuthClient = new PersonAuthorityClient();
+        PersonClient personAuthClient = new PersonClient();
        PoxPayloadOut multipart = PersonAuthorityClientUtils.createPersonAuthorityInstance(
                        PERSON_AUTHORITY_NAME, PERSON_AUTHORITY_NAME, personAuthClient.getCommonPartName());
         Response res = personAuthClient.create(multipart);
@@ -205,7 +205,7 @@ public class IntakeAuthRefsTest extends BaseServiceTest<AbstractCommonList> {
     protected String createPerson(String firstName, String surName, String shortId, String authRefName ) throws Exception {
        String result = null;
        
-        PersonAuthorityClient personAuthClient = new PersonAuthorityClient();
+        PersonClient personAuthClient = new PersonClient();
         Map<String, String> personInfo = new HashMap<String,String>();
         personInfo.put(PersonJAXBSchema.FORE_NAME, firstName);
         personInfo.put(PersonJAXBSchema.SUR_NAME, surName);
@@ -329,7 +329,7 @@ public class IntakeAuthRefsTest extends BaseServiceTest<AbstractCommonList> {
         }
         //
         // Delete all the person records then the parent resource
-        PersonAuthorityClient personAuthClient = new PersonAuthorityClient();
+        PersonClient personAuthClient = new PersonClient();
         for (String resourceId : personIdsCreated) {
             personAuthClient.deleteItem(personAuthCSID, resourceId).close();
         }
index f75673788260bb480994b708f60b13677a5c1540..87a7a909588298e0ca8bd767c22d11edded68b58 100644 (file)
@@ -32,7 +32,7 @@ import javax.ws.rs.core.Response;
 import org.collectionspace.services.OrganizationJAXBSchema;
 import org.collectionspace.services.client.CollectionSpaceClient;
 import org.collectionspace.services.client.IntakeClient;
-import org.collectionspace.services.client.OrgAuthorityClient;
+import org.collectionspace.services.client.OrganizationClient;
 import org.collectionspace.services.client.OrgAuthorityClientUtils;
 import org.collectionspace.services.client.PayloadOutputPart;
 import org.collectionspace.services.client.PoxPayloadOut;
@@ -172,7 +172,7 @@ public class OrganizationAuthRefDocsTest extends BaseServiceTest<AbstractCommonL
      * @throws Exception 
      */
     protected void createOrgRefs() throws Exception{
-        OrgAuthorityClient orgAuthClient = new OrgAuthorityClient();
+        OrganizationClient orgAuthClient = new OrganizationClient();
         //orgAuthRefName = 
        //      OrgAuthorityClientUtils.createOrgAuthRefName(ORGANIZATION_AUTHORITY_NAME, null);
         PoxPayloadOut multipart = OrgAuthorityClientUtils.createOrgAuthorityInstance(
@@ -218,7 +218,7 @@ public class OrganizationAuthRefDocsTest extends BaseServiceTest<AbstractCommonL
     protected String createOrganization(String shortId, String shortName, String longName) throws Exception {
        String result = null;
        
-        OrgAuthorityClient orgAuthClient = new OrgAuthorityClient();
+        OrganizationClient orgAuthClient = new OrganizationClient();
         Map<String, String> orgInfo = new HashMap<String,String>();
         orgInfo.put(OrganizationJAXBSchema.SHORT_IDENTIFIER, shortId);
         
@@ -255,7 +255,7 @@ public class OrganizationAuthRefDocsTest extends BaseServiceTest<AbstractCommonL
         testSetup(STATUS_OK, ServiceRequestType.READ);
         
         // Get the auth ref docs and check them
-       OrgAuthorityClient orgAuthClient = new OrgAuthorityClient();
+       OrganizationClient orgAuthClient = new OrganizationClient();
        Response refDocListResp = orgAuthClient.getReferencingObjects(orgAuthCSID, currentOwnerOrgCSID);
        AuthorityRefDocList list = null;
        try {
@@ -325,7 +325,7 @@ public class OrganizationAuthRefDocsTest extends BaseServiceTest<AbstractCommonL
             intakeClient.delete(resourceId).close();
         }
         // Delete persons before PersonAuth
-        OrgAuthorityClient personAuthClient = new OrgAuthorityClient();
+        OrganizationClient personAuthClient = new OrganizationClient();
         for (String resourceId : orgIdsCreated) {
             personAuthClient.deleteItem(orgAuthCSID, resourceId).close();
         }
index 14c411b105bd7ef21b40736dc6a4bc8d922bccd7..50f5baa800662c23ba341ee39d5b0d245575d3ee 100644 (file)
@@ -33,7 +33,7 @@ import org.collectionspace.services.PersonJAXBSchema;
 import org.collectionspace.services.client.CollectionSpaceClient;
 import org.collectionspace.services.client.IntakeClient;
 import org.collectionspace.services.client.PayloadOutputPart;
-import org.collectionspace.services.client.PersonAuthorityClient;
+import org.collectionspace.services.client.PersonClient;
 import org.collectionspace.services.client.PersonAuthorityClientUtils;
 import org.collectionspace.services.client.PoxPayloadOut;
 import org.collectionspace.services.common.api.GregorianCalendarDateTimeUtils;
@@ -170,7 +170,7 @@ public class PersonAuthRefDocsTest extends BaseServiceTest<AbstractCommonList> {
      * @throws Exception 
      */
     protected void createPersonRefs() throws Exception {
-        PersonAuthorityClient personAuthClient = new PersonAuthorityClient();
+        PersonClient personAuthClient = new PersonClient();
         PoxPayloadOut multipart = PersonAuthorityClientUtils.createPersonAuthorityInstance(
                 PERSON_AUTHORITY_NAME, PERSON_AUTHORITY_NAME, personAuthClient.getCommonPartName());
         Response res = personAuthClient.create(multipart);
@@ -226,7 +226,7 @@ public class PersonAuthRefDocsTest extends BaseServiceTest<AbstractCommonList> {
     protected String createPerson(String firstName, String surName, String shortId, String authRefName) throws Exception {
        String result = null;
        
-        PersonAuthorityClient personAuthClient = new PersonAuthorityClient();
+        PersonClient personAuthClient = new PersonClient();
         Map<String, String> personInfo = new HashMap<String, String>();
         personInfo.put(PersonJAXBSchema.FORE_NAME, firstName);
         personInfo.put(PersonJAXBSchema.SUR_NAME, surName);
@@ -263,7 +263,7 @@ public class PersonAuthRefDocsTest extends BaseServiceTest<AbstractCommonList> {
 
         // Get the auth ref docs and check them
 
-        PersonAuthorityClient personAuthClient = new PersonAuthorityClient();
+        PersonClient personAuthClient = new PersonClient();
         Response res = personAuthClient.getReferencingObjects(personAuthCSID, currentOwnerPersonCSID);
         AuthorityRefDocList list = null;
         try {
@@ -303,7 +303,7 @@ public class PersonAuthRefDocsTest extends BaseServiceTest<AbstractCommonList> {
         //
         // Get the referencing objects
         //
-        personAuthClient = new PersonAuthorityClient();
+        personAuthClient = new PersonClient();
         res = personAuthClient.getReferencingObjects(personAuthCSID, depositorPersonCSID);
         try {
                assertStatusCode(res, testName);
@@ -354,7 +354,7 @@ public class PersonAuthRefDocsTest extends BaseServiceTest<AbstractCommonList> {
         // Get the auth ref docs and check them
 
         // Single scalar field
-        PersonAuthorityClient personAuthClient = new PersonAuthorityClient();
+        PersonClient personAuthClient = new PersonClient();
         Response res = personAuthClient.getReferencingObjects(personAuthCSID, insurerPersonCSID);
         AuthorityRefDocList list = null;
         try {
@@ -425,7 +425,7 @@ public class PersonAuthRefDocsTest extends BaseServiceTest<AbstractCommonList> {
             intakeClient.delete(resourceId).close();
         }
         // Delete persons before PersonAuth
-        PersonAuthorityClient personAuthClient = new PersonAuthorityClient();
+        PersonClient personAuthClient = new PersonClient();
         for (String resourceId : personIdsCreated) {
             personAuthClient.deleteItem(personAuthCSID, resourceId).close();
         }
index b8ef0b8eb0e56e684d40dddbce45ab24ceb8a6a4..7e8c473fdbdc2664351698d6eb84dee4553e4570 100644 (file)
@@ -32,7 +32,7 @@ import javax.ws.rs.core.Response;
 import org.collectionspace.services.PersonJAXBSchema;
 import org.collectionspace.services.client.CollectionSpaceClient;
 import org.collectionspace.services.client.LoaninClient;
-import org.collectionspace.services.client.PersonAuthorityClient;
+import org.collectionspace.services.client.PersonClient;
 import org.collectionspace.services.client.PersonAuthorityClientUtils;
 import org.collectionspace.services.client.PayloadOutputPart;
 import org.collectionspace.services.client.PoxPayloadIn;
@@ -164,7 +164,7 @@ public class LoaninAuthRefsTest extends BaseServiceTest<AbstractCommonList> {
     
     protected void createPersonRefs() throws Exception{
 
-        PersonAuthorityClient personAuthClient = new PersonAuthorityClient();
+        PersonClient personAuthClient = new PersonClient();
         // Create a temporary PersonAuthority resource, and its corresponding
         // refName by which it can be identified.
        PoxPayloadOut multipart = PersonAuthorityClientUtils.createPersonAuthorityInstance(
@@ -212,7 +212,7 @@ public class LoaninAuthRefsTest extends BaseServiceTest<AbstractCommonList> {
     protected String createPerson(String firstName, String surName, String shortId, String authRefName ) throws Exception {
        String result = null;
        
-        PersonAuthorityClient personAuthClient = new PersonAuthorityClient();
+        PersonClient personAuthClient = new PersonClient();
         Map<String, String> personInfo = new HashMap<String,String>();
         personInfo.put(PersonJAXBSchema.FORE_NAME, firstName);
         personInfo.put(PersonJAXBSchema.SUR_NAME, surName);
@@ -365,7 +365,7 @@ public class LoaninAuthRefsTest extends BaseServiceTest<AbstractCommonList> {
         //
         // Delete Person resource(s) (before PersonAuthority resources).
         //
-        PersonAuthorityClient personAuthClient = new PersonAuthorityClient();        
+        PersonClient personAuthClient = new PersonClient();        
         for (String csid : personIdsCreated) {
                Response res = null;
                try {
index 94076561f51d7ff1cfd5565124e9e96eb7b5224f..ccad5c08d7d25443ff804c56771366f788df9ed0 100644 (file)
@@ -33,7 +33,7 @@ import org.collectionspace.services.PersonJAXBSchema;
 import org.collectionspace.services.client.CollectionSpaceClient;
 import org.collectionspace.services.client.LoanoutClient;
 import org.collectionspace.services.client.PayloadOutputPart;
-import org.collectionspace.services.client.PersonAuthorityClient;
+import org.collectionspace.services.client.PersonClient;
 import org.collectionspace.services.client.PersonAuthorityClientUtils;
 import org.collectionspace.services.client.PoxPayloadIn;
 import org.collectionspace.services.client.PoxPayloadOut;
@@ -167,7 +167,7 @@ public class LoanoutAuthRefsTest extends BaseServiceTest<AbstractCommonList> {
 
     protected void createPersonRefs() throws Exception{
 
-        PersonAuthorityClient personAuthClient = new PersonAuthorityClient();
+        PersonClient personAuthClient = new PersonClient();
         // Create a temporary PersonAuthority resource, and its corresponding
         // refName by which it can be identified.
         PoxPayloadOut multipart = PersonAuthorityClientUtils.createPersonAuthorityInstance(
@@ -208,7 +208,7 @@ public class LoanoutAuthRefsTest extends BaseServiceTest<AbstractCommonList> {
     protected String createPerson(String firstName, String surName, String shortId, String authRefName ) throws Exception {
        String result = null;
        
-        PersonAuthorityClient personAuthClient = new PersonAuthorityClient();
+        PersonClient personAuthClient = new PersonClient();
         Map<String, String> personInfo = new HashMap<String,String>();
         personInfo.put(PersonJAXBSchema.FORE_NAME, firstName);
         personInfo.put(PersonJAXBSchema.SUR_NAME, surName);
@@ -357,7 +357,7 @@ public class LoanoutAuthRefsTest extends BaseServiceTest<AbstractCommonList> {
         //
         // Delete the person terms/items before the person authority
         //
-        PersonAuthorityClient personAuthClient = new PersonAuthorityClient();
+        PersonClient personAuthClient = new PersonClient();
         for (String resourceId : personIdsCreated) {
                Response res = null;
                try {
index 86151b5c442465c28edc53156df8d42087b25cd5..e0765df66714a9fe6f3d005597875f38fa8ea366 100644 (file)
@@ -33,7 +33,7 @@ import org.collectionspace.services.PersonJAXBSchema;
 import org.collectionspace.services.client.CollectionSpaceClient;
 import org.collectionspace.services.client.MediaClient;
 import org.collectionspace.services.client.PayloadOutputPart;
-import org.collectionspace.services.client.PersonAuthorityClient;
+import org.collectionspace.services.client.PersonClient;
 import org.collectionspace.services.client.PersonAuthorityClientUtils;
 import org.collectionspace.services.client.PoxPayloadIn;
 import org.collectionspace.services.client.PoxPayloadOut;
@@ -124,7 +124,7 @@ public class MediaAuthRefsTest extends BaseServiceTest<AbstractCommonList> {
     }
 
     protected void createPersonRefs() throws Exception {
-        PersonAuthorityClient personAuthClient = new PersonAuthorityClient();
+        PersonClient personAuthClient = new PersonClient();
         // Create a temporary PersonAuthority resource, and its corresponding refName by which it can be identified.
         PoxPayloadOut multipart = PersonAuthorityClientUtils.createPersonAuthorityInstance(
                        PERSON_AUTHORITY_NAME, PERSON_AUTHORITY_NAME, personAuthClient.getCommonPartName());
@@ -153,7 +153,7 @@ public class MediaAuthRefsTest extends BaseServiceTest<AbstractCommonList> {
     protected String createPerson(String firstName, String surName, String shortId, String authRefName) throws Exception {
        String result = null;
        
-        PersonAuthorityClient personAuthClient = new PersonAuthorityClient();
+        PersonClient personAuthClient = new PersonClient();
         Map<String, String> personInfo = new HashMap<String, String>();
         personInfo.put(PersonJAXBSchema.FORE_NAME, firstName);
         personInfo.put(PersonJAXBSchema.SUR_NAME, surName);
@@ -255,7 +255,7 @@ public class MediaAuthRefsTest extends BaseServiceTest<AbstractCommonList> {
             return;
         }
         logger.debug("Cleaning up temporary resources created for testing ...");
-        PersonAuthorityClient personAuthClient = new PersonAuthorityClient();
+        PersonClient personAuthClient = new PersonClient();
         // Delete Person resource(s) (before PersonAuthority resources).
         for (String resourceId : personIdsCreated) {
             // Note: Any non-success responses are ignored and not reported.
index 0ab86d94068436fa87df45282ba3d538115d377e..2387d472d76104c5dc496c68b3e227eb01a019ad 100644 (file)
@@ -33,7 +33,7 @@ import javax.ws.rs.core.Response;
 import org.collectionspace.services.PersonJAXBSchema;
 import org.collectionspace.services.client.CollectionSpaceClient;
 import org.collectionspace.services.client.MovementClient;
-import org.collectionspace.services.client.PersonAuthorityClient;
+import org.collectionspace.services.client.PersonClient;
 import org.collectionspace.services.client.PersonAuthorityClientUtils;
 import org.collectionspace.services.client.PayloadInputPart;
 import org.collectionspace.services.client.PayloadOutputPart;
@@ -155,7 +155,7 @@ public class MovementAuthRefsTest extends BaseServiceTest<AbstractCommonList> {
     }
 
     protected void createPersonRefs() throws Exception{
-        PersonAuthorityClient personAuthClient = new PersonAuthorityClient();
+        PersonClient personAuthClient = new PersonClient();
         // Create a temporary PersonAuthority resource, and its corresponding
         // refName by which it can be identified.
        PoxPayloadOut multipart = PersonAuthorityClientUtils.createPersonAuthorityInstance(
@@ -184,7 +184,7 @@ public class MovementAuthRefsTest extends BaseServiceTest<AbstractCommonList> {
     protected String createPerson(String firstName, String surName, String shortId, String authRefName ) throws Exception {
        String result = null;
        
-        PersonAuthorityClient personAuthClient = new PersonAuthorityClient();
+        PersonClient personAuthClient = new PersonClient();
         Map<String, String> personInfo = new HashMap<String,String>();
         personInfo.put(PersonJAXBSchema.FORE_NAME, firstName);
         personInfo.put(PersonJAXBSchema.SUR_NAME, surName);
@@ -310,7 +310,7 @@ public class MovementAuthRefsTest extends BaseServiceTest<AbstractCommonList> {
         if (logger.isDebugEnabled()) {
             logger.debug("Cleaning up temporary resources created for testing ...");
         }
-        PersonAuthorityClient personAuthClient = new PersonAuthorityClient();
+        PersonClient personAuthClient = new PersonClient();
         // Delete Person resource(s) (before PersonAuthority resources).
         for (String resourceId : personIdsCreated) {
             // Note: Any non-success responses are ignored and not reported.
index 5916fdf86ab9136346df99063aaac0e7268b3bdc..f30b0d5d48c157fc220b4ab95961f2a72b82731d 100644 (file)
@@ -33,7 +33,7 @@ import org.collectionspace.services.PersonJAXBSchema;
 import org.collectionspace.services.client.CollectionSpaceClient;
 import org.collectionspace.services.client.ObjectExitClient;
 import org.collectionspace.services.client.PayloadOutputPart;
-import org.collectionspace.services.client.PersonAuthorityClient;
+import org.collectionspace.services.client.PersonClient;
 import org.collectionspace.services.client.PersonAuthorityClientUtils;
 import org.collectionspace.services.client.PoxPayloadIn;
 import org.collectionspace.services.client.PoxPayloadOut;
@@ -143,7 +143,7 @@ public class ObjectExitAuthRefsTest extends BaseServiceTest<AbstractCommonList>
     }
 
     protected void createPersonRefs() throws Exception {
-        PersonAuthorityClient personAuthClient = new PersonAuthorityClient();
+        PersonClient personAuthClient = new PersonClient();
         // Create a temporary PersonAuthority resource, and its corresponding refName by which it can be identified.
         PoxPayloadOut multipart = PersonAuthorityClientUtils.createPersonAuthorityInstance(
                        PERSON_AUTHORITY_NAME, PERSON_AUTHORITY_NAME, personAuthClient.getCommonPartName());
@@ -172,7 +172,7 @@ public class ObjectExitAuthRefsTest extends BaseServiceTest<AbstractCommonList>
     protected String createPerson(String firstName, String surName, String shortId, String authRefName) throws Exception {
        String result = null;
        
-        PersonAuthorityClient personAuthClient = new PersonAuthorityClient();
+        PersonClient personAuthClient = new PersonClient();
         Map<String, String> personInfo = new HashMap<String, String>();
         personInfo.put(PersonJAXBSchema.FORE_NAME, firstName);
         personInfo.put(PersonJAXBSchema.SUR_NAME, surName);
@@ -279,7 +279,7 @@ public class ObjectExitAuthRefsTest extends BaseServiceTest<AbstractCommonList>
         //
         // Next, delete the terms
         //
-        PersonAuthorityClient personAuthClient = new PersonAuthorityClient();
+        PersonClient personAuthClient = new PersonClient();
         // Delete Person resource(s) (before PersonAuthority resources).
         for (String resourceId : personIdsCreated) {
             // Note: Any non-success responses are ignored and not reported.
index bb2146d49a4266327a3c9fb7c22c429ddb7736dd..bcfcffd8c1edbce2a7a703fb125641b749e8b1f1 100644 (file)
-/**
- * OrgAuthorityClient.java
- *
- * {Purpose of This Class}
- *
- * {Other Notes Relating to This Class (Optional)}
- *
- * $LastChangedBy: $ $LastChangedRevision$ $LastChangedDate$
- *
- * 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
- *
- * Copyright Â© 2009 {Contributing Institution}
- *
- * 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
- */
 package org.collectionspace.services.client;
 
-import org.collectionspace.services.organization.OrganizationsCommon;
-import org.collectionspace.services.organization.OrgauthoritiesCommon;
+public class OrgAuthorityClient extends OrganizationClient {
 
-/**
- * The Class OrgAuthorityClient.
- */
-public class OrgAuthorityClient extends AuthorityWithContactsClientImpl<OrgauthoritiesCommon, OrganizationsCommon, OrgAuthorityProxy> {
-
-    public static final String SERVICE_NAME = "orgauthorities";
-    public static final String SERVICE_PATH_COMPONENT = SERVICE_NAME;
-    public static final String SERVICE_PATH = "/" + SERVICE_PATH_COMPONENT;
-    public static final String SERVICE_PAYLOAD_NAME = SERVICE_NAME;
-    public static final String TERM_INFO_GROUP_XPATH_BASE = "orgTermGroupList";
-    
-    //
-    // Subitem constants
-    //
-    public static final String SERVICE_ITEM_NAME = "organizations";
-    public static final String SERVICE_ITEM_PAYLOAD_NAME = SERVICE_ITEM_NAME;
-    //
-    // Payload Part/Schema part names
-    //
-    public static final String SERVICE_COMMON_PART_NAME = SERVICE_NAME
-            + PART_LABEL_SEPARATOR + PART_COMMON_LABEL;
-    public static final String SERVICE_ITEM_COMMON_PART_NAME = SERVICE_ITEM_NAME
-            + PART_LABEL_SEPARATOR + PART_COMMON_LABEL;
-
-    //
-    // Constructors
-    //
     public OrgAuthorityClient() throws Exception {
-       super();
+        super();
     }
     
     public OrgAuthorityClient(String clientPropertiesFilename) throws Exception {
-               super(clientPropertiesFilename);
-       }
-    
-    //
-    // Overrides
-    //
-    
-    @Override
-    public String getServiceName() {
-        return SERVICE_NAME;
-    }
-
-    @Override
-    public String getServicePathComponent() {
-        return SERVICE_PATH_COMPONENT;
-    }
-
-    @Override
-    public Class<OrgAuthorityProxy> getProxyClass() {
-        return OrgAuthorityProxy.class;
-    }
-
-    @Override
-    public String getItemCommonPartName() {
-        return getCommonPartName(SERVICE_ITEM_NAME);
-    }
-
-    @Override
-    public String getInAuthority(OrganizationsCommon item) {
-        return item.getInAuthority();
-    }
-
-    @Override
-    public void setInAuthority(OrganizationsCommon item, String inAuthorityCsid) {
-        item.setInAuthority(inAuthorityCsid);
+        super(clientPropertiesFilename);
+        // TODO Auto-generated constructor stub
     }
 
-       @Override
-       public String createAuthorityInstance(String shortIdentifier, String displayName) {
-               PoxPayloadOut poxPayloadout = OrgAuthorityClientUtils.createOrgAuthorityInstance(displayName, shortIdentifier, SERVICE_COMMON_PART_NAME);
-               return poxPayloadout.asXML();
-       }
-
-       @Override
-       public String createAuthorityItemInstance(String shortIdentifier, String displayName) {
-           PoxPayloadOut orgAuthorityInstance = OrgAuthorityClientUtils.createOrganizationInstance(shortIdentifier, displayName, SERVICE_ITEM_COMMON_PART_NAME);
-        return orgAuthorityInstance.asXML();
-       }
 }
index 3d3618979afc06850104f017529bfd95ba5f8284..69520c7b18e85ce74f3bf1130759394123fd278c 100644 (file)
@@ -60,9 +60,9 @@ public class OrgAuthorityClientUtils {
      * @return
      * @throws Exception 
      */
-    public static String getAuthorityRefName(String csid, OrgAuthorityClient client) throws Exception{
+    public static String getAuthorityRefName(String csid, OrganizationClient client) throws Exception{
        if (client==null) {
-               client = new OrgAuthorityClient();
+               client = new OrganizationClient();
        }
        
         Response res = client.read(csid);
@@ -96,9 +96,9 @@ public class OrgAuthorityClientUtils {
      * @return
      * @throws Exception 
      */
-    public static String getOrgRefName(String inAuthority, String csid, OrgAuthorityClient client) throws Exception{
+    public static String getOrgRefName(String inAuthority, String csid, OrganizationClient client) throws Exception{
        if (client == null) {
-               client = new OrgAuthorityClient();
+               client = new OrganizationClient();
        }
        
         Response res = client.readItem(inAuthority, csid);
@@ -142,7 +142,7 @@ public class OrgAuthorityClientUtils {
         //String refName = createOrgAuthRefName(shortIdentifier, displayName);
         //orgAuthority.setRefName(refName);
         orgAuthority.setVocabType("OrgAuthority");
-        PoxPayloadOut multipart = new PoxPayloadOut(OrgAuthorityClient.SERVICE_PAYLOAD_NAME);
+        PoxPayloadOut multipart = new PoxPayloadOut(OrganizationClient.SERVICE_PAYLOAD_NAME);
         PayloadOutputPart commonPart = multipart.addPart(orgAuthority, MediaType.APPLICATION_XML_TYPE);
         commonPart.setLabel(headerLabel);
 
@@ -165,7 +165,7 @@ public class OrgAuthorityClientUtils {
      */
     public static String createItemInAuthority( String inAuthority,
                String orgAuthorityRefName, Map<String, String> orgInfo, List<OrgTermGroup> terms,
-                Map<String, List<String>> orgRepeatablesInfo, OrgAuthorityClient client) {
+                Map<String, List<String>> orgRepeatablesInfo, OrganizationClient client) {
        // Expected status code: 201 Created
        int EXPECTED_STATUS_CODE = Response.Status.CREATED.getStatusCode();
        // Type of service request being tested
@@ -327,7 +327,7 @@ public class OrgAuthorityClientUtils {
                 organization.setHistoryNotes(historyNotesList);
         }
 
-        PoxPayloadOut multipart = new PoxPayloadOut(OrgAuthorityClient.SERVICE_ITEM_PAYLOAD_NAME);
+        PoxPayloadOut multipart = new PoxPayloadOut(OrganizationClient.SERVICE_ITEM_PAYLOAD_NAME);
         PayloadOutputPart commonPart = multipart.addPart(organization,
             MediaType.APPLICATION_XML_TYPE);
         commonPart.setLabel(headerLabel);
index ddf9e901bf532e16ee5e6b4a1bcacad458a9bb05..71ba0501713446ed1679ab47028b4b05af38c7f4 100644 (file)
@@ -6,7 +6,7 @@ import javax.ws.rs.Produces;
 /**
  * @version $Revision$
  */
-@Path(OrgAuthorityClient.SERVICE_PATH + "/")
+@Path(OrganizationClient.SERVICE_PATH + "/")
 @Produces({"application/xml"})
 @Consumes({"application/xml"})
 public interface OrgAuthorityProxy extends AuthorityWithContactsProxy {
diff --git a/services/organization/client/src/main/java/org/collectionspace/services/client/OrganizationClient.java b/services/organization/client/src/main/java/org/collectionspace/services/client/OrganizationClient.java
new file mode 100644 (file)
index 0000000..e3f21bc
--- /dev/null
@@ -0,0 +1,109 @@
+/**
+ * OrgAuthorityClient.java
+ *
+ * {Purpose of This Class}
+ *
+ * {Other Notes Relating to This Class (Optional)}
+ *
+ * $LastChangedBy: $ $LastChangedRevision$ $LastChangedDate$
+ *
+ * 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
+ *
+ * Copyright Â© 2009 {Contributing Institution}
+ *
+ * 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
+ */
+package org.collectionspace.services.client;
+
+import org.collectionspace.services.organization.OrganizationsCommon;
+import org.collectionspace.services.organization.OrgauthoritiesCommon;
+
+/**
+ * The Class OrgAuthorityClient.
+ */
+public class OrganizationClient extends AuthorityWithContactsClientImpl<OrgauthoritiesCommon, OrganizationsCommon, OrgAuthorityProxy> {
+
+    public static final String SERVICE_NAME = "orgauthorities";
+    public static final String SERVICE_PATH_COMPONENT = SERVICE_NAME;
+    public static final String SERVICE_PATH = "/" + SERVICE_PATH_COMPONENT;
+    public static final String SERVICE_PAYLOAD_NAME = SERVICE_NAME;
+    public static final String TERM_INFO_GROUP_XPATH_BASE = "orgTermGroupList";
+    
+    //
+    // Subitem constants
+    //
+    public static final String SERVICE_ITEM_NAME = "organizations";
+    public static final String SERVICE_ITEM_PAYLOAD_NAME = SERVICE_ITEM_NAME;
+    //
+    // Payload Part/Schema part names
+    //
+    public static final String SERVICE_COMMON_PART_NAME = SERVICE_NAME
+            + PART_LABEL_SEPARATOR + PART_COMMON_LABEL;
+    public static final String SERVICE_ITEM_COMMON_PART_NAME = SERVICE_ITEM_NAME
+            + PART_LABEL_SEPARATOR + PART_COMMON_LABEL;
+
+    //
+    // Constructors
+    //
+    public OrganizationClient() throws Exception {
+       super();
+    }
+    
+    public OrganizationClient(String clientPropertiesFilename) throws Exception {
+               super(clientPropertiesFilename);
+       }
+    
+    //
+    // Overrides
+    //
+    
+    @Override
+    public String getServiceName() {
+        return SERVICE_NAME;
+    }
+
+    @Override
+    public String getServicePathComponent() {
+        return SERVICE_PATH_COMPONENT;
+    }
+
+    @Override
+    public Class<OrgAuthorityProxy> getProxyClass() {
+        return OrgAuthorityProxy.class;
+    }
+
+    @Override
+    public String getItemCommonPartName() {
+        return getCommonPartName(SERVICE_ITEM_NAME);
+    }
+
+    @Override
+    public String getInAuthority(OrganizationsCommon item) {
+        return item.getInAuthority();
+    }
+
+    @Override
+    public void setInAuthority(OrganizationsCommon item, String inAuthorityCsid) {
+        item.setInAuthority(inAuthorityCsid);
+    }
+
+       @Override
+       public String createAuthorityInstance(String shortIdentifier, String displayName) {
+               PoxPayloadOut poxPayloadout = OrgAuthorityClientUtils.createOrgAuthorityInstance(displayName, shortIdentifier, SERVICE_COMMON_PART_NAME);
+               return poxPayloadout.asXML();
+       }
+
+       @Override
+       public String createAuthorityItemInstance(String shortIdentifier, String displayName) {
+           PoxPayloadOut orgAuthorityInstance = OrgAuthorityClientUtils.createOrganizationInstance(shortIdentifier, displayName, SERVICE_ITEM_COMMON_PART_NAME);
+        return orgAuthorityInstance.asXML();
+       }
+}
index fe98e8d1dc78033fb3ef457377a23d1aed9b50a9..7d7904257caa99c6c29b80b0f26bd3c14f56b7b9 100644 (file)
@@ -32,9 +32,9 @@ import javax.ws.rs.core.Response;
 import org.collectionspace.services.OrganizationJAXBSchema;
 import org.collectionspace.services.PersonJAXBSchema;
 import org.collectionspace.services.client.CollectionSpaceClient;
-import org.collectionspace.services.client.OrgAuthorityClient;
+import org.collectionspace.services.client.OrganizationClient;
 import org.collectionspace.services.client.OrgAuthorityClientUtils;
-import org.collectionspace.services.client.PersonAuthorityClient;
+import org.collectionspace.services.client.PersonClient;
 import org.collectionspace.services.client.PersonAuthorityClientUtils;
 import org.collectionspace.services.client.PoxPayloadIn;
 import org.collectionspace.services.client.PoxPayloadOut;
@@ -68,12 +68,12 @@ public class OrgAuthorityAuthRefsTest extends BaseServiceTest<AbstractCommonList
     
        @Override
        public String getServicePathComponent() {
-               return OrgAuthorityClient.SERVICE_PATH_COMPONENT;
+               return OrganizationClient.SERVICE_PATH_COMPONENT;
        }
 
        @Override
        protected String getServiceName() {
-               return OrgAuthorityClient.SERVICE_NAME;
+               return OrganizationClient.SERVICE_NAME;
        }
 
     protected String knownItemResourceId = null;
@@ -139,7 +139,7 @@ public class OrgAuthorityAuthRefsTest extends BaseServiceTest<AbstractCommonList
         testSetup(STATUS_CREATED, ServiceRequestType.CREATE);
 
         // Create a new Organization Authority resource.
-        OrgAuthorityClient orgAuthClient = new OrgAuthorityClient();
+        OrganizationClient orgAuthClient = new OrganizationClient();
         String shortId = createIdentifier();
         String displayName = "TestOrgAuth-" + shortId;
        //String baseRefName = OrgAuthorityClientUtils.createOrgAuthRefName(shortId, null);
@@ -212,7 +212,7 @@ public class OrgAuthorityAuthRefsTest extends BaseServiceTest<AbstractCommonList
      * @throws Exception 
      */
     protected void createPersonRefs() throws Exception {
-        PersonAuthorityClient personAuthClient = new PersonAuthorityClient();
+        PersonClient personAuthClient = new PersonClient();
         // Create a temporary PersonAuthority resource, and its corresponding
         // refName by which it can be identified.
        PoxPayloadOut multipart = PersonAuthorityClientUtils.createPersonAuthorityInstance(
@@ -255,7 +255,7 @@ public class OrgAuthorityAuthRefsTest extends BaseServiceTest<AbstractCommonList
      * @throws Exception 
      */
     protected String createPerson(String personAuthCSID, String firstName, String surName, String shortId, String authRefName ) throws Exception {
-        PersonAuthorityClient personAuthClient = new PersonAuthorityClient();
+        PersonClient personAuthClient = new PersonClient();
         Map<String, String> personInfo = new HashMap<String,String>();
         personInfo.put(PersonJAXBSchema.SHORT_IDENTIFIER, shortId);
         List<PersonTermGroup> personTerms = new ArrayList<PersonTermGroup>();
@@ -300,7 +300,7 @@ public class OrgAuthorityAuthRefsTest extends BaseServiceTest<AbstractCommonList
         testSetup(STATUS_OK, ServiceRequestType.READ);
 
         // Submit the request to the service and store the response.
-        OrgAuthorityClient orgAuthClient = new OrgAuthorityClient();
+        OrganizationClient orgAuthClient = new OrganizationClient();
         Response res = orgAuthClient.readItem(knownResourceId, knownItemResourceId);
         OrganizationsCommon organization = null;
         try {
@@ -395,7 +395,7 @@ public class OrgAuthorityAuthRefsTest extends BaseServiceTest<AbstractCommonList
                 
         String parentResourceId;
         String itemResourceId;
-        OrgAuthorityClient client = new OrgAuthorityClient();
+        OrganizationClient client = new OrganizationClient();
         // Clean up item resources.
         for (Map.Entry<String, String> entry : allResourceItemIdsCreated.entrySet()) {
             itemResourceId = entry.getKey();
@@ -410,7 +410,7 @@ public class OrgAuthorityAuthRefsTest extends BaseServiceTest<AbstractCommonList
         // that we needed to delete the objects/records referencing these authority items first since
         // we can't delete authority items that still have records referencing them
         //
-        PersonAuthorityClient personAuthClient = new PersonAuthorityClient();
+        PersonClient personAuthClient = new PersonClient();
         // Delete Person resource(s) (before PersonAuthority resources).
         for (String resourceId : personIdsCreated) {
             // Note: Any non-success responses are ignored and not reported.
index 287378632ece3228852bd4bcd29ce62ce1550d48..263cb3863f7ebb0077bceff647c324552fc7d884 100644 (file)
@@ -42,7 +42,7 @@ import org.collectionspace.services.client.PoxPayloadOut;
 import org.collectionspace.services.contact.AddressGroup;
 import org.collectionspace.services.contact.AddressGroupList;
 import org.collectionspace.services.contact.ContactsCommon;
-import org.collectionspace.services.client.OrgAuthorityClient;
+import org.collectionspace.services.client.OrganizationClient;
 import org.collectionspace.services.client.OrgAuthorityClientUtils;
 import org.collectionspace.services.jaxb.AbstractCommonList;
 import org.collectionspace.services.organization.OrgauthoritiesCommon;
@@ -78,12 +78,12 @@ public class OrgAuthorityServiceTest extends AbstractAuthorityServiceTest<Orgaut
     
     @Override
     public String getServicePathComponent() {
-        return OrgAuthorityClient.SERVICE_PATH_COMPONENT;
+        return OrganizationClient.SERVICE_PATH_COMPONENT;
     }
 
     @Override
     protected String getServiceName() {
-        return OrgAuthorityClient.SERVICE_NAME;
+        return OrganizationClient.SERVICE_NAME;
     }
     
     private final String TEST_ORG_NAME = "Test Org";
@@ -113,17 +113,17 @@ public class OrgAuthorityServiceTest extends AbstractAuthorityServiceTest<Orgaut
      */
     @Override
     protected CollectionSpaceClient getClientInstance() throws Exception {
-        return new OrgAuthorityClient();
+        return new OrganizationClient();
     }
 
        @Override
        protected CollectionSpaceClient getClientInstance(String clientPropertiesFilename) throws Exception {
-        return new OrgAuthorityClient(clientPropertiesFilename);
+        return new OrganizationClient(clientPropertiesFilename);
        }
 
     @Override
     protected PoxPayloadOut createInstance(String identifier) throws Exception {
-        OrgAuthorityClient client = new OrgAuthorityClient();
+        OrganizationClient client = new OrganizationClient();
         String displayName = "displayName-" + identifier;
         PoxPayloadOut multipart = OrgAuthorityClientUtils.createOrgAuthorityInstance(
                 displayName, identifier, client.getCommonPartName());
@@ -132,7 +132,7 @@ public class OrgAuthorityServiceTest extends AbstractAuthorityServiceTest<Orgaut
 
     @Override
     protected PoxPayloadOut createItemInstance(String parentCsid, String identifier) throws Exception {
-        String headerLabel = new OrgAuthorityClient().getItemCommonPartName();
+        String headerLabel = new OrganizationClient().getItemCommonPartName();
         
         String shortId = TEST_SHORTID + identifier;
         Map<String, String> testOrgMap = new HashMap<String, String>();
@@ -188,7 +188,7 @@ public class OrgAuthorityServiceTest extends AbstractAuthorityServiceTest<Orgaut
         testOrgRepeatablesMap.put(OrganizationJAXBSchema.CONTACT_NAMES, testOrgContactNames);
 
         String newID = OrgAuthorityClientUtils.createItemInAuthority(
-                vcsid, authRefName, testOrgMap, terms, testOrgRepeatablesMap, (OrgAuthorityClient) client);
+                vcsid, authRefName, testOrgMap, terms, testOrgRepeatablesMap, (OrganizationClient) client);
 
         // Store the ID returned from the first item resource created
         // for additional tests below.
@@ -237,7 +237,7 @@ public class OrgAuthorityServiceTest extends AbstractAuthorityServiceTest<Orgaut
         setupCreate();
 
         // Submit the request to the service and store the response.
-        OrgAuthorityClient client = new OrgAuthorityClient();
+        OrganizationClient client = new OrganizationClient();
         String identifier = createIdentifier();
         PoxPayloadOut multipart =
                 ContactClientUtils.createContactInstance(parentcsid,
@@ -317,7 +317,7 @@ public class OrgAuthorityServiceTest extends AbstractAuthorityServiceTest<Orgaut
         setupRead();
 
         // Submit the request to the service and store the response.
-        OrgAuthorityClient client = new OrgAuthorityClient();
+        OrganizationClient client = new OrganizationClient();
         Response res = null;
         if (CSID != null) {
             res = client.read(CSID);
@@ -332,7 +332,7 @@ public class OrgAuthorityServiceTest extends AbstractAuthorityServiceTest<Orgaut
             try {
                 PoxPayloadIn input = new PoxPayloadIn(res.readEntity(String.class));
                 OrgauthoritiesCommon orgAuthority = (OrgauthoritiesCommon) extractPart(input,
-                        new OrgAuthorityClient().getCommonPartName(), OrgauthoritiesCommon.class);
+                        new OrganizationClient().getCommonPartName(), OrgauthoritiesCommon.class);
                 if (logger.isDebugEnabled()) {
                     logger.debug(objectAsXmlString(orgAuthority, OrgauthoritiesCommon.class));
                 }
@@ -405,7 +405,7 @@ public class OrgAuthorityServiceTest extends AbstractAuthorityServiceTest<Orgaut
         setupRead();
 
         // Submit the request to the service and store the response.
-        OrgAuthorityClient client = new OrgAuthorityClient();
+        OrganizationClient client = new OrganizationClient();
         Response res = null;
         if (authCSID != null) {
             if (itemCSID != null) {
@@ -475,7 +475,7 @@ public class OrgAuthorityServiceTest extends AbstractAuthorityServiceTest<Orgaut
         //
         // First read our known resource.
         //
-        OrgAuthorityClient client = new OrgAuthorityClient();
+        OrganizationClient client = new OrganizationClient();
         Response res = client.readItem(knownResourceId, knownItemResourceId);
         OrganizationsCommon organization = null;
         try {
@@ -504,7 +504,7 @@ public class OrgAuthorityServiceTest extends AbstractAuthorityServiceTest<Orgaut
         
         setupUpdateWithInvalidBody(); // we expect a failure
         // Submit the updated resource to the service and store the response.
-        PoxPayloadOut output = new PoxPayloadOut(OrgAuthorityClient.SERVICE_ITEM_PAYLOAD_NAME);
+        PoxPayloadOut output = new PoxPayloadOut(OrganizationClient.SERVICE_ITEM_PAYLOAD_NAME);
         PayloadOutputPart commonPart = output.addPart(client.getItemCommonPartName(),
                        organization);
         res = client.updateItem(knownResourceId, knownItemResourceId, output);
@@ -530,7 +530,7 @@ public class OrgAuthorityServiceTest extends AbstractAuthorityServiceTest<Orgaut
         setupRead();
 
         // Submit the request to the service and store the response.
-        OrgAuthorityClient client = new OrgAuthorityClient();
+        OrganizationClient client = new OrganizationClient();
         Response res =client.readContact(knownResourceId, knownItemResourceId,
                 knownContactResourceId);
         try {
@@ -567,7 +567,7 @@ public class OrgAuthorityServiceTest extends AbstractAuthorityServiceTest<Orgaut
         setupReadNonExistent();
 
         // Submit the request to the service and store the response.
-        OrgAuthorityClient client = new OrgAuthorityClient();
+        OrganizationClient client = new OrganizationClient();
         Response res = client.readContact(knownResourceId, knownItemResourceId, NON_EXISTENT_ID);
         try {
             int statusCode = res.getStatus();
@@ -622,7 +622,7 @@ public class OrgAuthorityServiceTest extends AbstractAuthorityServiceTest<Orgaut
         setupReadList();
 
         // Submit the request to the service and store the response.
-        OrgAuthorityClient client = new OrgAuthorityClient();
+        OrganizationClient client = new OrganizationClient();
         Response res = null;
         if (vcsid != null) {
             res = client.readItemList(vcsid, null, null);
@@ -690,7 +690,7 @@ public class OrgAuthorityServiceTest extends AbstractAuthorityServiceTest<Orgaut
         setupReadList();
 
         // Submit the request to the service and store the response.
-        OrgAuthorityClient client = new OrgAuthorityClient();
+        OrganizationClient client = new OrganizationClient();
         Response res = client.readContactList(parentcsid, itemcsid);
         AbstractCommonList list = null;
         try {
@@ -738,7 +738,7 @@ public class OrgAuthorityServiceTest extends AbstractAuthorityServiceTest<Orgaut
         setupUpdate();
 
         // Retrieve the contents of a resource to update.
-        OrgAuthorityClient client = new OrgAuthorityClient();
+        OrganizationClient client = new OrganizationClient();
         Response res = client.readContact(knownResourceId, knownItemResourceId, knownContactResourceId);
         ContactsCommon contact = null;
         try {
@@ -840,7 +840,7 @@ public class OrgAuthorityServiceTest extends AbstractAuthorityServiceTest<Orgaut
         }
 
         // Submit the request to the service and store the response.
-        OrgAuthorityClient client = new OrgAuthorityClient();
+        OrganizationClient client = new OrganizationClient();
         Response res = client.deleteContact(knownResourceId, knownItemResourceId, knownContactResourceId);
         try {
             assertStatusCode(res, testName);
@@ -886,7 +886,7 @@ public class OrgAuthorityServiceTest extends AbstractAuthorityServiceTest<Orgaut
         setupDeleteNonExistent();
 
         // Submit the request to the service and store the response.
-        OrgAuthorityClient client = new OrgAuthorityClient();
+        OrganizationClient client = new OrganizationClient();
         Response res = client.deleteContact(knownResourceId, knownItemResourceId, NON_EXISTENT_ID);
         try {
             assertStatusCode(res, testName);
@@ -953,7 +953,7 @@ public class OrgAuthorityServiceTest extends AbstractAuthorityServiceTest<Orgaut
         String contactResourceId;
         // Clean up contact resources.
         parentResourceId = knownResourceId;
-        OrgAuthorityClient client = new OrgAuthorityClient();
+        OrganizationClient client = new OrganizationClient();
         for (Map.Entry<String, String> entry : allContactResourceIdsCreated.entrySet()) {
             contactResourceId = entry.getKey();
             itemResourceId = entry.getValue();
index 40373aa9160d4550b7593ecd3e256bf17aad1e9c..ad6d556a011d3216d963a4aad771cd5873a1ffcc 100644 (file)
@@ -26,8 +26,8 @@ package org.collectionspace.services.organization;
 import javax.ws.rs.Consumes;
 import javax.ws.rs.Path;
 import javax.ws.rs.Produces;
-import org.collectionspace.services.client.OrgAuthorityClient;
-import org.collectionspace.services.contact.AuthorityResourceWithContacts;
+import org.collectionspace.services.client.OrganizationClient;
+import org.collectionspace.services.common.vocabulary.AuthorityResourceWithContacts;
 import org.collectionspace.services.organization.nuxeo.OrganizationDocumentModelHandler;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -39,7 +39,7 @@ import org.slf4j.LoggerFactory;
  * related to Organization authority-related resources.
  */
 
-@Path(OrgAuthorityClient.SERVICE_PATH)
+@Path(OrganizationClient.SERVICE_PATH)
 @Consumes("application/xml")
 @Produces("application/xml")
 public class OrgAuthorityResource extends
@@ -49,22 +49,22 @@ public class OrgAuthorityResource extends
     
     public OrgAuthorityResource() {
         super(OrgauthoritiesCommon.class, OrgAuthorityResource.class,
-                OrgAuthorityClient.SERVICE_COMMON_PART_NAME, OrgAuthorityClient.SERVICE_ITEM_COMMON_PART_NAME);
+                OrganizationClient.SERVICE_COMMON_PART_NAME, OrganizationClient.SERVICE_ITEM_COMMON_PART_NAME);
     }
 
     @Override
     public String getServiceName() {
-        return OrgAuthorityClient.SERVICE_NAME;
+        return OrganizationClient.SERVICE_NAME;
     }
 
     @Override
     public String getItemServiceName() {
-        return OrgAuthorityClient.SERVICE_ITEM_NAME;
+        return OrganizationClient.SERVICE_ITEM_NAME;
     }
 
     @Override
     public String getItemTermInfoGroupXPathBase() {
-        return OrgAuthorityClient.TERM_INFO_GROUP_XPATH_BASE;
+        return OrganizationClient.TERM_INFO_GROUP_XPATH_BASE;
     }
     
 }
index 9f350736b725eddf112cef270e043262b85ffbff..be53db7c12f1f6bcadd529361bb2cacb3a4f3e45 100644 (file)
@@ -24,7 +24,7 @@
 package org.collectionspace.services.organization.nuxeo;
 
 import org.collectionspace.services.organization.OrgauthoritiesCommon;
-import org.collectionspace.services.client.OrgAuthorityClient;
+import org.collectionspace.services.client.OrganizationClient;
 import org.collectionspace.services.common.vocabulary.nuxeo.AuthorityDocumentModelHandler;
 
 /**
@@ -35,7 +35,7 @@ public class OrgAuthorityDocumentModelHandler
         extends AuthorityDocumentModelHandler<OrgauthoritiesCommon> {
     
     public OrgAuthorityDocumentModelHandler() {
-       super(OrgAuthorityClient.SERVICE_COMMON_PART_NAME, OrgAuthorityClient.SERVICE_ITEM_COMMON_PART_NAME);
+       super(OrganizationClient.SERVICE_COMMON_PART_NAME, OrganizationClient.SERVICE_ITEM_COMMON_PART_NAME);
     }
        
     /**
index 8d1f4b9ee30b7f15caffe76ac9ce1776b3b19158..3d73181b5a938c45fd30c23121a45a60c129540d 100644 (file)
@@ -23,9 +23,8 @@
  */
 package org.collectionspace.services.organization.nuxeo;
 
-import org.collectionspace.services.client.OrgAuthorityClient;
-import org.collectionspace.services.client.PersonAuthorityClient;
-import org.collectionspace.services.common.vocabulary.nuxeo.AuthorityItemDocumentModelHandler;
+import org.collectionspace.services.client.OrganizationClient;
+import org.collectionspace.services.common.vocabulary.nuxeo.AuthorityItemWithContactsDocumentModelHandler;
 import org.collectionspace.services.organization.OrganizationsCommon;
 
 /**
@@ -33,15 +32,15 @@ import org.collectionspace.services.organization.OrganizationsCommon;
  *
  */
 public class OrganizationDocumentModelHandler
-               extends AuthorityItemDocumentModelHandler<OrganizationsCommon> {
+               extends AuthorityItemWithContactsDocumentModelHandler<OrganizationsCommon> {
 
     public OrganizationDocumentModelHandler() {
-       super(OrgAuthorityClient.SERVICE_COMMON_PART_NAME, OrgAuthorityClient.SERVICE_ITEM_COMMON_PART_NAME);
+       super(OrganizationClient.SERVICE_COMMON_PART_NAME, OrganizationClient.SERVICE_ITEM_COMMON_PART_NAME);
     }
 
     @Override
     public String getAuthorityServicePath(){
-        return OrgAuthorityClient.SERVICE_PATH_COMPONENT;    //  CSPACE-3932
+        return OrganizationClient.SERVICE_PATH_COMPONENT;    //  CSPACE-3932
     }
        
     /**
@@ -57,7 +56,7 @@ public class OrganizationDocumentModelHandler
        @Override
        public String getParentCommonSchemaName() {
                // TODO Auto-generated method stub
-               return OrgAuthorityClient.SERVICE_COMMON_PART_NAME;
+               return OrganizationClient.SERVICE_COMMON_PART_NAME;
        }       
 }
 
index 44e1a85c672397e68fb7cafe95ff49e9597fec47..d91e5b1ebdd5640c2dd67c5858abc4ce11b4df76 100644 (file)
-/**
- * PersonAuthorityClient.java
- *
- * 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
- *
- * Copyright Â© 2009 University of California, Berkeley
- *
- * 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
- */
 package org.collectionspace.services.client;
 
-import org.collectionspace.services.person.PersonauthoritiesCommon;
-import org.collectionspace.services.person.PersonsCommon;
+public class PersonAuthorityClient extends PersonClient {
 
-/**
- * The Class PersonAuthorityClient.
- */
-public class PersonAuthorityClient extends AuthorityWithContactsClientImpl<PersonauthoritiesCommon, PersonsCommon, PersonAuthorityProxy> {
-
-    public static final String SERVICE_NAME = "personauthorities";
-    public static final String SERVICE_PATH_COMPONENT = SERVICE_NAME;
-    public static final String SERVICE_PATH = "/" + SERVICE_PATH_COMPONENT;
-    public static final String SERVICE_PAYLOAD_NAME = SERVICE_NAME;
-    public static final String TERM_INFO_GROUP_XPATH_BASE = "personTermGroupList";
-    //
-    // Subitem constants
-    //
-    public static final String SERVICE_ITEM_NAME = "persons";
-    public static final String SERVICE_ITEM_PAYLOAD_NAME = SERVICE_ITEM_NAME;
-    //
-    // Payload Part/Schema part names
-    //
-    public static final String SERVICE_COMMON_PART_NAME = SERVICE_NAME
-            + PART_LABEL_SEPARATOR + PART_COMMON_LABEL;
-    public static final String SERVICE_ITEM_COMMON_PART_NAME = SERVICE_ITEM_NAME
-            + PART_LABEL_SEPARATOR + PART_COMMON_LABEL;
-
-    //
-    // Constructors
-    //
     public PersonAuthorityClient() throws Exception {
-       super();
+        super();
     }
     
     public PersonAuthorityClient(String clientPropertiesFilename) throws Exception {
-               super(clientPropertiesFilename);
-       }
-
-    //
-    // Overrides
-    //
-    
-       @Override
-    public String getServiceName() {
-        return SERVICE_NAME;
+        super(clientPropertiesFilename);
+        // TODO Auto-generated constructor stub
     }
 
-    @Override
-    public String getServicePathComponent() {
-        return SERVICE_PATH_COMPONENT;
-    }
-
-    @Override
-    public String getItemCommonPartName() {
-        return getCommonPartName(SERVICE_ITEM_PAYLOAD_NAME);
-    }
-
-    @Deprecated // Use getItemCommonPartName() instead
-    public String getCommonPartItemName() {
-        return getCommonPartName(SERVICE_ITEM_PAYLOAD_NAME);
-    }
-
-    @Override
-    public Class<PersonAuthorityProxy> getProxyClass() {
-        return PersonAuthorityProxy.class;
-    }
-
-    @Override
-    public String getInAuthority(PersonsCommon item) {
-        return item.getInAuthority();
-    }
-
-    @Override
-    public void setInAuthority(PersonsCommon item, String inAuthorityCsid) {
-        item.setInAuthority(inAuthorityCsid);
-    }
-
-    //
-    // Should return a valid XML payload for creating an authority instance
-    //
-       @Override
-       public String createAuthorityInstance(String shortIdentifier, String displayName) {
-               PoxPayloadOut personAuthorityInstance = PersonAuthorityClientUtils.createPersonAuthorityInstance(displayName, shortIdentifier, SERVICE_COMMON_PART_NAME);
-               return personAuthorityInstance.asXML();
-       }
-
-       @Override
-       public String createAuthorityItemInstance(String shortIdentifier, String displayName) {
-               PoxPayloadOut personAuthorityInstance = PersonAuthorityClientUtils.createPersonInstance(shortIdentifier, displayName, SERVICE_ITEM_COMMON_PART_NAME);
-               return personAuthorityInstance.asXML();
-       }
 }
index 029da410e7bd1db1e382db86668a86b3b0dd37e0..9c85b5687d43fc65a5310f13ec6471a19972fec0 100644 (file)
@@ -64,9 +64,9 @@ public class PersonAuthorityClientUtils {
      * @return
      * @throws Exception 
      */
-    public static String getAuthorityRefName(String csid, PersonAuthorityClient client) throws Exception{
+    public static String getAuthorityRefName(String csid, PersonClient client) throws Exception{
        if (client == null) {
-               client = new PersonAuthorityClient();
+               client = new PersonClient();
        }
         Response res = client.read(csid);
         try {
@@ -99,9 +99,9 @@ public class PersonAuthorityClientUtils {
      * @return
      * @throws Exception 
      */
-    public static String getPersonRefName(String inAuthority, String csid, PersonAuthorityClient client) throws Exception{
+    public static String getPersonRefName(String inAuthority, String csid, PersonClient client) throws Exception{
        if ( client == null) {
-               client = new PersonAuthorityClient();
+               client = new PersonClient();
        }
         Response res = client.readItem(inAuthority, csid);
         try {
@@ -143,7 +143,7 @@ public class PersonAuthorityClientUtils {
         //String refName = createPersonAuthRefName(shortIdentifier, displayName);
         //personAuthority.setRefName(refName);
         personAuthority.setVocabType("PersonAuthority");
-        PoxPayloadOut multipart = new PoxPayloadOut(PersonAuthorityClient.SERVICE_PAYLOAD_NAME);
+        PoxPayloadOut multipart = new PoxPayloadOut(PersonClient.SERVICE_PAYLOAD_NAME);
         PayloadOutputPart commonPart = multipart.addPart(personAuthority, MediaType.APPLICATION_XML_TYPE);
         commonPart.setLabel(headerLabel);
 
@@ -281,7 +281,7 @@ public class PersonAuthorityClientUtils {
                        }
                }
 
-        PoxPayloadOut multipart = new PoxPayloadOut(PersonAuthorityClient.SERVICE_ITEM_PAYLOAD_NAME);
+        PoxPayloadOut multipart = new PoxPayloadOut(PersonClient.SERVICE_ITEM_PAYLOAD_NAME);
         PayloadOutputPart commonPart = multipart.addPart(person, MediaType.APPLICATION_XML_TYPE);
         commonPart.setLabel(headerLabel);
 
@@ -304,7 +304,7 @@ public class PersonAuthorityClientUtils {
     public static String createItemInAuthority(String vcsid, 
                String personAuthorityRefName, Map<String,String> personMap,
                 List<PersonTermGroup> terms, Map<String, List<String>> personRepeatablesMap,
-                PersonAuthorityClient client ) {
+                PersonClient client ) {
        // Expected status code: 201 Created
        int EXPECTED_STATUS_CODE = Response.Status.CREATED.getStatusCode();
        // Type of service request being tested
index b348057c6359e0a4d1f0c1c17f4b580a879a8016..31eef23829059112ac073d2356551373c6f2dd7e 100644 (file)
@@ -7,7 +7,7 @@ import javax.ws.rs.Produces;
 /**
  * @version $Revision:$
  */
-@Path(PersonAuthorityClient.SERVICE_PATH + "/")
+@Path(PersonClient.SERVICE_PATH + "/")
 @Produces({"application/xml"})
 @Consumes({"application/xml"})
 public interface PersonAuthorityProxy extends AuthorityWithContactsProxy {
diff --git a/services/person/client/src/main/java/org/collectionspace/services/client/PersonClient.java b/services/person/client/src/main/java/org/collectionspace/services/client/PersonClient.java
new file mode 100644 (file)
index 0000000..d9484ea
--- /dev/null
@@ -0,0 +1,110 @@
+/**
+ * PersonAuthorityClient.java
+ *
+ * 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
+ *
+ * Copyright Â© 2009 University of California, Berkeley
+ *
+ * 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
+ */
+package org.collectionspace.services.client;
+
+import org.collectionspace.services.person.PersonauthoritiesCommon;
+import org.collectionspace.services.person.PersonsCommon;
+
+/**
+ * The Class PersonAuthorityClient.
+ */
+public class PersonClient extends AuthorityWithContactsClientImpl<PersonauthoritiesCommon, PersonsCommon, PersonAuthorityProxy> {
+
+    public static final String SERVICE_NAME = "personauthorities";
+    public static final String SERVICE_PATH_COMPONENT = SERVICE_NAME;
+    public static final String SERVICE_PATH = "/" + SERVICE_PATH_COMPONENT;
+    public static final String SERVICE_PAYLOAD_NAME = SERVICE_NAME;
+    public static final String TERM_INFO_GROUP_XPATH_BASE = "personTermGroupList";
+    //
+    // Subitem constants
+    //
+    public static final String SERVICE_ITEM_NAME = "persons";
+    public static final String SERVICE_ITEM_PAYLOAD_NAME = SERVICE_ITEM_NAME;
+    //
+    // Payload Part/Schema part names
+    //
+    public static final String SERVICE_COMMON_PART_NAME = SERVICE_NAME
+            + PART_LABEL_SEPARATOR + PART_COMMON_LABEL;
+    public static final String SERVICE_ITEM_COMMON_PART_NAME = SERVICE_ITEM_NAME
+            + PART_LABEL_SEPARATOR + PART_COMMON_LABEL;
+
+    //
+    // Constructors
+    //
+    public PersonClient() throws Exception {
+       super();
+    }
+    
+    public PersonClient(String clientPropertiesFilename) throws Exception {
+               super(clientPropertiesFilename);
+       }
+
+    //
+    // Overrides
+    //
+    
+       @Override
+    public String getServiceName() {
+        return SERVICE_NAME;
+    }
+
+    @Override
+    public String getServicePathComponent() {
+        return SERVICE_PATH_COMPONENT;
+    }
+
+    @Override
+    public String getItemCommonPartName() {
+        return getCommonPartName(SERVICE_ITEM_PAYLOAD_NAME);
+    }
+
+    @Deprecated // Use getItemCommonPartName() instead
+    public String getCommonPartItemName() {
+        return getCommonPartName(SERVICE_ITEM_PAYLOAD_NAME);
+    }
+
+    @Override
+    public Class<PersonAuthorityProxy> getProxyClass() {
+        return PersonAuthorityProxy.class;
+    }
+
+    @Override
+    public String getInAuthority(PersonsCommon item) {
+        return item.getInAuthority();
+    }
+
+    @Override
+    public void setInAuthority(PersonsCommon item, String inAuthorityCsid) {
+        item.setInAuthority(inAuthorityCsid);
+    }
+
+    //
+    // Should return a valid XML payload for creating an authority instance
+    //
+       @Override
+       public String createAuthorityInstance(String shortIdentifier, String displayName) {
+               PoxPayloadOut personAuthorityInstance = PersonAuthorityClientUtils.createPersonAuthorityInstance(displayName, shortIdentifier, SERVICE_COMMON_PART_NAME);
+               return personAuthorityInstance.asXML();
+       }
+
+       @Override
+       public String createAuthorityItemInstance(String shortIdentifier, String displayName) {
+               PoxPayloadOut personAuthorityInstance = PersonAuthorityClientUtils.createPersonInstance(shortIdentifier, displayName, SERVICE_ITEM_COMMON_PART_NAME);
+               return personAuthorityInstance.asXML();
+       }
+}
index b010db4979256e66d6261b52bcb626fd3fb1d3be..78a24afa2ed38d3fd696f4d12ee252b594d89196 100644 (file)
@@ -33,7 +33,7 @@ import javax.ws.rs.core.Response;
 
 import org.collectionspace.services.PersonJAXBSchema;
 import org.collectionspace.services.client.CollectionSpaceClient;
-import org.collectionspace.services.client.PersonAuthorityClient;
+import org.collectionspace.services.client.PersonClient;
 import org.collectionspace.services.client.PersonAuthorityClientUtils;
 import org.collectionspace.services.client.PoxPayloadOut;
 import org.collectionspace.services.jaxb.AbstractCommonList;
@@ -59,12 +59,12 @@ public class PersonAuthoritySearchTest extends BaseServiceTest<AbstractCommonLis
     
        @Override
        public String getServicePathComponent() {
-               return PersonAuthorityClient.SERVICE_PATH_COMPONENT;
+               return PersonClient.SERVICE_PATH_COMPONENT;
        }
 
        @Override
        protected String getServiceName() {
-               return PersonAuthorityClient.SERVICE_NAME;
+               return PersonClient.SERVICE_NAME;
        }
     
     final String UTF8_CHARSET_NAME = "UTF-8";
@@ -149,12 +149,12 @@ public class PersonAuthoritySearchTest extends BaseServiceTest<AbstractCommonLis
      */
     @Override
     protected CollectionSpaceClient getClientInstance() throws Exception {
-       return new PersonAuthorityClient();
+       return new PersonClient();
     }
 
        @Override
        protected CollectionSpaceClient getClientInstance(String clientPropertiesFilename) throws Exception {
-       return new PersonAuthorityClient(clientPropertiesFilename);
+       return new PersonClient(clientPropertiesFilename);
        }
 
     /* (non-Javadoc)
@@ -476,7 +476,7 @@ public class PersonAuthoritySearchTest extends BaseServiceTest<AbstractCommonLis
         testSetup(expectedStatusCode, requestType);
 
         // Submit the request to the service and store the response.
-        PersonAuthorityClient client = new PersonAuthorityClient();
+        PersonClient client = new PersonClient();
         Response res = null;
         if (authorityCsid != null) {
                res = client.readItemList(authorityCsid, partialTerm, keywords);
@@ -526,7 +526,7 @@ public class PersonAuthoritySearchTest extends BaseServiceTest<AbstractCommonLis
         }
         String parentResourceId;
         String itemResourceId;
-        PersonAuthorityClient client = new PersonAuthorityClient();
+        PersonClient client = new PersonClient();
         parentResourceId = knownResourceId;
         // Clean up item resources.
         for (Map.Entry<String, String> entry : allItemResourceIdsCreated.entrySet()) {
@@ -565,7 +565,7 @@ public class PersonAuthoritySearchTest extends BaseServiceTest<AbstractCommonLis
         testSetup(expectedStatusCode, requestType);
 
         // Submit the request to the service and store the response.
-        PersonAuthorityClient client = new PersonAuthorityClient();
+        PersonClient client = new PersonClient();
         String shortId = createIdentifier();
        String displayName = "displayName-" + shortId;
        //String baseRefName = PersonAuthorityClientUtils.createPersonAuthRefName(shortId, null);
@@ -615,7 +615,7 @@ public class PersonAuthoritySearchTest extends BaseServiceTest<AbstractCommonLis
         testSetup(expectedStatusCode, requestType);
 
         // Submit the request to the service and store the response.
-        PersonAuthorityClient client = new PersonAuthorityClient();
+        PersonClient client = new PersonClient();
         Map<String, String> partialTermPersonMap = new HashMap<String,String>();
         //
         // Fill values for the UNICODE item
@@ -657,7 +657,7 @@ public class PersonAuthoritySearchTest extends BaseServiceTest<AbstractCommonLis
                String testName, 
                String authorityCsid, 
                String authRefName,
-               PersonAuthorityClient client,
+               PersonClient client,
                Map<String, String> partialTermPersonMap,
                 List<PersonTermGroup> partialTerms,
                Map<String, List<String>> partialTermRepeatablesMap) throws Exception {
index 15200e89aa2b3c03c8b54269b4c202be4201279b..833354fe03a977d75b71e35d2ad4c48f097ab135 100644 (file)
@@ -31,7 +31,7 @@ import javax.ws.rs.core.Response;
 
 import org.collectionspace.services.PersonJAXBSchema;
 import org.collectionspace.services.client.CollectionSpaceClient;
-import org.collectionspace.services.client.PersonAuthorityClient;
+import org.collectionspace.services.client.PersonClient;
 import org.collectionspace.services.client.PersonAuthorityClientUtils;
 import org.collectionspace.services.client.PoxPayloadOut;
 import org.collectionspace.services.jaxb.AbstractCommonList;
@@ -94,12 +94,12 @@ public class PersonAuthorityServicePerfTest extends BaseServiceTest<AbstractComm
     
        @Override
        public String getServicePathComponent() {
-               return PersonAuthorityClient.SERVICE_PATH_COMPONENT;
+               return PersonClient.SERVICE_PATH_COMPONENT;
        }
 
        @Override
        protected String getServiceName() {
-               return PersonAuthorityClient.SERVICE_NAME;
+               return PersonClient.SERVICE_NAME;
        }
     
     /* (non-Javadoc)
@@ -107,12 +107,12 @@ public class PersonAuthorityServicePerfTest extends BaseServiceTest<AbstractComm
      */
     @Override
     protected CollectionSpaceClient getClientInstance() throws Exception {
-       return new PersonAuthorityClient();
+       return new PersonClient();
     }
 
        @Override
        protected CollectionSpaceClient getClientInstance(String clientPropertiesFilename) throws Exception {
-       return new PersonAuthorityClient(clientPropertiesFilename);
+       return new PersonClient(clientPropertiesFilename);
        }
 
     /* (non-Javadoc)
@@ -156,7 +156,7 @@ public class PersonAuthorityServicePerfTest extends BaseServiceTest<AbstractComm
         testSetup(expectedStatusCode, requestType);
 
         // Submit the request to the service and store the response.
-        PersonAuthorityClient client = new PersonAuthorityClient();
+        PersonClient client = new PersonClient();
         String shortId = "perfTestPersons";
        String displayName = "Perf Test Person Auth";
        //String baseRefName = PersonAuthorityClientUtils.createPersonAuthRefName(shortId, null);
@@ -189,7 +189,7 @@ public class PersonAuthorityServicePerfTest extends BaseServiceTest<AbstractComm
      * @param authorityCsid The CSID of the Authority in which the term will be created.
      * @param authRefName The refName of the Authority in which the term will be created.
      */
-    private void createItem(String firstName, String lastName, PersonAuthorityClient client )
+    private void createItem(String firstName, String lastName, PersonClient client )
         throws Exception {
             
         int expectedStatusCode = Response.Status.CREATED.getStatusCode();
@@ -197,7 +197,7 @@ public class PersonAuthorityServicePerfTest extends BaseServiceTest<AbstractComm
         testSetup(expectedStatusCode, requestType);
         
         if(client==null) {
-            client = new PersonAuthorityClient();
+            client = new PersonClient();
         }
 
         // Submit the request to the service and store the response.
@@ -240,7 +240,7 @@ public class PersonAuthorityServicePerfTest extends BaseServiceTest<AbstractComm
 
     private void createItems()
        throws Exception {
-        PersonAuthorityClient client = new PersonAuthorityClient();
+        PersonClient client = new PersonClient();
         String fullTest = System.getProperty("runFullItemsTest");
         runFullTest = Boolean.TRUE.toString().equalsIgnoreCase(fullTest); 
                int maxSuff = shortTestLimit;
@@ -308,7 +308,7 @@ public class PersonAuthorityServicePerfTest extends BaseServiceTest<AbstractComm
         testSetup(expectedStatusCode, requestType);
 
         // Submit the request to the service and store the response.
-        PersonAuthorityClient client = new PersonAuthorityClient();
+        PersonClient client = new PersonClient();
         Response res = null;
         if (authorityCsid != null) {
                res = client.readItemList(authorityCsid, partialTerm, keywords);
@@ -351,7 +351,7 @@ public class PersonAuthorityServicePerfTest extends BaseServiceTest<AbstractComm
        }
         // Note: Any non-success responses from the delete operations
         // below are ignored and not reported.
-        PersonAuthorityClient client = new PersonAuthorityClient();
+        PersonClient client = new PersonClient();
         // Clean up item resources.
         for (String itemId : allItemIdsCreated) {
             client.deleteItem(authId, itemId).close();
index 185291047f1cd9b926133be96f9d185a924206e5..4b6c1aaa62101e5d3e4f1cf88c657198a3e758f9 100644 (file)
@@ -39,7 +39,7 @@ import org.collectionspace.services.client.ContactClientUtils;
 import org.collectionspace.services.contact.AddressGroup;
 import org.collectionspace.services.contact.AddressGroupList;
 import org.collectionspace.services.contact.ContactsCommon;
-import org.collectionspace.services.client.PersonAuthorityClient;
+import org.collectionspace.services.client.PersonClient;
 import org.collectionspace.services.client.PersonAuthorityClientUtils;
 import org.collectionspace.services.jaxb.AbstractCommonList;
 import org.collectionspace.services.PersonJAXBSchema;
@@ -81,12 +81,12 @@ public class PersonAuthorityServiceTest extends AbstractAuthorityServiceTest<Per
 
     @Override
     public String getServicePathComponent() {
-        return PersonAuthorityClient.SERVICE_PATH_COMPONENT;
+        return PersonClient.SERVICE_PATH_COMPONENT;
     }
 
     @Override
     protected String getServiceName() {
-        return PersonAuthorityClient.SERVICE_NAME;
+        return PersonClient.SERVICE_NAME;
     }
 
     public String getItemServicePathComponent() {
@@ -129,12 +129,12 @@ public class PersonAuthorityServiceTest extends AbstractAuthorityServiceTest<Per
      */
     @Override
     protected CollectionSpaceClient getClientInstance() throws Exception {
-        return new PersonAuthorityClient();
+        return new PersonClient();
     }
     
        @Override
        protected CollectionSpaceClient getClientInstance(String clientPropertiesFilename) throws Exception {
-        return new PersonAuthorityClient(clientPropertiesFilename);
+        return new PersonClient(clientPropertiesFilename);
        }
 
     // ---------------------------------------------------------------
@@ -152,7 +152,7 @@ public class PersonAuthorityServiceTest extends AbstractAuthorityServiceTest<Per
         setupCreate();
 
         // Submit the request to the service and store the response.
-        PersonAuthorityClient client = new PersonAuthorityClient();
+        PersonClient client = new PersonClient();
         String shortId = createIdentifier();
         String displayName = "displayName-" + shortId;
         //String baseRefName = PersonAuthorityClientUtils.createPersonAuthRefName(shortId, null);
@@ -188,7 +188,7 @@ public class PersonAuthorityServiceTest extends AbstractAuthorityServiceTest<Per
 
     @Override
     protected PoxPayloadOut createInstance(String identifier) throws Exception {
-        PersonAuthorityClient client = new PersonAuthorityClient();
+        PersonClient client = new PersonClient();
         
         String displayName = "displayName-" + identifier;
         PoxPayloadOut multipart = PersonAuthorityClientUtils.createPersonAuthorityInstance(
@@ -199,7 +199,7 @@ public class PersonAuthorityServiceTest extends AbstractAuthorityServiceTest<Per
 
     @Override
     protected PoxPayloadOut createItemInstance(String parentCsid, String identifier) throws Exception {
-        String headerLabel = new PersonAuthorityClient().getItemCommonPartName();
+        String headerLabel = new PersonClient().getItemCommonPartName();
         
         HashMap<String, String> personInfo = new HashMap<String, String>();
         String shortId = "MarkTwainAuthor" + identifier;
@@ -300,7 +300,7 @@ public class PersonAuthorityServiceTest extends AbstractAuthorityServiceTest<Per
 
         // Submit the request to the service and store the response.
         if (client == null) {
-               client = new PersonAuthorityClient();
+               client = new PersonClient();
         }
         PoxPayloadOut multipart =
                 PersonAuthorityClientUtils.createPersonInstance(vcsid, null /*authRefName*/, itemFieldProperties,
@@ -381,7 +381,7 @@ public class PersonAuthorityServiceTest extends AbstractAuthorityServiceTest<Per
             logger.debug(testName + ":...");
         }
         // Submit the request to the service and store the response.
-        PersonAuthorityClient client = new PersonAuthorityClient();
+        PersonClient client = new PersonClient();
         String identifier = createIdentifier();
         PoxPayloadOut multipart = ContactClientUtils.createContactInstance(parentcsid,
                 itemcsid, identifier, new ContactClient().getCommonPartName());
@@ -428,7 +428,7 @@ public class PersonAuthorityServiceTest extends AbstractAuthorityServiceTest<Per
         testSetup(testExpectedStatusCode, testRequestType);
 
         // Create the payload to be included in the body of the request
-        PersonAuthorityClient client = new PersonAuthorityClient();
+        PersonClient client = new PersonClient();
         String shortId = createIdentifier() + "*" + createIdentifier();
         String displayName = "displayName-" + shortId;
         PoxPayloadOut multipart =
@@ -462,7 +462,7 @@ public class PersonAuthorityServiceTest extends AbstractAuthorityServiceTest<Per
         testRequestType = ServiceRequestType.CREATE;
         testSetup(testExpectedStatusCode, testRequestType);
 
-        PersonAuthorityClient client = new PersonAuthorityClient();
+        PersonClient client = new PersonClient();
         // Create the payload to be included in the body of the request
         String shortId = "7-Eleven";
         Map<String, String> fieldProperties = new HashMap<String, String>();
@@ -554,7 +554,7 @@ public class PersonAuthorityServiceTest extends AbstractAuthorityServiceTest<Per
 
     protected void readInternal(String testName, String CSID, String shortId) throws Exception {
         // Submit the request to the service and store the response.
-        PersonAuthorityClient client = new PersonAuthorityClient();
+        PersonClient client = new PersonClient();
         Response res = null;
         setupRead();
         if (CSID != null) {
@@ -629,7 +629,7 @@ public class PersonAuthorityServiceTest extends AbstractAuthorityServiceTest<Per
         }
 
         // Submit the request to the service and store the response.
-        PersonAuthorityClient client = new PersonAuthorityClient();
+        PersonClient client = new PersonClient();
         setupRead();
         Response res = null;
         if (authCSID != null) {
@@ -696,7 +696,7 @@ public class PersonAuthorityServiceTest extends AbstractAuthorityServiceTest<Per
         setupRead();
 
         // Submit the request to the service and store the response.
-        PersonAuthorityClient client = new PersonAuthorityClient();
+        PersonClient client = new PersonClient();
         Response res = client.readItem(knownResourceId, knownItemResourceId);
         PoxPayloadIn input = null;
         try {
@@ -723,7 +723,7 @@ public class PersonAuthorityServiceTest extends AbstractAuthorityServiceTest<Per
         terms.get(0).setTermName(null);
 
         // Submit the updated resource to the service and store the response.
-        PoxPayloadOut output = new PoxPayloadOut(PersonAuthorityClient.SERVICE_ITEM_PAYLOAD_NAME);
+        PoxPayloadOut output = new PoxPayloadOut(PersonClient.SERVICE_ITEM_PAYLOAD_NAME);
         output.addPart(client.getItemCommonPartName(), person);
         setupUpdateWithInvalidBody();
         res = client.updateItem(knownResourceId, knownItemResourceId, output);
@@ -749,7 +749,7 @@ public class PersonAuthorityServiceTest extends AbstractAuthorityServiceTest<Per
         setupRead();
 
         // Submit the request to the service and store the response.
-        PersonAuthorityClient client = new PersonAuthorityClient();
+        PersonClient client = new PersonClient();
         PoxPayloadIn input = null;
         Response res = client.readContact(knownResourceId, knownItemResourceId,
                 knownContactResourceId);
@@ -788,7 +788,7 @@ public class PersonAuthorityServiceTest extends AbstractAuthorityServiceTest<Per
         setupReadNonExistent();
 
         // Submit the request to the service and store the response.
-        PersonAuthorityClient client = new PersonAuthorityClient();
+        PersonClient client = new PersonClient();
         Response res = client.readContact(knownResourceId, knownItemResourceId,
                        NON_EXISTENT_ID);
         try {
@@ -828,7 +828,7 @@ public class PersonAuthorityServiceTest extends AbstractAuthorityServiceTest<Per
         setupReadList();
 
         // Submit the request to the service and store the response.
-        PersonAuthorityClient client = new PersonAuthorityClient();
+        PersonClient client = new PersonClient();
         AbstractCommonList list = null;
         Response res = client.readContactList(parentcsid, itemcsid);
         try {
@@ -877,7 +877,7 @@ public class PersonAuthorityServiceTest extends AbstractAuthorityServiceTest<Per
 //    groups = {"update"}, dependsOnGroups = {"readItem", "readList"})
     public void update(String testName) throws Exception {
         // Retrieve the contents of a resource to update.
-        PersonAuthorityClient client = new PersonAuthorityClient();
+        PersonClient client = new PersonClient();
         PoxPayloadIn input = null;
         setupRead();
         Response res = client.read(knownResourceId);
@@ -906,7 +906,7 @@ public class PersonAuthorityServiceTest extends AbstractAuthorityServiceTest<Per
         }
 
         // Submit the updated resource to the service and store the response.
-        PoxPayloadOut output = new PoxPayloadOut(PersonAuthorityClient.SERVICE_PAYLOAD_NAME);
+        PoxPayloadOut output = new PoxPayloadOut(PersonClient.SERVICE_PAYLOAD_NAME);
         output.addPart(client.getCommonPartName(), personAuthority);
         setupUpdate();
         res = client.update(knownResourceId, output);
@@ -940,7 +940,7 @@ public class PersonAuthorityServiceTest extends AbstractAuthorityServiceTest<Per
     @Override
     public void updateItem(String testName) throws Exception {
         // Retrieve the contents of a resource to update.
-        PersonAuthorityClient client = new PersonAuthorityClient();
+        PersonClient client = new PersonClient();
         PoxPayloadIn input = null;
         setupRead();
         Response res = client.readItem(knownResourceId, knownItemResourceId);
@@ -984,7 +984,7 @@ public class PersonAuthorityServiceTest extends AbstractAuthorityServiceTest<Per
         }
 
         // Submit the updated resource to the service and store the response.
-        PoxPayloadOut output = new PoxPayloadOut(PersonAuthorityClient.SERVICE_ITEM_PAYLOAD_NAME);
+        PoxPayloadOut output = new PoxPayloadOut(PersonClient.SERVICE_ITEM_PAYLOAD_NAME);
         output.addPart(client.getItemCommonPartName(), person);
         setupUpdate();
         res = client.updateItem(knownResourceId, knownItemResourceId, output);
@@ -1030,7 +1030,7 @@ public class PersonAuthorityServiceTest extends AbstractAuthorityServiceTest<Per
        String contactsCommonLabel = new ContactClient().getCommonPartName();
 
         // Retrieve the contents of a resource to update.
-        PersonAuthorityClient client = new PersonAuthorityClient();
+        PersonClient client = new PersonClient();
         PoxPayloadIn input = null;
         setupRead();
         Response res = client.readContact(knownResourceId, knownItemResourceId,
@@ -1130,7 +1130,7 @@ public class PersonAuthorityServiceTest extends AbstractAuthorityServiceTest<Per
         }
 
         // Submit the request to the service and store the response.
-        PersonAuthorityClient client = new PersonAuthorityClient();
+        PersonClient client = new PersonClient();
         setupDelete();
         Response res = client.deleteContact(knownResourceId, knownItemResourceId, 
                        knownContactResourceId);
@@ -1175,7 +1175,7 @@ public class PersonAuthorityServiceTest extends AbstractAuthorityServiceTest<Per
                dependsOnMethods = {"deleteContact"})
     public void deleteNonExistentContact(String testName) throws Exception {
         // Submit the request to the service and store the response.
-        PersonAuthorityClient client = new PersonAuthorityClient();
+        PersonClient client = new PersonClient();
         setupDeleteNonExistent();
         Response res = client.deleteContact(knownResourceId, knownItemResourceId, NON_EXISTENT_ID);
         try {
@@ -1244,7 +1244,7 @@ public class PersonAuthorityServiceTest extends AbstractAuthorityServiceTest<Per
         String itemResourceId;
         String contactResourceId;
         // Clean up contact resources.
-        PersonAuthorityClient client = new PersonAuthorityClient();
+        PersonClient client = new PersonClient();
         parentResourceId = this.getKnowResourceId();
         for (Map.Entry<String, String> entry : allContactResourceIdsCreated.entrySet()) {
             contactResourceId = entry.getKey();
index 2724e8be8d4519efde1607779c73ff78bf61335c..9d6f1c8acad3d169b69045acbbde9dbddb1ae7ce 100644 (file)
@@ -25,8 +25,8 @@ package org.collectionspace.services.person;
 import javax.ws.rs.Consumes;
 import javax.ws.rs.Path;
 import javax.ws.rs.Produces;
-import org.collectionspace.services.client.PersonAuthorityClient;
-import org.collectionspace.services.contact.AuthorityResourceWithContacts;
+import org.collectionspace.services.client.PersonClient;
+import org.collectionspace.services.common.vocabulary.AuthorityResourceWithContacts;
 import org.collectionspace.services.person.nuxeo.PersonDocumentModelHandler;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -37,7 +37,7 @@ import org.slf4j.LoggerFactory;
  * Handles, dispatches, and returns responses to RESTful requests related to
  * Person authority-related resources.
  */
-@Path(PersonAuthorityClient.SERVICE_PATH)
+@Path(PersonClient.SERVICE_PATH)
 @Consumes("application/xml")
 @Produces("application/xml")
 public class PersonAuthorityResource extends AuthorityResourceWithContacts<PersonauthoritiesCommon, PersonDocumentModelHandler> {
@@ -46,22 +46,22 @@ public class PersonAuthorityResource extends AuthorityResourceWithContacts<Perso
 
     public PersonAuthorityResource() {
         super(PersonauthoritiesCommon.class, PersonAuthorityResource.class,
-                PersonAuthorityClient.SERVICE_COMMON_PART_NAME, PersonAuthorityClient.SERVICE_ITEM_COMMON_PART_NAME);
+                PersonClient.SERVICE_COMMON_PART_NAME, PersonClient.SERVICE_ITEM_COMMON_PART_NAME);
     }
 
     @Override
     public String getServiceName() {
-        return PersonAuthorityClient.SERVICE_NAME;
+        return PersonClient.SERVICE_NAME;
     }
 
     @Override
     public String getItemServiceName() {
-        return PersonAuthorityClient.SERVICE_ITEM_NAME;
+        return PersonClient.SERVICE_ITEM_NAME;
     }
 
     @Override
     public String getItemTermInfoGroupXPathBase() {
-        return PersonAuthorityClient.TERM_INFO_GROUP_XPATH_BASE;
+        return PersonClient.TERM_INFO_GROUP_XPATH_BASE;
     }
 
     @Override
index dbef883777ea7bc0b325b0b8f2b95bc3f7736310..39e6d502ff42c2a8b8467fb2f6807fbc7f238e77 100644 (file)
@@ -24,7 +24,7 @@
 package org.collectionspace.services.person.nuxeo;
 
 import org.collectionspace.services.person.PersonauthoritiesCommon;
-import org.collectionspace.services.client.PersonAuthorityClient;
+import org.collectionspace.services.client.PersonClient;
 import org.collectionspace.services.common.vocabulary.nuxeo.AuthorityDocumentModelHandler;
 
 /**
@@ -35,7 +35,7 @@ public class PersonAuthorityDocumentModelHandler
                extends AuthorityDocumentModelHandler<PersonauthoritiesCommon> {
 
     public PersonAuthorityDocumentModelHandler() {
-       super(PersonAuthorityClient.SERVICE_COMMON_PART_NAME, PersonAuthorityClient.SERVICE_ITEM_COMMON_PART_NAME);
+       super(PersonClient.SERVICE_COMMON_PART_NAME, PersonClient.SERVICE_ITEM_COMMON_PART_NAME);
     }
        
     /**
index 088abf5973414ebeadab3aed1e1227d324719aab..59955e7694b85d72c9d5a742283e880bc7cfff4c 100644 (file)
@@ -23,8 +23,8 @@
  */
 package org.collectionspace.services.person.nuxeo;
 
-import org.collectionspace.services.client.PersonAuthorityClient;
-import org.collectionspace.services.common.vocabulary.nuxeo.AuthorityItemDocumentModelHandler;
+import org.collectionspace.services.client.PersonClient;
+import org.collectionspace.services.common.vocabulary.nuxeo.AuthorityItemWithContactsDocumentModelHandler;
 import org.collectionspace.services.person.PersonsCommon;
 
 /**
@@ -32,15 +32,15 @@ import org.collectionspace.services.person.PersonsCommon;
  *
  */
 public class PersonDocumentModelHandler
-       extends AuthorityItemDocumentModelHandler<PersonsCommon> {
+       extends AuthorityItemWithContactsDocumentModelHandler<PersonsCommon> {
 
     public PersonDocumentModelHandler() {
-       super(PersonAuthorityClient.SERVICE_COMMON_PART_NAME, PersonAuthorityClient.SERVICE_ITEM_COMMON_PART_NAME);
+       super(PersonClient.SERVICE_COMMON_PART_NAME, PersonClient.SERVICE_ITEM_COMMON_PART_NAME);
     }
 
     @Override
     public String getAuthorityServicePath(){
-        return PersonAuthorityClient.SERVICE_PATH_COMPONENT;    // CSPACE-3932
+        return PersonClient.SERVICE_PATH_COMPONENT;    // CSPACE-3932
     }
            
     /**
@@ -56,7 +56,7 @@ public class PersonDocumentModelHandler
        @Override
        public String getParentCommonSchemaName() {
                // TODO Auto-generated method stub
-               return PersonAuthorityClient.SERVICE_COMMON_PART_NAME;
+               return PersonClient.SERVICE_COMMON_PART_NAME;
        }
 }
 
index 9637b4ab5b2806680a5c083425e7378b306a60f1..bd04636544a0ebb50759b2633611048563deccdf 100644 (file)
@@ -32,7 +32,7 @@ import javax.ws.rs.core.Response;
 import org.collectionspace.services.PersonJAXBSchema;
 import org.collectionspace.services.client.CollectionSpaceClient;
 import org.collectionspace.services.client.PottagClient;
-import org.collectionspace.services.client.PersonAuthorityClient;
+import org.collectionspace.services.client.PersonClient;
 import org.collectionspace.services.client.PersonAuthorityClientUtils;
 import org.collectionspace.services.client.PayloadOutputPart;
 import org.collectionspace.services.client.PoxPayloadIn;
@@ -122,7 +122,7 @@ public class PottagAuthRefsTest extends BaseServiceTest<AbstractCommonList> {
     }
     
     protected void createPersonRefs() throws Exception {
-        PersonAuthorityClient personAuthClient = new PersonAuthorityClient();
+        PersonClient personAuthClient = new PersonClient();
         // Create a temporary PersonAuthority resource, and its corresponding
         // refName by which it can be identified.
        PoxPayloadOut multipart = PersonAuthorityClientUtils.createPersonAuthorityInstance(
@@ -145,7 +145,7 @@ public class PottagAuthRefsTest extends BaseServiceTest<AbstractCommonList> {
     }
     
     protected String createPerson(String firstName, String surName, String shortId, String authRefName ) throws Exception {
-        PersonAuthorityClient personAuthClient = new PersonAuthorityClient();
+        PersonClient personAuthClient = new PersonClient();
         Map<String, String> personInfo = new HashMap<String,String>();
         personInfo.put(PersonJAXBSchema.FORE_NAME, firstName);
         personInfo.put(PersonJAXBSchema.SUR_NAME, surName);
@@ -273,7 +273,7 @@ public class PottagAuthRefsTest extends BaseServiceTest<AbstractCommonList> {
         
         //
         // Delete Person resource(s) (before PersonAuthority resources).     
-        PersonAuthorityClient personAuthClient = new PersonAuthorityClient();
+        PersonClient personAuthClient = new PersonClient();
         for (String resourceId : personIdsCreated) {
             // Note: Any non-success responses are ignored and not reported.
                        personAuthClient.deleteItem(personAuthCSID, resourceId).close();
index b34b6f32cc649415b3496b377689086003c56cf8..9b518ff7a717e09b45c35567ca6114fb2244bb51 100644 (file)
@@ -33,7 +33,7 @@ import javax.ws.rs.core.Response;
 import org.collectionspace.services.PersonJAXBSchema;
 import org.collectionspace.services.client.CollectionSpaceClient;
 import org.collectionspace.services.client.PropagationClient;
-import org.collectionspace.services.client.PersonAuthorityClient;
+import org.collectionspace.services.client.PersonClient;
 import org.collectionspace.services.client.PersonAuthorityClientUtils;
 import org.collectionspace.services.client.PayloadOutputPart;
 import org.collectionspace.services.client.PoxPayloadIn;
@@ -135,7 +135,7 @@ public class PropagationAuthRefsTest extends BaseServiceTest<AbstractCommonList>
      * @throws Exception
      */
     protected void createPersonRefs() throws Exception {
-        PersonAuthorityClient personAuthClient = new PersonAuthorityClient();
+        PersonClient personAuthClient = new PersonClient();
         // Create a temporary PersonAuthority resource, and its corresponding
         // refName by which it can be identified.
        PoxPayloadOut multipart = PersonAuthorityClientUtils.createPersonAuthorityInstance(
@@ -162,7 +162,7 @@ public class PropagationAuthRefsTest extends BaseServiceTest<AbstractCommonList>
     }
     
     protected String createPerson(String firstName, String surName, String shortId, String authRefName ) throws Exception {
-        PersonAuthorityClient personAuthClient = new PersonAuthorityClient();
+        PersonClient personAuthClient = new PersonClient();
         Map<String, String> personInfo = new HashMap<String,String>();
         personInfo.put(PersonJAXBSchema.FORE_NAME, firstName);
         personInfo.put(PersonJAXBSchema.SUR_NAME, surName);
@@ -294,7 +294,7 @@ public class PropagationAuthRefsTest extends BaseServiceTest<AbstractCommonList>
 
         //
         // Delete Person resource(s) (before PersonAuthority resources). 
-        PersonAuthorityClient personAuthClient = new PersonAuthorityClient();
+        PersonClient personAuthClient = new PersonClient();
         for (String resourceId : personIdsCreated) {
             // Note: Any non-success responses are ignored and not reported.
                personAuthClient.deleteItem(personAuthCSID, resourceId).close();
index eaf89ee7e48f2d3db93a6f61607ad99ef0305b53..768e8f3bbe8253aaba26caf62e43bacddfb59c70 100644 (file)
@@ -32,7 +32,7 @@ import javax.ws.rs.core.Response;
 import org.collectionspace.services.PersonJAXBSchema;
 import org.collectionspace.services.client.CollectionSpaceClient;
 import org.collectionspace.services.client.PayloadOutputPart;
-import org.collectionspace.services.client.PersonAuthorityClient;
+import org.collectionspace.services.client.PersonClient;
 import org.collectionspace.services.client.PersonAuthorityClientUtils;
 import org.collectionspace.services.client.PoxPayloadOut;
 import org.collectionspace.services.client.RelationClient;
@@ -103,7 +103,7 @@ public class RelationServiceTest extends AbstractPoxServiceTestImpl<RelationsCom
     private void createPersonRefs() throws Exception {
         setupCreate();
 
-        PersonAuthorityClient personAuthClient = new PersonAuthorityClient();
+        PersonClient personAuthClient = new PersonClient();
         PoxPayloadOut multipart = PersonAuthorityClientUtils.createPersonAuthorityInstance(
                        personAuthDisplayName, personAuthShortId, personAuthClient.getCommonPartName());
         Response res = personAuthClient.create(multipart);
@@ -136,7 +136,7 @@ public class RelationServiceTest extends AbstractPoxServiceTestImpl<RelationsCom
     
     @AfterSuite
     private void deletePersonRefs() throws Exception {
-        PersonAuthorityClient personAuthClient = new PersonAuthorityClient();
+        PersonClient personAuthClient = new PersonClient();
         for (String csid:personIdsCreated) {
                Response res = personAuthClient.deleteItem(personAuthCSID, csid);
                try {
@@ -168,7 +168,7 @@ public class RelationServiceTest extends AbstractPoxServiceTestImpl<RelationsCom
     private String createPerson(String firstName, String surName, String shortId, String authRefName) throws Exception {
        String result = null;
        
-        PersonAuthorityClient personAuthClient = new PersonAuthorityClient();
+        PersonClient personAuthClient = new PersonClient();
         Map<String, String> personInfo = new HashMap<String, String>();
         personInfo.put(PersonJAXBSchema.FORE_NAME, firstName);
         personInfo.put(PersonJAXBSchema.SUR_NAME, surName);
index 5eda18c2c0a2f6bc95438ea5c60be50a02139efc..ff2e12edd2e05cb6a3a39042f5837dba372971bd 100644 (file)
@@ -32,7 +32,7 @@ import javax.ws.rs.core.Response;
 import org.collectionspace.services.PersonJAXBSchema;
 import org.collectionspace.services.client.CollectionSpaceClient;
 import org.collectionspace.services.client.UocClient;
-import org.collectionspace.services.client.PersonAuthorityClient;
+import org.collectionspace.services.client.PersonClient;
 import org.collectionspace.services.client.PersonAuthorityClientUtils;
 import org.collectionspace.services.client.PayloadOutputPart;
 import org.collectionspace.services.client.PoxPayloadIn;
@@ -154,7 +154,7 @@ public class UocAuthRefsTest extends BaseServiceTest<AbstractCommonList> {
 
     protected void createPersonRefs() throws Exception {
 
-        PersonAuthorityClient personAuthClient = new PersonAuthorityClient();
+        PersonClient personAuthClient = new PersonClient();
         // Create a temporary PersonAuthority resource, and its corresponding
         // refName by which it can be identified.
         PoxPayloadOut multipart = PersonAuthorityClientUtils.createPersonAuthorityInstance(PERSON_AUTHORITY_NAME,
@@ -212,7 +212,7 @@ public class UocAuthRefsTest extends BaseServiceTest<AbstractCommonList> {
             throws Exception {
         String result = null;
 
-        PersonAuthorityClient personAuthClient = new PersonAuthorityClient();
+        PersonClient personAuthClient = new PersonClient();
         Map<String, String> personInfo = new HashMap<String, String>();
         personInfo.put(PersonJAXBSchema.FORE_NAME, firstName);
         personInfo.put(PersonJAXBSchema.SUR_NAME, surName);
@@ -356,7 +356,7 @@ public class UocAuthRefsTest extends BaseServiceTest<AbstractCommonList> {
         //
         // Delete Person resource(s) (before PersonAuthority resources).
         //
-        PersonAuthorityClient personAuthClient = new PersonAuthorityClient();
+        PersonClient personAuthClient = new PersonClient();
         for (String csid : personIdsCreated) {
             Response res = null;
             try {