]> git.aero2k.de Git - tmp/jakarta-migration.git/commitdiff
CSPACE-3603: /derivatives is failing on Media and Blob services.
authorRichard Millet <richard.millet@berkeley.edu>
Sat, 26 Feb 2011 01:23:21 +0000 (01:23 +0000)
committerRichard Millet <richard.millet@berkeley.edu>
Sat, 26 Feb 2011 01:23:21 +0000 (01:23 +0000)
services/blob/service/src/main/java/org/collectionspace/services/blob/nuxeo/BlobDocumentModelHandler.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/DocHandlerBase.java

index 46ff10703b9d0381362543a90dbc70314b520d07..c4686b097a9eb9ccf75d6573d8751d58a78ef514 100644 (file)
@@ -31,6 +31,7 @@ import org.collectionspace.services.common.blob.BlobUtil;
 import org.collectionspace.services.common.context.ServiceContext;
 import org.collectionspace.services.common.document.DocumentWrapper;
 import org.collectionspace.services.common.imaging.nuxeo.NuxeoImageUtils;
+import org.collectionspace.services.common.service.ListResultField;
 import org.collectionspace.services.jaxb.AbstractCommonList;
 import org.collectionspace.services.jaxb.BlobJAXBSchema;
 import org.collectionspace.services.jaxb.AbstractCommonList;
@@ -111,8 +112,9 @@ extends DocHandlerBase<BlobsCommon> {
                String blobRepositoryId = blobsCommon.getRepositoryId(); //cache the value to pass to the blob retriever
                
                if (blobInput.isDerivativeListRequested() == true) {
+               List<ListResultField> resultsFields = getListItemsArray();
                        CommonList blobsCommonList = NuxeoImageUtils.getBlobDerivatives(
-                                       repoSession, blobRepositoryId, getDerivativePathBase(docModel));
+                                       repoSession, blobRepositoryId, resultsFields, getDerivativePathBase(docModel));
 //                     ctx.setProperty(BlobInput.BLOB_DERIVATIVE_LIST_KEY, blobsCommonList);
                        blobInput.setDerivativeList(blobsCommonList);
                        return;  //FIXME: Don't like this exit point.  Perhaps derivatives should be a sub-resource?
index 67605db5c683b67d089bb7c4e767d6e9a4327ec2..87c891bbe215cff1a118452d9e2990407ddb87ca 100644 (file)
@@ -110,6 +110,7 @@ import org.collectionspace.services.common.ServiceMain;
 import org.collectionspace.services.common.blob.BlobInput;\r
 import org.collectionspace.services.common.context.ServiceContext;\r
 import org.collectionspace.services.common.document.DocumentUtils;\r
+import org.collectionspace.services.common.service.ListResultField;\r
 import org.collectionspace.services.common.FileUtils;\r
 import org.collectionspace.services.blob.BlobsCommon;\r
 //import org.collectionspace.services.blob.BlobsCommonList;\r
@@ -222,8 +223,18 @@ public class NuxeoImageUtils {
 \r
        static public CommonList getBlobDerivatives(RepositoryInstance repoSession,\r
                        String repositoryId,\r
+                       List<ListResultField> resultsFields,\r
                        String uri) throws Exception {\r
                CommonList commonList = new CommonList();\r
+        int nFields = resultsFields.size()+2;\r
+        String fields[] = new String[nFields];//FIXME: REM - Patrick will fix this.\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
 \r
                IdRef documentRef = new IdRef(repositoryId);\r
                DocumentModel documentModel = repoSession.getDocument(documentRef);             \r
index 3984b2bb119e5a68419ee50c907da85663439cb8..ecc21560bc90d7a9b7942e143937f9f18bb6e3f7 100755 (executable)
@@ -163,7 +163,7 @@ public abstract class DocHandlerBase<T> extends RemoteDocumentModelHandlerImpl<T
        String commonSchema = getServiceContext().getCommonPartLabel();\r
        CommonList commonList = new CommonList();\r
         extractPagingInfo(commonList, wrapDoc);\r
-        List<ListResultField> resultsFields = getListItemsArray();\r
+        List<ListResultField> resultsFields = getListItemsArray(); \r
         int nFields = resultsFields.size()+2;\r
         String fields[] = new String[nFields];\r
         fields[0] = "csid";\r