]> git.aero2k.de Git - tmp/jakarta-migration.git/commitdiff
CSPACE-3332, CSPACE-3784 Updated Blob, Media, and Group to use shared subclasses...
authorPatrick Schmitz <pschmitz@berkeley.edu>
Fri, 22 Jul 2011 22:34:43 +0000 (22:34 +0000)
committerPatrick Schmitz <pschmitz@berkeley.edu>
Fri, 22 Jul 2011 22:34:43 +0000 (22:34 +0000)
12 files changed:
services/batch/client/src/main/java/org/collectionspace/services/client/BatchClient.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/common/src/main/cspace/config/services/tenants/tenant-bindings-proto.xml
services/group/client/src/main/java/org/collectionspace/services/client/GroupClient.java
services/group/client/src/main/java/org/collectionspace/services/client/GroupProxy.java
services/group/client/src/test/java/org/collectionspace/services/client/test/GroupServiceTest.java
services/group/jaxb/src/main/resources/groups_common.xsd
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/media/client/src/test/java/org/collectionspace/services/client/test/MediaServiceTest.java
services/media/jaxb/src/main/resources/media_common.xsd

index 48d7b0f20de22db345db097628300ad0c2c68868..ee7e28f20d7e774080708ab9885f75df20e43c93 100644 (file)
@@ -45,13 +45,4 @@ public class BatchClient extends AbstractCommonListPoxServiceClientImpl<BatchPro
                return BatchProxy.class;
        }
 
-       /*
-        * Proxied service calls.
-        * 
-       
-    public BatchCommonList readList2(){
-        BatchCommonList list = readList().getEntity(BatchCommonList.class);
-        return list;
-    }
-        */
 }
index 1a753ee085255c6ff855a915c36ee26a6d974298..9ab6b1244cb3e96acafc27beba1256dd6b69727f 100644 (file)
@@ -18,7 +18,6 @@ package org.collectionspace.services.client;
 
 import javax.ws.rs.core.Response;
 
-import org.collectionspace.services.jaxb.AbstractCommonList;
 import org.jboss.resteasy.client.ClientResponse;
 import org.jboss.resteasy.plugins.providers.multipart.MultipartFormDataOutput;
 
@@ -29,7 +28,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 AbstractPoxServiceClientImpl<AbstractCommonList, BlobProxy> {
+public class BlobClient extends AbstractCommonListPoxServiceClientImpl<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;
@@ -59,14 +58,6 @@ public class BlobClient extends AbstractPoxServiceClientImpl<AbstractCommonList,
         * Blob proxied service calls
         */
        
-    /**
-     * @return
-     * @see org.collectionspace.services.client.BlobProxy#getBlob()
-     */
-    public ClientResponse<AbstractCommonList> readList() {
-        return getProxy().readList();
-    }
-    
     public ClientResponse<Response> createBlobFromFormData(MultipartFormDataOutput formDataOutput) {
         return getProxy().createBlobFromFormData(formDataOutput);
     }
index 5dc06a0dbd2ce8ef00eb32d24c7ea2817b06c16c..7c3e38c55e8d31b25054a548e242815141ec0fb1 100644 (file)
@@ -1,16 +1,12 @@
 package org.collectionspace.services.client;
 
 import javax.ws.rs.Consumes;
-import javax.ws.rs.GET;
 import javax.ws.rs.POST;
 import javax.ws.rs.Path;
 import javax.ws.rs.Produces;
 import javax.ws.rs.QueryParam;
 import javax.ws.rs.core.Response;
 
-import org.collectionspace.services.client.workflow.WorkflowClient;
-import org.collectionspace.services.jaxb.AbstractCommonList;
-
 import org.jboss.resteasy.client.ClientResponse;
 import org.jboss.resteasy.plugins.providers.multipart.MultipartFormDataOutput;
 
@@ -21,7 +17,7 @@ import org.jboss.resteasy.plugins.providers.multipart.MultipartFormDataOutput;
 @Path(BlobClient.SERVICE_PATH + "/")
 @Produces("application/xml")
 @Consumes("application/xml")
-public interface BlobProxy extends CollectionSpacePoxProxy<AbstractCommonList> {
+public interface BlobProxy extends CollectionSpaceCommonListPoxProxy {
     //(C)reate
     @POST
     ClientResponse<Response> createBlobFromURI(byte[] xmlPayload, 
@@ -32,21 +28,4 @@ public interface BlobProxy extends CollectionSpacePoxProxy<AbstractCommonList> {
     @Consumes("multipart/form-data")
     ClientResponse<Response> createBlobFromFormData(MultipartFormDataOutput formDataOutput);
         
-    // List
-    @GET
-    @Produces({"application/xml"})
-    ClientResponse<AbstractCommonList> readList();
-    
-    @Override
-       @GET
-    @Produces({"application/xml"})
-    ClientResponse<AbstractCommonList> readIncludeDeleted(
-            @QueryParam(WorkflowClient.WORKFLOW_QUERY_NONDELETED) String includeDeleted);    
-
-    @Override
-    @GET
-    @Produces({"application/xml"})
-    ClientResponse<AbstractCommonList> keywordSearchIncludeDeleted(
-               @QueryParam(IQueryManager.SEARCH_TYPE_KEYWORDS_KW) String keywords,
-            @QueryParam(WorkflowClient.WORKFLOW_QUERY_NONDELETED) String includeDeleted);
 }
index faccf45bc06f020f9bfed087bfb1707e34eef839..6281f22a6847c8f9e520ee0ab2e023834914748f 100644 (file)
       <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.blob.nuxeo.BlobDocumentModelHandler</service:documentHandler>
       <service:DocHandlerParams xmlns:service="http://collectionspace.org/services/common/service">
-        <service:classname>org.collectionspace.services.blob.nuxeo.BlobDocumentModelHandler</service:classname>
         <service:params>
-          <service:SchemaName>blobs</service:SchemaName>
-          <service:DublinCoreTitle>blobs</service:DublinCoreTitle>
-          <service:SummaryFields>name|mimeType|encoding|length|uri|csid</service:SummaryFields>
-          <service:AbstractCommonListClassname />
-          <service:CommonListItemClassname />
-          <service:ListResultsItemMethodName>getBlobListItem</service:ListResultsItemMethodName>
           <service:ListResultsFields>
             <service:ListResultField>
               <service:element>name</service:element>
       <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.group.nuxeo.GroupDocumentModelHandler</service:documentHandler>
       <service:DocHandlerParams xmlns:service="http://collectionspace.org/services/common/service">
-        <service:classname>org.collectionspace.services.group.nuxeo.GroupDocumentModelHandler</service:classname>
         <service:params>
-          <service:SchemaName>groups</service:SchemaName>
-          <service:DublinCoreTitle>groups</service:DublinCoreTitle>
-          <service:SummaryFields>title|uri|csid</service:SummaryFields>
-          <service:AbstractCommonListClassname />
-          <service:CommonListItemClassname />
-          <service:ListResultsItemMethodName>getGroupListItem</service:ListResultsItemMethodName>
           <service:ListResultsFields>
             <service:ListResultField>
               <service:element>title</service:element>
       <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.media.nuxeo.MediaDocumentModelHandler</service:documentHandler>
       <service:DocHandlerParams xmlns:service="http://collectionspace.org/services/common/service">
-        <service:classname>org.collectionspace.services.media.nuxeo.MediaDocumentModelHandler</service:classname>
         <service:params>
-          <service:SchemaName>media</service:SchemaName>
-          <service:DublinCoreTitle>media</service:DublinCoreTitle>
-          <service:SummaryFields>title|source|filename|identificationNumber|blobCsid|uri|csid</service:SummaryFields>
-          <service:AbstractCommonListClassname />
-          <service:CommonListItemClassname />
-          <service:ListResultsItemMethodName>getMediaListItem</service:ListResultsItemMethodName>
           <service:ListResultsFields>
             <service:ListResultField>
               <service:element>title</service:element>
index e73ace195e455789fe63377c51f2582e8f6a39a5..fce1d34043f22263935d0de92e93e8ab2df6459d 100644 (file)
@@ -16,9 +16,6 @@
  */
 package org.collectionspace.services.client;
 
-import org.collectionspace.services.jaxb.AbstractCommonList;
-import org.jboss.resteasy.client.ClientResponse;
-
 /**
  * GroupClient.java
  *
@@ -26,7 +23,7 @@ import org.jboss.resteasy.client.ClientResponse;
  * $LastChangedDate: 2010-05-17 18:25:37 -0700 (Mon, 17 May 2010) $
  *
  */
-public class GroupClient extends AbstractPoxServiceClientImpl<AbstractCommonList, GroupProxy> {
+public class GroupClient extends AbstractCommonListPoxServiceClientImpl<GroupProxy> {
        public static final String SERVICE_NAME = "groups";
        public static final String SERVICE_PATH_COMPONENT = SERVICE_NAME;       
        public static final String SERVICE_PATH = "/" + SERVICE_PATH_COMPONENT;
@@ -49,12 +46,4 @@ public class GroupClient extends AbstractPoxServiceClientImpl<AbstractCommonList
                return GroupProxy.class;
        }
 
-       /*
-        * Proxied service calls.
-        * 
-        */
-       
-    public ClientResponse<AbstractCommonList> readList() {
-        return getProxy().readList();
-    }
 }
index 610a5a88a3add01b4a50bc8fe21f0f9e63220e9d..5ec5d71b9b823c2617e3e355f1afdceedbd15d93 100644 (file)
  */
 package org.collectionspace.services.client;
 
-import org.jboss.resteasy.client.ClientResponse;
 import javax.ws.rs.Consumes;
-import javax.ws.rs.GET;
 import javax.ws.rs.Path;
 import javax.ws.rs.Produces;
-import javax.ws.rs.QueryParam;
-
-import org.collectionspace.services.client.workflow.WorkflowClient;
-import org.collectionspace.services.jaxb.AbstractCommonList;
 
 /**
  * @version $Revision: 2108 $
@@ -42,21 +36,5 @@ import org.collectionspace.services.jaxb.AbstractCommonList;
 @Path(GroupClient.SERVICE_PATH_PROXY)
 @Produces({"application/xml"})
 @Consumes({"application/xml"})
-public interface GroupProxy extends CollectionSpacePoxProxy<AbstractCommonList> {
-    // List
-    @GET
-    ClientResponse<AbstractCommonList> readList();
-    
-    @Override
-               @GET
-    @Produces({"application/xml"})
-    ClientResponse<AbstractCommonList> readIncludeDeleted(
-            @QueryParam(WorkflowClient.WORKFLOW_QUERY_NONDELETED) String includeDeleted);
-
-               @Override
-    @GET
-    @Produces({"application/xml"})
-    ClientResponse<AbstractCommonList> keywordSearchIncludeDeleted(
-               @QueryParam(IQueryManager.SEARCH_TYPE_KEYWORDS_KW) String keywords,
-            @QueryParam(WorkflowClient.WORKFLOW_QUERY_NONDELETED) String includeDeleted);
+public interface GroupProxy extends CollectionSpaceCommonListPoxProxy {
 }
index 97b1abdaf08fa6ff36ac2bfdbab1ac3c94083705..86b510b5fc699d848971bda052e3a89db7f0e502 100644 (file)
@@ -32,6 +32,7 @@ import org.collectionspace.services.client.GroupProxy;
 import org.collectionspace.services.client.PayloadOutputPart;
 import org.collectionspace.services.client.PoxPayloadIn;
 import org.collectionspace.services.client.PoxPayloadOut;
+import org.collectionspace.services.common.AbstractCommonListUtils;
 import org.collectionspace.services.jaxb.AbstractCommonList;
 import org.collectionspace.services.group.GroupsCommon;
 
@@ -122,15 +123,8 @@ public class GroupServiceTest extends AbstractServiceTestImpl {
         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++;
-            }
+        if(logger.isTraceEnabled()){
+               AbstractCommonListUtils.ListItemsInAbstractCommonList(list, logger, testName);
         }
     }
 
index 210494178c356c5e7a7cccc55e6d1a19ce61aef1..5e23c3e08f7a8bc5f05e95ef1f9314d311987a10 100644 (file)
         </xs:complexType>
     </xs:element>
     
-    <!-- This is the base class for paginated lists -->
-    <xs:complexType name="abstractCommonList">
-        <xs:annotation>
-            <xs:appinfo>
-                <jaxb:class ref="org.collectionspace.services.jaxb.AbstractCommonList"/>
-            </xs:appinfo>
-        </xs:annotation>
-    </xs:complexType>
-    
 </xs:schema>
 
index 40460cbea8700151690cf0744372942791af8979..04efdc9884643c17618560bbb110d53c57cd8e5f 100644 (file)
@@ -20,8 +20,6 @@ import javax.ws.rs.core.Response;
 import org.jboss.resteasy.plugins.providers.multipart.MultipartFormDataOutput;
 import org.jboss.resteasy.client.ClientResponse;
 
-import org.collectionspace.services.jaxb.AbstractCommonList;
-
 /**
  * MediaClient.java
  *
@@ -29,7 +27,7 @@ import org.collectionspace.services.jaxb.AbstractCommonList;
  * $LastChangedDate: 2010-05-17 18:25:37 -0700 (Mon, 17 May 2010) $
  *
  */
-public class MediaClient extends AbstractPoxServiceClientImpl<AbstractCommonList, MediaProxy> {
+public class MediaClient extends AbstractCommonListPoxServiceClientImpl<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;
@@ -54,14 +52,6 @@ public class MediaClient extends AbstractPoxServiceClientImpl<AbstractCommonList
         * Proxied service calls
         */
 
-    /**
-     * @return
-     * @see org.collectionspace.services.client.MediaProxy#getMedia()
-     */
-    public ClientResponse<AbstractCommonList> readList() {
-        return getProxy().readList();
-    }
-        
     /**
      * @param media
      * @return
index ae38fb0986ac0a42ab4b22fb7d9eee1bf63947b7..ea59a91d93dc142296d2f66745c55eb8c40a38a4 100644 (file)
@@ -4,7 +4,6 @@ import org.jboss.resteasy.client.ClientResponse;
 import org.jboss.resteasy.plugins.providers.multipart.MultipartFormDataOutput;
 
 import javax.ws.rs.Consumes;
-import javax.ws.rs.GET;
 import javax.ws.rs.POST;
 import javax.ws.rs.Path;
 import javax.ws.rs.PathParam;
@@ -12,9 +11,7 @@ import javax.ws.rs.Produces;
 import javax.ws.rs.QueryParam;
 import javax.ws.rs.core.Response;
 
-import org.collectionspace.services.jaxb.AbstractCommonList;
 import org.collectionspace.services.client.BlobClient;
-import org.collectionspace.services.client.workflow.WorkflowClient;
 
 /**
  * @version $Revision: 2108 $
@@ -22,26 +19,8 @@ import org.collectionspace.services.client.workflow.WorkflowClient;
 @Path(MediaClient.SERVICE_PATH + "/")
 @Produces("application/xml")
 @Consumes("application/xml")
-public interface MediaProxy extends CollectionSpacePoxProxy<AbstractCommonList> {
+public interface MediaProxy extends CollectionSpaceCommonListPoxProxy {
 
-    // List
-    @GET
-    @Produces({"application/xml"})
-    ClientResponse<AbstractCommonList> readList();
-    
-    @Override
-       @GET
-    @Produces({"application/xml"})
-    ClientResponse<AbstractCommonList> readIncludeDeleted(
-            @QueryParam(WorkflowClient.WORKFLOW_QUERY_NONDELETED) String includeDeleted);
-
-    @Override
-    @GET
-    @Produces({"application/xml"})
-    ClientResponse<AbstractCommonList> keywordSearchIncludeDeleted(
-               @QueryParam(IQueryManager.SEARCH_TYPE_KEYWORDS_KW) String keywords,
-            @QueryParam(WorkflowClient.WORKFLOW_QUERY_NONDELETED) String includeDeleted);
-    
     @POST
     @Path("/{csid}")
     @Consumes("multipart/form-data")
index a56d00e7449f6a6bcbbfb84036203859f1457860..c9f4c8fdf867e06f9cc7ef09d54aa033048fdd19 100644 (file)
@@ -34,6 +34,7 @@ import org.collectionspace.services.client.MediaClient;
 import org.collectionspace.services.client.PayloadOutputPart;
 import org.collectionspace.services.client.PoxPayloadIn;
 import org.collectionspace.services.client.PoxPayloadOut;
+import org.collectionspace.services.common.AbstractCommonListUtils;
 import org.collectionspace.services.jaxb.AbstractCommonList;
 import org.collectionspace.services.media.LanguageList;
 import org.collectionspace.services.media.MediaCommon;
@@ -243,15 +244,9 @@ public class MediaServiceTest extends AbstractServiceTestImpl {
         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++;
-            }
+        // Optionally output additional data about list members for debugging.
+        if(logger.isTraceEnabled()){
+               AbstractCommonListUtils.ListItemsInAbstractCommonList(list, logger, testName);
         }
     }
 
index c804e7131e8fa0cc1d53989490e19b0506e6abf7..a0e58ce279e712e94d84612fbe72142ab5c6cd95 100644 (file)
         </xs:sequence>
     </xs:complexType>
 
-    <!-- This is the base class for paginated lists -->
-    <xs:complexType name="abstractCommonList">
-        <xs:annotation>
-            <xs:appinfo>
-                <jaxb:class ref="org.collectionspace.services.jaxb.AbstractCommonList"/>
-            </xs:appinfo>
-        </xs:annotation>
-    </xs:complexType>
-    
 </xs:schema>