]> git.aero2k.de Git - tmp/jakarta-migration.git/commitdiff
CSPACE-3332, CSPACE-3784 Updated Batch to use DocHandlerBase, AbstractCommonList.
authorPatrick Schmitz <pschmitz@berkeley.edu>
Fri, 22 Jul 2011 20:52:28 +0000 (20:52 +0000)
committerPatrick Schmitz <pschmitz@berkeley.edu>
Fri, 22 Jul 2011 20:52:28 +0000 (20:52 +0000)
services/batch/client/src/main/java/org/collectionspace/services/client/BatchClient.java
services/batch/client/src/main/java/org/collectionspace/services/client/BatchProxy.java
services/batch/client/src/test/java/org/collectionspace/services/client/test/BatchServiceTest.java
services/batch/jaxb/src/main/resources/batch_common.xsd
services/common/src/main/cspace/config/services/tenants/tenant-bindings-proto.xml

index 82c06e016d785d1915abf6f5f07462b36f2c2e48..48d7b0f20de22db345db097628300ad0c2c68868 100644 (file)
  */
 package org.collectionspace.services.client;
 
-import org.collectionspace.services.jaxb.AbstractCommonList;
-import org.collectionspace.services.batch.BatchCommonList;
-
-import org.jboss.resteasy.client.ClientResponse;
-
 /**
  * BatchClient.java
  *
@@ -28,7 +23,7 @@ import org.jboss.resteasy.client.ClientResponse;
  * $LastChangedDate: 2010-05-17 18:25:37 -0700 (Mon, 17 May 2010) $
  *
  */
-public class BatchClient extends AbstractPoxServiceClientImpl<BatchCommonList, BatchProxy> {
+public class BatchClient extends AbstractCommonListPoxServiceClientImpl<BatchProxy> {
        public static final String SERVICE_NAME = "batch";
        public static final String SERVICE_PATH_COMPONENT = SERVICE_NAME;       
        public static final String SERVICE_PATH = "/" + SERVICE_PATH_COMPONENT;
@@ -53,14 +48,10 @@ public class BatchClient extends AbstractPoxServiceClientImpl<BatchCommonList, B
        /*
         * Proxied service calls.
         * 
-        */
        
-    public ClientResponse<BatchCommonList> readList() {
-        return getProxy().readList();
-    }
-
     public BatchCommonList readList2(){
         BatchCommonList list = readList().getEntity(BatchCommonList.class);
         return list;
     }
+        */
 }
index 88af51a302194c9a694b9346311e85be4b195b62..e30237860a917aaa3ae630b613497df998b61996 100644 (file)
@@ -1,16 +1,8 @@
 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;
-import org.collectionspace.services.batch.BatchCommonList;
-
 
 /**
  * @version $Revision: 2108 $
@@ -18,21 +10,5 @@ import org.collectionspace.services.batch.BatchCommonList;
 @Path(BatchClient.SERVICE_PATH + "/")
 @Produces({"application/xml"})
 @Consumes({"application/xml"})
-public interface BatchProxy extends CollectionSpacePoxProxy<BatchCommonList> {
-    // List
-    @GET
-    ClientResponse<BatchCommonList> readList();
-    
-    @Override
-       @GET
-    @Produces({"application/xml"})
-    ClientResponse<BatchCommonList> readIncludeDeleted(
-            @QueryParam(WorkflowClient.WORKFLOW_QUERY_NONDELETED) String includeDeleted);
-
-    @Override
-    @GET
-    @Produces({"application/xml"})
-    ClientResponse<BatchCommonList> keywordSearchIncludeDeleted(
-               @QueryParam(IQueryManager.SEARCH_TYPE_KEYWORDS_KW) String keywords,
-            @QueryParam(WorkflowClient.WORKFLOW_QUERY_NONDELETED) String includeDeleted);
+public interface BatchProxy extends CollectionSpaceCommonListPoxProxy {
 }
index 14467be1074eb1643ecd1d56470ee255637c888a..5aeed3bbca805d8d30f10dae0cb5ffa8aa3a6c6a 100644 (file)
@@ -22,7 +22,6 @@
  */
 package org.collectionspace.services.client.test;
 
-import java.util.List;
 import javax.ws.rs.core.MediaType;
 import javax.ws.rs.core.Response;
 
@@ -32,8 +31,8 @@ import org.collectionspace.services.client.BatchProxy;
 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.batch.BatchCommonList;
 import org.collectionspace.services.batch.BatchCommon;
 
 import org.jboss.resteasy.client.ClientResponse;
@@ -73,11 +72,6 @@ public class BatchServiceTest extends AbstractServiceTestImpl {
         return new BatchClient();
     }
 
-    @Override
-    protected AbstractCommonList getAbstractCommonList(ClientResponse<AbstractCommonList> response) {
-        return response.getEntity(BatchCommonList.class);
-    }
-
     @Override
     @Test(dataProvider = "testName", dataProviderClass = AbstractServiceTestImpl.class)
     public void create(String testName) throws Exception {
@@ -122,23 +116,16 @@ public class BatchServiceTest extends AbstractServiceTestImpl {
         logger.debug(testBanner(testName, CLASS_NAME));
         setupReadList();
         BatchClient client = new BatchClient();
-        ClientResponse<BatchCommonList> res = client.readList();
+        ClientResponse<AbstractCommonList> res = client.readList();
         String bar = "\r\n\r\n=================================\r\n\r\n";
         System.out.println(bar+" res: "+res);
-        BatchCommonList  list = res.getEntity();
+        AbstractCommonList  list = res.getEntity();
 
         System.out.println(bar+" list: "+list);
         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 74baecf95c8cc13c03f56c236a4f5c230bec89b1..4fe6ab3b43d90f5f492d7bd062a13562df373477 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>
-
-
-               <!-- batch records, as in nuxeo repository -->
-    <xs:element name="batch-common-list">
-        <xs:complexType>
-            <xs:complexContent>
-                <xs:extension base="abstractCommonList">
-                    <xs:sequence>
-                        <xs:element name="batch-list-item" maxOccurs="unbounded">
-                            <xs:complexType>
-                                <xs:sequence>
-                                    <xs:element name="name" type="xs:string" minOccurs="1" />
-                                    <xs:element name="forDocType" type="xs:string" minOccurs="1" />
-                                    <xs:element name="uri" type="xs:anyURI" minOccurs="1" />
-                                    <xs:element name="csid" type="xs:string" minOccurs="1" />
-                                </xs:sequence>
-                            </xs:complexType>
-                        </xs:element>
-                    </xs:sequence>
-                </xs:extension>
-            </xs:complexContent>
-        </xs:complexType>
-    </xs:element>
-
 </xs:schema>
 
index 3b3fff016cffdae980d2acbad31db12c944075de..faccf45bc06f020f9bfed087bfb1707e34eef839 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.batch.nuxeo.BatchDocumentModelHandler</service:documentHandler>
       <service:DocHandlerParams xmlns:service="http://collectionspace.org/services/common/service">
-        <service:classname>org.collectionspace.services.batch.nuxeo.BatchDocumentModelHandler</service:classname>
         <service:params>
-          <service:SchemaName>batch</service:SchemaName>
-          <service:DublinCoreTitle>batch</service:DublinCoreTitle>
-          <service:SummaryFields>name|uri|csid</service:SummaryFields>
-          <service:AbstractCommonListClassname>org.collectionspace.services.batch.BatchCommonList</service:AbstractCommonListClassname>
-          <service:CommonListItemClassname>org.collectionspace.services.batch.BatchCommonList$BatchListItem</service:CommonListItemClassname>
-          <service:ListResultsItemMethodName>getBatchListItem</service:ListResultsItemMethodName>
           <service:ListResultsFields>
             <service:ListResultField>
               <service:element>name</service:element>