]> git.aero2k.de Git - tmp/jakarta-migration.git/commitdiff
CSPACE-577 - Make the set of fields returned for lists, be configurable in the tenant...
authorPatrick Schmitz <pschmitz@berkeley.edu>
Sat, 12 Feb 2011 00:35:19 +0000 (00:35 +0000)
committerPatrick Schmitz <pschmitz@berkeley.edu>
Sat, 12 Feb 2011 00:35:19 +0000 (00:35 +0000)
39 files changed:
services/acquisition/client/src/main/java/org/collectionspace/services/client/AcquisitionClient.java
services/acquisition/client/src/main/java/org/collectionspace/services/client/AcquisitionProxy.java
services/acquisition/client/src/test/java/org/collectionspace/services/client/test/AcquisitionServiceTest.java
services/acquisition/jaxb/src/main/resources/acquisitions_common.xsd
services/acquisition/service/src/main/java/org/collectionspace/services/acquisition/AcquisitionResource.java
services/acquisition/service/src/main/java/org/collectionspace/services/acquisition/nuxeo/AcquisitionDocumentModelHandler.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/blob/client/src/test/java/org/collectionspace/services/client/test/BlobServiceTest.java
services/blob/service/src/main/java/org/collectionspace/services/blob/BlobResource.java
services/blob/service/src/main/java/org/collectionspace/services/blob/nuxeo/BlobDocumentModelHandler.java
services/common/src/main/cspace/config/services/tenants/collectionspace/tenant-bindings.xml
services/common/src/main/cspace/config/services/tenants/hearstmuseum/tenant-bindings.xml
services/common/src/main/java/org/collectionspace/services/common/blob/BlobInput.java
services/common/src/main/java/org/collectionspace/services/common/imaging/nuxeo/NuxeoImageUtils.java
services/common/src/main/java/org/collectionspace/services/nuxeo/client/java/CommonList.java [new file with mode: 0644]
services/common/src/main/java/org/collectionspace/services/nuxeo/client/java/DocHandlerBase.java
services/common/src/main/java/org/collectionspace/services/nuxeo/client/java/ObjectFactory.java [new file with mode: 0644]
services/common/src/main/java/org/collectionspace/services/nuxeo/client/java/package-info.java [new file with mode: 0644]
services/common/src/main/resources/service.xsd
services/jaxb/src/main/resources/AbstractCommonList.xsd
services/jaxb/src/main/resources/blobs_common.xsd
services/loanin/client/src/main/java/org/collectionspace/services/client/LoaninClient.java
services/loanin/client/src/main/java/org/collectionspace/services/client/LoaninProxy.java
services/loanin/client/src/test/java/org/collectionspace/services/client/test/LoaninServiceTest.java
services/loanin/jaxb/src/main/resources/loansin-common.xsd
services/loanin/service/src/main/java/org/collectionspace/services/loanin/LoaninResource.java
services/loanin/service/src/main/java/org/collectionspace/services/loanin/nuxeo/LoaninDocumentModelHandler.java
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
services/media/service/src/main/java/org/collectionspace/services/media/MediaResource.java
services/media/service/src/main/java/org/collectionspace/services/media/nuxeo/MediaDocumentModelHandler.java
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/main/java/org/collectionspace/services/objectexit/nuxeo/ObjectExitDocumentModelHandler.java

index 972716418db06190c1565f8e4fa68119148a48d9..f8bd3aef6bdaaf0e634d889dd2180df6f7e27dd2 100644 (file)
@@ -2,7 +2,7 @@ package org.collectionspace.services.client;
 
 import javax.ws.rs.core.Response;
 
-import org.collectionspace.services.acquisition.AcquisitionsCommonList;
+import org.collectionspace.services.jaxb.AbstractCommonList;
 import org.collectionspace.services.common.authorityref.AuthorityRefList;
 import org.jboss.resteasy.client.ProxyFactory;
 import org.jboss.resteasy.plugins.providers.RegisterBuiltin;
@@ -77,7 +77,7 @@ public class AcquisitionClient extends AbstractServiceClientImpl {
      * @return
      * @see org.collectionspace.hello.client.IntakeProxy#getIntake()
      */
-    public ClientResponse<AcquisitionsCommonList> readList() {
+    public ClientResponse<AbstractCommonList> readList() {
         return acquisitionProxy.readList();
     }
 
index 2a105603d5d26da84b5d0f9893dfccd6074b168a..6ba5e01a9701baf0ef05ae6f6deae2272d6b6134 100644 (file)
@@ -10,7 +10,7 @@ import javax.ws.rs.PathParam;
 import javax.ws.rs.Produces;
 import javax.ws.rs.core.Response;
 
-import org.collectionspace.services.acquisition.AcquisitionsCommonList;
+import org.collectionspace.services.jaxb.AbstractCommonList;
 import org.collectionspace.services.common.authorityref.AuthorityRefList;
 import org.jboss.resteasy.client.ClientResponse;
 import org.jboss.resteasy.plugins.providers.multipart.MultipartInput;
@@ -26,7 +26,7 @@ public interface AcquisitionProxy extends CollectionSpaceProxy {
 
     @GET
     @Produces({"application/xml"})
-    ClientResponse<AcquisitionsCommonList> readList();
+    ClientResponse<AbstractCommonList> readList();
 
     //(C)reate
     @POST
index 5863acaddbf976aa38b247fb2dee50c4b1a6805a..8213d966f79cd744c8e7a55950c0fdadb1d24fb5 100644 (file)
@@ -28,16 +28,15 @@ import javax.ws.rs.core.Response;
 
 import org.collectionspace.services.client.AcquisitionClient;
 import org.collectionspace.services.client.CollectionSpaceClient;
-import org.collectionspace.services.jaxb.AbstractCommonList;
 
 import org.collectionspace.services.acquisition.AcquisitionsCommon;
-import org.collectionspace.services.acquisition.AcquisitionsCommonList;
 import org.collectionspace.services.acquisition.AcquisitionDateList;
 import org.collectionspace.services.acquisition.AcquisitionFunding;
 import org.collectionspace.services.acquisition.AcquisitionFundingList;
 import org.collectionspace.services.acquisition.AcquisitionSourceList;
 import org.collectionspace.services.acquisition.OwnerList;
 import org.jboss.resteasy.client.ClientResponse;
+import org.collectionspace.services.jaxb.AbstractCommonList;
 
 import org.jboss.resteasy.plugins.providers.multipart.MultipartInput;
 import org.jboss.resteasy.plugins.providers.multipart.MultipartOutput;
@@ -79,7 +78,7 @@ public class AcquisitionServiceTest extends AbstractServiceTestImpl {
     @Override
        protected AbstractCommonList getAbstractCommonList(
                        ClientResponse<AbstractCommonList> response) {
-        return response.getEntity(AcquisitionsCommonList.class);
+        return response.getEntity(AbstractCommonList.class);
     }
 
     // ---------------------------------------------------------------
@@ -390,8 +389,8 @@ public class AcquisitionServiceTest extends AbstractServiceTestImpl {
 
         // Submit the request to the service and store the response.
         AcquisitionClient client = new AcquisitionClient();
-        ClientResponse<AcquisitionsCommonList> res = client.readList();
-        AcquisitionsCommonList list = res.getEntity();
+        ClientResponse<AbstractCommonList> res = client.readList();
+        AbstractCommonList list = res.getEntity();
         int statusCode = res.getStatus();
 
         // Check the status code of the response: does it match
@@ -406,22 +405,14 @@ public class AcquisitionServiceTest extends AbstractServiceTestImpl {
         // Optionally output additional data about list members for debugging.
         boolean iterateThroughList = false;
         if(iterateThroughList && logger.isDebugEnabled()){
-            List<AcquisitionsCommonList.AcquisitionListItem> items =
-                    list.getAcquisitionListItem();
-            int i = 0;
-            for(AcquisitionsCommonList.AcquisitionListItem item : items){
-                logger.debug(testName + ": list-item[" + i + "] csid=" +
-                    item.getCsid());
-                logger.debug(testName + ": list-item[" + i + "] objectNumber=" +
-                    item.getAcquisitionReferenceNumber());
-                logger.debug(testName + ": list-item[" + i + "] acquisitionSource=" +
-                    item.getAcquisitionSource());
-                logger.debug(testName + ": list-item[" + i + "] owner=" +
-                    item.getOwner());
-                logger.debug(testName + ": list-item[" + i + "] URI=" +
-                    item.getUri());
-                i++;
-            }
+               List<AbstractCommonList.ListItem> items =
+                       list.getListItem();
+               int i = 0;
+               for(AbstractCommonList.ListItem item : items){
+                       logger.debug(testName + ": list-item[" + i + "] " +
+                                       item.toString());
+                       i++;
+               }
         }
 
     }
index ac8d05288fc355260cc05d6a0975c9038c14b6c4..6fc452e43031fe97e3d0812a1afedbb1525024d8 100644 (file)
         </xs:annotation>
     </xs:complexType>
 
-    <!-- acquisition records, as in nuxeo repository -->
-    <xs:element name="acquisitions-common-list">
-        <xs:complexType>
-            <xs:complexContent>
-                <xs:extension base="abstractCommonList">                    
-                    <xs:sequence>
-                        <xs:element name="acquisition-list-item" maxOccurs="unbounded">
-                            <xs:complexType>
-                                <xs:sequence>
-                                    <xs:element name="acquisitionReferenceNumber" type="xs:string"
-                                        minOccurs="1" />
-                                    <xs:element name="acquisitionSource" type="xs:string"
-                                        minOccurs="1" />
-                                    <xs:element name="owner" type="xs:string"
-                                        minOccurs="1" />
-                                    <!-- uri to retrive acquisition details -->
-                                    <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 a8113cf5e13612aa831da548659a54d8223dca96..e67b108d542c7f034777c2a4e60455fe9cb34904 100644 (file)
@@ -55,6 +55,9 @@ import org.collectionspace.services.common.query.IQueryManager;
 import org.collectionspace.services.common.query.QueryManager;
 import org.collectionspace.services.common.security.UnauthorizedException;
 import org.collectionspace.services.nuxeo.client.java.DocumentModelHandler;
+import org.collectionspace.services.jaxb.AbstractCommonList;
+import org.collectionspace.services.nuxeo.client.java.CommonList;
+
 import org.jboss.resteasy.plugins.providers.multipart.MultipartInput;
 import org.jboss.resteasy.plugins.providers.multipart.MultipartOutput;
 import org.jboss.resteasy.util.HttpResponseCodes;
@@ -223,9 +226,9 @@ public class AcquisitionResource
      */
     @GET
     @Produces("application/xml")
-    public AcquisitionsCommonList getAcquisitionList(@Context UriInfo ui,
+    public CommonList getAcquisitionList(@Context UriInfo ui,
             @QueryParam(IQueryManager.SEARCH_TYPE_KEYWORDS_KW) String keywords) {
-        AcquisitionsCommonList result = null;
+        CommonList result = null;
         MultivaluedMap<String, String> queryParams = ui.getQueryParameters();
         if (keywords != null) {
             result = searchAcquisitions(queryParams, keywords);
@@ -241,13 +244,13 @@ public class AcquisitionResource
      * 
      * @return the acquisitions list
      */
-    private AcquisitionsCommonList getAcquisitionsList(MultivaluedMap<String, String> queryParams) {
-        AcquisitionsCommonList acquisitionObjectList;
+    private CommonList getAcquisitionsList(MultivaluedMap<String, String> queryParams) {
+        CommonList commonList;
         try {
             ServiceContext<MultipartInput, MultipartOutput> ctx = createServiceContext(queryParams);
             DocumentHandler handler = createDocumentHandler(ctx);
             getRepositoryClient(ctx).getFiltered(ctx, handler);
-            acquisitionObjectList = (AcquisitionsCommonList) handler.getCommonPartList();
+            commonList = (CommonList) handler.getCommonPartList();
         } catch (UnauthorizedException ue) {
             Response response = Response.status(
                     Response.Status.UNAUTHORIZED).entity(
@@ -262,7 +265,7 @@ public class AcquisitionResource
                     ServiceMessages.LIST_FAILED + e.getMessage()).type("text/plain").build();
             throw new WebApplicationException(response);
         }
-        return acquisitionObjectList;
+        return commonList;
     }
 
     /**
@@ -373,7 +376,7 @@ public class AcquisitionResource
     @Path("/search")
     @Produces("application/xml")
     @Deprecated
-    public AcquisitionsCommonList keywordsSearchAcquisitions(@Context UriInfo ui,
+    public CommonList keywordsSearchAcquisitions(@Context UriInfo ui,
             @QueryParam(IQueryManager.SEARCH_TYPE_KEYWORDS) String keywords) {
         MultivaluedMap<String, String> queryParams = ui.getQueryParameters();
         return searchAcquisitions(queryParams, keywords);
@@ -386,10 +389,10 @@ public class AcquisitionResource
      * 
      * @return the acquisitions common list
      */
-    private AcquisitionsCommonList searchAcquisitions(
+    private CommonList searchAcquisitions(
             MultivaluedMap<String, String> queryParams,
             String keywords) {
-        AcquisitionsCommonList acquisitionObjectList;
+        CommonList commonList;
         try {
             ServiceContext<MultipartInput, MultipartOutput> ctx = createServiceContext(queryParams);
             DocumentHandler handler = createDocumentHandler(ctx);
@@ -404,7 +407,7 @@ public class AcquisitionResource
                 }
             }
             getRepositoryClient(ctx).getFiltered(ctx, handler);
-            acquisitionObjectList = (AcquisitionsCommonList) handler.getCommonPartList();
+            commonList = (CommonList) handler.getCommonPartList();
         } catch (UnauthorizedException ue) {
             Response response = Response.status(
                     Response.Status.UNAUTHORIZED).entity(
@@ -419,7 +422,7 @@ public class AcquisitionResource
                     ServiceMessages.SEARCH_FAILED + e.getMessage()).type("text/plain").build();
             throw new WebApplicationException(response);
         }
-        return acquisitionObjectList;
+        return commonList;
     }
 
     /**
index bc262b11c1447fb96830e31f3a03f2146c8928ff..f6a2e024573c7be1b977454959343f6701b40051 100644 (file)
@@ -24,7 +24,6 @@
 package org.collectionspace.services.acquisition.nuxeo;
 
 import org.collectionspace.services.acquisition.AcquisitionsCommon;
-import org.collectionspace.services.jaxb.AbstractCommonList;
 import org.collectionspace.services.nuxeo.client.java.DocHandlerBase;
 
 /** AcquisitionDocumentModelHandler
@@ -32,6 +31,6 @@ import org.collectionspace.services.nuxeo.client.java.DocHandlerBase;
  *  $LastChangedDate: $
  */
 public class AcquisitionDocumentModelHandler
-        extends DocHandlerBase<AcquisitionsCommon, AbstractCommonList> {
+        extends DocHandlerBase<AcquisitionsCommon> {
 }
 
index 9c7e20af8a67173fd919a57d43dc4c355f257f02..510d30e5faae5a568db9f463ea0acc6dd19c3211 100644 (file)
@@ -20,8 +20,7 @@ import javax.ws.rs.PathParam;
 import javax.ws.rs.core.Response;
 
 import org.collectionspace.services.common.authorityref.AuthorityRefList;
-//import org.collectionspace.services.common.context.ServiceContext;
-import org.collectionspace.services.blob.BlobsCommonList;
+import org.collectionspace.services.jaxb.AbstractCommonList;
 
 import org.jboss.resteasy.client.ProxyFactory;
 import org.jboss.resteasy.plugins.providers.RegisterBuiltin;
@@ -97,7 +96,7 @@ public class BlobClient extends AbstractServiceClientImpl {
      * @return
      * @see org.collectionspace.services.client.BlobProxy#getBlob()
      */
-    public ClientResponse<BlobsCommonList> readList() {
+    public ClientResponse<AbstractCommonList> readList() {
         return blobProxy.readList();
     }
     
index 40797d269ceb7a88633a8f409ca5c55df1e49866..18829d9a0423aa6970cf6395f8b62ffa3b5a3fbf 100644 (file)
@@ -11,7 +11,7 @@ import javax.ws.rs.Produces;
 import javax.ws.rs.core.Response;
 
 import org.collectionspace.services.common.authorityref.AuthorityRefList;
-import org.collectionspace.services.blob.BlobsCommonList;
+import org.collectionspace.services.jaxb.AbstractCommonList;
 import org.jboss.resteasy.client.ClientResponse;
 import org.jboss.resteasy.plugins.providers.multipart.MultipartInput;
 import org.jboss.resteasy.plugins.providers.multipart.MultipartOutput;
@@ -46,7 +46,7 @@ public interface BlobProxy extends CollectionSpaceProxy {
     // List
     @GET
     @Produces({"application/xml"})
-    ClientResponse<BlobsCommonList> readList();
+    ClientResponse<AbstractCommonList> readList();
 
     // List Authority References
     @GET
index 64249d0153a1eff9fb67bc6dab84a19c7c9d7115..2dea5714d4f6e683e533689c06c6567766ecb4a2 100644 (file)
@@ -30,7 +30,6 @@ import org.collectionspace.services.client.CollectionSpaceClient;
 import org.collectionspace.services.client.BlobClient;
 import org.collectionspace.services.jaxb.AbstractCommonList;
 import org.collectionspace.services.blob.BlobsCommon;
-import org.collectionspace.services.blob.BlobsCommonList;
 
 import org.jboss.resteasy.client.ClientResponse;
 
@@ -62,7 +61,7 @@ public class BlobServiceTest extends AbstractServiceTestImpl {
 
     @Override
     protected AbstractCommonList getAbstractCommonList(ClientResponse<AbstractCommonList> response) {
-        return response.getEntity(BlobsCommonList.class);
+        return response.getEntity(AbstractCommonList.class);
     }
 
     @Override
@@ -109,16 +108,16 @@ public class BlobServiceTest extends AbstractServiceTestImpl {
         logger.debug(testBanner(testName, CLASS_NAME));
         setupReadList();
         BlobClient client = new BlobClient();
-        ClientResponse<BlobsCommonList> res = client.readList();
-        BlobsCommonList list = res.getEntity();
+        ClientResponse<AbstractCommonList> res = client.readList();
+        AbstractCommonList list = res.getEntity();
         assertStatusCode(res, testName);
         if (logger.isDebugEnabled()) {
-            List<BlobsCommonList.BlobListItem> items = list.getBlobListItem();
+            List<AbstractCommonList.ListItem> items =
+                list.getListItem();
             int i = 0;
-            for (BlobsCommonList.BlobListItem item : items) {
-                logger.debug(testName + ": list-item[" + i + "] csid=" + item.getCsid());
-                logger.debug(testName + ": list-item[" + i + "] blob.name=" + item.getName());
-                logger.debug(testName + ": list-item[" + i + "] URI=" + item.getUri());
+            for(AbstractCommonList.ListItem item : items){
+                logger.debug(testName + ": list-item[" + i + "] " +
+                        item.toString());
                 i++;
             }
         }
index 762935527e3469a594546c498d6919c5339b05cb..bb0fd3444d86c21f138657f5fa2fe79e4f06e6d0 100644 (file)
@@ -37,7 +37,10 @@ import org.collectionspace.services.common.context.ServiceContext;
 import org.collectionspace.services.common.document.DocumentHandler;
 import org.collectionspace.services.blob.nuxeo.BlobDocumentModelHandler; //FIXEME: A resource class should not have a dependency on a specific DocumentHandler
 import org.collectionspace.services.blob.BlobsCommon;
-import org.collectionspace.services.blob.BlobsCommonList;
+//import org.collectionspace.services.blob.BlobsCommonList;
+import org.collectionspace.services.jaxb.AbstractCommonList;
+import org.collectionspace.services.nuxeo.client.java.CommonList;
+import javax.xml.parsers.ParserConfigurationException;
 
 import org.jboss.resteasy.plugins.providers.multipart.InputPart;
 import org.jboss.resteasy.plugins.providers.multipart.MultipartInput;
@@ -93,23 +96,23 @@ public class BlobResource extends ResourceBase {
 
     //FIXME: Is this method used/needed?
     @Deprecated
-    private BlobsCommonList getBlobList(MultivaluedMap<String, String> queryParams) {
-        return (BlobsCommonList)getList(queryParams);
+    private CommonList getBlobList(MultivaluedMap<String, String> queryParams) {
+        return (CommonList)getList(queryParams);
     }
 
     @Deprecated
-    public BlobsCommonList getBlobList(List<String> csidList) {
-        return (BlobsCommonList) getList(csidList);
+    public CommonList getBlobList(List<String> csidList) {
+        return (CommonList) getList(csidList);
     }
 
     @Deprecated
-    protected BlobsCommonList search(MultivaluedMap<String,String> queryParams,String keywords) {
-         return (BlobsCommonList) super.search(queryParams, keywords);
+    protected CommonList search(MultivaluedMap<String,String> queryParams,String keywords) {
+         return (CommonList) super.search(queryParams, keywords);
     }
     
-    private BlobsCommonList getDerivativeList(ServiceContext<MultipartInput, MultipartOutput> ctx,
+    private CommonList getDerivativeList(ServiceContext<MultipartInput, MultipartOutput> ctx,
                String csid) throws Exception {
-       BlobsCommonList result = null;
+       CommonList result = null;
        
        BlobInput blobInput = new BlobInput();
        blobInput.setDerivativeListRequested(true);
@@ -267,9 +270,9 @@ public class BlobResource extends ResourceBase {
     @GET
     @Path("{csid}/derivatives")
     @Produces("application/xml")
-    public BlobsCommonList getDerivatives(
+    public CommonList getDerivatives(
                @PathParam("csid") String csid) {
-       BlobsCommonList result = null;
+       CommonList result = null;
 
        ensureCSID(csid, READ);
         try {
index e79ae7dd299090f389dcd21ffaac421de04e0846..8cac45583d6fe9a95992e35a74ab3b561ba3d5e7 100644 (file)
@@ -24,7 +24,6 @@
 package org.collectionspace.services.blob.nuxeo;
 
 import org.collectionspace.services.blob.BlobsCommon;
-import org.collectionspace.services.blob.BlobsCommonList;
 import org.collectionspace.services.nuxeo.client.java.DocHandlerBase;
 import org.collectionspace.services.common.blob.BlobInput;
 import org.collectionspace.services.common.blob.BlobOutput;
@@ -34,6 +33,8 @@ import org.collectionspace.services.common.document.DocumentWrapper;
 import org.collectionspace.services.common.imaging.nuxeo.NuxeoImageUtils;
 import org.collectionspace.services.jaxb.AbstractCommonList;
 import org.collectionspace.services.jaxb.BlobJAXBSchema;
+import org.collectionspace.services.jaxb.AbstractCommonList;
+import org.collectionspace.services.nuxeo.client.java.CommonList;
 import org.nuxeo.ecm.core.api.ClientException;
 import org.nuxeo.ecm.core.api.DocumentModel;
 import org.nuxeo.ecm.core.api.repository.RepositoryInstance;
@@ -47,7 +48,7 @@ import java.util.List;
  * The Class BlobDocumentModelHandler.
  */
 public class BlobDocumentModelHandler
-extends DocHandlerBase<BlobsCommon, AbstractCommonList> {
+extends DocHandlerBase<BlobsCommon> {
 
        /** The logger. */
        private final Logger logger = LoggerFactory.getLogger(BlobDocumentModelHandler.class);
@@ -110,7 +111,7 @@ extends DocHandlerBase<BlobsCommon, AbstractCommonList> {
                String blobRepositoryId = blobsCommon.getRepositoryId(); //cache the value to pass to the blob retriever
                
                if (blobInput.isDerivativeListRequested() == true) {
-                       BlobsCommonList blobsCommonList = NuxeoImageUtils.getBlobDerivatives(
+                       CommonList blobsCommonList = NuxeoImageUtils.getBlobDerivatives(
                                        repoSession, blobRepositoryId, getDerivativePathBase(docModel));
 //                     ctx.setProperty(BlobInput.BLOB_DERIVATIVE_LIST_KEY, blobsCommonList);
                        blobInput.setDerivativeList(blobsCommonList);
index 3691e62483cf8bc8973934e727d502145b679d1e..458ca085cdada8ebe35cce26ae3a23d0b164c623 100644 (file)
             <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>org.collectionspace.services.blob.BlobsCommonList</service:AbstractCommonListClassname>
-                    <service:CommonListItemClassname>org.collectionspace.services.blob.BlobsCommonList$BlobListItem</service:CommonListItemClassname>
-                    <service:ListResultsItemMethodName>getBlobListItem</service:ListResultsItemMethodName>
-                    <service:ListResultsFields>
-                        <service:ListResultField>
-                            <service:setter>setName</service:setter>
-                            <service:xpath>name</service:xpath>
-                        </service:ListResultField>
+                     <service:SchemaName>blobs</service:SchemaName>
+                     <service:DublinCoreTitle>blobs</service:DublinCoreTitle>
+                     <service:SummaryFields>name|mimeType|encoding|length|uri|csid</service:SummaryFields>
+                     <service:AbstractCommonListClassname>org.collectionspace.services.blob.BlobsCommonList</service:AbstractCommonListClassname>
+                     <service:CommonListItemClassname>org.collectionspace.services.blob.BlobsCommonList$BlobListItem</service:CommonListItemClassname>
+                     <service:ListResultsItemMethodName>getBlobListItem</service:ListResultsItemMethodName>
+                     <service:ListResultsFields>
+                         <service:ListResultField>
+                             <service:element>name</service:element>
+                             <service:xpath>name</service:xpath>
+                         </service:ListResultField>
 
                         <service:ListResultField>
-                            <service:setter>setMimeType</service:setter>
-                            <service:xpath>mimeType</service:xpath>
+                            <service:element>mimeType</service:element>
+                                                                                                               <service:xpath>mimeType</service:xpath>
                         </service:ListResultField>
 
                         <service:ListResultField>
-                            <service:setter>setEncoding</service:setter>
+                            <service:element>encoding</service:element>
                             <service:xpath>encoding</service:xpath>
                         </service:ListResultField>
 
                         <service:ListResultField>
-                            <service:setter>setLength</service:setter>
+                            <service:element>length</service:element>
                             <service:xpath>length</service:xpath>
-                        </service:ListResultField>
-                    </service:ListResultsFields>
+                                                                                               </service:ListResultField>
+                                                                                       </service:ListResultsFields>
                 </service:params>
             </service:DocHandlerParams>
             <service:validatorHandler xmlns:service='http://collectionspace.org/services/common/service'>
                         <types:item><types:key>authRef</types:key><types:value>valuer</types:value></types:item>
                         <types:item><types:key>authRef</types:key><types:value>insurers|insurer</types:value></types:item>
                         <types:item><types:key>authRef</types:key><types:value>conditionCheckersOrAssessors|conditionCheckerOrAssessor</types:value></types:item>
-                    </service:properties>
+                   </service:properties>
                     <service:content contentType="application/xml">
                         <service:xmlContent
                             namespaceURI="http://collectionspace.org/services/intake"
             <service:DocHandlerParams xmlns:service='http://collectionspace.org/services/common/service'>
                 <service:classname>org.collectionspace.services.loanin.nuxeo.LoaninDocumentModelHandler</service:classname>
                 <service:params>
-                    <service:SchemaName>loansin</service:SchemaName>
-                    <service:DublinCoreTitle>loansin</service:DublinCoreTitle>
-                    <service:SummaryFields>loanInNumber|lenderList|loanReturnDate|uri|csid</service:SummaryFields>
-                    <service:AbstractCommonListClassname>org.collectionspace.services.loanin.LoansinCommonList</service:AbstractCommonListClassname>
-                    <service:CommonListItemClassname>org.collectionspace.services.loanin.LoansinCommonList$LoaninListItem</service:CommonListItemClassname>
-                    <service:ListResultsItemMethodName>getLoaninListItem</service:ListResultsItemMethodName>
-                    <service:ListResultsFields>
-                        <service:ListResultField>
-                            <service:setter>setLoanInNumber</service:setter>
-                            <service:xpath>loanInNumber</service:xpath>
-                        </service:ListResultField>
+                     <service:SchemaName>loansin</service:SchemaName>
+                     <service:DublinCoreTitle>loansin</service:DublinCoreTitle>
+                     <service:SummaryFields>loanInNumber|lenderList|loanReturnDate|uri|csid</service:SummaryFields>
+                     <service:AbstractCommonListClassname>org.collectionspace.services.loanin.LoansinCommonList</service:AbstractCommonListClassname>
+                     <service:CommonListItemClassname>org.collectionspace.services.loanin.LoansinCommonList$LoaninListItem</service:CommonListItemClassname>
+                     <service:ListResultsItemMethodName>getLoaninListItem</service:ListResultsItemMethodName>
+                     <service:ListResultsFields>
+                         <service:ListResultField>
+                             <service:element>loanInNumber</service:element>
+                             <service:xpath>loanInNumber</service:xpath>
+                         </service:ListResultField>
                         <service:ListResultField>
-                            <service:setter>setLender</service:setter>
-                            <service:xpath>lenderGroupList/[0]/lender</service:xpath>
+                            <service:element>lender</service:element>
+                                                                                                               <service:xpath>lenderGroupList/[0]/lender</service:xpath>
                         </service:ListResultField>
                         <service:ListResultField>
-                            <service:setter>setLoanReturnDate</service:setter>
+                            <service:element>loanReturnDate</service:element>
                             <service:xpath>loanReturnDate</service:xpath>
                         </service:ListResultField>
                     </service:ListResultsFields>
                 </s:params>
             </s:initHandler>
             <tenant:properties>
-                <types:item><types:key>datePattern</types:key><types:value>MMM dd, yyyy</types:value></types:item>
-                <types:item><types:key>datePattern</types:key><types:value>dd.MM.yyyy</types:value></types:item>
-                <!-- <types:item><types:key>datePattern</types:key><types:value>dd/MM/yyyy</types:value></types:item> -->
-                <types:item><types:key>localeLanguage</types:key><types:value>en</types:value></types:item>
-                <!-- <types:item><types:key>localeLanguage</types:key><types:value>da</types:value></types:item> -->
-            </tenant:properties>
+            <types:item><types:key>datePattern</types:key><types:value>MMM dd, yyyy</types:value></types:item>
+            <types:item><types:key>datePattern</types:key><types:value>dd.MM.yyyy</types:value></types:item>
+            <!-- <types:item><types:key>datePattern</types:key><types:value>dd/MM/yyyy</types:value></types:item> -->
+            <types:item><types:key>localeLanguage</types:key><types:value>en</types:value></types:item>
+            <!-- <types:item><types:key>localeLanguage</types:key><types:value>da</types:value></types:item> -->
+        </tenant:properties>
 
 
             <service:properties xmlns:service='http://collectionspace.org/services/common/service'>
             <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:setter>setExitNumber</service:setter>
-                            <service:xpath>exitNumber</service:xpath>
-                        </service:ListResultField>
+                     <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>
+                             <service:xpath>exitNumber</service:xpath>
+                         </service:ListResultField>
                         <service:ListResultField>
-                            <service:setter>setCurrentOwner</service:setter>
-                            <service:xpath>currentOwner</service:xpath>
+                            <service:element>currentOwner</service:element>
+                                                                                                               <service:xpath>currentOwner</service:xpath>
                         </service:ListResultField>
-                    </service:ListResultsFields>
+                                                                                       </service:ListResultsFields>
                 </service:params>
             </service:DocHandlerParams>
             <service:validatorHandler xmlns:service='http://collectionspace.org/services/common/service'>
             <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|uri|csid</service:SummaryFields>
-                    <service:AbstractCommonListClassname>org.collectionspace.services.media.MediaCommonList</service:AbstractCommonListClassname>
-                    <service:CommonListItemClassname>org.collectionspace.services.media.MediaCommonList$MediaListItem</service:CommonListItemClassname>
-                    <service:ListResultsItemMethodName>getMediaListItem</service:ListResultsItemMethodName>
-                    <service:ListResultsFields>
-                        <service:ListResultField>
-                            <service:setter>setTitle</service:setter>
-                            <service:xpath>title</service:xpath>
-                        </service:ListResultField>
+                     <service:SchemaName>media</service:SchemaName>
+                     <service:DublinCoreTitle>media</service:DublinCoreTitle>
+                     <service:SummaryFields>title|source|filename|identificationNumber|uri|csid</service:SummaryFields>
+                     <service:AbstractCommonListClassname>org.collectionspace.services.media.MediaCommonList</service:AbstractCommonListClassname>
+                     <service:CommonListItemClassname>org.collectionspace.services.media.MediaCommonList$MediaListItem</service:CommonListItemClassname>
+                     <service:ListResultsItemMethodName>getMediaListItem</service:ListResultsItemMethodName>
+                     <service:ListResultsFields>
+                         <service:ListResultField>
+                             <service:element>title</service:element>
+                             <service:xpath>title</service:xpath>
+                         </service:ListResultField>
                         <service:ListResultField>
-                            <service:setter>setSource</service:setter>
-                            <service:xpath>source</service:xpath>
+                            <service:element>source</service:element>
+                                                                                                               <service:xpath>source</service:xpath>
                         </service:ListResultField>
                         <service:ListResultField>
-                            <service:setter>setFilename</service:setter>
+                            <service:element>filename</service:element>
                             <service:xpath>filename</service:xpath>
                         </service:ListResultField>
                         <service:ListResultField>
-                            <service:setter>setIdentificationNumber</service:setter>
+                            <service:element>identificationNumber</service:element>
                             <service:xpath>identificationNumber</service:xpath>
-                        </service:ListResultField>
-                    </service:ListResultsFields>
+                                                                                               </service:ListResultField>
+                                                                                       </service:ListResultsFields>
                 </service:params>
             </service:DocHandlerParams>
             <service:validatorHandler xmlns:service='http://collectionspace.org/services/common/service'>
                         <types:item><types:key>authRef</types:key><types:value>publisher</types:value></types:item>
                         <types:item><types:key>authRef</types:key><types:value>rightsHolder</types:value></types:item>
                         <types:item><types:key>authRef</types:key><types:value>subjects|subject</types:value></types:item>
-                    </service:properties>
+                   </service:properties>
                     <service:content contentType="application/xml">
                         <service:xmlContent
                             namespaceURI="http://collectionspace.org/services/media"
                         <service:col>shortidentifier</service:col>
                     </service:field>
                 </service:params>
-            </service:initHandler>
+            </service:initHandler>                                             
             <service:object id="1" name="Organization" version="0.1"
                             xmlns:service='http://collectionspace.org/services/common/service'>
                 <service:part id="0" control_group="Managed"
                         <service:col>shortidentifier</service:col>
                     </service:field>
                 </service:params>
-            </service:initHandler>
+            </service:initHandler>                                             
             <service:object id="1" name="Locationitem" version="0.1"
                             xmlns:service='http://collectionspace.org/services/common/service'>
                 <service:part id="0" control_group="Managed"
             <service:DocHandlerParams xmlns:service='http://collectionspace.org/services/common/service'>
                 <service:classname>org.collectionspace.services.loanin.nuxeo.AcquisitionDocumentModelHandler</service:classname>
                 <service:params>
-                    <service:SchemaName>acquisition</service:SchemaName>
-                    <service:DublinCoreTitle>acquisition</service:DublinCoreTitle>
-                    <service:SummaryFields>acquisitionReferenceNumber|acquisitionSources|owners|uri|csid</service:SummaryFields>
-                    <service:AbstractCommonListClassname>org.collectionspace.services.acquisition.AcquisitionsCommonList</service:AbstractCommonListClassname>
-                    <service:CommonListItemClassname>org.collectionspace.services.acquisition.AcquisitionsCommonList$AcquisitionListItem</service:CommonListItemClassname>
-                    <service:ListResultsItemMethodName>getAcquisitionListItem</service:ListResultsItemMethodName>
-                    <service:ListResultsFields>
+                     <service:SchemaName>acquisition</service:SchemaName>
+                     <service:DublinCoreTitle>acquisition</service:DublinCoreTitle>
+                     <service:SummaryFields>acquisitionReferenceNumber|acquisitionSources|owners|uri|csid</service:SummaryFields>
+                     <service:AbstractCommonListClassname>org.collectionspace.services.acquisition.AcquisitionsCommonList</service:AbstractCommonListClassname>
+                     <service:CommonListItemClassname>org.collectionspace.services.acquisition.AcquisitionsCommonList$AcquisitionListItem</service:CommonListItemClassname>
+                     <service:ListResultsItemMethodName>getAcquisitionListItem</service:ListResultsItemMethodName>
+                     <service:ListResultsFields>
+                         <service:ListResultField>
+                             <service:element>acquisitionReferenceNumber</service:element>
+                             <service:xpath>acquisitionReferenceNumber</service:xpath>
+                         </service:ListResultField>
                         <service:ListResultField>
-                            <service:setter>setAcquisitionReferenceNumber</service:setter>
-                            <service:xpath>acquisitionReferenceNumber</service:xpath>
+                            <service:element>acquisitionSource</service:element>
+                                                                                                               <service:xpath>acquisitionSources/[0]</service:xpath>
                         </service:ListResultField>
                         <service:ListResultField>
-                            <service:setter>setAcquisitionSource</service:setter>
-                            <service:xpath>acquisitionSources/[0]</service:xpath>
-                        </service:ListResultField>
-                        <service:ListResultField>
-                            <service:setter>setOwner</service:setter>
+                            <service:element>owner</service:element>
                             <service:xpath>owners/[0]</service:xpath>
                         </service:ListResultField>
                     </service:ListResultsFields>
             </service:object>
         </tenant:serviceBindings>
         <!-- end role-permission service meta-data -->
-
+        
         <!-- begin role-account service meta-data -->
         <!-- the following service is same as account/accountroles service -->
         <!-- except that it is available as a sub resource of the role service -->
                 </service:part>
             </service:object>
         </tenant:serviceBindings>
-
+        
     </tenant:tenantBinding>
     <!-- end collectionspace.org tenant meta-data -->
 
-
 </tenant:TenantBindingConfig>
index 57697856ac7718c5e29054a0f262e0bbc2751413..7bfb78098d7b68674bf945a044efceaff5c9abce 100644 (file)
                     <service:ListResultsItemMethodName>getBlobListItem</service:ListResultsItemMethodName>
                     <service:ListResultsFields>
                         <service:ListResultField>
-                            <service:setter>setName</service:setter>
+                            <service:element>name</service:element>
                             <service:xpath>name</service:xpath>
                         </service:ListResultField>
                         <service:ListResultField>
-                            <service:setter>setMimeType</service:setter>
+                            <service:element>mimeType</service:element>
                             <service:xpath>mimeType</service:xpath>
                         </service:ListResultField>
                         <service:ListResultField>
-                            <service:setter>setEncoding</service:setter>
+                            <service:element>encoding</service:element>
                             <service:xpath>encoding</service:xpath>
                         </service:ListResultField>
                         <service:ListResultField>
-                            <service:setter>setLength</service:setter>
+                            <service:element>length</service:element>
                             <service:xpath>length</service:xpath>
                         </service:ListResultField>
                     </service:ListResultsFields>
                     <service:ListResultsItemMethodName>getLoaninListItem</service:ListResultsItemMethodName>
                     <service:ListResultsFields>
                         <service:ListResultField>
-                            <service:setter>setLoanInNumber</service:setter>
+                            <service:element>loanInNumber</service:element>
                             <service:xpath>loanInNumber</service:xpath>
                         </service:ListResultField>
                         <service:ListResultField>
-                            <service:setter>setLender</service:setter>
+                            <service:element>lender</service:element>
                             <service:xpath>lenderGroupList/[0]/lender</service:xpath>
                         </service:ListResultField>
                         <service:ListResultField>
-                            <service:setter>setLoanReturnDate</service:setter>
+                            <service:element>loanReturnDate</service:element>
                             <service:xpath>loanReturnDate</service:xpath>
                         </service:ListResultField>
                     </service:ListResultsFields>
                     <service:ListResultsItemMethodName>getObjectexitListItem</service:ListResultsItemMethodName>
                     <service:ListResultsFields>
                         <service:ListResultField>
-                            <service:setter>setExitNumber</service:setter>
+                            <service:element>exitNumber</service:element>
                             <service:xpath>exitNumber</service:xpath>
                         </service:ListResultField>
 
                         <service:ListResultField>
-                            <service:setter>setCurrentOwner</service:setter>
+                            <service:element>currentOwner</service:element>
                             <service:xpath>currentOwner</service:xpath>
                         </service:ListResultField>
                     </service:ListResultsFields>
                     <service:ListResultsItemMethodName>getMediaListItem</service:ListResultsItemMethodName>
                     <service:ListResultsFields>
                         <service:ListResultField>
-                            <service:setter>setTitle</service:setter>
+                            <service:element>title</service:element>
                             <service:xpath>title</service:xpath>
                         </service:ListResultField>
                         <service:ListResultField>
-                            <service:setter>setSource</service:setter>
+                            <service:element>source</service:element>
                             <service:xpath>source</service:xpath>
                         </service:ListResultField>
                         <service:ListResultField>
-                            <service:setter>setFilename</service:setter>
+                            <service:element>filename</service:element>
                             <service:xpath>filename</service:xpath>
                         </service:ListResultField>
                         <service:ListResultField>
-                            <service:setter>setIdentificationNumber</service:setter>
+                            <service:element>identificationNumber</service:element>
                             <service:xpath>identificationNumber</service:xpath>
                         </service:ListResultField>
                     </service:ListResultsFields>
                     <service:ListResultsItemMethodName>getAcquisitionListItem</service:ListResultsItemMethodName>
                     <service:ListResultsFields>
                         <service:ListResultField>
-                            <service:setter>setAcquisitionReferenceNumber</service:setter>
+                            <service:element>acquisitionReferenceNumber</service:element>
                             <service:xpath>acquisitionReferenceNumber</service:xpath>
                         </service:ListResultField>
                         <service:ListResultField>
-                            <service:setter>setAcquisitionSource</service:setter>
+                            <service:element>acquisitionSource</service:element>
                             <service:xpath>acquisitionSources/[0]</service:xpath>
                         </service:ListResultField>
                         <service:ListResultField>
-                            <service:setter>setOwner</service:setter>
+                            <service:element>owner</service:element>
                             <service:xpath>owners/[0]</service:xpath>
                         </service:ListResultField>
                     </service:ListResultsFields>
index c0e565895e09228dfac76b4811b5a6fa049c9283..a7bf2d71eff0f7c510393a03bbc78a2240f64cae 100644 (file)
@@ -5,7 +5,9 @@ import java.io.InputStream;
 \r
 import javax.servlet.http.HttpServletRequest;\r
 \r
-import org.collectionspace.services.blob.BlobsCommonList; \r
+//import org.collectionspace.services.blob.BlobsCommonList; \r
+import org.collectionspace.services.jaxb.AbstractCommonList;\r
+import org.collectionspace.services.nuxeo.client.java.CommonList;\r
 import org.collectionspace.services.common.FileUtils;\r
 \r
 public class BlobInput {\r
@@ -15,7 +17,7 @@ public class BlobInput {
        \r
        private String derivativeTerm;\r
        private boolean derivativeListRequested = false;\r
-       private BlobsCommonList derivativeList;\r
+       private CommonList derivativeList;\r
        \r
        private boolean contentRequested = false;\r
        private InputStream contentStream;\r
@@ -88,11 +90,11 @@ public class BlobInput {
                this.derivativeListRequested = derivativesRequested;\r
        }\r
 \r
-       public BlobsCommonList getDerivativeList() {\r
+       public CommonList getDerivativeList() {\r
                return derivativeList;\r
        }\r
 \r
-       public void setDerivativeList(BlobsCommonList derivativeList) {\r
+       public void setDerivativeList(CommonList derivativeList) {\r
                this.derivativeList = derivativeList;\r
        }\r
 \r
index d7ba33682666581e47bbc432affdd07b585c6fd1..67605db5c683b67d089bb7c4e767d6e9a4327ec2 100644 (file)
@@ -112,8 +112,11 @@ import org.collectionspace.services.common.context.ServiceContext;
 import org.collectionspace.services.common.document.DocumentUtils;\r
 import org.collectionspace.services.common.FileUtils;\r
 import org.collectionspace.services.blob.BlobsCommon;\r
-import org.collectionspace.services.blob.BlobsCommonList;\r
-import org.collectionspace.services.blob.BlobsCommonList.BlobListItem;\r
+//import org.collectionspace.services.blob.BlobsCommonList;\r
+//import org.collectionspace.services.blob.BlobsCommonList.BlobListItem;\r
+import org.collectionspace.services.jaxb.AbstractCommonList;\r
+import org.collectionspace.services.jaxb.BlobJAXBSchema;\r
+import org.collectionspace.services.nuxeo.client.java.CommonList;\r
 import org.collectionspace.services.common.blob.BlobOutput;\r
 \r
 import org.collectionspace.ecm.platform.quote.api.QuoteManager;\r
@@ -190,28 +193,43 @@ public class NuxeoImageUtils {
                return uri + result + "/" + BlobInput.URI_CONTENT_PATH;\r
        }\r
 \r
-       static private BlobListItem createBlobListItem(Blob blob, String uri) {\r
-               BlobListItem result = new BlobListItem();\r
-\r
-               result.setEncoding(blob.getEncoding());\r
-               result.setLength(Long.toString(blob.getLength()));\r
-               result.setMimeType(blob.getMimeType());\r
-               result.setName(blob.getFilename());\r
-               result.setUri(getDerivativeUri(uri, blob.getFilename()));\r
-\r
-               return result;\r
+       static private HashMap<String,String> createBlobListItem(Blob blob, String uri) {\r
+               HashMap<String,String> item = new HashMap<String,String>();\r
+               \r
+               String value = blob.getEncoding();\r
+               if(value!=null && !value.trim().isEmpty()) {\r
+               item.put(BlobJAXBSchema.encoding, value);\r
+        }\r
+               value = Long.toString(blob.getLength());\r
+               if(value!=null && !value.trim().isEmpty()) {\r
+               item.put(BlobJAXBSchema.length, value);\r
+        }\r
+               value = blob.getMimeType();\r
+               if(value!=null && !value.trim().isEmpty()) {\r
+               item.put(BlobJAXBSchema.mimeType, value);\r
+        }\r
+               value = blob.getFilename();\r
+               if(value!=null && !value.trim().isEmpty()) {\r
+               item.put(BlobJAXBSchema.name, value);\r
+        }\r
+               value = getDerivativeUri(uri, blob.getFilename());\r
+               if(value!=null && !value.trim().isEmpty()) {\r
+               item.put(BlobJAXBSchema.uri, value);\r
+        }\r
+\r
+               return item;\r
        }\r
 \r
-       static public BlobsCommonList getBlobDerivatives(RepositoryInstance repoSession,\r
+       static public CommonList getBlobDerivatives(RepositoryInstance repoSession,\r
                        String repositoryId,\r
                        String uri) throws Exception {\r
-               BlobsCommonList result = new BlobsCommonList();\r
+               CommonList commonList = new CommonList();\r
 \r
                IdRef documentRef = new IdRef(repositoryId);\r
                DocumentModel documentModel = repoSession.getDocument(documentRef);             \r
                DocumentBlobHolder docBlobHolder = (DocumentBlobHolder)documentModel.getAdapter(BlobHolder.class);\r
                //\r
-               //\r
+               // FIXME: REM this looks like cruft\r
                try {\r
                        QuoteManager quoteManager = (QuoteManager)Framework.getService(QuoteManager.class);\r
                        quoteManager.createQuote(documentModel, "Quoted - Comment" + System.currentTimeMillis(),\r
@@ -222,14 +240,14 @@ public class NuxeoImageUtils {
                //\r
                //\r
                List<Blob> docBlobs = docBlobHolder.getBlobs();         \r
-               List<BlobListItem> blobListItems = result.getBlobListItem();\r
-               BlobListItem blobListItem = null;\r
+               //List<BlobListItem> blobListItems = result.getBlobListItem();\r
+               HashMap<String,String> item = null;\r
                for (Blob blob : docBlobs) {\r
-                       blobListItem = createBlobListItem(blob, uri);\r
-                       blobListItems.add(blobListItem);\r
+                       item = createBlobListItem(blob, uri);\r
+            commonList.addItem(item);\r
                }\r
 \r
-               return result;\r
+               return commonList;\r
        }\r
 \r
        static private BlobsCommon createBlobsCommon(DocumentModel documentModel, Blob nuxeoBlob) {\r
diff --git a/services/common/src/main/java/org/collectionspace/services/nuxeo/client/java/CommonList.java b/services/common/src/main/java/org/collectionspace/services/nuxeo/client/java/CommonList.java
new file mode 100644 (file)
index 0000000..9b807de
--- /dev/null
@@ -0,0 +1,159 @@
+/**\r
+ *  This document is a part of the source code and related artifacts\r
+ *  for CollectionSpace, an open source collections management system\r
+ *  for museums and related institutions:\r
+\r
+ *  http://www.collectionspace.org\r
+ *  http://wiki.collectionspace.org\r
+\r
+ *  Copyright 2009 University of California at Berkeley\r
+\r
+ *  Licensed under the Educational Community License (ECL), Version 2.0.\r
+ *  You may not use this file except in compliance with this License.\r
+\r
+ *  You may obtain a copy of the ECL 2.0 License at\r
+\r
+ *  https://source.collectionspace.org/collection-space/LICENSE.txt\r
+\r
+ *  Unless required by applicable law or agreed to in writing, software\r
+ *  distributed under the License is distributed on an "AS IS" BASIS,\r
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ *  See the License for the specific language governing permissions and\r
+ *  limitations under the License.\r
+ */\r
+package org.collectionspace.services.nuxeo.client.java;\r
+\r
+import java.util.ArrayList;\r
+import java.util.HashMap;\r
+import java.util.Iterator;\r
+import java.util.List;\r
+\r
+import org.collectionspace.services.jaxb.AbstractCommonList;\r
+\r
+import org.apache.commons.lang.builder.ToStringBuilder;\r
+import org.jvnet.jaxb2_commons.lang.ToString;\r
+import org.jvnet.jaxb2_commons.lang.builder.JAXBToStringBuilder;\r
+import javax.xml.parsers.DocumentBuilder;\r
+import javax.xml.parsers.DocumentBuilderFactory;\r
+import org.w3c.dom.Document;\r
+import org.w3c.dom.Element;\r
+\r
+import javax.xml.bind.annotation.XmlAccessType;\r
+import javax.xml.bind.annotation.XmlAccessorType;\r
+import javax.xml.bind.annotation.XmlElement;\r
+import javax.xml.bind.annotation.XmlRootElement;\r
+import javax.xml.bind.annotation.XmlTransient;\r
+import javax.xml.bind.annotation.XmlType;\r
+import javax.xml.bind.annotation.XmlSeeAlso;\r
+\r
+//import org.slf4j.Logger;\r
+//import org.slf4j.LoggerFactory;\r
+\r
+/**\r
+ * This class allows us to generically represent and marshall a set of list\r
+ * results for any object. The base information is provided by the\r
+ * AbstractCommonList.xsd and associated class, defining the list header.\r
+ * A array of itemInfo objects define the results-specific info, where\r
+ * each itemInfo is a map of Strings that represent the fields returned for\r
+ * each item.\r
+ *\r
+ * @author pschmitz\r
+ * $LastChangedRevision:  $\r
+ * $LastChangedDate:  $\r
+ */\r
+@XmlAccessorType(XmlAccessType.NONE)\r
+// We use the same root as the superclass, so unmarshalling will work (more or less)\r
+@XmlRootElement(name = "abstract-common-list")\r
+public class CommonList extends AbstractCommonList {\r
+       \r
+       /** The logger. */\r
+       //private final Logger logger = LoggerFactory.getLogger(this.getClass());\r
+       @XmlTransient\r
+       private DocumentBuilderFactory factory;\r
+       @XmlTransient\r
+       private DocumentBuilder parser;\r
+       @XmlTransient\r
+       private Document doc;\r
+    \r
+    public CommonList()\r
+       throws javax.xml.parsers.ParserConfigurationException {\r
+       super();\r
+       factory = DocumentBuilderFactory.newInstance();\r
+        //Get the DocumentBuilder\r
+        parser = factory.newDocumentBuilder();\r
+        //Create blank DOM Document\r
+        doc = parser.newDocument();\r
+    }\r
+        \r
+       @XmlTransient\r
+       private String fieldKeys[] = null;\r
+       \r
+       //Add methods to add new items, and to set the fieldKeys. Could make\r
+       //them an array of strings rather than arraylist.\r
+       \r
+       /**\r
+        * @return the current set of fieldKeys.\r
+        */\r
+       public String[] getFieldKeys() {\r
+               return fieldKeys;\r
+       }\r
+       \r
+       /**\r
+        * Sets the keys to assume when fetching fields from the itemInfo maps.\r
+        * As a side-effect, will build and set super.fieldsReturned.\r
+        * This MUST be called before attempting to add items (with addItem).\r
+        * \r
+        * @param fieldKeys     the keys to use\r
+        * \r
+        */\r
+       public void setFieldsReturned(String[] fieldKeys) {\r
+               this.fieldKeys = fieldKeys;\r
+               String fieldsImploded = implode(fieldKeys, "|");\r
+               setFieldsReturned(fieldsImploded);\r
+       }\r
+\r
+       // TODO This should be in common, but then we have mutual dependencies. Sigh.\r
+       private String implode(String strings[], String sep) {\r
+               String implodedString;\r
+               if (strings.length==0) {\r
+                       implodedString = "";\r
+               } else {\r
+                       StringBuffer sb = new StringBuffer();\r
+                       sb.append(strings[0]);\r
+                       for (int i=1;i<strings.length;i++) {\r
+                               if(strings[i]!=null&& !strings[i].trim().isEmpty()) {\r
+                                       sb.append(sep);\r
+                                       sb.append(strings[i]);\r
+                               }\r
+                       }\r
+                       implodedString = sb.toString();\r
+               }\r
+               return implodedString;\r
+       }\r
+       \r
+       /**\r
+        * Adds an item to the results list. Each item should have fields\r
+        * associated to keys defined in the fieldKeys. \r
+        * Caller must call setFieldsReturned() before calling this.\r
+        * \r
+        * @param itemInfo\r
+        * @throws RuntimeException if this is called before fieldKeys has been set.\r
+        */\r
+       public void addItem(HashMap<String,String> itemInfo) {\r
+               if(fieldKeys==null) {\r
+                       throw new RuntimeException("CommonList.addItem: Cannot add items before fieldKeys are set.");\r
+               }\r
+               List<AbstractCommonList.ListItem> itemsList = getListItem();\r
+               AbstractCommonList.ListItem listItem = new AbstractCommonList.ListItem();\r
+               itemsList.add(listItem);\r
+               List<Element> anyList = listItem.getAny();\r
+               for(String key:fieldKeys) {\r
+                       Element el = doc.createElement(key);\r
+                       el.setTextContent(itemInfo.get(key));\r
+                       anyList.add(el);\r
+               }\r
+       }\r
+\r
+}\r
+\r
+\r
index f531487601055deaf6116677876ffc1dfdcb12d3..3984b2bb119e5a68419ee50c907da85663439cb8 100755 (executable)
@@ -25,6 +25,7 @@ package org.collectionspace.services.nuxeo.client.java;
 \r
 import java.lang.reflect.Method;\r
 import java.util.ArrayList;\r
+import java.util.HashMap;\r
 import java.util.Iterator;\r
 import java.util.List;\r
 \r
@@ -36,6 +37,7 @@ import org.collectionspace.services.common.service.ServiceBindingType;
 import org.collectionspace.services.common.context.MultipartServiceContext;\r
 import org.collectionspace.services.common.document.DocumentWrapper;\r
 import org.collectionspace.services.jaxb.AbstractCommonList;\r
+import org.collectionspace.services.nuxeo.client.java.CommonList;\r
 import org.collectionspace.services.nuxeo.client.java.RemoteDocumentModelHandlerImpl;\r
 import org.collectionspace.services.nuxeo.util.NuxeoUtils;\r
 import org.nuxeo.ecm.core.api.DocumentModel;\r
@@ -44,10 +46,8 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;\r
 \r
 /**\r
- * This class is generified by the marker types T and TL,\r
- * however, T is expected to map to something like BlobCommon, MediaCommon, ObjectexitCommon, etc.,\r
- * whereas TL is expected to map to AbstractCommonList,\r
- * since, for example, BlobCommonList and ObjectexitCommonList descend from AbstractCommonList,\r
+ * This class is generified by the marker type T,\r
+ * where T is expected to map to something like BlobCommon, MediaCommon, ObjectexitCommon, etc.,\r
  * and so on for every JAXB-generated schema class.\r
  *\r
  * User: laramie\r
@@ -55,7 +55,7 @@ import org.slf4j.LoggerFactory;
  * $LastChangedDate:  $\r
  *\r
  */\r
-public abstract class DocHandlerBase<T, TL> extends RemoteDocumentModelHandlerImpl<T, TL> {\r
+public abstract class DocHandlerBase<T> extends RemoteDocumentModelHandlerImpl<T, AbstractCommonList> {\r
 \r
     /** The logger. */\r
     private final Logger logger = LoggerFactory.getLogger(this.getClass());\r
@@ -63,8 +63,8 @@ public abstract class DocHandlerBase<T, TL> extends RemoteDocumentModelHandlerIm
     private AbstractCommonList commonList;\r
 \r
     @Override\r
-    public TL getCommonPartList() {\r
-        return (TL)commonList;\r
+    public AbstractCommonList getCommonPartList() {\r
+        return commonList;\r
     }\r
 \r
     public void setCommonPartList(AbstractCommonList aCommonList) {\r
@@ -128,9 +128,10 @@ public abstract class DocHandlerBase<T, TL> extends RemoteDocumentModelHandlerIm
     }\r
 \r
     @Override\r
-    public TL extractCommonPartList(DocumentWrapper<DocumentModelList> wrapDoc) throws Exception {\r
-        String label = getServiceContext().getCommonPartLabel();\r
-\r
+    public AbstractCommonList extractCommonPartList(DocumentWrapper<DocumentModelList> wrapDoc) throws Exception {\r
+        //String label = getServiceContext().getCommonPartLabel();\r
+        \r
+        /*\r
         AbstractCommonList commonList = createAbstractCommonListImpl();\r
         extractPagingInfo(((TL)commonList), wrapDoc);\r
         commonList.setFieldsReturned(getSummaryFields(commonList));\r
@@ -142,7 +143,59 @@ public abstract class DocHandlerBase<T, TL> extends RemoteDocumentModelHandlerIm
             Object item = createItemForCommonList(docModel, label, id);\r
             list.add(item);\r
         }\r
-        return (TL)commonList;\r
+        */\r
+        /* Rewrite\r
+         * Create the CommonList\r
+         * List<ListResultField> resultsFields = getListItemsArray();\r
+         * Construct array of strings of resultsFields\r
+         *   add csid and uri\r
+         * Set the fieldNames for CommonList\r
+         * For each doc in list:\r
+         *   Create HashMap of values\r
+         *   get csid, set csid hashmap value\r
+         *   get uri, set uri hashmap value\r
+         *   for (ListResultField field : resultsFields ){\r
+         *        get String value from Xpath\r
+         *        set hashMap value\r
+         *   AddItem to CommonList\r
+         * \r
+         */\r
+       String commonSchema = getServiceContext().getCommonPartLabel();\r
+       CommonList commonList = new CommonList();\r
+        extractPagingInfo(commonList, wrapDoc);\r
+        List<ListResultField> resultsFields = getListItemsArray();\r
+        int nFields = resultsFields.size()+2;\r
+        String fields[] = new String[nFields];\r
+        fields[0] = "csid";\r
+        fields[1] = "uri";\r
+        for(int i=2;i<nFields;i++) {\r
+               ListResultField field = resultsFields.get(i-2); \r
+               fields[i]=field.getElement();\r
+        }\r
+        commonList.setFieldsReturned(fields);\r
+        Iterator<DocumentModel> iter = wrapDoc.getWrappedObject().iterator();\r
+               HashMap<String,String> item = new HashMap<String,String>();\r
+        while(iter.hasNext()){\r
+            DocumentModel docModel = iter.next();\r
+            String id = NuxeoUtils.getCsid(docModel);//NuxeoUtils.extractId(docModel.getPathAsString());\r
+            item.put(fields[0], id);\r
+            String uri = getServiceContextPath() + id;\r
+            item.put(fields[1], uri);\r
+            for (ListResultField field : resultsFields ){\r
+               String schema = field.getSchema();\r
+               if(schema==null || schema.trim().isEmpty())\r
+                       schema = commonSchema;\r
+                String value = \r
+                       getXPathStringValue(docModel, schema, field.getXpath());\r
+                if(value!=null && !value.trim().isEmpty()) {\r
+                       item.put(field.getElement(), value);\r
+                }\r
+            }\r
+            commonList.addItem(item);\r
+            item.clear();\r
+        }\r
+\r
+        return commonList;\r
     }\r
 \r
     @Override\r
diff --git a/services/common/src/main/java/org/collectionspace/services/nuxeo/client/java/ObjectFactory.java b/services/common/src/main/java/org/collectionspace/services/nuxeo/client/java/ObjectFactory.java
new file mode 100644 (file)
index 0000000..ddbb497
--- /dev/null
@@ -0,0 +1,53 @@
+/**\r
+ *  This document is a part of the source code and related artifacts\r
+ *  for CollectionSpace, an open source collections management system\r
+ *  for museums and related institutions:\r
+\r
+ *  http://www.collectionspace.org\r
+ *  http://wiki.collectionspace.org\r
+\r
+ *  Copyright 2009 University of California at Berkeley\r
+\r
+ *  Licensed under the Educational Community License (ECL), Version 2.0.\r
+ *  You may not use this file except in compliance with this License.\r
+\r
+ *  You may obtain a copy of the ECL 2.0 License at\r
+\r
+ *  https://source.collectionspace.org/collection-space/LICENSE.txt\r
+\r
+ *  Unless required by applicable law or agreed to in writing, software\r
+ *  distributed under the License is distributed on an "AS IS" BASIS,\r
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ *  See the License for the specific language governing permissions and\r
+ *  limitations under the License.\r
+ */\r
+package org.collectionspace.services.nuxeo.client.java;\r
+\r
+import javax.xml.bind.annotation.XmlRegistry;\r
+\r
+/**\r
+ * ObjectFactory for CommonList \r
+ */\r
+@XmlRegistry\r
+public class ObjectFactory {\r
+    /**\r
+     * Create a new ObjectFactory that can be used to create new instances of schema derived classes for package: org.collectionspace.services.jaxb\r
+     * \r
+     */\r
+    public ObjectFactory() {\r
+    }\r
+\r
+    /**\r
+     * Create an instance of {@link tCommonList }\r
+     * \r
+     */\r
+    public CommonList createCommonList() {\r
+       try {\r
+               //-System.out.println("CL_ObjectFactory:createAbstractCommonList");\r
+               return new CommonList();\r
+       } catch(Exception e) {\r
+               return null;\r
+       }\r
+    }\r
+\r
+}\r
diff --git a/services/common/src/main/java/org/collectionspace/services/nuxeo/client/java/package-info.java b/services/common/src/main/java/org/collectionspace/services/nuxeo/client/java/package-info.java
new file mode 100644 (file)
index 0000000..2726134
--- /dev/null
@@ -0,0 +1,3 @@
+// We make the CommonList act like an AbstractCommonList, by setting its namespace\r
+@javax.xml.bind.annotation.XmlSchema(namespace = "http://collectionspace.org/services/jaxb")\r
+package org.collectionspace.services.nuxeo.client.java;\r
index ab1d0231ef2203f394b46ea7d7e727524536a53c..e7fbbb1d37bcbb9b2eba7b07eb62196e4b0334f2 100644 (file)
     <xs:complexType name="ListResultField">
         <xs:sequence>
             <xs:element name="setter" type="xs:string" minOccurs="1" maxOccurs="1"/>
+            <xs:element name="element" type="xs:string" minOccurs="1" maxOccurs="1"/>
+            <xs:element name="schema" type="xs:string" minOccurs="1" maxOccurs="1"/>
             <xs:element name="xpath" type="xs:string" minOccurs="1" maxOccurs="1"/>
         </xs:sequence>
     </xs:complexType>
index 790271ae65b0373e97aee0189214003e9a71422b..59e16d7739d72dd0e6a23961d91edcc9edbf346b 100644 (file)
@@ -1,28 +1,26 @@
 <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
-
 <!--
     $LastChangedRevision: 1341 $
     $LastChangedDate: 2010-02-15 22:01:55 -0800 (Mon, 15 Feb 2010) $
 -->
-
-<xs:schema 
-    xmlns:xs="http://www.w3.org/2001/XMLSchema"
-    xmlns:ns="http://collectionspace.org/services/jaxb"
-    xmlns="http://collectionspace.org/services/jaxb"
-    targetNamespace="http://collectionspace.org/services/jaxb"
-    version="0.6">
-    
-    <xs:element name="abstract-common-list">
-        <xs:complexType>
-            <xs:sequence>
-                <xs:element name="pageNum" type="xs:unsignedInt" />
-                <xs:element name="pageSize" type="xs:unsignedInt" />
-                <!-- "itemsInPage" is useful to our testing framework's unit tests -->
-                <xs:element name="itemsInPage" type="xs:unsignedInt" />
-                <xs:element name="totalItems" type="xs:unsignedInt" />
-                <xs:element name="fieldsReturned" type="xs:string" />
-            </xs:sequence>
-        </xs:complexType>
-    </xs:element>
-    
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:ns="http://collectionspace.org/services/jaxb" xmlns="http://collectionspace.org/services/jaxb" targetNamespace="http://collectionspace.org/services/jaxb" version="0.6">
+       <xs:element name="abstract-common-list">
+               <xs:complexType>
+                       <xs:sequence>
+                               <xs:element name="pageNum" type="xs:unsignedInt"/>
+                               <xs:element name="pageSize" type="xs:unsignedInt"/>
+                               <!-- "itemsInPage" is useful to our testing framework's unit tests -->
+                               <xs:element name="itemsInPage" type="xs:unsignedInt"/>
+                               <xs:element name="totalItems" type="xs:unsignedInt"/>
+                               <xs:element name="fieldsReturned" type="xs:string"/>
+                               <xs:element name="list-item" minOccurs="0" maxOccurs="unbounded">
+                                       <xs:complexType>
+                                               <xs:sequence>
+                                                       <xs:any processContents="skip" maxOccurs="unbounded"/>
+                                               </xs:sequence>
+                                       </xs:complexType>
+                               </xs:element>
+                       </xs:sequence>
+               </xs:complexType>
+       </xs:element>
 </xs:schema>
index 74f56be2e3911aa46eb6cf70af8e144d4a0eeedf..e9ea8e33e320fd146e8133fdbb4ff9fcb776a27c 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>
-    
-    <!-- blob records, as in nuxeo repository -->
-    <xs:element name="blobs_common_list">
-        <xs:complexType>
-            <xs:complexContent>
-                <xs:extension base="abstractCommonList">                    
-                    <xs:sequence>
-                        <xs:element name="blob_list_item" maxOccurs="unbounded">
-                            <xs:complexType>
-                                <xs:sequence>
-                                    <xs:element name="name" type="xs:string"   minOccurs="1" />
-                                    <xs:element name="mime-type" type="xs:string" minOccurs="1" />
-                                    <xs:element name="encoding" type="xs:string" minOccurs="1" />
-                                    <xs:element name="length" type="xs:string" minOccurs="1" />
-                                    <xs:element name="uri" type="xs:string" />
-                                    <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 b4c8d033a70ef300c07588a9ccbf3e25b4abbe84..428d9a14fbaba0c2c48eb8d62319532af43fc061 100644 (file)
@@ -21,7 +21,7 @@ import javax.ws.rs.core.Response;
 
 import org.collectionspace.services.common.authorityref.AuthorityRefList;
 //import org.collectionspace.services.common.context.ServiceContext;
-import org.collectionspace.services.loanin.LoansinCommonList;
+import org.collectionspace.services.jaxb.AbstractCommonList;
 
 import org.jboss.resteasy.client.ProxyFactory;
 import org.jboss.resteasy.plugins.providers.RegisterBuiltin;
@@ -97,7 +97,7 @@ public class LoaninClient extends AbstractServiceClientImpl {
      * @return
      * @see org.collectionspace.services.client.LoaninProxy#getLoanin()
      */
-    public ClientResponse<LoansinCommonList> readList() {
+    public ClientResponse<AbstractCommonList> readList() {
         return loaninProxy.readList();
     }
     
index 7f6647e056bdcbcc3f6df9a2b7ce096128443f0a..d3dd1f88549721e97c0c4ef3a8f40567857a7f0c 100644 (file)
@@ -11,7 +11,7 @@ import javax.ws.rs.Produces;
 import javax.ws.rs.core.Response;
 
 import org.collectionspace.services.common.authorityref.AuthorityRefList;
-import org.collectionspace.services.loanin.LoansinCommonList;
+import org.collectionspace.services.jaxb.AbstractCommonList;
 import org.jboss.resteasy.client.ClientResponse;
 import org.jboss.resteasy.plugins.providers.multipart.MultipartInput;
 import org.jboss.resteasy.plugins.providers.multipart.MultipartOutput;
@@ -46,7 +46,7 @@ public interface LoaninProxy extends CollectionSpaceProxy {
     // List
     @GET
     @Produces({"application/xml"})
-    ClientResponse<LoansinCommonList> readList();
+    ClientResponse<AbstractCommonList> readList();
 
     // List Authority References
     @GET
index 44da361ee12000d5e27ea11d15b28cb1070c60e9..92461792947444aa8c7fc48dc5eff98024e91f2b 100644 (file)
@@ -33,7 +33,7 @@ import org.collectionspace.services.jaxb.AbstractCommonList;
 import org.collectionspace.services.loanin.LenderGroup;
 import org.collectionspace.services.loanin.LenderGroupList;
 import org.collectionspace.services.loanin.LoansinCommon;
-import org.collectionspace.services.loanin.LoansinCommonList;
+//import org.collectionspace.services.loanin.LoansinCommonList;
 
 import org.jboss.resteasy.client.ClientResponse;
 import org.jboss.resteasy.plugins.providers.multipart.MultipartInput;
@@ -83,7 +83,7 @@ public class LoaninServiceTest extends AbstractServiceTestImpl {
     @Override
        protected AbstractCommonList getAbstractCommonList(
                        ClientResponse<AbstractCommonList> response) {
-        return response.getEntity(LoansinCommonList.class);
+        return response.getEntity(AbstractCommonList.class);
     }
  
     // ---------------------------------------------------------------
@@ -380,9 +380,9 @@ public class LoaninServiceTest extends AbstractServiceTestImpl {
         setupReadList();
 
         // Submit the request to the service and store the response.
-        LoansinCommonList list = null;
+        AbstractCommonList list = null;
         LoaninClient client = new LoaninClient();
-        ClientResponse<LoansinCommonList> res = client.readList();
+        ClientResponse<AbstractCommonList> res = client.readList();
         try {
                int statusCode = res.getStatus();
        
@@ -403,16 +403,12 @@ public class LoaninServiceTest extends AbstractServiceTestImpl {
         // Optionally output additional data about list members for debugging.
         boolean iterateThroughList = false;
         if (iterateThroughList && logger.isDebugEnabled()){
-            List<LoansinCommonList.LoaninListItem> items =
-                    list.getLoaninListItem();
+            List<AbstractCommonList.ListItem> items =
+                    list.getListItem();
             int i = 0;
-            for(LoansinCommonList.LoaninListItem item : items){
-                logger.debug(testName + ": list-item[" + i + "] csid=" +
-                        item.getCsid());
-                logger.debug(testName + ": list-item[" + i + "] loanInNumber=" +
-                        item.getLoanInNumber());
-                logger.debug(testName + ": list-item[" + i + "] URI=" +
-                        item.getUri());
+            for(AbstractCommonList.ListItem item : items){
+                logger.debug(testName + ": list-item[" + i + "] " +
+                        item.toString());
                 i++;
             }
         }
index a5b742ab5e854eced59bad9c4587f0e1f3eae5e8..021d22ffcbf860da5fb22010d4db030acccd5a91 100644 (file)
         </xs:annotation>
     </xs:complexType>
     
-    <!-- loansin records, as in nuxeo repository -->
-    <xs:element name="loansin-common-list">
-        <xs:complexType>
-            <xs:complexContent>
-                <xs:extension base="abstractCommonList">
-                    <xs:sequence>
-                        <xs:element name="loanin-list-item" maxOccurs="unbounded">
-                            <xs:complexType>
-                                <xs:sequence>
-                                    <xs:element name="loanInNumber" type="xs:string"
-                                        minOccurs="1" />
-                                    <xs:element name="lender" type="xs:string"
-                                        minOccurs="1" />
-                                    <xs:element name="loanReturnDate" type="xs:string"
-                                        minOccurs="1" />
-                                    <!-- uri to retrive details -->
-                                    <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 29b1b969c6de0b62be28f0cb2005a37473612453..590539012c741674eb1ed53ec0f30f2ef84fce71 100644 (file)
@@ -40,6 +40,7 @@ import javax.ws.rs.core.MultivaluedMap;
 import javax.ws.rs.core.Response;
 import javax.ws.rs.core.UriBuilder;
 import javax.ws.rs.core.UriInfo;
+import javax.xml.parsers.ParserConfigurationException;
 
 import org.collectionspace.services.common.AbstractMultiPartCollectionSpaceResourceImpl;
 import org.collectionspace.services.common.ClientType;
@@ -58,6 +59,8 @@ import org.collectionspace.services.common.query.IQueryManager;
 import org.collectionspace.services.common.query.QueryManager;
 import org.collectionspace.services.common.security.UnauthorizedException;
 import org.collectionspace.services.common.vocabulary.RefNameServiceUtils;
+import org.collectionspace.services.jaxb.AbstractCommonList;
+import org.collectionspace.services.nuxeo.client.java.CommonList;
 import org.collectionspace.services.nuxeo.client.java.DocumentModelHandler;
 import org.collectionspace.services.nuxeo.client.java.RemoteDocumentModelHandlerImpl;
 import org.jboss.resteasy.plugins.providers.multipart.MultipartInput;
@@ -231,9 +234,9 @@ public class LoaninResource extends
      */
     @GET
     @Produces("application/xml")
-    public LoansinCommonList getLoaninList(@Context UriInfo ui,
+    public AbstractCommonList getLoaninList(@Context UriInfo ui,
                @QueryParam(IQueryManager.SEARCH_TYPE_KEYWORDS_KW) String keywords) {
-       LoansinCommonList result = null;
+       AbstractCommonList result = null;
        MultivaluedMap<String, String> queryParams = ui.getQueryParameters();
        if (keywords != null) {
                result = searchLoansin(queryParams, keywords);
@@ -249,13 +252,13 @@ public class LoaninResource extends
      * 
      * @return the loanin list
      */
-    private LoansinCommonList getLoaninList(MultivaluedMap<String, String> queryParams) {
-        LoansinCommonList loaninObjectList;
+    private CommonList getLoaninList(MultivaluedMap<String, String> queryParams) {
+        CommonList loaninObjectList;
         try {
                ServiceContext<MultipartInput, MultipartOutput> ctx = createServiceContext(queryParams);
             DocumentHandler handler = createDocumentHandler(ctx);
             getRepositoryClient(ctx).getFiltered(ctx, handler);
-            loaninObjectList = (LoansinCommonList) handler.getCommonPartList();
+            loaninObjectList = (CommonList) handler.getCommonPartList();
         } catch (UnauthorizedException ue) {
             Response response = Response.status(
                     Response.Status.UNAUTHORIZED).entity("Index failed reason " + ue.getErrorReason()).type("text/plain").build();
@@ -320,13 +323,14 @@ public class LoaninResource extends
      * @return the loanin list
      */
     @Deprecated
-    public LoansinCommonList getLoaninList(List<String> csidList) {
-        LoansinCommonList loaninObjectList = new LoansinCommonList();
+    public CommonList getLoaninList(List<String> csidList) {
+        CommonList loaninObjectList;
         try {
+            loaninObjectList = new CommonList();
                ServiceContext<MultipartInput, MultipartOutput> ctx = createServiceContext();
             DocumentHandler handler = createDocumentHandler(ctx);
             getRepositoryClient(ctx).get(ctx, csidList, handler);
-            loaninObjectList = (LoansinCommonList) handler.getCommonPartList();
+            loaninObjectList = (CommonList) handler.getCommonPartList();
         } catch (UnauthorizedException ue) {
             Response response = Response.status(
                     Response.Status.UNAUTHORIZED).entity("Index failed reason " + ue.getErrorReason()).type("text/plain").build();
@@ -442,10 +446,10 @@ public class LoaninResource extends
      * 
      * @return the loansin common list
      */
-    private LoansinCommonList searchLoansin(
+    private CommonList searchLoansin(
                MultivaluedMap<String, String> queryParams,
                String keywords) {
-       LoansinCommonList loansinObjectList;
+       CommonList loansinObjectList;
         try {
                ServiceContext<MultipartInput, MultipartOutput> ctx = createServiceContext(queryParams);
             DocumentHandler handler = createDocumentHandler(ctx);
@@ -460,7 +464,7 @@ public class LoaninResource extends
                    }
             }
             getRepositoryClient(ctx).getFiltered(ctx, handler);
-            loansinObjectList = (LoansinCommonList) handler.getCommonPartList();            
+            loansinObjectList = (CommonList) handler.getCommonPartList();            
         } catch (UnauthorizedException ue) {
             Response response = Response.status(
                     Response.Status.UNAUTHORIZED).entity("Index failed reason " + ue.getErrorReason()).type("text/plain").build();
index 4867715d86345ac994053ab05f03f2b899742d58..d3244a9aa2d5316e80ed17905a2e788d9c44e455 100644 (file)
@@ -23,7 +23,6 @@
  */
 package org.collectionspace.services.loanin.nuxeo;
 
-import org.collectionspace.services.jaxb.AbstractCommonList;
 import org.collectionspace.services.loanin.LoansinCommon;
 import org.collectionspace.services.nuxeo.client.java.DocHandlerBase;
 
@@ -32,6 +31,6 @@ import org.collectionspace.services.nuxeo.client.java.DocHandlerBase;
  *  $LastChangedDate$
  */
 public class LoaninDocumentModelHandler
-        extends DocHandlerBase<LoansinCommon, AbstractCommonList> {
+        extends DocHandlerBase<LoansinCommon> {
 }
 
index 1c34bec20f140e431dd6257c1c433069756c7b80..be915210adbf6177d1b838b7d78bb98a3bf70df4 100644 (file)
@@ -20,8 +20,7 @@ import javax.ws.rs.PathParam;
 import javax.ws.rs.core.Response;
 
 import org.collectionspace.services.common.authorityref.AuthorityRefList;
-//import org.collectionspace.services.common.context.ServiceContext;
-import org.collectionspace.services.media.MediaCommonList;
+import org.collectionspace.services.jaxb.AbstractCommonList;
 
 import org.jboss.resteasy.client.ProxyFactory;
 import org.jboss.resteasy.plugins.providers.RegisterBuiltin;
@@ -97,7 +96,7 @@ public class MediaClient extends AbstractServiceClientImpl {
      * @return
      * @see org.collectionspace.services.client.MediaProxy#getMedia()
      */
-    public ClientResponse<MediaCommonList> readList() {
+    public ClientResponse<AbstractCommonList> readList() {
         return mediaProxy.readList();
     }
     
index 2422b764be5e6f73a90a60cecab4328a923f22c2..2c02917245a37a495e5413331a3fb6b20b2669f0 100644 (file)
@@ -11,7 +11,7 @@ import javax.ws.rs.Produces;
 import javax.ws.rs.core.Response;
 
 import org.collectionspace.services.common.authorityref.AuthorityRefList;
-import org.collectionspace.services.media.MediaCommonList;
+import org.collectionspace.services.jaxb.AbstractCommonList;
 import org.jboss.resteasy.client.ClientResponse;
 import org.jboss.resteasy.plugins.providers.multipart.MultipartInput;
 import org.jboss.resteasy.plugins.providers.multipart.MultipartOutput;
@@ -46,7 +46,7 @@ public interface MediaProxy extends CollectionSpaceProxy {
     // List
     @GET
     @Produces({"application/xml"})
-    ClientResponse<MediaCommonList> readList();
+    ClientResponse<AbstractCommonList> readList();
 
     // List Authority References
     @GET
index 93dc38a140375523f3b1c2b707491ccc7e162754..e90092e6e4767f7ba28ca0828c681370ed12c1fa 100644 (file)
@@ -30,7 +30,6 @@ import org.collectionspace.services.client.CollectionSpaceClient;
 import org.collectionspace.services.client.MediaClient;
 import org.collectionspace.services.jaxb.AbstractCommonList;
 import org.collectionspace.services.media.MediaCommon;
-import org.collectionspace.services.media.MediaCommonList;
 
 import org.jboss.resteasy.client.ClientResponse;
 
@@ -62,7 +61,7 @@ public class MediaServiceTest extends AbstractServiceTestImpl {
 
     @Override
     protected AbstractCommonList getAbstractCommonList(ClientResponse<AbstractCommonList> response) {
-        return response.getEntity(MediaCommonList.class);
+        return response.getEntity(AbstractCommonList.class);
     }
 
     @Override
@@ -109,16 +108,16 @@ public class MediaServiceTest extends AbstractServiceTestImpl {
         logger.debug(testBanner(testName, CLASS_NAME));
         setupReadList();
         MediaClient client = new MediaClient();
-        ClientResponse<MediaCommonList> res = client.readList();
-        MediaCommonList list = res.getEntity();
+        ClientResponse<AbstractCommonList> res = client.readList();
+        AbstractCommonList list = res.getEntity();
         assertStatusCode(res, testName);
         if (logger.isDebugEnabled()) {
-            List<MediaCommonList.MediaListItem> items = list.getMediaListItem();
+            List<AbstractCommonList.ListItem> items =
+                list.getListItem();
             int i = 0;
-            for (MediaCommonList.MediaListItem item : items) {
-                logger.debug(testName + ": list-item[" + i + "] csid=" + item.getCsid());
-                logger.debug(testName + ": list-item[" + i + "] media.title=" + item.getTitle());
-                logger.debug(testName + ": list-item[" + i + "] URI=" + item.getUri());
+            for(AbstractCommonList.ListItem item : items){
+                logger.debug(testName + ": list-item[" + i + "] " +
+                        item.toString());
                 i++;
             }
         }
index 2e581577d68aeb929879b658df6e7d58c09d1c9d..7723e76cb3cadfde5a534322df2cdd291a87fa69 100644 (file)
         </xs:annotation>
     </xs:complexType>
     
-    <!-- media records, as in nuxeo repository -->
-    <xs:element name="media_common_list">
-        <xs:complexType>
-            <xs:complexContent>
-                <xs:extension base="abstractCommonList">                    
-                    <xs:sequence>
-                        <xs:element name="media_list_item" maxOccurs="unbounded">
-                            <xs:complexType>
-                                <xs:sequence>
-                                    <xs:element name="title" type="xs:string"   minOccurs="1" />
-                                    <xs:element name="source" type="xs:string" minOccurs="1" />
-                                    <xs:element name="filename" type="xs:anyURI"          minOccurs="1" />
-                                    <xs:element name="identificationNumber" type="xs:anyURI"          minOccurs="1" />
-                                    <xs:element name="dimension" type="xs:anyURI"          minOccurs="1" />
-                                    <xs:element name="uri" type="xs:string" />
-                                    <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 97446a576da8184cb40fbc9cbecd4848713d5176..9cc3e6e067c27aea6a89a4fbd189e289b3e26d04 100644 (file)
@@ -32,9 +32,9 @@ import org.collectionspace.services.common.blob.BlobUtil;
 import org.collectionspace.services.common.context.ServiceContext;
 import org.collectionspace.services.common.document.DocumentHandler;
 import org.collectionspace.services.blob.BlobsCommon;
-import org.collectionspace.services.blob.BlobsCommonList;
 import org.collectionspace.services.blob.nuxeo.BlobDocumentModelHandler;
 import org.collectionspace.services.blob.BlobResource;
+import org.collectionspace.services.nuxeo.client.java.CommonList;
 
 import org.jboss.resteasy.plugins.providers.multipart.MultipartInput;
 import org.jboss.resteasy.plugins.providers.multipart.MultipartOutput;
@@ -217,9 +217,9 @@ public class MediaResource extends ResourceBase {
     @GET
     @Path("{csid}/blob/derivatives")
     @Produces("application/xml")    
-    public BlobsCommonList getDerivatives(
+    public CommonList getDerivatives(
                @PathParam("csid") String csid) {
-       BlobsCommonList result = null;
+       CommonList result = null;
 
            try {
                ensureCSID(csid, READ);
index 7b10a27faea414ce576640b241bee8c8c2dc33aa..c90614aabd6dad3c412435bda7df68810e0bc850 100644 (file)
@@ -40,7 +40,7 @@ import java.util.List;
  * The Class MediaDocumentModelHandler.
  */
 public class MediaDocumentModelHandler
-        extends DocHandlerBase<MediaCommon, AbstractCommonList> {
+        extends DocHandlerBase<MediaCommon> {
 
     //==============================================================================
 
index 92d9da95ab59e074f918e539fb710a8db40b5946..8a21594d439928736ff500199cf1587415323a25 100644 (file)
@@ -20,8 +20,7 @@ import javax.ws.rs.PathParam;
 import javax.ws.rs.core.Response;
 
 import org.collectionspace.services.common.authorityref.AuthorityRefList;
-//import org.collectionspace.services.common.context.ServiceContext;
-import org.collectionspace.services.objectexit.ObjectexitCommonList;
+import org.collectionspace.services.jaxb.AbstractCommonList;
 
 import org.jboss.resteasy.client.ProxyFactory;
 import org.jboss.resteasy.plugins.providers.RegisterBuiltin;
@@ -97,7 +96,7 @@ public class ObjectExitClient extends AbstractServiceClientImpl {
      * @return
      * @see org.collectionspace.services.client.ObjectExitProxy#getObjectExit()
      */
-    public ClientResponse<ObjectexitCommonList> readList() {
+    public ClientResponse<AbstractCommonList> readList() {
         return objectexitProxy.readList();
     }
     
index efb8d842f979ddba7bd69e38dfa6a561da2d5550..485f02fa8779fe59843b4172222045354d94a0ef 100644 (file)
@@ -11,7 +11,7 @@ import javax.ws.rs.Produces;
 import javax.ws.rs.core.Response;
 
 import org.collectionspace.services.common.authorityref.AuthorityRefList;
-import org.collectionspace.services.objectexit.ObjectexitCommonList;
+import org.collectionspace.services.jaxb.AbstractCommonList;
 import org.jboss.resteasy.client.ClientResponse;
 import org.jboss.resteasy.plugins.providers.multipart.MultipartInput;
 import org.jboss.resteasy.plugins.providers.multipart.MultipartOutput;
@@ -46,7 +46,7 @@ public interface ObjectExitProxy extends CollectionSpaceProxy {
     // List
     @GET
     @Produces({"application/xml"})
-    ClientResponse<ObjectexitCommonList> readList();
+    ClientResponse<AbstractCommonList> readList();
 
     // List Authority References
     @GET
index 0aa445ed13ecce42ce1e3634eb755fb12b7160f1..c20aca5cc6ec7005551a5bc765c90291d8c165db 100644 (file)
@@ -30,7 +30,6 @@ import org.collectionspace.services.client.CollectionSpaceClient;
 import org.collectionspace.services.client.ObjectExitClient;
 import org.collectionspace.services.jaxb.AbstractCommonList;
 import org.collectionspace.services.objectexit.ObjectexitCommon;
-import org.collectionspace.services.objectexit.ObjectexitCommonList;
 
 import org.jboss.resteasy.client.ClientResponse;
 
@@ -62,7 +61,7 @@ public class ObjectExitServiceTest extends AbstractServiceTestImpl {
 
     @Override
     protected AbstractCommonList getAbstractCommonList(ClientResponse<AbstractCommonList> response) {
-        return response.getEntity(ObjectexitCommonList.class);
+        return response.getEntity(AbstractCommonList.class);
     }
 
     @Override
@@ -109,16 +108,16 @@ public class ObjectExitServiceTest extends AbstractServiceTestImpl {
         logger.debug(testBanner(testName, CLASS_NAME));
         setupReadList();
         ObjectExitClient client = new ObjectExitClient();
-        ClientResponse<ObjectexitCommonList> res = client.readList();
-        ObjectexitCommonList list = res.getEntity();
+        ClientResponse<AbstractCommonList> res = client.readList();
+        AbstractCommonList list = res.getEntity();
         assertStatusCode(res, testName);
         if (logger.isDebugEnabled()) {
-            List<ObjectexitCommonList.ObjectexitListItem> items = list.getObjectexitListItem();
+            List<AbstractCommonList.ListItem> items =
+                list.getListItem();
             int i = 0;
-            for (ObjectexitCommonList.ObjectexitListItem item : items) {
-                logger.debug(testName + ": list-item[" + i + "] csid=" + item.getCsid());
-                logger.debug(testName + ": list-item[" + i + "] objectExitNumber=" + item.getExitNumber());
-                logger.debug(testName + ": list-item[" + i + "] URI=" + item.getUri());
+            for(AbstractCommonList.ListItem item : items){
+                logger.debug(testName + ": list-item[" + i + "] " +
+                        item.toString());
                 i++;
             }
         }
index d6e6f91a592bcf8631cd2e939e05db140d0329b5..254e0ee8e53af1cafafe731235c8bdfa23721a0b 100644 (file)
         </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:element name="depositor" type="xs:string"    minOccurs="1" />
-                                    <xs:element name="exitDate" type="xs:string"     minOccurs="1" />
-                                    <xs:element name="exitMethod" type="xs:string"   minOccurs="1" />
-                                    <xs:element name="exitNote" type="xs:string"     minOccurs="1" />
-                                    <xs:element name="exitReason" type="xs:string"   minOccurs="1" />
-                                    <xs:element name="packingNote" type="xs:string"  minOccurs="1" />
-                                    -->
-                                </xs:sequence>
-                            </xs:complexType>
-                        </xs:element>
-                    </xs:sequence>
-                </xs:extension>
-            </xs:complexContent>                    
-        </xs:complexType>
-    </xs:element>
-    
 </xs:schema>
 
index fded4525417b08a41c06b88df6a379739bcb09d6..11093d97a20a940227341f82c1dc13caa8bbcced 100644 (file)
@@ -25,9 +25,8 @@ package org.collectionspace.services.objectexit.nuxeo;
 
 import org.collectionspace.services.nuxeo.client.java.DocHandlerBase;
 import org.collectionspace.services.objectexit.ObjectexitCommon;
-import org.collectionspace.services.jaxb.AbstractCommonList;
 
 public class ObjectExitDocumentModelHandler 
-       extends DocHandlerBase<ObjectexitCommon, AbstractCommonList> {
+       extends DocHandlerBase<ObjectexitCommon> {
 }