From: Patrick Schmitz Date: Fri, 22 Jul 2011 20:52:28 +0000 (+0000) Subject: CSPACE-3332, CSPACE-3784 Updated Batch to use DocHandlerBase, AbstractCommonList. X-Git-Url: https://git.aero2k.de/?a=commitdiff_plain;h=1fbdb8e3c63bd4de5be6be90c9bc300fd8443cf0;p=tmp%2Fjakarta-migration.git CSPACE-3332, CSPACE-3784 Updated Batch to use DocHandlerBase, AbstractCommonList. --- diff --git a/services/batch/client/src/main/java/org/collectionspace/services/client/BatchClient.java b/services/batch/client/src/main/java/org/collectionspace/services/client/BatchClient.java index 82c06e016..48d7b0f20 100644 --- a/services/batch/client/src/main/java/org/collectionspace/services/client/BatchClient.java +++ b/services/batch/client/src/main/java/org/collectionspace/services/client/BatchClient.java @@ -16,11 +16,6 @@ */ 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 { +public class BatchClient extends AbstractCommonListPoxServiceClientImpl { 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 readList() { - return getProxy().readList(); - } - public BatchCommonList readList2(){ BatchCommonList list = readList().getEntity(BatchCommonList.class); return list; } + */ } diff --git a/services/batch/client/src/main/java/org/collectionspace/services/client/BatchProxy.java b/services/batch/client/src/main/java/org/collectionspace/services/client/BatchProxy.java index 88af51a30..e30237860 100644 --- a/services/batch/client/src/main/java/org/collectionspace/services/client/BatchProxy.java +++ b/services/batch/client/src/main/java/org/collectionspace/services/client/BatchProxy.java @@ -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 { - // List - @GET - ClientResponse readList(); - - @Override - @GET - @Produces({"application/xml"}) - ClientResponse readIncludeDeleted( - @QueryParam(WorkflowClient.WORKFLOW_QUERY_NONDELETED) String includeDeleted); - - @Override - @GET - @Produces({"application/xml"}) - ClientResponse keywordSearchIncludeDeleted( - @QueryParam(IQueryManager.SEARCH_TYPE_KEYWORDS_KW) String keywords, - @QueryParam(WorkflowClient.WORKFLOW_QUERY_NONDELETED) String includeDeleted); +public interface BatchProxy extends CollectionSpaceCommonListPoxProxy { } diff --git a/services/batch/client/src/test/java/org/collectionspace/services/client/test/BatchServiceTest.java b/services/batch/client/src/test/java/org/collectionspace/services/client/test/BatchServiceTest.java index 14467be10..5aeed3bbc 100644 --- a/services/batch/client/src/test/java/org/collectionspace/services/client/test/BatchServiceTest.java +++ b/services/batch/client/src/test/java/org/collectionspace/services/client/test/BatchServiceTest.java @@ -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 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 res = client.readList(); + ClientResponse 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 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); } } diff --git a/services/batch/jaxb/src/main/resources/batch_common.xsd b/services/batch/jaxb/src/main/resources/batch_common.xsd index 74baecf95..4fe6ab3b4 100644 --- a/services/batch/jaxb/src/main/resources/batch_common.xsd +++ b/services/batch/jaxb/src/main/resources/batch_common.xsd @@ -39,37 +39,5 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/services/common/src/main/cspace/config/services/tenants/tenant-bindings-proto.xml b/services/common/src/main/cspace/config/services/tenants/tenant-bindings-proto.xml index 3b3fff016..faccf45bc 100644 --- a/services/common/src/main/cspace/config/services/tenants/tenant-bindings-proto.xml +++ b/services/common/src/main/cspace/config/services/tenants/tenant-bindings-proto.xml @@ -563,14 +563,7 @@ default-domain org.collectionspace.services.batch.nuxeo.BatchDocumentModelHandler - org.collectionspace.services.batch.nuxeo.BatchDocumentModelHandler - batch - batch - name|uri|csid - org.collectionspace.services.batch.BatchCommonList - org.collectionspace.services.batch.BatchCommonList$BatchListItem - getBatchListItem name