]> git.aero2k.de Git - tmp/jakarta-migration.git/commitdiff
CSPACE-4172,CSPACE-3332: Revised ObjectExit service to return CommonList format for...
authorAron Roberts <aron@socrates.berkeley.edu>
Thu, 21 Jul 2011 21:24:03 +0000 (21:24 +0000)
committerAron Roberts <aron@socrates.berkeley.edu>
Thu, 21 Jul 2011 21:24:03 +0000 (21:24 +0000)
services/common/src/main/cspace/config/services/tenants/tenant-bindings-proto.xml
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/objectexit/client/src/test/java/org/collectionspace/services/client/test/ObjectExitServiceTest.java
services/objectexit/jaxb/src/main/resources/objectexit_common.xsd
services/objectexit/service/src/test/java/org/collectionspace/services/test/ObjectExitServiceTest.java

index 91f2a87611cb33b389c2d5301e47d3948c4bbf2c..3b3fff016cffdae980d2acbad31db12c944075de 100644 (file)
       <service:DocHandlerParams xmlns:service="http://collectionspace.org/services/common/service">
         <service:classname>org.collectionspace.services.objectexit.nuxeo.ObjectExitDocumentModelHandler</service:classname>
         <service:params>
-          <service:SchemaName>objectexit</service:SchemaName>
-          <service:DublinCoreTitle>objectexit</service:DublinCoreTitle>
-          <service:SummaryFields>exitNumber|currentOwner|uri|csid</service:SummaryFields>
-          <service:AbstractCommonListClassname>org.collectionspace.services.objectexit.ObjectexitCommonList</service:AbstractCommonListClassname>
-          <service:CommonListItemClassname>org.collectionspace.services.objectexit.ObjectexitCommonList$ObjectexitListItem</service:CommonListItemClassname>
-          <service:ListResultsItemMethodName>getObjectexitListItem</service:ListResultsItemMethodName>
           <service:ListResultsFields>
             <service:ListResultField>
               <service:element>exitNumber</service:element>
index 5851400f6db9b1f0246bc422160970e271f14f1c..a7b4d132bd2eace90b9757970b5a5a14fadb95c0 100644 (file)
  */
 package org.collectionspace.services.client;
 
-import org.collectionspace.services.jaxb.AbstractCommonList;
-import org.collectionspace.services.objectexit.ObjectexitCommonList;
-
-import org.jboss.resteasy.client.ClientResponse;
-
 /**
  * ObjectExitClient.java
  *
@@ -28,39 +23,28 @@ import org.jboss.resteasy.client.ClientResponse;
  * $LastChangedDate: 2010-05-17 18:25:37 -0700 (Mon, 17 May 2010) $
  *
  */
-public class ObjectExitClient extends AbstractPoxServiceClientImpl<ObjectexitCommonList, 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; 
+public class ObjectExitClient extends AbstractCommonListPoxServiceClientImpl<ObjectExitProxy> {
 
-       @Override
-       public String getServiceName() {
-               return SERVICE_NAME;
-       }
-       
-       @Override
+    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_PATH_PROXY = SERVICE_PATH + "/";        
+    public static final String SERVICE_PAYLOAD_NAME = SERVICE_NAME;
+
+    @Override
+    public String getServiceName() {
+        return SERVICE_NAME;
+    }
+
+    @Override
     public String getServicePathComponent() {
         return SERVICE_PATH_COMPONENT;
     }
 
-       @Override
-       public Class<ObjectExitProxy> getProxyClass() {
-               // TODO Auto-generated method stub
-               return ObjectExitProxy.class;
-       }
-
-       /*
-        * Proxied service calls.
-        * 
-        */
-       
-    public ClientResponse<ObjectexitCommonList> readList() {
-        return getProxy().readList();
+    @Override
+    public Class<ObjectExitProxy> getProxyClass() {
+        // TODO Auto-generated method stub
+        return ObjectExitProxy.class;
     }
 
-    public ObjectexitCommonList readList2(){
-        ObjectexitCommonList list = readList().getEntity(ObjectexitCommonList.class);
-        return list;
-    }
 }
index 49189d2af2f387234ac0999d210d81291672627b..f9eb9e4aeca985308c6c45c43fbf65690b75d73a 100644 (file)
@@ -1,38 +1,14 @@
 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.objectexit.ObjectexitCommonList;
-
 
 /**
  * @version $Revision: 2108 $
  */
-@Path(ObjectExitClient.SERVICE_PATH + "/")
+@Path(ObjectExitClient.SERVICE_PATH_PROXY)
 @Produces({"application/xml"})
 @Consumes({"application/xml"})
-public interface ObjectExitProxy extends CollectionSpacePoxProxy<ObjectexitCommonList> {
-    // List
-    @GET
-    ClientResponse<ObjectexitCommonList> readList();
-    
-    @Override
-       @GET
-    @Produces({"application/xml"})
-    ClientResponse<ObjectexitCommonList> readIncludeDeleted(
-            @QueryParam(WorkflowClient.WORKFLOW_QUERY_NONDELETED) String includeDeleted);
-
-    @Override
-    @GET
-    @Produces({"application/xml"})
-    ClientResponse<ObjectexitCommonList> keywordSearchIncludeDeleted(
-               @QueryParam(IQueryManager.SEARCH_TYPE_KEYWORDS_KW) String keywords,
-            @QueryParam(WorkflowClient.WORKFLOW_QUERY_NONDELETED) String includeDeleted);
+public interface ObjectExitProxy extends CollectionSpaceCommonListPoxProxy {
 }
index 0e4dba46274fa5d9a391da5474a52e89219e101a..f72ef4bc203da20ea37f571e139da5baeb45ccde 100644 (file)
  */
 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.ObjectExitClient;
-import org.collectionspace.services.client.ObjectExitProxy;
 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.objectexit.ObjectexitCommonList;
 import org.collectionspace.services.objectexit.ObjectexitCommon;
 
 import org.jboss.resteasy.client.ClientResponse;
@@ -75,7 +72,7 @@ public class ObjectExitServiceTest extends AbstractServiceTestImpl {
 
     @Override
     protected AbstractCommonList getAbstractCommonList(ClientResponse<AbstractCommonList> response) {
-        return response.getEntity(ObjectexitCommonList.class);
+        return response.getEntity(AbstractCommonList.class);
     }
 
     @Override
@@ -122,41 +119,20 @@ public class ObjectExitServiceTest extends AbstractServiceTestImpl {
         logger.debug(testBanner(testName, CLASS_NAME));
         setupReadList();
         ObjectExitClient client = new ObjectExitClient();
-        ClientResponse<ObjectexitCommonList> res = client.readList();
+        ClientResponse<AbstractCommonList> res = client.readList();
         String bar = "\r\n\r\n=================================\r\n\r\n";
         System.out.println(bar+" res: "+res);
-        ObjectexitCommonList  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++;
-            }
-        }
-
-        /*
-        List<AbstractCommonList.ListItem> items = list.getListItem();
-        int i = 0;
-        for(AbstractCommonList.ListItem item : items){
-            List<Element> elList = item.getAny();
-            StringBuilder elementStrings = new StringBuilder();
-            for(Element el : elList) {
-                Node textEl = el.getFirstChild();
-                if (textEl != null){
-                    elementStrings.append("["+el.getNodeName()+":"+textEl.getNodeValue()+"] ");
-                }
-            }
-            System.out.println("\r\n\r\n\r\n~~~~~~~~~~~~~~~~~~~~~~~~~~~"+testName + ": list-item[" + i + "]: "+elementStrings.toString());
-            i++;
+        // Optionally output additional data about list members for debugging.
+        boolean iterateThroughList = true;
+        if(iterateThroughList && logger.isDebugEnabled()){
+               ListItemsInAbstractCommonList(list, logger, testName);
         }
-        */
+        
     }
 
     @Override
index 75fce14005dd7334642650f52ded6c0e46138f6c..c82c14a5c53a1cc77a72f47b3142c585fa13770b 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>
-
-
-    <!-- objectexit records, as in nuxeo repository -->
-    <xs:element name="objectexit-common-list">
-        <xs:complexType>
-            <xs:complexContent>
-                <xs:extension base="abstractCommonList">
-                    <xs:sequence>
-                        <xs:element name="objectexit-list-item" maxOccurs="unbounded">
-                            <xs:complexType>
-                                <xs:sequence>
-                                    <xs:element name="exitNumber" type="xs:string"
-                                        minOccurs="1" />
-                                    <xs:element name="currentOwner" 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 bec77cb2c03b403eaf95977e76046bb76b4af18d..4b254c18404d6309927b51bf08e8e400e8aec2de 100644 (file)
@@ -1,8 +1,5 @@
 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.
  *