]> git.aero2k.de Git - tmp/jakarta-migration.git/commitdiff
CSPACE-3711, CSPACE-3706, CSPACE-3708, CSPACE-3496, CSPACE-3483: Workflow (soft-delet...
authorRichard Millet <richard.millet@berkeley.edu>
Mon, 28 Mar 2011 23:11:23 +0000 (23:11 +0000)
committerRichard Millet <richard.millet@berkeley.edu>
Mon, 28 Mar 2011 23:11:23 +0000 (23:11 +0000)
135 files changed:
3rdparty/nuxeo/nuxeo-platform-collectionspace/src/main/resources/META-INF/MANIFEST.MF
3rdparty/nuxeo/nuxeo-platform-collectionspace/src/main/resources/OSGI-INF/core-types-contrib.xml
3rdparty/nuxeo/nuxeo-platform-collectionspace/src/main/resources/OSGI-INF/default-life-cycle-contrib.xml [new file with mode: 0644]
3rdparty/nuxeo/nuxeo-platform-collectionspace/src/main/resources/OSGI-INF/querymodel-contrib.xml
services/JaxRsServiceProvider/.classpath
services/JaxRsServiceProvider/.project
services/JaxRsServiceProvider/pom.xml
services/JaxRsServiceProvider/src/main/java/org/collectionspace/services/jaxrs/CollectionSpaceJaxRsApplication.java
services/account/client/src/main/java/org/collectionspace/services/client/AccountClient.java
services/account/client/src/main/java/org/collectionspace/services/client/AccountProxy.java
services/account/client/src/main/java/org/collectionspace/services/client/AccountRoleClient.java
services/account/client/src/main/java/org/collectionspace/services/client/AccountRoleProxy.java
services/acquisition/client/src/main/java/org/collectionspace/services/client/AcquisitionClient.java
services/acquisition/client/src/main/java/org/collectionspace/services/client/AcquisitionProxy.java
services/acquisition/service/src/main/java/org/collectionspace/services/acquisition/AcquisitionResource.java
services/authorization-mgt/client/src/main/java/org/collectionspace/services/client/PermissionClient.java
services/authorization-mgt/client/src/main/java/org/collectionspace/services/client/PermissionProxy.java
services/authorization-mgt/client/src/main/java/org/collectionspace/services/client/PermissionRoleClient.java
services/authorization-mgt/client/src/main/java/org/collectionspace/services/client/PermissionRoleProxy.java
services/authorization-mgt/client/src/main/java/org/collectionspace/services/client/RoleClient.java
services/authorization-mgt/client/src/main/java/org/collectionspace/services/client/RolePermissionClient.java
services/authorization-mgt/client/src/main/java/org/collectionspace/services/client/RolePermissionProxy.java
services/authorization-mgt/client/src/main/java/org/collectionspace/services/client/RoleProxy.java
services/authorization-mgt/service/src/main/java/org/collectionspace/services/authorization/RoleResource.java
services/blob/client/src/main/java/org/collectionspace/services/client/BlobClient.java
services/blob/client/src/main/java/org/collectionspace/services/client/BlobProxy.java
services/client/.classpath
services/client/src/main/java/org/collectionspace/services/client/AbstractPoxServiceClientImpl.java [new file with mode: 0644]
services/client/src/main/java/org/collectionspace/services/client/AbstractServiceClientImpl.java
services/client/src/main/java/org/collectionspace/services/client/AuthorityClient.java [new file with mode: 0644]
services/client/src/main/java/org/collectionspace/services/client/AuthorityClientImpl.java [new file with mode: 0644]
services/client/src/main/java/org/collectionspace/services/client/AuthorityProxy.java [new file with mode: 0644]
services/client/src/main/java/org/collectionspace/services/client/CollectionSpaceClient.java
services/client/src/main/java/org/collectionspace/services/client/CollectionSpacePoxClient.java [new file with mode: 0644]
services/client/src/main/java/org/collectionspace/services/client/CollectionSpacePoxProxy.java [new file with mode: 0644]
services/client/src/main/java/org/collectionspace/services/client/CollectionSpaceProxy.java
services/client/src/main/java/org/collectionspace/services/client/IQueryManager.java [moved from services/common/src/main/java/org/collectionspace/services/common/query/IQueryManager.java with 94% similarity]
services/client/src/main/java/org/collectionspace/services/client/TestServiceClient.java
services/client/src/main/java/org/collectionspace/services/client/TestServiceProxy.java [new file with mode: 0644]
services/client/src/main/java/org/collectionspace/services/client/test/ServiceTestUtils.java [new file with mode: 0644]
services/collectionobject/3rdparty/nuxeo-platform-cs-collectionobject/src/main/resources/META-INF/MANIFEST.MF
services/collectionobject/3rdparty/nuxeo-platform-cs-collectionobject/src/main/resources/OSGI-INF/core-types-contrib.xml
services/collectionobject/3rdparty/nuxeo-platform-cs-collectionobject/src/main/resources/OSGI-INF/life-cycle-contrib.xml [new file with mode: 0644]
services/collectionobject/client/src/main/java/org/collectionspace/services/client/CollectionObjectClient.java
services/collectionobject/client/src/main/java/org/collectionspace/services/client/CollectionObjectProxy.java
services/collectionobject/service/src/main/java/org/collectionspace/services/collectionobject/CollectionObjectResource.java
services/common-api/.project
services/common/src/main/cspace/config/services/tenants/collectionspace/tenant-bindings.xml
services/common/src/main/java/org/collectionspace/services/common/AbstractMultiPartCollectionSpaceResourceImpl.java
services/common/src/main/java/org/collectionspace/services/common/ResourceBase.java
services/common/src/main/java/org/collectionspace/services/common/ServiceMessages.java
services/common/src/main/java/org/collectionspace/services/common/context/AbstractServiceContextImpl.java
services/common/src/main/java/org/collectionspace/services/common/context/MultipartServiceContext.java
services/common/src/main/java/org/collectionspace/services/common/context/MultipartServiceContextImpl.java
services/common/src/main/java/org/collectionspace/services/common/query/QueryManager.java
services/common/src/main/java/org/collectionspace/services/common/query/nuxeo/QueryManagerNuxeoImpl.java
services/common/src/main/java/org/collectionspace/services/common/relation/nuxeo/RelationsUtils.java
services/common/src/main/java/org/collectionspace/services/common/vocabulary/AuthorityResource.java
services/common/src/main/java/org/collectionspace/services/common/vocabulary/VocabManagerImpl.java
services/common/src/main/java/org/collectionspace/services/common/workflow/client/WorkflowClient.java [new file with mode: 0644]
services/common/src/main/java/org/collectionspace/services/common/workflow/client/WorkflowProxy.java [new file with mode: 0644]
services/common/src/main/java/org/collectionspace/services/nuxeo/client/java/RemoteDocumentModelHandlerImpl.java
services/common/src/main/java/org/collectionspace/services/nuxeo/client/java/RepositoryJavaClientImpl.java
services/contact/client/src/main/java/org/collectionspace/services/client/AuthorityWithContactsClient.java [new file with mode: 0644]
services/contact/client/src/main/java/org/collectionspace/services/client/AuthorityWithContactsClientImpl.java [new file with mode: 0644]
services/contact/client/src/main/java/org/collectionspace/services/client/AuthorityWithContactsProxy.java [new file with mode: 0644]
services/contact/client/src/main/java/org/collectionspace/services/client/ContactClient.java
services/contact/client/src/main/java/org/collectionspace/services/client/ContactProxy.java
services/contact/service/src/main/java/org/collectionspace/services/contact/AuthorityResourceWithContacts.java
services/dimension/3rdparty/nuxeo-platform-cs-dimension/src/main/resources/META-INF/MANIFEST.MF
services/dimension/3rdparty/nuxeo-platform-cs-dimension/src/main/resources/OSGI-INF/life-cycle-contrib.xml [new file with mode: 0644]
services/dimension/client/src/main/java/org/collectionspace/services/client/DimensionClient.java
services/dimension/client/src/main/java/org/collectionspace/services/client/DimensionProxy.java
services/dimension/client/src/test/java/org/collectionspace/services/client/test/DimensionServiceTest.java
services/id/client/src/main/java/org/collectionspace/services/client/IdClient.java
services/id/client/src/main/java/org/collectionspace/services/client/IdProxy.java
services/intake/3rdparty/nuxeo-platform-cs-intake/src/main/resources/META-INF/MANIFEST.MF
services/intake/3rdparty/nuxeo-platform-cs-intake/src/main/resources/OSGI-INF/core-types-contrib.xml
services/intake/3rdparty/nuxeo-platform-cs-intake/src/main/resources/OSGI-INF/life-cycle-contrib.xml [new file with mode: 0644]
services/intake/client/src/main/java/org/collectionspace/services/client/IntakeClient.java
services/intake/client/src/main/java/org/collectionspace/services/client/IntakeProxy.java
services/intake/service/src/main/java/org/collectionspace/services/intake/IntakeResource.java
services/jaxb/src/main/resources/authorityrefdocs.xsd [moved from services/common/src/main/resources/authorityrefdocs.xsd with 99% similarity]
services/jaxb/src/main/resources/workflows_common.xsd [new file with mode: 0644]
services/loanin/client/src/main/java/org/collectionspace/services/client/LoaninClient.java
services/loanin/client/src/main/java/org/collectionspace/services/client/LoaninProxy.java
services/loanin/service/src/main/java/org/collectionspace/services/loanin/LoaninResource.java
services/loanout/client/src/main/java/org/collectionspace/services/client/LoanoutClient.java
services/loanout/client/src/main/java/org/collectionspace/services/client/LoanoutProxy.java
services/loanout/service/src/main/java/org/collectionspace/services/loanout/LoanoutResource.java
services/location/client/src/main/java/org/collectionspace/services/client/LocationAuthorityClient.java
services/location/client/src/main/java/org/collectionspace/services/client/LocationAuthorityProxy.java
services/location/service/src/main/java/org/collectionspace/services/location/LocationAuthorityResource.java
services/media/client/src/main/java/org/collectionspace/services/client/MediaClient.java
services/media/client/src/main/java/org/collectionspace/services/client/MediaProxy.java
services/movement/client/src/main/java/org/collectionspace/services/client/MovementClient.java
services/movement/client/src/main/java/org/collectionspace/services/client/MovementProxy.java
services/movement/service/src/main/java/org/collectionspace/services/movement/MovementResource.java
services/note/client/src/main/java/org/collectionspace/services/client/NoteClient.java
services/objectexit/client/src/main/java/org/collectionspace/services/client/ObjectExitClient.java
services/objectexit/client/src/main/java/org/collectionspace/services/client/ObjectExitProxy.java
services/organization/client/src/main/java/org/collectionspace/services/client/OrgAuthorityClient.java
services/organization/client/src/main/java/org/collectionspace/services/client/OrgAuthorityProxy.java
services/person/client/src/main/java/org/collectionspace/services/client/PersonAuthorityClient.java
services/person/client/src/main/java/org/collectionspace/services/client/PersonAuthorityProxy.java
services/pom.xml
services/relation/client/src/main/java/org/collectionspace/services/client/RelationClient.java
services/relation/client/src/main/java/org/collectionspace/services/client/RelationProxy.java
services/relation/service/src/main/java/org/collectionspace/services/relation/RelationResource.java
services/report/client/src/main/java/org/collectionspace/services/client/ReportClient.java
services/report/client/src/main/java/org/collectionspace/services/client/ReportProxy.java
services/report/service/src/main/java/org/collectionspace/services/report/ReportResource.java
services/vocabulary/client/src/main/java/org/collectionspace/services/client/VocabularyClient.java
services/vocabulary/client/src/main/java/org/collectionspace/services/client/VocabularyProxy.java
services/vocabulary/client/src/test/java/org/collectionspace/services/client/test/VocabularyServiceTest.java
services/workflow/3rdparty/build.xml [new file with mode: 0644]
services/workflow/3rdparty/nuxeo-platform-cs-workflow/build.xml [new file with mode: 0644]
services/workflow/3rdparty/nuxeo-platform-cs-workflow/pom.xml [new file with mode: 0644]
services/workflow/3rdparty/nuxeo-platform-cs-workflow/src/main/resources/META-INF/MANIFEST.MF [new file with mode: 0644]
services/workflow/3rdparty/nuxeo-platform-cs-workflow/src/main/resources/OSGI-INF/core-types-contrib.xml [new file with mode: 0644]
services/workflow/3rdparty/nuxeo-platform-cs-workflow/src/main/resources/OSGI-INF/deployment-fragment.xml [new file with mode: 0644]
services/workflow/3rdparty/nuxeo-platform-cs-workflow/src/main/resources/schemas/workflows_common.xsd [new file with mode: 0644]
services/workflow/3rdparty/pom.xml [new file with mode: 0644]
services/workflow/build.xml [new file with mode: 0644]
services/workflow/client/pom.xml [new file with mode: 0644]
services/workflow/client/src/test/java/org/collectionspace/services/client/test/WorkflowServiceTest.java [new file with mode: 0644]
services/workflow/client/src/test/resources/log4j.properties [new file with mode: 0644]
services/workflow/jaxb/pom.xml [new file with mode: 0644]
services/workflow/pom.xml [new file with mode: 0644]
services/workflow/service/.project [new file with mode: 0644]
services/workflow/service/pom.xml [new file with mode: 0644]
services/workflow/service/src/main/java/org/collectionspace/services/workflow/WorkflowResource.java [new file with mode: 0644]
services/workflow/service/src/main/java/org/collectionspace/services/workflow/nuxeo/WorkflowValidatorHandler.java [new file with mode: 0644]
services/workflow/service/src/test/java/org/collectionspace/services/test/WorkflowServiceTest.java [new file with mode: 0644]
services/workflow/service/src/test/resources/log4j.xml [new file with mode: 0644]

index 68d7e9bbf166168c7571506e2b0715bf822bd80f..22c7df63dfc8c6c0f1645f5e2be2a0e5bb1dbf8e 100644 (file)
@@ -11,6 +11,7 @@ Require-Bundle: org.nuxeo.runtime,
  org.nuxeo.ecm.webapp.core\r
 Provide-Package: org.collectionspace.collectionspace_core\r
 Nuxeo-Component: OSGI-INF/core-types-contrib.xml,\r
+ OSGI-INF/default-life-cycle-contrib.xml,\r
  OSGI-INF/ecm-types-contrib.xml,\r
  OSGI-INF/layouts-contrib.xml\r
 \r
index df22ac00c0b89535ac3912ae3c220a7602c8a2e9..a6f879e491ec640a898bd72ec94a52cf8b33beb9 100644 (file)
@@ -4,6 +4,10 @@
     <schema name="collectionspace_core" prefix="collectionspace_core" src="schemas/collectionspace_core.xsd"/>
     <schema name="subitem" prefix="subitem" src="schemas/subitem.xsd"/>
   </extension>
+  <extension target="org.nuxeo.ecm.core.schema.TypeService" point="doctype">
+    <doctype name="CollectionSpaceDocument" extends="Document">
+    </doctype>
+  </extension>  
   <extension target="org.nuxeo.ecm.core.schema.TypeService" point="doctype">
     <doctype name="CollectionSpace_Core" extends="Document">
       <schema name="common"/>
diff --git a/3rdparty/nuxeo/nuxeo-platform-collectionspace/src/main/resources/OSGI-INF/default-life-cycle-contrib.xml b/3rdparty/nuxeo/nuxeo-platform-collectionspace/src/main/resources/OSGI-INF/default-life-cycle-contrib.xml
new file mode 100644 (file)
index 0000000..d68c55c
--- /dev/null
@@ -0,0 +1,11 @@
+<?xml version="1.0"?>
+<component name="org.collectionspace.ecm.platform.default.LifeCycleManagerExtensions">
+
+  <extension target="org.nuxeo.ecm.core.lifecycle.LifeCycleService"
+             point="types">
+    <types>
+      <type name="CollectionSpaceDocument">default</type>
+    </types>
+  </extension>
+
+</component>
index ecbed6c0959e20b693bcb3bc8091adc0edb9383e..c8fa3f7283035fbb2f8c079d791bb5a64731df14 100644 (file)
@@ -1,6 +1,6 @@
 <?xml version="1.0"?>\r
 \r
-<component name="com.myexample.query.model.override">\r
+<component name="com.collectionspace.query.model.override">\r
   <require>org.nuxeo.ecm.webapp.querymodel.DefaultQueryModels</require>\r
   <extension\r
     target="org.nuxeo.ecm.core.search.api.client.querymodel.QueryModelService"\r
index 5a709acd078283dc2b19833456de417f2e37b0c7..6c03a89cd10d28981af9d91694b693db99ff5c5e 100644 (file)
   <classpathentry kind="src" path="/org.collectionspace.services.vocabulary.client"/>\r
   <classpathentry kind="src" path="/org.collectionspace.services.vocabulary.jaxb"/>\r
   <classpathentry kind="src" path="/org.collectionspace.services.vocabulary.service"/>\r
+  <classpathentry kind="src" path="/org.collectionspace.services.workflow.service"/>\r
   <classpathentry kind="var" path="M2_REPO/org/osgi/org.osgi.core/4.1.0/org.osgi.core-4.1.0.jar"/>\r
   <classpathentry kind="var" path="M2_REPO/org/restlet/org.restlet/1.0.7/org.restlet-1.0.7.jar"/>\r
   <classpathentry kind="var" path="M2_REPO/org/codehaus/plexus/plexus-container-default/1.0-alpha-9-stable-1/plexus-container-default-1.0-alpha-9-stable-1.jar" sourcepath="M2_REPO/org/codehaus/plexus/plexus-container-default/1.0-alpha-9-stable-1/plexus-container-default-1.0-alpha-9-stable-1-sources.jar">\r
index 0f523f3ba486fc27fbeb9ed4b83c776947ce9133..277d1eba9d54ddd083f5f353ebeb10cd11609b54 100644 (file)
@@ -59,6 +59,7 @@
     <project>org.collectionspace.services.vocabulary.client</project>\r
     <project>org.collectionspace.services.vocabulary.jaxb</project>\r
     <project>org.collectionspace.services.vocabulary.service</project>\r
+    <project>org.collectionspace.services.workflow.service</project>\r
   </projects>\r
   <buildSpec>\r
     <buildCommand>\r
index 5727103a8162bbda4dda5c5f0d3d279bf4200b15..c3a86268312c939c9a15fa9f8c502adc678400ba 100644 (file)
             <artifactId>org.collectionspace.services.relation.service</artifactId>\r
             <version>${project.version}</version>\r
         </dependency>\r
+        <dependency>\r
+            <groupId>org.collectionspace.services</groupId>\r
+            <artifactId>org.collectionspace.services.workflow.service</artifactId>\r
+            <version>${project.version}</version>\r
+        </dependency>\r
         <!--dependency>\r
             <groupId>org.collectionspace.services</groupId>\r
             <artifactId>org.collectionspace.services.query.service</artifactId>\r
index f669634d35e8829f81e2e8419355fea6159d53d0..fc5074f62446aa89734eb993df130d057f86b022 100644 (file)
@@ -43,6 +43,7 @@ import org.collectionspace.services.contact.ContactResource;
 import org.collectionspace.services.vocabulary.VocabularyResource;
 import org.collectionspace.services.organization.OrgAuthorityResource;
 import org.collectionspace.services.person.PersonAuthorityResource;
+import org.collectionspace.services.workflow.WorkflowResource;
 
 //import org.collectionspace.services.query.QueryResource;
 
@@ -79,13 +80,13 @@ public class CollectionSpaceJaxRsApplication extends Application {
         singletons.add(new AccountResource());
         singletons.add(new RoleResource());
         singletons.add(new PermissionResource());
-        singletons.add(new CollectionObjectResource());
-        singletons.add(new IntakeResource());
         singletons.add(new VocabularyResource());
-        singletons.add(new DimensionResource());
         singletons.add(new ContactResource());
         singletons.add(new PersonAuthorityResource());
         singletons.add(new OrgAuthorityResource());
+        singletons.add(new CollectionObjectResource());
+        singletons.add(new IntakeResource());
+        singletons.add(new DimensionResource());
         singletons.add(new RelationResource());
         singletons.add(new NoteResource());
         singletons.add(new LoaninResource());
@@ -99,6 +100,9 @@ public class CollectionSpaceJaxRsApplication extends Application {
         singletons.add(new ReportResource());
         singletons.add(new LocationAuthorityResource());
         singletons.add(new IDResource());
+        /*
+        singletons.add(new WorkflowResource());
+        */
 //        singletons.add(new QueryResource());
 //        singletons.add(new DomainIdentifierResource());
 //        singletons.add(new PingResource());
index 758b172c13640ac55c21ad6de42e1615b5d8e3e7..025c542b6f30670e3d921dab48d696d2c4e510a3 100644 (file)
 package org.collectionspace.services.client;
 
 import javax.ws.rs.core.Response;
-
-
 import org.collectionspace.services.account.AccountsCommon;
 import org.collectionspace.services.account.AccountsCommonList;
-import org.jboss.resteasy.client.ProxyFactory;
-import org.jboss.resteasy.plugins.providers.RegisterBuiltin;
 import org.jboss.resteasy.client.ClientResponse;
-import org.jboss.resteasy.client.core.executors.ApacheHttpClientExecutor;
-import org.jboss.resteasy.spi.ResteasyProviderFactory;
 
 /**
  * A AccountClient.
 
  * @version $Revision:$
  */
-public class AccountClient extends AbstractServiceClientImpl {
+public class AccountClient extends AbstractServiceClientImpl<AccountProxy> {
     public static final String SERVICE_NAME = "accounts";
 
-    /**
-     *
-     */
-    private AccountProxy accountProxy;
-
        @Override
        public String getServiceName() {
                return SERVICE_NAME;
@@ -62,48 +51,30 @@ public class AccountClient extends AbstractServiceClientImpl {
     public String getServicePathComponent() {
         return SERVICE_NAME;
     }
-
-    /**
-     *
-     * Default constructor for AccountClient class.
-     *
-     */
-    public AccountClient() {
-        ResteasyProviderFactory factory = ResteasyProviderFactory.getInstance();
-        RegisterBuiltin.register(factory);
-        setProxy();
-    }
-
-    @Override
-    public CollectionSpaceProxy getProxy() {
-        return this.accountProxy;
-    }
-
-    /**
-     * allow to reset proxy as per security needs
-     */
-    public void setProxy() {
-        if (useAuth()) {
-            accountProxy = ProxyFactory.create(AccountProxy.class,
-                    getBaseURL(), new ApacheHttpClientExecutor(getHttpClient()));
-        } else {
-            accountProxy = ProxyFactory.create(AccountProxy.class,
-                    getBaseURL());
-        }
+    
+    public String getTenantId() {
+        return getProperty(AccountClient.TENANT_PROPERTY);
     }
 
+       @Override
+       public Class<AccountProxy> getProxyClass() {
+               return AccountProxy.class;
+       }    
+
+       /*
+        * CRUD+L Methods
+        */
+       
     /**
      * @return response
      * @see org.collectionspace.hello.client.AccountProxy#readList()
      */
     public ClientResponse<AccountsCommonList> readList() {
-        return accountProxy.readList();
-
+        return getProxy().readList();
     }
 
     public ClientResponse<AccountsCommonList> readSearchList(String screenName, String uid, String email) {
-        return accountProxy.readSearchList(screenName, uid, email);
-
+        return getProxy().readSearchList(screenName, uid, email);
     }
 
     /**
@@ -112,7 +83,7 @@ public class AccountClient extends AbstractServiceClientImpl {
      * @see org.collectionspace.hello.client.AccountProxy#getAccount(java.lang.String)
      */
     public ClientResponse<AccountsCommon> read(String csid) {
-        return accountProxy.read(csid);
+        return getProxy().read(csid);
     }
 
     /**
@@ -122,7 +93,7 @@ public class AccountClient extends AbstractServiceClientImpl {
      * @see org.collectionspace.hello.client.AccountProxy#create(org.collectionspace.services.account.AccountsCommon)
      */
     public ClientResponse<Response> create(AccountsCommon multipart) {
-        return accountProxy.create(multipart);
+        return getProxy().create(multipart);
     }
 
     /**
@@ -133,21 +104,6 @@ public class AccountClient extends AbstractServiceClientImpl {
      * @see org.collectionspace.hello.client.AccountProxy#updateAccount(java.lang.Long, org.collectionspace.services.account.AccountsCommon)
      */
     public ClientResponse<AccountsCommon> update(String csid, AccountsCommon multipart) {
-        return accountProxy.update(csid, multipart);
-    }
-
-    /**
-     * @param csid
-     * @return response
-     * @see org.collectionspace.hello.client.AccountProxy#deleteAccount(java.lang.Long)
-     */
-    @Override
-    public ClientResponse<Response> delete(String csid) {
-        return accountProxy.delete(csid);
-    }
-    
-    
-    public String getTenantId() {
-        return getProperty(AccountClient.TENANT_PROPERTY);
+        return getProxy().update(csid, multipart);
     }
 }
index 2b53494cd6f64386935f8b10bb5233e644e69fc5..2988a7f942918cdef3a421c49411d7cd74149b00 100644 (file)
@@ -56,7 +56,7 @@ public interface AccountProxy extends CollectionSpaceProxy {
     @Produces({"application/xml"})
     ClientResponse<AccountsCommonList> readList();
 
-        @GET
+    @GET
     @Produces({"application/xml"})
     ClientResponse<AccountsCommonList> readSearchList(@QueryParam("sn") String screenName, @QueryParam("uid") String uid, @QueryParam("email") String email);
 
@@ -73,9 +73,4 @@ public interface AccountProxy extends CollectionSpaceProxy {
     @PUT
     @Path("/{csid}")
     ClientResponse<AccountsCommon> update(@PathParam("csid") String csid, AccountsCommon multipart);
-
-    //(D)elete
-    @DELETE
-    @Path("/{csid}")
-    ClientResponse<Response> delete(@PathParam("csid") String csid);
 }
index f29dab264a7ac30272ac12a72bd129a94b4998cd..028a114497cebbfa7225863967e70908424cade3 100644 (file)
@@ -30,18 +30,14 @@ import javax.ws.rs.core.Response;
 
 //import org.collectionspace.services.authorization.AccountRolesList;
 import org.collectionspace.services.authorization.AccountRole;
-import org.jboss.resteasy.client.ProxyFactory;
-import org.jboss.resteasy.plugins.providers.RegisterBuiltin;
 import org.jboss.resteasy.client.ClientResponse;
-import org.jboss.resteasy.client.core.executors.ApacheHttpClientExecutor;
-import org.jboss.resteasy.spi.ResteasyProviderFactory;
 
 /**
  * A AccountRoleClient.
 
  * @version $Revision:$
  */
-public class AccountRoleClient extends AbstractServiceClientImpl {
+public class AccountRoleClient extends AbstractServiceClientImpl<AccountRoleProxy> {
        public static final String SERVICE_NAME = "accountroles";
 
        @Override
@@ -49,11 +45,6 @@ public class AccountRoleClient extends AbstractServiceClientImpl {
                return AccountRoleClient.SERVICE_NAME;
        }
 
-    /**
-     *
-     */
-    private AccountRoleProxy accountRoleProxy;
-
     /* (non-Javadoc)
      * @see 
      */
@@ -61,36 +52,15 @@ public class AccountRoleClient extends AbstractServiceClientImpl {
         return "accounts";
     }
 
-    /**
-     *
-     * Default constructor for AccountRoleClient class.
-     *
-     */
-    public AccountRoleClient() {
-        ResteasyProviderFactory factory = ResteasyProviderFactory.getInstance();
-        RegisterBuiltin.register(factory);
-        setProxy();
-    }
-
-    @Override
-    public CollectionSpaceProxy getProxy() {
-       return this.accountRoleProxy;
-    }
-    
-    /**
-     * allow to reset proxy as per security needs
-     */
-    public void setProxy() {
-        if (useAuth()) {
-            accountRoleProxy = ProxyFactory.create(AccountRoleProxy.class,
-                    getBaseURL(), new ApacheHttpClientExecutor(getHttpClient()));
-        } else {
-            accountRoleProxy = ProxyFactory.create(AccountRoleProxy.class,
-                    getBaseURL());
-        }
-    }
-
+       @Override
+       public Class<AccountRoleProxy> getProxyClass() {
+               return AccountRoleProxy.class;
+       }
 
+       /*
+        * CRUD+L Methods
+        */
+       
     /**
      * @param csid
      * @param arcsid relationship does not have an id, junk is fine
@@ -98,7 +68,7 @@ public class AccountRoleClient extends AbstractServiceClientImpl {
      * @see 
      */
     public ClientResponse<AccountRole> read(String csid, String arcsid) {
-        return accountRoleProxy.read(csid, arcsid);
+        return getProxy().read(csid, arcsid);
     }
 
     /**
@@ -109,7 +79,7 @@ public class AccountRoleClient extends AbstractServiceClientImpl {
      * @return the client response
      */
     public ClientResponse<AccountRole> read(String csid) {
-        return accountRoleProxy.read(csid);
+        return getProxy().read(csid);
     }
 
     /**
@@ -119,7 +89,7 @@ public class AccountRoleClient extends AbstractServiceClientImpl {
      * @see 
      */
     public ClientResponse<Response> create(String csid, AccountRole accRole) {
-        return accountRoleProxy.create(csid, accRole);
+        return getProxy().create(csid, accRole);
     }
 
 
@@ -130,13 +100,6 @@ public class AccountRoleClient extends AbstractServiceClientImpl {
      * @see 
      */
     public ClientResponse<Response> delete(String csid, AccountRole accRole) {
-        return accountRoleProxy.delete(csid, "delete", accRole);
-    }
-
-    /* (non-Javadoc)
-     * @see org.collectionspace.services.client.AbstractServiceClientImpl#delete(java.lang.String)
-     */
-    public ClientResponse<Response> delete(String csid) {
-        return accountRoleProxy.delete(csid);
+        return getProxy().delete(csid, "delete", accRole);
     }
 }
index 04fdfe42c6a6df1dcba38ad91157a2aea58a7eed..d757d32aa082572c3091f575fdbfa44a3bf187a4 100644 (file)
@@ -27,9 +27,9 @@
 package org.collectionspace.services.client;
 
 import javax.ws.rs.Consumes;
+import javax.ws.rs.DELETE;
 import javax.ws.rs.GET;
 import javax.ws.rs.POST;
-import javax.ws.rs.DELETE;
 import javax.ws.rs.Path;
 import javax.ws.rs.PathParam;
 import javax.ws.rs.Produces;
@@ -72,7 +72,8 @@ public interface AccountRoleProxy extends CollectionSpaceProxy {
             AccountRole accRole);
 
     //(D)elete
-    @DELETE
+    @Override
+       @DELETE
     @Path("/{csid}/accountroles")
     ClientResponse<Response> delete(@PathParam("csid") String csid);
 }
index e78a7ebbbc852343b9e8239bb3833a2556640f29..9daf1ac6def3f3963a3a433a7e1c3de72b07a291 100644 (file)
@@ -1,21 +1,14 @@
 package org.collectionspace.services.client;
 
-import javax.ws.rs.core.Response;
-
-import org.collectionspace.services.jaxb.AbstractCommonList;
-import org.collectionspace.services.common.authorityref.AuthorityRefList;
-import org.jboss.resteasy.client.ProxyFactory;
-import org.jboss.resteasy.plugins.providers.RegisterBuiltin;
 import org.jboss.resteasy.client.ClientResponse;
-import org.jboss.resteasy.client.core.executors.ApacheHttpClientExecutor;
-import org.jboss.resteasy.spi.ResteasyProviderFactory;
+import org.collectionspace.services.jaxb.AbstractCommonList;
 
 /**
  * An AcquisitionClient.
 
  * @version $Revision:$
  */
-public class AcquisitionClient extends AbstractServiceClientImpl {
+public class AcquisitionClient extends AbstractPoxServiceClientImpl<AcquisitionProxy> {
        public static final String SERVICE_NAME = "acquisitions";
        public static final String SERVICE_PATH_COMPONENT = SERVICE_NAME;       
        public static final String SERVICE_PATH = "/" + SERVICE_PATH_COMPONENT;
@@ -31,56 +24,23 @@ public class AcquisitionClient extends AbstractServiceClientImpl {
     public String getServicePathComponent() {
         return SERVICE_PATH_COMPONENT;
     }
-       
-    /**
-     *
-     */
-    private AcquisitionProxy acquisitionProxy;
-
-    /**
-     *
-     * Default constructor for IntakeClient class.
-     *
-     */
-    public AcquisitionClient() {
-        ResteasyProviderFactory factory = ResteasyProviderFactory.getInstance();
-        RegisterBuiltin.register(factory);
-        setProxy();
-    }
-
-    @Override
-    public CollectionSpaceProxy getProxy() {
-       return this.acquisitionProxy;
-    }
-
-    /**
-     * allow to reset proxy as per security needs
-     */
-    public void setProxy() {
-        if (useAuth()) {
-            acquisitionProxy = ProxyFactory.create(AcquisitionProxy.class,
-                    getBaseURL(), new ApacheHttpClientExecutor(getHttpClient()));
-        } else {
-            acquisitionProxy = ProxyFactory.create(AcquisitionProxy.class,
-                    getBaseURL());
-        }
-    }
 
-    /**
-     * FIXME Is this method still needed/used?
-     *
-     * @return
-     */
-//    public static AcquisitionClient getInstance() {
-//        return instance;
-//    }
+       @Override
+       public Class<AcquisitionProxy> getProxyClass() {
+               // TODO Auto-generated method stub
+               return AcquisitionProxy.class;
+       }
 
+       /*
+        * Proxied service calls.
+        */
+       
     /**
      * @return
      * @see org.collectionspace.hello.client.IntakeProxy#getIntake()
      */
     public ClientResponse<AbstractCommonList> readList() {
-        return acquisitionProxy.readList();
+        return getProxy().readList();
     }
 
     /**
@@ -88,44 +48,8 @@ public class AcquisitionClient extends AbstractServiceClientImpl {
      * @return
      * @see org.collectionspace.hello.client.IntakeProxy#getIntake(java.lang.String)
      */
-    public ClientResponse<String> read(String csid) {
-        return acquisitionProxy.read(csid);
-    }
-
-    /**
-     * @param csid
-     * @return
-     * @see org.collectionspace.services.client.CollectionObjectProxy#getAuthorityRefs(java.lang.String)
-     */
-    public ClientResponse<AuthorityRefList> getAuthorityRefs(String csid) {
-        return acquisitionProxy.getAuthorityRefs(csid);
-    }
-
-    /**
-     * @param intake
-     * @return
-     * @see org.collectionspace.hello.client.IntakeProxy#createIntake(org.collectionspace.hello.Intake)
-     */
-    public ClientResponse<Response> create(PoxPayloadOut xmlPayload) {
-        return acquisitionProxy.create(xmlPayload.getBytes());
-    }
-
-    /**
-     * @param csid
-     * @param intake
-     * @return
-     * @see org.collectionspace.hello.client.IntakeProxy#updateIntake(java.lang.Long, org.collectionspace.hello.Intake)
-     */
-    public ClientResponse<String> update(String csid, PoxPayloadOut xmlPayload) {
-        return acquisitionProxy.update(csid, xmlPayload.getBytes());
-    }
-
-    /**
-     * @param csid
-     * @return
-     * @see org.collectionspace.hello.client.IntakeProxy#deleteIntake(java.lang.Long)
-     */
-    public ClientResponse<Response> delete(String csid) {
-        return acquisitionProxy.delete(csid);
+    @Override
+       public ClientResponse<String> read(String csid) {
+        return getProxy().read(csid);
     }
 }
index 3aaf02907feee43803d59be9ba29654894d56ded..527d5446b994ab8e5231555abda9dab61d8e1f7d 100644 (file)
@@ -1,17 +1,11 @@
 package org.collectionspace.services.client;
 
 import javax.ws.rs.Consumes;
-import javax.ws.rs.DELETE;
 import javax.ws.rs.GET;
-import javax.ws.rs.POST;
-import javax.ws.rs.PUT;
 import javax.ws.rs.Path;
-import javax.ws.rs.PathParam;
 import javax.ws.rs.Produces;
-import javax.ws.rs.core.Response;
 
 import org.collectionspace.services.jaxb.AbstractCommonList;
-import org.collectionspace.services.common.authorityref.AuthorityRefList;
 import org.jboss.resteasy.client.ClientResponse;
 
 /**
@@ -20,32 +14,7 @@ import org.jboss.resteasy.client.ClientResponse;
 @Path(AcquisitionClient.SERVICE_PATH_PROXY)
 @Produces({"application/xml"})
 @Consumes({"application/xml"})
-public interface AcquisitionProxy extends CollectionSpaceProxy {
-
+public interface AcquisitionProxy extends CollectionSpacePoxProxy {
     @GET
     ClientResponse<AbstractCommonList> readList();
-
-    //(C)reate
-    @POST
-    ClientResponse<Response> create(byte[] xmlPayload);
-
-    //(R)ead
-    @GET
-    @Path("/{csid}")
-    ClientResponse<String> read(@PathParam("csid") String csid);
-
-    // List Authority references
-    @GET
-    @Path("/{csid}/authorityrefs/")
-    ClientResponse<AuthorityRefList> getAuthorityRefs(@PathParam("csid") String csid);
-    
-    //(U)pdate
-    @PUT
-    @Path("/{csid}")
-    ClientResponse<String> update(@PathParam("csid") String csid, byte[] xmlPayload);
-
-    //(D)elete
-    @DELETE
-    @Path("/{csid}")
-    ClientResponse<Response> delete(@PathParam("csid") String csid);
 }
index 7337b6243ce201ee7feb455cebe09d13105fcf37..2351e2dd043068a5606d81ff421519023200359f 100644 (file)
@@ -41,6 +41,7 @@ import javax.ws.rs.core.Response;
 import javax.ws.rs.core.UriBuilder;
 import javax.ws.rs.core.UriInfo;
 
+import org.collectionspace.services.client.IQueryManager;
 import org.collectionspace.services.client.PoxPayloadIn;
 import org.collectionspace.services.client.PoxPayloadOut;
 import org.collectionspace.services.client.AcquisitionClient;
@@ -56,11 +57,8 @@ import org.collectionspace.services.common.document.DocumentFilter;
 import org.collectionspace.services.common.document.DocumentNotFoundException;
 import org.collectionspace.services.common.document.DocumentHandler;
 import org.collectionspace.services.common.document.DocumentWrapper;
-import org.collectionspace.services.common.query.IQueryManager;
 import org.collectionspace.services.common.query.QueryManager;
 import org.collectionspace.services.common.security.UnauthorizedException;
-import org.collectionspace.services.nuxeo.client.java.DocumentModelHandler;
-import org.collectionspace.services.jaxb.AbstractCommonList;
 import org.collectionspace.services.nuxeo.client.java.CommonList;
 
 import org.jboss.resteasy.util.HttpResponseCodes;
index e7e0695b0cf81abebb9b361c51af765ff1b0d90c..87e70ec013ebd1ae734242153bb194f6eed50540 100644 (file)
 package org.collectionspace.services.client;
 
 import javax.ws.rs.core.Response;
-
+import org.jboss.resteasy.client.ClientResponse;
 
 import org.collectionspace.services.authorization.Permission;
 import org.collectionspace.services.authorization.PermissionsList;
-import org.jboss.resteasy.client.ProxyFactory;
-import org.jboss.resteasy.plugins.providers.RegisterBuiltin;
-import org.jboss.resteasy.client.ClientResponse;
-import org.jboss.resteasy.client.core.executors.ApacheHttpClientExecutor;
-import org.jboss.resteasy.spi.ResteasyProviderFactory;
 
 /**
  * A PermissionClient.
 
  * @version $Revision:$
  */
-public class PermissionClient extends AbstractServiceClientImpl {
+public class PermissionClient extends AbstractServiceClientImpl<PermissionProxy> {
        public static final String SERVICE_NAME = "authorization/permissions";
        public static final String SERVICE_PATH_COMPONENT = SERVICE_NAME;       
        public static final String SERVICE_PATH = "/" + SERVICE_PATH_COMPONENT;
        public static final String SERVICE_PATH_PROXY = SERVICE_PATH + "/";     
-    /**
-     *
-     */
-    private PermissionProxy permissionProxy;
-
     /* (non-Javadoc)
      * @see org.collectionspace.services.client.AbstractServiceClientImpl#getServicePathComponent()
      */
-    public String getServicePathComponent() {
+    @Override
+       public String getServicePathComponent() {
         return SERVICE_PATH_COMPONENT;
     }
 
-    /**
-     *
-     * Default constructor for PermissionClient class.
-     *
-     */
-    public PermissionClient() {
-        ResteasyProviderFactory factory = ResteasyProviderFactory.getInstance();
-        RegisterBuiltin.register(factory);
-        setProxy();
-    }
-
-    @Override
-    public CollectionSpaceProxy getProxy() {
-       return this.permissionProxy;
-    }    
-
-    /**
-     * allow to reset proxy as per security needs
-     */
-    public void setProxy() {
-        if (useAuth()) {
-            permissionProxy = ProxyFactory.create(PermissionProxy.class,
-                    getBaseURL(), new ApacheHttpClientExecutor(getHttpClient()));
-        } else {
-            permissionProxy = ProxyFactory.create(PermissionProxy.class,
-                    getBaseURL());
-        }
-    }
+       @Override
+       public String getServiceName() {
+               return SERVICE_NAME;
+       }
 
+       @Override
+       public Class<PermissionProxy> getProxyClass() {
+               return PermissionProxy.class;
+       }
+       
+       /*
+        * CRUD+L Methods
+        */
+       
     /**
      * @return
      * @see org.collectionspace.hello.client.PermissionProxy#readList()
      */
     public ClientResponse<PermissionsList> readList() {
-        return permissionProxy.readList();
+        return getProxy().readList();
 
     }
 
     public ClientResponse<PermissionsList> readSearchList(String resourceName) {
-        return permissionProxy.readSearchList(resourceName);
+        return getProxy().readSearchList(resourceName);
 
     }
 
@@ -108,7 +84,7 @@ public class PermissionClient extends AbstractServiceClientImpl {
      * @see org.collectionspace.hello.client.PermissionProxy#getAccount(java.lang.String)
      */
     public ClientResponse<Permission> read(String csid) {
-        return permissionProxy.read(csid);
+        return getProxy().read(csid);
     }
 
     /**
@@ -117,7 +93,7 @@ public class PermissionClient extends AbstractServiceClientImpl {
      * @see org.collectionspace.hello.client.PermissionProxy#create(org.collectionspace.services.permission.Permission)
      */
     public ClientResponse<Response> create(Permission permission) {
-        return permissionProxy.create(permission);
+        return getProxy().create(permission);
     }
 
     /**
@@ -127,20 +103,6 @@ public class PermissionClient extends AbstractServiceClientImpl {
      * @see org.collectionspace.hello.client.PermissionProxy#updateAccount(java.lang.Long, org.collectionspace.services.permission.Permission)
      */
     public ClientResponse<Permission> update(String csid, Permission permission) {
-        return permissionProxy.update(csid, permission);
-    }
-
-    /**
-     * @param csid
-     * @return
-     * @see org.collectionspace.hello.client.PermissionProxy#deleteAccount(java.lang.Long)
-     */
-    public ClientResponse<Response> delete(String csid) {
-        return permissionProxy.delete(csid);
+        return getProxy().update(csid, permission);
     }
-
-       @Override
-       public String getServiceName() {
-               return SERVICE_NAME;
-       }
 }
index 68655d3190ab6c4b321c57bcf7d566537a37b03f..dae1aa4753c8f5a768e13827df56b0eccd3daf82 100644 (file)
@@ -27,7 +27,6 @@
 package org.collectionspace.services.client;
 
 import javax.ws.rs.Consumes;
-import javax.ws.rs.DELETE;
 import javax.ws.rs.GET;
 import javax.ws.rs.POST;
 import javax.ws.rs.PUT;
@@ -37,7 +36,6 @@ import javax.ws.rs.Produces;
 import javax.ws.rs.QueryParam;
 import javax.ws.rs.core.Response;
 
-
 import org.collectionspace.services.authorization.Permission;
 import org.collectionspace.services.authorization.PermissionsList;
 import org.jboss.resteasy.client.ClientResponse;
@@ -55,7 +53,6 @@ public interface PermissionProxy extends CollectionSpaceProxy {
     ClientResponse<PermissionsList> readList();
 
     @GET
-
     ClientResponse<PermissionsList> readSearchList(@QueryParam("res") String resourceName);
 
     //(C)reate
@@ -71,9 +68,4 @@ public interface PermissionProxy extends CollectionSpaceProxy {
     @PUT
     @Path("/{csid}")
     ClientResponse<Permission> update(@PathParam("csid") String csid, Permission permission);
-
-    //(D)elete
-    @DELETE
-    @Path("/{csid}")
-    ClientResponse<Response> delete(@PathParam("csid") String csid);
 }
index cf1046ee0da1c609e138d578ad98649951fe5fbf..5bb12627d46823d6756297151edf57ddcc00e34a 100644 (file)
 package org.collectionspace.services.client;
 
 import javax.ws.rs.core.Response;
-
-
-import org.collectionspace.services.authorization.PermissionRole;
-import org.jboss.resteasy.client.ProxyFactory;
-import org.jboss.resteasy.plugins.providers.RegisterBuiltin;
 import org.jboss.resteasy.client.ClientResponse;
-import org.jboss.resteasy.client.core.executors.ApacheHttpClientExecutor;
-import org.jboss.resteasy.spi.ResteasyProviderFactory;
+import org.collectionspace.services.authorization.PermissionRole;
 
 /**
  * A PermissionRoleClient.
 
  * @version $Revision:$
  */
-public class PermissionRoleClient extends AbstractServiceClientImpl {
-
-    /** The permission role proxy. */
-    private PermissionRoleProxy permissionRoleProxy;
-
+public class PermissionRoleClient extends AbstractServiceClientImpl<PermissionRoleProxy> {
        @Override
        public String getServiceName() {
                throw new UnsupportedOperationException(); //FIXME: REM - http://issues.collectionspace.org/browse/CSPACE-3497
@@ -54,42 +44,20 @@ public class PermissionRoleClient extends AbstractServiceClientImpl {
     /* (non-Javadoc)
      * @see 
      */
-    public String getServicePathComponent() {
-        return "authorization/permissions";
-    }
-
-    /**
-     *
-     * Default constructor for PermissionRoleClient class.
-     *
-     */
-    public PermissionRoleClient() {
-        ResteasyProviderFactory factory = ResteasyProviderFactory.getInstance();
-        RegisterBuiltin.register(factory);
-        setProxy();
-    }
-
-    /* (non-Javadoc)
-     * @see org.collectionspace.services.client.CollectionSpaceClient#getProxy()
-     */
     @Override
-    public CollectionSpaceProxy getProxy() {
-        return this.permissionRoleProxy;
+       public String getServicePathComponent() {
+        return "authorization/permissions";
     }
 
-    /**
-     * allow to reset proxy as per security needs.
-     */
-    public void setProxy() {
-        if (useAuth()) {
-            permissionRoleProxy = ProxyFactory.create(PermissionRoleProxy.class,
-                    getBaseURL(), new ApacheHttpClientExecutor(getHttpClient()));
-        } else {
-            permissionRoleProxy = ProxyFactory.create(PermissionRoleProxy.class,
-                    getBaseURL());
-        }
-    }
+       @Override
+       public Class<PermissionRoleProxy> getProxyClass() {
+               return PermissionRoleProxy.class;
+       }
 
+       /*
+        * CRUD+L Methods
+        */
+       
     /**
      * Read.
      *
@@ -99,7 +67,7 @@ public class PermissionRoleClient extends AbstractServiceClientImpl {
      * @see
      */
     public ClientResponse<PermissionRole> read(String csid, String prcsid) {
-        return permissionRoleProxy.read(csid, prcsid);
+        return getProxy().read(csid, prcsid);
     }
 
     /**
@@ -111,7 +79,7 @@ public class PermissionRoleClient extends AbstractServiceClientImpl {
      * @see
      */
     public ClientResponse<PermissionRole> read(String csid) {
-        return permissionRoleProxy.read(csid);
+        return getProxy().read(csid);
     }
 
     /**
@@ -123,25 +91,17 @@ public class PermissionRoleClient extends AbstractServiceClientImpl {
      * @see
      */
     public ClientResponse<Response> create(String csid, PermissionRole permRole) {
-        return permissionRoleProxy.create(csid, permRole);
+        return getProxy().create(csid, permRole);
     }
-
-
+    
     /**
-     * Delete given relationships between given permission and role(s)
+     * Delete with payload
      *
      * @param csid the csid
-     * @param relationships to delete
-     * @return response
-     * @see
+     * @param permRole the perm role
+     * @return the client response
      */
     public ClientResponse<Response> delete(String csid, PermissionRole permRole) {
-        return permissionRoleProxy.delete(csid, "delete", permRole);
+       return getProxy().delete(csid, "delete", permRole);
     }
-    
-    @Override
-    public ClientResponse<Response> delete(String csid) {
-        return permissionRoleProxy.delete(csid);
-    }
-    
 }
index f2389678d1239af9e35c2452196c2ddc64c31c38..8bbd98310bfd4e17de94a8abfc75f89fc1e16314 100644 (file)
@@ -47,7 +47,6 @@ import org.jboss.resteasy.client.ClientResponse;
 @Produces({"application/xml"})
 @Consumes({"application/xml"})
 public interface PermissionRoleProxy extends CollectionSpaceProxy {
-
     //(C)reate
     @POST
     @Path("/{csid}/permroles")
@@ -64,16 +63,15 @@ public interface PermissionRoleProxy extends CollectionSpaceProxy {
     ClientResponse<PermissionRole> read(@PathParam("csid") String csid,
             @PathParam("prcsid") String prcsid);
 
-    //(D)elete
-    @POST
-    @Path("/{csid}/permroles")
-    ClientResponse<Response> delete(@PathParam("csid") String csid,
-            @QueryParam("_method") String method,
-            PermissionRole permRole);
-    
     //(D)elete
     @DELETE
     @Path("/{csid}/permroles")
     ClientResponse<Response> delete(@PathParam("csid") String csid);
     
+    //(D)elete - with a payload
+    @POST
+    @Path("/{csid}/permroles")
+    ClientResponse<Response> delete(@PathParam("csid") String csid,
+            @QueryParam("_method") String method,
+            PermissionRole permRole);    
 }
index 9802ca37e16e28d88e3848e36bef040ce8df53d7..041d1e7c4ed5eab181c80708f2b698843f75aad1 100644 (file)
@@ -31,26 +31,18 @@ import javax.ws.rs.core.Response;
 
 import org.collectionspace.services.authorization.Role;
 import org.collectionspace.services.authorization.RolesList;
-import org.jboss.resteasy.client.ProxyFactory;
-import org.jboss.resteasy.plugins.providers.RegisterBuiltin;
 import org.jboss.resteasy.client.ClientResponse;
-import org.jboss.resteasy.client.core.executors.ApacheHttpClientExecutor;
-import org.jboss.resteasy.spi.ResteasyProviderFactory;
 
 /**
  * A RoleClient.
 
  * @version $Revision:$
  */
-public class RoleClient extends AbstractServiceClientImpl {
+public class RoleClient extends AbstractServiceClientImpl<RoleProxy> {
        public static final String SERVICE_NAME = "authorization/roles";
        public static final String SERVICE_PATH_COMPONENT = SERVICE_NAME;       
        public static final String SERVICE_PATH = "/" + SERVICE_PATH_COMPONENT;
        public static final String SERVICE_PATH_PROXY = SERVICE_PATH + "/";     
-    /**
-     *
-     */
-    private RoleProxy roleProxy;
 
     @Override
     public String getServiceName() { 
@@ -60,37 +52,9 @@ public class RoleClient extends AbstractServiceClientImpl {
     /* (non-Javadoc)
      * @see org.collectionspace.services.client.AbstractServiceClientImpl#getServicePathComponent()
      */
-    public String getServicePathComponent() {
-        return "authorization/roles";
-    }
-
-    /**
-     *
-     * Default constructor for RoleClient class.
-     *
-     */
-    public RoleClient() {
-        ResteasyProviderFactory factory = ResteasyProviderFactory.getInstance();
-        RegisterBuiltin.register(factory);
-        setProxy();
-    }
-
     @Override
-    public CollectionSpaceProxy getProxy() {
-       return this.roleProxy;
-    }    
-
-    /**
-     * allow to reset proxy as per security needs
-     */
-    public void setProxy() {
-        if (useAuth()) {
-            roleProxy = ProxyFactory.create(RoleProxy.class,
-                    getBaseURL(), new ApacheHttpClientExecutor(getHttpClient()));
-        } else {
-            roleProxy = ProxyFactory.create(RoleProxy.class,
-                    getBaseURL());
-        }
+       public String getServicePathComponent() {
+        return SERVICE_PATH_COMPONENT;
     }
 
     /**
@@ -98,12 +62,12 @@ public class RoleClient extends AbstractServiceClientImpl {
      * @see org.collectionspace.hello.client.RoleProxy#readList()
      */
     public ClientResponse<RolesList> readList() {
-        return roleProxy.readList();
+        return getProxy().readList();
 
     }
 
     public ClientResponse<RolesList> readSearchList(String roleName) {
-        return roleProxy.readSearchList(roleName);
+        return getProxy().readSearchList(roleName);
 
     }
 
@@ -113,16 +77,17 @@ public class RoleClient extends AbstractServiceClientImpl {
      * @see org.collectionspace.hello.client.RoleProxy#getAccount(java.lang.String)
      */
     public ClientResponse<Role> read(String csid) {
-        return roleProxy.read(csid);
+        return getProxy().read(csid);
     }
 
     /**
-     * @param role
-     * @return
-     * @see org.collectionspace.hello.client.RoleProxy#create(org.collectionspace.services.role.Role)
+     * Creates the.
+     *
+     * @param role the role
+     * @return the client response
      */
     public ClientResponse<Response> create(Role role) {
-        return roleProxy.create(role);
+        return getProxy().create(role);
     }
 
     /**
@@ -132,15 +97,11 @@ public class RoleClient extends AbstractServiceClientImpl {
      * @see org.collectionspace.hello.client.RoleProxy#updateAccount(java.lang.Long, org.collectionspace.services.role.Role)
      */
     public ClientResponse<Role> update(String csid, Role role) {
-        return roleProxy.update(csid, role);
+        return getProxy().update(csid, role);
     }
 
-    /**
-     * @param csid
-     * @return
-     * @see org.collectionspace.hello.client.RoleProxy#deleteAccount(java.lang.Long)
-     */
-    public ClientResponse<Response> delete(String csid) {
-        return roleProxy.delete(csid);
-    }
+       @Override
+       public Class<RoleProxy> getProxyClass() {
+               return RoleProxy.class;
+       }
 }
index a6a2356f77e9c9f33c70ee767701b0c9c8100b2a..a80125ff401afa09d23728e2e2ea809b8564b70b 100644 (file)
@@ -42,55 +42,28 @@ import org.jboss.resteasy.spi.ResteasyProviderFactory;
 
  * @version $Revision:$
  */
-public class RolePermissionClient extends AbstractServiceClientImpl {
-
-    /** The role permission proxy. */
-    private RolePermissionProxy rolePermissionProxy;
-
+public class RolePermissionClient extends AbstractServiceClientImpl<RolePermissionProxy> {
     @Override
     public String getServiceName() { 
-       throw new UnsupportedOperationException(); //FIXME: REM - http://issues.collectionspace.org/browse/CSPACE-3498 }
+       throw new UnsupportedOperationException(); //FIXME: REM - http://issues.collectionspace.org/browse/CSPACE-3498
     }
     
     /* (non-Javadoc)
      * @see 
      */
-    public String getServicePathComponent() {
+       public String getServicePathComponent() {
         return "authorization/roles";
     }
+    
+       @Override
+       public Class<RolePermissionProxy> getProxyClass() {
+               return RolePermissionProxy.class;
+       }
 
-    /**
-     *
-     * Default constructor for PermissionRoleClient class.
-     *
-     */
-    public RolePermissionClient() {
-        ResteasyProviderFactory factory = ResteasyProviderFactory.getInstance();
-        RegisterBuiltin.register(factory);
-        setProxy();
-    }
-
-    /* (non-Javadoc)
-     * @see org.collectionspace.services.client.CollectionSpaceClient#getProxy()
-     */
-    @Override
-    public CollectionSpaceProxy getProxy() {
-        return this.rolePermissionProxy;
-    }
-
-    /**
-     * allow to reset proxy as per security needs.
-     */
-    public void setProxy() {
-        if (useAuth()) {
-            rolePermissionProxy = ProxyFactory.create(RolePermissionProxy.class,
-                    getBaseURL(), new ApacheHttpClientExecutor(getHttpClient()));
-        } else {
-            rolePermissionProxy = ProxyFactory.create(RolePermissionProxy.class,
-                    getBaseURL());
-        }
-    }
-
+       /*
+        * CRUD+L Methods
+        */
+       
     /**
      * Read.
      *
@@ -99,7 +72,7 @@ public class RolePermissionClient extends AbstractServiceClientImpl {
      * @see
      */
     public ClientResponse<PermissionRole> read(String csid) {
-        return rolePermissionProxy.read(csid);
+        return getProxy().read(csid);
     }
 
     /**
@@ -110,7 +83,7 @@ public class RolePermissionClient extends AbstractServiceClientImpl {
      * @return the client response
      */
     public ClientResponse<PermissionRole> read(String csid, String prcsid) {
-        return rolePermissionProxy.read(csid, prcsid);
+        return getProxy().read(csid, prcsid);
     }
 
     /**
@@ -122,7 +95,7 @@ public class RolePermissionClient extends AbstractServiceClientImpl {
      * @see
      */
     public ClientResponse<Response> create(String csid, PermissionRole permRole) {
-        return rolePermissionProxy.create(csid, permRole);
+        return getProxy().create(csid, permRole);
     }
 
     /**
@@ -133,17 +106,6 @@ public class RolePermissionClient extends AbstractServiceClientImpl {
      * @return the client response
      */
     public ClientResponse<Response> delete(String csid, PermissionRole permRole) {
-        return rolePermissionProxy.delete(csid, "delete", permRole);
-    }
-    
-    /**
-     * delete given relationships between given role and permission(s).
-     *
-     * @param csid the csid
-     * @return the client response
-     */
-    @Override
-    public ClientResponse<Response> delete(String csid) {
-        return rolePermissionProxy.delete(csid);
+        return getProxy().delete(csid, "delete", permRole);
     }
 }
index b613ab7ffdf7b1ffc8945d43f559700c61ad63ad..757a99ea9e7055632e91ddc82e4a32269e88a122 100644 (file)
@@ -64,14 +64,15 @@ public interface RolePermissionProxy extends CollectionSpaceProxy {
     ClientResponse<PermissionRole> read(@PathParam("csid") String csid,
             @PathParam("prcsid") String prcsid);
 
-    //(D)elete - with a payload
-    @POST
-    @Path("/{csid}/permroles")
-    ClientResponse<Response> delete(@PathParam("csid") String csid, 
-            @QueryParam("_method") String method, PermissionRole permRole);
-
     //(D)elete
     @DELETE
     @Path("/{csid}/permroles")
     ClientResponse<Response> delete(@PathParam("csid") String csid);
+    
+    //(D)elete - with a payload
+    @POST
+    @Path("/{csid}/permroles")
+    ClientResponse<Response> delete(@PathParam("csid") String csid, 
+            @QueryParam("_method") String method,
+            PermissionRole permRole);
 }
index b87bd448e39adec92fa92cc18a2fa874fc6f1950..e6004143fcdbc62912369c16a7c82b274053b270 100644 (file)
@@ -27,7 +27,6 @@
 package org.collectionspace.services.client;
 
 import javax.ws.rs.Consumes;
-import javax.ws.rs.DELETE;
 import javax.ws.rs.GET;
 import javax.ws.rs.POST;
 import javax.ws.rs.PUT;
@@ -55,7 +54,6 @@ public interface RoleProxy extends CollectionSpaceProxy {
     ClientResponse<RolesList> readList();
 
     @GET
-
     ClientResponse<RolesList> readSearchList(@QueryParam("r") String roleName);
 
     //(C)reate
@@ -71,9 +69,4 @@ public interface RoleProxy extends CollectionSpaceProxy {
     @PUT
     @Path("/{csid}")
     ClientResponse<Role> update(@PathParam("csid") String csid, Role role);
-
-    //(D)elete
-    @DELETE
-    @Path("/{csid}")
-    ClientResponse<Response> delete(@PathParam("csid") String csid);
 }
index 13393df66e84dd77e43cd40ae3007f28f197c5bb..03dcd06385fb0736cdea9c730f449df12e07ff44 100644 (file)
@@ -635,7 +635,6 @@ public class RoleResource
     @Path("{csid}/permroles")
     public Response deleteRolePermission(
                @PathParam("csid") String roleCsid) {
-
         if (logger.isDebugEnabled()) {
             logger.debug("deleteRolePermission with roleCsid=" + roleCsid);
         }
index 82ac3c5a10eadf05db67c7dbb1dfebb65b8502dd..fe60a7cf40891c1f3fb019475dacd15b42bb40cb 100644 (file)
@@ -18,22 +18,10 @@ package org.collectionspace.services.client;
 
 import javax.ws.rs.core.Response;
 
-import org.collectionspace.services.common.authorityref.AuthorityRefList;
 import org.collectionspace.services.jaxb.AbstractCommonList;
-
-import org.jboss.resteasy.client.ProxyFactory;
-import org.jboss.resteasy.plugins.providers.RegisterBuiltin;
 import org.jboss.resteasy.client.ClientResponse;
-import org.jboss.resteasy.client.core.executors.ApacheHttpClientExecutor;
-import org.jboss.resteasy.spi.ResteasyProviderFactory;
-
-import org.jboss.resteasy.plugins.providers.multipart.InputPart;
-import org.jboss.resteasy.plugins.providers.multipart.MultipartInput;
-import org.jboss.resteasy.plugins.providers.multipart.MultipartOutput;
-import org.jboss.resteasy.plugins.providers.multipart.MultipartFormDataInput;
 import org.jboss.resteasy.plugins.providers.multipart.MultipartFormDataOutput;
 
-
 /**
  * BlobClient.java
  *
@@ -41,7 +29,7 @@ import org.jboss.resteasy.plugins.providers.multipart.MultipartFormDataOutput;
  * $LastChangedDate: 2010-05-17 18:25:37 -0700 (Mon, 17 May 2010) $
  *
  */
-public class BlobClient extends AbstractServiceClientImpl {
+public class BlobClient extends AbstractPoxServiceClientImpl<BlobProxy> {
        public static final String SERVICE_NAME = "blobs";
        public static final String SERVICE_PATH_COMPONENT = SERVICE_NAME;       
        public static final String SERVICE_PATH = "/" + SERVICE_PATH_COMPONENT;
@@ -60,110 +48,29 @@ public class BlobClient extends AbstractServiceClientImpl {
     public String getServicePathComponent() {
         return SERVICE_PATH_COMPONENT;
     }
-    /**
-     *
-     */
-    private BlobProxy blobProxy;
-
-    /**
-     *
-     * Default constructor for BlobClient class.
-     *
-     */
-    public BlobClient() {
-        ResteasyProviderFactory factory = ResteasyProviderFactory.getInstance();
-        RegisterBuiltin.register(factory);
-        setProxy();
-    }
-
-    @Override
-    public CollectionSpaceProxy getProxy() {
-       return this.blobProxy;
-    }    
-
-    /**
-     * allow to reset proxy as per security needs
-     */
-    @Override
-       public void setProxy() {
-        if (useAuth()) {
-            blobProxy = ProxyFactory.create(BlobProxy.class,
-                    getBaseURL(), new ApacheHttpClientExecutor(getHttpClient()));
-        } else {
-            blobProxy = ProxyFactory.create(BlobProxy.class,
-                    getBaseURL());
-        }
-    }
-
-    /**
-     * FIXME Comment this
-     *
-     * @return
-     */
-//    public static BlobClient getInstance() {
-//        return instance;
-//    }
+    
+       @Override
+       public Class<BlobProxy> getProxyClass() {
+               return BlobProxy.class;
+       }
 
+       /**
+        * Blob proxied service calls
+        */
+       
     /**
      * @return
      * @see org.collectionspace.services.client.BlobProxy#getBlob()
      */
     public ClientResponse<AbstractCommonList> readList() {
-        return blobProxy.readList();
-    }
-    
-    /**
-     * @param csid
-     * @return
-     * @see org.collectionspace.services.client.BlobProxy#getAuthorityRefs(java.lang.String)
-     */
-    public ClientResponse<AuthorityRefList> getAuthorityRefs(String csid) {
-        return blobProxy.getAuthorityRefs(csid);
-    }
-
-
-    /**
-     * @param csid
-     * @return
-     * @see org.collectionspace.services.client.BlobProxy#getBlob(java.lang.String)
-     */
-    public ClientResponse<String> read(String csid) {
-        return blobProxy.read(csid);
+        return getProxy().readList();
     }
-
-    /**
-     * @param blob
-     * @return
-     *
-     */
-    public ClientResponse<Response> create(PoxPayloadOut xmlPayload) {
-        return blobProxy.create(xmlPayload.getBytes());
-    }    
     
     public ClientResponse<Response> createBlobFromFormData(MultipartFormDataOutput formDataOutput) {
-        return blobProxy.createBlobFromFormData(formDataOutput);
+        return getProxy().createBlobFromFormData(formDataOutput);
     }
     
     public ClientResponse<Response> createBlobFromURI(String blobUri) {
-        return blobProxy.createBlobFromURI("".getBytes(), blobUri);
-    }
-    
-    /**
-     * @param csid
-     * @param blob
-     * @return
-     */
-    public ClientResponse<String> update(String csid, PoxPayloadOut xmlPayload) {
-        return blobProxy.update(csid, xmlPayload.getBytes());
-
-    }
-
-    /**
-     * @param csid
-     * @return
-     * @see org.collectionspace.services.client.BlobProxy#deleteBlob(java.lang.Long)
-     */
-    public ClientResponse<Response> delete(String csid) {
-        return blobProxy.delete(csid);
+        return getProxy().createBlobFromURI("".getBytes(), blobUri);
     }
 }
index b9b2703ceda83893717c9ff952fa5bb4c8d26f81..ebd5ce34b4ad96d635b1965496d17bb77f74544b 100644 (file)
@@ -28,12 +28,7 @@ import org.jboss.resteasy.plugins.providers.multipart.MultipartFormDataOutput;
 @Path(BlobClient.SERVICE_PATH + "/")
 @Produces("application/xml")
 @Consumes("application/xml")
-public interface BlobProxy extends CollectionSpaceProxy {
-
-    //(C)reate
-    @POST
-    ClientResponse<Response> create(byte[] xmlPayload);
-
+public interface BlobProxy extends CollectionSpacePoxProxy {
     //(C)reate
     @POST
     ClientResponse<Response> createBlobFromURI(byte[] xmlPayload, 
@@ -43,31 +38,9 @@ public interface BlobProxy extends CollectionSpaceProxy {
     @POST
     @Consumes("multipart/form-data")
     ClientResponse<Response> createBlobFromFormData(MultipartFormDataOutput formDataOutput);
-    
-    //(R)ead
-    @GET
-    @Path("/{csid}")
-    ClientResponse<String> read(@PathParam("csid") String csid);
-
-    //(U)pdate
-    @PUT
-    @Path("/{csid}")
-    ClientResponse<String> update(@PathParam("csid") String csid, byte[] xmlPayload);
-
-    //(D)elete
-    @DELETE
-    @Path("/{csid}")
-    ClientResponse<Response> delete(@PathParam("csid") String csid);
-    
+        
     // List
     @GET
     @Produces({"application/xml"})
-    ClientResponse<AbstractCommonList> readList();
-
-    // List Authority References
-    @GET
-    @Produces({"application/xml"})
-    @Path("/{csid}/authorityrefs/")
-    ClientResponse<AuthorityRefList> getAuthorityRefs(@PathParam("csid") String csid);
-    
+    ClientResponse<AbstractCommonList> readList();    
 }
index 425cd1620f3d44a6c3d1d8c43488a67552f09765..4aef6f033ea6b5046a6d71892a7a01d93ee2fc66 100644 (file)
-<?xml version="1.0" encoding="UTF-8"?>\r
 <classpath>\r
-       <classpathentry kind="src" output="target/classes" path="src/main/java"/>\r
-       <classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources"/>\r
-       <classpathentry kind="src" output="target/test-classes" path="src/test/java"/>\r
-       <classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources"/>\r
-       <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>\r
-       <classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>\r
-       <classpathentry kind="output" path="target/classes"/>\r
-</classpath>\r
+  <classpathentry kind="src" path="src/test/java" output="target/test-classes" including="**/*.java"/>\r
+  <classpathentry kind="src" path="src/test/resources" output="target/test-classes" excluding="**/*.java"/>\r
+  <classpathentry kind="src" path="src/main/java" including="**/*.java"/>\r
+  <classpathentry kind="src" path="src/main/resources" excluding="**/*.java"/>\r
+  <classpathentry kind="output" path="target/classes"/>\r
+  <classpathentry kind="var" path="M2_REPO/javax/activation/activation/1.1/activation-1.1.jar" sourcepath="M2_REPO/javax/activation/activation/1.1/activation-1.1-sources.jar"/>\r
+  <classpathentry kind="var" path="M2_REPO/javax/security/jaas/1.0.01/jaas-1.0.01.jar"/>\r
+  <classpathentry kind="var" path="M2_REPO/javax/xml/bind/jaxb-api/2.2.2/jaxb-api-2.2.2.jar"/>\r
+  <classpathentry kind="var" path="M2_REPO/javax/annotation/jsr250-api/1.0/jsr250-api-1.0.jar" sourcepath="M2_REPO/javax/annotation/jsr250-api/1.0/jsr250-api-1.0-sources.jar"/>\r
+  <classpathentry kind="var" path="M2_REPO/javax/mail/mail/1.4/mail-1.4.jar" sourcepath="M2_REPO/javax/mail/mail/1.4/mail-1.4-sources.jar"/>\r
+  <classpathentry kind="var" path="M2_REPO/javax/xml/stream/stax-api/1.0-2/stax-api-1.0-2.jar" sourcepath="M2_REPO/javax/xml/stream/stax-api/1.0-2/stax-api-1.0-2-sources.jar"/>\r
+  <classpathentry kind="var" path="M2_REPO/org/apache/james/apache-mime4j/0.6/apache-mime4j-0.6.jar" sourcepath="M2_REPO/org/apache/james/apache-mime4j/0.6/apache-mime4j-0.6-sources.jar">\r
+    <attributes>\r
+      <attribute value="jar:file:/C:/Documents%20and%20Settings/remillet/.m2/repository/org/apache/james/apache-mime4j/0.6/apache-mime4j-0.6-javadoc.jar!/" name="javadoc_location"/>\r
+    </attributes>\r
+  </classpathentry>\r
+  <classpathentry kind="var" path="M2_REPO/classworlds/classworlds/1.1/classworlds-1.1.jar" sourcepath="M2_REPO/classworlds/classworlds/1.1/classworlds-1.1-sources.jar"/>\r
+  <classpathentry kind="var" path="M2_REPO/commons-cli/commons-cli/1.2/commons-cli-1.2.jar" sourcepath="M2_REPO/commons-cli/commons-cli/1.2/commons-cli-1.2-sources.jar"/>\r
+  <classpathentry kind="var" path="M2_REPO/commons-codec/commons-codec/1.2/commons-codec-1.2.jar">\r
+    <attributes>\r
+      <attribute value="jar:file:/C:/Documents%20and%20Settings/remillet/.m2/repository/commons-codec/commons-codec/1.2/commons-codec-1.2-javadoc.jar!/" name="javadoc_location"/>\r
+    </attributes>\r
+  </classpathentry>\r
+  <classpathentry kind="var" path="M2_REPO/commons-httpclient/commons-httpclient/3.1/commons-httpclient-3.1.jar" sourcepath="M2_REPO/commons-httpclient/commons-httpclient/3.1/commons-httpclient-3.1-sources.jar"/>\r
+  <classpathentry kind="var" path="M2_REPO/commons-io/commons-io/1.4/commons-io-1.4.jar" sourcepath="M2_REPO/commons-io/commons-io/1.4/commons-io-1.4-sources.jar">\r
+    <attributes>\r
+      <attribute value="jar:file:/C:/Documents%20and%20Settings/remillet/.m2/repository/commons-io/commons-io/1.4/commons-io-1.4-javadoc.jar!/" name="javadoc_location"/>\r
+    </attributes>\r
+  </classpathentry>\r
+  <classpathentry kind="var" path="M2_REPO/commons-lang/commons-lang/2.2/commons-lang-2.2.jar" sourcepath="M2_REPO/commons-lang/commons-lang/2.2/commons-lang-2.2-sources.jar">\r
+    <attributes>\r
+      <attribute value="jar:file:/C:/Documents%20and%20Settings/remillet/.m2/repository/commons-lang/commons-lang/2.2/commons-lang-2.2-javadoc.jar!/" name="javadoc_location"/>\r
+    </attributes>\r
+  </classpathentry>\r
+  <classpathentry kind="var" path="M2_REPO/dom4j/dom4j/1.6.1/dom4j-1.6.1.jar" sourcepath="M2_REPO/dom4j/dom4j/1.6.1/dom4j-1.6.1-sources.jar"/>\r
+  <classpathentry kind="var" path="M2_REPO/org/apache/maven/doxia/doxia-sink-api/1.0-alpha-7/doxia-sink-api-1.0-alpha-7.jar" sourcepath="M2_REPO/org/apache/maven/doxia/doxia-sink-api/1.0-alpha-7/doxia-sink-api-1.0-alpha-7-sources.jar">\r
+    <attributes>\r
+      <attribute value="jar:file:/C:/Documents%20and%20Settings/remillet/.m2/repository/org/apache/maven/doxia/doxia-sink-api/1.0-alpha-7/doxia-sink-api-1.0-alpha-7-javadoc.jar!/" name="javadoc_location"/>\r
+    </attributes>\r
+  </classpathentry>\r
+  <classpathentry kind="var" path="M2_REPO/org/apache/httpcomponents/httpclient/4.0/httpclient-4.0.jar" sourcepath="M2_REPO/org/apache/httpcomponents/httpclient/4.0/httpclient-4.0-sources.jar"/>\r
+  <classpathentry kind="var" path="M2_REPO/org/apache/httpcomponents/httpcore/4.0.1/httpcore-4.0.1.jar" sourcepath="M2_REPO/org/apache/httpcomponents/httpcore/4.0.1/httpcore-4.0.1-sources.jar"/>\r
+  <classpathentry kind="var" path="M2_REPO/javassist/javassist/3.6.0.GA/javassist-3.6.0.GA.jar"/>\r
+  <classpathentry kind="var" path="M2_REPO/com/sun/xml/bind/jaxb-impl/2.2.2/jaxb-impl-2.2.2.jar"/>\r
+  <classpathentry kind="var" path="M2_REPO/com/sun/xml/bind/jaxb-xjc/2.1/jaxb-xjc-2.1.jar" sourcepath="M2_REPO/com/sun/xml/bind/jaxb-xjc/2.1/jaxb-xjc-2.1-sources.jar"/>\r
+  <classpathentry kind="var" path="M2_REPO/org/jboss/resteasy/jaxrs-api/1.2.1.GA/jaxrs-api-1.2.1.GA.jar"/>\r
+  <classpathentry kind="var" path="M2_REPO/net/jcip/jcip-annotations/1.0/jcip-annotations-1.0.jar" sourcepath="M2_REPO/net/jcip/jcip-annotations/1.0/jcip-annotations-1.0-sources.jar"/>\r
+  <classpathentry kind="var" path="M2_REPO/org/slf4j/jcl-over-slf4j/1.5.8/jcl-over-slf4j-1.5.8.jar"/>\r
+  <classpathentry kind="var" path="M2_REPO/com/jcraft/jsch/0.1.27/jsch-0.1.27.jar" sourcepath="M2_REPO/com/jcraft/jsch/0.1.27/jsch-0.1.27-sources.jar">\r
+    <attributes>\r
+      <attribute value="jar:file:/C:/Documents%20and%20Settings/remillet/.m2/repository/com/jcraft/jsch/0.1.27/jsch-0.1.27-javadoc.jar!/" name="javadoc_location"/>\r
+    </attributes>\r
+  </classpathentry>\r
+  <classpathentry kind="var" path="M2_REPO/jtidy/jtidy/4aug2000r7-dev/jtidy-4aug2000r7-dev.jar" sourcepath="M2_REPO/jtidy/jtidy/4aug2000r7-dev/jtidy-4aug2000r7-dev-sources.jar"/>\r
+  <classpathentry kind="var" path="M2_REPO/junit/junit/3.8.1/junit-3.8.1.jar" sourcepath="M2_REPO/junit/junit/3.8.1/junit-3.8.1-sources.jar"/>\r
+  <classpathentry kind="var" path="M2_REPO/log4j/log4j/1.2.14/log4j-1.2.14.jar" sourcepath="M2_REPO/log4j/log4j/1.2.14/log4j-1.2.14-sources.jar"/>\r
+  <classpathentry kind="var" path="M2_REPO/org/apache/maven/maven-artifact/2.0.6/maven-artifact-2.0.6.jar" sourcepath="M2_REPO/org/apache/maven/maven-artifact/2.0.6/maven-artifact-2.0.6-sources.jar">\r
+    <attributes>\r
+      <attribute value="jar:file:/C:/Documents%20and%20Settings/remillet/.m2/repository/org/apache/maven/maven-artifact/2.0.6/maven-artifact-2.0.6-javadoc.jar!/" name="javadoc_location"/>\r
+    </attributes>\r
+  </classpathentry>\r
+  <classpathentry kind="var" path="M2_REPO/org/apache/maven/maven-artifact-manager/2.0.6/maven-artifact-manager-2.0.6.jar" sourcepath="M2_REPO/org/apache/maven/maven-artifact-manager/2.0.6/maven-artifact-manager-2.0.6-sources.jar">\r
+    <attributes>\r
+      <attribute value="jar:file:/C:/Documents%20and%20Settings/remillet/.m2/repository/org/apache/maven/maven-artifact-manager/2.0.6/maven-artifact-manager-2.0.6-javadoc.jar!/" name="javadoc_location"/>\r
+    </attributes>\r
+  </classpathentry>\r
+  <classpathentry kind="var" path="M2_REPO/org/apache/maven/maven-core/2.0.6/maven-core-2.0.6.jar" sourcepath="M2_REPO/org/apache/maven/maven-core/2.0.6/maven-core-2.0.6-sources.jar">\r
+    <attributes>\r
+      <attribute value="jar:file:/C:/Documents%20and%20Settings/remillet/.m2/repository/org/apache/maven/maven-core/2.0.6/maven-core-2.0.6-javadoc.jar!/" name="javadoc_location"/>\r
+    </attributes>\r
+  </classpathentry>\r
+  <classpathentry kind="var" path="M2_REPO/org/apache/maven/maven-error-diagnostics/2.0.6/maven-error-diagnostics-2.0.6.jar" sourcepath="M2_REPO/org/apache/maven/maven-error-diagnostics/2.0.6/maven-error-diagnostics-2.0.6-sources.jar">\r
+    <attributes>\r
+      <attribute value="jar:file:/C:/Documents%20and%20Settings/remillet/.m2/repository/org/apache/maven/maven-error-diagnostics/2.0.6/maven-error-diagnostics-2.0.6-javadoc.jar!/" name="javadoc_location"/>\r
+    </attributes>\r
+  </classpathentry>\r
+  <classpathentry kind="var" path="M2_REPO/org/apache/maven/maven-model/2.0.6/maven-model-2.0.6.jar" sourcepath="M2_REPO/org/apache/maven/maven-model/2.0.6/maven-model-2.0.6-sources.jar">\r
+    <attributes>\r
+      <attribute value="jar:file:/C:/Documents%20and%20Settings/remillet/.m2/repository/org/apache/maven/maven-model/2.0.6/maven-model-2.0.6-javadoc.jar!/" name="javadoc_location"/>\r
+    </attributes>\r
+  </classpathentry>\r
+  <classpathentry kind="var" path="M2_REPO/org/apache/maven/maven-monitor/2.0.6/maven-monitor-2.0.6.jar" sourcepath="M2_REPO/org/apache/maven/maven-monitor/2.0.6/maven-monitor-2.0.6-sources.jar">\r
+    <attributes>\r
+      <attribute value="jar:file:/C:/Documents%20and%20Settings/remillet/.m2/repository/org/apache/maven/maven-monitor/2.0.6/maven-monitor-2.0.6-javadoc.jar!/" name="javadoc_location"/>\r
+    </attributes>\r
+  </classpathentry>\r
+  <classpathentry kind="var" path="M2_REPO/org/apache/maven/maven-plugin-api/2.0.6/maven-plugin-api-2.0.6.jar" sourcepath="M2_REPO/org/apache/maven/maven-plugin-api/2.0.6/maven-plugin-api-2.0.6-sources.jar">\r
+    <attributes>\r
+      <attribute value="jar:file:/C:/Documents%20and%20Settings/remillet/.m2/repository/org/apache/maven/maven-plugin-api/2.0.6/maven-plugin-api-2.0.6-javadoc.jar!/" name="javadoc_location"/>\r
+    </attributes>\r
+  </classpathentry>\r
+  <classpathentry kind="var" path="M2_REPO/org/apache/maven/maven-plugin-descriptor/2.0.6/maven-plugin-descriptor-2.0.6.jar" sourcepath="M2_REPO/org/apache/maven/maven-plugin-descriptor/2.0.6/maven-plugin-descriptor-2.0.6-sources.jar">\r
+    <attributes>\r
+      <attribute value="jar:file:/C:/Documents%20and%20Settings/remillet/.m2/repository/org/apache/maven/maven-plugin-descriptor/2.0.6/maven-plugin-descriptor-2.0.6-javadoc.jar!/" name="javadoc_location"/>\r
+    </attributes>\r
+  </classpathentry>\r
+  <classpathentry kind="var" path="M2_REPO/org/apache/maven/maven-plugin-parameter-documenter/2.0.6/maven-plugin-parameter-documenter-2.0.6.jar" sourcepath="M2_REPO/org/apache/maven/maven-plugin-parameter-documenter/2.0.6/maven-plugin-parameter-documenter-2.0.6-sources.jar">\r
+    <attributes>\r
+      <attribute value="jar:file:/C:/Documents%20and%20Settings/remillet/.m2/repository/org/apache/maven/maven-plugin-parameter-documenter/2.0.6/maven-plugin-parameter-documenter-2.0.6-javadoc.jar!/" name="javadoc_location"/>\r
+    </attributes>\r
+  </classpathentry>\r
+  <classpathentry kind="var" path="M2_REPO/org/apache/maven/maven-plugin-registry/2.0.6/maven-plugin-registry-2.0.6.jar" sourcepath="M2_REPO/org/apache/maven/maven-plugin-registry/2.0.6/maven-plugin-registry-2.0.6-sources.jar">\r
+    <attributes>\r
+      <attribute value="jar:file:/C:/Documents%20and%20Settings/remillet/.m2/repository/org/apache/maven/maven-plugin-registry/2.0.6/maven-plugin-registry-2.0.6-javadoc.jar!/" name="javadoc_location"/>\r
+    </attributes>\r
+  </classpathentry>\r
+  <classpathentry kind="var" path="M2_REPO/org/apache/maven/maven-profile/2.0.6/maven-profile-2.0.6.jar" sourcepath="M2_REPO/org/apache/maven/maven-profile/2.0.6/maven-profile-2.0.6-sources.jar">\r
+    <attributes>\r
+      <attribute value="jar:file:/C:/Documents%20and%20Settings/remillet/.m2/repository/org/apache/maven/maven-profile/2.0.6/maven-profile-2.0.6-javadoc.jar!/" name="javadoc_location"/>\r
+    </attributes>\r
+  </classpathentry>\r
+  <classpathentry kind="var" path="M2_REPO/org/apache/maven/maven-project/2.0.6/maven-project-2.0.6.jar" sourcepath="M2_REPO/org/apache/maven/maven-project/2.0.6/maven-project-2.0.6-sources.jar">\r
+    <attributes>\r
+      <attribute value="jar:file:/C:/Documents%20and%20Settings/remillet/.m2/repository/org/apache/maven/maven-project/2.0.6/maven-project-2.0.6-javadoc.jar!/" name="javadoc_location"/>\r
+    </attributes>\r
+  </classpathentry>\r
+  <classpathentry kind="var" path="M2_REPO/org/apache/maven/reporting/maven-reporting-api/2.0.6/maven-reporting-api-2.0.6.jar" sourcepath="M2_REPO/org/apache/maven/reporting/maven-reporting-api/2.0.6/maven-reporting-api-2.0.6-sources.jar">\r
+    <attributes>\r
+      <attribute value="jar:file:/C:/Documents%20and%20Settings/remillet/.m2/repository/org/apache/maven/reporting/maven-reporting-api/2.0.6/maven-reporting-api-2.0.6-javadoc.jar!/" name="javadoc_location"/>\r
+    </attributes>\r
+  </classpathentry>\r
+  <classpathentry kind="var" path="M2_REPO/org/apache/maven/maven-repository-metadata/2.0.6/maven-repository-metadata-2.0.6.jar" sourcepath="M2_REPO/org/apache/maven/maven-repository-metadata/2.0.6/maven-repository-metadata-2.0.6-sources.jar">\r
+    <attributes>\r
+      <attribute value="jar:file:/C:/Documents%20and%20Settings/remillet/.m2/repository/org/apache/maven/maven-repository-metadata/2.0.6/maven-repository-metadata-2.0.6-javadoc.jar!/" name="javadoc_location"/>\r
+    </attributes>\r
+  </classpathentry>\r
+  <classpathentry kind="var" path="M2_REPO/org/apache/maven/maven-settings/2.0.6/maven-settings-2.0.6.jar" sourcepath="M2_REPO/org/apache/maven/maven-settings/2.0.6/maven-settings-2.0.6-sources.jar">\r
+    <attributes>\r
+      <attribute value="jar:file:/C:/Documents%20and%20Settings/remillet/.m2/repository/org/apache/maven/maven-settings/2.0.6/maven-settings-2.0.6-javadoc.jar!/" name="javadoc_location"/>\r
+    </attributes>\r
+  </classpathentry>\r
+  <classpathentry kind="var" path="M2_REPO/org/apache/maven/plugins/maven-surefire-plugin/2.4.3/maven-surefire-plugin-2.4.3.jar" sourcepath="M2_REPO/org/apache/maven/plugins/maven-surefire-plugin/2.4.3/maven-surefire-plugin-2.4.3-sources.jar">\r
+    <attributes>\r
+      <attribute value="jar:file:/C:/Documents%20and%20Settings/remillet/.m2/repository/org/apache/maven/plugins/maven-surefire-plugin/2.4.3/maven-surefire-plugin-2.4.3-javadoc.jar!/" name="javadoc_location"/>\r
+    </attributes>\r
+  </classpathentry>\r
+  <classpathentry kind="var" path="M2_REPO/org/apache/maven/maven-toolchain/1.0/maven-toolchain-1.0.jar" sourcepath="M2_REPO/org/apache/maven/maven-toolchain/1.0/maven-toolchain-1.0-sources.jar">\r
+    <attributes>\r
+      <attribute value="jar:file:/C:/Documents%20and%20Settings/remillet/.m2/repository/org/apache/maven/maven-toolchain/1.0/maven-toolchain-1.0-javadoc.jar!/" name="javadoc_location"/>\r
+    </attributes>\r
+  </classpathentry>\r
+  <classpathentry kind="src" path="/org.collectionspace.services.jaxb"/>\r
+  <classpathentry kind="var" path="M2_REPO/org/codehaus/plexus/plexus-container-default/1.0-alpha-9-stable-1/plexus-container-default-1.0-alpha-9-stable-1.jar" sourcepath="M2_REPO/org/codehaus/plexus/plexus-container-default/1.0-alpha-9-stable-1/plexus-container-default-1.0-alpha-9-stable-1-sources.jar">\r
+    <attributes>\r
+      <attribute value="jar:file:/C:/Documents%20and%20Settings/remillet/.m2/repository/org/codehaus/plexus/plexus-container-default/1.0-alpha-9-stable-1/plexus-container-default-1.0-alpha-9-stable-1-javadoc.jar!/" name="javadoc_location"/>\r
+    </attributes>\r
+  </classpathentry>\r
+  <classpathentry kind="var" path="M2_REPO/org/codehaus/plexus/plexus-interactivity-api/1.0-alpha-4/plexus-interactivity-api-1.0-alpha-4.jar" sourcepath="M2_REPO/org/codehaus/plexus/plexus-interactivity-api/1.0-alpha-4/plexus-interactivity-api-1.0-alpha-4-sources.jar"/>\r
+  <classpathentry kind="var" path="M2_REPO/org/codehaus/plexus/plexus-utils/1.5.1/plexus-utils-1.5.1.jar" sourcepath="M2_REPO/org/codehaus/plexus/plexus-utils/1.5.1/plexus-utils-1.5.1-sources.jar"/>\r
+  <classpathentry kind="var" path="M2_REPO/org/jvnet/jaxb2-commons/property-listener-injector/1.0/property-listener-injector-1.0.jar" sourcepath="M2_REPO/org/jvnet/jaxb2-commons/property-listener-injector/1.0/property-listener-injector-1.0-sources.jar">\r
+    <attributes>\r
+      <attribute value="jar:file:/C:/Documents%20and%20Settings/remillet/.m2/repository/org/jvnet/jaxb2-commons/property-listener-injector/1.0/property-listener-injector-1.0-javadoc.jar!/" name="javadoc_location"/>\r
+    </attributes>\r
+  </classpathentry>\r
+  <classpathentry kind="var" path="M2_REPO/org/jboss/resteasy/resteasy-jaxb-provider/1.2.1.GA/resteasy-jaxb-provider-1.2.1.GA.jar"/>\r
+  <classpathentry kind="var" path="M2_REPO/org/jboss/resteasy/resteasy-jaxrs/1.2.1.GA/resteasy-jaxrs-1.2.1.GA.jar" sourcepath="M2_REPO/org/jboss/resteasy/resteasy-jaxrs/1.2.1.GA/resteasy-jaxrs-1.2.1.GA-sources.jar"/>\r
+  <classpathentry kind="var" path="M2_REPO/org/jboss/resteasy/resteasy-multipart-provider/1.2.1.GA/resteasy-multipart-provider-1.2.1.GA.jar"/>\r
+  <classpathentry kind="var" path="M2_REPO/org/jvnet/jaxb2_commons/runtime/0.4.1.4/runtime-0.4.1.4.jar" sourcepath="M2_REPO/org/jvnet/jaxb2_commons/runtime/0.4.1.4/runtime-0.4.1.4-sources.jar">\r
+    <attributes>\r
+      <attribute value="jar:file:/C:/Documents%20and%20Settings/remillet/.m2/repository/org/jvnet/jaxb2_commons/runtime/0.4.1.4/runtime-0.4.1.4-javadoc.jar!/" name="javadoc_location"/>\r
+    </attributes>\r
+  </classpathentry>\r
+  <classpathentry kind="var" path="M2_REPO/org/scannotation/scannotation/1.0.2/scannotation-1.0.2.jar"/>\r
+  <classpathentry kind="var" path="M2_REPO/com/sun/xml/stream/sjsxp/1.0.1/sjsxp-1.0.1.jar"/>\r
+  <classpathentry kind="var" path="M2_REPO/org/slf4j/slf4j-api/1.5.8/slf4j-api-1.5.8.jar"/>\r
+  <classpathentry kind="var" path="M2_REPO/org/slf4j/slf4j-log4j12/1.5.8/slf4j-log4j12-1.5.8.jar"/>\r
+  <classpathentry kind="var" path="M2_REPO/org/slf4j/slf4j-simple/1.5.8/slf4j-simple-1.5.8.jar"/>\r
+  <classpathentry kind="var" path="M2_REPO/org/apache/maven/surefire/surefire-api/2.4.3/surefire-api-2.4.3.jar" sourcepath="M2_REPO/org/apache/maven/surefire/surefire-api/2.4.3/surefire-api-2.4.3-sources.jar">\r
+    <attributes>\r
+      <attribute value="jar:file:/C:/Documents%20and%20Settings/remillet/.m2/repository/org/apache/maven/surefire/surefire-api/2.4.3/surefire-api-2.4.3-javadoc.jar!/" name="javadoc_location"/>\r
+    </attributes>\r
+  </classpathentry>\r
+  <classpathentry kind="var" path="M2_REPO/org/apache/maven/surefire/surefire-booter/2.4.3/surefire-booter-2.4.3.jar" sourcepath="M2_REPO/org/apache/maven/surefire/surefire-booter/2.4.3/surefire-booter-2.4.3-sources.jar">\r
+    <attributes>\r
+      <attribute value="jar:file:/C:/Documents%20and%20Settings/remillet/.m2/repository/org/apache/maven/surefire/surefire-booter/2.4.3/surefire-booter-2.4.3-javadoc.jar!/" name="javadoc_location"/>\r
+    </attributes>\r
+  </classpathentry>\r
+  <classpathentry kind="var" path="M2_REPO/org/testng/testng/5.6/testng-5.6-jdk15.jar"/>\r
+  <classpathentry kind="var" path="M2_REPO/org/testng/testng/5.6/testng-5.6.jar"/>\r
+  <classpathentry kind="var" path="M2_REPO/org/apache/maven/wagon/wagon-file/1.0-beta-2/wagon-file-1.0-beta-2.jar" sourcepath="M2_REPO/org/apache/maven/wagon/wagon-file/1.0-beta-2/wagon-file-1.0-beta-2-sources.jar">\r
+    <attributes>\r
+      <attribute value="jar:file:/C:/Documents%20and%20Settings/remillet/.m2/repository/org/apache/maven/wagon/wagon-file/1.0-beta-2/wagon-file-1.0-beta-2-javadoc.jar!/" name="javadoc_location"/>\r
+    </attributes>\r
+  </classpathentry>\r
+  <classpathentry kind="var" path="M2_REPO/org/apache/maven/wagon/wagon-http-lightweight/1.0-beta-2/wagon-http-lightweight-1.0-beta-2.jar" sourcepath="M2_REPO/org/apache/maven/wagon/wagon-http-lightweight/1.0-beta-2/wagon-http-lightweight-1.0-beta-2-sources.jar">\r
+    <attributes>\r
+      <attribute value="jar:file:/C:/Documents%20and%20Settings/remillet/.m2/repository/org/apache/maven/wagon/wagon-http-lightweight/1.0-beta-2/wagon-http-lightweight-1.0-beta-2-javadoc.jar!/" name="javadoc_location"/>\r
+    </attributes>\r
+  </classpathentry>\r
+  <classpathentry kind="var" path="M2_REPO/org/apache/maven/wagon/wagon-http-shared/1.0-beta-2/wagon-http-shared-1.0-beta-2.jar" sourcepath="M2_REPO/org/apache/maven/wagon/wagon-http-shared/1.0-beta-2/wagon-http-shared-1.0-beta-2-sources.jar">\r
+    <attributes>\r
+      <attribute value="jar:file:/C:/Documents%20and%20Settings/remillet/.m2/repository/org/apache/maven/wagon/wagon-http-shared/1.0-beta-2/wagon-http-shared-1.0-beta-2-javadoc.jar!/" name="javadoc_location"/>\r
+    </attributes>\r
+  </classpathentry>\r
+  <classpathentry kind="var" path="M2_REPO/org/apache/maven/wagon/wagon-provider-api/1.0-beta-2/wagon-provider-api-1.0-beta-2.jar" sourcepath="M2_REPO/org/apache/maven/wagon/wagon-provider-api/1.0-beta-2/wagon-provider-api-1.0-beta-2-sources.jar">\r
+    <attributes>\r
+      <attribute value="jar:file:/C:/Documents%20and%20Settings/remillet/.m2/repository/org/apache/maven/wagon/wagon-provider-api/1.0-beta-2/wagon-provider-api-1.0-beta-2-javadoc.jar!/" name="javadoc_location"/>\r
+    </attributes>\r
+  </classpathentry>\r
+  <classpathentry kind="var" path="M2_REPO/org/apache/maven/wagon/wagon-ssh/1.0-beta-2/wagon-ssh-1.0-beta-2.jar" sourcepath="M2_REPO/org/apache/maven/wagon/wagon-ssh/1.0-beta-2/wagon-ssh-1.0-beta-2-sources.jar">\r
+    <attributes>\r
+      <attribute value="jar:file:/C:/Documents%20and%20Settings/remillet/.m2/repository/org/apache/maven/wagon/wagon-ssh/1.0-beta-2/wagon-ssh-1.0-beta-2-javadoc.jar!/" name="javadoc_location"/>\r
+    </attributes>\r
+  </classpathentry>\r
+  <classpathentry kind="var" path="M2_REPO/org/apache/maven/wagon/wagon-ssh-common/1.0-beta-2/wagon-ssh-common-1.0-beta-2.jar" sourcepath="M2_REPO/org/apache/maven/wagon/wagon-ssh-common/1.0-beta-2/wagon-ssh-common-1.0-beta-2-sources.jar">\r
+    <attributes>\r
+      <attribute value="jar:file:/C:/Documents%20and%20Settings/remillet/.m2/repository/org/apache/maven/wagon/wagon-ssh-common/1.0-beta-2/wagon-ssh-common-1.0-beta-2-javadoc.jar!/" name="javadoc_location"/>\r
+    </attributes>\r
+  </classpathentry>\r
+  <classpathentry kind="var" path="M2_REPO/org/apache/maven/wagon/wagon-ssh-external/1.0-beta-2/wagon-ssh-external-1.0-beta-2.jar" sourcepath="M2_REPO/org/apache/maven/wagon/wagon-ssh-external/1.0-beta-2/wagon-ssh-external-1.0-beta-2-sources.jar">\r
+    <attributes>\r
+      <attribute value="jar:file:/C:/Documents%20and%20Settings/remillet/.m2/repository/org/apache/maven/wagon/wagon-ssh-external/1.0-beta-2/wagon-ssh-external-1.0-beta-2-javadoc.jar!/" name="javadoc_location"/>\r
+    </attributes>\r
+  </classpathentry>\r
+  <classpathentry kind="var" path="M2_REPO/xml-apis/xml-apis/1.0.b2/xml-apis-1.0.b2.jar"/>\r
+  <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>\r
+</classpath>
\ No newline at end of file
diff --git a/services/client/src/main/java/org/collectionspace/services/client/AbstractPoxServiceClientImpl.java b/services/client/src/main/java/org/collectionspace/services/client/AbstractPoxServiceClientImpl.java
new file mode 100644 (file)
index 0000000..bd49d98
--- /dev/null
@@ -0,0 +1,28 @@
+package org.collectionspace.services.client;\r
+\r
+import javax.ws.rs.PathParam;\r
+import javax.ws.rs.core.Response;\r
+\r
+import org.apache.commons.httpclient.HttpClient;\r
+import org.collectionspace.services.common.authorityref.AuthorityRefList;\r
+import org.collectionspace.services.jaxb.AbstractCommonList;\r
+import org.collectionspace.services.workflow.WorkflowsCommon;\r
+import org.jboss.resteasy.client.ClientResponse;\r
+\r
+public abstract class AbstractPoxServiceClientImpl<T extends CollectionSpacePoxProxy> extends AbstractServiceClientImpl<T> \r
+               implements CollectionSpacePoxClient<T> {\r
+       @Override\r
+       public ClientResponse<Response> create(PoxPayloadOut xmlPayload) {\r
+        return getProxy().create(xmlPayload.getBytes());\r
+    }\r
+               \r
+    @Override\r
+       public ClientResponse<String> read(String csid) {\r
+        return getProxy().read(csid);\r
+    }\r
+\r
+    @Override\r
+    public ClientResponse<String> update(String csid, PoxPayloadOut xmlPayload) {\r
+        return getProxy().update(csid, xmlPayload.getBytes());\r
+    }\r
+}\r
index 53a4e8fa4032527aaadf835c37f6c470364e8594..bdaeab9bd234b1faa683f3258429b1e532fa48d5 100644 (file)
@@ -28,16 +28,21 @@ import java.io.UnsupportedEncodingException;
 import java.net.URL;\r
 import java.util.Properties;\r
 \r
+import javax.ws.rs.PathParam;\r
 import javax.ws.rs.core.Response;\r
 \r
-//import javax.ws.rs.core.Response;\r
-\r
 import org.apache.commons.httpclient.HttpClient;\r
 import org.apache.commons.httpclient.UsernamePasswordCredentials;\r
 import org.apache.commons.httpclient.auth.AuthScope; //import org.collectionspace.services.collectionobject.CollectionobjectsCommonList;\r
 \r
+import org.collectionspace.services.common.authorityref.AuthorityRefList;\r
 import org.collectionspace.services.jaxb.AbstractCommonList;\r
+import org.collectionspace.services.workflow.WorkflowsCommon;\r
 import org.jboss.resteasy.client.ClientResponse; //import org.collectionspace.services.common.context.ServiceContext;\r
+import org.jboss.resteasy.client.ProxyFactory;\r
+import org.jboss.resteasy.client.core.executors.ApacheHttpClientExecutor;\r
+import org.jboss.resteasy.plugins.providers.RegisterBuiltin;\r
+import org.jboss.resteasy.spi.ResteasyProviderFactory;\r
 \r
 import org.slf4j.Logger;\r
 import org.slf4j.LoggerFactory;\r
@@ -48,8 +53,8 @@ import org.slf4j.LoggerFactory;
  * @param <CommonListType> \r
  * @param <ListType> \r
  */\r
-public abstract class AbstractServiceClientImpl implements\r
-        CollectionSpaceClient {\r
+public abstract class AbstractServiceClientImpl<T extends CollectionSpaceProxy> implements\r
+        CollectionSpaceClient<T> {\r
 \r
     /** The logger. */\r
     protected final Logger logger = LoggerFactory.getLogger(AbstractServiceClientImpl.class);\r
@@ -65,6 +70,8 @@ public abstract class AbstractServiceClientImpl implements
     private URL url;\r
     /** The http client. */\r
     private HttpClient httpClient;\r
+    /** The RESTEasy proxy */\r
+    private T proxy;\r
 \r
     /**\r
      * Gets the logger.\r
@@ -127,6 +134,9 @@ public abstract class AbstractServiceClientImpl implements
     protected AbstractServiceClientImpl() {\r
         readProperties();\r
         setupHttpClient();\r
+        ResteasyProviderFactory factory = ResteasyProviderFactory.getInstance();\r
+        RegisterBuiltin.register(factory);\r
+        setProxy();        \r
     }\r
 \r
     /*\r
@@ -330,53 +340,32 @@ public abstract class AbstractServiceClientImpl implements
         return Boolean.getBoolean("cspace.server.secure");\r
     }\r
 \r
-    /*\r
-     * (non-Javadoc)\r
-     *\r
-     * @see\r
-     * org.collectionspace.services.client.CollectionSpaceClient#readList(java\r
-     * .lang.String, java.lang.String)\r
-     */\r
-    @Override\r
-    public ClientResponse<AbstractCommonList> readList(Long pageSize,\r
-               Long pageNumber) {\r
-        return getProxy().readList(pageSize, pageNumber);\r
-    }\r
-\r
-    /*\r
-     * (non-Javadoc)\r
-     *\r
-     * @see\r
-     * org.collectionspace.services.client.CollectionSpaceClient#readList(java\r
-     * .lang.String, java.lang.String)\r
-     */\r
     @Override\r
-    public ClientResponse<AbstractCommonList> readList(String sortBy, Long pageSize,\r
-            Long pageNumber) {\r
-        return getProxy().readList(sortBy, pageSize, pageNumber);\r
+    public T getProxy() {\r
+       return proxy;\r
     }\r
-\r
-    /* (non-Javadoc)\r
-     * @see org.collectionspace.services.client.CollectionSpaceClient#delete(java.lang.String)\r
+    \r
+    /**\r
+     * allow to reset proxy as per security needs\r
      */\r
     @Override\r
-    public ClientResponse<Response> delete(String csid) {\r
-        // must override in children if you want behavior\r
-        throw new UnsupportedOperationException();\r
+       public void setProxy() {\r
+       Class<T> proxyClass = this.getProxyClass();\r
+        if (useAuth()) {\r
+            proxy = ProxyFactory.create(proxyClass,\r
+                    getBaseURL(), new ApacheHttpClientExecutor(getHttpClient()));\r
+        } else {\r
+               proxy = ProxyFactory.create(proxyClass,\r
+                    getBaseURL());\r
+        }\r
     }\r
 \r
     @Override\r
-    public abstract CollectionSpaceProxy getProxy();\r
-\r
-    @Override\r
-    public abstract void setProxy();\r
-\r
-    public void setAuth(boolean useAuth,\r
+       public void setAuth(boolean useAuth,\r
             String user, boolean useUser,\r
             String password, boolean usePassword) {\r
-        if (useAuth) {\r
-            setProperty(CollectionSpaceClient.AUTH_PROPERTY,\r
-                    "true");\r
+        if (useAuth == true) {\r
+            setProperty(CollectionSpaceClient.AUTH_PROPERTY, "true");\r
             if (useUser) {\r
                 setProperty(CollectionSpaceClient.USER_PROPERTY,\r
                         user);\r
@@ -395,4 +384,65 @@ public abstract class AbstractServiceClientImpl implements
         setupHttpClient();\r
         setProxy();\r
     }\r
+    \r
+       /*\r
+        * \r
+        * Common Proxied service calls\r
+        * \r
+        */\r
+    \r
+    /* (non-Javadoc)\r
+     * @see org.collectionspace.services.client.AbstractServiceClientImpl#delete(java.lang.String)\r
+     */\r
+    @Override\r
+       public ClientResponse<Response> delete(String csid) {\r
+        return getProxy().delete(csid);\r
+    }\r
+\r
+    /**\r
+     * @param csid\r
+     * @return\r
+     * @see org.collectionspace.services.client.BlobProxy#getAuthorityRefs(java.lang.String)\r
+     */\r
+    @Override\r
+       public ClientResponse<AuthorityRefList> getAuthorityRefs(String csid) {\r
+        return getProxy().getAuthorityRefs(csid);\r
+    }\r
+    \r
+    @Override\r
+       public ClientResponse<String> getWorkflow(@PathParam("csid") String csid) {\r
+       return getProxy().getWorkflow(csid);\r
+    }    \r
+    \r
+    /*\r
+     * Because of how RESTEasy creates proxy classes, sub-interfaces will need to override\r
+     * these methods with their specific "common" list return types.  Otherwise, only the info\r
+     * in the AbstractCommonList type will be returned to the callers\r
+     */\r
+    \r
+    /*\r
+     * (non-Javadoc)\r
+     *\r
+     * @see\r
+     * org.collectionspace.services.client.CollectionSpaceClient#readList(java\r
+     * .lang.String, java.lang.String)\r
+     */\r
+    @Override\r
+    public ClientResponse<AbstractCommonList> readList(Long pageSize,\r
+               Long pageNumber) {\r
+        return getProxy().readList(pageSize, pageNumber);\r
+    }\r
+\r
+    /*\r
+     * (non-Javadoc)\r
+     *\r
+     * @see\r
+     * org.collectionspace.services.client.CollectionSpaceClient#readList(java\r
+     * .lang.String, java.lang.String)\r
+     */\r
+    @Override\r
+    public ClientResponse<AbstractCommonList> readList(String sortBy, Long pageSize,\r
+            Long pageNumber) {\r
+        return getProxy().readList(sortBy, pageSize, pageNumber);\r
+    }\r
 }\r
diff --git a/services/client/src/main/java/org/collectionspace/services/client/AuthorityClient.java b/services/client/src/main/java/org/collectionspace/services/client/AuthorityClient.java
new file mode 100644 (file)
index 0000000..b3be0cd
--- /dev/null
@@ -0,0 +1,108 @@
+package org.collectionspace.services.client;\r
+\r
+import javax.ws.rs.core.Response;\r
+\r
+import org.collectionspace.services.common.authorityref.AuthorityRefDocList;\r
+import org.collectionspace.services.common.authorityref.AuthorityRefList;\r
+import org.collectionspace.services.jaxb.AbstractCommonList;\r
+import org.jboss.resteasy.client.ClientResponse;\r
+\r
+public interface AuthorityClient<TL extends AbstractCommonList, T extends AuthorityProxy<TL>> extends CollectionSpacePoxClient<T> {    \r
+       /*\r
+        * Basic CRUD operations\r
+        */\r
+       \r
+    //(C)reate Item\r
+    ClientResponse<Response> createItem(String vcsid, PoxPayloadOut poxPayloadOut);\r
+\r
+    //(R)ead Item\r
+    ClientResponse<String> readItem(String vcsid, String csid);\r
+\r
+    //(U)pdate Item\r
+    ClientResponse<String> updateItem(String vcsid, String csid, PoxPayloadOut poxPayloadOut);\r
+\r
+    //(D)elete Item\r
+    ClientResponse<Response> deleteItem(String vcsid, String csid);\r
+    \r
+    // Get a list of objects that\r
+    ClientResponse<AuthorityRefDocList> getReferencingObjects(\r
+            String parentcsid,\r
+            String itemcsid);\r
+    /**\r
+     * Get a list of objects that reference a given authority term.\r
+     * \r
+     * @param parentcsid \r
+     * @param itemcsid \r
+     * @param csid\r
+     * @return\r
+     * @see org.collectionspace.services.client.IntakeProxy#getAuthorityRefs(java.lang.String)\r
+     */\r
+    public ClientResponse<AuthorityRefList> getItemAuthorityRefs(String parentcsid, String itemcsid);    \r
+    \r
+    /*\r
+     * \r
+     */\r
+    \r
+    ClientResponse<String> readByName(String name);\r
+    \r
+    /*\r
+     * Item subresource methods\r
+     */\r
+    \r
+    /**\r
+     * Read named item.\r
+     *\r
+     * @param vcsid the vcsid\r
+     * @param shortId the shortIdentifier\r
+     * @return the client response\r
+     */\r
+    public ClientResponse<String> readNamedItem(String vcsid, String shortId);\r
+\r
+    /**\r
+     * Read item in Named Authority.\r
+     *\r
+     * @param authShortId the shortIdentifier for the Authority\r
+     * @param csid the csid\r
+     * @return the client response\r
+     */\r
+    public ClientResponse<String> readItemInNamedAuthority(String authShortId, String csid);\r
+\r
+    /**\r
+     * Read named item in Named Authority.\r
+     *\r
+     * @param authShortId the shortIdentifier for the Authority\r
+     * @param itemShortId the shortIdentifier for the item\r
+     * @return the client response\r
+     */\r
+    public ClientResponse<String> readNamedItemInNamedAuthority(String authShortId, String itemShortId);\r
+    \r
+    /**\r
+     * Read item list, filtering by partial term match, or keywords. Only one of\r
+     * partialTerm or keywords should be specified. If both are specified, keywords\r
+     * will be ignored.\r
+     *\r
+     * @param inAuthority the parent authority\r
+     * @param partialTerm A partial term on which to match,\r
+     *     which will filter list results to return only matched resources.\r
+     * @param keywords A set of keywords on which to match,\r
+     *     which will filter list results to return only matched resources.\r
+     * @return the client response\r
+     */\r
+    public ClientResponse<TL> readItemList(String inAuthority, String partialTerm, String keywords);\r
+    \r
+    /**\r
+     * Read item list for named vocabulary, filtering by partial term match, or keywords. Only one of\r
+     * partialTerm or keywords should be specified. If both are specified, keywords\r
+     * will be ignored.\r
+     *\r
+     * @param specifier the specifier\r
+     * @param partialTerm A partial term on which to match,\r
+     *     which will filter list results to return only matched resources.\r
+     * @param keywords A set of keywords on which to match,\r
+     *     which will filter list results to return only matched resources.\r
+     * @return the client response\r
+     */\r
+    public ClientResponse<TL> readItemListForNamedAuthority(String specifier, \r
+               String partialTerm, String keywords);\r
+    \r
+}\r
diff --git a/services/client/src/main/java/org/collectionspace/services/client/AuthorityClientImpl.java b/services/client/src/main/java/org/collectionspace/services/client/AuthorityClientImpl.java
new file mode 100644 (file)
index 0000000..db07e63
--- /dev/null
@@ -0,0 +1,145 @@
+package org.collectionspace.services.client;\r
+\r
+import javax.ws.rs.core.Response;\r
+import org.jboss.resteasy.client.ClientResponse;\r
+\r
+import org.collectionspace.services.common.authorityref.AuthorityRefDocList;\r
+import org.collectionspace.services.common.authorityref.AuthorityRefList;\r
+import org.collectionspace.services.jaxb.AbstractCommonList;\r
+\r
+public abstract class AuthorityClientImpl<TL extends AbstractCommonList, T extends AuthorityProxy<TL>> extends AbstractPoxServiceClientImpl<T>\r
+               implements AuthorityClient<TL, T> {\r
+\r
+       /*\r
+        * Basic CRUD proxied methods\r
+        */\r
+\r
+       //(C)reate Item\r
+       @Override\r
+    public ClientResponse<Response> createItem(String vcsid, PoxPayloadOut poxPayloadOut) {\r
+       return getProxy().createItem(vcsid, poxPayloadOut.getBytes());\r
+    }\r
+\r
+    //(R)ead Item\r
+    @Override\r
+       public ClientResponse<String> readItem(String vcsid, String csid) {\r
+       return getProxy().readItem(vcsid, csid);\r
+    }\r
+\r
+    //(U)pdate Item\r
+    @Override\r
+       public ClientResponse<String> updateItem(String vcsid, String csid, PoxPayloadOut poxPayloadOut) {\r
+       return getProxy().updateItem(vcsid, csid, poxPayloadOut.getBytes());\r
+    }\r
+\r
+    //(D)elete Item\r
+    @Override\r
+       public ClientResponse<Response> deleteItem(String vcsid, String csid) {\r
+       return getProxy().deleteItem(vcsid, csid);\r
+    }\r
+    \r
+    @Override\r
+       public ClientResponse<AuthorityRefDocList> getReferencingObjects(\r
+            String parentcsid,\r
+            String itemcsid) {\r
+       return getProxy().getReferencingObjects(parentcsid, itemcsid);\r
+    }\r
+    \r
+    /**\r
+     * Gets the item authority refs.\r
+     *\r
+     * @param parentcsid the parentcsid\r
+     * @param csid the csid\r
+     * @return the item authority refs\r
+     */\r
+    @Override\r
+       public ClientResponse<AuthorityRefList> getItemAuthorityRefs(String parentcsid, String csid) {\r
+        return getProxy().getItemAuthorityRefs(parentcsid, csid);\r
+    }\r
+    \r
+    /*\r
+     * \r
+     */\r
+    \r
+    @Override\r
+       public ClientResponse<String> readByName(String name) {\r
+       return getProxy().readByName(name);\r
+    }\r
+    \r
+    /*\r
+     * Item subresource methods\r
+     */\r
+    \r
+    /**\r
+     * Read named item.\r
+     *\r
+     * @param vcsid the vcsid\r
+     * @param shortId the shortIdentifier\r
+     * @return the client response\r
+     */\r
+    @Override\r
+       public ClientResponse<String> readNamedItem(String vcsid, String shortId) {\r
+        return getProxy().readNamedItem(vcsid, shortId);\r
+    }\r
+\r
+    /**\r
+     * Read item in Named Authority.\r
+     *\r
+     * @param authShortId the shortIdentifier for the Authority\r
+     * @param csid the csid\r
+     * @return the client response\r
+     */\r
+    @Override\r
+       public ClientResponse<String> readItemInNamedAuthority(String authShortId, String csid) {\r
+        return getProxy().readItemInNamedAuthority(authShortId, csid);\r
+    }\r
+\r
+    /**\r
+     * Read named item in Named Authority.\r
+     *\r
+     * @param authShortId the shortIdentifier for the Authority\r
+     * @param itemShortId the shortIdentifier for the item\r
+     * @return the client response\r
+     */\r
+    @Override\r
+       public ClientResponse<String> readNamedItemInNamedAuthority(String authShortId, String itemShortId) {\r
+        return getProxy().readNamedItemInNamedAuthority(authShortId, itemShortId);\r
+    }\r
+\r
+    /**\r
+     * Read item list, filtering by partial term match, or keywords. Only one of\r
+     * partialTerm or keywords should be specified. If both are specified, keywords\r
+     * will be ignored.\r
+     *\r
+     * @param inAuthority the parent authority\r
+     * @param partialTerm A partial term on which to match,\r
+     *     which will filter list results to return only matched resources.\r
+     * @param keywords A set of keywords on which to match,\r
+     *     which will filter list results to return only matched resources.\r
+     * @return the client response\r
+     */\r
+    @Override\r
+    public ClientResponse<TL> \r
+               readItemList(String inAuthority, String partialTerm, String keywords) {\r
+        return getProxy().readItemList(inAuthority, partialTerm, keywords);\r
+    }\r
+\r
+    /**\r
+     * Read item list for named vocabulary, filtering by partial term match, or keywords. Only one of\r
+     * partialTerm or keywords should be specified. If both are specified, keywords\r
+     * will be ignored.\r
+     *\r
+     * @param specifier the specifier\r
+     * @param partialTerm A partial term on which to match,\r
+     *     which will filter list results to return only matched resources.\r
+     * @param keywords A set of keywords on which to match,\r
+     *     which will filter list results to return only matched resources.\r
+     * @return the client response\r
+     */\r
+\r
+       @Override\r
+       public ClientResponse<TL> readItemListForNamedAuthority(\r
+                       String specifier, String partialTerm, String keywords) {\r
+        return getProxy().readItemListForNamedAuthority(specifier, partialTerm, keywords);\r
+       }\r
+}\r
diff --git a/services/client/src/main/java/org/collectionspace/services/client/AuthorityProxy.java b/services/client/src/main/java/org/collectionspace/services/client/AuthorityProxy.java
new file mode 100644 (file)
index 0000000..a8c0d99
--- /dev/null
@@ -0,0 +1,118 @@
+package org.collectionspace.services.client;\r
+\r
+import javax.ws.rs.DELETE;\r
+import javax.ws.rs.GET;\r
+import javax.ws.rs.POST;\r
+import javax.ws.rs.PUT;\r
+import javax.ws.rs.Path;\r
+import javax.ws.rs.PathParam;\r
+import javax.ws.rs.Produces;\r
+import javax.ws.rs.QueryParam;\r
+import javax.ws.rs.core.Response;\r
+\r
+import org.collectionspace.services.common.authorityref.AuthorityRefDocList;\r
+import org.collectionspace.services.common.authorityref.AuthorityRefList;\r
+import org.collectionspace.services.jaxb.AbstractCommonList;\r
+import org.jboss.resteasy.client.ClientResponse;\r
+\r
+public interface AuthorityProxy<TL extends AbstractCommonList> extends CollectionSpacePoxProxy {\r
+       \r
+       /*\r
+        * Basic CRUD operations\r
+        */\r
+       \r
+    //(C)reate Item\r
+    @POST\r
+    @Path("/{vcsid}/items/")\r
+    ClientResponse<Response> createItem(@PathParam("vcsid") String vcsid, byte[] xmlPayload);\r
+\r
+    //(R)ead Item\r
+    @GET\r
+    @Path("/{vcsid}/items/{csid}")\r
+    ClientResponse<String> readItem(@PathParam("vcsid") String vcsid, @PathParam("csid") String csid);\r
+\r
+    //(U)pdate Item\r
+    @PUT\r
+    @Path("/{vcsid}/items/{csid}")\r
+    ClientResponse<String> updateItem(@PathParam("vcsid") String vcsid, @PathParam("csid") String csid, byte[] xmlPayload);\r
+\r
+    //(D)elete Item\r
+    @DELETE\r
+    @Path("/{vcsid}/items/{csid}")\r
+    ClientResponse<Response> deleteItem(@PathParam("vcsid") String vcsid, @PathParam("csid") String csid);\r
+    \r
+    /**\r
+     * Get a list of objects that reference a given authority term.\r
+     * \r
+     * @param parentcsid \r
+     * @param itemcsid \r
+     * @param csid\r
+     * @return\r
+     * @see org.collectionspace.services.client.IntakeProxy#getAuthorityRefs(java.lang.String)\r
+     */\r
+    @GET\r
+    @Path("{csid}/items/{itemcsid}/refObjs")\r
+    @Produces("application/xml")\r
+    ClientResponse<AuthorityRefDocList> getReferencingObjects(\r
+            @PathParam("csid") String parentcsid,\r
+            @PathParam("itemcsid") String itemcsid);\r
+    \r
+    // List Item Authority References\r
+    @GET\r
+    @Produces({"application/xml"})\r
+    @Path("/{parentcsid}/items/{itemcsid}/authorityrefs/")\r
+    public ClientResponse<AuthorityRefList> getItemAuthorityRefs(\r
+            @PathParam("parentcsid") String parentcsid,\r
+            @PathParam("itemcsid") String itemcsid);\r
+    \r
+    /*\r
+     * \r
+     */\r
+    \r
+    //(R)ead by name\r
+    @GET\r
+    @Path("/urn:cspace:name({name})")\r
+    ClientResponse<String> readByName(@PathParam("name") String name);\r
+    \r
+    /*\r
+     * Item subresource methods\r
+     */\r
+    \r
+    //(R)ead Named Item\r
+    @GET\r
+    @Path("/{vcsid}/items/urn:cspace:name({specifier})")\r
+    ClientResponse<String> readNamedItem(@PathParam("vcsid") String vcsid, @PathParam("specifier") String specifier);\r
+\r
+    //(R)ead Item In Named Authority\r
+    @GET\r
+    @Path("/urn:cspace:name({specifier})/items/{csid}")\r
+    ClientResponse<String> readItemInNamedAuthority(@PathParam("specifier") String specifier, @PathParam("csid") String csid);\r
+\r
+    //(R)ead Named Item In Named Authority\r
+    @GET\r
+    @Path("/urn:cspace:name({specifier})/items/urn:cspace:name({itemspecifier})")\r
+    ClientResponse<String> readNamedItemInNamedAuthority(@PathParam("specifier") String specifier, @PathParam("itemspecifier") String itemspecifier);\r
+    \r
+    /*\r
+     * Item subresource List methods\r
+     */\r
+\r
+    // List Items matching a partial term or keywords.\r
+    @GET\r
+    @Produces({"application/xml"})\r
+    @Path("/{csid}/items/")\r
+    ClientResponse<TL> readItemList(\r
+               @PathParam("csid") String vcsid,\r
+            @QueryParam (IQueryManager.SEARCH_TYPE_PARTIALTERM) String partialTerm,\r
+            @QueryParam(IQueryManager.SEARCH_TYPE_KEYWORDS_KW) String keywords);\r
+    \r
+    // List Items for a named authority matching a partial term or keywords.\r
+    @GET\r
+    @Produces({"application/xml"})\r
+    @Path("/urn:cspace:name({specifier})/items/")\r
+    ClientResponse<TL> readItemListForNamedAuthority(\r
+               @PathParam("specifier") String specifier,\r
+            @QueryParam (IQueryManager.SEARCH_TYPE_PARTIALTERM) String partialTerm,\r
+            @QueryParam(IQueryManager.SEARCH_TYPE_KEYWORDS_KW) String keywords);\r
+\r
+}\r
index b785d1d3b4d93cfaca620e9eecc8002a468c496f..cfe5893064db16b92d6ee1726cdd7558bf8f26c2 100644 (file)
  */
 package org.collectionspace.services.client;
 
+import javax.ws.rs.PathParam;
 import javax.ws.rs.core.Response;
 import org.apache.commons.httpclient.HttpClient;
+import org.collectionspace.services.common.authorityref.AuthorityRefList;
 import org.collectionspace.services.jaxb.AbstractCommonList;
+import org.collectionspace.services.workflow.WorkflowsCommon;
 import org.jboss.resteasy.client.ClientResponse;
 
 /**
  *
  */
-public interface CollectionSpaceClient {
+public interface CollectionSpaceClient<T extends CollectionSpaceProxy> {
 
     public static final String AUTH_PROPERTY = "cspace.auth";
     public static final String PASSWORD_PROPERTY = "cspace.password";
@@ -45,8 +48,10 @@ public interface CollectionSpaceClient {
      *
      * @return the proxy
      */
-    CollectionSpaceProxy getProxy();
+    T getProxy();
 
+    Class<T> getProxyClass();
+    
     /**
      * Gets the base url.
      *
@@ -136,6 +141,10 @@ public interface CollectionSpaceClient {
      * @return boolean
      */
     boolean isServerSecure();
+    
+    /*
+     * Common proxied service calls
+     */
 
     /**
      * Read list.
@@ -161,6 +170,22 @@ public interface CollectionSpaceClient {
             Long pageSize,
             Long pageNumber);
 
+    /**
+     * Gets the workflow information
+     *
+     * @param csid the csid of the entity
+     * @return the workflow
+     */
+    public ClientResponse<String> getWorkflow(@PathParam("csid") String csid);
+    
+    /**
+     * Gets the authority refs.
+     *
+     * @param csid the csid
+     * @return the authority refs
+     */
+    public ClientResponse<AuthorityRefList> getAuthorityRefs(String csid);
+    
     /**
      * Delete.
      *
diff --git a/services/client/src/main/java/org/collectionspace/services/client/CollectionSpacePoxClient.java b/services/client/src/main/java/org/collectionspace/services/client/CollectionSpacePoxClient.java
new file mode 100644 (file)
index 0000000..1703154
--- /dev/null
@@ -0,0 +1,15 @@
+package org.collectionspace.services.client;\r
+\r
+import javax.ws.rs.core.Response;\r
+import org.jboss.resteasy.client.ClientResponse;\r
+\r
+public interface CollectionSpacePoxClient<T extends CollectionSpacePoxProxy> extends CollectionSpaceClient<T> {\r
+       /*\r
+        * Common service calls\r
+        */\r
+       public ClientResponse<Response> create(PoxPayloadOut xmlPayload);\r
+               \r
+    public ClientResponse<String> read(String csid);\r
+\r
+    public ClientResponse<String> update(String csid, PoxPayloadOut xmlPayload);\r
+}\r
diff --git a/services/client/src/main/java/org/collectionspace/services/client/CollectionSpacePoxProxy.java b/services/client/src/main/java/org/collectionspace/services/client/CollectionSpacePoxProxy.java
new file mode 100644 (file)
index 0000000..7eefc85
--- /dev/null
@@ -0,0 +1,26 @@
+package org.collectionspace.services.client;\r
+\r
+import javax.ws.rs.GET;\r
+import javax.ws.rs.POST;\r
+import javax.ws.rs.PUT;\r
+import javax.ws.rs.Path;\r
+import javax.ws.rs.PathParam;\r
+import javax.ws.rs.core.Response;\r
+\r
+import org.jboss.resteasy.client.ClientResponse;\r
+\r
+public interface CollectionSpacePoxProxy extends CollectionSpaceProxy {\r
+    //(C)reate\r
+    @POST\r
+    ClientResponse<Response> create(byte[] payload);\r
+\r
+    //(R)ead\r
+    @GET\r
+    @Path("/{csid}")\r
+    ClientResponse<String> read(@PathParam("csid") String csid);\r
+\r
+    //(U)pdate\r
+    @PUT\r
+    @Path("/{csid}")\r
+    ClientResponse<String> update(@PathParam("csid") String csid, byte[] payload);\r
+}\r
index b9a02d3f227ec7b3b4954349dc0f2a61e0bfa0e6..02c39baaebdcef952dd9c367e755ac39efd2e8f7 100644 (file)
 package org.collectionspace.services.client;\r
 \r
 import javax.ws.rs.GET;\r
+import javax.ws.rs.DELETE;\r
+import javax.ws.rs.Path;\r
+import javax.ws.rs.PathParam;\r
 import javax.ws.rs.Produces;\r
 import javax.ws.rs.QueryParam;\r
+import javax.ws.rs.core.Response;\r
 \r
+import org.collectionspace.services.common.authorityref.AuthorityRefList;\r
 import org.collectionspace.services.jaxb.AbstractCommonList;\r
+import org.collectionspace.services.workflow.WorkflowsCommon;\r
 import org.jboss.resteasy.client.ClientResponse;\r
 \r
 /**\r
@@ -39,6 +45,25 @@ import org.jboss.resteasy.client.ClientResponse;
  */\r
 public interface CollectionSpaceProxy {\r
 \r
+    //(D)elete\r
+    @DELETE\r
+    @Path("/{csid}")\r
+    ClientResponse<Response> delete(@PathParam("csid") String csid);\r
+       \r
+    // List Authority References\r
+    @GET\r
+    @Produces({"application/xml"})\r
+    @Path("/{csid}/authorityrefs/")\r
+    ClientResponse<AuthorityRefList> getAuthorityRefs(@PathParam("csid") String csid);\r
+    \r
+    @GET\r
+    @Path("{csid}/workflow")\r
+    ClientResponse<String> getWorkflow(@PathParam("csid") String csid);\r
+    \r
+    /*\r
+     * (R)read List operations\r
+     */\r
+    \r
     /**\r
      * Read list.\r
      *\r
similarity index 94%
rename from services/common/src/main/java/org/collectionspace/services/common/query/IQueryManager.java
rename to services/client/src/main/java/org/collectionspace/services/client/IQueryManager.java
index c4174faddb58cc6799a2569752001522fd5a73a9..5be8e813d4fab074cfa61642b96dd3e7e53fe2bc 100644 (file)
@@ -24,7 +24,7 @@
  * You may obtain a copy of the ECL 2.0 License at\r
  * https://source.collectionspace.org/collection-space/LICENSE.txt\r
  */\r
-package org.collectionspace.services.common.query;\r
+package org.collectionspace.services.client;\r
 \r
 public interface IQueryManager {\r
        \r
index a65ab0004789124c73f9396e4ed7162ee655a0a6..9552197d542b02a20a6ea3b31decb54c1d6be8bc 100644 (file)
@@ -31,7 +31,7 @@ import org.jboss.resteasy.client.ClientResponse;
 
  * @version $Revision:$
  */
-public class TestServiceClient extends AbstractServiceClientImpl {
+public class TestServiceClient extends AbstractServiceClientImpl<TestServiceProxy> {
 
     /**
      *
@@ -44,23 +44,14 @@ public class TestServiceClient extends AbstractServiceClientImpl {
         throw new UnsupportedOperationException();
     }
 
-
-    @Override
-    public CollectionSpaceProxy getProxy() {
-        throw new UnsupportedOperationException();
-    }
-
-    @Override
-    public void setProxy() {
-        throw new UnsupportedOperationException();
-    }
-
-    public ClientResponse<Response> delete(String csid) {
-       throw new UnsupportedOperationException();
-    }
-
        @Override
        public String getServiceName() {
                throw new UnsupportedOperationException();
-    } 
+    }
+
+       @Override
+       public Class<TestServiceProxy> getProxyClass() {
+               // TODO Auto-generated method stub
+               return TestServiceProxy.class;
+       } 
 }
diff --git a/services/client/src/main/java/org/collectionspace/services/client/TestServiceProxy.java b/services/client/src/main/java/org/collectionspace/services/client/TestServiceProxy.java
new file mode 100644 (file)
index 0000000..2483ee8
--- /dev/null
@@ -0,0 +1,5 @@
+package org.collectionspace.services.client;\r
+\r
+public interface TestServiceProxy extends CollectionSpaceProxy {\r
+\r
+}\r
diff --git a/services/client/src/main/java/org/collectionspace/services/client/test/ServiceTestUtils.java b/services/client/src/main/java/org/collectionspace/services/client/test/ServiceTestUtils.java
new file mode 100644 (file)
index 0000000..cbf1d5a
--- /dev/null
@@ -0,0 +1,6 @@
+package org.collectionspace.services.client.test;\r
+\r
+public class ServiceTestUtils {\r
+\r
+       \r
+}\r
index f9a7546bb7cfdc5bccfad8866ee226898331c543..1a49e9936b82c9ecbb0f0a62a2b0e1490d83909c 100644 (file)
@@ -12,6 +12,6 @@ Require-Bundle: org.nuxeo.runtime,
  org.collectionspace.collectionspace_core\r
 Provide-Package: org.collectionspace.collectionobject\r
 Nuxeo-Component: OSGI-INF/core-types-contrib.xml,\r
+ OSGI-INF/life-cycle-contrib.xml,\r
  OSGI-INF/ecm-types-contrib.xml,\r
  OSGI-INF/layouts-contrib.xml\r
-\r
index 2c5c1e51215eb53049549f60792af71a1ca43f4a..ae91a1580b4835f0f9094ee6bbd13bc8d738f34b 100644 (file)
@@ -5,7 +5,7 @@
         <schema name="collectionobjects_naturalhistory" prefix="collectionobjects_naturalhistory" src="schemas/collectionobjects_naturalhistory.xsd"/>
     </extension>
     <extension target="org.nuxeo.ecm.core.schema.TypeService" point="doctype">
-        <doctype name="CollectionObject" extends="Document">
+        <doctype name="CollectionObject" extends="CollectionSpaceDocument">
             <schema name="common"/>
             <schema name="dublincore"/>
             <schema name="collectionspace_core"/>
diff --git a/services/collectionobject/3rdparty/nuxeo-platform-cs-collectionobject/src/main/resources/OSGI-INF/life-cycle-contrib.xml b/services/collectionobject/3rdparty/nuxeo-platform-cs-collectionobject/src/main/resources/OSGI-INF/life-cycle-contrib.xml
new file mode 100644 (file)
index 0000000..4fa5e88
--- /dev/null
@@ -0,0 +1,11 @@
+<?xml version="1.0"?>
+<component name="org.collectionspace.ecm.platform.collectionobject.LifeCycleManagerExtensions">
+
+  <extension target="org.nuxeo.ecm.core.lifecycle.LifeCycleService"
+             point="types">
+    <types>
+      <type name="CollectionObject">default</type>
+    </types>
+  </extension>
+
+</component>
index f9682b88350b682f1af5b76c85ef4236f5c62cda..6fbb38178a538449ab0b4f357036b3b79c491cfd 100644 (file)
  */
 package org.collectionspace.services.client;
 
+import org.jboss.resteasy.client.ClientResponse;
 import javax.ws.rs.core.Response;
-
 import org.collectionspace.services.collectionobject.CollectionobjectsCommonList;
-import org.collectionspace.services.common.authorityref.AuthorityRefList;
-//import org.collectionspace.services.common.context.ServiceContext;
-//import org.collectionspace.services.common.query.IQueryManager;
-import org.jboss.resteasy.client.ProxyFactory;
-import org.jboss.resteasy.plugins.providers.RegisterBuiltin;
-import org.jboss.resteasy.client.ClientResponse;
-import org.jboss.resteasy.client.core.executors.ApacheHttpClientExecutor;
-//import org.jboss.resteasy.plugins.providers.multipart.PoxPayloadIn;
-//import org.jboss.resteasy.plugins.providers.multipart.PoxPayloadOut;
-import org.jboss.resteasy.spi.ResteasyProviderFactory;
-
-import org.slf4j.Logger;
 
 /**
  * The Class CollectionObjectClient.
  * FIXME: http://issues.collectionspace.org/browse/CSPACE-1684
  */
-public class CollectionObjectClient extends AbstractServiceClientImpl {
+public class CollectionObjectClient extends AbstractPoxServiceClientImpl<CollectionObjectProxy> {
        public static final String SERVICE_NAME = "collectionobjects";
        public static final String SERVICE_PATH_COMPONENT = SERVICE_NAME;
        public static final String SERVICE_PATH = "/" + SERVICE_PATH_COMPONENT; 
        public static final String SERVICE_PATH_PROXY = SERVICE_PATH + "/";             
        public static final String SERVICE_PAYLOAD_NAME = SERVICE_NAME;
-
-    /** The collection object proxy. */
-    private CollectionObjectProxy collectionObjectProxy;
     
        @Override
        public String getServiceName() {
                return SERVICE_NAME;
        }
     
-       /* (non-Javadoc)
-        * @see org.collectionspace.services.client.BaseServiceClient#getServicePathComponent()
-        */
        @Override
     public String getServicePathComponent() {
                return SERVICE_PATH_COMPONENT;
        }
 
-    /**
-     * Instantiates a new collection object client.
-     */
-    public CollectionObjectClient() {
-        ResteasyProviderFactory factory = ResteasyProviderFactory.getInstance();
-        RegisterBuiltin.register(factory);
-        setProxy();
-    }
-    
-    @Override
-    public CollectionSpaceProxy getProxy() {
-       return this.collectionObjectProxy;
-    }
-
-    /**
-     * Sets the proxy.
-     */
-    public void setProxy() {
-        if(useAuth()){
-            collectionObjectProxy = ProxyFactory.create(CollectionObjectProxy.class,
-                    getBaseURL(), new ApacheHttpClientExecutor(getHttpClient()));
-        }else{
-            collectionObjectProxy = ProxyFactory.create(CollectionObjectProxy.class,
-                    getBaseURL());
-        }
-    }
+       @Override
+       public Class<CollectionObjectProxy> getProxyClass() {
+               return CollectionObjectProxy.class;
+       }
 
-    /**
+       /*
+        * Proxied service calls
+        */
+       
+       /**
      * Read list.
      * 
      * @see org.collectionspace.services.client.CollectionObjectProxy#readList()
      * @return the client response< collectionobjects common list>
      */
     public ClientResponse<CollectionobjectsCommonList> readList() {
-        return collectionObjectProxy.readList();
+       CollectionObjectProxy proxy = (CollectionObjectProxy)getProxy();
+        return proxy.readList();
 
     }
 
-//    @Override
-//    public ClientResponse<CollectionobjectsCommonList> readList(String pageSize,
-//             String pageNumber) {
-//        return collectionObjectProxy.readList(pageSize, pageNumber);
-//    }
-    
     /**
      * Roundtrip.
      * 
@@ -124,7 +83,7 @@ public class CollectionObjectClient extends AbstractServiceClientImpl {
      */
     public ClientResponse<Response> roundtrip(int ms) {
        getLogger().debug(">>>>Roundtrip start.");
-       ClientResponse<Response> result = collectionObjectProxy.roundtrip(ms);
+       ClientResponse<Response> result = getProxy().roundtrip(ms);
        getLogger().debug("<<<<Roundtrip stop.");
        return result;
     }
@@ -137,74 +96,7 @@ public class CollectionObjectClient extends AbstractServiceClientImpl {
      * @see org.collectionspace.services.client.CollectionObjectProxy#keywordSearch()
      * @return the client response< collectionobjects common list>
      */
-    public ClientResponse<CollectionobjectsCommonList> keywordSearch(String keywords) {        
-        return collectionObjectProxy.keywordSearch(keywords);
-    }
-
-    
-    /**
-     * Read.
-     * 
-     * @param csid the csid
-     * 
-     * @see org.collectionspace.services.client.CollectionObjectProxy#keywordSearch()
-     * @return the client response< multipart input>
-     */
-    public ClientResponse<String> read(String csid) {
-        return collectionObjectProxy.read(csid);
+    public ClientResponse<CollectionobjectsCommonList> keywordSearch(String keywords) {
+        return getProxy().keywordSearch(keywords);
     }
-
-    public ClientResponse<Response> createPicture(String csid) {
-        return collectionObjectProxy.createPicture(csid);
-    }
-    
-    /**
-     * @param csid
-     * @return response
-     * @see org.collectionspace.services.client.CollectionObjectProxy#getAuthorityRefs(java.lang.String)
-     */
-    public ClientResponse<AuthorityRefList> getAuthorityRefs(String csid) {
-        return collectionObjectProxy.getAuthorityRefs(csid);
-    }
-
-
-    /**
-     * Creates the.
-     * 
-     * @param multipart the multipart
-     * 
-     * @see org.collectionspace.services.client.CollectionObjectProxy#create()
-     * @return the client response< response>
-     */
-    public ClientResponse<Response> create(PoxPayloadOut xmlPayload) {
-        return collectionObjectProxy.create(xmlPayload.getBytes());
-    }
-
-    /**
-     * Update.
-     * 
-     * @param csid the csid
-     * @param multipart the multipart
-     * 
-     * @see org.collectionspace.services.client.CollectionObjectProxy#update()
-     * @return the client response< multipart input>
-     */
-    public ClientResponse<String> update(String csid, PoxPayloadOut multipart) {
-       String payload = multipart.toXML();
-        return collectionObjectProxy.update(csid, payload.getBytes());
-    }
-
-    /**
-     * Delete.
-     * 
-     * @param csid the csid
-     * 
-     * @see org.collectionspace.services.client.CollectionObjectProxy#delete()
-     * @return the client response< response>
-     */
-    @Override
-    public ClientResponse<Response> delete(String csid) {
-        return collectionObjectProxy.delete(csid);
-    }
-
 }
index 743cddabbbb88fcf401cdd822c90dd901761937f..8cd0c85afef03219bf992e630b4ba3bc2b8c75d5 100644 (file)
  */
 package org.collectionspace.services.client;
 
+import org.jboss.resteasy.client.ClientResponse;
 import javax.ws.rs.Consumes;
-import javax.ws.rs.DELETE;
 import javax.ws.rs.GET;
-import javax.ws.rs.POST;
-import javax.ws.rs.PUT;
 import javax.ws.rs.Path;
 import javax.ws.rs.PathParam;
 import javax.ws.rs.QueryParam;
 import javax.ws.rs.Produces;
-//import javax.ws.rs.core.Context;
 import javax.ws.rs.core.Response;
-//import javax.ws.rs.core.UriInfo;
 
-//import org.collectionspace.services.client.IClientQueryParams;
-import org.collectionspace.services.client.CollectionSpaceProxy;
-import org.collectionspace.services.common.query.IQueryManager;
-import org.collectionspace.services.common.authorityref.AuthorityRefList;
-//import org.collectionspace.services.jaxb.AbstractCommonList;
 import org.collectionspace.services.collectionobject.CollectionobjectsCommonList;
 
-import org.jboss.resteasy.client.ClientResponse;
-
 /**
  * @version $Revision:$
  * FIXME: http://issues.collectionspace.org/browse/CSPACE-1684
@@ -55,31 +44,7 @@ import org.jboss.resteasy.client.ClientResponse;
 @Path(CollectionObjectClient.SERVICE_PATH_PROXY)
 @Produces({"application/xml"})
 @Consumes({"application/xml"})
-public interface CollectionObjectProxy extends CollectionSpaceProxy {
-
-    /**
-     * Read list.
-     *
-     * @return the client response
-     */
-    @GET
-    @Produces({"application/xml"})
-    ClientResponse<CollectionobjectsCommonList> readList();
-    
-//    /**
-//     * Read list.  //FIXME: REM - Remove this dead code please.
-//     *
-//     * @param pageSize the page size
-//     * @param pageNumber the page number
-//     * @return the client response
-//     */
-//    @GET
-//    @Produces({"application/xml"})
-//    @Override
-//    ClientResponse<CollectionobjectsCommonList> readList(
-//             @QueryParam(IClientQueryParams.PAGE_SIZE_PARAM) String pageSize,
-//             @QueryParam(IClientQueryParams.START_PAGE_PARAM) String pageNumber);
-    
+public interface CollectionObjectProxy extends CollectionSpacePoxProxy {
 
     /**
      * Roundtrip.
@@ -93,76 +58,23 @@ public interface CollectionObjectProxy extends CollectionSpaceProxy {
     ClientResponse<Response> roundtrip(@PathParam("ms") int ms);
 
     /**
-     * Keyword search.
-     *
-     * @param keywords the keywords
-     * @return the client response
-     */
-    @GET
-    @Produces({"application/xml"})
-    ClientResponse<CollectionobjectsCommonList> keywordSearch(
-               @QueryParam(IQueryManager.SEARCH_TYPE_KEYWORDS_KW) String keywords);
-
-    //(C)reate
-    /**
-     * Creates the.
-     *
-     * @param payload the payload
-     * @return the client response
-     */
-    @POST
-    ClientResponse<Response> create(byte[] payload);
-
-    //(R)ead
-    /**
-     * Read.
+     * Read list.
      *
-     * @param csid the csid
      * @return the client response
      */
-    @GET
-    @Path("/{csid}")
-    ClientResponse<String> read(@PathParam("csid") String csid);
-    
     @GET
     @Produces({"application/xml"})
-    @Path("/{csid}/picture")
-    @Deprecated //FIXME: REM - Remove this method and the corresponding client, and resource as well.
-    ClientResponse<Response> createPicture(@PathParam("csid") String csid);
+    ClientResponse<CollectionobjectsCommonList> readList();
     
-    // List Authority references
     /**
-     * Gets the authority refs.
+     * Keyword search.
      *
-     * @param csid the csid
-     * @return the authority refs
+     * @param keywords the keywords
+     * @return the client response
      */
     @GET
     @Produces({"application/xml"})
-    @Path("/{csid}/authorityrefs/")
-    ClientResponse<AuthorityRefList> getAuthorityRefs(@PathParam("csid") String csid);
+    ClientResponse<CollectionobjectsCommonList> keywordSearch(
+               @QueryParam(IQueryManager.SEARCH_TYPE_KEYWORDS_KW) String keywords);
     
-
-    //(U)pdate
-    /**
-     * Update.
-     *
-     * @param csid the csid
-     * @param multipart the multipart
-     * @return the client response
-     */
-    @PUT
-    @Path("/{csid}")
-    ClientResponse<String> update(@PathParam("csid") String csid, byte[] payload);
-
-    //(D)elete
-    /**
-     * Delete.
-     *
-     * @param csid the csid
-     * @return the client response
-     */
-    @DELETE
-    @Path("/{csid}")
-    ClientResponse<Response> delete(@PathParam("csid") String csid);
 }
index 504707179d4d08b340fd340c589d7e71fe265dd5..d7791c7b64208abbdc6f861245c5ffae3816179c 100644 (file)
@@ -46,6 +46,7 @@ import javax.ws.rs.core.UriInfo;
 import javax.ws.rs.core.MultivaluedMap;
 
 import org.collectionspace.services.client.CollectionObjectClient;
+import org.collectionspace.services.client.IQueryManager;
 import org.collectionspace.services.client.PoxPayloadIn;
 import org.collectionspace.services.client.PoxPayloadOut;
 //import org.collectionspace.services.common.imaging.nuxeo.NuxeoImageUtils; //FIXME: REM - Please remove all unneeded imports
@@ -60,7 +61,7 @@ import org.collectionspace.services.common.document.DocumentFilter;
 import org.collectionspace.services.common.document.DocumentHandler;
 import org.collectionspace.services.common.document.DocumentNotFoundException;
 import org.collectionspace.services.common.document.DocumentWrapper;
-import org.collectionspace.services.common.query.IQueryManager;
+//import org.collectionspace.services.common.query.IQueryManager;
 import org.collectionspace.services.common.query.QueryManager;
 import org.collectionspace.services.common.security.UnauthorizedException;
 import org.collectionspace.services.intake.IntakeResource;
index 980990437951a632ac7d078a2ff4341be3d4f879..a249472a903ca0bdebfccbb08598df20bfa28eb0 100755 (executable)
@@ -1,15 +1,23 @@
 <?xml version="1.0" encoding="UTF-8"?>\r
 <projectDescription>\r
        <name>common-api</name>\r
-       <comment/>\r
-       <projects/>\r
+       <comment></comment>\r
+       <projects>\r
+       </projects>\r
        <buildSpec>\r
                <buildCommand>\r
                        <name>org.eclipse.jdt.core.javabuilder</name>\r
-                       <arguments/>\r
+                       <arguments>\r
+                       </arguments>\r
+               </buildCommand>\r
+               <buildCommand>\r
+                       <name>org.maven.ide.eclipse.maven2Builder</name>\r
+                       <arguments>\r
+                       </arguments>\r
                </buildCommand>\r
        </buildSpec>\r
        <natures>\r
+               <nature>org.maven.ide.eclipse.maven2Nature</nature>\r
                <nature>org.eclipse.jdt.core.javanature</nature>\r
        </natures>\r
 </projectDescription>\r
index 0e000e34ebaf350161f6eda681848a14777559c8..bf4136a5213ae22ff9ff18e89c4286e9fd4caa46 100644 (file)
         </tenant:serviceBindings>
         <!-- end movement service meta-data -->
 
+        <!-- begin Workflow service meta-data -->
+        <tenant:serviceBindings name="Workflows" type="procedure" version="0.1">
+            <service:repositoryDomain xmlns:service='http://collectionspace.org/services/common/service'>
+                default-domain
+            </service:repositoryDomain>
+            <service:documentHandler xmlns:service='http://collectionspace.org/services/common/service'>
+                org.collectionspace.services.common.workflow.service.nuxeo.WorkflowDocumentModelHandler
+            </service:documentHandler>
+            <service:validatorHandler xmlns:service='http://collectionspace.org/services/common/service'>
+                org.collectionspace.services.workflow.nuxeo.WorkflowValidatorHandler
+            </service:validatorHandler>
+            <service:object name="Workflow" version="0.1"
+                            xmlns:service='http://collectionspace.org/services/common/service'>
+                <service:part id="0" control_group="Managed"
+                              versionable="true" auditable="false"
+                              label="workflows-system" updated="" order="0">
+                    <service:content contentType="application/xml">
+                        <service:xmlContent
+                            namespaceURI="http://collectionspace.org/services/common/system"
+                            schemaLocation="http://collectionspace.org/services/common/system http://collectionspace.org/services/common/system/system-response.xsd">
+                        </service:xmlContent>
+                    </service:content>
+                </service:part>
+                <service:part id="1" control_group="Managed"
+                              versionable="true" auditable="false"
+                              label="workflows_common" updated="" order="1">
+                    <service:content contentType="application/xml">
+                        <service:xmlContent
+                            namespaceURI="http://collectionspace.org/services/workflow"
+                            schemaLocation="http://collectionspace.org/services/workflow http://services.collectionspace.org/movement/workflows_common.xsd">
+                        </service:xmlContent>
+                    </service:content>
+                </service:part>
+            </service:object>
+        </tenant:serviceBindings>
+        <!-- end Workflow service meta-data -->
+
         <!-- begin report service meta-data -->
         <tenant:serviceBindings name="Reports" type="procedure" version="0.1">
             <!-- other URI paths using which this service could be accessed -->
index a557ba7578931cadd4d29e5388687295d5cd18ec..1371cb62be714bd9a61f28ca82dafc9dd4260bea 100644 (file)
  */\r
 package org.collectionspace.services.common;\r
 \r
+import javax.ws.rs.GET;\r
+import javax.ws.rs.Path;\r
+import javax.ws.rs.PathParam;\r
+import javax.ws.rs.WebApplicationException;\r
+import javax.ws.rs.core.Response;\r
+\r
 import org.collectionspace.services.client.PayloadInputPart;\r
 import org.collectionspace.services.client.PoxPayloadIn;\r
 import org.collectionspace.services.client.PoxPayloadOut;\r
@@ -34,9 +40,12 @@ import org.collectionspace.services.common.context.MultipartServiceContextFactor
 import org.collectionspace.services.common.context.ServiceContext;\r
 import org.collectionspace.services.common.context.ServiceContextFactory;\r
 import org.collectionspace.services.common.document.DocumentHandler;\r
+import org.collectionspace.services.common.document.DocumentNotFoundException;\r
+import org.collectionspace.services.common.security.UnauthorizedException;\r
+import org.collectionspace.services.common.workflow.client.WorkflowClient;\r
+import org.collectionspace.services.common.workflow.service.nuxeo.WorkflowDocumentModelHandler;\r
+import org.collectionspace.services.workflow.WorkflowsCommon;\r
 \r
-import org.jboss.resteasy.plugins.providers.multipart.MultipartInput;\r
-import org.jboss.resteasy.plugins.providers.multipart.MultipartOutput;\r
 import org.slf4j.Logger;\r
 import org.slf4j.LoggerFactory;\r
 \r
@@ -53,6 +62,40 @@ public abstract class AbstractMultiPartCollectionSpaceResourceImpl extends
        return MultipartServiceContextFactory.get();\r
     }\r
 \r
+    protected WebApplicationException bigReThrow(Exception e, String serviceMsg)\r
+    throws WebApplicationException {\r
+        return bigReThrow(e, serviceMsg, "");\r
+    }\r
+\r
+       protected WebApplicationException bigReThrow(Exception e,\r
+                       String serviceMsg, String csid) throws WebApplicationException {\r
+               Response response;\r
+               if (logger.isDebugEnabled()) {\r
+                       logger.debug(getClass().getName(), e);\r
+               }\r
+               if (e instanceof UnauthorizedException) {\r
+                       response = Response.status(Response.Status.UNAUTHORIZED)\r
+                                       .entity(serviceMsg + e.getMessage()).type("text/plain")\r
+                                       .build();\r
+                       return new WebApplicationException(response);\r
+               } else if (e instanceof DocumentNotFoundException) {\r
+                       response = Response\r
+                                       .status(Response.Status.NOT_FOUND)\r
+                                       .entity(serviceMsg + " on " + getClass().getName()\r
+                                                       + " csid=" + csid).type("text/plain").build();\r
+                       return new WebApplicationException(response);\r
+               } else if (e instanceof WebApplicationException) {\r
+                       //\r
+                       // subresource may have already thrown this exception\r
+                       // so just pass it on\r
+                       return (WebApplicationException)e;\r
+               } else { // e is now instanceof Exception\r
+                       response = Response.status(Response.Status.INTERNAL_SERVER_ERROR)\r
+                                       .entity(serviceMsg).type("text/plain").build();\r
+                       return new WebApplicationException(response);\r
+               }\r
+       }\r
+    \r
     @Override\r
     public DocumentHandler createDocumentHandler(ServiceContext<PoxPayloadIn, PoxPayloadOut> ctx) throws Exception {\r
        return createDocumentHandler(ctx, ctx.getCommonPartLabel(), getCommonPartClass());\r
@@ -100,4 +143,51 @@ public abstract class AbstractMultiPartCollectionSpaceResourceImpl extends
        return createDocumentHandler(ctx, ctx.getCommonPartLabel(), commonClass);\r
     }\r
     \r
+    /**\r
+     * Creates the contact document handler.\r
+     * \r
+     * @param ctx the ctx\r
+     * @param inAuthority the in authority\r
+     * @param inItem the in item\r
+     * \r
+     * @return the document handler\r
+     * \r
+     * @throws Exception the exception\r
+     */\r
+    private WorkflowDocumentModelHandler createWorkflowDocumentHandler(\r
+               ServiceContext<PoxPayloadIn, PoxPayloadOut> ctx) throws Exception {\r
+       \r
+       WorkflowDocumentModelHandler docHandler = (WorkflowDocumentModelHandler)createDocumentHandler(ctx,\r
+                       WorkflowClient.SERVICE_COMMONPART_NAME,\r
+                       WorkflowsCommon.class);         \r
+       \r
+        return docHandler;\r
+    }\r
+    \r
+    /*\r
+     * JAX-RS Annotated methods\r
+     */\r
+        \r
+    @GET\r
+    @Path("{csid}/workflow")\r
+    public byte[] getWorkflow(\r
+            @PathParam("csid") String csid) {\r
+        PoxPayloadOut result = null;\r
+\r
+        try {\r
+            ServiceContext<PoxPayloadIn, PoxPayloadOut> parentCtx = createServiceContext();\r
+            String parentWorkspaceName = parentCtx.getRepositoryWorkspaceName();\r
+               \r
+               MultipartServiceContext ctx = (MultipartServiceContext) createServiceContext(WorkflowClient.SERVICE_NAME);\r
+               WorkflowDocumentModelHandler handler = createWorkflowDocumentHandler(ctx);\r
+               ctx.setRespositoryWorkspaceName(parentWorkspaceName); //find the document in the parent's workspace\r
+            getRepositoryClient(ctx).get(ctx, csid, handler);\r
+            result = ctx.getOutput();\r
+        } catch (Exception e) {\r
+            throw bigReThrow(e, ServiceMessages.READ_FAILED + WorkflowClient.SERVICE_PAYLOAD_NAME, csid);\r
+        }\r
+                \r
+        return result.getBytes();\r
+    }\r
+    \r
 }\r
index ee5a4ecf75935b8264f28b6cbb09ed66511222de..eaafe2b9839cc25c0e468a1017df0b1015bd73d3 100644 (file)
@@ -24,6 +24,7 @@
 \r
 package org.collectionspace.services.common;\r
 \r
+import org.collectionspace.services.client.IQueryManager;\r
 import org.collectionspace.services.client.PoxPayloadIn;\r
 import org.collectionspace.services.client.PoxPayloadOut;\r
 import org.collectionspace.services.common.authorityref.AuthorityRefList;\r
@@ -34,7 +35,6 @@ import org.collectionspace.services.common.document.DocumentFilter;
 import org.collectionspace.services.common.document.DocumentHandler;\r
 import org.collectionspace.services.common.document.DocumentNotFoundException;\r
 import org.collectionspace.services.common.document.DocumentWrapper;\r
-import org.collectionspace.services.common.query.IQueryManager;\r
 import org.collectionspace.services.common.query.QueryManager;\r
 import org.collectionspace.services.common.security.UnauthorizedException;\r
 import org.collectionspace.services.jaxb.AbstractCommonList;\r
@@ -91,39 +91,6 @@ extends AbstractMultiPartCollectionSpaceResourceImpl {
         }\r
     }\r
 \r
-    protected WebApplicationException bigReThrow(Exception e, String serviceMsg)\r
-    throws WebApplicationException {\r
-        return bigReThrow(e, serviceMsg, "");\r
-    }\r
-\r
-       protected WebApplicationException bigReThrow(Exception e,\r
-                       String serviceMsg, String csid) throws WebApplicationException {\r
-               Response response;\r
-               //if (logger.isDebugEnabled()) {\r
-                       logger.error(getClass().getName(), e);\r
-               //}\r
-               if (e instanceof UnauthorizedException) {\r
-                       response = Response.status(Response.Status.UNAUTHORIZED)\r
-                                       .entity(serviceMsg + e.getMessage()).type("text/plain")\r
-                                       .build();\r
-                       return new WebApplicationException(response);\r
-               } else if (e instanceof DocumentNotFoundException) {\r
-                       response = Response\r
-                                       .status(Response.Status.NOT_FOUND)\r
-                                       .entity(serviceMsg + " on " + getClass().getName()\r
-                                                       + " csid=" + csid).type("text/plain").build();\r
-                       return new WebApplicationException(response);\r
-               } else if (e instanceof WebApplicationException) {\r
-                       //\r
-                       // subresource may have already thrown this exception\r
-                       // so just pass it on\r
-                       return (WebApplicationException)e;\r
-               } else { // e is now instanceof Exception\r
-                       response = Response.status(Response.Status.INTERNAL_SERVER_ERROR)\r
-                                       .entity(serviceMsg).type("text/plain").build();\r
-                       return new WebApplicationException(response);\r
-               }\r
-       }\r
 \r
     //======================= CREATE ====================================================\r
 \r
index b065f93c5d110e78b5f0b5b6c22a5161f8748e34..2fe4e522e36d72f009502388de83981ed08941ce 100644 (file)
@@ -34,6 +34,7 @@ package org.collectionspace.services.common;
 public class ServiceMessages {
 
     private static final String FAILED = "failed: ";
+    private static final String UNSUPPORTED = "unsupported: ";
 
     public static final String POST_FAILED = "POST " + FAILED;
     public static final String GET_FAILED = "GET " + FAILED;
@@ -42,6 +43,12 @@ public class ServiceMessages {
     public static final String CREATE_FAILED = "Create request " + FAILED;
     public static final String READ_FAILED = "Read request " + FAILED;
     public static final String UPDATE_FAILED = "Update request " + FAILED;
+    
+    public static final String POST_UNSUPPORTED = "POST " + UNSUPPORTED;
+    public static final String GET_UNSUPPORTED = "GET " + UNSUPPORTED;
+    public static final String GET_LIST_UNSUPPORTED = "GET/LIST " + UNSUPPORTED;
+    public static final String PUT_UNSUPPORTED = "PUT " + UNSUPPORTED;
+    public static final String DELETE_UNSUPPORTED = "DELETE " + UNSUPPORTED;
 
     public static final String DELETE_FAILED = "Delete request " + FAILED;
     public static final String LIST_FAILED = "List request " + FAILED;
index e12b4daaff54a174c23e3d6222b26f802344dba6..2f058db7028baa5b4d22547c5413f87c499562ab 100644 (file)
@@ -76,7 +76,7 @@ public abstract class AbstractServiceContextImpl<IT, OT>
     /** The object part map. */
     Map<String, ObjectPartType> objectPartMap = new HashMap<String, ObjectPartType>();
     /** The service binding. */
-    private ServiceBindingType serviceBinding;
+    protected ServiceBindingType serviceBinding;
     /** The tenant binding. */
     private TenantBindingType tenantBinding;
     /** repository domain used by the service */
index 3c6fe48b3596b481f1f6a94e58cc9d3094764e33..cf7c4ce99e817cfa94901f3e96ec689f11ee1f43 100644 (file)
@@ -109,4 +109,6 @@ public interface MultipartServiceContext
      * @param contentType media type
      */
     public void addOutputPart(String label, Element doc, String contentType) throws Exception;
+    
+    public void setRespositoryWorkspaceName(String workspaceName);    
 }
index cc068a2832c5970b83036e72be5ec3aec25bbd2c..67dc80d73e07203e1abe06b8e6013132e3efd439 100644 (file)
@@ -55,6 +55,7 @@ public class MultipartServiceContextImpl
 
     /** The logger. */
     final Logger logger = LoggerFactory.getLogger(MultipartServiceContextImpl.class);
+       private String repositoryWorkspaceName;
 
     /**
      * Instantiates a new multipart service context impl.
@@ -177,4 +178,22 @@ public class MultipartServiceContextImpl
         ServiceContext ctx = (ServiceContext) ctor.newInstance(getServiceName());
         return ctx;
     }
+    
+    /* (non-Javadoc)
+     * @see org.collectionspace.services.common.context.ServiceContext#getRepositoryWorkspaceName()
+     */
+    @Override
+    public String getRepositoryWorkspaceName() {
+       String result = repositoryWorkspaceName;
+        //service name is workspace name by convention
+        if (result == null) {
+               result = serviceBinding.getName();
+        }
+        return result;
+    }
+    
+    @Override
+    public void setRespositoryWorkspaceName(String workspaceName) {
+       repositoryWorkspaceName = workspaceName;
+    }
 }
index 040d04f682e8f6c253b955a4a20955bdbe8483c7..ee76beb4834280f8a1a7c53ef22745e94ebc4f32 100644 (file)
@@ -26,6 +26,7 @@
  */\r
 package org.collectionspace.services.common.query;\r
 \r
+import org.collectionspace.services.client.IQueryManager;\r
 import org.collectionspace.services.common.query.nuxeo.QueryManagerNuxeoImpl;\r
 \r
 public class QueryManager {\r
index aba6d1d6d5020eaccac421cbbd6936cd7735f249..a055e9e85ffdb3fda0ab05cbb236d9dbeb1ba87b 100644 (file)
  */\r
 package org.collectionspace.services.common.query.nuxeo;\r
 \r
-import java.util.StringTokenizer;\r
-\r
 import org.slf4j.Logger;\r
 import org.slf4j.LoggerFactory;\r
 \r
-import java.util.Map;\r
-import java.util.HashMap;\r
-import java.util.StringTokenizer;\r
 import java.util.regex.Pattern;\r
 \r
 import org.nuxeo.ecm.core.api.DocumentModel;\r
@@ -43,9 +38,7 @@ import org.nuxeo.ecm.core.client.NuxeoClient;
 \r
 import org.collectionspace.services.nuxeo.client.java.NuxeoConnector;\r
 import org.collectionspace.services.nuxeo.client.java.RepositoryJavaClientImpl;\r
-import org.collectionspace.services.common.document.DocumentFilter;\r
-import org.collectionspace.services.common.query.IQueryManager;\r
-import org.collectionspace.services.common.vocabulary.AuthorityItemJAXBSchema;\r
+import org.collectionspace.services.client.IQueryManager;\r
 \r
 public class QueryManagerNuxeoImpl implements IQueryManager {\r
        \r
index f4c026ad58aecc01a9d95f5de675e6bc9574037e..2d4240b0d8047cd6e30410d2c088a0e4778ddc53 100644 (file)
@@ -25,7 +25,7 @@ package org.collectionspace.services.common.relation.nuxeo;
 
 import java.lang.StringBuilder;
 
-import org.collectionspace.services.common.query.IQueryManager;
+import org.collectionspace.services.client.IQueryManager;
 import org.collectionspace.services.common.relation.RelationJAXBSchema;
 
 import org.slf4j.Logger;
index 9fdc5496036c1d5366a1b30bcfe463b0e3818963..6698a6634b6f5be95830feaad479f341f5425aa8 100644 (file)
@@ -42,6 +42,7 @@ import javax.ws.rs.core.Response;
 import javax.ws.rs.core.UriBuilder;
 import javax.ws.rs.core.UriInfo;
 
+import org.collectionspace.services.client.IQueryManager;
 import org.collectionspace.services.client.PoxPayloadIn;
 import org.collectionspace.services.client.PoxPayloadOut;
 import org.collectionspace.services.common.vocabulary.AuthorityJAXBSchema;
@@ -62,7 +63,6 @@ import org.collectionspace.services.common.document.DocumentNotFoundException;
 import org.collectionspace.services.common.document.DocumentWrapper;
 import org.collectionspace.services.common.repository.RepositoryClient;
 import org.collectionspace.services.common.security.UnauthorizedException;
-import org.collectionspace.services.common.query.IQueryManager;
 import org.collectionspace.services.common.query.QueryManager;
 import org.collectionspace.services.nuxeo.client.java.RemoteDocumentModelHandlerImpl;
 import org.jboss.resteasy.util.HttpResponseCodes;
index 600c043efc0f946010dbf786aa720a97e53784dc..d70370f167c97c88a5610fa4d2e1d687c0669e1f 100644 (file)
@@ -10,7 +10,7 @@ import org.nuxeo.ecm.core.client.NuxeoClient;
 \r
 import org.collectionspace.services.nuxeo.client.java.NuxeoConnector;\r
 import org.collectionspace.services.nuxeo.client.java.RepositoryJavaClientImpl;\r
-import org.collectionspace.services.common.query.IQueryManager;\r
+//import org.collectionspace.services.common.query.IQueryManager;\r
 \r
 public class VocabManagerImpl implements IVocabManager {\r
        \r
diff --git a/services/common/src/main/java/org/collectionspace/services/common/workflow/client/WorkflowClient.java b/services/common/src/main/java/org/collectionspace/services/common/workflow/client/WorkflowClient.java
new file mode 100644 (file)
index 0000000..2f47077
--- /dev/null
@@ -0,0 +1,50 @@
+/**    
+ * 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 (c) 2009 Regents of the University of California
+ *
+ * Licensed under the Educational Community License (ECL), Version 2.0.
+ * You may not use this file except in compliance with this License.
+ *
+ * You may obtain a copy of the ECL 2.0 License at
+ * https://source.collectionspace.org/collection-space/LICENSE.txt
+ */
+package org.collectionspace.services.common.workflow.client;
+
+import org.collectionspace.services.client.AbstractPoxServiceClientImpl;
+
+/**
+ * WorkflowClient.java
+ *
+ * $LastChangedRevision: 2108 $
+ * $LastChangedDate: 2010-05-17 18:25:37 -0700 (Mon, 17 May 2010) $
+ *
+ */
+public class WorkflowClient extends AbstractPoxServiceClientImpl<WorkflowProxy> {
+       public static final String SERVICE_NAME = "workflows";
+       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 SERVICE_COMMONPART_NAME = SERVICE_NAME + PART_LABEL_SEPARATOR + PART_COMMON_LABEL;
+
+       @Override
+       public String getServiceName() {
+               return SERVICE_NAME;
+       }
+       
+       @Override
+    public String getServicePathComponent() {
+        return SERVICE_PATH_COMPONENT;
+    }    
+
+       @Override
+       public Class<WorkflowProxy> getProxyClass() {
+               // TODO Auto-generated method stub
+               return WorkflowProxy.class;
+       }
+}
diff --git a/services/common/src/main/java/org/collectionspace/services/common/workflow/client/WorkflowProxy.java b/services/common/src/main/java/org/collectionspace/services/common/workflow/client/WorkflowProxy.java
new file mode 100644 (file)
index 0000000..04ff61a
--- /dev/null
@@ -0,0 +1,16 @@
+package org.collectionspace.services.common.workflow.client;
+
+import javax.ws.rs.Consumes;
+import javax.ws.rs.Path;
+import javax.ws.rs.Produces;
+
+import org.collectionspace.services.client.CollectionSpacePoxProxy;
+
+/**
+ * @version $Revision: 2108 $
+ */
+@Path(WorkflowClient.SERVICE_PATH + "/")
+@Produces({"application/xml"})
+@Consumes({"application/xml"})
+public interface WorkflowProxy extends CollectionSpacePoxProxy {       
+}
index d13c122a24003244826f8ded52fe5ad5f3282495..50db6a4d7f021267e13f808843038ae86b8755a0 100644 (file)
@@ -127,7 +127,7 @@ public abstract class RemoteDocumentModelHandlerImpl<T, TL>
      * @param partMeta the part meta
      * @throws Exception the exception
      */
-    private void addOutputPart(Map<String, Object> unQObjectProperties, String schema, ObjectPartType partMeta)
+    protected void addOutputPart(Map<String, Object> unQObjectProperties, String schema, ObjectPartType partMeta)
             throws Exception {
         Element doc = DocumentUtils.buildDocument(partMeta, schema,
                 unQObjectProperties);
index a83eac3b6d250a5d8264ad75b33addae8f03a7c6..3c9e94c17a442e5c95990581d0d133d4f78d4633 100644 (file)
@@ -24,11 +24,11 @@ import java.util.regex.Matcher;
 import java.util.regex.Pattern;
 import java.util.regex.PatternSyntaxException;
 
+import org.collectionspace.services.client.IQueryManager;
 import org.collectionspace.services.client.PoxPayloadIn;
 import org.collectionspace.services.client.PoxPayloadOut;
 import org.collectionspace.services.common.context.ServiceContext;
 import org.collectionspace.services.common.datetime.GregorianCalendarDateTimeUtils;
-import org.collectionspace.services.common.query.IQueryManager;
 import org.collectionspace.services.common.query.QueryContext;
 import org.collectionspace.services.common.repository.RepositoryClient;
 import org.collectionspace.services.common.profile.Profiler;
@@ -43,9 +43,6 @@ import org.collectionspace.services.common.document.DocumentHandler.Action;
 import org.collectionspace.services.common.document.DocumentWrapper;
 import org.collectionspace.services.common.document.DocumentWrapperImpl;
 
-import org.jboss.resteasy.plugins.providers.multipart.MultipartInput;
-import org.jboss.resteasy.plugins.providers.multipart.MultipartOutput;
-
 import org.nuxeo.common.utils.IdUtils;
 import org.nuxeo.ecm.core.api.ClientException;
 import org.nuxeo.ecm.core.api.DocumentModel;
diff --git a/services/contact/client/src/main/java/org/collectionspace/services/client/AuthorityWithContactsClient.java b/services/contact/client/src/main/java/org/collectionspace/services/client/AuthorityWithContactsClient.java
new file mode 100644 (file)
index 0000000..f1ae2dc
--- /dev/null
@@ -0,0 +1,261 @@
+package org.collectionspace.services.client;\r
+\r
+import javax.ws.rs.core.Response;\r
+\r
+import org.collectionspace.services.contact.ContactsCommonList;\r
+import org.collectionspace.services.jaxb.AbstractCommonList;\r
+import org.jboss.resteasy.client.ClientResponse;\r
+\r
+public interface AuthorityWithContactsClient<TL extends AbstractCommonList, T extends AuthorityProxy<TL>> extends AuthorityClient<TL, T> {\r
+    /**\r
+     * Creates the contact.\r
+     *\r
+     * @param parentcsid the parentcsid\r
+     * @param itemcsid the itemcsid\r
+     * @param multipart the multipart\r
+     * @return the client response\r
+     */\r
+    public ClientResponse<Response> createContact(String parentcsid,\r
+            String itemcsid, PoxPayloadOut xmlPayload);\r
+    \r
+    /**\r
+     * Creates the contact.\r
+     *\r
+     * @param parentcsid\r
+     * @param itemspecifier (shortIdentifier)\r
+     * @param multipart\r
+     * @return the client response\r
+     */\r
+    public ClientResponse<Response> createContactForNamedItem(\r
+               String parentcsid,\r
+               String itemspecifier,\r
+               PoxPayloadOut xmlPayload);\r
+    \r
+    /**\r
+     * Creates the contact.\r
+     *\r
+     * @param parentspecifier (shortIdentifier)\r
+     * @param itemcsid\r
+     * @param multipart\r
+     * @return the client response\r
+     */\r
+    public ClientResponse<Response> createContactForItemInNamedAuthority(\r
+               String parentspecifier,\r
+               String itemcsid,\r
+               PoxPayloadOut xmlPayload);\r
+    \r
+    /**\r
+     * Creates the contact.\r
+     *\r
+     * @param parentspecifier (shortIdentifier)\r
+     * @param itemspecifier (shortIdentifier)\r
+     * @param multipart\r
+     * @return the client response\r
+     */\r
+    public ClientResponse<Response> createContactForNamedItemInNamedAuthority(\r
+               String parentspecifier,\r
+               String itemspecifier,\r
+               PoxPayloadOut xmlPayload);\r
+    \r
+    /**\r
+     * Read contact.\r
+     *\r
+     * @param parentcsid the parentcsid\r
+     * @param itemcsid the itemcsid\r
+     * @param csid the csid\r
+     * @return the client response\r
+     */\r
+    public ClientResponse<String> readContact(String parentcsid,\r
+            String itemcsid, String csid);\r
+    \r
+    /**\r
+     * Read contact.\r
+     *\r
+     * @param parentcsid\r
+     * @param itemspecifier (shortIdentifier)\r
+     * @param csid\r
+     * @return the client response\r
+     */\r
+    public ClientResponse<String> readContactForNamedItem(\r
+               String parentcsid,\r
+               String itemspecifier,\r
+               String csid);\r
+\r
+    /**\r
+     * Read contact.\r
+     *\r
+     * @param parentspecifier (shortIdentifier)\r
+     * @param itemcsid\r
+     * @param csid\r
+     * @return the client response\r
+     */\r
+    public ClientResponse<String> readContactInNamedAuthority(\r
+               String parentspecifier,\r
+               String itemcsid,\r
+               String csid);\r
+\r
+    /**\r
+     * Read contact.\r
+     *\r
+     * @param parentspecifier (shortIdentifier)\r
+     * @param itemspecifier (shortIdentifier)\r
+     * @param csid\r
+     * @return the client response\r
+     */\r
+    public ClientResponse<String> readContactForNamedItemInNamedAuthority(\r
+               String parentspecifier,\r
+               String itemspecifier,\r
+               String csid);\r
+            \r
+\r
+    /**\r
+     * Read contact list.\r
+     *\r
+     * @param parentcsid the parentcsid\r
+     * @param itemcsid the itemcsid\r
+     * @return the client response\r
+     */\r
+    public ClientResponse<ContactsCommonList> readContactList(String parentcsid,\r
+            String itemcsid);\r
+    \r
+    /**\r
+     * Read contact list.\r
+     *\r
+     * @param parentcsid\r
+     * @param itemspecifier (shortIdentifier)\r
+     * @return the client response\r
+     */\r
+    public ClientResponse<ContactsCommonList> readContactListForNamedItem(\r
+               String parentcsid,\r
+               String itemspecifier);\r
+\r
+    /**\r
+     * Read contact list.\r
+     *\r
+     * @param parentspecifier (shortIdentifier)\r
+     * @param itemcsid\r
+     * @return the client response\r
+     */\r
+    public ClientResponse<ContactsCommonList> readContactListForItemInNamedAuthority(\r
+               String parentspecifier,\r
+               String itemcsid);\r
+\r
+    /**\r
+     * Read contact list.\r
+     *\r
+     * @param parentspecifier (shortIdentifier)\r
+     * @param itemspecifier (shortIdentifier)\r
+     * @return the client response\r
+     */\r
+    public ClientResponse<ContactsCommonList> readContactListForNamedItemInNamedAuthority(\r
+               String parentspecifier,\r
+               String itemspecifier);\r
+\r
+    /**\r
+     * Update contact.\r
+     *\r
+     * @param parentcsid the parentcsid\r
+     * @param itemcsid the itemcsid\r
+     * @param csid the csid\r
+     * @param multipart the multipart\r
+     * @return the client response\r
+     */\r
+    public ClientResponse<String> updateContact(String parentcsid,\r
+            String itemcsid, String csid, PoxPayloadOut xmlPayload);\r
+    \r
+    /**\r
+     * Update contact.\r
+     *\r
+     * @param parentcsid the parentcsid\r
+     * @param itemspecifier (shortIdentifier)\r
+     * @param csid the csid\r
+     * @param multipart the multipart\r
+     * @return the client response\r
+     */\r
+    public ClientResponse<String> updateContactForNamedItem(\r
+               String parentcsid,\r
+               String itemspecifier,\r
+               String csid,\r
+               PoxPayloadOut xmlPayload);\r
+\r
+    /**\r
+     * Update contact.\r
+     *\r
+     * @param parentspecifier (shortIdentifier)\r
+     * @param itemcsid the itemcsid\r
+     * @param csid the csid\r
+     * @param multipart the multipart\r
+     * @return the client response\r
+     */\r
+    public ClientResponse<String> updateContactInNamedAuthority(\r
+               String parentspecifier,\r
+               String itemcsid,\r
+               String csid,\r
+               PoxPayloadOut xmlPayload);\r
+\r
+    /**\r
+     * Update contact.\r
+     *\r
+     * @param parentspecifier (shortIdentifier)\r
+     * @param itemspecifier (shortIdentifier)\r
+     * @param csid the csid\r
+     * @param multipart the multipart\r
+     * @return the client response\r
+     */\r
+    public ClientResponse<String> updateContactForNamedItemInNamedAuthority(\r
+               String parentspecifier,\r
+               String itemspecifier,\r
+               String csid,\r
+               PoxPayloadOut xmlPayload);\r
+\r
+    /**\r
+     * Delete contact.\r
+     *\r
+     * @param parentcsid the parentcsid\r
+     * @param itemcsid the itemcsid\r
+     * @param csid the csid\r
+     * @return the client response\r
+     */\r
+    public ClientResponse<Response> deleteContact(String parentcsid,\r
+        String itemcsid, String csid);\r
+    \r
+    /**\r
+     * Delete contact.\r
+     *\r
+     * @param parentcsid the parentcsid\r
+     * @param itemspecifier (shortIdentifier)\r
+     * @param csid the csid\r
+     * @return the client response\r
+     */\r
+    public ClientResponse<Response> deleteContactForNamedItem(\r
+               String parentcsid,\r
+               String itemspecifier,\r
+               String csid);\r
+\r
+    /**\r
+     * Delete contact.\r
+     *\r
+     * @param parentspecifier (shortIdentifier)\r
+     * @param itemcsid the itemcsid\r
+     * @param csid the csid\r
+     * @return the client response\r
+     */\r
+    public ClientResponse<Response> deleteContactInNamedAuthority(\r
+               String parentspecifier,\r
+               String itemcsid,\r
+               String csid);\r
+\r
+    /**\r
+     * Delete contact.\r
+     *\r
+     * @param parentspecifier (shortIdentifier)\r
+     * @param itemspecifier (shortIdentifier)\r
+     * @param csid the csid\r
+     * @return the client response\r
+     */\r
+    public ClientResponse<Response> deleteContactForNamedItemInNamedAuthority(\r
+               String parentspecifier,\r
+               String itemspecifier,\r
+               String csid);\r
+    \r
+}\r
diff --git a/services/contact/client/src/main/java/org/collectionspace/services/client/AuthorityWithContactsClientImpl.java b/services/contact/client/src/main/java/org/collectionspace/services/client/AuthorityWithContactsClientImpl.java
new file mode 100644 (file)
index 0000000..7ef2bde
--- /dev/null
@@ -0,0 +1,321 @@
+package org.collectionspace.services.client;\r
+\r
+import javax.ws.rs.core.Response;\r
+import org.jboss.resteasy.client.ClientResponse;\r
+\r
+import org.collectionspace.services.contact.ContactsCommonList;\r
+import org.collectionspace.services.jaxb.AbstractCommonList;\r
+\r
+public abstract class AuthorityWithContactsClientImpl<TL extends AbstractCommonList, T extends AuthorityWithContactsProxy<TL>>\r
+       extends AuthorityClientImpl<TL, T>\r
+       implements AuthorityWithContactsClient<TL, T> {\r
+       \r
+       @Override\r
+    public ClientResponse<Response> createContact(String parentcsid,\r
+            String itemcsid, PoxPayloadOut xmlPayload) {\r
+        return getProxy().createContact(parentcsid, itemcsid, xmlPayload.getBytes());\r
+    }\r
+    \r
+    /**\r
+     * Creates the contact.\r
+     *\r
+     * @param parentcsid\r
+     * @param itemspecifier (shortIdentifier)\r
+     * @param multipart\r
+     * @return the client response\r
+     */\r
+    @Override\r
+       public ClientResponse<Response> createContactForNamedItem(\r
+               String parentcsid,\r
+               String itemspecifier,\r
+               PoxPayloadOut xmlPayload) {\r
+       return getProxy().createContactForNamedItem(parentcsid, itemspecifier, xmlPayload.getBytes());\r
+    }\r
+    /**\r
+     * Creates the contact.\r
+     *\r
+     * @param parentspecifier (shortIdentifier)\r
+     * @param itemcsid\r
+     * @param multipart\r
+     * @return the client response\r
+     */\r
+    @Override\r
+       public ClientResponse<Response> createContactForItemInNamedAuthority(\r
+               String parentspecifier,\r
+               String itemcsid,\r
+               PoxPayloadOut xmlPayload) {\r
+       return getProxy().createContactForItemInNamedAuthority(parentspecifier,\r
+                       itemcsid, xmlPayload.getBytes());\r
+    }\r
+    /**\r
+     * Creates the contact.\r
+     *\r
+     * @param parentspecifier (shortIdentifier)\r
+     * @param itemspecifier (shortIdentifier)\r
+     * @param multipart\r
+     * @return the client response\r
+     */\r
+    @Override\r
+       public ClientResponse<Response> createContactForNamedItemInNamedAuthority(\r
+               String parentspecifier,\r
+               String itemspecifier,\r
+               PoxPayloadOut xmlPayload) {\r
+       return getProxy().createContactForNamedItemInNamedAuthority(parentspecifier, itemspecifier,\r
+                       xmlPayload.getBytes());\r
+    }\r
+    \r
+    /**\r
+     * Read contact.\r
+     *\r
+     * @param parentcsid the parentcsid\r
+     * @param itemcsid the itemcsid\r
+     * @param csid the csid\r
+     * @return the client response\r
+     */\r
+    @Override\r
+       public ClientResponse<String> readContact(String parentcsid,\r
+            String itemcsid, String csid) {\r
+        return getProxy().readContact(parentcsid, itemcsid, csid);\r
+    }\r
+    \r
+    /**\r
+     * Read contact.\r
+     *\r
+     * @param parentcsid\r
+     * @param itemspecifier (shortIdentifier)\r
+     * @param csid\r
+     * @return the client response\r
+     */\r
+    @Override\r
+       public ClientResponse<String> readContactForNamedItem(\r
+               String parentcsid,\r
+               String itemspecifier,\r
+               String csid){\r
+       return getProxy().readContactForNamedItem(parentcsid, itemspecifier, csid);\r
+    }\r
+\r
+    /**\r
+     * Read contact.\r
+     *\r
+     * @param parentspecifier (shortIdentifier)\r
+     * @param itemcsid\r
+     * @param csid\r
+     * @return the client response\r
+     */\r
+    @Override\r
+       public ClientResponse<String> readContactInNamedAuthority(\r
+               String parentspecifier,\r
+               String itemcsid,\r
+               String csid){\r
+       return getProxy().readContactInNamedAuthority(parentspecifier, itemcsid, csid);\r
+    }\r
+\r
+    /**\r
+     * Read contact.\r
+     *\r
+     * @param parentspecifier (shortIdentifier)\r
+     * @param itemspecifier (shortIdentifier)\r
+     * @param csid\r
+     * @return the client response\r
+     */\r
+    @Override\r
+       public ClientResponse<String> readContactForNamedItemInNamedAuthority(\r
+               String parentspecifier,\r
+               String itemspecifier,\r
+               String csid){\r
+       return getProxy().readContactForNamedItemInNamedAuthority(parentspecifier, itemspecifier, csid);\r
+    }\r
+            \r
+\r
+    /**\r
+     * Read contact list.\r
+     *\r
+     * @param parentcsid the parentcsid\r
+     * @param itemcsid the itemcsid\r
+     * @return the client response\r
+     */\r
+    @Override\r
+       public ClientResponse<ContactsCommonList> readContactList(String parentcsid,\r
+            String itemcsid) {\r
+        return getProxy().readContactList(parentcsid, itemcsid);\r
+    }\r
+    \r
+    /**\r
+     * Read contact list.\r
+     *\r
+     * @param parentcsid\r
+     * @param itemspecifier (shortIdentifier)\r
+     * @return the client response\r
+     */\r
+    @Override\r
+       public ClientResponse<ContactsCommonList> readContactListForNamedItem(\r
+               String parentcsid,\r
+               String itemspecifier){\r
+       return getProxy().readContactList(parentcsid, itemspecifier);\r
+    }\r
+\r
+    /**\r
+     * Read contact list.\r
+     *\r
+     * @param parentspecifier (shortIdentifier)\r
+     * @param itemcsid\r
+     * @return the client response\r
+     */\r
+    @Override\r
+       public ClientResponse<ContactsCommonList> readContactListForItemInNamedAuthority(\r
+               String parentspecifier,\r
+               String itemcsid){\r
+       return getProxy().readContactList(parentspecifier, itemcsid);\r
+    }\r
+\r
+    /**\r
+     * Read contact list.\r
+     *\r
+     * @param parentspecifier (shortIdentifier)\r
+     * @param itemspecifier (shortIdentifier)\r
+     * @return the client response\r
+     */\r
+    @Override\r
+       public ClientResponse<ContactsCommonList> readContactListForNamedItemInNamedAuthority(\r
+               String parentspecifier,\r
+               String itemspecifier){\r
+       return getProxy().readContactList(parentspecifier, itemspecifier);\r
+    }\r
+\r
+    /**\r
+     * Update contact.\r
+     *\r
+     * @param parentcsid the parentcsid\r
+     * @param itemcsid the itemcsid\r
+     * @param csid the csid\r
+     * @param multipart the multipart\r
+     * @return the client response\r
+     */\r
+    @Override\r
+       public ClientResponse<String> updateContact(String parentcsid,\r
+            String itemcsid, String csid, PoxPayloadOut xmlPayload) {\r
+        return getProxy().updateContact(parentcsid, itemcsid, csid, xmlPayload.getBytes());\r
+    }\r
+    \r
+    /**\r
+     * Update contact.\r
+     *\r
+     * @param parentcsid the parentcsid\r
+     * @param itemspecifier (shortIdentifier)\r
+     * @param csid the csid\r
+     * @param multipart the multipart\r
+     * @return the client response\r
+     */\r
+    @Override\r
+       public ClientResponse<String> updateContactForNamedItem(\r
+               String parentcsid,\r
+               String itemspecifier,\r
+               String csid,\r
+               PoxPayloadOut xmlPayload) {\r
+       return getProxy().updateContactForNamedItem(parentcsid, itemspecifier, csid, xmlPayload.getBytes());\r
+    }\r
+\r
+    /**\r
+     * Update contact.\r
+     *\r
+     * @param parentspecifier (shortIdentifier)\r
+     * @param itemcsid the itemcsid\r
+     * @param csid the csid\r
+     * @param multipart the multipart\r
+     * @return the client response\r
+     */\r
+    @Override\r
+       public ClientResponse<String> updateContactInNamedAuthority(\r
+               String parentspecifier,\r
+               String itemcsid,\r
+               String csid,\r
+               PoxPayloadOut xmlPayload) {\r
+       return getProxy().updateContactInNamedAuthority(parentspecifier, itemcsid, csid, xmlPayload.getBytes());\r
+    }\r
+\r
+    /**\r
+     * Update contact.\r
+     *\r
+     * @param parentspecifier (shortIdentifier)\r
+     * @param itemspecifier (shortIdentifier)\r
+     * @param csid the csid\r
+     * @param multipart the multipart\r
+     * @return the client response\r
+     */\r
+    @Override\r
+       public ClientResponse<String> updateContactForNamedItemInNamedAuthority(\r
+               String parentspecifier,\r
+               String itemspecifier,\r
+               String csid,\r
+               PoxPayloadOut xmlPayload) {\r
+       return getProxy().updateContactForNamedItemInNamedAuthority(parentspecifier, itemspecifier, csid,\r
+                       xmlPayload.getBytes());\r
+    }\r
+\r
+    /**\r
+     * Delete contact.\r
+     *\r
+     * @param parentcsid the parentcsid\r
+     * @param itemcsid the itemcsid\r
+     * @param csid the csid\r
+     * @return the client response\r
+     */\r
+    @Override\r
+       public ClientResponse<Response> deleteContact(String parentcsid,\r
+        String itemcsid, String csid) {\r
+        return getProxy().deleteContact(parentcsid,\r
+            itemcsid, csid);\r
+    }\r
+    \r
+    /**\r
+     * Delete contact.\r
+     *\r
+     * @param parentcsid the parentcsid\r
+     * @param itemspecifier (shortIdentifier)\r
+     * @param csid the csid\r
+     * @return the client response\r
+     */\r
+    @Override\r
+       public ClientResponse<Response> deleteContactForNamedItem(\r
+               String parentcsid,\r
+               String itemspecifier,\r
+               String csid) {\r
+       return getProxy().deleteContactForNamedItem(parentcsid,\r
+                       itemspecifier, csid);\r
+    }\r
+\r
+    /**\r
+     * Delete contact.\r
+     *\r
+     * @param parentspecifier (shortIdentifier)\r
+     * @param itemcsid the itemcsid\r
+     * @param csid the csid\r
+     * @return the client response\r
+     */\r
+    @Override\r
+       public ClientResponse<Response> deleteContactInNamedAuthority(\r
+               String parentspecifier,\r
+               String itemcsid,\r
+               String csid) {\r
+       return getProxy().deleteContactInNamedAuthority(parentspecifier,\r
+                       itemcsid, csid);\r
+    }\r
+\r
+    /**\r
+     * Delete contact.\r
+     *\r
+     * @param parentspecifier (shortIdentifier)\r
+     * @param itemspecifier (shortIdentifier)\r
+     * @param csid the csid\r
+     * @return the client response\r
+     */\r
+    @Override\r
+       public ClientResponse<Response> deleteContactForNamedItemInNamedAuthority(\r
+               String parentspecifier,\r
+               String itemspecifier,\r
+               String csid) {\r
+       return getProxy().deleteContactForNamedItemInNamedAuthority(parentspecifier,\r
+                       itemspecifier, csid);\r
+    }\r
+    \r
+}\r
diff --git a/services/contact/client/src/main/java/org/collectionspace/services/client/AuthorityWithContactsProxy.java b/services/contact/client/src/main/java/org/collectionspace/services/client/AuthorityWithContactsProxy.java
new file mode 100644 (file)
index 0000000..2541e89
--- /dev/null
@@ -0,0 +1,153 @@
+package org.collectionspace.services.client;\r
+\r
+import javax.ws.rs.DELETE;\r
+import javax.ws.rs.GET;\r
+import javax.ws.rs.POST;\r
+import javax.ws.rs.PUT;\r
+import javax.ws.rs.Path;\r
+import javax.ws.rs.PathParam;\r
+import javax.ws.rs.Produces;\r
+import javax.ws.rs.core.Response;\r
+\r
+import org.collectionspace.services.contact.ContactsCommonList;\r
+import org.collectionspace.services.jaxb.AbstractCommonList;\r
+import org.jboss.resteasy.client.ClientResponse;\r
+\r
+public interface AuthorityWithContactsProxy<TL extends AbstractCommonList> extends AuthorityProxy<TL> {\r
+    @GET\r
+    @Produces({"application/xml"})\r
+    @Path("/{parentcsid}/items/{itemcsid}/contacts/")\r
+    public ClientResponse<ContactsCommonList> readContactList(\r
+            @PathParam("parentcsid") String parentcsid,\r
+            @PathParam("itemcsid") String itemcsid);\r
+\r
+    @GET\r
+    @Produces({"application/xml"})\r
+    @Path("/{parentcsid}/items/urn:cspace:name({itemspecifier})/contacts/")\r
+    ClientResponse<ContactsCommonList> readContactListForNamedItem(\r
+            @PathParam("parentcsid") String parentcsid,\r
+            @PathParam("itemspecifier") String itemspecifier);\r
+    \r
+    @GET\r
+    @Produces({"application/xml"})\r
+    @Path("/urn:cspace:name({parentspecifier})/items/{itemcsid}/contacts/")\r
+    ClientResponse<ContactsCommonList> readContactListForItemInNamedAuthority(\r
+            @PathParam("parentspecifier") String parentspecifier,\r
+            @PathParam("itemcsid") String itemcsid);\r
+    @GET\r
+    @Produces({"application/xml"})\r
+    @Path("/urn:cspace:name({parentspecifier})/items/urn:cspace:name({itemspecifier})/contacts/")\r
+    ClientResponse<ContactsCommonList> readContactListForNamedItemInNamedAuthority(\r
+            @PathParam("parentspecifier") String parentspecifier,\r
+            @PathParam("itemspecifier") String itemspecifier);\r
+\r
+    //(C)reate Contact\r
+    @POST\r
+    @Path("/{parentcsid}/items/{itemcsid}/contacts/")\r
+    ClientResponse<Response> createContact(\r
+            @PathParam("parentcsid") String parentcsid,\r
+            @PathParam("itemcsid") String itemcsid,\r
+            byte[] xmlPayload);\r
+    @POST\r
+    @Path("/{parentcsid}/items/urn:cspace:name({itemspecifier})/contacts/")\r
+    ClientResponse<Response> createContactForNamedItem(\r
+            @PathParam("parentcsid") String parentcsid,\r
+            @PathParam("itemspecifier") String itemspecifier,\r
+            byte[] xmlPayload);\r
+    @POST\r
+    @Path("/urn:cspace:name({parentspecifier})/items/{itemcsid}/contacts/")\r
+    ClientResponse<Response> createContactForItemInNamedAuthority(\r
+            @PathParam("parentspecifier") String parentspecifier,\r
+            @PathParam("itemcsid") String itemcsid,\r
+            byte[] xmlPayload);\r
+    @POST\r
+    @Path("/urn:cspace:name({parentspecifier})/items/urn:cspace:name({itemspecifier})/contacts/")\r
+    ClientResponse<Response> createContactForNamedItemInNamedAuthority(\r
+            @PathParam("parentspecifier") String parentspecifier,\r
+            @PathParam("itemspecifier") String itemspecifier,\r
+            byte[] xmlPayload);\r
+\r
+     //(R)ead Contact\r
+    @GET\r
+    @Path("/{parentcsid}/items/{itemcsid}/contacts/{csid}")\r
+    ClientResponse<String> readContact(\r
+            @PathParam("parentcsid") String parentcsid,\r
+            @PathParam("itemcsid") String itemcsid,\r
+            @PathParam("csid") String csid);\r
+    @GET\r
+    @Path("/{parentcsid}/items/urn:cspace:name({itemspecifier})/contacts/{csid}")\r
+    ClientResponse<String> readContactForNamedItem(\r
+            @PathParam("parentcsid") String parentcsid,\r
+            @PathParam("itemspecifier") String itemspecifier,\r
+            @PathParam("csid") String csid);\r
+    @GET\r
+    @Path("/urn:cspace:name({parentspecifier})/items/{itemcsid}/contacts/{csid}")\r
+    ClientResponse<String> readContactInNamedAuthority(\r
+            @PathParam("parentspecifier") String parentspecifier,\r
+            @PathParam("itemcsid") String itemcsid,\r
+            @PathParam("csid") String csid);\r
+    @GET\r
+    @Path("/urn:cspace:name({parentspecifier})/items/urn:cspace:name({itemspecifier})/contacts/{csid}")\r
+    ClientResponse<String> readContactForNamedItemInNamedAuthority(\r
+            @PathParam("parentspecifier") String parentspecifier,\r
+            @PathParam("itemspecifier") String itemspecifier,\r
+            @PathParam("csid") String csid);\r
+\r
+    //(U)pdate Contact\r
+    @PUT\r
+    @Path("/{parentcsid}/items/{itemcsid}/contacts/{csid}")\r
+    ClientResponse<String> updateContact(\r
+            @PathParam("parentcsid") String parentcsid,\r
+            @PathParam("itemcsid") String itemcsid,\r
+            @PathParam("csid") String csid,\r
+            byte[] xmlPayload);\r
+    @PUT\r
+    @Path("/{parentcsid}/items/urn:cspace:name({itemspecifier})/contacts/{csid}")\r
+    ClientResponse<String> updateContactForNamedItem(\r
+            @PathParam("parentcsid") String parentcsid,\r
+            @PathParam("itemspecifier") String itemspecifier,\r
+            @PathParam("csid") String csid,\r
+            byte[] xmlPayload);\r
+    @PUT\r
+    @Path("/urn:cspace:name({parentspecifier})/items/{itemcsid}/contacts/{csid}")\r
+    ClientResponse<String> updateContactInNamedAuthority(\r
+            @PathParam("parentspecifier") String parentspecifier,\r
+            @PathParam("itemcsid") String itemcsid,\r
+            @PathParam("csid") String csid,\r
+            byte[] xmlPayload);\r
+    @PUT\r
+    @Path("/urn:cspace:name({parentspecifier})/items/urn:cspace:name({itemspecifier})/contacts/{csid}")\r
+    ClientResponse<String> updateContactForNamedItemInNamedAuthority(\r
+            @PathParam("parentspecifier") String parentspecifier,\r
+            @PathParam("itemspecifier") String itemspecifier,\r
+            @PathParam("csid") String csid,\r
+            byte[] xmlPayload);\r
+\r
+    //(D)elete Contact\r
+    @DELETE\r
+    @Path("/{parentcsid}/items/{itemcsid}/contacts/{csid}")\r
+    ClientResponse<Response> deleteContact(\r
+            @PathParam("parentcsid") String parentcsid,\r
+            @PathParam("itemcsid") String itemcsid,\r
+            @PathParam("csid") String csid);\r
+    \r
+    @DELETE\r
+    @Path("/{parentcsid}/items/urn:cspace:name({itemspecifier})/contacts/{csid}")\r
+    ClientResponse<Response> deleteContactForNamedItem(\r
+            @PathParam("parentcsid") String parentcsid,\r
+            @PathParam("itemspecifier") String itemspecifier,\r
+            @PathParam("csid") String csid);\r
+    @DELETE\r
+    @Path("/urn:cspace:name({parentspecifier})/items/{itemcsid}/contacts/{csid}")\r
+    ClientResponse<Response> deleteContactInNamedAuthority(\r
+            @PathParam("parentspecifier") String parentspecifier,\r
+            @PathParam("itemcsid") String itemcsid,\r
+            @PathParam("csid") String csid);\r
+    \r
+    @DELETE\r
+    @Path("/urn:cspace:name({parentspecifier})/items/urn:cspace:name({itemspecifier})/contacts/{csid}")\r
+    ClientResponse<Response> deleteContactForNamedItemInNamedAuthority(\r
+            @PathParam("parentspecifier") String parentspecifier,\r
+            @PathParam("itemspecifier") String itemspecifier,\r
+            @PathParam("csid") String csid);\r
+}\r
index ff80b7b92d5a7165ca437e205ef7bf213ed3774a..65e05f3f55ba2959cfad9347a934f40b8ba6820f 100644 (file)
  */
 package org.collectionspace.services.client;
 
-import javax.ws.rs.core.Response;
-
-import org.collectionspace.services.contact.ContactsCommonList;
-
-import org.jboss.resteasy.client.ProxyFactory;
-import org.jboss.resteasy.plugins.providers.RegisterBuiltin;
 import org.jboss.resteasy.client.ClientResponse;
-import org.jboss.resteasy.client.core.executors.ApacheHttpClientExecutor;
-import org.jboss.resteasy.spi.ResteasyProviderFactory;
+import org.collectionspace.services.contact.ContactsCommonList;
 
 /**
  * ContactClient.java
@@ -33,7 +26,7 @@ import org.jboss.resteasy.spi.ResteasyProviderFactory;
  * $LastChangedDate: $
  */
  
-public class ContactClient extends AbstractServiceClientImpl {
+public class ContactClient extends AbstractPoxServiceClientImpl<ContactProxy> {
        public static final String SERVICE_NAME = "contacts";
        public static final String SERVICE_PATH_COMPONENT = SERVICE_NAME;       
        public static final String SERVICE_PATH = "/" + SERVICE_PATH_COMPONENT;
@@ -50,98 +43,20 @@ public class ContactClient extends AbstractServiceClientImpl {
         return SERVICE_PATH_COMPONENT;
        }
 
-       /**
-     *
-     */
-//    private static final ContactClient instance = new ContactClient();
-    
-    /**
-     *
-     */
-    private ContactProxy contactProxy;
-
-    /**
-     *
-     * Default constructor for ContactClient class.
-     *
-     */
-    public ContactClient() {
-        ResteasyProviderFactory factory = ResteasyProviderFactory.getInstance();
-        RegisterBuiltin.register(factory);
-        setProxy();
-    }
-
-    @Override
-    public CollectionSpaceProxy getProxy() {
-       return this.contactProxy;
-    }
-    
-    /**
-     * allow to reset proxy as per security needs
-     */
-    public void setProxy() {
-        if (useAuth()) {
-            contactProxy = ProxyFactory.create(ContactProxy.class,
-                    getBaseURL(), new ApacheHttpClientExecutor(getHttpClient()));
-        } else {
-            contactProxy = ProxyFactory.create(ContactProxy.class,
-                    getBaseURL());
-        }
-    }
-
-    /**
-     * FIXME Comment this
-     *
-     * @return
-     */
-//    public static ContactClient getInstance() {
-//        return instance;
-//    }
+       @Override
+       public Class<ContactProxy> getProxyClass() {
+               return ContactProxy.class;
+       }
 
+       /*
+        * Service calls
+        */
+       
     /**
      * @return
      * @see org.collectionspace.services.client.Contact#getContact()
      */
     public ClientResponse<ContactsCommonList> readList() {
-        return contactProxy.readList();
-    }
-
-    /**
-     * @param csid
-     * @return
-     * @see org.collectionspace.services.client.Contact#getContact(java.lang.String)
-     */
-
-    public ClientResponse<String> read(String csid) {
-        return contactProxy.read(csid);
-    }
-
-    /**
-     * @param contact
-     * @return
-     * @see org.collectionspace.services.client.Contact#createContact(org.collectionspace.services.Contact)
-     */
-    public ClientResponse<Response> create(PoxPayloadOut xmlPayload) {
-        return contactProxy.create(xmlPayload.getBytes());
-    }
-
-    /**
-     * @param csid
-     * @param contact
-     * @return
-     * @see org.collectionspace.services.client.Contact#updateContact(java.lang.Long, org.collectionspace.services.Contact)
-     */
-    public ClientResponse<String> update(String csid, PoxPayloadOut xmlPayload) {
-        return contactProxy.update(csid, xmlPayload.getBytes());
-
-    }
-
-    /**
-     * @param csid
-     * @return
-     * @see org.collectionspace.services.client.Contact#deleteContact(java.lang.Long)
-     */
-    public ClientResponse<Response> delete(String csid) {
-        return contactProxy.delete(csid);
+        return getProxy().readList();
     }
 }
index d62a4ee7a5494beb35d880634a1d648d2e699ec2..e22cc345a1d18e00213d7b65cb76bd44238f3bed 100644 (file)
@@ -1,17 +1,12 @@
 package org.collectionspace.services.client;
 
+import org.jboss.resteasy.client.ClientResponse;
 import javax.ws.rs.Consumes;
-import javax.ws.rs.DELETE;
 import javax.ws.rs.GET;
-import javax.ws.rs.POST;
-import javax.ws.rs.PUT;
 import javax.ws.rs.Path;
-import javax.ws.rs.PathParam;
 import javax.ws.rs.Produces;
-import javax.ws.rs.core.Response;
 
 import org.collectionspace.services.contact.ContactsCommonList;
-import org.jboss.resteasy.client.ClientResponse;
 
 /**
  * @version $Revision:$
@@ -19,27 +14,7 @@ import org.jboss.resteasy.client.ClientResponse;
 @Path(ContactClient.SERVICE_PATH_PROXY)
 @Produces({"application/xml"})
 @Consumes({"application/xml"})
-public interface ContactProxy extends CollectionSpaceProxy {
-
+public interface ContactProxy extends CollectionSpacePoxProxy {
     @GET
     ClientResponse<ContactsCommonList> readList();
-
-    //(C)reate
-    @POST
-    ClientResponse<Response> create(byte[] xmlPayload);
-
-    //(R)ead
-    @GET
-    @Path("/{csid}")
-    ClientResponse<String> read(@PathParam("csid") String csid);
-
-    //(U)pdate
-    @PUT
-    @Path("/{csid}")
-    ClientResponse<String> update(@PathParam("csid") String csid, byte[] xmlPayload);
-
-    //(D)elete
-    @DELETE
-    @Path("/{csid}")
-    ClientResponse<Response> delete(@PathParam("csid") String csid);
 }
index b2fe3d3d689dad11d04bc4302936985dc69341f1..6d5ce8108d0307ff785fd64b3e369913fc711b5c 100644 (file)
@@ -41,6 +41,7 @@ import javax.ws.rs.core.Response;
 import javax.ws.rs.core.UriBuilder;
 import javax.ws.rs.core.UriInfo;
 
+import org.collectionspace.services.client.IQueryManager;
 import org.collectionspace.services.client.PoxPayloadIn;
 import org.collectionspace.services.client.PoxPayloadOut;
 import org.collectionspace.services.common.vocabulary.AuthorityResource;
@@ -69,7 +70,7 @@ import org.collectionspace.services.contact.ContactJAXBSchema;
 import org.collectionspace.services.contact.nuxeo.ContactDocumentModelHandler;
 //import org.collectionspace.services.common.repository.RepositoryClient;
 import org.collectionspace.services.common.security.UnauthorizedException;
-import org.collectionspace.services.common.query.IQueryManager;
+//import org.collectionspace.services.common.query.IQueryManager;
 //import org.collectionspace.services.common.query.QueryManager;
 //import org.collectionspace.services.nuxeo.client.java.RemoteDocumentModelHandlerImpl;
 //import org.jboss.remoting.samples.chat.exceptions.InvalidArgumentException;
index 4f1e9dad3d052a704a5813735a7d389b9e2e88ad..6c2e01ae1cb3081ad9a59ae944fbd75f32c15aa4 100644 (file)
@@ -12,6 +12,7 @@ Require-Bundle: org.nuxeo.runtime,
  org.collectionspace.collectionspace_core\r
 Provide-Package: org.collectionspace.dimension\r
 Nuxeo-Component: OSGI-INF/core-types-contrib.xml,\r
+ OSGI-INF/life-cycle-contrib.xml,\r
  OSGI-INF/ecm-types-contrib.xml,\r
  OSGI-INF/layouts-contrib.xml\r
 \r
diff --git a/services/dimension/3rdparty/nuxeo-platform-cs-dimension/src/main/resources/OSGI-INF/life-cycle-contrib.xml b/services/dimension/3rdparty/nuxeo-platform-cs-dimension/src/main/resources/OSGI-INF/life-cycle-contrib.xml
new file mode 100644 (file)
index 0000000..21e5598
--- /dev/null
@@ -0,0 +1,11 @@
+<?xml version="1.0"?>
+<component name="org.collectionspace.ecm.platform.intake.LifeCycleManagerExtensions">
+
+  <extension target="org.nuxeo.ecm.core.lifecycle.LifeCycleService"
+             point="types">
+    <types>
+      <type name="Dimension">default</type>
+    </types>
+  </extension>
+
+</component>
index 2cbe680850e2610c5e613c48a105354656b7215c..13913149469cb19274c6ed0ab601f5325dffbc08 100644 (file)
  */
 package org.collectionspace.services.client;
 
-import javax.ws.rs.core.Response;
-
-//import org.collectionspace.services.common.context.ServiceContext;
 import org.collectionspace.services.dimension.DimensionsCommonList;
-
-import org.jboss.resteasy.client.ProxyFactory;
-import org.jboss.resteasy.plugins.providers.RegisterBuiltin;
 import org.jboss.resteasy.client.ClientResponse;
-import org.jboss.resteasy.client.core.executors.ApacheHttpClientExecutor;
-//import org.jboss.resteasy.plugins.providers.multipart.MultipartInput;
-//import org.jboss.resteasy.plugins.providers.multipart.MultipartOutput;
-import org.jboss.resteasy.spi.ResteasyProviderFactory;
 
 /**
  * A DimensionClient.
 
  * @version $Revision:$
  */
-public class DimensionClient extends AbstractServiceClientImpl {
+public class DimensionClient extends AbstractPoxServiceClientImpl<DimensionProxy> {
        public static final String SERVICE_NAME = "dimensions";
        public static final String SERVICE_PATH_COMPONENT = SERVICE_NAME;       
        public static final String SERVICE_PATH = "/" + SERVICE_PATH_COMPONENT;
@@ -61,101 +51,18 @@ public class DimensionClient extends AbstractServiceClientImpl {
                return SERVICE_NAME;
        }
        
-       /**
-     *
-     */
-//    private static final DimensionClient instance = new DimensionClient();
-    
-    /**
-     *
-     */
-    private DimensionProxy dimensionProxy;
-
-    /**
-     *
-     * Default constructor for DimensionClient class.
-     *
-     */
-    public DimensionClient() {
-        ResteasyProviderFactory factory = ResteasyProviderFactory.getInstance();
-        RegisterBuiltin.register(factory);
-        setProxy();
-    }
-
-    /* (non-Javadoc)
-     * @see org.collectionspace.services.client.CollectionSpaceClient#getProxy()
-     */
-    @Override
-    public CollectionSpaceProxy getProxy() {
-       return this.dimensionProxy;
-    }
-
-    /**
-     * allow to reset proxy as per security needs
-     */
-    public void setProxy() {
-        if (useAuth()) {
-            dimensionProxy = ProxyFactory.create(DimensionProxy.class,
-                    getBaseURL(), new ApacheHttpClientExecutor(getHttpClient()));
-        } else {
-            dimensionProxy = ProxyFactory.create(DimensionProxy.class,
-                    getBaseURL());
-        }
-    }
-
-    /**
-     * FIXME Comment this
-     *
-     * @return
-     */
-//    public static DimensionClient getInstance() {
-//        return instance;
-//    }
-
-    /**
-     * @return
-     * @see org.collectionspace.services.client.DimensionProxy#getDimension()
-     */
+       @Override
+       public Class<DimensionProxy> getProxyClass() {
+               return DimensionProxy.class;
+       }
+       
+       /*
+        * Proxied service calls
+        */
+       
     public ClientResponse<DimensionsCommonList> readList() {
-        return dimensionProxy.readList();
-    }
-
-    /**
-     * @param csid
-     * @return
-     * @see org.collectionspace.services.client.DimensionProxy#getDimension(java.lang.String)
-     */
-
-    public ClientResponse<String> read(String csid) {
-        return dimensionProxy.read(csid);
-    }
-
-    /**
-     * @param dimension
-     * @return
-     * @see org.collectionspace.services.client.DimensionProxy#createDimension(org.collectionspace.services.Dimension)
-     */
-    public ClientResponse<Response> create(PoxPayloadOut xmlPayload) {
-        return dimensionProxy.create(xmlPayload.getBytes());
-    }
-
-    /**
-     * @param csid
-     * @param dimension
-     * @return
-     * @see org.collectionspace.services.client.DimensionProxy#updateDimension(java.lang.Long, org.collectionspace.services.Dimension)
-     */
-    public ClientResponse<String> update(String csid, PoxPayloadOut xmlPayload) {
-        return dimensionProxy.update(csid, xmlPayload.getBytes());
-    }
-
-    /**
-     * @param csid
-     * @return response
-     * @see org.collectionspace.services.client.DimensionProxy#deleteDimension(java.lang.Long)
-     */
-    @Override
-    public ClientResponse<Response> delete(String csid) {
-        return dimensionProxy.delete(csid);
+       DimensionProxy proxy = (DimensionProxy)getProxy();
+       return proxy.readList();
     }
+    
 }
index 711e57b17154dd15d3ff9738247dcdd07061d056..bfbe7abc2bcaa4ecef71e8ca939251b8182e8691 100644 (file)
@@ -1,14 +1,9 @@
 package org.collectionspace.services.client;
 
 import javax.ws.rs.Consumes;
-import javax.ws.rs.DELETE;
 import javax.ws.rs.GET;
-import javax.ws.rs.POST;
-import javax.ws.rs.PUT;
 import javax.ws.rs.Path;
-import javax.ws.rs.PathParam;
 import javax.ws.rs.Produces;
-import javax.ws.rs.core.Response;
 
 import org.collectionspace.services.dimension.DimensionsCommonList;
 import org.jboss.resteasy.client.ClientResponse;
@@ -19,28 +14,8 @@ import org.jboss.resteasy.client.ClientResponse;
 @Path("/dimensions/")
 @Produces({"application/xml"})
 @Consumes({"application/xml"})
-public interface DimensionProxy extends CollectionSpaceProxy {
-
+public interface DimensionProxy extends CollectionSpacePoxProxy {
     @GET
     @Produces({"application/xml"})
     ClientResponse<DimensionsCommonList> readList();
-
-    //(C)reate
-    @POST
-    ClientResponse<Response> create(byte[] payload);
-
-    //(R)ead
-    @GET
-    @Path("/{csid}")
-    ClientResponse<String> read(@PathParam("csid") String csid);
-
-    //(U)pdate
-    @PUT
-    @Path("/{csid}")
-    ClientResponse<String> update(@PathParam("csid") String csid, byte[] payload);
-
-    //(D)elete
-    @DELETE
-    @Path("/{csid}")
-    ClientResponse<Response> delete(@PathParam("csid") String csid);
 }
index 106320b3db2406d8e32571a7a3728cba4350af83..a33a5d7f3d85764fef8e76217311320157e799cc 100644 (file)
@@ -62,7 +62,6 @@ public class DimensionServiceTest extends AbstractServiceTestImpl {
 
     // Instance variables specific to this test.
     /** The SERVIC e_ pat h_ component. */
-    final String SERVICE_PATH_COMPONENT = "dimensions";
     /** The known resource id. */
     private String knownResourceId = null;
 
@@ -716,7 +715,7 @@ public class DimensionServiceTest extends AbstractServiceTestImpl {
      */
     @Override
     public String getServicePathComponent() {
-        return SERVICE_PATH_COMPONENT;
+        return DimensionClient.SERVICE_PATH_COMPONENT;
     }
 
     /**
index 53e998afd995cff16f0932adb76c86b2e8bbfe54..b4726693f71bfb4825e3c3593355d5f017614b8f 100644 (file)
@@ -1,81 +1,45 @@
 package org.collectionspace.services.client;
 
-import javax.ws.rs.core.Response;
-
-import org.jboss.resteasy.client.ProxyFactory;
-import org.jboss.resteasy.plugins.providers.RegisterBuiltin;
 import org.jboss.resteasy.client.ClientResponse;
-import org.jboss.resteasy.client.core.executors.ApacheHttpClientExecutor;
-import org.jboss.resteasy.spi.ResteasyProviderFactory;
 
 /**
  * An AcquisitionClient.
 
  * @version $Revision:$
  */
-public class IdClient extends AbstractServiceClientImpl {
+public class IdClient extends AbstractServiceClientImpl<IdProxy> {
 
     /* (non-Javadoc)
      * @see org.collectionspace.services.client.BaseServiceClient#getServicePathComponent()
      */
-    public String getServicePathComponent() {
+    @Override
+       public String getServicePathComponent() {
         return "idgenerators";
     }
-    // FIXME: Is the "instance" member still needed/used?
-    /**
-     *
-     */
-//    private static final AcquisitionClient instance = new AcquisitionClient();
-    /**
-     *
-     */
-    private IdProxy idProxy;
 
-    /**
-     *
-     * Default constructor for IntakeClient class.
-     *
-     */
-    public IdClient() {
-        ResteasyProviderFactory factory = ResteasyProviderFactory.getInstance();
-        RegisterBuiltin.register(factory);
-        setProxy();
-    }
+       @Override
+       public String getServiceName() {
+               return null; //FIXME: REM - See http://issues.collectionspace.org/browse/CSPACE-3497
+       }
 
-    @Override
-    public CollectionSpaceProxy getProxy() {
-       return this.idProxy;
-    }
+       @Override
+       public Class<IdProxy> getProxyClass() {
+               return IdProxy.class;
+       }
 
-    /**
-     * allow to reset proxy as per security needs
+       /*
+     * Proxied service calls
      */
-    public void setProxy() {
-        if (useAuth()) {
-            idProxy = ProxyFactory.create(IdProxy.class,
-                    getBaseURL(), new ApacheHttpClientExecutor(getHttpClient()));
-        } else {
-            idProxy = ProxyFactory.create(IdProxy.class,
-                    getBaseURL());
-        }
-    }
-
+    
     public ClientResponse<String> readList() {
-        return idProxy.readList();
+        return getProxy().readList();
     }
 
     public ClientResponse<String> read(String csid) {
-        return idProxy.read(csid);
+        return getProxy().read(csid);
     }
 
     public ClientResponse<String> createId(String csid) {
-        return idProxy.createId(csid);
+        return getProxy().createId(csid);
     }
-
-       @Override
-       public String getServiceName() {
-               // TODO Auto-generated method stub
-               return null; //FIXME: REM - See http://issues.collectionspace.org/browse/CSPACE-3497
-       }
-
 }
index 99def07964c67f4d20c9282c706b96c51a923908..ca016c6d9f1be8e2a105001111e57acb41ae4059 100644 (file)
@@ -6,11 +6,8 @@ import javax.ws.rs.POST;
 import javax.ws.rs.Path;
 import javax.ws.rs.PathParam;
 import javax.ws.rs.Produces;
-import javax.ws.rs.core.Response;
-
 import org.jboss.resteasy.client.ClientResponse;
 
-
 @Path("/idgenerators/")
 @Produces({"application/xml"})
 @Consumes({"text/plain"})
index e6dca8069d9703a251772d3336777dfeafc03b13..7740dcb0d0acdd440a7ee1a252ba597ed91bc13f 100644 (file)
@@ -17,6 +17,7 @@ Require-Bundle: org.nuxeo.runtime,
  org.collectionspace.collectionspace_core\r
 Provide-Package: org.collectionspace.intake\r
 Nuxeo-Component: OSGI-INF/core-types-contrib.xml,\r
+ OSGI-INF/life-cycle-contrib.xml,\r
  OSGI-INF/ecm-types-contrib.xml,\r
  OSGI-INF/layouts-contrib.xml\r
 \r
index f314632a264d94d50c8c76465cb75ab0b8cc7a9e..b72fd72dea4a51569a2a754fa14ef427c11b6814 100644 (file)
@@ -4,7 +4,7 @@
     <schema name="intakes_common" prefix="intakes_common" src="schemas/intakes_common.xsd"/>
   </extension>
   <extension target="org.nuxeo.ecm.core.schema.TypeService" point="doctype">
-    <doctype name="Intake" extends="Document">
+    <doctype name="Intake" extends="CollectionSpaceDocument">
       <schema name="common"/>
       <schema name="dublincore"/>
       <schema name="collectionspace_core"/>
diff --git a/services/intake/3rdparty/nuxeo-platform-cs-intake/src/main/resources/OSGI-INF/life-cycle-contrib.xml b/services/intake/3rdparty/nuxeo-platform-cs-intake/src/main/resources/OSGI-INF/life-cycle-contrib.xml
new file mode 100644 (file)
index 0000000..7e5bd92
--- /dev/null
@@ -0,0 +1,11 @@
+<?xml version="1.0"?>
+<component name="org.collectionspace.ecm.platform.intake.LifeCycleManagerExtensions">
+
+  <extension target="org.nuxeo.ecm.core.lifecycle.LifeCycleService"
+             point="types">
+    <types>
+      <type name="Intake">default</type>
+    </types>
+  </extension>
+
+</component>
index 7c902a9d8099c79679bd3e695c5e8a90ac8987b7..6e82d1a8110f284e278af3eeff861c6b8ba6182c 100644 (file)
  */
 package org.collectionspace.services.client;
 
-//import javax.ws.rs.PathParam;
-import javax.ws.rs.core.Response;
-
-import org.collectionspace.services.common.authorityref.AuthorityRefList;
-//import org.collectionspace.services.common.context.ServiceContext;
-import org.collectionspace.services.intake.IntakesCommonList;
-
-import org.jboss.resteasy.client.ProxyFactory;
-import org.jboss.resteasy.plugins.providers.RegisterBuiltin;
 import org.jboss.resteasy.client.ClientResponse;
-import org.jboss.resteasy.client.core.executors.ApacheHttpClientExecutor;
-//import org.jboss.resteasy.plugins.providers.multipart.MultipartInput;
-//import org.jboss.resteasy.plugins.providers.multipart.MultipartOutput;
-import org.jboss.resteasy.spi.ResteasyProviderFactory;
+import org.collectionspace.services.intake.IntakesCommonList;
 
 /**
  * A IntakeClient.
@@ -47,7 +35,7 @@ import org.jboss.resteasy.spi.ResteasyProviderFactory;
  * @version $Revision:$
  * FIXME: http://issues.collectionspace.org/browse/CSPACE-1684
  */
-public class IntakeClient extends AbstractServiceClientImpl {
+public class IntakeClient extends AbstractPoxServiceClientImpl<IntakeProxy> {
        public static final String SERVICE_NAME = "intakes";
        public static final String SERVICE_PATH_COMPONENT = SERVICE_NAME;       
        public static final String SERVICE_PATH = "/" + SERVICE_PATH_COMPONENT;
@@ -64,102 +52,21 @@ public class IntakeClient extends AbstractServiceClientImpl {
         return SERVICE_PATH_COMPONENT;
     }
 
-    /**
-     *
-     */
-    private IntakeProxy intakeProxy;
-
-    /**
-     *
-     * Default constructor for IntakeClient class.
-     *
-     */
-    public IntakeClient() {
-        ResteasyProviderFactory factory = ResteasyProviderFactory.getInstance();
-        RegisterBuiltin.register(factory);
-        setProxy();
-    }
-
-    @Override
-    public CollectionSpaceProxy getProxy() {
-       return this.intakeProxy;
-    }
-    
-    /**
-     * allow to reset proxy as per security needs
-     */
-    public void setProxy() {
-        if (useAuth()) {
-            intakeProxy = ProxyFactory.create(IntakeProxy.class,
-                    getBaseURL(), new ApacheHttpClientExecutor(getHttpClient()));
-        } else {
-            intakeProxy = ProxyFactory.create(IntakeProxy.class,
-                    getBaseURL());
-        }
-    }
-
-    /**
-     * FIXME Comment this
-     *
-     * @return
-     */
-//    public static IntakeClient getInstance() {
-//        return instance;
-//    }
-
-    /**
+       @Override
+       public Class<IntakeProxy> getProxyClass() {
+               // TODO Auto-generated method stub
+               return IntakeProxy.class;
+       }
+       
+       /*
+        * Proxied service calls
+        */
+       
+       /**
      * @return
      * @see org.collectionspace.services.client.IntakeProxy#getIntake()
      */
     public ClientResponse<IntakesCommonList> readList() {
-        return intakeProxy.readList();
-    }
-    
-    /**
-     * @param csid
-     * @return
-     * @see org.collectionspace.services.client.IntakeProxy#getAuthorityRefs(java.lang.String)
-     */
-    public ClientResponse<AuthorityRefList> getAuthorityRefs(String csid) {
-        return intakeProxy.getAuthorityRefs(csid);
-    }
-
-
-    /**
-     * @param csid
-     * @return
-     * @see org.collectionspace.services.client.IntakeProxy#getIntake(java.lang.String)
-     */
-    public ClientResponse<String> read(String csid) {
-        return intakeProxy.read(csid);
-    }
-
-    /**
-     * @param intake
-     * @return
-     * @see org.collectionspace.services.client.IntakeProxy#createIntake(org.collectionspace.hello.Intake)
-     */
-    public ClientResponse<Response> create(PoxPayloadOut xmlPayload) {
-        return intakeProxy.create(xmlPayload.getBytes());
-    }
-
-    /**
-     * @param csid
-     * @param intake
-     * @return
-     * @see org.collectionspace.services.client.IntakeProxy#updateIntake(java.lang.Long, org.collectionspace.hello.Intake)
-     */
-    public ClientResponse<String> update(String csid, PoxPayloadOut xmlPayload) {
-        return intakeProxy.update(csid, xmlPayload.getBytes());
-
-    }
-
-    /**
-     * @param csid
-     * @return
-     * @see org.collectionspace.services.client.IntakeProxy#deleteIntake(java.lang.Long)
-     */
-    public ClientResponse<Response> delete(String csid) {
-        return intakeProxy.delete(csid);
-    }
+        return getProxy().readList();
+    }    
 }
index 4b68ebdd523083796b4b9e137521997d3eeb0c21..a791a49d18b4e698e918119e45096b0f4823768b 100644 (file)
  */
 package org.collectionspace.services.client;
 
+import org.jboss.resteasy.client.ClientResponse;
 import javax.ws.rs.Consumes;
-import javax.ws.rs.DELETE;
 import javax.ws.rs.GET;
-import javax.ws.rs.POST;
-import javax.ws.rs.PUT;
 import javax.ws.rs.Path;
-import javax.ws.rs.PathParam;
 import javax.ws.rs.Produces;
-import javax.ws.rs.core.Response;
 
-import org.collectionspace.services.common.authorityref.AuthorityRefList;
 import org.collectionspace.services.intake.IntakesCommonList;
-//import org.collectionspace.services.person.PersonsCommonList;
-import org.jboss.resteasy.client.ClientResponse;
-//import org.jboss.resteasy.plugins.providers.multipart.MultipartInput;
-//import org.jboss.resteasy.plugins.providers.multipart.MultipartOutput;
 
 /**
  * @version $Revision:$
@@ -50,7 +41,7 @@ import org.jboss.resteasy.client.ClientResponse;
 @Path(IntakeClient.SERVICE_PATH_PROXY)
 @Produces({"application/xml"})
 @Consumes({"application/xml"})
-public interface IntakeProxy extends CollectionSpaceProxy {
+public interface IntakeProxy extends CollectionSpacePoxProxy {
     /**
      * Read list.
      *
@@ -59,61 +50,4 @@ public interface IntakeProxy extends CollectionSpaceProxy {
     @GET
     @Produces({"application/xml"})
     ClientResponse<IntakesCommonList> readList();
-
-    //(C)reate
-    /**
-     * Creates the.
-     *
-     * @param multipart the multipart
-     * @return the client response
-     */
-    @POST
-    ClientResponse<Response> create(byte[] payload);
-
-    //(R)ead
-    /**
-     * Read.
-     *
-     * @param csid the csid
-     * @return the client response
-     */
-    @GET
-    @Path("/{csid}")
-    ClientResponse<String> read(@PathParam("csid") String csid);
-
-    //(U)pdate
-    /**
-     * Update.
-     *
-     * @param csid the csid
-     * @param multipart the multipart
-     * @return the client response
-     */
-    @PUT
-    @Path("/{csid}")
-    ClientResponse<String> update(@PathParam("csid") String csid, byte[] payload);
-
-    //(D)elete
-    /**
-     * Delete.
-     *
-     * @param csid the csid
-     * @return the client response
-     */
-    @DELETE
-    @Path("/{csid}")
-    ClientResponse<Response> delete(@PathParam("csid") String csid);
-    
-    // List Items
-    /**
-     * Gets the authority refs.
-     *
-     * @param csid the csid
-     * @return the authority refs
-     */
-    @GET
-    @Produces({"application/xml"})
-    @Path("/{csid}/authorityrefs/")
-    ClientResponse<AuthorityRefList> getAuthorityRefs(@PathParam("csid") String csid);
-    
 }
index 33526c666142d3a99cfba35bc07f8e626c77c259..cd90ca77d1e36b7927bb88659975ac935c9553f5 100644 (file)
@@ -41,16 +41,15 @@ import javax.ws.rs.core.Response;
 import javax.ws.rs.core.UriBuilder;
 import javax.ws.rs.core.UriInfo;
 
-//import org.collectionspace.services.collectionobject.CollectionobjectsCommonList;
+import org.collectionspace.services.client.IQueryManager;
 import org.collectionspace.services.client.IntakeClient;
 import org.collectionspace.services.client.PoxPayloadIn;
 import org.collectionspace.services.client.PoxPayloadOut;
 import org.collectionspace.services.common.AbstractMultiPartCollectionSpaceResourceImpl;
 import org.collectionspace.services.common.ClientType;
 import org.collectionspace.services.common.ServiceMain;
+
 import org.collectionspace.services.common.authorityref.AuthorityRefList;
-//import org.collectionspace.services.common.context.MultipartServiceContext;
-//import org.collectionspace.services.common.context.MultipartServiceContextFactory;
 import org.collectionspace.services.common.context.MultipartServiceContextImpl;
 import org.collectionspace.services.common.context.ServiceBindingUtils;
 import org.collectionspace.services.common.context.ServiceContext;
@@ -58,14 +57,9 @@ import org.collectionspace.services.common.document.DocumentFilter;
 import org.collectionspace.services.common.document.DocumentHandler;
 import org.collectionspace.services.common.document.DocumentNotFoundException;
 import org.collectionspace.services.common.document.DocumentWrapper;
-import org.collectionspace.services.common.query.IQueryManager;
 import org.collectionspace.services.common.query.QueryManager;
 import org.collectionspace.services.common.security.UnauthorizedException;
-//import org.collectionspace.services.common.vocabulary.RefNameServiceUtils;
 import org.collectionspace.services.nuxeo.client.java.DocumentModelHandler;
-//import org.collectionspace.services.nuxeo.client.java.RemoteDocumentModelHandlerImpl;
-//import org.jboss.resteasy.plugins.providers.multipart.MultipartInput;
-//import org.jboss.resteasy.plugins.providers.multipart.MultipartOutput;
 import org.jboss.resteasy.util.HttpResponseCodes;
 import org.nuxeo.ecm.core.api.DocumentModel;
 import org.slf4j.Logger;
@@ -167,6 +161,7 @@ public class IntakeResource extends
         }
     }
 
+    
     /**
      * Gets the intake.
      * 
similarity index 99%
rename from services/common/src/main/resources/authorityrefdocs.xsd
rename to services/jaxb/src/main/resources/authorityrefdocs.xsd
index 8bd7ad64231f383c8669da8697b9fb2449486b65..5cd4aa6cdcfe4108f9327a8772fcca1a8625e6c2 100644 (file)
@@ -25,6 +25,7 @@
        >
 
     <!-- This is the base class for paginated lists -->
+       <!--
     <xs:complexType name="abstractCommonList">
         <xs:annotation>
             <xs:appinfo>
@@ -32,6 +33,7 @@
             </xs:appinfo>
         </xs:annotation>
     </xs:complexType>
+    -->
 
        <xs:element name="authority-ref-doc-list">
                <xs:complexType>
diff --git a/services/jaxb/src/main/resources/workflows_common.xsd b/services/jaxb/src/main/resources/workflows_common.xsd
new file mode 100644 (file)
index 0000000..35655b7
--- /dev/null
@@ -0,0 +1,53 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+
+<!--
+    Loan Out schema (XSD)
+    
+    Entity  : Workflow
+    Part    : Common
+    Used for: JAXB binding between XML and Java objects
+
+    $LastChangedRevision: 2316 $
+    $LastChangedDate: 2010-06-02 16:03:51 -0700 (Wed, 02 Jun 2010) $
+-->
+
+<xs:schema 
+  xmlns:xs="http://www.w3.org/2001/XMLSchema"
+  xmlns:jaxb="http://java.sun.com/xml/ns/jaxb"
+  jaxb:version="1.0" elementFormDefault="unqualified"
+  xmlns:ns="http://collectionspace.org/services/workflow"
+  xmlns="http://collectionspace.org/services/workflow"
+  targetNamespace="http://collectionspace.org/services/workflow"
+  version="0.1">
+<!--
+    Avoid XmlRootElement nightmare:
+    See http://weblogs.java.net/blog/kohsuke/archive/2006/03/why_does_jaxb_p.html
+-->    
+    <!-- workflow -->
+    <xs:element name="workflows_common">
+        <xs:complexType>
+            <xs:sequence>
+                <!--  Workflow Information Group -->
+                <xs:element name="lifeCyclePolicy" type="xs:string"/>
+                <xs:element name="currentLifeCycleState" type="xs:string"/>
+                               <xs:element name="allowedStateTransitionList">
+                                       <xs:complexType>
+                                               <xs:sequence>
+                                                       <xs:element name="stateTransition" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
+                                               </xs:sequence>
+                                       </xs:complexType>
+                               </xs:element>
+            </xs:sequence>
+        </xs:complexType>
+    </xs:element>
+    
+       <!--
+    <xs:complexType name="stateTransitionList">
+        <xs:sequence>
+            <xs:element name="stateTransition" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
+        </xs:sequence>
+    </xs:complexType>
+       -->
+    
+</xs:schema>
+
index ef2f339ce9e4bac8081760b790f18654b00f2910..595aba1c05b9e47a4dd0ace6d50e1e02936e1fd8 100644 (file)
  */
 package org.collectionspace.services.client;
 
-import javax.ws.rs.PathParam;
-import javax.ws.rs.core.Response;
-
-import org.collectionspace.services.common.authorityref.AuthorityRefList;
-//import org.collectionspace.services.common.context.ServiceContext;
-import org.collectionspace.services.jaxb.AbstractCommonList;
-
-import org.jboss.resteasy.client.ProxyFactory;
-import org.jboss.resteasy.plugins.providers.RegisterBuiltin;
 import org.jboss.resteasy.client.ClientResponse;
-import org.jboss.resteasy.client.core.executors.ApacheHttpClientExecutor;
-import org.jboss.resteasy.spi.ResteasyProviderFactory;
+import org.collectionspace.services.jaxb.AbstractCommonList;
 
 /**
  * LoaninClient.java
@@ -36,24 +26,10 @@ import org.jboss.resteasy.spi.ResteasyProviderFactory;
  * $LastChangedDate$
  *
  */
-public class LoaninClient extends AbstractServiceClientImpl {
-
-    private LoaninProxy loaninProxy;
+public class LoaninClient extends AbstractPoxServiceClientImpl<LoaninProxy> {
     public static final String SERVICE_NAME = "loansin";
     public static final String SERVICE_PATH_COMPONENT = SERVICE_NAME;
 
-
-    /**
-     *
-     * Default constructor for LoaninClient class.
-     *
-     */
-    public LoaninClient() {
-        ResteasyProviderFactory factory = ResteasyProviderFactory.getInstance();
-        RegisterBuiltin.register(factory);
-        setProxy();
-    }
-
     /* (non-Javadoc)
      * @see org.collectionspace.services.client.AbstractServiceClientImpl#getServicePathComponent()
      */
@@ -62,89 +38,25 @@ public class LoaninClient extends AbstractServiceClientImpl {
         return SERVICE_PATH_COMPONENT;
     }
 
+    @Override
     public String getServiceName() {
         return SERVICE_NAME;
     }
 
-    @Override
-    public CollectionSpaceProxy getProxy() {
-       return this.loaninProxy;
-    }    
+       @Override
+       public Class<LoaninProxy> getProxyClass() {
+               return LoaninProxy.class;
+       }
 
-    /**
-     * allow to reset proxy as per security needs
+    /*
+     * Proxied service calls
      */
-    public void setProxy() {
-        if (useAuth()) {
-            loaninProxy = ProxyFactory.create(LoaninProxy.class,
-                    getBaseURL(), new ApacheHttpClientExecutor(getHttpClient()));
-        } else {
-            loaninProxy = ProxyFactory.create(LoaninProxy.class,
-                    getBaseURL());
-        }
-    }
-
-    /**
-     * FIXME Comment this
-     *
-     * @return
-     */
-//    public static LoaninClient getInstance() {
-//        return instance;
-//    }
 
     /**
      * @return
      * @see org.collectionspace.services.client.LoaninProxy#getLoanin()
      */
     public ClientResponse<AbstractCommonList> readList() {
-        return loaninProxy.readList();
-    }
-    
-    /**
-     * @param csid
-     * @return
-     * @see org.collectionspace.services.client.LoaninProxy#getAuthorityRefs(java.lang.String)
-     */
-    public ClientResponse<AuthorityRefList> getAuthorityRefs(String csid) {
-        return loaninProxy.getAuthorityRefs(csid);
-    }
-
-
-    /**
-     * @param csid
-     * @return
-     * @see org.collectionspace.services.client.LoaninProxy#getLoanin(java.lang.String)
-     */
-    public ClientResponse<String> read(String csid) {
-        return loaninProxy.read(csid);
-    }
-
-    /**
-     * @param loanin
-     * @return
-     * @see org.collectionspace.services.client.LoaninProxy#createLoanin(org.collectionspace.hello.Loanin)
-     */
-    public ClientResponse<Response> create(PoxPayloadOut xmlPayload) {
-        return loaninProxy.create(xmlPayload.getBytes());
-    }
-
-    /**
-     * @param csid
-     * @param loanin
-     * @return
-     * @see org.collectionspace.services.client.LoaninProxy#updateLoanin(java.lang.Long, org.collectionspace.hello.Loanin)
-     */
-    public ClientResponse<String> update(String csid, PoxPayloadOut xmlPayload) {
-        return loaninProxy.update(csid, xmlPayload.getBytes());
-    }
-
-    /**
-     * @param csid
-     * @return
-     * @see org.collectionspace.services.client.LoaninProxy#deleteLoanin(java.lang.Long)
-     */
-    public ClientResponse<Response> delete(String csid) {
-        return loaninProxy.delete(csid);
+        return getProxy().readList();
     }
 }
index 1666703bc98f1d6584d5b207414508fe3870d70c..e193ff5a1bc3f70792e873664d6a291408517bba 100644 (file)
@@ -1,18 +1,12 @@
 package org.collectionspace.services.client;
 
+import org.jboss.resteasy.client.ClientResponse;
 import javax.ws.rs.Consumes;
-import javax.ws.rs.DELETE;
 import javax.ws.rs.GET;
-import javax.ws.rs.POST;
-import javax.ws.rs.PUT;
 import javax.ws.rs.Path;
-import javax.ws.rs.PathParam;
 import javax.ws.rs.Produces;
-import javax.ws.rs.core.Response;
 
-import org.collectionspace.services.common.authorityref.AuthorityRefList;
 import org.collectionspace.services.jaxb.AbstractCommonList;
-import org.jboss.resteasy.client.ClientResponse;
 
 /**
  * @version $Revision$
@@ -20,34 +14,8 @@ import org.jboss.resteasy.client.ClientResponse;
 @Path("/loansin/")
 @Produces({"application/xml;charset=UTF-8"})
 @Consumes({"application/xml"})
-public interface LoaninProxy extends CollectionSpaceProxy {
-
-    //(C)reate
-    @POST
-    ClientResponse<Response> create(byte[] payload);
-
-    //(R)ead
-    @GET
-    @Path("/{csid}")
-    ClientResponse<String> read(@PathParam("csid") String csid);
-
-    //(U)pdate
-    @PUT
-    @Path("/{csid}")
-    ClientResponse<String> update(@PathParam("csid") String csid, byte[] payload);
-
-    //(D)elete
-    @DELETE
-    @Path("/{csid}")
-    ClientResponse<Response> delete(@PathParam("csid") String csid);
-    
+public interface LoaninProxy extends CollectionSpacePoxProxy {    
     // List
     @GET
     ClientResponse<AbstractCommonList> readList();
-
-    // List Authority References
-    @GET
-    @Path("/{csid}/authorityrefs/")
-    ClientResponse<AuthorityRefList> getAuthorityRefs(@PathParam("csid") String csid);
-    
 }
index 29468a7d2a3088cd5c66e69fb1261ac493887697..54dcd6931d0a6c3600fa24b88b8b507761de0a1f 100644 (file)
@@ -42,6 +42,7 @@ import javax.ws.rs.core.UriBuilder;
 import javax.ws.rs.core.UriInfo;
 import javax.xml.parsers.ParserConfigurationException;
 
+import org.collectionspace.services.client.IQueryManager;
 import org.collectionspace.services.client.PoxPayloadIn;
 import org.collectionspace.services.client.PoxPayloadOut;
 import org.collectionspace.services.common.AbstractMultiPartCollectionSpaceResourceImpl;
@@ -57,7 +58,7 @@ import org.collectionspace.services.common.document.DocumentFilter;
 import org.collectionspace.services.common.document.DocumentHandler;
 import org.collectionspace.services.common.document.DocumentNotFoundException;
 import org.collectionspace.services.common.document.DocumentWrapper;
-import org.collectionspace.services.common.query.IQueryManager;
+//import org.collectionspace.services.common.query.IQueryManager;
 import org.collectionspace.services.common.query.QueryManager;
 import org.collectionspace.services.common.security.UnauthorizedException;
 import org.collectionspace.services.common.vocabulary.RefNameServiceUtils;
index 071e4c874a8b0c36ed85588a57789b38e9c2e4d6..8501a4baae5624fba68b7ec70fc96d8fbd32e381 100644 (file)
  */
 package org.collectionspace.services.client;
 
-import javax.ws.rs.core.Response;
-
-import org.collectionspace.services.common.authorityref.AuthorityRefList;
-import org.collectionspace.services.loanout.LoansoutCommonList;
-
-import org.jboss.resteasy.client.ProxyFactory;
-import org.jboss.resteasy.plugins.providers.RegisterBuiltin;
 import org.jboss.resteasy.client.ClientResponse;
-import org.jboss.resteasy.client.core.executors.ApacheHttpClientExecutor;
-import org.jboss.resteasy.spi.ResteasyProviderFactory;
+import org.collectionspace.services.loanout.LoansoutCommonList;
 
 /**
  * LoanoutClient.java
@@ -33,112 +25,38 @@ import org.jboss.resteasy.spi.ResteasyProviderFactory;
  * $LastChangedRevision$
  * $LastChangedDate$
  */
-public class LoanoutClient extends AbstractServiceClientImpl {
+public class LoanoutClient extends AbstractPoxServiceClientImpl<LoanoutProxy> {
        public static final String SERVICE_NAME = "loansout";
        public static final String SERVICE_PATH_COMPONENT = SERVICE_NAME;       
        public static final String SERVICE_PATH = "/" + SERVICE_PATH_COMPONENT;
        public static final String SERVICE_PATH_PROXY = SERVICE_PATH + "/";     
        public static final String SERVICE_PAYLOAD_NAME = SERVICE_NAME;
 
-    private LoanoutProxy loanoutProxy;
-
        @Override
        public String getServiceName() {
                return SERVICE_NAME;
        }
-    
-    /**
-     *
-     * Default constructor for LoanoutClient class.
-     *
-     */
-    public LoanoutClient() {
-        ResteasyProviderFactory factory = ResteasyProviderFactory.getInstance();
-        RegisterBuiltin.register(factory);
-        setProxy();
-    }
-    
-    /* (non-Javadoc)
-     * @see org.collectionspace.services.client.AbstractServiceClientImpl#getServicePathComponent()
-     */
+
     @Override
     public String getServicePathComponent() {
         return SERVICE_PATH_COMPONENT;
     }
 
-    @Override
-    public CollectionSpaceProxy getProxy() {
-       return this.loanoutProxy;
-    }    
+       @Override
+       public Class<LoanoutProxy> getProxyClass() {
+               // TODO Auto-generated method stub
+               return LoanoutProxy.class;
+       }
 
-    /**
-     * allow to reset proxy as per security needs
+       /*
+     * Proxied service calls
      */
-    @Override
-    public void setProxy() {
-        if (useAuth()) {
-            loanoutProxy = ProxyFactory.create(LoanoutProxy.class,
-                    getBaseURL(), new ApacheHttpClientExecutor(getHttpClient()));
-        } else {
-            loanoutProxy = ProxyFactory.create(LoanoutProxy.class,
-                    getBaseURL());
-        }
-    }
 
     /**
      * @return
      * @see org.collectionspace.services.client.LoanoutProxy#getLoanout()
      */
     public ClientResponse<LoansoutCommonList> readList() {
-        return loanoutProxy.readList();
-    }
-    
-    /**
-     * @param csid
-     * @return
-     * @see org.collectionspace.services.client.LoanoutProxy#getAuthorityRefs(java.lang.String)
-     */
-    public ClientResponse<AuthorityRefList> getAuthorityRefs(String csid) {
-        return loanoutProxy.getAuthorityRefs(csid);
-    }
-
-
-    /**
-     * @param csid
-     * @return
-     * @see org.collectionspace.services.client.LoanoutProxy#getLoanout(java.lang.String)
-     */
-    public ClientResponse<String> read(String csid) {
-        return loanoutProxy.read(csid);
-    }
-
-    /**
-     * @param multipart
-     * @return
-     * @see org.collectionspace.services.client.LoanoutProxy#createLoanout(org.collectionspace.hello.Loanout)
-     */
-    public ClientResponse<Response> create(PoxPayloadOut xmlPayload) {
-        return loanoutProxy.create(xmlPayload.getBytes());
-    }
-
-    /**
-     * @param csid
-     * @param multipart
-     * @return
-     * @see org.collectionspace.services.client.LoanoutProxy#updateLoanout(java.lang.Long, org.collectionspace.hello.Loanout)
-     */
-    public ClientResponse<String> update(String csid, PoxPayloadOut xmlPayload) {
-        return loanoutProxy.update(csid, xmlPayload.getBytes());
-
-    }
-
-    /**
-     * @param csid
-     * @return
-     * @see org.collectionspace.services.client.LoanoutProxy#deleteLoanout(java.lang.Long)
-     */
-    @Override
-    public ClientResponse<Response> delete(String csid) {
-        return loanoutProxy.delete(csid);
-    }
+        return getProxy().readList();
+    }    
 }
index b3e18945a57710f8ba8c6e9c9d4f944bcbfb9a35..f97805cab45413b19c2f7c0d5007e71a9a104ece 100644 (file)
@@ -1,18 +1,12 @@
 package org.collectionspace.services.client;
 
+import org.jboss.resteasy.client.ClientResponse;
 import javax.ws.rs.Consumes;
-import javax.ws.rs.DELETE;
 import javax.ws.rs.GET;
-import javax.ws.rs.POST;
-import javax.ws.rs.PUT;
 import javax.ws.rs.Path;
-import javax.ws.rs.PathParam;
 import javax.ws.rs.Produces;
-import javax.ws.rs.core.Response;
 
-import org.collectionspace.services.common.authorityref.AuthorityRefList;
 import org.collectionspace.services.loanout.LoansoutCommonList;
-import org.jboss.resteasy.client.ClientResponse;
 
 /**
  * @version $Revision$
@@ -20,36 +14,9 @@ import org.jboss.resteasy.client.ClientResponse;
 @Path("/loansout/")
 @Produces({"application/xml"})
 @Consumes({"application/xml"})
-public interface LoanoutProxy extends CollectionSpaceProxy {
-
-    //(C)reate
-    @POST
-    ClientResponse<Response> create(byte[] payload);
-
-    //(R)ead
-    @GET
-    @Path("/{csid}")
-    ClientResponse<String> read(@PathParam("csid") String csid);
-
-    //(U)pdate
-    @PUT
-    @Path("/{csid}")
-    ClientResponse<String> update(@PathParam("csid") String csid, byte[] payload);
-
-    //(D)elete
-    @DELETE
-    @Path("/{csid}")
-    ClientResponse<Response> delete(@PathParam("csid") String csid);
-    
+public interface LoanoutProxy extends CollectionSpacePoxProxy {    
     // List
     @GET
     @Produces({"application/xml"})
     ClientResponse<LoansoutCommonList> readList();
-
-    // List Authority References
-    @GET
-    @Produces({"application/xml"})
-    @Path("/{csid}/authorityrefs/")
-    ClientResponse<AuthorityRefList> getAuthorityRefs(@PathParam("csid") String csid);
-    
 }
index 5df1fad8005674d690b36f29e178f4f9c5ca85f3..556ea41fbe7f0b3591612d51eacc7dc8fca9cb37 100644 (file)
@@ -41,6 +41,7 @@ import javax.ws.rs.core.Response;
 import javax.ws.rs.core.UriBuilder;
 import javax.ws.rs.core.UriInfo;
 
+import org.collectionspace.services.client.IQueryManager;
 import org.collectionspace.services.client.PoxPayloadIn;
 import org.collectionspace.services.client.PoxPayloadOut;
 import org.collectionspace.services.common.AbstractMultiPartCollectionSpaceResourceImpl;
@@ -54,7 +55,7 @@ import org.collectionspace.services.common.document.DocumentFilter;
 import org.collectionspace.services.common.document.DocumentHandler;
 import org.collectionspace.services.common.document.DocumentNotFoundException;
 import org.collectionspace.services.common.document.DocumentWrapper;
-import org.collectionspace.services.common.query.IQueryManager;
+//import org.collectionspace.services.common.query.IQueryManager;
 import org.collectionspace.services.common.query.QueryManager;
 import org.collectionspace.services.common.security.UnauthorizedException;
 import org.collectionspace.services.nuxeo.client.java.DocumentModelHandler;
index af2955e876b321846c085c20501a19239c0f5ca9..aa747e47f20b7a12677b1da3a660212a4d574287 100644 (file)
@@ -45,7 +45,7 @@ import org.jboss.resteasy.spi.ResteasyProviderFactory;
 /**
  * The Class LocationAuthorityClient.
  */
-public class LocationAuthorityClient extends AbstractServiceClientImpl {  //FIXME: REM - Client classes for Person, Org, Vocab, and Location should have a common base class
+public class LocationAuthorityClient extends AuthorityClientImpl<LocationsCommonList, LocationAuthorityProxy> {
        public static final String SERVICE_NAME = "locationauthorities";
        public static final String SERVICE_PATH_COMPONENT = SERVICE_NAME;       
        public static final String SERVICE_PATH = "/" + SERVICE_PATH_COMPONENT;
@@ -77,262 +77,21 @@ public class LocationAuthorityClient extends AbstractServiceClientImpl {  //FIXM
     public String getItemCommonPartName() {
         return getCommonPartName(SERVICE_ITEM_NAME);
     }
-    
-    /**
-     *
-     */
-    private LocationAuthorityProxy locationAuthorityProxy;
-
-    /**
-     * Instantiates a new location authority client.
-     */
-    public LocationAuthorityClient() {
-        ResteasyProviderFactory factory = ResteasyProviderFactory.getInstance();
-        RegisterBuiltin.register(factory);
-        setProxy();
-    }
-
-    /* (non-Javadoc)
-     * @see org.collectionspace.services.client.CollectionSpaceClient#getProxy()
-     */
-    @Override
-    public CollectionSpaceProxy getProxy() {
-       return this.locationAuthorityProxy;
-    }    
 
-    /**
-     * Sets the proxy.
-     */
-    public void setProxy() {
-        if (useAuth()) {
-            locationAuthorityProxy = ProxyFactory.create(LocationAuthorityProxy.class,
-                    getBaseURL(), new ApacheHttpClientExecutor(getHttpClient()));
-        } else {
-            locationAuthorityProxy = ProxyFactory.create(LocationAuthorityProxy.class,
-                    getBaseURL());
-        }
-    }
-
-    /**
-     * Read list.
-     *
-     * @return the client response
+       @Override
+       public Class<LocationAuthorityProxy> getProxyClass() {
+               return LocationAuthorityProxy.class;
+       }
+    
+    /*
+     * Proxied service calls.
      */
-
+    
     /**
      * @return list
      * @see org.collectionspace.services.client.LocationAuthorityProxy#readList()
      */
     public ClientResponse<LocationauthoritiesCommonList> readList() {
-        return locationAuthorityProxy.readList();
-    }
-
-    /**
-     * Read.
-     *
-     * @param csid the csid
-     * @return the client response
-     */
-    public ClientResponse<String> read(String csid) {
-        return locationAuthorityProxy.read(csid);
-    }
-
-    /**
-     * Read by name.
-     *
-     * @param name the name
-     * @return the client response
-     */
-    public ClientResponse<String> readByName(String name) {
-        return locationAuthorityProxy.readByName(name);
-    }
-
-    /**
-     * Creates the.
-     *
-     * @param multipart the multipart
-     * @return the client response
-     */
-    public ClientResponse<Response> create(PoxPayloadOut xmlPayload) {
-        return locationAuthorityProxy.create(xmlPayload.getBytes());
-    }
-
-    /**
-     * Update.
-     *
-     * @param csid the csid
-     * @param multipart the multipart
-     * @return the client response
-     */
-    public ClientResponse<String> update(String csid, PoxPayloadOut xmlPayload) {
-        return locationAuthorityProxy.update(csid, xmlPayload.getBytes());
-
-    }
-
-    /**
-     * Delete.
-     *
-     * @param csid the csid
-     * @return the client response
-     */
-    public ClientResponse<Response> delete(String csid) {
-        return locationAuthorityProxy.delete(csid);
-    }
-
-    /**
-     * Read item list, filtering by partial term match, or keywords. Only one of
-     * partialTerm or keywords should be specified. If both are specified, keywords
-     * will be ignored.
-     *
-     * @param inAuthority the parent authority
-     * @param partialTerm A partial term on which to match,
-     *     which will filter list results to return only matched resources.
-     * @param keywords A set of keywords on which to match,
-     *     which will filter list results to return only matched resources.
-     * @return the client response
-     */
-    public ClientResponse<LocationsCommonList> 
-               readItemList(String inAuthority, String partialTerm, String keywords) {
-        return locationAuthorityProxy.readItemList(inAuthority, partialTerm, keywords);
-    }
-
-    /**
-     * Gets the referencing objects.
-     *
-     * @param parentcsid the parentcsid
-     * @param csid the csid
-     * @return the referencing objects
-     */
-    public ClientResponse<AuthorityRefDocList> getReferencingObjects(String parentcsid, String csid) {
-        return locationAuthorityProxy.getReferencingObjects(parentcsid, csid);
-    }
-
-    /**
-     * Read item list for named vocabulary, filtering by partial term match, or keywords. Only one of
-     * partialTerm or keywords should be specified. If both are specified, keywords
-     * will be ignored.
-     *
-     * @param specifier the specifier
-     * @param partialTerm A partial term on which to match,
-     *     which will filter list results to return only matched resources.
-     * @param keywords A set of keywords on which to match,
-     *     which will filter list results to return only matched resources.
-     * @return the client response
-     */
-    public ClientResponse<LocationsCommonList> 
-               readItemListForNamedAuthority(String specifier, String partialTerm, String keywords) {
-        return locationAuthorityProxy.readItemListForNamedAuthority(specifier, partialTerm, keywords);
-    }
-
-    /**
-     * Read item.
-     *
-     * @param vcsid the vcsid
-     * @param csid the csid
-     * @return the client response
-     */
-    public ClientResponse<String> readItem(String vcsid, String csid) {
-        return locationAuthorityProxy.readItem(vcsid, csid);
-    }
-
-    /**
-     * Creates the item.
-     *
-     * @param vcsid the vcsid
-     * @param multipart the multipart
-     * @return the client response
-     */
-    public ClientResponse<Response> createItem(String vcsid, PoxPayloadOut xmlPayload) {
-        return locationAuthorityProxy.createItem(vcsid, xmlPayload.getBytes());
-    }
-
-    /**
-     * Update item.
-     *
-     * @param vcsid the vcsid
-     * @param csid the csid
-     * @param multipart the multipart
-     * @return the client response
-     */
-    public ClientResponse<String> updateItem(String vcsid, String csid, PoxPayloadOut xmlPayload) {
-        return locationAuthorityProxy.updateItem(vcsid, csid, xmlPayload.getBytes());
-
-    }
-
-    /**
-     * Delete item.
-     *
-     * @param vcsid the vcsid
-     * @param csid the csid
-     * @return the client response
-     */
-    public ClientResponse<Response> deleteItem(String vcsid, String csid) {
-        return locationAuthorityProxy.deleteItem(vcsid, csid);
-    }
-
-    /**
-     * Creates the contact.
-     *
-     * @param parentcsid the parentcsid
-     * @param itemcsid the itemcsid
-     * @param multipart the multipart
-     * @return the client response
-     */
-    public ClientResponse<Response> createContact(String parentcsid,
-            String itemcsid, PoxPayloadOut xmlPayload) {
-        return locationAuthorityProxy.createContact(parentcsid, itemcsid, xmlPayload.getBytes());
-    }
-
-    /**
-     * Read contact.
-     *
-     * @param parentcsid the parentcsid
-     * @param itemcsid the itemcsid
-     * @param csid the csid
-     * @return the client response
-     */
-    public ClientResponse<String> readContact(String parentcsid,
-            String itemcsid, String csid) {
-        return locationAuthorityProxy.readContact(parentcsid, itemcsid, csid);
-    }
-
-    /**
-     * Read contact list.
-     *
-     * @param parentcsid the parentcsid
-     * @param itemcsid the itemcsid
-     * @return the client response
-     */
-    public ClientResponse<ContactsCommonList> readContactList(String parentcsid,
-            String itemcsid) {
-        return locationAuthorityProxy.readContactList(parentcsid, itemcsid);
-    }
-
-    /**
-     * Update contact.
-     *
-     * @param parentcsid the parentcsid
-     * @param itemcsid the itemcsid
-     * @param csid the csid
-     * @param multipart the multipart
-     * @return the client response
-     */
-    public ClientResponse<String> updateContact(String parentcsid,
-            String itemcsid, String csid, PoxPayloadOut xmlPayload) {
-        return locationAuthorityProxy.updateContact(parentcsid, itemcsid, csid, xmlPayload.getBytes());
-    }
-
-    /**
-     * Delete contact.
-     *
-     * @param parentcsid the parentcsid
-     * @param itemcsid the itemcsid
-     * @param csid the csid
-     * @return the client response
-     */
-    public ClientResponse<Response> deleteContact(String parentcsid,
-        String itemcsid, String csid) {
-        return locationAuthorityProxy.deleteContact(parentcsid,
-            itemcsid, csid);
+        return getProxy().readList();
     }
 }
index 0c20500f5d3f2218ad1c4bf2987e2d53a497aa7d..95abda7d1ba7da535c48a81f4cfd4ea12654457a 100644 (file)
@@ -1,22 +1,15 @@
 package org.collectionspace.services.client;
 
+import org.jboss.resteasy.client.ClientResponse;
 import javax.ws.rs.Consumes;
-import javax.ws.rs.DELETE;
 import javax.ws.rs.GET;
-import javax.ws.rs.POST;
-import javax.ws.rs.PUT;
 import javax.ws.rs.Path;
 import javax.ws.rs.PathParam;
 import javax.ws.rs.Produces;
 import javax.ws.rs.QueryParam;
-import javax.ws.rs.core.Response;
 
-import org.collectionspace.services.common.query.IQueryManager;
-import org.collectionspace.services.common.authorityref.AuthorityRefDocList;
-import org.collectionspace.services.contact.ContactsCommonList;
 import org.collectionspace.services.location.LocationauthoritiesCommonList;
 import org.collectionspace.services.location.LocationsCommonList;
-import org.jboss.resteasy.client.ClientResponse;
 
 /**
  * @version $Revision:$
@@ -24,126 +17,34 @@ import org.jboss.resteasy.client.ClientResponse;
 @Path(LocationAuthorityClient.SERVICE_PATH + "/")
 @Produces("application/xml")
 @Consumes("application/xml")
-public interface LocationAuthorityProxy extends CollectionSpaceProxy {
+public interface LocationAuthorityProxy extends AuthorityProxy<LocationsCommonList> {
 
     // List Locationauthorities
     @GET
     ClientResponse<LocationauthoritiesCommonList> readList();
-
-    //(C)reate
-    @POST
-    ClientResponse<Response> create(byte[] xmlPayload);
-
-    //(R)ead
-    @GET
-    @Path("/{csid}")
-    ClientResponse<String> read(@PathParam("csid") String csid);
-
-    //(R)ead by name
-    @GET
-    @Path("/urn:cspace:name({name})")
-    ClientResponse<String> readByName(@PathParam("name") String name);
-
-    //(U)pdate
-    @PUT
-    @Path("/{csid}")
-    ClientResponse<String> update(@PathParam("csid") String csid, byte[] xmlPayload);
-
-    //(D)elete
-    @DELETE
-    @Path("/{csid}")
-    ClientResponse<Response> delete(@PathParam("csid") String csid);
-
+    
+    /*
+     * List results that must be overridden for the RESTEasy proxy generation to work correctly.
+     */
+    
     // List Items matching a partial term or keywords.
-    @GET
+    @Override
+       @GET
     @Produces({"application/xml"})
-    @Path("/{vcsid}/items/")
+    @Path("/{csid}/items/")
     ClientResponse<LocationsCommonList> readItemList(
-               @PathParam("vcsid") String vcsid,
+               @PathParam("csid") String vcsid,
             @QueryParam (IQueryManager.SEARCH_TYPE_PARTIALTERM) String partialTerm,
             @QueryParam(IQueryManager.SEARCH_TYPE_KEYWORDS_KW) String keywords);
-
-    /**
-     * @param parentcsid
-     * @param itemcsid
-     * @param csid
-     * @return
-     * @see org.collectionspace.services.client.IntakeProxy#getAuthorityRefs(java.lang.String)
-     */
-    @GET
-    @Path("{csid}/items/{itemcsid}/refObjs")
-    @Produces("application/xml")
-    ClientResponse<AuthorityRefDocList> getReferencingObjects(
-            @PathParam("csid") String parentcsid,
-            @PathParam("itemcsid") String itemcsid);
-
+    
     // List Items for a named authority matching a partial term or keywords.
-    @GET
+    @Override
+       @GET
     @Produces({"application/xml"})
     @Path("/urn:cspace:name({specifier})/items/")
     ClientResponse<LocationsCommonList> readItemListForNamedAuthority(
                @PathParam("specifier") String specifier,
             @QueryParam (IQueryManager.SEARCH_TYPE_PARTIALTERM) String partialTerm,
             @QueryParam(IQueryManager.SEARCH_TYPE_KEYWORDS_KW) String keywords);
-
-    //(C)reate Item
-    @POST
-    @Path("/{vcsid}/items/")
-    ClientResponse<Response> createItem(@PathParam("vcsid") String vcsid, byte[] xmlPayload);
-
-    //(R)ead Item
-    @GET
-    @Path("/{vcsid}/items/{csid}")
-    ClientResponse<String> readItem(@PathParam("vcsid") String vcsid, @PathParam("csid") String csid);
-
-    //(U)pdate Item
-    @PUT
-    @Path("/{vcsid}/items/{csid}")
-    ClientResponse<String> updateItem(@PathParam("vcsid") String vcsid, @PathParam("csid") String csid, byte[] xmlPayload);
-
-    //(D)elete Item
-    @DELETE
-    @Path("/{vcsid}/items/{csid}")
-    ClientResponse<Response> deleteItem(@PathParam("vcsid") String vcsid, @PathParam("csid") String csid);
-
-     // List Contacts
-    @GET
-    @Path("/{parentcsid}/items/{itemcsid}/contacts/")
-    ClientResponse<ContactsCommonList> readContactList(
-            @PathParam("parentcsid") String parentcsid,
-            @PathParam("itemcsid") String itemcsid);
-
-    //(C)reate Contact
-    @POST
-    @Path("/{parentcsid}/items/{itemcsid}/contacts/")
-    ClientResponse<Response> createContact(
-            @PathParam("parentcsid") String parentcsid,
-            @PathParam("itemcsid") String itemcsid,
-            byte[] xmlPayload);
-
-     //(R)ead Contact
-    @GET
-    @Path("/{parentcsid}/items/{itemcsid}/contacts/{csid}")
-    ClientResponse<String> readContact(
-            @PathParam("parentcsid") String parentcsid,
-            @PathParam("itemcsid") String itemcsid,
-            @PathParam("csid") String csid);
-
-    //(U)pdate Contact
-    @PUT
-    @Path("/{parentcsid}/items/{itemcsid}/contacts/{csid}")
-    ClientResponse<String> updateContact(
-            @PathParam("parentcsid") String parentcsid,
-            @PathParam("itemcsid") String itemcsid,
-            @PathParam("csid") String csid,
-            byte[] xmlPayload);
-
-    //(D)elete Contact
-    @DELETE
-    @Path("/{parentcsid}/items/{itemcsid}/contacts/{csid}")
-    ClientResponse<Response> deleteContact(
-            @PathParam("parentcsid") String parentcsid,
-            @PathParam("itemcsid") String itemcsid,
-            @PathParam("csid") String csid);
-
+    
 }
index 84b1f6fb3f1a01b39c1f65c8a777bbaf662b997b..6f780fc3dff3fe09f5b813ff3c7f5b0677d277d7 100644 (file)
@@ -65,7 +65,6 @@ import org.collectionspace.services.common.security.UnauthorizedException;
 import org.collectionspace.services.common.vocabulary.AuthorityResource;
 import org.collectionspace.services.common.vocabulary.RefNameServiceUtils;
 import org.collectionspace.services.common.vocabulary.RefNameUtils;
-import org.collectionspace.services.common.query.IQueryManager;
 import org.collectionspace.services.nuxeo.client.java.RemoteDocumentModelHandlerImpl;
 import org.collectionspace.services.location.nuxeo.LocationDocumentModelHandler;
 import org.jboss.resteasy.util.HttpResponseCodes;
index 6516d2f06a3b8fb5092973eb3fd8fff123667b64..4f18c560331ff18596ee191a4c64c459390a3f92 100644 (file)
  */
 package org.collectionspace.services.client;
 
-import javax.ws.rs.PathParam;
 import javax.ws.rs.core.Response;
-
-import org.collectionspace.services.common.authorityref.AuthorityRefList;
-import org.collectionspace.services.jaxb.AbstractCommonList;
-
-import org.jboss.resteasy.client.ProxyFactory;
-import org.jboss.resteasy.plugins.providers.RegisterBuiltin;
 import org.jboss.resteasy.plugins.providers.multipart.MultipartFormDataOutput;
 import org.jboss.resteasy.client.ClientResponse;
-import org.jboss.resteasy.client.core.executors.ApacheHttpClientExecutor;
-//import org.jboss.resteasy.plugins.providers.multipart.MultipartInput;
-//import org.jboss.resteasy.plugins.providers.multipart.MultipartOutput;
-import org.jboss.resteasy.spi.ResteasyProviderFactory;
+
+import org.collectionspace.services.jaxb.AbstractCommonList;
 
 /**
  * MediaClient.java
@@ -38,7 +29,7 @@ import org.jboss.resteasy.spi.ResteasyProviderFactory;
  * $LastChangedDate: 2010-05-17 18:25:37 -0700 (Mon, 17 May 2010) $
  *
  */
-public class MediaClient extends AbstractServiceClientImpl {
+public class MediaClient extends AbstractPoxServiceClientImpl<MediaProxy> {
        public static final String SERVICE_NAME = "media";
        public static final String SERVICE_PATH_COMPONENT = SERVICE_NAME;       
        public static final String SERVICE_PATH = "/" + SERVICE_PATH_COMPONENT;
@@ -53,77 +44,24 @@ public class MediaClient extends AbstractServiceClientImpl {
     public String getServicePathComponent() {
         return SERVICE_PATH_COMPONENT;
     }
-    
-    /**
-     *
-     */
-    private MediaProxy mediaProxy;
-
-    /**
-     *
-     * Default constructor for MediaClient class.
-     *
-     */
-    public MediaClient() {
-        ResteasyProviderFactory factory = ResteasyProviderFactory.getInstance();
-        RegisterBuiltin.register(factory);
-        setProxy();
-    }
 
-    @Override
-    public CollectionSpaceProxy getProxy() {
-       return this.mediaProxy;
-    }    
-
-    /**
-     * allow to reset proxy as per security needs
-     */
-    public void setProxy() {
-        if (useAuth()) {
-            mediaProxy = ProxyFactory.create(MediaProxy.class,
-                    getBaseURL(), new ApacheHttpClientExecutor(getHttpClient()));
-        } else {
-            mediaProxy = ProxyFactory.create(MediaProxy.class,
-                    getBaseURL());
-        }
-    }
+       @Override
+       public Class<MediaProxy> getProxyClass() {
+               return MediaProxy.class;
+       }
+       
+       /*
+        * Proxied service calls
+        */
 
     /**
      * @return
      * @see org.collectionspace.services.client.MediaProxy#getMedia()
      */
     public ClientResponse<AbstractCommonList> readList() {
-        return mediaProxy.readList();
-    }
-    
-    /**
-     * @param csid
-     * @return
-     * @see org.collectionspace.services.client.MediaProxy#getAuthorityRefs(java.lang.String)
-     */
-    public ClientResponse<AuthorityRefList> getAuthorityRefs(String csid) {
-        return mediaProxy.getAuthorityRefs(csid);
+        return getProxy().readList();
     }
-
-
-    /**
-     * @param csid
-     * @return
-     * @see org.collectionspace.services.client.MediaProxy#getMedia(java.lang.String)
-     */
-    public ClientResponse<String> read(String csid) {
-        return mediaProxy.read(csid);
-    }
-
-    /**
-     * @param media
-     * @return
-     *
-     */
-    public ClientResponse<Response> create(PoxPayloadOut xmlPayload) {
-        return mediaProxy.create(xmlPayload.getBytes());
-    }
-    
+        
     /**
      * @param media
      * @return
@@ -131,7 +69,7 @@ public class MediaClient extends AbstractServiceClientImpl {
      */
     public ClientResponse<Response> createBlobFromFormData(String csid,
                MultipartFormDataOutput formDataOutput) {
-        return mediaProxy.createBlobFromFormData(csid, formDataOutput);
+        return getProxy().createBlobFromFormData(csid, formDataOutput);
     }    
 
     /**
@@ -140,36 +78,16 @@ public class MediaClient extends AbstractServiceClientImpl {
      *
      */
     public ClientResponse<Response> createBlobFromUri(String csid, String blobUri) {
-        return mediaProxy.createBlobFromUri(csid, blobUri);
+        return getProxy().createBlobFromUri(csid, blobUri);
     }    
-    
-    /**
-     * @param csid
-     * @param media
-     * @return
-     */
-    public ClientResponse<String> update(String csid, PoxPayloadOut xmlPayload) {
-        return mediaProxy.update(csid, xmlPayload.getBytes());
-
-    }
-    
+        
     /**
      * @param csid
      * @param media
      * @return
      */
     public ClientResponse<String> update(String csid, PoxPayloadOut xmlPayload, String URI) {
-        return mediaProxy.update(csid, xmlPayload.getBytes());
+        return getProxy().update(csid, xmlPayload.getBytes());
 
     }
-    
-
-    /**
-     * @param csid
-     * @return
-     * @see org.collectionspace.services.client.MediaProxy#deleteMedia(java.lang.Long)
-     */
-    public ClientResponse<Response> delete(String csid) {
-        return mediaProxy.delete(csid);
-    }
 }
index ed931d8d9b690f1f1bfebdffb473a2075bfa4d94..829bd5abf193b6248389cec47d66060c022baaa9 100644 (file)
@@ -1,23 +1,19 @@
 package org.collectionspace.services.client;
 
-import javax.servlet.http.HttpServletRequest;
+import org.jboss.resteasy.client.ClientResponse;
+import org.jboss.resteasy.plugins.providers.multipart.MultipartFormDataOutput;
+
 import javax.ws.rs.Consumes;
-import javax.ws.rs.DELETE;
 import javax.ws.rs.GET;
 import javax.ws.rs.POST;
-import javax.ws.rs.PUT;
 import javax.ws.rs.Path;
 import javax.ws.rs.PathParam;
 import javax.ws.rs.Produces;
 import javax.ws.rs.QueryParam;
-import javax.ws.rs.core.Context;
 import javax.ws.rs.core.Response;
 
-import org.collectionspace.services.common.authorityref.AuthorityRefList;
 import org.collectionspace.services.jaxb.AbstractCommonList;
 import org.collectionspace.services.client.BlobClient;
-import org.jboss.resteasy.client.ClientResponse;
-import org.jboss.resteasy.plugins.providers.multipart.MultipartFormDataOutput;
 
 /**
  * @version $Revision: 2108 $
@@ -25,12 +21,8 @@ import org.jboss.resteasy.plugins.providers.multipart.MultipartFormDataOutput;
 @Path(MediaClient.SERVICE_PATH + "/")
 @Produces("application/xml")
 @Consumes("application/xml")
-public interface MediaProxy extends CollectionSpaceProxy {
+public interface MediaProxy extends CollectionSpacePoxProxy {
 
-    //(C)reate
-    @POST
-    ClientResponse<Response> create(byte[] xmlPayload);
-    
     @POST
     @Path("/{csid}")
     @Consumes("multipart/form-data")
@@ -43,31 +35,9 @@ public interface MediaProxy extends CollectionSpaceProxy {
        @Consumes("application/xml")
     ClientResponse<Response>createBlobFromUri(@PathParam("csid") String csid,
                @QueryParam(BlobClient.BLOB_URI_PARAM) String blobUri);
-
-    //(R)ead
-    @GET
-    @Path("/{csid}")
-    ClientResponse<String> read(@PathParam("csid") String csid);
-
-    //(U)pdate
-    @PUT
-    @Path("/{csid}")
-    ClientResponse<String> update(@PathParam("csid") String csid, byte[] xmlPayload);
-
-    //(D)elete
-    @DELETE
-    @Path("/{csid}")
-    ClientResponse<Response> delete(@PathParam("csid") String csid);
     
     // List
     @GET
     @Produces({"application/xml"})
     ClientResponse<AbstractCommonList> readList();
-
-    // List Authority References
-    @GET
-    @Produces({"application/xml"})
-    @Path("/{csid}/authorityrefs/")
-    ClientResponse<AuthorityRefList> getAuthorityRefs(@PathParam("csid") String csid);
-    
 }
index 89d2ee5065770fc91027aa5d4c147e2ba32adb81..db71e9b6d7941362c7ebdbef38ebfd9f648b54d0 100644 (file)
 
 package org.collectionspace.services.client;
 
-import javax.ws.rs.core.Response;
-
-import org.collectionspace.services.common.authorityref.AuthorityRefList;
-import org.collectionspace.services.movement.MovementsCommonList;
-
-import org.jboss.resteasy.client.ProxyFactory;
-import org.jboss.resteasy.plugins.providers.RegisterBuiltin;
 import org.jboss.resteasy.client.ClientResponse;
-import org.jboss.resteasy.client.core.executors.ApacheHttpClientExecutor;
-import org.jboss.resteasy.spi.ResteasyProviderFactory;
+import org.collectionspace.services.movement.MovementsCommonList;
 
 /**
  * MovementClient.java
@@ -35,63 +27,38 @@ import org.jboss.resteasy.spi.ResteasyProviderFactory;
  * $LastChangedDate$
  *
  */
-public class MovementClient extends AbstractServiceClientImpl {
+public class MovementClient extends AbstractPoxServiceClientImpl<MovementProxy> {
     public static final String SERVICE_NAME = "movements";
        public static final String SERVICE_PATH_COMPONENT = SERVICE_NAME;       
        public static final String SERVICE_PATH = "/" + SERVICE_PATH_COMPONENT;
        public static final String SERVICE_PATH_PROXY = SERVICE_PATH + "/";     
        public static final String SERVICE_PAYLOAD_NAME = SERVICE_NAME;
 
-    private MovementProxy movementProxy;
-    /**
-     *
-     * Default constructor for MovementClient class.
-     *
-     */
-    public MovementClient() {
-        ResteasyProviderFactory factory = ResteasyProviderFactory.getInstance();
-        RegisterBuiltin.register(factory);
-        setProxy();
-    }
-
     @Override
     public String getServiceName() {
         return SERVICE_NAME;
     }
 
-    /* (non-Javadoc)
-     * @see org.collectionspace.services.client.AbstractServiceClientImpl#getServicePathComponent()
-     */
     @Override
     public String getServicePathComponent() {
         return SERVICE_PATH_COMPONENT;
     }
-    
-    @Override
-    public CollectionSpaceProxy getProxy() {
-       return this.movementProxy;
-    }    
 
-    /**
-     * allow to reset proxy as per security needs
-     */
-    @Override
-    public void setProxy() {
-        if (useAuth()) {
-            movementProxy = ProxyFactory.create(MovementProxy.class,
-                    getBaseURL(), new ApacheHttpClientExecutor(getHttpClient()));
-        } else {
-            movementProxy = ProxyFactory.create(MovementProxy.class,
-                    getBaseURL());
-        }
-    }
+       @Override
+       public Class<MovementProxy> getProxyClass() {
+               return MovementProxy.class;
+       }
 
+       /*
+        * Proxied service calls
+        */
+       
     /**
      * @return
      * @see org.collectionspace.services.client.MovementProxy#readList()
      */
     public ClientResponse<MovementsCommonList> readList() {
-        return movementProxy.readList();
+        return getProxy().readList();
     }
 
     /**
@@ -100,7 +67,7 @@ public class MovementClient extends AbstractServiceClientImpl {
      * @see org.collectionspace.services.client.MovementProxy#readList(java.lang.String)
      */
     public ClientResponse<MovementsCommonList> readListSortedBy(String sortFieldName) {
-        return movementProxy.readListSortedBy(sortFieldName);
+        return getProxy().readListSortedBy(sortFieldName);
     }
 
     /**
@@ -110,55 +77,6 @@ public class MovementClient extends AbstractServiceClientImpl {
      * @see org.collectionspace.services.client.MovementProxy#keywordSearchSortedBy(java.lang.String, java.lang.String)
      */
     public ClientResponse<MovementsCommonList> keywordSearchSortedBy(String keywords, String sortFieldName) {
-        return movementProxy.keywordSearchSortedBy(keywords, sortFieldName);
-    }
-    
-    /**
-     * @param csid
-     * @return
-     * @see org.collectionspace.services.client.MovementProxy#getAuthorityRefs(java.lang.String)
-     */
-    public ClientResponse<AuthorityRefList> getAuthorityRefs(String csid) {
-        return movementProxy.getAuthorityRefs(csid);
-    }
-
-
-    /**
-     * @param csid
-     * @return
-     * @see org.collectionspace.services.client.MovementProxy#getMovement(java.lang.String)
-     */
-    public ClientResponse<String> read(String csid) {
-        return movementProxy.read(csid);
-    }
-
-    /**
-     * @param multipart
-     * @return
-     * @see org.collectionspace.services.client.MovementProxy#createMovement(org.collectionspace.hello.Movement)
-     */
-    public ClientResponse<Response> create(PoxPayloadOut xmlPayload) {
-        return movementProxy.create(xmlPayload.getBytes());
-    }
-
-    /**
-     * @param csid
-     * @param multipart
-     * @return
-     * @see org.collectionspace.services.client.MovementProxy#updateMovement(java.lang.Long, org.collectionspace.hello.Movement)
-     */
-    public ClientResponse<String> update(String csid, PoxPayloadOut xmlPayload) {
-        return movementProxy.update(csid, xmlPayload.getBytes());
-
-    }
-
-    /**
-     * @param csid
-     * @return
-     * @see org.collectionspace.services.client.MovementProxy#deleteMovement(java.lang.Long)
-     */
-    @Override
-    public ClientResponse<Response> delete(String csid) {
-        return movementProxy.delete(csid);
-    }
+        return getProxy().keywordSearchSortedBy(keywords, sortFieldName);
+    }    
 }
index d4b90f0b280a0e1f76f9f20d34e87cf3f1512f1d..8c576c6dc622371386046d100e1562140f4c6e80 100644 (file)
 
 package org.collectionspace.services.client;
 
+import org.jboss.resteasy.client.ClientResponse;
 import javax.ws.rs.Consumes;
-import javax.ws.rs.DELETE;
 import javax.ws.rs.GET;
-import javax.ws.rs.POST;
-import javax.ws.rs.PUT;
 import javax.ws.rs.Path;
-import javax.ws.rs.PathParam;
 import javax.ws.rs.Produces;
 import javax.ws.rs.QueryParam;
-import javax.ws.rs.core.Response;
 
-import org.collectionspace.services.common.query.IQueryManager;
-import org.collectionspace.services.common.authorityref.AuthorityRefList;
 import org.collectionspace.services.movement.MovementsCommonList;
-import org.jboss.resteasy.client.ClientResponse;
-
 
 /**
  * MovementProxy.java
@@ -50,27 +42,8 @@ import org.jboss.resteasy.client.ClientResponse;
 @Path("/movements/")
 @Produces("application/xml")
 @Consumes("application/xml")
-public interface MovementProxy extends CollectionSpaceProxy {
-
-    //(C)reate
-    @POST
-    ClientResponse<Response> create(byte[] payload);
-
-    //(R)ead
-    @GET
-    @Path("/{csid}")
-    ClientResponse<String> read(@PathParam("csid") String csid);
+public interface MovementProxy extends CollectionSpacePoxProxy {
 
-    //(U)pdate
-    @PUT
-    @Path("/{csid}")
-    ClientResponse<String> update(@PathParam("csid") String csid, byte[] payload);
-
-    //(D)elete
-    @DELETE
-    @Path("/{csid}")
-    ClientResponse<Response> delete(@PathParam("csid") String csid);
-    
     // List
     @GET
     @Produces({"application/xml"})
@@ -87,11 +60,4 @@ public interface MovementProxy extends CollectionSpaceProxy {
     ClientResponse<MovementsCommonList> keywordSearchSortedBy(
         @QueryParam(IQueryManager.SEARCH_TYPE_KEYWORDS_KW) String keywords,
         @QueryParam(IClientQueryParams.SORT_BY_PARAM) String sortFieldName);
-
-    // List Authority References
-    @GET
-    @Produces({"application/xml"})
-    @Path("/{csid}/authorityrefs/")
-    ClientResponse<AuthorityRefList> getAuthorityRefs(@PathParam("csid") String csid);
-    
 }
index 67759b3a78092d4e9b7cb2b7c1a846e37ee383df..ad709a4f71acc8f3d09a7158e0ebe8c2fb31362f 100644 (file)
@@ -41,6 +41,7 @@ import javax.ws.rs.core.Response;
 import javax.ws.rs.core.UriBuilder;
 import javax.ws.rs.core.UriInfo;
 
+import org.collectionspace.services.client.IQueryManager;
 import org.collectionspace.services.client.PoxPayloadIn;
 import org.collectionspace.services.client.PoxPayloadOut;
 import org.collectionspace.services.common.AbstractMultiPartCollectionSpaceResourceImpl;
@@ -55,7 +56,7 @@ import org.collectionspace.services.common.document.DocumentFilter;
 import org.collectionspace.services.common.document.DocumentHandler;
 import org.collectionspace.services.common.document.DocumentNotFoundException;
 import org.collectionspace.services.common.document.DocumentWrapper;
-import org.collectionspace.services.common.query.IQueryManager;
+//import org.collectionspace.services.common.query.IQueryManager;
 import org.collectionspace.services.common.query.QueryManager;
 import org.collectionspace.services.common.security.UnauthorizedException;
 import org.collectionspace.services.movement.MovementsCommon;
index 6e026b4aeec0fc21695851240de687e2f39d089c..d356897a889484d2f9601de2d200cc5d21f2bbb1 100644 (file)
@@ -33,60 +33,36 @@ import org.jboss.resteasy.spi.ResteasyProviderFactory;
  * $LastChangedDate: $\r
  */\r
  \r
-public class NoteClient extends AbstractServiceClientImpl {\r
+public class NoteClient extends AbstractServiceClientImpl<NoteProxy> {\r
 \r
-    private NoteProxy noteProxy;\r
     public static final String SERVICE_NAME = "notes";\r
     public static final String SERVICE_PATH_COMPONENT = "notes";\r
 \r
-    /**\r
-     *\r
-     * Default constructor for NoteClient class.\r
-     *\r
-     */\r
-    public NoteClient() {\r
-        ResteasyProviderFactory factory = ResteasyProviderFactory.getInstance();\r
-        RegisterBuiltin.register(factory);\r
-        setProxy();\r
-    }\r
-\r
     @Override\r
     public String getServiceName() {\r
             return SERVICE_NAME;\r
     }\r
 \r
-    /* (non-Javadoc)\r
-     * @see org.collectionspace.services.client.BaseServiceClient#getServicePathComponent()\r
-     */\r
     @Override\r
     public String getServicePathComponent() {\r
             return SERVICE_PATH_COMPONENT;\r
     }\r
 \r
-    @Override\r
-    public CollectionSpaceProxy getProxy() {\r
-       return this.noteProxy;\r
-    }\r
-    \r
-    /**\r
-     * allow to reset proxy as per security needs\r
-     */\r
-    public void setProxy() {\r
-        if (useAuth()) {\r
-            noteProxy = ProxyFactory.create(NoteProxy.class,\r
-                    getBaseURL(), new ApacheHttpClientExecutor(getHttpClient()));\r
-        } else {\r
-            noteProxy = ProxyFactory.create(NoteProxy.class,\r
-                    getBaseURL());\r
-        }\r
-    }\r
+       @Override\r
+       public Class<NoteProxy> getProxyClass() {\r
+               return NoteProxy.class;\r
+       }\r
 \r
+       /*\r
+        * Proxied service calls\r
+        */\r
+       \r
     /**\r
      * @return\r
      * @see org.collectionspace.services.client.Note#getNote()\r
      */\r
     public ClientResponse<NotesCommonList> readList() {\r
-        return noteProxy.readList();\r
+        return getProxy().readList();\r
     }\r
 \r
     /**\r
@@ -96,7 +72,7 @@ public class NoteClient extends AbstractServiceClientImpl {
      */\r
 \r
     public ClientResponse<String> read(String csid) {\r
-        return noteProxy.read(csid);\r
+        return getProxy().read(csid);\r
     }\r
 \r
     /**\r
@@ -107,7 +83,7 @@ public class NoteClient extends AbstractServiceClientImpl {
      */\r
     public ClientResponse<Response> create(PoxPayloadOut multipart) {\r
         String payload = multipart.toXML();\r
-        return noteProxy.create(payload);\r
+        return getProxy().create(payload);\r
     }\r
 \r
     /**\r
@@ -118,17 +94,7 @@ public class NoteClient extends AbstractServiceClientImpl {
      */\r
     public ClientResponse<String> update(String csid, PoxPayloadOut multipart) {\r
         String payload = multipart.toXML();\r
-        return noteProxy.update(csid, payload);\r
-\r
-    }\r
+        return getProxy().update(csid, payload);\r
 \r
-    /**\r
-     * @param csid\r
-     * @return\r
-     * @see org.collectionspace.services.client.Note#deleteNote(java.lang.Long)\r
-     */\r
-    @Override\r
-    public ClientResponse<Response> delete(String csid) {\r
-        return noteProxy.delete(csid);\r
     }\r
 }\r
index 21b9991dd905a55b20d6c58e46cb05b701177615..e1a76c6e16453b1c35082906c35d628e9ee00b53 100644 (file)
  */
 package org.collectionspace.services.client;
 
-import javax.ws.rs.PathParam;
-import javax.ws.rs.core.Response;
-
-import org.collectionspace.services.common.authorityref.AuthorityRefList;
 import org.collectionspace.services.jaxb.AbstractCommonList;
-
-import org.jboss.resteasy.client.ProxyFactory;
-import org.jboss.resteasy.plugins.providers.RegisterBuiltin;
 import org.jboss.resteasy.client.ClientResponse;
-import org.jboss.resteasy.client.core.executors.ApacheHttpClientExecutor;
-import org.jboss.resteasy.spi.ResteasyProviderFactory;
 
 /**
  * ObjectExitClient.java
@@ -35,15 +26,11 @@ import org.jboss.resteasy.spi.ResteasyProviderFactory;
  * $LastChangedDate: 2010-05-17 18:25:37 -0700 (Mon, 17 May 2010) $
  *
  */
-public class ObjectExitClient extends AbstractServiceClientImpl {
+public class ObjectExitClient extends AbstractPoxServiceClientImpl<ObjectExitProxy> {
        public static final String SERVICE_NAME = "objectexit";
        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; 
-    /**
-     *
-     */
-    private ObjectExitProxy objectexitProxy;
 
        @Override
        public String getServiceName() {
@@ -54,97 +41,19 @@ public class ObjectExitClient extends AbstractServiceClientImpl {
     public String getServicePathComponent() {
         return SERVICE_PATH_COMPONENT;
     }
-    
-    /**
-     *
-     * Default constructor for ObjectExitClient class.
-     *
-     */
-    public ObjectExitClient() {
-        ResteasyProviderFactory factory = ResteasyProviderFactory.getInstance();
-        RegisterBuiltin.register(factory);
-        setProxy();
-    }
-
-    @Override
-    public CollectionSpaceProxy getProxy() {
-       return this.objectexitProxy;
-    }    
-
-    /**
-     * allow to reset proxy as per security needs
-     */
-    public void setProxy() {
-        if (useAuth()) {
-            objectexitProxy = ProxyFactory.create(ObjectExitProxy.class,
-                    getBaseURL(), new ApacheHttpClientExecutor(getHttpClient()));
-        } else {
-            objectexitProxy = ProxyFactory.create(ObjectExitProxy.class,
-                    getBaseURL());
-        }
-    }
 
-    /**
-     * FIXME Comment this
-     *
-     * @return
-     */
-//    public static ObjectExitClient getInstance() {
-//        return instance;
-//    }
+       @Override
+       public Class<ObjectExitProxy> getProxyClass() {
+               // TODO Auto-generated method stub
+               return ObjectExitProxy.class;
+       }
 
-    /**
-     * @return
-     * @see org.collectionspace.services.client.ObjectExitProxy#getObjectExit()
-     */
+       /*
+        * Proxied service calls.
+        * 
+        */
+       
     public ClientResponse<AbstractCommonList> readList() {
-        return objectexitProxy.readList();
-    }
-    
-    /**
-     * @param csid
-     * @return
-     * @see org.collectionspace.services.client.ObjectExitProxy#getAuthorityRefs(java.lang.String)
-     */
-    public ClientResponse<AuthorityRefList> getAuthorityRefs(String csid) {
-        return objectexitProxy.getAuthorityRefs(csid);
-    }
-
-
-    /**
-     * @param csid
-     * @return
-     * @see org.collectionspace.services.client.ObjectExitProxy#getObjectExit(java.lang.String)
-     */
-    public ClientResponse<String> read(String csid) {
-        return objectexitProxy.read(csid);
-    }
-
-    /**
-     * @param objectexit
-     * @return
-     *
-     */
-    public ClientResponse<Response> create(PoxPayloadOut xmlPayload) {
-        return objectexitProxy.create(xmlPayload.getBytes());
-    }
-
-    /**
-     * @param csid
-     * @param objectexit
-     * @return
-     */
-    public ClientResponse<String> update(String csid, PoxPayloadOut xmlPayload) {
-        return objectexitProxy.update(csid, xmlPayload.getBytes());
-
-    }
-
-    /**
-     * @param csid
-     * @return
-     * @see org.collectionspace.services.client.ObjectExitProxy#deleteObjectExit(java.lang.Long)
-     */
-    public ClientResponse<Response> delete(String csid) {
-        return objectexitProxy.delete(csid);
+        return getProxy().readList();
     }
 }
index 05f63b437da278d712a735454ada88d2db3bc36d..81f8d383a4ee7a134e089f3c6d7cb38ba54c2b4d 100644 (file)
@@ -1,18 +1,12 @@
 package org.collectionspace.services.client;
 
+import org.jboss.resteasy.client.ClientResponse;
 import javax.ws.rs.Consumes;
-import javax.ws.rs.DELETE;
 import javax.ws.rs.GET;
-import javax.ws.rs.POST;
-import javax.ws.rs.PUT;
 import javax.ws.rs.Path;
-import javax.ws.rs.PathParam;
 import javax.ws.rs.Produces;
-import javax.ws.rs.core.Response;
 
-import org.collectionspace.services.common.authorityref.AuthorityRefList;
 import org.collectionspace.services.jaxb.AbstractCommonList;
-import org.jboss.resteasy.client.ClientResponse;
 
 /**
  * @version $Revision: 2108 $
@@ -20,34 +14,8 @@ import org.jboss.resteasy.client.ClientResponse;
 @Path(ObjectExitClient.SERVICE_PATH + "/")
 @Produces({"application/xml"})
 @Consumes({"application/xml"})
-public interface ObjectExitProxy extends CollectionSpaceProxy {
-
-    //(C)reate
-    @POST
-    ClientResponse<Response> create(byte[] xmlPayload);
-
-    //(R)ead
-    @GET
-    @Path("/{csid}")
-    ClientResponse<String> read(@PathParam("csid") String csid);
-
-    //(U)pdate
-    @PUT
-    @Path("/{csid}")
-    ClientResponse<String> update(@PathParam("csid") String csid, byte[] xmlPayload);
-
-    //(D)elete
-    @DELETE
-    @Path("/{csid}")
-    ClientResponse<Response> delete(@PathParam("csid") String csid);
-    
+public interface ObjectExitProxy extends CollectionSpacePoxProxy {
     // List
     @GET
     ClientResponse<AbstractCommonList> readList();
-
-    // List Authority References
-    @GET
-    @Path("/{csid}/authorityrefs/")
-    ClientResponse<AuthorityRefList> getAuthorityRefs(@PathParam("csid") String csid);
-    
 }
index 111c54e59b9540f1249b1c4e269330629e8d2507..a64e1c9bb0da4fc97d29f445f24b704ff43ac9b1 100644 (file)
  * https://source.collectionspace.org/collection-space/LICENSE.txt
  */
 package org.collectionspace.services.client;
+import org.jboss.resteasy.client.ClientResponse;
 
-//import javax.ws.rs.PathParam;
-import javax.ws.rs.core.Response;
-
-import org.collectionspace.services.common.authorityref.AuthorityRefDocList;
-import org.collectionspace.services.common.authorityref.AuthorityRefList;
-import org.collectionspace.services.contact.ContactsCommonList;
 import org.collectionspace.services.organization.OrgauthoritiesCommonList;
 import org.collectionspace.services.organization.OrganizationsCommonList;
 
-import org.jboss.resteasy.client.ClientResponse;
-import org.jboss.resteasy.client.ProxyFactory;
-import org.jboss.resteasy.client.core.executors.ApacheHttpClientExecutor;
-import org.jboss.resteasy.plugins.providers.RegisterBuiltin;
-import org.jboss.resteasy.spi.ResteasyProviderFactory;
-
 /**
  * The Class OrgAuthorityClient.
  */
-public class OrgAuthorityClient extends AbstractServiceClientImpl {
+public class OrgAuthorityClient extends AuthorityWithContactsClientImpl<OrganizationsCommonList, 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;
@@ -72,555 +61,26 @@ public class OrgAuthorityClient extends AbstractServiceClientImpl {
     public String getServicePathComponent() {
         return SERVICE_PATH_COMPONENT;
     }
-
-    /**
-     * Gets the item common part name.
-     *
-     * @return the item common part name
-     */
+       
+       @Override
+       public Class<OrgAuthorityProxy> getProxyClass() {
+               return OrgAuthorityProxy.class;
+       }
+       
     public String getItemCommonPartName() {
         return getCommonPartName(SERVICE_ITEM_NAME);
     }
-    
-    /** The org authority proxy. */
-    private OrgAuthorityProxy orgAuthorityProxy;
 
-    /**
-     * Instantiates a new org authority client.
+    /*
+     * Proxied service call methods
      */
-    public OrgAuthorityClient() {
-        ResteasyProviderFactory factory = ResteasyProviderFactory.getInstance();
-        RegisterBuiltin.register(factory);
-        setProxy();
-    }
-
-    /* (non-Javadoc)
-     * @see org.collectionspace.services.client.CollectionSpaceClient#getProxy()
-     */
-    @Override
-    public CollectionSpaceProxy getProxy() {
-       return this.orgAuthorityProxy;
-    }    
-
-    /**
-     * Sets the proxy.
-     */
-    public void setProxy() {
-        if (useAuth()) {
-            orgAuthorityProxy = ProxyFactory.create(OrgAuthorityProxy.class,
-                    getBaseURL(), new ApacheHttpClientExecutor(getHttpClient()));
-        } else {
-            orgAuthorityProxy = ProxyFactory.create(OrgAuthorityProxy.class,
-                    getBaseURL());
-        }
-    }
-
-    /**
-     * Gets the single instance of OrgAuthorityClient.
-     *
-     * @return single instance of OrgAuthorityClient //FIXME: This is wrong.  There should NOT be a static instance of the client
-     */
-//    public static OrgAuthorityClient getInstance() {
-//        return instance;
-//    }
-
+    
     /**
      * Read list.
      *
      * @return the client response
      */
     public ClientResponse<OrgauthoritiesCommonList> readList() {
-        return orgAuthorityProxy.readList();
-    }
-
-    /**
-     * Read.
-     *
-     * @param csid the csid
-     * @return the client response
-     */
-    public ClientResponse<String> read(String csid) {
-        return orgAuthorityProxy.read(csid);
-    }
-
-    /**
-     * Read by name.
-     *
-     * @param name the name
-     * @return the client response
-     */
-    public ClientResponse<String> readByName(String name) {
-        return orgAuthorityProxy.readByName(name);
-    }
-
-    /**
-     * Creates the.
-     *
-     * @param multipart the multipart
-     * @return the client response
-     */
-    public ClientResponse<Response> create(PoxPayloadOut xmlPayload) {
-        return orgAuthorityProxy.create(xmlPayload.getBytes());
-    }
-
-    /**
-     * Update.
-     *
-     * @param csid the csid
-     * @param multipart the multipart
-     * @return the client response
-     */
-    public ClientResponse<String> update(String csid, PoxPayloadOut xmlPayload) {
-        return orgAuthorityProxy.update(csid, xmlPayload.getBytes());
-
-    }
-
-    /**
-     * Delete.
-     *
-     * @param csid the csid
-     * @return the client response
-     */
-    @Override
-    public ClientResponse<Response> delete(String csid) {
-        return orgAuthorityProxy.delete(csid);
-    }
-
-    /**
-     * Read item list, filtering by partial term match, or keywords. Only one of
-     * partialTerm or keywords should be specified. If both are specified, keywords
-     * will be ignored.
-     *
-     * @param inAuthority the parent authority
-     * @param partialTerm A partial term on which to match,
-     *     which will filter list results to return only matched resources.
-     * @param keywords A set of keywords on which to match,
-     *     which will filter list results to return only matched resources.
-     * @return the client response
-     */
-    public ClientResponse<OrganizationsCommonList> 
-               readItemList(String inAuthority, String partialTerm, String keywords) {
-        return orgAuthorityProxy.readItemList(inAuthority, partialTerm, keywords);
-    }
-    
-    /**
-     * Gets the referencing objects.
-     *
-     * @param parentcsid the parentcsid
-     * @param csid the csid
-     * @return the referencing objects
-     */
-    public ClientResponse<AuthorityRefDocList> getReferencingObjects(String parentcsid, String csid) {
-        return orgAuthorityProxy.getReferencingObjects(parentcsid, csid);
-    }
-    
-
-    /**
-     * Read item list for named vocabulary, filtering by partial term match, or keywords. Only one of
-     * partialTerm or keywords should be specified. If both are specified, keywords
-     * will be ignored.
-     *
-     * @param specifier the specifier
-     * @param partialTerm A partial term on which to match,
-     *     which will filter list results to return only matched resources.
-     * @param keywords A set of keywords on which to match,
-     *     which will filter list results to return only matched resources.
-     * @return the client response
-     */
-    public ClientResponse<OrganizationsCommonList> 
-               readItemListForNamedAuthority(String specifier, String partialTerm, String keywords) {
-        return orgAuthorityProxy.readItemListForNamedAuthority(specifier, partialTerm, keywords);
-    }
-
-    /**
-     * Gets the item authority refs.
-     *
-     * @param parentcsid the parentcsid
-     * @param csid the csid
-     * @return the item authority refs
-     */
-    public ClientResponse<AuthorityRefList> getItemAuthorityRefs(String parentcsid, String csid) {
-        return orgAuthorityProxy.getItemAuthorityRefs(parentcsid, csid);
-    }
-
-    /**
-     * Read item.
-     *
-     * @param vcsid the vcsid
-     * @param csid the csid
-     * @return the client response
-     */
-    public ClientResponse<String> readItem(String vcsid, String csid) {
-        return orgAuthorityProxy.readItem(vcsid, csid);
-    }
-
-    /**
-     * Read named item.
-     *
-     * @param vcsid the vcsid
-     * @param shortId the shortIdentifier
-     * @return the client response
-     */
-    public ClientResponse<String> readNamedItem(String vcsid, String shortId) {
-        return orgAuthorityProxy.readNamedItem(vcsid, shortId);
-    }
-
-    /**
-     * Read item in Named Authority.
-     *
-     * @param authShortId the shortIdentifier for the Authority
-     * @param csid the csid
-     * @return the client response
-     */
-    public ClientResponse<String> readItemInNamedAuthority(String authShortId, String csid) {
-        return orgAuthorityProxy.readItemInNamedAuthority(authShortId, csid);
+        return getProxy().readList();
     }
-
-    /**
-     * Read named item in Named Authority.
-     *
-     * @param authShortId the shortIdentifier for the Authority
-     * @param itemShortId the shortIdentifier for the item
-     * @return the client response
-     */
-    public ClientResponse<String> readNamedItemInNamedAuthority(String authShortId, String itemShortId) {
-        return orgAuthorityProxy.readNamedItemInNamedAuthority(authShortId, itemShortId);
-    }
-
-    /**
-     * Creates the item.
-     *
-     * @param vcsid the vcsid
-     * @param multipart the multipart
-     * @return the client response
-     */
-    public ClientResponse<Response> createItem(String vcsid, PoxPayloadOut multipart) {
-        return orgAuthorityProxy.createItem(vcsid, multipart.getBytes());
-    }
-
-    /**
-     * Update item.
-     *
-     * @param vcsid the vcsid
-     * @param csid the csid
-     * @param multipart the multipart
-     * @return the client response
-     */
-    public ClientResponse<String> updateItem(String vcsid, String csid, PoxPayloadOut xmlPayload) {
-        return orgAuthorityProxy.updateItem(vcsid, csid, xmlPayload.getBytes());
-
-    }
-
-    /**
-     * Delete item.
-     *
-     * @param vcsid the vcsid
-     * @param csid the csid
-     * @return the client response
-     */
-    public ClientResponse<Response> deleteItem(String vcsid, String csid) {
-        return orgAuthorityProxy.deleteItem(vcsid, csid);
-    }
-
-    /***************************************************************************
-     * 
-     * Contact sub-resource interfaces
-     * 
-     ***************************************************************************/
-    
-    /**
-     * Creates the contact.
-     *
-     * @param parentcsid the parentcsid
-     * @param itemcsid the itemcsid
-     * @param multipart the multipart
-     * @return the client response
-     */
-    public ClientResponse<Response> createContact(String parentcsid,
-            String itemcsid, PoxPayloadOut xmlPayload) {
-        return orgAuthorityProxy.createContact(parentcsid, itemcsid, xmlPayload.getBytes());
-    }
-
-    /**
-     * Creates the contact.
-     *
-     * @param parentcsid
-     * @param itemspecifier (shortIdentifier)
-     * @param multipart
-     * @return the client response
-     */
-    public ClientResponse<Response> createContactForNamedItem(
-               String parentcsid,
-               String itemspecifier,
-               PoxPayloadOut xmlPayload) {
-       return orgAuthorityProxy.createContactForNamedItem(parentcsid, itemspecifier, xmlPayload.getBytes());
-    }
-    /**
-     * Creates the contact.
-     *
-     * @param parentspecifier (shortIdentifier)
-     * @param itemcsid
-     * @param multipart
-     * @return the client response
-     */
-    public ClientResponse<Response> createContactForItemInNamedAuthority(
-               String parentspecifier,
-               String itemcsid,
-               PoxPayloadOut xmlPayload) {
-       return orgAuthorityProxy.createContactForItemInNamedAuthority(parentspecifier, itemcsid, xmlPayload.getBytes());
-    }
-    /**
-     * Creates the contact.
-     *
-     * @param parentspecifier (shortIdentifier)
-     * @param itemspecifier (shortIdentifier)
-     * @param multipart
-     * @return the client response
-     */
-    public ClientResponse<Response> createContactForNamedItemInNamedAuthority(
-               String parentspecifier,
-               String itemspecifier,
-               PoxPayloadOut xmlPayload) {
-       return orgAuthorityProxy.createContactForNamedItemInNamedAuthority(parentspecifier, itemspecifier, xmlPayload.getBytes());
-    }
-    
-    /**
-     * Read contact.
-     *
-     * @param parentcsid the parentcsid
-     * @param itemcsid the itemcsid
-     * @param csid the csid
-     * @return the client response
-     */
-    public ClientResponse<String> readContact(String parentcsid,
-            String itemcsid, String csid) {
-        return orgAuthorityProxy.readContact(parentcsid, itemcsid, csid);
-    }
-    
-    /**
-     * Read contact.
-     *
-     * @param parentcsid
-     * @param itemspecifier (shortIdentifier)
-     * @param csid
-     * @return the client response
-     */
-    public ClientResponse<String> readContactForNamedItem(
-               String parentcsid,
-               String itemspecifier,
-               String csid){
-       return orgAuthorityProxy.readContactForNamedItem(parentcsid, itemspecifier, csid);
-    }
-
-    /**
-     * Read contact.
-     *
-     * @param parentspecifier (shortIdentifier)
-     * @param itemcsid
-     * @param csid
-     * @return the client response
-     */
-    public ClientResponse<String> readContactInNamedAuthority(
-               String parentspecifier,
-               String itemcsid,
-               String csid){
-       return orgAuthorityProxy.readContactInNamedAuthority(parentspecifier, itemcsid, csid);
-    }
-
-    /**
-     * Read contact.
-     *
-     * @param parentspecifier (shortIdentifier)
-     * @param itemspecifier (shortIdentifier)
-     * @param csid
-     * @return the client response
-     */
-    public ClientResponse<String> readContactForNamedItemInNamedAuthority(
-               String parentspecifier,
-               String itemspecifier,
-               String csid){
-       return orgAuthorityProxy.readContactForNamedItemInNamedAuthority(parentspecifier, itemspecifier, csid);
-    }
-            
-
-    /**
-     * Read contact list.
-     *
-     * @param parentcsid the parentcsid
-     * @param itemcsid the itemcsid
-     * @return the client response
-     */
-    public ClientResponse<ContactsCommonList> readContactList(String parentcsid,
-            String itemcsid) {
-        return orgAuthorityProxy.readContactList(parentcsid, itemcsid);
-    }
-    
-    /**
-     * Read contact list.
-     *
-     * @param parentcsid
-     * @param itemspecifier (shortIdentifier)
-     * @return the client response
-     */
-    public ClientResponse<ContactsCommonList> readContactListForNamedItem(
-               String parentcsid,
-               String itemspecifier){
-       return orgAuthorityProxy.readContactList(parentcsid, itemspecifier);
-    }
-
-    /**
-     * Read contact list.
-     *
-     * @param parentspecifier (shortIdentifier)
-     * @param itemcsid
-     * @return the client response
-     */
-    public ClientResponse<ContactsCommonList> readContactListForItemInNamedAuthority(
-               String parentspecifier,
-               String itemcsid){
-       return orgAuthorityProxy.readContactList(parentspecifier, itemcsid);
-    }
-
-    /**
-     * Read contact list.
-     *
-     * @param parentspecifier (shortIdentifier)
-     * @param itemspecifier (shortIdentifier)
-     * @return the client response
-     */
-    public ClientResponse<ContactsCommonList> readContactListForNamedItemInNamedAuthority(
-               String parentspecifier,
-               String itemspecifier){
-       return orgAuthorityProxy.readContactList(parentspecifier, itemspecifier);
-    }
-            
-
-    /**
-     * Update contact.
-     *
-     * @param parentcsid the parentcsid
-     * @param itemcsid the itemcsid
-     * @param csid the csid
-     * @param multipart the multipart
-     * @return the client response
-     */
-    public ClientResponse<String> updateContact(String parentcsid,
-            String itemcsid, String csid, PoxPayloadOut xmlPayload) {
-        return orgAuthorityProxy.updateContact(parentcsid, itemcsid, csid, xmlPayload.getBytes());
-    }
-    
-    /**
-     * Update contact.
-     *
-     * @param parentcsid the parentcsid
-     * @param itemspecifier (shortIdentifier)
-     * @param csid the csid
-     * @param multipart the multipart
-     * @return the client response
-     */
-    public ClientResponse<String> updateContactForNamedItem(
-               String parentcsid,
-               String itemspecifier,
-               String csid,
-               PoxPayloadOut xmlPayload) {
-       return orgAuthorityProxy.updateContactForNamedItem(parentcsid, itemspecifier, csid, xmlPayload.getBytes());
-    }
-
-    /**
-     * Update contact.
-     *
-     * @param parentspecifier (shortIdentifier)
-     * @param itemcsid the itemcsid
-     * @param csid the csid
-     * @param multipart the multipart
-     * @return the client response
-     */
-    public ClientResponse<String> updateContactInNamedAuthority(
-               String parentspecifier,
-               String itemcsid,
-               String csid,
-               PoxPayloadOut xmlPayload) {
-       return orgAuthorityProxy.updateContactInNamedAuthority(parentspecifier, itemcsid, csid, xmlPayload.getBytes());
-    }
-
-    /**
-     * Update contact.
-     *
-     * @param parentspecifier (shortIdentifier)
-     * @param itemspecifier (shortIdentifier)
-     * @param csid the csid
-     * @param multipart the multipart
-     * @return the client response
-     */
-    public ClientResponse<String> updateContactForNamedItemInNamedAuthority(
-               String parentspecifier,
-               String itemspecifier,
-               String csid,
-               PoxPayloadOut xmlPayload) {
-       return orgAuthorityProxy.updateContactForNamedItemInNamedAuthority(parentspecifier, itemspecifier, csid, xmlPayload.getBytes());
-    }
-
-
-    /**
-     * Delete contact.
-     *
-     * @param parentcsid the parentcsid
-     * @param itemcsid the itemcsid
-     * @param csid the csid
-     * @return the client response
-     */
-    public ClientResponse<Response> deleteContact(String parentcsid,
-        String itemcsid, String csid) {
-        return orgAuthorityProxy.deleteContact(parentcsid,
-            itemcsid, csid);
-    }
-    
-    /**
-     * Delete contact.
-     *
-     * @param parentcsid the parentcsid
-     * @param itemspecifier (shortIdentifier)
-     * @param csid the csid
-     * @return the client response
-     */
-    public ClientResponse<Response> deleteContactForNamedItem(
-               String parentcsid,
-               String itemspecifier,
-               String csid) {
-       return orgAuthorityProxy.deleteContactForNamedItem(parentcsid,
-                       itemspecifier, csid);
-    }
-
-    /**
-     * Delete contact.
-     *
-     * @param parentspecifier (shortIdentifier)
-     * @param itemcsid the itemcsid
-     * @param csid the csid
-     * @return the client response
-     */
-    public ClientResponse<Response> deleteContactInNamedAuthority(
-               String parentspecifier,
-               String itemcsid,
-               String csid) {
-       return orgAuthorityProxy.deleteContactInNamedAuthority(parentspecifier,
-                       itemcsid, csid);
-    }
-
-    /**
-     * Delete contact.
-     *
-     * @param parentspecifier (shortIdentifier)
-     * @param itemspecifier (shortIdentifier)
-     * @param csid the csid
-     * @return the client response
-     */
-    public ClientResponse<Response> deleteContactForNamedItemInNamedAuthority(
-               String parentspecifier,
-               String itemspecifier,
-               String csid) {
-       return orgAuthorityProxy.deleteContactForNamedItemInNamedAuthority(parentspecifier,
-                       itemspecifier, csid);
-    }
-
 }
index e84136e5706ba92db738b4b2671364881e02312b..7a3c67d8ac30281e9ff015f31461a7395e87fc8d 100644 (file)
@@ -1,23 +1,16 @@
 package org.collectionspace.services.client;
 
 import javax.ws.rs.Consumes;
-import javax.ws.rs.DELETE;
 import javax.ws.rs.GET;
-import javax.ws.rs.POST;
-import javax.ws.rs.PUT;
 import javax.ws.rs.Path;
 import javax.ws.rs.PathParam;
 import javax.ws.rs.Produces;
 import javax.ws.rs.QueryParam;
-import javax.ws.rs.core.Response;
 
-import org.collectionspace.services.common.query.IQueryManager;
-import org.collectionspace.services.common.authorityref.AuthorityRefDocList;
 import org.collectionspace.services.common.authorityref.AuthorityRefList;
-import org.collectionspace.services.contact.ContactsCommonList;
 import org.collectionspace.services.organization.OrgauthoritiesCommonList;
 import org.collectionspace.services.organization.OrganizationsCommonList;
-//import org.collectionspace.services.person.PersonsCommonList;
+import org.collectionspace.services.person.PersonauthoritiesCommonList;
 import org.jboss.resteasy.client.ClientResponse;
 
 /**
@@ -26,243 +19,32 @@ import org.jboss.resteasy.client.ClientResponse;
 @Path(OrgAuthorityClient.SERVICE_PATH + "/")
 @Produces({"application/xml"})
 @Consumes({"application/xml"})
-public interface OrgAuthorityProxy extends CollectionSpaceProxy { //FIXME: REM - Most of the methods in this class and PersonAuthorityProxy are the same and should be moved to a base class
-
+public interface OrgAuthorityProxy extends AuthorityWithContactsProxy<OrganizationsCommonList> {
     // List OrgAuthorities
     @GET
     ClientResponse<OrgauthoritiesCommonList> readList();
-
-    //(C)reate
-    @POST
-    ClientResponse<Response> create(byte[] xmlPayload);
-
-    //(R)ead
-    @GET
-    @Path("/{csid}")
-    ClientResponse<String> read(@PathParam("csid") String csid);
-
-    //(R)ead by name
-    @GET
-    @Path("/urn:cspace:name({name})")
-    ClientResponse<String> readByName(@PathParam("name") String name);
-
-    //(U)pdate
-    @PUT
-    @Path("/{csid}")
-    ClientResponse<String> update(@PathParam("csid") String csid, byte[] xmlPayload);
-
-    //(D)elete
-    @DELETE
-    @Path("/{csid}")
-    ClientResponse<Response> delete(@PathParam("csid") String csid);
-
-    // List Items with options for matching a partial term or keywords.
-    @GET
-    @Produces("application/xml")
+       
+    /*
+     * List results that must be overridden for the RESTEasy proxy generation to work correctly.
+     */
+    
+    // List Items matching a partial term or keywords.
+    @Override
+       @GET
+    @Produces({"application/xml"})
     @Path("/{csid}/items/")
-    ClientResponse<OrganizationsCommonList>readItemList(
-            @PathParam("csid") String parentcsid,
+    ClientResponse<OrganizationsCommonList> readItemList(
+               @PathParam("csid") String vcsid,
             @QueryParam (IQueryManager.SEARCH_TYPE_PARTIALTERM) String partialTerm,
             @QueryParam(IQueryManager.SEARCH_TYPE_KEYWORDS_KW) String keywords);
-
-    /**
-     * @param parentcsid 
-     * @param itemcsid 
-     * @param csid
-     * @return
-     * @see org.collectionspace.services.client.IntakeProxy#getAuthorityRefs(java.lang.String)
-     */
-    @GET
-    @Path("{csid}/items/{itemcsid}/refObjs")
-    @Produces("application/xml")
-    ClientResponse<AuthorityRefDocList> getReferencingObjects(
-            @PathParam("csid") String parentcsid,
-            @PathParam("itemcsid") String itemcsid);    
-
+    
     // List Items for a named authority matching a partial term or keywords.
-    @GET
+    @Override
+       @GET
     @Produces({"application/xml"})
     @Path("/urn:cspace:name({specifier})/items/")
     ClientResponse<OrganizationsCommonList> readItemListForNamedAuthority(
                @PathParam("specifier") String specifier,
             @QueryParam (IQueryManager.SEARCH_TYPE_PARTIALTERM) String partialTerm,
             @QueryParam(IQueryManager.SEARCH_TYPE_KEYWORDS_KW) String keywords);
-
-    // List Item Authority References
-    @GET
-    @Produces({"application/xml"})
-    @Path("/{parentcsid}/items/{itemcsid}/authorityrefs/")
-    public ClientResponse<AuthorityRefList> getItemAuthorityRefs(
-            @PathParam("parentcsid") String parentcsid,
-            @PathParam("itemcsid") String itemcsid);
-
-    //(C)reate Item
-    @POST
-    @Path("/{vcsid}/items/")
-    ClientResponse<Response> createItem(@PathParam("vcsid") String vcsid, byte[] xmlPayload);
-
-    //(R)ead Item
-    @GET
-    @Path("/{vcsid}/items/{csid}")
-    ClientResponse<String> readItem(@PathParam("vcsid") String vcsid, @PathParam("csid") String csid);
-
-    //(R)ead Named Item
-    @GET
-    @Path("/{vcsid}/items/urn:cspace:name({specifier})")
-    ClientResponse<String> readNamedItem(@PathParam("vcsid") String vcsid, @PathParam("specifier") String specifier);
-
-    //(R)ead Item In Named Authority
-    @GET
-    @Path("/urn:cspace:name({specifier})/items/{csid}")
-    ClientResponse<String> readItemInNamedAuthority(@PathParam("specifier") String specifier, @PathParam("csid") String csid);
-
-    //(R)ead Named Item In Named Authority
-    @GET
-    @Path("/urn:cspace:name({specifier})/items/urn:cspace:name({itemspecifier})")
-    ClientResponse<String> readNamedItemInNamedAuthority(@PathParam("specifier") String specifier, @PathParam("itemspecifier") String itemspecifier);
-
-    //(U)pdate Item
-    @PUT
-    @Path("/{vcsid}/items/{csid}")
-    ClientResponse<String> updateItem(@PathParam("vcsid") String vcsid, @PathParam("csid") String csid, byte[] xmlPayload);
-
-    //(D)elete Item
-    @DELETE
-    @Path("/{vcsid}/items/{csid}")
-    ClientResponse<Response> deleteItem(@PathParam("vcsid") String vcsid, @PathParam("csid") String csid);
-
-     // List Contacts
-    @GET
-    @Produces({"application/xml"})
-    @Path("/{parentcsid}/items/{itemcsid}/contacts/")
-    ClientResponse<ContactsCommonList> readContactList(
-            @PathParam("parentcsid") String parentcsid,
-            @PathParam("itemcsid") String itemcsid);
-    @GET
-    @Produces({"application/xml"})
-    @Path("/{parentcsid}/items/urn:cspace:name({itemspecifier})/contacts/")
-    ClientResponse<ContactsCommonList> readContactListForNamedItem(
-            @PathParam("parentcsid") String parentcsid,
-            @PathParam("itemspecifier") String itemspecifier);
-    @GET
-    @Produces({"application/xml"})
-    @Path("/urn:cspace:name({parentspecifier})/items/{itemcsid}/contacts/")
-    ClientResponse<ContactsCommonList> readContactListForItemInNamedAuthority(
-            @PathParam("parentspecifier") String parentspecifier,
-            @PathParam("itemcsid") String itemcsid);
-    @GET
-    @Produces({"application/xml"})
-    @Path("/urn:cspace:name({parentspecifier})/items/urn:cspace:name({itemspecifier})/contacts/")
-    ClientResponse<ContactsCommonList> readContactListForNamedItemInNamedAuthority(
-            @PathParam("parentspecifier") String parentspecifier,
-            @PathParam("itemspecifier") String itemspecifier);
-
-    //(C)reate Contact
-    @POST
-    @Path("/{parentcsid}/items/{itemcsid}/contacts/")
-    ClientResponse<Response> createContact(
-            @PathParam("parentcsid") String parentcsid,
-            @PathParam("itemcsid") String itemcsid,
-            byte[] xmlPayload);
-    @POST
-    @Path("/{parentcsid}/items/urn:cspace:name({itemspecifier})/contacts/")
-    ClientResponse<Response> createContactForNamedItem(
-            @PathParam("parentcsid") String parentcsid,
-            @PathParam("itemspecifier") String itemspecifier,
-            byte[] xmlPayload);
-    @POST
-    @Path("/urn:cspace:name({parentspecifier})/items/{itemcsid}/contacts/")
-    ClientResponse<Response> createContactForItemInNamedAuthority(
-            @PathParam("parentspecifier") String parentspecifier,
-            @PathParam("itemcsid") String itemcsid,
-            byte[] xmlPayload);
-    @POST
-    @Path("/urn:cspace:name({parentspecifier})/items/urn:cspace:name({itemspecifier})/contacts/")
-    ClientResponse<Response> createContactForNamedItemInNamedAuthority(
-            @PathParam("parentspecifier") String parentspecifier,
-            @PathParam("itemspecifier") String itemspecifier,
-            byte[] xmlPayload);
-
-     //(R)ead Contact
-    @GET
-    @Path("/{parentcsid}/items/{itemcsid}/contacts/{csid}")
-    ClientResponse<String> readContact(
-            @PathParam("parentcsid") String parentcsid,
-            @PathParam("itemcsid") String itemcsid,
-            @PathParam("csid") String csid);
-    @GET
-    @Path("/{parentcsid}/items/urn:cspace:name({itemspecifier})/contacts/{csid}")
-    ClientResponse<String> readContactForNamedItem(
-            @PathParam("parentcsid") String parentcsid,
-            @PathParam("itemspecifier") String itemspecifier,
-            @PathParam("csid") String csid);
-    @GET
-    @Path("/urn:cspace:name({parentspecifier})/items/{itemcsid}/contacts/{csid}")
-    ClientResponse<String> readContactInNamedAuthority(
-            @PathParam("parentspecifier") String parentspecifier,
-            @PathParam("itemcsid") String itemcsid,
-            @PathParam("csid") String csid);
-    @GET
-    @Path("/urn:cspace:name({parentspecifier})/items/urn:cspace:name({itemspecifier})/contacts/{csid}")
-    ClientResponse<String> readContactForNamedItemInNamedAuthority(
-            @PathParam("parentspecifier") String parentspecifier,
-            @PathParam("itemspecifier") String itemspecifier,
-            @PathParam("csid") String csid);
-
-    //(U)pdate Contact
-    @PUT
-    @Path("/{parentcsid}/items/{itemcsid}/contacts/{csid}")
-    ClientResponse<String> updateContact(
-            @PathParam("parentcsid") String parentcsid,
-            @PathParam("itemcsid") String itemcsid,
-            @PathParam("csid") String csid,
-            byte[] xmlPayload);
-    @PUT
-    @Path("/{parentcsid}/items/urn:cspace:name({itemspecifier})/contacts/{csid}")
-    ClientResponse<String> updateContactForNamedItem(
-            @PathParam("parentcsid") String parentcsid,
-            @PathParam("itemspecifier") String itemspecifier,
-            @PathParam("csid") String csid,
-            byte[] xmlPayload);
-    @PUT
-    @Path("/urn:cspace:name({parentspecifier})/items/{itemcsid}/contacts/{csid}")
-    ClientResponse<String> updateContactInNamedAuthority(
-            @PathParam("parentspecifier") String parentspecifier,
-            @PathParam("itemcsid") String itemcsid,
-            @PathParam("csid") String csid,
-            byte[] xmlPayload);
-    @PUT
-    @Path("/urn:cspace:name({parentspecifier})/items/urn:cspace:name({itemspecifier})/contacts/{csid}")
-    ClientResponse<String> updateContactForNamedItemInNamedAuthority(
-            @PathParam("parentspecifier") String parentspecifier,
-            @PathParam("itemspecifier") String itemspecifier,
-            @PathParam("csid") String csid,
-            byte[] xmlPayload);
-
-    //(D)elete Contact
-    @DELETE
-    @Path("/{parentcsid}/items/{itemcsid}/contacts/{csid}")
-    ClientResponse<Response> deleteContact(
-            @PathParam("parentcsid") String parentcsid,
-            @PathParam("itemcsid") String itemcsid,
-            @PathParam("csid") String csid);
-    @DELETE
-    @Path("/{parentcsid}/items/urn:cspace:name({itemspecifier})/contacts/{csid}")
-    ClientResponse<Response> deleteContactForNamedItem(
-            @PathParam("parentcsid") String parentcsid,
-            @PathParam("itemspecifier") String itemspecifier,
-            @PathParam("csid") String csid);
-    @DELETE
-    @Path("/urn:cspace:name({parentspecifier})/items/{itemcsid}/contacts/{csid}")
-    ClientResponse<Response> deleteContactInNamedAuthority(
-            @PathParam("parentspecifier") String parentspecifier,
-            @PathParam("itemcsid") String itemcsid,
-            @PathParam("csid") String csid);
-    @DELETE
-    @Path("/urn:cspace:name({parentspecifier})/items/urn:cspace:name({itemspecifier})/contacts/{csid}")
-    ClientResponse<Response> deleteContactForNamedItemInNamedAuthority(
-            @PathParam("parentspecifier") String parentspecifier,
-            @PathParam("itemspecifier") String itemspecifier,
-            @PathParam("csid") String csid);
-
 }
index b67138744afd85a9ae421ade4045d68e6fc4a4f3..182d121b9efecead70d613cd62edd7ea8b7d2a31 100644 (file)
 package org.collectionspace.services.client;
 
 //import javax.ws.rs.PathParam;
-import javax.ws.rs.core.Response;
+import org.jboss.resteasy.client.ClientResponse;
 
-//import org.collectionspace.services.common.authorityref.AuthorityRefList;
-import org.collectionspace.services.common.authorityref.AuthorityRefDocList;
-import org.collectionspace.services.contact.ContactsCommonList;
 import org.collectionspace.services.person.PersonauthoritiesCommonList;
 import org.collectionspace.services.person.PersonsCommonList;
 import org.collectionspace.services.client.PersonAuthorityProxy;
 
-import org.jboss.resteasy.client.ClientResponse;
-import org.jboss.resteasy.client.ProxyFactory;
-import org.jboss.resteasy.client.core.executors.ApacheHttpClientExecutor;
-import org.jboss.resteasy.plugins.providers.RegisterBuiltin;
-import org.jboss.resteasy.spi.ResteasyProviderFactory;
-
 /**
  * The Class PersonAuthorityClient.
  */
-public class PersonAuthorityClient extends AbstractServiceClientImpl {
+public class PersonAuthorityClient extends AuthorityWithContactsClientImpl<PersonsCommonList, 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;
@@ -78,536 +69,16 @@ public class PersonAuthorityClient extends AbstractServiceClientImpl {
         return getCommonPartName(SERVICE_ITEM_NAME);
     }
     
-    /**
-     *
-     */
-    private PersonAuthorityProxy personAuthorityProxy;
-
-    /**
-     * Instantiates a new person authority client.
-     */
-    public PersonAuthorityClient() {
-        ResteasyProviderFactory factory = ResteasyProviderFactory.getInstance();
-        RegisterBuiltin.register(factory);
-        setProxy();
-    }
-
-    /* (non-Javadoc)
-     * @see org.collectionspace.services.client.CollectionSpaceClient#getProxy()
-     */
-    @Override
-    public CollectionSpaceProxy getProxy() {
-       return this.personAuthorityProxy;
-    }    
-
-    /**
-     * Sets the proxy.
-     */
-    public void setProxy() {
-        if (useAuth()) {
-            personAuthorityProxy = ProxyFactory.create(PersonAuthorityProxy.class,
-                    getBaseURL(), new ApacheHttpClientExecutor(getHttpClient()));
-        } else {
-            personAuthorityProxy = ProxyFactory.create(PersonAuthorityProxy.class,
-                    getBaseURL());
-        }
-    }
-
-    /**
-     * Read list.
-     *
-     * @return the client response
-     */
-//    public static PersonAuthorityClient getInstance() {
-//        return instance;
-//    }
-
-    /**
-     * @return list
-     * @see org.collectionspace.services.client.PersonAuthorityProxy#readList()
-     */
-    public ClientResponse<PersonauthoritiesCommonList> readList() {
-        return personAuthorityProxy.readList();
-    }
-
-    /**
-     * Read.
-     *
-     * @param csid the csid
-     * @return the client response
-     */
-    public ClientResponse<String> read(String csid) {
-        return personAuthorityProxy.read(csid);
-    }
-
-    /**
-     * Read by name.
-     *
-     * @param name the name
-     * @return the client response
-     */
-    public ClientResponse<String> readByName(String name) {
-        return personAuthorityProxy.readByName(name);
-    }
-
-    /**
-     * Creates the.
-     *
-     * @param multipart the multipart
-     * @return the client response
-     */
-    public ClientResponse<Response> create(PoxPayloadOut xmlPayload) {
-        return personAuthorityProxy.create(xmlPayload.getBytes());
-    }
-
-    /**
-     * Update.
-     *
-     * @param csid the csid
-     * @param multipart the multipart
-     * @return the client response
-     */
-    public ClientResponse<String> update(String csid, PoxPayloadOut xmlPayload) {
-        return personAuthorityProxy.update(csid, xmlPayload.getBytes());
-
-    }
-
-    /**
-     * Delete.
-     *
-     * @param csid the csid
-     * @return the client response
-     */
-    public ClientResponse<Response> delete(String csid) {
-        return personAuthorityProxy.delete(csid);
-    }
-
-    /**
-     * Gets the referencing objects.
-     *
-     * @param parentcsid the parentcsid
-     * @param csid the csid
-     * @return the referencing objects
-     */
-    public ClientResponse<AuthorityRefDocList> getReferencingObjects(String parentcsid, String csid) {
-        return personAuthorityProxy.getReferencingObjects(parentcsid, csid);
-    }
-
-    /**
-     * Read item list, filtering by partial term match, or keywords. Only one of
-     * partialTerm or keywords should be specified. If both are specified, keywords
-     * will be ignored.
-     *
-     * @param inAuthority the parent authority
-     * @param partialTerm A partial term on which to match,
-     *     which will filter list results to return only matched resources.
-     * @param keywords A set of keywords on which to match,
-     *     which will filter list results to return only matched resources.
-     * @return the client response
-     */
-    public ClientResponse<PersonsCommonList> 
-               readItemList(String inAuthority, String partialTerm, String keywords) {
-        return personAuthorityProxy.readItemList(inAuthority, partialTerm, keywords);
-    }
-
-    /**
-     * Read item list for named vocabulary, filtering by partial term match, or keywords. Only one of
-     * partialTerm or keywords should be specified. If both are specified, keywords
-     * will be ignored.
-     *
-     * @param specifier the specifier
-     * @param partialTerm A partial term on which to match,
-     *     which will filter list results to return only matched resources.
-     * @param keywords A set of keywords on which to match,
-     *     which will filter list results to return only matched resources.
-     * @return the client response
-     */
-    public ClientResponse<PersonsCommonList> 
-               readItemListForNamedAuthority(String specifier, String partialTerm, String keywords) {
-        return personAuthorityProxy.readItemListForNamedAuthority(specifier, partialTerm, keywords);
-    }
-
-    /**
-     * Read item.
-     *
-     * @param vcsid the vcsid
-     * @param csid the csid
-     * @return the client response
-     */
-    public ClientResponse<String> readItem(String vcsid, String csid) {
-        return personAuthorityProxy.readItem(vcsid, csid);
-    }
-
-    /**
-     * Read named item.
-     *
-     * @param vcsid the vcsid
-     * @param shortId the shortIdentifier
-     * @return the client response
-     */
-    public ClientResponse<String> readNamedItem(String vcsid, String shortId) {
-        return personAuthorityProxy.readNamedItem(vcsid, shortId);
-    }
-
-    /**
-     * Read item in Named Authority.
-     *
-     * @param authShortId the shortIdentifier for the Authority
-     * @param csid the csid
-     * @return the client response
-     */
-    public ClientResponse<String> readItemInNamedAuthority(String authShortId, String csid) {
-        return personAuthorityProxy.readItemInNamedAuthority(authShortId, csid);
-    }
-
-    /**
-     * Read named item in Named Authority.
-     *
-     * @param authShortId the shortIdentifier for the Authority
-     * @param itemShortId the shortIdentifier for the item
-     * @return the client response
-     */
-    public ClientResponse<String> readNamedItemInNamedAuthority(String authShortId, String itemShortId) {
-        return personAuthorityProxy.readNamedItemInNamedAuthority(authShortId, itemShortId);
-    }
-
-    /**
-     * Creates the item.
-     *
-     * @param vcsid the vcsid
-     * @param multipart the multipart
-     * @return the client response
-     */
-    public ClientResponse<Response> createItem(String vcsid, PoxPayloadOut xmlPayload) {
-        return personAuthorityProxy.createItem(vcsid, xmlPayload.getBytes());
-    }
-
-    /**
-     * Update item.
-     *
-     * @param vcsid the vcsid
-     * @param csid the csid
-     * @param multipart the multipart
-     * @return the client response
-     */
-    public ClientResponse<String> updateItem(String vcsid, String csid, PoxPayloadOut xmlPayload) {
-        return personAuthorityProxy.updateItem(vcsid, csid, xmlPayload.getBytes());
-
-    }
-
-    /**
-     * Delete item.
-     *
-     * @param vcsid the vcsid
-     * @param csid the csid
-     * @return the client response
-     */
-    public ClientResponse<Response> deleteItem(String vcsid, String csid) {
-        return personAuthorityProxy.deleteItem(vcsid, csid);
-    }
-
-    /***************************************************************************
-     * 
-     * Contact sub-resource interfaces
-     * 
-     ***************************************************************************/
-    
-    /**
-     * Creates the contact.
-     *
-     * @param parentcsid the parentcsid
-     * @param itemcsid the itemcsid
-     * @param multipart the multipart
-     * @return the client response
-     */
-    public ClientResponse<Response> createContact(String parentcsid,
-            String itemcsid, PoxPayloadOut xmlPayload) {
-        return personAuthorityProxy.createContact(parentcsid, itemcsid, xmlPayload.getBytes());
-    }
-
-    /**
-     * Creates the contact.
-     *
-     * @param parentcsid
-     * @param itemspecifier (shortIdentifier)
-     * @param multipart
-     * @return the client response
-     */
-    public ClientResponse<Response> createContactForNamedItem(
-               String parentcsid,
-               String itemspecifier,
-               PoxPayloadOut xmlPayload) {
-       return personAuthorityProxy.createContactForNamedItem(parentcsid, itemspecifier, xmlPayload.getBytes());
-    }
-    /**
-     * Creates the contact.
-     *
-     * @param parentspecifier (shortIdentifier)
-     * @param itemcsid
-     * @param multipart
-     * @return the client response
-     */
-    public ClientResponse<Response> createContactForItemInNamedAuthority(
-               String parentspecifier,
-               String itemcsid,
-               PoxPayloadOut xmlPayload) {
-       return personAuthorityProxy.createContactForItemInNamedAuthority(parentspecifier,
-                       itemcsid, xmlPayload.getBytes());
-    }
-    /**
-     * Creates the contact.
-     *
-     * @param parentspecifier (shortIdentifier)
-     * @param itemspecifier (shortIdentifier)
-     * @param multipart
-     * @return the client response
-     */
-    public ClientResponse<Response> createContactForNamedItemInNamedAuthority(
-               String parentspecifier,
-               String itemspecifier,
-               PoxPayloadOut xmlPayload) {
-       return personAuthorityProxy.createContactForNamedItemInNamedAuthority(parentspecifier, itemspecifier,
-                       xmlPayload.getBytes());
-    }
-    
-    /**
-     * Read contact.
-     *
-     * @param parentcsid the parentcsid
-     * @param itemcsid the itemcsid
-     * @param csid the csid
-     * @return the client response
-     */
-    public ClientResponse<String> readContact(String parentcsid,
-            String itemcsid, String csid) {
-        return personAuthorityProxy.readContact(parentcsid, itemcsid, csid);
-    }
-    
-    /**
-     * Read contact.
-     *
-     * @param parentcsid
-     * @param itemspecifier (shortIdentifier)
-     * @param csid
-     * @return the client response
-     */
-    public ClientResponse<String> readContactForNamedItem(
-               String parentcsid,
-               String itemspecifier,
-               String csid){
-       return personAuthorityProxy.readContactForNamedItem(parentcsid, itemspecifier, csid);
-    }
-
-    /**
-     * Read contact.
-     *
-     * @param parentspecifier (shortIdentifier)
-     * @param itemcsid
-     * @param csid
-     * @return the client response
-     */
-    public ClientResponse<String> readContactInNamedAuthority(
-               String parentspecifier,
-               String itemcsid,
-               String csid){
-       return personAuthorityProxy.readContactInNamedAuthority(parentspecifier, itemcsid, csid);
-    }
-
-    /**
-     * Read contact.
-     *
-     * @param parentspecifier (shortIdentifier)
-     * @param itemspecifier (shortIdentifier)
-     * @param csid
-     * @return the client response
-     */
-    public ClientResponse<String> readContactForNamedItemInNamedAuthority(
-               String parentspecifier,
-               String itemspecifier,
-               String csid){
-       return personAuthorityProxy.readContactForNamedItemInNamedAuthority(parentspecifier, itemspecifier, csid);
-    }
-            
-
-    /**
-     * Read contact list.
-     *
-     * @param parentcsid the parentcsid
-     * @param itemcsid the itemcsid
-     * @return the client response
-     */
-    public ClientResponse<ContactsCommonList> readContactList(String parentcsid,
-            String itemcsid) {
-        return personAuthorityProxy.readContactList(parentcsid, itemcsid);
-    }
-    
-    /**
-     * Read contact list.
-     *
-     * @param parentcsid
-     * @param itemspecifier (shortIdentifier)
-     * @return the client response
-     */
-    public ClientResponse<ContactsCommonList> readContactListForNamedItem(
-               String parentcsid,
-               String itemspecifier){
-       return personAuthorityProxy.readContactList(parentcsid, itemspecifier);
-    }
-
-    /**
-     * Read contact list.
-     *
-     * @param parentspecifier (shortIdentifier)
-     * @param itemcsid
-     * @return the client response
-     */
-    public ClientResponse<ContactsCommonList> readContactListForItemInNamedAuthority(
-               String parentspecifier,
-               String itemcsid){
-       return personAuthorityProxy.readContactList(parentspecifier, itemcsid);
-    }
-
-    /**
-     * Read contact list.
-     *
-     * @param parentspecifier (shortIdentifier)
-     * @param itemspecifier (shortIdentifier)
-     * @return the client response
-     */
-    public ClientResponse<ContactsCommonList> readContactListForNamedItemInNamedAuthority(
-               String parentspecifier,
-               String itemspecifier){
-       return personAuthorityProxy.readContactList(parentspecifier, itemspecifier);
-    }
-            
-
-    /**
-     * Update contact.
-     *
-     * @param parentcsid the parentcsid
-     * @param itemcsid the itemcsid
-     * @param csid the csid
-     * @param multipart the multipart
-     * @return the client response
-     */
-    public ClientResponse<String> updateContact(String parentcsid,
-            String itemcsid, String csid, PoxPayloadOut xmlPayload) {
-        return personAuthorityProxy.updateContact(parentcsid, itemcsid, csid, xmlPayload.getBytes());
-    }
-    
-    /**
-     * Update contact.
-     *
-     * @param parentcsid the parentcsid
-     * @param itemspecifier (shortIdentifier)
-     * @param csid the csid
-     * @param multipart the multipart
-     * @return the client response
-     */
-    public ClientResponse<String> updateContactForNamedItem(
-               String parentcsid,
-               String itemspecifier,
-               String csid,
-               PoxPayloadOut xmlPayload) {
-       return personAuthorityProxy.updateContactForNamedItem(parentcsid, itemspecifier, csid, xmlPayload.getBytes());
-    }
-
-    /**
-     * Update contact.
-     *
-     * @param parentspecifier (shortIdentifier)
-     * @param itemcsid the itemcsid
-     * @param csid the csid
-     * @param multipart the multipart
-     * @return the client response
-     */
-    public ClientResponse<String> updateContactInNamedAuthority(
-               String parentspecifier,
-               String itemcsid,
-               String csid,
-               PoxPayloadOut xmlPayload) {
-       return personAuthorityProxy.updateContactInNamedAuthority(parentspecifier, itemcsid, csid, xmlPayload.getBytes());
-    }
-
-    /**
-     * Update contact.
-     *
-     * @param parentspecifier (shortIdentifier)
-     * @param itemspecifier (shortIdentifier)
-     * @param csid the csid
-     * @param multipart the multipart
-     * @return the client response
-     */
-    public ClientResponse<String> updateContactForNamedItemInNamedAuthority(
-               String parentspecifier,
-               String itemspecifier,
-               String csid,
-               PoxPayloadOut xmlPayload) {
-       return personAuthorityProxy.updateContactForNamedItemInNamedAuthority(parentspecifier, itemspecifier, csid,
-                       xmlPayload.getBytes());
-    }
-
-
-    /**
-     * Delete contact.
-     *
-     * @param parentcsid the parentcsid
-     * @param itemcsid the itemcsid
-     * @param csid the csid
-     * @return the client response
-     */
-    public ClientResponse<Response> deleteContact(String parentcsid,
-        String itemcsid, String csid) {
-        return personAuthorityProxy.deleteContact(parentcsid,
-            itemcsid, csid);
-    }
+       @Override
+       public Class<PersonAuthorityProxy> getProxyClass() {
+               return PersonAuthorityProxy.class;
+       }
     
-    /**
-     * Delete contact.
-     *
-     * @param parentcsid the parentcsid
-     * @param itemspecifier (shortIdentifier)
-     * @param csid the csid
-     * @return the client response
-     */
-    public ClientResponse<Response> deleteContactForNamedItem(
-               String parentcsid,
-               String itemspecifier,
-               String csid) {
-       return personAuthorityProxy.deleteContactForNamedItem(parentcsid,
-                       itemspecifier, csid);
-    }
-
-    /**
-     * Delete contact.
-     *
-     * @param parentspecifier (shortIdentifier)
-     * @param itemcsid the itemcsid
-     * @param csid the csid
-     * @return the client response
-     */
-    public ClientResponse<Response> deleteContactInNamedAuthority(
-               String parentspecifier,
-               String itemcsid,
-               String csid) {
-       return personAuthorityProxy.deleteContactInNamedAuthority(parentspecifier,
-                       itemcsid, csid);
-    }
-
-    /**
-     * Delete contact.
-     *
-     * @param parentspecifier (shortIdentifier)
-     * @param itemspecifier (shortIdentifier)
-     * @param csid the csid
-     * @return the client response
+    /*
+     * Proxied service call methods
      */
-    public ClientResponse<Response> deleteContactForNamedItemInNamedAuthority(
-               String parentspecifier,
-               String itemspecifier,
-               String csid) {
-       return personAuthorityProxy.deleteContactForNamedItemInNamedAuthority(parentspecifier,
-                       itemspecifier, csid);
+       
+    public ClientResponse<PersonauthoritiesCommonList> readList() {
+        return getProxy().readList();
     }
-
 }
index 5b4105c8b23da27b1de4826904d227376a4bbe36..a67aae6fbe80ed330c7b740da6d0f55eba77fa40 100644 (file)
@@ -1,24 +1,15 @@
 package org.collectionspace.services.client;
 
 import javax.ws.rs.Consumes;
-import javax.ws.rs.DELETE;
 import javax.ws.rs.GET;
-import javax.ws.rs.POST;
-import javax.ws.rs.PUT;
 import javax.ws.rs.Path;
 import javax.ws.rs.PathParam;
 import javax.ws.rs.Produces;
 import javax.ws.rs.QueryParam;
-import javax.ws.rs.Encoded;
-import javax.ws.rs.core.Response;
 
-import org.collectionspace.services.common.authorityref.AuthorityRefDocList;
-import org.collectionspace.services.common.query.IQueryManager;
-import org.collectionspace.services.contact.ContactsCommonList;
 import org.collectionspace.services.person.PersonauthoritiesCommonList;
 import org.collectionspace.services.person.PersonsCommonList;
 import org.jboss.resteasy.client.ClientResponse;
-//import org.jboss.resteasy.plugins.providers.multipart.PoxPayloadOut;
 
 /**
  * @version $Revision:$
@@ -26,236 +17,33 @@ import org.jboss.resteasy.client.ClientResponse;
 @Path(PersonAuthorityClient.SERVICE_PATH + "/")
 @Produces({"application/xml"})
 @Consumes({"application/xml"})
-public interface PersonAuthorityProxy extends CollectionSpaceProxy {
+public interface PersonAuthorityProxy extends AuthorityWithContactsProxy<PersonsCommonList> {
 
     // List Personauthorities
     @GET
     ClientResponse<PersonauthoritiesCommonList> readList();
 
-    //(C)reate
-    @POST
-    ClientResponse<Response> create(byte[] xmlPayload);
-
-    //(R)ead
-    @GET
-    @Path("/{csid}")
-    ClientResponse<String> read(@PathParam("csid") String csid);
-
-    //(R)ead by name
-    @GET
-    @Path("/urn:cspace:name({name})")
-    ClientResponse<String> readByName(@PathParam("name") String name);
-
-    //(U)pdate
-    @PUT
-    @Path("/{csid}")
-    ClientResponse<String> update(@PathParam("csid") String csid, byte[] xmlPayload);
-
-    //(D)elete
-    @DELETE
-    @Path("/{csid}")
-    ClientResponse<Response> delete(@PathParam("csid") String csid);
-
-    // List Items with options for matching a partial term or keywords.
-    @GET
-    @Produces("application/xml")
-    @Path("/{csid}/items/")
-    ClientResponse<PersonsCommonList>readItemList(
-            @PathParam("csid") String parentcsid,
-            @QueryParam (IQueryManager.SEARCH_TYPE_PARTIALTERM) @Encoded String partialTerm,
-            @QueryParam(IQueryManager.SEARCH_TYPE_KEYWORDS_KW) @Encoded String keywords);
-
-    /**
-     * @param parentcsid 
-     * @param itemcsid 
-     * @param csid
-     * @return
-     * @see org.collectionspace.services.client.IntakeProxy#getAuthorityRefs(java.lang.String)
+    /*
+     * List results that must be overridden for the RESTEasy proxy generation to work correctly.
      */
-    @GET
-    @Path("{csid}/items/{itemcsid}/refObjs")
-    @Produces("application/xml")
-    ClientResponse<AuthorityRefDocList> getReferencingObjects(
-            @PathParam("csid") String parentcsid,
-            @PathParam("itemcsid") String itemcsid);
-
+    
+    // List Items matching a partial term or keywords.
+    @Override
+       @GET
+    @Produces({"application/xml"})
+    @Path("/{csid}/items/")
+    ClientResponse<PersonsCommonList> readItemList(
+               @PathParam("csid") String vcsid,
+            @QueryParam (IQueryManager.SEARCH_TYPE_PARTIALTERM) String partialTerm,
+            @QueryParam(IQueryManager.SEARCH_TYPE_KEYWORDS_KW) String keywords);
+    
     // List Items for a named authority matching a partial term or keywords.
-    @GET
+    @Override
+       @GET
     @Produces({"application/xml"})
     @Path("/urn:cspace:name({specifier})/items/")
     ClientResponse<PersonsCommonList> readItemListForNamedAuthority(
                @PathParam("specifier") String specifier,
             @QueryParam (IQueryManager.SEARCH_TYPE_PARTIALTERM) String partialTerm,
             @QueryParam(IQueryManager.SEARCH_TYPE_KEYWORDS_KW) String keywords);
-
-    //(C)reate Item
-    @POST
-    @Path("/{vcsid}/items/")
-    ClientResponse<Response> createItem(@PathParam("vcsid") String vcsid, byte[] xmlPayload);
-
-    //(R)ead Item
-    @GET
-    @Path("/{vcsid}/items/{csid}")
-    ClientResponse<String> readItem(@PathParam("vcsid") String vcsid, @PathParam("csid") String csid);
-
-    //(R)ead Named Item
-    @GET
-    @Path("/{vcsid}/items/urn:cspace:name({specifier})")
-    ClientResponse<String> readNamedItem(@PathParam("vcsid") String vcsid, @PathParam("specifier") String specifier);
-
-    //(R)ead Item In Named Authority
-    @GET
-    @Path("/urn:cspace:name({specifier})/items/{csid}")
-    ClientResponse<String> readItemInNamedAuthority(@PathParam("specifier") String specifier, @PathParam("csid") String csid);
-
-    //(R)ead Named Item In Named Authority
-    @GET
-    @Path("/urn:cspace:name({specifier})/items/urn:cspace:name({itemspecifier})")
-    ClientResponse<String> readNamedItemInNamedAuthority(@PathParam("specifier") String specifier, @PathParam("itemspecifier") String itemspecifier);
-
-    //(U)pdate Item
-    @PUT
-    @Path("/{vcsid}/items/{csid}")
-    ClientResponse<String> updateItem(@PathParam("vcsid") String vcsid, @PathParam("csid") String csid, byte[] xmlPayload);
-
-    //(D)elete Item
-    @DELETE
-    @Path("/{vcsid}/items/{csid}")
-    ClientResponse<Response> deleteItem(@PathParam("vcsid") String vcsid, @PathParam("csid") String csid);
-
-    // List Contacts
-    @GET
-    @Produces({"application/xml"})
-    @Path("/{parentcsid}/items/{itemcsid}/contacts/")
-    ClientResponse<ContactsCommonList> readContactList(
-            @PathParam("parentcsid") String parentcsid,
-            @PathParam("itemcsid") String itemcsid);
-    @GET
-    @Produces({"application/xml"})
-    @Path("/{parentcsid}/items/urn:cspace:name({itemspecifier})/contacts/")
-    ClientResponse<ContactsCommonList> readContactListForNamedItem(
-            @PathParam("parentcsid") String parentcsid,
-            @PathParam("itemspecifier") String itemspecifier);
-    @GET
-    @Produces({"application/xml"})
-    @Path("/urn:cspace:name({parentspecifier})/items/{itemcsid}/contacts/")
-    ClientResponse<ContactsCommonList> readContactListForItemInNamedAuthority(
-            @PathParam("parentspecifier") String parentspecifier,
-            @PathParam("itemcsid") String itemcsid);
-    @GET
-    @Produces({"application/xml"})
-    @Path("/urn:cspace:name({parentspecifier})/items/urn:cspace:name({itemspecifier})/contacts/")
-    ClientResponse<ContactsCommonList> readContactListForNamedItemInNamedAuthority(
-            @PathParam("parentspecifier") String parentspecifier,
-            @PathParam("itemspecifier") String itemspecifier);
-
-    //(C)reate Contact
-    @POST
-    @Path("/{parentcsid}/items/{itemcsid}/contacts/")
-    ClientResponse<Response> createContact(
-            @PathParam("parentcsid") String parentcsid,
-            @PathParam("itemcsid") String itemcsid,
-            byte[] xmlPayload);
-    @POST
-    @Path("/{parentcsid}/items/urn:cspace:name({itemspecifier})/contacts/")
-    ClientResponse<Response> createContactForNamedItem(
-            @PathParam("parentcsid") String parentcsid,
-            @PathParam("itemspecifier") String itemspecifier,
-            byte[] xmlPayload);
-    @POST
-    @Path("/urn:cspace:name({parentspecifier})/items/{itemcsid}/contacts/")
-    ClientResponse<Response> createContactForItemInNamedAuthority(
-            @PathParam("parentspecifier") String parentspecifier,
-            @PathParam("itemcsid") String itemcsid,
-            byte[] xmlPayload);
-    @POST
-    @Path("/urn:cspace:name({parentspecifier})/items/urn:cspace:name({itemspecifier})/contacts/")
-    ClientResponse<Response> createContactForNamedItemInNamedAuthority(
-            @PathParam("parentspecifier") String parentspecifier,
-            @PathParam("itemspecifier") String itemspecifier,
-            byte[] xmlPayload);
-
-     //(R)ead Contact
-    @GET
-    @Path("/{parentcsid}/items/{itemcsid}/contacts/{csid}")
-    ClientResponse<String> readContact(
-            @PathParam("parentcsid") String parentcsid,
-            @PathParam("itemcsid") String itemcsid,
-            @PathParam("csid") String csid);
-    @GET
-    @Path("/{parentcsid}/items/urn:cspace:name({itemspecifier})/contacts/{csid}")
-    ClientResponse<String> readContactForNamedItem(
-            @PathParam("parentcsid") String parentcsid,
-            @PathParam("itemspecifier") String itemspecifier,
-            @PathParam("csid") String csid);
-    @GET
-    @Path("/urn:cspace:name({parentspecifier})/items/{itemcsid}/contacts/{csid}")
-    ClientResponse<String> readContactInNamedAuthority(
-            @PathParam("parentspecifier") String parentspecifier,
-            @PathParam("itemcsid") String itemcsid,
-            @PathParam("csid") String csid);
-    @GET
-    @Path("/urn:cspace:name({parentspecifier})/items/urn:cspace:name({itemspecifier})/contacts/{csid}")
-    ClientResponse<String> readContactForNamedItemInNamedAuthority(
-            @PathParam("parentspecifier") String parentspecifier,
-            @PathParam("itemspecifier") String itemspecifier,
-            @PathParam("csid") String csid);
-
-    //(U)pdate Contact
-    @PUT
-    @Path("/{parentcsid}/items/{itemcsid}/contacts/{csid}")
-    ClientResponse<String> updateContact(
-            @PathParam("parentcsid") String parentcsid,
-            @PathParam("itemcsid") String itemcsid,
-            @PathParam("csid") String csid,
-            byte[] xmlPayload);
-    @PUT
-    @Path("/{parentcsid}/items/urn:cspace:name({itemspecifier})/contacts/{csid}")
-    ClientResponse<String> updateContactForNamedItem(
-            @PathParam("parentcsid") String parentcsid,
-            @PathParam("itemspecifier") String itemspecifier,
-            @PathParam("csid") String csid,
-            byte[] xmlPayload);
-    @PUT
-    @Path("/urn:cspace:name({parentspecifier})/items/{itemcsid}/contacts/{csid}")
-    ClientResponse<String> updateContactInNamedAuthority(
-            @PathParam("parentspecifier") String parentspecifier,
-            @PathParam("itemcsid") String itemcsid,
-            @PathParam("csid") String csid,
-            byte[] xmlPayload);
-    @PUT
-    @Path("/urn:cspace:name({parentspecifier})/items/urn:cspace:name({itemspecifier})/contacts/{csid}")
-    ClientResponse<String> updateContactForNamedItemInNamedAuthority(
-            @PathParam("parentspecifier") String parentspecifier,
-            @PathParam("itemspecifier") String itemspecifier,
-            @PathParam("csid") String csid,
-            byte[] xmlPayload);
-
-    //(D)elete Contact
-    @DELETE
-    @Path("/{parentcsid}/items/{itemcsid}/contacts/{csid}")
-    ClientResponse<Response> deleteContact(
-            @PathParam("parentcsid") String parentcsid,
-            @PathParam("itemcsid") String itemcsid,
-            @PathParam("csid") String csid);
-    
-    @DELETE
-    @Path("/{parentcsid}/items/urn:cspace:name({itemspecifier})/contacts/{csid}")
-    ClientResponse<Response> deleteContactForNamedItem(
-            @PathParam("parentcsid") String parentcsid,
-            @PathParam("itemspecifier") String itemspecifier,
-            @PathParam("csid") String csid);
-    @DELETE
-    @Path("/urn:cspace:name({parentspecifier})/items/{itemcsid}/contacts/{csid}")
-    ClientResponse<Response> deleteContactInNamedAuthority(
-            @PathParam("parentspecifier") String parentspecifier,
-            @PathParam("itemcsid") String itemcsid,
-            @PathParam("csid") String csid);
-    
-    @DELETE
-    @Path("/urn:cspace:name({parentspecifier})/items/urn:cspace:name({itemspecifier})/contacts/{csid}")
-    ClientResponse<Response> deleteContactForNamedItemInNamedAuthority(
-            @PathParam("parentspecifier") String parentspecifier,
-            @PathParam("itemspecifier") String itemspecifier,
-            @PathParam("csid") String csid);
 }
index 67cf3559c0ac73b1420bc5c938de7e0cbbd80efe..35fd25fbe1f3e10028570cd22113adc0fa37c7aa 100644 (file)
@@ -51,6 +51,7 @@
         <module>report</module>
         <module>dimension</module>
         <module>contact</module>
+        <module>workflow</module>
         <module>JaxRsServiceProvider</module>
         <!--module>sdk</module-->
         <module>IntegrationTests</module>
index df0da4ecbdab3b0c4f2b46e524e0de91567771e8..d318e6448553313859c4270f7608d90a51c99a21 100644 (file)
  */
 package org.collectionspace.services.client;
 
-import javax.ws.rs.core.Response;
-
-//import org.collectionspace.services.common.context.ServiceContext;
+import org.jboss.resteasy.client.ClientResponse;
 import org.collectionspace.services.relation.RelationsCommonList;
 
-import org.jboss.resteasy.client.ProxyFactory;
-import org.jboss.resteasy.plugins.providers.RegisterBuiltin;
-import org.jboss.resteasy.client.ClientResponse;
-import org.jboss.resteasy.client.core.executors.ApacheHttpClientExecutor;
-import org.jboss.resteasy.spi.ResteasyProviderFactory;
 
 /**
  * The Class RelationClient.
  */
-public class RelationClient extends AbstractServiceClientImpl {
+public class RelationClient extends AbstractPoxServiceClientImpl<RelationProxy> {
        public static final String SERVICE_NAME = "relations";
        public static final String SERVICE_PATH_COMPONENT = SERVICE_NAME;       
        public static final String SERVICE_PATH = "/" + SERVICE_PATH_COMPONENT;
@@ -57,44 +50,22 @@ public class RelationClient extends AbstractServiceClientImpl {
                return SERVICE_PATH_COMPONENT;
        }
 
-       /** The relation proxy. */
-       private RelationProxy relationProxy;
-
-       /**
-        * Instantiates a new relation client.
-        */
-       public RelationClient() {
-               ResteasyProviderFactory factory = ResteasyProviderFactory.getInstance();
-               RegisterBuiltin.register(factory);
-               setProxy();
-       }
-
-    @Override
-       public CollectionSpaceProxy getProxy() {
-       return this.relationProxy;
-    }
-
-    /**
-        * Sets the proxy.
-        */
        @Override
-       public void setProxy() {
-               if (useAuth()) {
-                       relationProxy = ProxyFactory.create(RelationProxy.class,
-                                       getBaseURL(), new ApacheHttpClientExecutor(getHttpClient()));
-               } else {
-                       relationProxy = ProxyFactory.create(RelationProxy.class,
-                                       getBaseURL());
-               }
+       public Class<RelationProxy> getProxyClass() {
+               return RelationProxy.class;
        }
 
+       /*
+        * Proxied service calls
+        */
+       
        /**
         * Read list.
         *
         * @return the client response
         */
        public ClientResponse<RelationsCommonList> readList() {
-               return relationProxy.readList();
+               return getProxy().readList();
        }
 
        /**
@@ -112,7 +83,7 @@ public class RelationClient extends AbstractServiceClientImpl {
                        String predicate,
                        String objectCsid,
                        String objectType) {
-               return relationProxy.readList(subjectCsid, subjectType, predicate, objectCsid, objectType);
+               return getProxy().readList(subjectCsid, subjectType, predicate, objectCsid, objectType);
        }
 
     public ClientResponse<RelationsCommonList> readList(String subjectCsid,
@@ -123,49 +94,6 @@ public class RelationClient extends AbstractServiceClientImpl {
             String sortBy,
             Long pageSize,
             Long pageNumber) {
-        return relationProxy.readList(subjectCsid, subjectType, predicate, objectCsid, objectType, sortBy, pageSize, pageNumber);
+        return getProxy().readList(subjectCsid, subjectType, predicate, objectCsid, objectType, sortBy, pageSize, pageNumber);
     }
-
-
-       /**
-        * Read.
-        *
-        * @param csid the csid
-        * @return the client response
-        */
-       public ClientResponse<String> read(String csid) {
-               return relationProxy.read(csid);
-       }
-
-       /**
-        * Creates the.
-        *
-        * @param multipart the multipart
-        * @return the client response
-        */
-       public ClientResponse<Response> create(PoxPayloadOut multipart) {
-            return relationProxy.create(multipart.getBytes());
-       }
-
-       /**
-        * Update.
-        *
-        * @param csid the csid
-        * @param multipart the multipart
-        * @return the client response
-        */
-       public ClientResponse<String> update(String csid,
-                PoxPayloadOut multipart) {
-            return relationProxy.update(csid, multipart.getBytes());
-       }
-
-       /**
-        * Delete.
-        *
-        * @param csid the csid
-        * @return the client response
-        */
-       public ClientResponse<Response> delete(String csid) {
-               return relationProxy.delete(csid);
-       }
 }
index 21e140828c99e9b92453ef1b5027e70829eee4ca..e020a19c3248e38da1c3462507d59de98fd0c937 100644 (file)
@@ -1,21 +1,14 @@
 package org.collectionspace.services.client;
 
 import javax.ws.rs.Consumes;
-import javax.ws.rs.DELETE;
 import javax.ws.rs.GET;
-import javax.ws.rs.POST;
-import javax.ws.rs.PUT;
 import javax.ws.rs.Path;
-import javax.ws.rs.PathParam;
 import javax.ws.rs.Produces;
-import javax.ws.rs.core.Response;
 
 import org.collectionspace.services.relation.RelationsCommonList;
 import org.collectionspace.services.common.relation.IRelationsManager;
 
 import org.jboss.resteasy.client.ClientResponse;
-import org.jboss.resteasy.plugins.providers.multipart.MultipartInput;
-import org.jboss.resteasy.plugins.providers.multipart.MultipartOutput;
 import javax.ws.rs.QueryParam;
 
 /**
@@ -24,7 +17,7 @@ import javax.ws.rs.QueryParam;
 @Path("/relations/")
 @Produces({"application/xml"})
 @Consumes({"application/xml"})
-public interface RelationProxy extends CollectionSpaceProxy {
+public interface RelationProxy extends CollectionSpacePoxProxy {
 
     @GET
     @Produces({"application/xml"})
@@ -50,23 +43,4 @@ public interface RelationProxy extends CollectionSpaceProxy {
             @QueryParam(IClientQueryParams.SORT_BY_PARAM) String sortBy,
             @QueryParam(IClientQueryParams.PAGE_SIZE_PARAM) Long pageSize,
            @QueryParam(IClientQueryParams.START_PAGE_PARAM) Long pageNumber);
-
-    //(C)reate
-    @POST
-    ClientResponse<Response> create(byte[] payload);
-
-    //(R)ead
-    @GET
-    @Path("/{csid}")
-    ClientResponse<String> read(@PathParam("csid") String csid);
-
-    //(U)pdate
-    @PUT
-    @Path("/{csid}")
-    ClientResponse<String> update(@PathParam("csid") String csid, byte[] payload);
-
-    //(D)elete
-    @DELETE
-    @Path("/{csid}")
-    ClientResponse<Response> delete(@PathParam("csid") String csid);
 }
index 2cba6a45d707f446cdf0c612ef4ca54c4de2a21b..e92eebce92dd5e41a00bd6eb5e7b8a4142b290b5 100644 (file)
@@ -42,9 +42,10 @@ import javax.ws.rs.core.Response;
 import javax.ws.rs.core.UriBuilder;
 import javax.ws.rs.core.UriInfo;
 
+import org.collectionspace.services.client.IQueryManager;
 import org.collectionspace.services.client.PoxPayloadIn;
 import org.collectionspace.services.client.PoxPayloadOut;
-import org.collectionspace.services.common.query.IQueryManager;
+//import org.collectionspace.services.common.query.IQueryManager;
 import org.collectionspace.services.common.relation.IRelationsManager;
 import org.collectionspace.services.common.relation.nuxeo.RelationsUtils;
 import org.collectionspace.services.common.AbstractMultiPartCollectionSpaceResourceImpl;
index ba606c77a0e7b35d2a41c6bb7e94372692b8b65c..3850603bcf22462bbb51106c797c6a562587c5ed 100644 (file)
  */
 package org.collectionspace.services.client;
 
-import javax.ws.rs.core.Response;
-
-import org.collectionspace.services.common.authorityref.AuthorityRefList;
 //import org.collectionspace.services.common.context.ServiceContext;
 import org.collectionspace.services.report.ReportsCommonList;
-
-import org.jboss.resteasy.client.ProxyFactory;
-import org.jboss.resteasy.plugins.providers.RegisterBuiltin;
 import org.jboss.resteasy.client.ClientResponse;
-import org.jboss.resteasy.client.core.executors.ApacheHttpClientExecutor;
-import org.jboss.resteasy.spi.ResteasyProviderFactory;
 
 /**
  * A ReportClient.
@@ -44,108 +36,36 @@ import org.jboss.resteasy.spi.ResteasyProviderFactory;
  * @version $Revision:$
  * FIXME: http://issues.collectionspace.org/browse/CSPACE-1684
  */
-public class ReportClient extends AbstractServiceClientImpl {
+public class ReportClient extends AbstractPoxServiceClientImpl<ReportProxy> {
 
-    private ReportProxy reportProxy;
     public static final String SERVICE_NAME = "reports";
     public static final String SERVICE_PATH_COMPONENT = "reports";
 
-    /**
-     *
-     * Default constructor for ReportClient class.
-     *
-     */
-    public ReportClient() {
-        ResteasyProviderFactory factory = ResteasyProviderFactory.getInstance();
-        RegisterBuiltin.register(factory);
-        setProxy();
-    }
-
     @Override
     public String getServiceName() {
         return SERVICE_NAME;
     }
 
-    /* (non-Javadoc)
-     * @see org.collectionspace.services.client.AbstractServiceClientImpl#getServicePathComponent()
-     */
-    public String getServicePathComponent() {
-        return SERVICE_PATH_COMPONENT;
-    }
-
-
     @Override
-    public CollectionSpaceProxy getProxy() {
-       return this.reportProxy;
-    }
-    
-    /**
-     * allow to reset proxy as per security needs
-     */
-    public void setProxy() {
-        if (useAuth()) {
-            reportProxy = ProxyFactory.create(ReportProxy.class,
-                    getBaseURL(), new ApacheHttpClientExecutor(getHttpClient()));
-        } else {
-            reportProxy = ProxyFactory.create(ReportProxy.class,
-                    getBaseURL());
-        }
+       public String getServicePathComponent() {
+        return SERVICE_PATH_COMPONENT;
     }
 
+       @Override
+       public Class<ReportProxy> getProxyClass() {
+               return ReportProxy.class;
+       }
+       
+       /*
+        * Proxied service calls.
+        */
+       
     /**
      * @return
      * @see org.collectionspace.services.client.ReportProxy#getReport()
      */
     public ClientResponse<ReportsCommonList> readList() {
-        return reportProxy.readList();
+        return getProxy().readList();
     }
     
-    /**
-     * @param csid
-     * @return
-     * @see org.collectionspace.services.client.ReportProxy#getAuthorityRefs(java.lang.String)
-     */
-    public ClientResponse<AuthorityRefList> getAuthorityRefs(String csid) {
-        return reportProxy.getAuthorityRefs(csid);
-    }
-
-
-    /**
-     * @param csid
-     * @return
-     * @see org.collectionspace.services.client.ReportProxy#getReport(java.lang.String)
-     */
-    public ClientResponse<String> read(String csid) {
-        return reportProxy.read(csid);
-    }
-
-    /**
-     * @param report
-     * @return
-     * @see org.collectionspace.services.client.ReportProxy#createReport(org.collectionspace.hello.Report)
-     */
-    public ClientResponse<Response> create(PoxPayloadOut multipart) {
-        return reportProxy.create(multipart.getBytes());
-    }
-
-    /**
-     * @param csid
-     * @param report
-     * @return
-     * @see org.collectionspace.services.client.ReportProxy#updateReport(java.lang.Long, org.collectionspace.hello.Report)
-     */
-    public ClientResponse<String> update(String csid, PoxPayloadOut multipart) {
-        return reportProxy.update(csid, multipart.getBytes());
-    }
-
-    /**
-     * @param csid
-     * @return
-     * @see org.collectionspace.services.client.ReportProxy#deleteReport(java.lang.Long)
-     */
-    public ClientResponse<Response> delete(String csid) {
-        return reportProxy.delete(csid);
-    }
-
-
 }
index 32b836ee793e32f9e3dca347113be564b437cc58..66c3b6a651f04c2e649ab531ba09c275a9930314 100644 (file)
 package org.collectionspace.services.client;
 
 import javax.ws.rs.Consumes;
-import javax.ws.rs.DELETE;
 import javax.ws.rs.GET;
-import javax.ws.rs.POST;
-import javax.ws.rs.PUT;
 import javax.ws.rs.Path;
-import javax.ws.rs.PathParam;
 import javax.ws.rs.Produces;
-import javax.ws.rs.core.Response;
 
-import org.collectionspace.services.common.authorityref.AuthorityRefList;
 import org.collectionspace.services.report.ReportsCommonList;
-import org.collectionspace.services.person.PersonsCommonList;
 import org.jboss.resteasy.client.ClientResponse;
 
 /**
@@ -48,8 +41,7 @@ import org.jboss.resteasy.client.ClientResponse;
 @Path("/reports/")
 @Produces({"application/xml;charset=UTF-8"})
 @Consumes({"application/xml"})
-public interface ReportProxy extends CollectionSpaceProxy {
-
+public interface ReportProxy extends CollectionSpacePoxProxy {
     /**
      * Read list.
      *
@@ -58,61 +50,4 @@ public interface ReportProxy extends CollectionSpaceProxy {
     @GET
     @Produces({"application/xml"})
     ClientResponse<ReportsCommonList> readList();
-
-    //(C)reate
-    /**
-     * Creates the.
-     *
-     * @param multipart the multipart
-     * @return the client response
-     */
-    @POST
-    ClientResponse<Response> create(byte[] payload);
-
-    //(R)ead
-    /**
-     * Read.
-     *
-     * @param csid the csid
-     * @return the client response
-     */
-    @GET
-    @Path("/{csid}")
-    ClientResponse<String> read(@PathParam("csid") String csid);
-
-    //(U)pdate
-    /**
-     * Update.
-     *
-     * @param csid the csid
-     * @param multipart the multipart
-     * @return the client response
-     */
-    @PUT
-    @Path("/{csid}")
-    ClientResponse<String> update(@PathParam("csid") String csid, byte[] payload);
-
-    //(D)elete
-    /**
-     * Delete.
-     *
-     * @param csid the csid
-     * @return the client response
-     */
-    @DELETE
-    @Path("/{csid}")
-    ClientResponse<Response> delete(@PathParam("csid") String csid);
-    
-    // List Items
-    /**
-     * Gets the authority refs.
-     *
-     * @param csid the csid
-     * @return the authority refs
-     */
-    @GET
-    @Produces({"application/xml"})
-    @Path("/{csid}/authorityrefs/")
-    ClientResponse<AuthorityRefList> getAuthorityRefs(@PathParam("csid") String csid);
-    
 }
index c0e83ea398fed25360593b8637cb79416022ccfc..ae63afe19514e2e1aa70b4d3ee873612aa7b0aac 100644 (file)
@@ -56,6 +56,7 @@ import net.sf.jasperreports.engine.JasperFillManager;
 import net.sf.jasperreports.engine.JasperPrint;
 
 import org.collectionspace.services.ReportJAXBSchema;
+import org.collectionspace.services.client.IQueryManager;
 import org.collectionspace.services.client.PoxPayloadIn;
 import org.collectionspace.services.client.PoxPayloadOut;
 import org.collectionspace.services.common.AbstractMultiPartCollectionSpaceResourceImpl;
@@ -69,7 +70,6 @@ import org.collectionspace.services.common.document.DocumentFilter;
 import org.collectionspace.services.common.document.DocumentHandler;
 import org.collectionspace.services.common.document.DocumentNotFoundException;
 import org.collectionspace.services.common.document.DocumentWrapper;
-import org.collectionspace.services.common.query.IQueryManager;
 import org.collectionspace.services.common.query.QueryManager;
 import org.collectionspace.services.common.security.UnauthorizedException;
 import org.collectionspace.services.common.vocabulary.AuthorityItemJAXBSchema;
index 78df317e728d220e6377934cfc38847fe84a5b68..b86a75ac7eaeae5ca688d8c052d91852c721cc8f 100644 (file)
  */
 package org.collectionspace.services.client;
 
-import javax.ws.rs.core.Response;
+import org.jboss.resteasy.client.ClientResponse;
 
 import org.collectionspace.services.vocabulary.VocabulariesCommonList;
 import org.collectionspace.services.vocabulary.VocabularyitemsCommonList;
 import org.collectionspace.services.client.VocabularyProxy;
 
-import org.jboss.resteasy.client.ClientResponse;
-import org.jboss.resteasy.client.ProxyFactory;
-import org.jboss.resteasy.client.core.executors.ApacheHttpClientExecutor;
-import org.jboss.resteasy.plugins.providers.RegisterBuiltin;
-import org.jboss.resteasy.spi.ResteasyProviderFactory;
-
 /**
  * The Class VocabularyClient.
  */
-public class VocabularyClient extends AbstractServiceClientImpl {
+public class VocabularyClient extends AuthorityClientImpl<VocabularyitemsCommonList, VocabularyProxy> {
        public static final String SERVICE_NAME = "vocabularies";
        public static final String SERVICE_PATH_COMPONENT = SERVICE_NAME;       
        public static final String SERVICE_PATH = "/" + SERVICE_PATH_COMPONENT;
@@ -58,9 +52,6 @@ public class VocabularyClient extends AbstractServiceClientImpl {
                return SERVICE_NAME;
        }
        
-    /* (non-Javadoc)
-     * @see org.collectionspace.services.client.BaseServiceClient#getServicePathComponent()
-     */
     @Override
     public String getServicePathComponent() {
         return SERVICE_PATH_COMPONENT;
@@ -70,6 +61,11 @@ public class VocabularyClient extends AbstractServiceClientImpl {
        return SERVICE_PAYLOAD_NAME;
     }
 
+       @Override
+       public Class<VocabularyProxy> getProxyClass() {
+               return VocabularyProxy.class;
+       }    
+    
     /**
      * Gets the item common part name.
      *
@@ -79,189 +75,16 @@ public class VocabularyClient extends AbstractServiceClientImpl {
         return getCommonPartName(SERVICE_ITEM_PAYLOAD_NAME);
     }
     
-    /** The Constant instance. */ //FIXME: This is wrong.  There should not be a static instance of the client.
-//    private static final VocabularyClient instance = new VocabularyClient();
-    
-    /** The vocabulary proxy. */
-    private VocabularyProxy vocabularyProxy;
-
-    /**
-     * Instantiates a new vocabulary client.
-     */
-    public VocabularyClient() {
-        ResteasyProviderFactory factory = ResteasyProviderFactory.getInstance();
-        RegisterBuiltin.register(factory);
-        setProxy();
-    }
-
-    /* (non-Javadoc)
-     * @see org.collectionspace.services.client.CollectionSpaceClient#getProxy()
+    /*
+     * Service calls
      */
-    @Override
-    public CollectionSpaceProxy getProxy() {
-       return this.vocabularyProxy;
-    }    
-
-    /**
-     * Sets the proxy.
-     */
-    public void setProxy() {
-        if (useAuth()) {
-            vocabularyProxy = ProxyFactory.create(VocabularyProxy.class, getBaseURL(), 
-                       new ApacheHttpClientExecutor(getHttpClient()));
-        } else {
-            vocabularyProxy = ProxyFactory.create(VocabularyProxy.class, getBaseURL());
-        }
-    }
-
-    /**
-     * Gets the single instance of VocabularyClient.
-     *
-     * @return single instance of VocabularyClient //FIXME: This is wrong.  There should not be a static instance of the client.
-     */
-//    public static VocabularyClient getInstance() {
-//        return instance;
-//    }
-
+    
     /**
      * Read list.
      *
      * @return the client response
      */
     public ClientResponse<VocabulariesCommonList> readList() {
-        return vocabularyProxy.readList();
-    }
-
-    /**
-     * Read.
-     *
-     * @param csid the csid
-     * @return the client response
-     */
-    public ClientResponse<String> read(String csid) {
-        return vocabularyProxy.read(csid);
-    }
-
-    /**
-     * Read by name.
-     *
-     * @param name the name
-     * @return the client response
-     */
-    public ClientResponse<String> readByName(String name) {
-        return vocabularyProxy.readByName(name);
-    }
-
-    /**
-     * Creates the.
-     *
-     * @param multipart the multipart
-     * @return the client response
-     */
-    public ClientResponse<Response> create(PoxPayloadOut poxPayloadout) {
-        return vocabularyProxy.create(poxPayloadout.getBytes());
-    }
-
-    /**
-     * Update.
-     *
-     * @param csid the csid
-     * @param multipart the multipart
-     * @return the client response
-     */
-    public ClientResponse<String> update(String csid, PoxPayloadOut poxPayloadout) {
-        return vocabularyProxy.update(csid, poxPayloadout.getBytes());
-
-    }
-
-    /**
-     * Delete.
-     *
-     * @param csid the csid
-     * @return the client response
-     */
-    public ClientResponse<Response> delete(String csid) {
-        return vocabularyProxy.delete(csid);
-    }
-
-    /**
-     * Read item list, filtering by partial term match, or keywords. Only one of
-     * partialTerm or keywords should be specified. If both are specified, keywords
-     * will be ignored.
-     *
-     * @param inAuthority the parent authority
-     * @param partialTerm A partial term on which to match,
-     *     which will filter list results to return only matched resources.
-     * @param keywords A set of keywords on which to match,
-     *     which will filter list results to return only matched resources.
-     * @return the client response
-     */
-    public ClientResponse<VocabularyitemsCommonList> 
-               readItemList(String inAuthority, String partialTerm, String keywords) {
-        return vocabularyProxy.readItemList(inAuthority, partialTerm, keywords);
-    }
-
-    /**
-     * Read item list for named vocabulary, filtering by partial term match, or keywords. Only one of
-     * partialTerm or keywords should be specified. If both are specified, keywords
-     * will be ignored.
-     *
-     * @param specifier the specifier
-     * @param partialTerm A partial term on which to match,
-     *     which will filter list results to return only matched resources.
-     * @param keywords A set of keywords on which to match,
-     *     which will filter list results to return only matched resources.
-     * @return the client response
-     */
-    public ClientResponse<VocabularyitemsCommonList> 
-               readItemListForNamedVocabulary(String specifier, String partialTerm, String keywords) {
-        return vocabularyProxy.readItemListForNamedVocabulary(specifier, partialTerm, keywords);
-    }
-
-    /**
-     * Read item.
-     *
-     * @param vcsid the vcsid
-     * @param csid the csid
-     * @return the client response
-     */
-    public ClientResponse<String> readItem(String vcsid, String csid) {
-        return vocabularyProxy.readItem(vcsid, csid);
-    }
-
-    /**
-     * Creates the item.
-     *
-     * @param vcsid the vcsid
-     * @param multipart the multipart
-     * @return the client response
-     */
-    public ClientResponse<Response> createItem(String vcsid, PoxPayloadOut poxPayloadOut) {
-       String xmlPayload = poxPayloadOut.toXML();
-        return vocabularyProxy.createItem(vcsid, xmlPayload);
-    }
-
-    /**
-     * Update item.
-     *
-     * @param vcsid the vcsid
-     * @param csid the csid
-     * @param multipart the multipart
-     * @return the client response
-     */
-    public ClientResponse<String> updateItem(String vcsid, String csid, PoxPayloadOut poxPayloadOut) {
-       String xmlPayload = poxPayloadOut.toXML();
-        return vocabularyProxy.updateItem(vcsid, csid, xmlPayload);
-    }
-
-    /**
-     * Delete item.
-     *
-     * @param vcsid the vcsid
-     * @param csid the csid
-     * @return the client response
-     */
-    public ClientResponse<Response> deleteItem(String vcsid, String csid) {
-        return vocabularyProxy.deleteItem(vcsid, csid);
+        return getProxy().readList();
     }
 }
index 54d254f885edbeb1cd860aa83aff5b38c32bee94..41f8aba6f4480b74059cab88440f422c0f91b315 100644 (file)
@@ -1,19 +1,12 @@
 package org.collectionspace.services.client;
 
 import javax.ws.rs.Consumes;
-import javax.ws.rs.DELETE;
 import javax.ws.rs.GET;
-import javax.ws.rs.POST;
-import javax.ws.rs.PUT;
 import javax.ws.rs.Path;
 import javax.ws.rs.PathParam;
 import javax.ws.rs.Produces;
 import javax.ws.rs.QueryParam;
-//import javax.ws.rs.core.Context;
-import javax.ws.rs.core.Response;
-//import javax.ws.rs.core.UriInfo;
 
-import org.collectionspace.services.common.query.IQueryManager;
 import org.collectionspace.services.vocabulary.VocabulariesCommonList;
 import org.collectionspace.services.vocabulary.VocabularyitemsCommonList;
 import org.jboss.resteasy.client.ClientResponse;
@@ -21,76 +14,36 @@ import org.jboss.resteasy.client.ClientResponse;
 /**
  * @version $Revision:$
  */
-//@Path("/vocabularies/")
 @Path("/" + VocabularyClient.SERVICE_PATH_COMPONENT + "/")
 @Produces({"application/xml"})
 @Consumes({"application/xml"})
-public interface VocabularyProxy extends CollectionSpaceProxy {
-
+public interface VocabularyProxy extends AuthorityProxy<VocabularyitemsCommonList> {
     // List Vocabularies
     @GET
     @Produces({"application/xml"})
     ClientResponse<VocabulariesCommonList> readList();
-
-    //(C)reate
-    @POST
-    ClientResponse<Response> create(byte[] xmlPayload);
-
-    //(R)ead
-    @GET
-    @Path("/{csid}")
-    ClientResponse<String> read(@PathParam("csid") String csid);
-
-    //(R)ead by name
-    @GET
-    @Path("/urn:cspace:name({name})")
-    ClientResponse<String> readByName(@PathParam("name") String name);
-
-    //(U)pdate
-    @PUT
-    @Path("/{csid}")
-    ClientResponse<String> update(@PathParam("csid") String csid, byte[] xmlPayload);
-
-    //(D)elete
-    @DELETE
-    @Path("/{csid}")
-    ClientResponse<Response> delete(@PathParam("csid") String csid);
-
+    
+    /*
+     * List results that must be overridden for the RESTEasy proxy generation to work correctly.
+     */
+    
     // List Items matching a partial term or keywords.
-    @GET
+    @Override
+       @GET
     @Produces({"application/xml"})
-    @Path("/{vcsid}/items/")
+    @Path("/{csid}/items/")
     ClientResponse<VocabularyitemsCommonList> readItemList(
-               @PathParam("vcsid") String vcsid,
+               @PathParam("csid") String vcsid,
             @QueryParam (IQueryManager.SEARCH_TYPE_PARTIALTERM) String partialTerm,
             @QueryParam(IQueryManager.SEARCH_TYPE_KEYWORDS_KW) String keywords);
     
     // List Items for a named authority matching a partial term or keywords.
-    @GET
+    @Override
+       @GET
     @Produces({"application/xml"})
-    @Path("/urn:cspace:name({specifier})/items")
-    ClientResponse<VocabularyitemsCommonList> readItemListForNamedVocabulary(
+    @Path("/urn:cspace:name({specifier})/items/")
+    ClientResponse<VocabularyitemsCommonList> readItemListForNamedAuthority(
                @PathParam("specifier") String specifier,
             @QueryParam (IQueryManager.SEARCH_TYPE_PARTIALTERM) String partialTerm,
             @QueryParam(IQueryManager.SEARCH_TYPE_KEYWORDS_KW) String keywords);
-
-    //(C)reate Item
-    @POST
-    @Path("/{vcsid}/items/")
-    ClientResponse<Response> createItem(@PathParam("vcsid") String vcsid, String xmlPayload);
-
-    //(R)ead
-    @GET
-    @Path("/{vcsid}/items/{csid}")
-    ClientResponse<String> readItem(@PathParam("vcsid") String vcsid, @PathParam("csid") String csid);
-
-    //(U)pdate
-    @PUT
-    @Path("/{vcsid}/items/{csid}")
-    ClientResponse<String> updateItem(@PathParam("vcsid") String vcsid, @PathParam("csid") String csid, String xmlPayload);
-
-    //(D)elete
-    @DELETE
-    @Path("/{vcsid}/items/{csid}")
-    ClientResponse<Response> deleteItem(@PathParam("vcsid") String vcsid, @PathParam("csid") String csid);
 }
index 972076681b970355d8db240d17d35ae0a3275782..f5bc4b6b3f1805e455baa6a253e44dc2713bd74e 100644 (file)
@@ -699,7 +699,7 @@ public class VocabularyServiceTest extends AbstractServiceTestImpl {
         if (vcsid != null) {
             res = client.readItemList(vcsid, null, null);
         } else if (shortId != null) {
-            res = client.readItemListForNamedVocabulary(shortId, null, null);
+            res = client.readItemListForNamedAuthority(shortId, null, null);
         } else {
             Assert.fail("Internal Error: readItemList both vcsid and shortId are null!");
         }
diff --git a/services/workflow/3rdparty/build.xml b/services/workflow/3rdparty/build.xml
new file mode 100644 (file)
index 0000000..aa1d772
--- /dev/null
@@ -0,0 +1,127 @@
+
+<project name="workflow.3rdparty" default="package" basedir=".">
+    <description>
+        workflow service 3rdparty
+    </description>
+  <!-- set global properties for this build -->
+    <property name="services.trunk" value="../../.."/>
+    <!-- environment should be declared before reading build.properties -->
+    <property environment="env" />
+    <property file="${services.trunk}/build.properties" />
+    <property name="mvn.opts" value="" />
+    <property name="src" location="src"/>
+
+    <condition property="osfamily-unix">
+        <os family="unix" />
+    </condition>
+    <condition property="osfamily-windows">
+        <os family="windows" />
+    </condition>
+
+    <target name="init" >
+    <!-- Create the time stamp -->
+        <tstamp/>
+    </target>
+
+    <target name="package" depends="package-unix,package-windows"
+  description="Package CollectionSpace Services" />
+    <target name="package-unix" if="osfamily-unix">
+        <exec executable="mvn" failonerror="true">
+            <arg value="package" />
+            <arg value="-Dmaven.test.skip=true" />
+            <arg value="-f" />
+            <arg value="${basedir}/pom.xml" />
+            <arg value="-N" />
+            <arg value="${mvn.opts}" />
+        </exec>
+    </target>
+    <target name="package-windows" if="osfamily-windows">
+        <exec executable="cmd" failonerror="true">
+            <arg value="/c" />
+            <arg value="mvn.bat" />
+            <arg value="package" />
+            <arg value="-Dmaven.test.skip=true" />
+            <arg value="-f" />
+            <arg value="${basedir}/pom.xml" />
+            <arg value="-N" />
+            <arg value="${mvn.opts}" />
+        </exec>
+    </target>
+
+    <target name="install" depends="install-unix,install-windows"
+  description="Install" />
+    <target name="install-unix" if="osfamily-unix">
+        <exec executable="mvn" failonerror="true">
+            <arg value="install" />
+            <arg value="-Dmaven.test.skip=true" />
+            <arg value="-f" />
+            <arg value="${basedir}/pom.xml" />
+            <arg value="-N" />
+            <arg value="${mvn.opts}" />
+        </exec>
+    </target>
+    <target name="install-windows" if="osfamily-windows">
+        <exec executable="cmd" failonerror="true">
+            <arg value="/c" />
+            <arg value="mvn.bat" />
+            <arg value="install" />
+            <arg value="-Dmaven.test.skip=true" />
+            <arg value="-f" />
+            <arg value="${basedir}/pom.xml" />
+            <arg value="-N" />
+            <arg value="${mvn.opts}" />
+        </exec>
+    </target>
+    
+    <target name="clean" depends="clean-unix,clean-windows"
+  description="Delete target directories" >
+        <delete dir="${build}"/>
+    </target>
+    <target name="clean-unix" if="osfamily-unix">
+        <exec executable="mvn" failonerror="true">
+            <arg value="clean" />
+            <arg value="${mvn.opts}" />
+        </exec>
+    </target>
+    <target name="clean-windows" if="osfamily-windows">
+        <exec executable="cmd" failonerror="true">
+            <arg value="/c" />
+            <arg value="mvn.bat" />
+            <arg value="clean" />
+            <arg value="${mvn.opts}" />
+        </exec>
+    </target>
+
+    <target name="test" depends="test-unix,test-windows" description="Run tests" />
+    <target name="test-unix" if="osfamily-unix">
+        <exec executable="mvn" failonerror="true">
+            <arg value="test" />
+            <arg value="${mvn.opts}" />
+        </exec>
+    </target>
+    <target name="test-windows" if="osfamily-windows">
+        <exec executable="cmd" failonerror="true">
+            <arg value="/c" />
+            <arg value="mvn.bat" />
+            <arg value="test" />
+            <arg value="${mvn.opts}" />
+        </exec>
+    </target>
+
+    <target name="deploy" depends="install"
+    description="deploy workflow in ${jboss.server.nuxeo}">
+        <ant antfile="nuxeo-platform-cs-workflow/build.xml" target="deploy" inheritall="false"/>
+    </target>
+
+    <target name="undeploy"
+    description="undeploy workflow from ${jboss.server.nuxeo}">
+        <ant antfile="nuxeo-platform-cs-workflow/build.xml" target="undeploy" inheritall="false"/>
+    </target>
+
+    <target name="dist"
+    description="generate distribution for workflow" depends="package">
+        <ant antfile="nuxeo-platform-cs-workflow/build.xml" target="dist" inheritall="false"/>
+    </target>
+
+
+</project>
diff --git a/services/workflow/3rdparty/nuxeo-platform-cs-workflow/build.xml b/services/workflow/3rdparty/nuxeo-platform-cs-workflow/build.xml
new file mode 100644 (file)
index 0000000..0e43e44
--- /dev/null
@@ -0,0 +1,143 @@
+
+<project name="nuxeo-platform-cs-workflow" default="package" basedir=".">
+    <description>
+        workflow nuxeo document type
+    </description>
+    <!-- set global properties for this build -->
+    <property name="services.trunk" value="../../../.."/>
+    <!-- environment should be declared before reading build.properties -->
+    <property environment="env" />
+    <property file="${services.trunk}/build.properties" />
+    <property name="mvn.opts" value="" />
+    <property name="src" location="src"/>
+    <property name="nuxeo.workflow.jar"
+        value="org.collectionspace.services.workflow.3rdparty.nuxeo-${cspace.release}.jar"/>
+    <property name="nuxeo.workflow.jars.all"
+        value="org.collectionspace.services.workflow.3rdparty.nuxeo-*.jar"/>
+
+    <condition property="osfamily-unix">
+        <os family="unix" />
+    </condition>
+    <condition property="osfamily-windows">
+        <os family="windows" />
+    </condition>
+
+    <target name="init" >
+        <!-- Create the time stamp -->
+        <tstamp/>
+    </target>
+
+    <target name="package" depends="package-unix,package-windows"
+        description="Package CollectionSpace Services" />
+    <target name="package-unix" if="osfamily-unix">
+        <exec executable="mvn" failonerror="true">
+            <arg value="package" />
+            <arg value="-Dmaven.test.skip=true" />
+            <arg value="-f" />
+            <arg value="${basedir}/pom.xml" />
+            <arg value="-N" />
+            <arg value="${mvn.opts}" />
+        </exec>
+    </target>
+    <target name="package-windows" if="osfamily-windows">
+        <exec executable="cmd" failonerror="true">
+            <arg value="/c" />
+            <arg value="mvn.bat" />
+            <arg value="package" />
+            <arg value="-Dmaven.test.skip=true" />
+            <arg value="-f" />
+            <arg value="${basedir}/pom.xml" />
+            <arg value="-N" />
+            <arg value="${mvn.opts}" />
+        </exec>
+    </target>
+
+    <target name="install" depends="install-unix,install-windows"
+        description="Install" />
+    <target name="install-unix" if="osfamily-unix">
+        <exec executable="mvn" failonerror="true">
+            <arg value="install" />
+            <arg value="-Dmaven.test.skip=true" />
+            <arg value="-f" />
+            <arg value="${basedir}/pom.xml" />
+            <arg value="-N" />
+            <arg value="${mvn.opts}" />
+        </exec>
+    </target>
+    <target name="install-windows" if="osfamily-windows">
+        <exec executable="cmd" failonerror="true">
+            <arg value="/c" />
+            <arg value="mvn.bat" />
+            <arg value="install" />
+            <arg value="-Dmaven.test.skip=true" />
+            <arg value="-f" />
+            <arg value="${basedir}/pom.xml" />
+            <arg value="-N" />
+            <arg value="${mvn.opts}" />
+        </exec>
+    </target>
+
+    <target name="clean" depends="clean-unix,clean-windows"
+        description="Delete target directories" >
+        <delete dir="${build}"/>
+    </target>
+    <target name="clean-unix" if="osfamily-unix">
+        <exec executable="mvn" failonerror="true">
+            <arg value="clean" />
+            <arg value="${mvn.opts}" />
+        </exec>
+    </target>
+    <target name="clean-windows" if="osfamily-windows">
+        <exec executable="cmd" failonerror="true">
+            <arg value="/c" />
+            <arg value="mvn.bat" />
+            <arg value="clean" />
+            <arg value="${mvn.opts}" />
+        </exec>
+    </target>
+
+    <target name="test" depends="test-unix,test-windows" description="Run tests" />
+    <target name="test-unix" if="osfamily-unix">
+        <exec executable="mvn" failonerror="true">
+            <arg value="test" />
+            <arg value="${mvn.opts}" />
+        </exec>
+    </target>
+    <target name="test-windows" if="osfamily-windows">
+        <exec executable="cmd" failonerror="true">
+            <arg value="/c" />
+            <arg value="mvn.bat" />
+            <arg value="test" />
+            <arg value="${mvn.opts}" />
+        </exec>
+    </target>
+
+    <target name="deploy" depends="install"
+        description="deploy workflow doctype in ${jboss.server.nuxeo}">
+        <copy file="${basedir}/target/${nuxeo.workflow.jar}"
+        todir="${jboss.deploy.nuxeo.plugins}"/>
+    </target>
+
+    <target name="undeploy"
+        description="undeploy workflow doctype from ${jboss.server.nuxeo}">
+        <delete>
+            <fileset dir="${jboss.deploy.nuxeo.plugins}">
+                <include name="${nuxeo.workflow.jars.all}"/>
+            </fileset>
+            <!-- Legacy deployment location through release 0.6 -->
+            <fileset dir="${jboss.deploy.nuxeo.system}">
+                <include name="${nuxeo.workflow.jars.all}"/>
+            </fileset>
+        </delete>
+    </target>
+
+
+    <target name="dist"
+        description="generate distribution for workflow doctype" depends="package">
+        <copy todir="${services.trunk}/${dist.deploy.nuxeo.plugins}">
+            <fileset file="${basedir}/target/${nuxeo.workflow.jar}"/>
+        </copy>
+    </target>
+
+</project>
+
diff --git a/services/workflow/3rdparty/nuxeo-platform-cs-workflow/pom.xml b/services/workflow/3rdparty/nuxeo-platform-cs-workflow/pom.xml
new file mode 100644 (file)
index 0000000..d744aca
--- /dev/null
@@ -0,0 +1,37 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+       <modelVersion>4.0.0</modelVersion>
+       <parent>
+               <groupId>org.collectionspace.services</groupId>
+               <artifactId>org.collectionspace.services.workflow.3rdparty</artifactId>
+               <version>1.6-SNAPSHOT</version>
+       </parent>
+    
+    <groupId>org.collectionspace.services</groupId>
+    <artifactId>org.collectionspace.services.workflow.3rdparty.nuxeo</artifactId>
+    <name>services.workflow.3rdparty.nuxeo</name>
+    <packaging>jar</packaging>
+    <description>
+        Workflow Nuxeo Document Type
+    </description>
+
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-jar-plugin</artifactId>
+                <configuration>
+                    <archive>
+                        <manifestFile> src/main/resources/META-INF/MANIFEST.MF </manifestFile>
+                        <manifestEntries>
+                            <Bundle-Version>${eclipseVersion}</Bundle-Version>
+                            <Bundle-ManifestVersion>2</Bundle-ManifestVersion>
+                        </manifestEntries>
+                    </archive>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
+
+</project>
diff --git a/services/workflow/3rdparty/nuxeo-platform-cs-workflow/src/main/resources/META-INF/MANIFEST.MF b/services/workflow/3rdparty/nuxeo-platform-cs-workflow/src/main/resources/META-INF/MANIFEST.MF
new file mode 100644 (file)
index 0000000..6b8bf35
--- /dev/null
@@ -0,0 +1,22 @@
+Manifest-Version: 1.0 \r
+Bundle-ManifestVersion: 1 \r
+Bundle-Name: NuxeoCS\r
+Bundle-SymbolicName: org.collectionspace.workflow;singleton:=true \r
+Bundle-Version: 1.0.0\r
+Bundle-Localization: plugin\r
+Bundle-Vendor: Nuxeo \r
+Require-Bundle: org.nuxeo.runtime, \r
+ org.nuxeo.ecm.core.api, \r
+ org.nuxeo.ecm.core,\r
+ org.nuxeo.ecm.core.api,\r
+ org.nuxeo.ecm.platform.types.api,\r
+ org.nuxeo.ecm.platform.versioning.api,\r
+ org.nuxeo.ecm.platform.ui,\r
+ org.nuxeo.ecm.platform.forms.layout.client,\r
+ org.nuxeo.ecm.platform.ws,\r
+ org.collectionspace.collectionspace_core\r
+Provide-Package: org.collectionspace.workflow\r
+Nuxeo-Component: OSGI-INF/core-types-contrib.xml,\r
+ OSGI-INF/ecm-types-contrib.xml,\r
+ OSGI-INF/layouts-contrib.xml\r
+\r
diff --git a/services/workflow/3rdparty/nuxeo-platform-cs-workflow/src/main/resources/OSGI-INF/core-types-contrib.xml b/services/workflow/3rdparty/nuxeo-platform-cs-workflow/src/main/resources/OSGI-INF/core-types-contrib.xml
new file mode 100644 (file)
index 0000000..8b34a1e
--- /dev/null
@@ -0,0 +1,6 @@
+<?xml version="1.0"?>
+<component name="org.collectionspace.workflow.coreTypes">
+  <extension target="org.nuxeo.ecm.core.schema.TypeService" point="schema">
+    <schema name="workflows_common" prefix="workflows_common" src="schemas/workflows_common.xsd"/>
+  </extension>
+</component>
diff --git a/services/workflow/3rdparty/nuxeo-platform-cs-workflow/src/main/resources/OSGI-INF/deployment-fragment.xml b/services/workflow/3rdparty/nuxeo-platform-cs-workflow/src/main/resources/OSGI-INF/deployment-fragment.xml
new file mode 100644 (file)
index 0000000..1d37c1b
--- /dev/null
@@ -0,0 +1,10 @@
+<?xml version="1.0"?>
+<fragment>
+
+  <extension target="application#MODULE">
+    <module>
+      <java>${bundle.fileName}</java>
+    </module>
+  </extension>
+
+</fragment>
\ No newline at end of file
diff --git a/services/workflow/3rdparty/nuxeo-platform-cs-workflow/src/main/resources/schemas/workflows_common.xsd b/services/workflow/3rdparty/nuxeo-platform-cs-workflow/src/main/resources/schemas/workflows_common.xsd
new file mode 100644 (file)
index 0000000..c93c1b9
--- /dev/null
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\r
+\r
+<!--\r
+    Workflow schema (XSD)\r
+    \r
+    Entity  : Workflow\r
+    Part    : Common\r
+    Used for: Nuxeo EP core document type\r
+\r
+    $LastChangedRevision: 2316 $\r
+    $LastChangedDate: 2010-06-02 16:03:51 -0700 (Wed, 02 Jun 2010) $\r
+-->\r
+\r
+<xs:schema \r
+    xmlns:xs="http://www.w3.org/2001/XMLSchema"\r
+    xmlns:ns="http://collectionspace.org/workflow/"\r
+    xmlns="http://collectionspace.org/workflow/"\r
+    targetNamespace="http://collectionspace.org/workflow/"\r
+    version="0.1">\r
+    <!--  Workflow Information Group -->\r
+       <xs:element name="lifeCyclePolicy" type="xs:string"/>\r
+       <xs:element name="currentLifeCycleState" type="xs:string"/>\r
+       <xs:element name="allowedStateTransitionList" type="stateTransitionList">\r
+        <xs:complexType>\r
+            <xs:sequence>\r
+                               <xs:element name="stateTransition" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>\r
+            </xs:sequence>\r
+        </xs:complexType>\r
+    </xs:element>\r
+</xs:schema>\r
diff --git a/services/workflow/3rdparty/pom.xml b/services/workflow/3rdparty/pom.xml
new file mode 100644 (file)
index 0000000..8db5da6
--- /dev/null
@@ -0,0 +1,24 @@
+
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+    <parent>
+        <artifactId>org.collectionspace.services.workflow</artifactId>
+        <groupId>org.collectionspace.services</groupId>
+        <version>1.6-SNAPSHOT</version>
+    </parent>
+    
+    <modelVersion>4.0.0</modelVersion>
+    <groupId>org.collectionspace.services</groupId>
+    <artifactId>org.collectionspace.services.workflow.3rdparty</artifactId>
+    <name>services.workflow.3rdparty</name>
+    <packaging>pom</packaging>
+    
+    <description>
+        3rd party build for workflow service
+    </description>
+
+    <modules>
+        <module>nuxeo-platform-cs-workflow</module>
+    </modules>
+</project>
diff --git a/services/workflow/build.xml b/services/workflow/build.xml
new file mode 100644 (file)
index 0000000..53604d9
--- /dev/null
@@ -0,0 +1,121 @@
+
+<project name="workflow" default="package" basedir=".">
+    <description>
+        workflow service
+    </description>
+  <!-- set global properties for this build -->
+    <property name="services.trunk" value="../.."/>
+    <!-- environment should be declared before reading build.properties -->
+    <property environment="env" />
+    <property file="${services.trunk}/build.properties" />
+    <property name="mvn.opts" value="" />
+    <property name="src" location="src"/>
+
+    <condition property="osfamily-unix">
+        <os family="unix" />
+    </condition>
+    <condition property="osfamily-windows">
+        <os family="windows" />
+    </condition>
+
+    <target name="package" depends="package-unix,package-windows"
+  description="Package CollectionSpace Services" />
+  
+    <target name="package-unix" if="osfamily-unix">
+        <exec executable="mvn" failonerror="true">
+            <arg value="package" />
+            <arg value="-Dmaven.test.skip=true" />
+            <arg value="-f" />
+            <arg value="${basedir}/pom.xml" />
+            <arg value="-N" />
+            <arg value="${mvn.opts}" />
+        </exec>
+    </target>
+    
+    <target name="package-windows" if="osfamily-windows">
+        <exec executable="cmd" failonerror="true">
+            <arg value="/c" />
+            <arg value="mvn.bat" />
+            <arg value="package" />
+            <arg value="-Dmaven.test.skip=true" />
+            <arg value="-f" />
+            <arg value="${basedir}/pom.xml" />
+            <arg value="-N" />
+            <arg value="${mvn.opts}" />
+        </exec>
+    </target>
+
+
+    <target name="install" depends="install-unix,install-windows"
+  description="Install" />
+    <target name="install-unix" if="osfamily-unix">
+        <exec executable="mvn" failonerror="true">
+            <arg value="install" />
+            <arg value="-Dmaven.test.skip=true" />
+            <arg value="-f" />
+            <arg value="${basedir}/pom.xml" />
+            <arg value="-N" />
+            <arg value="${mvn.opts}" />
+        </exec>
+    </target>
+    <target name="install-windows" if="osfamily-windows">
+        <exec executable="cmd" failonerror="true">
+            <arg value="/c" />
+            <arg value="mvn.bat" />
+            <arg value="install" />
+            <arg value="-Dmaven.test.skip=true" />
+            <arg value="-f" />
+            <arg value="${basedir}/pom.xml" />
+            <arg value="-N" />
+            <arg value="${mvn.opts}" />
+        </exec>
+    </target>
+
+    <target name="clean" depends="clean-unix,clean-windows"
+  description="Delete target directories" >
+        <delete dir="${build}"/>
+    </target>
+    <target name="clean-unix" if="osfamily-unix">
+        <exec executable="mvn" failonerror="true">
+            <arg value="clean" />
+            <arg value="${mvn.opts}" />
+        </exec>
+    </target>
+    <target name="clean-windows" if="osfamily-windows">
+        <exec executable="cmd" failonerror="true">
+            <arg value="/c" />
+            <arg value="mvn.bat" />
+            <arg value="clean" />
+            <arg value="${mvn.opts}" />
+        </exec>
+    </target>
+
+    <target name="test" depends="test-unix,test-windows" description="Run tests" />
+    <target name="test-unix" if="osfamily-unix">
+        <exec executable="mvn" failonerror="true">
+            <arg value="test" />
+            <arg value="${mvn.opts}" />
+        </exec>
+    </target>
+    <target name="test-windows" if="osfamily-windows">
+        <exec executable="cmd" failonerror="true">
+            <arg value="/c" />
+            <arg value="mvn.bat" />
+            <arg value="test" />
+            <arg value="${mvn.opts}" />
+        </exec>
+    </target>
+
+    <target name="deploy" depends="install"
+    description="deploy workflow service">
+    </target>
+
+    <target name="undeploy"
+    description="undeploy workflow service">
+    </target>
+
+    <target name="dist" depends="package"
+    description="distribute workflow service">
+    </target>
+
+</project>
diff --git a/services/workflow/client/pom.xml b/services/workflow/client/pom.xml
new file mode 100644 (file)
index 0000000..b1bfac4
--- /dev/null
@@ -0,0 +1,85 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+    <parent>
+        <groupId>org.collectionspace.services</groupId>
+        <artifactId>org.collectionspace.services.workflow</artifactId>
+        <version>1.6-SNAPSHOT</version>
+    </parent>
+
+    <modelVersion>4.0.0</modelVersion>
+    <groupId>org.collectionspace.services</groupId>
+    <artifactId>org.collectionspace.services.workflow.client</artifactId>
+    <name>services.workflow.client</name>
+    
+    <dependencies>
+        <!-- keep slf4j dependencies on the top -->
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-api</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-log4j12</artifactId>
+            <scope>test</scope>
+        </dependency>
+<!-- CollectionSpace dependencies -->
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.jaxb</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.common</artifactId>
+            <optional>true</optional>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.client</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.dimension.client</artifactId> <!-- Dimension instances are used as a unit-tests targets -->
+            <version>${project.version}</version>
+        </dependency>
+<!-- External dependencies -->        
+        <dependency>
+            <groupId>org.testng</groupId>
+            <artifactId>testng</artifactId>
+            <version>5.6</version>
+        </dependency>
+        <dependency>
+            <groupId>org.jboss.resteasy</groupId>
+            <artifactId>resteasy-jaxrs</artifactId>
+            <!-- filter out unwanted jars -->
+            <exclusions>
+                <exclusion>
+                    <groupId>tjws</groupId>
+                    <artifactId>webserver</artifactId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+        <dependency>
+            <groupId>org.jboss.resteasy</groupId>
+            <artifactId>resteasy-jaxb-provider</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.jboss.resteasy</groupId>
+            <artifactId>resteasy-multipart-provider</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>commons-httpclient</groupId>
+            <artifactId>commons-httpclient</artifactId>
+            <version>3.1</version>
+        </dependency>
+    </dependencies>
+    
+    <build>
+        <finalName>collectionspace-services-workflow-client</finalName>
+    </build>
+</project>
diff --git a/services/workflow/client/src/test/java/org/collectionspace/services/client/test/WorkflowServiceTest.java b/services/workflow/client/src/test/java/org/collectionspace/services/client/test/WorkflowServiceTest.java
new file mode 100644 (file)
index 0000000..77d2e8e
--- /dev/null
@@ -0,0 +1,306 @@
+/**
+ * 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 Regents of the University of California
+ *
+ * Licensed under the Educational Community License (ECL), Version 2.0.
+ * You may not use this file except in compliance with this License.
+ *
+ * You may obtain a copy of the ECL 2.0 License at
+ * https://source.collectionspace.org/collection-space/LICENSE.txt
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.collectionspace.services.client.test;
+
+import java.util.List;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.Response;
+
+import org.collectionspace.services.client.CollectionSpaceClient;
+import org.collectionspace.services.client.PayloadOutputPart;
+import org.collectionspace.services.client.PoxPayloadIn;
+import org.collectionspace.services.client.PoxPayloadOut;
+
+import org.collectionspace.services.jaxb.AbstractCommonList;
+import org.collectionspace.services.common.workflow.client.WorkflowClient;
+import org.collectionspace.services.workflow.WorkflowsCommon;
+import org.collectionspace.services.client.DimensionClient;
+import org.collectionspace.services.dimension.DimensionsCommon;
+
+import org.jboss.resteasy.client.ClientResponse;
+
+import org.testng.Assert;
+import org.testng.annotations.Test;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * ObjectExitServiceTest, carries out tests against a deployed and running ObjectExit Service. <p/>
+ * $LastChangedRevision:  $
+ * $LastChangedDate:  $
+ */
+public class WorkflowServiceTest extends AbstractServiceTestImpl {
+
+    private final String CLASS_NAME = WorkflowServiceTest.class.getName();
+    private final Logger logger = LoggerFactory.getLogger(CLASS_NAME);
+    private String knownResourceId = null;
+
+    @Override
+       public String getServicePathComponent() {
+               return WorkflowClient.SERVICE_PATH_COMPONENT;
+       }
+
+       @Override
+       protected String getServiceName() {
+               return WorkflowClient.SERVICE_NAME;
+       }
+    
+    @Override
+    protected CollectionSpaceClient getClientInstance() {
+        return new WorkflowClient();
+    }
+
+    @Override
+    protected AbstractCommonList getAbstractCommonList(ClientResponse<AbstractCommonList> response) {
+        return response.getEntity(AbstractCommonList.class);
+    }
+
+//    @Override
+//    @Test(dataProvider = "testName", dataProviderClass = AbstractServiceTestImpl.class)
+//    public void create(String testName) throws Exception {
+//        logger.debug(testBanner(testName, CLASS_NAME));
+//        setupCreate();
+//        WorkflowClient client = new WorkflowClient();
+//        PoxPayloadOut multipart = createObjectExitInstance(createIdentifier());
+//        ClientResponse<Response> res = client.create(multipart);
+//        assertStatusCode(res, testName);
+//        if (knownResourceId == null) {
+//            knownResourceId = extractId(res);  // Store the ID returned from the first resource created for additional tests below.
+//            logger.debug(testName + ": knownResourceId=" + knownResourceId);
+//        }
+//        allResourceIdsCreated.add(extractId(res)); // Store the IDs from every resource created by tests so they can be deleted after tests have been run.
+//    }
+    
+    /*
+     * Create a Dimension instance to use as our test target.
+     */
+    @Test(dataProvider = "testName", dataProviderClass = AbstractServiceTestImpl.class)
+    public void createTestObject(String testName) throws Exception {
+       logger.debug(testBanner(testName, CLASS_NAME));
+       setupCreate();
+       DimensionClient client = new DimensionClient();
+       PoxPayloadOut multipart = createDimensionInstance(createIdentifier());
+       ClientResponse<Response> res = client.create(multipart);
+       assertStatusCode(res, testName);
+       if (knownResourceId == null) {
+               knownResourceId = extractId(res);  // Store the ID returned from the first resource created for additional tests below.
+               logger.debug(testName + ": knownResourceId=" + knownResourceId);
+       }
+       allResourceIdsCreated.add(extractId(res)); // Store the IDs from every resource created by tests so they can be deleted after tests have been run.
+    }
+
+    @Override
+    public void createList(String testName) throws Exception {
+       //empty N/A
+    }
+
+    @Override
+    @Test(dataProvider = "testName", dataProviderClass = AbstractServiceTestImpl.class, dependsOnMethods = {"createTestObject"})
+    public void read(String testName) throws Exception {
+        logger.debug(testBanner(testName, CLASS_NAME));
+        setupRead();
+        DimensionClient client = new DimensionClient();
+        ClientResponse<String> res = client.getWorkflow(knownResourceId);
+        assertStatusCode(res, testName);
+        PoxPayloadIn input = new PoxPayloadIn(res.getEntity());
+        WorkflowsCommon workflowsCommon = (WorkflowsCommon) extractPart(input, WorkflowClient.SERVICE_COMMONPART_NAME, WorkflowsCommon.class);
+        if (logger.isDebugEnabled() == true) {
+               logger.debug("Workflow payload is: " + input.getXmlPayload());
+        }
+        Assert.assertNotNull(workflowsCommon);
+    }
+
+//    @Override
+//    @Test(dataProvider = "testName", dataProviderClass = AbstractServiceTestImpl.class, dependsOnMethods = {"createList", "read"})
+//    public void readList(String testName) throws Exception {
+//        logger.debug(testBanner(testName, CLASS_NAME));
+//        setupReadList();
+//        WorkflowClient client = new WorkflowClient();
+//        ClientResponse<AbstractCommonList> res = client.readList();
+//        AbstractCommonList list = res.getEntity();
+//        assertStatusCode(res, testName);
+//        if (logger.isDebugEnabled()) {
+//            List<AbstractCommonList.ListItem> items =
+//                list.getListItem();
+//            int i = 0;
+//            for(AbstractCommonList.ListItem item : items){
+//                logger.debug(testName + ": list-item[" + i + "] " +
+//                        item.toString());
+//                i++;
+//            }
+//        }
+//    }
+
+    @Override
+//    @Test(dataProvider = "testName", dataProviderClass = AbstractServiceTestImpl.class, dependsOnMethods = {"read"})
+    public void update(String testName) throws Exception {
+        logger.debug(testBanner(testName, CLASS_NAME));
+        setupUpdate();
+        WorkflowClient client = new WorkflowClient();
+        ClientResponse<String> res = client.read(knownResourceId);
+        assertStatusCode(res, testName);
+        logger.debug("got object to update with ID: " + knownResourceId);
+        PoxPayloadIn input = new PoxPayloadIn(res.getEntity());
+        WorkflowsCommon objectexit = (WorkflowsCommon) extractPart(input, client.getCommonPartName(), WorkflowsCommon.class);
+        Assert.assertNotNull(objectexit);
+
+//        objectexit.setExitNumber("updated-" + objectexit.getExitNumber());
+        logger.debug("Object to be updated:"+objectAsXmlString(objectexit, WorkflowsCommon.class));
+        PoxPayloadOut output = new PoxPayloadOut(WorkflowClient.SERVICE_PAYLOAD_NAME);
+        PayloadOutputPart commonPart = output.addPart(objectexit, MediaType.APPLICATION_XML_TYPE);
+        commonPart.setLabel(client.getCommonPartName());
+        res = client.update(knownResourceId, output);
+        assertStatusCode(res, testName);
+        input = new PoxPayloadIn(res.getEntity());
+        WorkflowsCommon updatedObjectExit = (WorkflowsCommon) extractPart(input, client.getCommonPartName(), WorkflowsCommon.class);
+        Assert.assertNotNull(updatedObjectExit);
+    }
+
+    @Override
+//    @Test(dataProvider = "testName", dataProviderClass = AbstractServiceTestImpl.class, dependsOnMethods = {"update", "testSubmitRequest"})
+    public void updateNonExistent(String testName) throws Exception {
+        logger.debug(testBanner(testName, CLASS_NAME));
+        setupUpdateNonExistent();
+        // Submit the request to the service and store the response.
+        // Note: The ID used in this 'create' call may be arbitrary.
+        // The only relevant ID may be the one used in update(), below.
+        WorkflowClient client = new WorkflowClient();
+        PoxPayloadOut multipart = createDimensionInstance(NON_EXISTENT_ID);
+        ClientResponse<String> res = client.update(NON_EXISTENT_ID, multipart);
+        assertStatusCode(res, testName);
+    }
+
+    @Override
+//    @Test(dataProvider = "testName", dataProviderClass = AbstractServiceTestImpl.class, dependsOnMethods = {"create", "readList", "testSubmitRequest", "update"})
+    public void delete(String testName) throws Exception {
+        logger.debug(testBanner(testName, CLASS_NAME));
+        setupDelete();
+        WorkflowClient client = new WorkflowClient();
+        ClientResponse<Response> res = client.delete(knownResourceId);
+        assertStatusCode(res, testName);
+    }
+
+    // ---------------------------------------------------------------
+    // Failure outcome tests : means we expect response to fail, but test to succeed
+    // ---------------------------------------------------------------
+
+    // Failure outcome
+    @Override
+//    @Test(dataProvider = "testName", dataProviderClass = AbstractServiceTestImpl.class, dependsOnMethods = {"read"})
+    public void readNonExistent(String testName) throws Exception {
+        logger.debug(testBanner(testName, CLASS_NAME));
+        setupReadNonExistent();
+        WorkflowClient client = new WorkflowClient();
+        ClientResponse<String> res = client.read(NON_EXISTENT_ID);
+        assertStatusCode(res, testName);
+    }
+
+    // Failure outcome
+    @Override
+//    @Test(dataProvider = "testName", dataProviderClass = AbstractServiceTestImpl.class, dependsOnMethods = {"delete"})
+    public void deleteNonExistent(String testName) throws Exception {
+        logger.debug(testBanner(testName, CLASS_NAME));
+        setupDeleteNonExistent();
+        WorkflowClient client = new WorkflowClient();
+        ClientResponse<Response> res = client.delete(NON_EXISTENT_ID);
+        assertStatusCode(res, testName);
+    }
+
+    // Failure outcomes
+    // Placeholders until the tests below can be implemented. See Issue CSPACE-401.
+
+    @Override
+    public void createWithEmptyEntityBody(String testName) throws Exception {
+    }
+
+    @Override
+    public void createWithMalformedXml(String testName) throws Exception {
+    }
+
+    @Override
+    public void createWithWrongXmlSchema(String testName) throws Exception {
+    }
+
+    @Override
+    public void updateWithEmptyEntityBody(String testName) throws Exception {
+    }
+
+    @Override
+    public void updateWithMalformedXml(String testName) throws Exception {
+    }
+
+    @Override
+    public void updateWithWrongXmlSchema(String testName) throws Exception {
+    }
+
+    // ---------------------------------------------------------------
+    // Utility tests : tests of code used in tests above
+    // ---------------------------------------------------------------
+
+//    @Test(dependsOnMethods = {"create", "read"})
+    public void testSubmitRequest() {
+        final int EXPECTED_STATUS = Response.Status.OK.getStatusCode(); // Expected status code: 200 OK
+        String method = ServiceRequestType.READ.httpMethodName();
+        String url = getResourceURL(knownResourceId);
+        int statusCode = submitRequest(method, url);
+        logger.debug("testSubmitRequest: url=" + url + " status=" + statusCode);
+        Assert.assertEquals(statusCode, EXPECTED_STATUS);
+    }
+
+    // ---------------------------------------------------------------
+    // Utility methods used by tests above
+    // ---------------------------------------------------------------
+    private PoxPayloadOut createDimensionInstance(String dimensionValue) {
+        String value = "dimensionValue-" + dimensionValue;
+        String dimensionsCommonPartName = new DimensionClient().getCommonPartName();
+        DimensionsCommon dimensionsCommon = new DimensionsCommon();
+        
+        dimensionsCommon.setValue(value);
+        PoxPayloadOut multipart = new PoxPayloadOut(DimensionClient.SERVICE_PAYLOAD_NAME);
+        PayloadOutputPart commonPart = multipart.addPart(dimensionsCommonPartName, dimensionsCommon);
+
+        if (logger.isDebugEnabled()) {
+            logger.debug("To be created, Dimensions common: " + commonPart.asXML());
+            logger.debug(objectAsXmlString(dimensionsCommon, DimensionsCommon.class));
+        }
+
+        return multipart;
+    }
+
+       @Override
+       public void create(String testName) throws Exception {
+               //empty N/A
+       }
+
+       @Override
+       public void readList(String testName) throws Exception {
+               //empty N/A
+       }
+       
+       @Override
+    public void readPaginatedList(String testName) throws Exception {
+               //empty N/A
+       }
+       
+}
diff --git a/services/workflow/client/src/test/resources/log4j.properties b/services/workflow/client/src/test/resources/log4j.properties
new file mode 100644 (file)
index 0000000..18c5103
--- /dev/null
@@ -0,0 +1,23 @@
+log4j.rootLogger=debug, stdout, R\r
+\r
+log4j.appender.stdout=org.apache.log4j.ConsoleAppender\r
+log4j.appender.stdout.layout=org.apache.log4j.PatternLayout\r
+\r
+# Pattern to output the caller's file name and line number.\r
+log4j.appender.stdout.layout.ConversionPattern=%d %-5p [%t] [%c:%L] %m%n\r
+\r
+log4j.appender.R=org.apache.log4j.RollingFileAppender\r
+log4j.appender.R.File=target/test-client.log\r
+\r
+log4j.appender.R.MaxFileSize=100KB\r
+# Keep one backup file\r
+log4j.appender.R.MaxBackupIndex=1\r
+\r
+log4j.appender.R.layout=org.apache.log4j.PatternLayout\r
+log4j.appender.R.layout.ConversionPattern=%d %-5p [%t] [%c:%L] %m%n\r
+\r
+#packages\r
+log4j.logger.org.collectionspace=DEBUG\r
+log4j.logger.org.apache=INFO\r
+log4j.logger.httpclient=INFO\r
+log4j.logger.org.jboss.resteasy=INFO\r
diff --git a/services/workflow/jaxb/pom.xml b/services/workflow/jaxb/pom.xml
new file mode 100644 (file)
index 0000000..a0677e8
--- /dev/null
@@ -0,0 +1,47 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+    <parent>
+        <artifactId>org.collectionspace.services.workflow</artifactId>
+        <groupId>org.collectionspace.services</groupId>
+        <version>1.6-SNAPSHOT</version>
+    </parent>
+    
+    <modelVersion>4.0.0</modelVersion>
+    <groupId>org.collectionspace.services</groupId>
+    <artifactId>org.collectionspace.services.workflow.jaxb</artifactId>
+    <name>services.workflow.jaxb</name>
+    
+    <dependencies>
+        <dependency>
+            <groupId>com.sun.xml.bind</groupId>
+            <artifactId>jaxb-impl</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.jvnet.jaxb2-commons</groupId>
+            <artifactId>property-listener-injector</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.jvnet.jaxb2_commons</groupId>
+            <artifactId>runtime</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.jaxb</artifactId>
+            <version>${project.version}</version>
+        </dependency>        
+    </dependencies>
+    
+    <build>
+        <finalName>collectionspace-services-workflow-jaxb</finalName>
+        <defaultGoal>install</defaultGoal>
+        <plugins>
+            <plugin>
+                <groupId>org.jvnet.jaxb2.maven2</groupId>
+                <artifactId>maven-jaxb2-plugin</artifactId>
+            </plugin>
+        </plugins>
+    </build>
+</project>
+
diff --git a/services/workflow/pom.xml b/services/workflow/pom.xml
new file mode 100644 (file)
index 0000000..63309a1
--- /dev/null
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- A comment. -->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+    <parent>
+        <groupId>org.collectionspace.services</groupId>
+        <artifactId>org.collectionspace.services.main</artifactId>
+        <version>1.6-SNAPSHOT</version>
+    </parent>
+    
+    <modelVersion>4.0.0</modelVersion>
+    <groupId>org.collectionspace.services</groupId>
+    <artifactId>org.collectionspace.services.workflow</artifactId>
+    <name>services.workflow</name>
+    <packaging>pom</packaging>
+
+    <modules>
+        <module>3rdparty</module>
+        <module>client</module>
+        <module>service</module>
+    </modules>
+
+</project>
+
diff --git a/services/workflow/service/.project b/services/workflow/service/.project
new file mode 100644 (file)
index 0000000..1d4d274
--- /dev/null
@@ -0,0 +1,23 @@
+<projectDescription>\r
+  <name>org.collectionspace.services.workflow.service</name>\r
+  <comment>NO_M2ECLIPSE_SUPPORT: Project files created with the maven-eclipse-plugin are not supported in M2Eclipse.</comment>\r
+  <projects>\r
+    <project>org.collectionspace.services.3rdparty.nuxeo.quote-api</project>\r
+    <project>org.collectionspace.services.client</project>\r
+    <project>org.collectionspace.services.common</project>\r
+    <project>org.collectionspace.services.hyperjaxb</project>\r
+    <project>org.collectionspace.services.jaxb</project>\r
+  </projects>\r
+  <buildSpec>\r
+    <buildCommand>\r
+      <name>org.eclipse.jdt.core.javabuilder</name>\r
+    </buildCommand>\r
+    <buildCommand>\r
+      <name>org.maven.ide.eclipse.maven2Builder</name>\r
+    </buildCommand>\r
+  </buildSpec>\r
+  <natures>\r
+    <nature>org.eclipse.jdt.core.javanature</nature>\r
+    <nature>org.maven.ide.eclipse.maven2Nature</nature>\r
+  </natures>\r
+</projectDescription>
\ No newline at end of file
diff --git a/services/workflow/service/pom.xml b/services/workflow/service/pom.xml
new file mode 100644 (file)
index 0000000..0610a2e
--- /dev/null
@@ -0,0 +1,96 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+    <parent>
+        <groupId>org.collectionspace.services</groupId>
+        <artifactId>org.collectionspace.services.workflow</artifactId>        
+        <version>1.6-SNAPSHOT</version>
+    </parent>
+    
+    <modelVersion>4.0.0</modelVersion>
+    <groupId>org.collectionspace.services</groupId>
+    <artifactId>org.collectionspace.services.workflow.service</artifactId>
+    <name>services.workflow.service</name>
+    <packaging>jar</packaging>       
+
+    <dependencies>
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.common</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.jaxb</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <!-- External dependencies -->        
+        <dependency>
+            <groupId>junit</groupId>
+            <artifactId>junit</artifactId>
+            <version>4.1</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.testng</groupId>
+            <artifactId>testng</artifactId>
+            <version>5.6</version>
+        </dependency>
+        
+      <!-- javax -->
+
+        <dependency>
+            <groupId>javax.security</groupId>
+            <artifactId>jaas</artifactId>
+            <version>1.0.01</version>
+            <scope>provided</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>dom4j</groupId>
+            <artifactId>dom4j</artifactId>
+            <version>1.6.1</version>
+            <scope>provided</scope>
+        </dependency>
+        
+        <!-- jboss -->
+
+        <dependency>
+            <groupId>org.jboss.resteasy</groupId>
+            <artifactId>resteasy-jaxrs</artifactId>
+            <exclusions>
+                <exclusion>
+                    <groupId>tjws</groupId>
+                    <artifactId>webserver</artifactId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+        <dependency>
+            <groupId>org.jboss.resteasy</groupId>
+            <artifactId>resteasy-jaxb-provider</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.jboss.resteasy</groupId>
+            <artifactId>resteasy-multipart-provider</artifactId>
+        </dependency>
+        
+        <!-- nuxeo -->
+
+        <dependency>
+            <groupId>org.nuxeo.ecm.core</groupId>
+            <artifactId>nuxeo-core-api</artifactId>
+            <version>${nuxeo.core.version}</version>
+            <exclusions>
+                <exclusion>
+                    <artifactId>jboss-remoting</artifactId>
+                    <groupId>jboss</groupId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+    </dependencies>
+    
+    <build>
+        <finalName>collectionspace-services-workflow</finalName>
+    </build>
+</project>
+
diff --git a/services/workflow/service/src/main/java/org/collectionspace/services/workflow/WorkflowResource.java b/services/workflow/service/src/main/java/org/collectionspace/services/workflow/WorkflowResource.java
new file mode 100644 (file)
index 0000000..0e27cce
--- /dev/null
@@ -0,0 +1,112 @@
+/**
+ *  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 at 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
+
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+package org.collectionspace.services.workflow;
+
+import org.collectionspace.services.client.IQueryManager;
+import org.collectionspace.services.client.PoxPayloadIn;
+import org.collectionspace.services.client.PoxPayloadOut;
+import org.collectionspace.services.common.ResourceBase;
+import org.collectionspace.services.common.ServiceMessages;
+import org.collectionspace.services.common.context.ServiceContext;
+import org.collectionspace.services.jaxb.AbstractCommonList;
+import org.collectionspace.services.common.workflow.client.WorkflowClient;
+
+import javax.ws.rs.Consumes;
+import javax.ws.rs.DELETE;
+import javax.ws.rs.GET;
+import javax.ws.rs.POST;
+import javax.ws.rs.Path;
+import javax.ws.rs.PathParam;
+import javax.ws.rs.Produces;
+import javax.ws.rs.QueryParam;
+import javax.ws.rs.WebApplicationException;
+import javax.ws.rs.core.Context;
+import javax.ws.rs.core.Response;
+import javax.ws.rs.core.UriInfo;
+
+@Path(WorkflowClient.SERVICE_PATH)
+@Produces({"application/xml"})
+@Consumes({"application/xml"})
+public class WorkflowResource extends ResourceBase {
+
+    @Override
+    public String getServiceName(){
+        return WorkflowClient.SERVICE_NAME;
+    }
+
+    @Override
+    protected String getVersionString() {
+       final String lastChangeRevision = "$LastChangedRevision: 2108 $";
+       return lastChangeRevision;
+    }
+
+    @Override
+    //public Class<ObjectexitCommon> getCommonPartClass() {
+    public Class<?> getCommonPartClass() {
+       try {
+            return Class.forName("org.collectionspace.services.objectexit.WorkflowCommon");//.class;
+        } catch (ClassNotFoundException e){
+            return null;
+        }
+    }
+    
+       /*
+        * HTTP Methods
+        */
+    
+       @Override
+       @POST
+       public Response create(@Context UriInfo ui, String xmlPayload) {
+               Response response = Response.status(Response.Status.BAD_REQUEST)
+                               .entity(ServiceMessages.POST_UNSUPPORTED).type("text/plain").build();
+               return response;
+       }
+       
+    @Override
+       @DELETE
+    @Path("{csid}")
+    public Response delete(@PathParam("csid") String csid) {
+               Response response = Response.status(Response.Status.BAD_REQUEST)
+                               .entity(ServiceMessages.DELETE_UNSUPPORTED).type("text/plain")
+                               .build();
+               return response;
+    }
+    
+    
+       /* (non-Javadoc)
+        * @see org.collectionspace.services.common.ResourceBase#getList(javax.ws.rs.core.UriInfo, java.lang.String)
+        * 
+        * The workflow sub-resource does not support a getList operation.
+        */
+       @Override
+       @GET
+       public AbstractCommonList getList(@Context UriInfo ui,
+                       @QueryParam(IQueryManager.SEARCH_TYPE_KEYWORDS_KW) String keywords) {
+               Response response = Response.status(Response.Status.BAD_REQUEST)
+                               .entity(ServiceMessages.GET_LIST_UNSUPPORTED).type("text/plain")
+                               .build();
+               throw new WebApplicationException(response);
+       }
+    
+}
diff --git a/services/workflow/service/src/main/java/org/collectionspace/services/workflow/nuxeo/WorkflowValidatorHandler.java b/services/workflow/service/src/main/java/org/collectionspace/services/workflow/nuxeo/WorkflowValidatorHandler.java
new file mode 100644 (file)
index 0000000..8ba0fe3
--- /dev/null
@@ -0,0 +1,63 @@
+package org.collectionspace.services.workflow.nuxeo;
+
+import org.collectionspace.services.client.PoxPayloadIn;
+import org.collectionspace.services.client.PoxPayloadOut;
+import org.collectionspace.services.common.document.InvalidDocumentException;
+import org.collectionspace.services.common.document.ValidatorHandlerImpl;
+import org.collectionspace.services.workflow.WorkflowsCommon;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class WorkflowValidatorHandler extends ValidatorHandlerImpl<PoxPayloadIn, PoxPayloadOut> {
+
+    /** The logger. */
+    private final Logger logger = LoggerFactory.getLogger(WorkflowValidatorHandler.class);
+    
+    /** Error Messages **/
+    private static final String VALIDATION_ERROR = "The intake record payload was invalid. See log file for more details.";
+    
+       
+    @Override
+    protected Class<?> getCommonPartClass() {
+       return WorkflowsCommon.class;
+    }
+       
+       @Override
+       protected void handleCreate() throws InvalidDocumentException {
+               try {
+                       WorkflowsCommon intakesCommon = (WorkflowsCommon)getCommonPart();
+                       assert(intakesCommon != null);
+       } catch (AssertionError e) {
+               if (logger.isErrorEnabled() == true) {
+                       logger.error(e.getMessage(), e);
+               }
+               throw new InvalidDocumentException(VALIDATION_ERROR, e);
+       }
+       }
+
+       @Override
+       protected void handleGet() throws InvalidDocumentException {
+               // TODO Auto-generated method stub
+               
+       }
+
+       @Override
+       protected void handleGetAll() throws InvalidDocumentException {
+               // TODO Auto-generated method stub
+               
+       }
+
+       @Override
+       protected void handleUpdate() throws InvalidDocumentException {
+               // TODO Auto-generated method stub
+               
+       }
+
+       @Override
+       protected void handleDelete() throws InvalidDocumentException {
+               // TODO Auto-generated method stub
+               
+       }
+
+}
diff --git a/services/workflow/service/src/test/java/org/collectionspace/services/test/WorkflowServiceTest.java b/services/workflow/service/src/test/java/org/collectionspace/services/test/WorkflowServiceTest.java
new file mode 100644 (file)
index 0000000..544e33f
--- /dev/null
@@ -0,0 +1,13 @@
+package org.collectionspace.services.test;
+
+//import org.collectionspace.services.objectexit.ObjectExit;
+//import org.collectionspace.services.objectexit.ObjectexitList;
+
+/**
+ * Placeholder for server-side testing of Loan Out service code.
+ * 
+ * @version $Revision: 2108 $
+ */
+public class WorkflowServiceTest {
+       //empty
+}
diff --git a/services/workflow/service/src/test/resources/log4j.xml b/services/workflow/service/src/test/resources/log4j.xml
new file mode 100644 (file)
index 0000000..52121cb
--- /dev/null
@@ -0,0 +1,45 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
+<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">
+
+       <appender name="console" class="org.apache.log4j.ConsoleAppender">
+               <param name="Target" value="System.out" />
+               <layout class="org.apache.log4j.TTCCLayout">
+                       <param name="DateFormat" value="ISO8601" />
+               </layout>
+       </appender>
+
+
+       <appender name="unit-tests"
+               class="org.apache.log4j.RollingFileAppender">
+               <param name="File" value="./target/unit-tests.log" />
+               <param name="MaxFileSize" value="10240KB" />
+               <param name="MaxBackupIndex" value="6" />
+               <layout class="org.apache.log4j.TTCCLayout">
+                       <param name="DateFormat" value="ISO8601" />
+               </layout>
+       </appender>
+
+       <logger name="org.apache.commons.httpclient" additivity="false">
+               <level value="warn" />
+               <appender-ref ref="console" />
+               <appender-ref ref="unit-tests" />
+       </logger>
+
+       <logger name="httpclient.wire" additivity="false">
+               <level value="info" />
+               <appender-ref ref="console" />
+               <appender-ref ref="unit-tests" />
+       </logger>
+
+       <root>
+               <priority value="debug" />
+               <appender-ref ref="console" />
+               <appender-ref ref="unit-tests" />
+       </root>
+
+</log4j:configuration>
+
+
+
+