*/
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
*
* $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;
/*
* Proxied service calls.
*
- */
- public ClientResponse<BatchCommonList> readList() {
- return getProxy().readList();
- }
-
public BatchCommonList readList2(){
BatchCommonList list = readList().getEntity(BatchCommonList.class);
return list;
}
+ */
}
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 $
@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 {
}
*/
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.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;
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 {
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);
}
}
</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>
<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>