From: Richard Millet Date: Tue, 22 Jan 2013 06:11:19 +0000 (-0800) Subject: CSPACE-5564: Have publish and anonymous retrieve working for blob service. X-Git-Url: https://git.aero2k.de/?a=commitdiff_plain;h=44a5aefade73176867662479c083b6c7dc45b6bf;p=tmp%2Fjakarta-migration.git CSPACE-5564: Have publish and anonymous retrieve working for blob service. --- diff --git a/services/article/3rdparty/nuxeo-platform-cs-article/src/main/resources/schemas/articles_common.xsd b/services/article/3rdparty/nuxeo-platform-cs-article/src/main/resources/schemas/articles_common.xsd index 479da4663..05cbf5323 100644 --- a/services/article/3rdparty/nuxeo-platform-cs-article/src/main/resources/schemas/articles_common.xsd +++ b/services/article/3rdparty/nuxeo-platform-cs-article/src/main/resources/schemas/articles_common.xsd @@ -16,12 +16,12 @@ targetNamespace="http://collectionspace.org/article/" version="0.1"> - - - - - - - - + + + + + + + + diff --git a/services/article/jaxb/src/main/java/org/collectionspace/services/ArticlesCommonJAXBSchema.java b/services/article/jaxb/src/main/java/org/collectionspace/services/ArticlesCommonJAXBSchema.java index 9c4c56a57..a121f7374 100644 --- a/services/article/jaxb/src/main/java/org/collectionspace/services/ArticlesCommonJAXBSchema.java +++ b/services/article/jaxb/src/main/java/org/collectionspace/services/ArticlesCommonJAXBSchema.java @@ -8,7 +8,7 @@ package org.collectionspace.services; - + @@ -22,7 +22,7 @@ package org.collectionspace.services; public interface ArticlesCommonJAXBSchema { final static String ARTICLE_NUMBER = "articleNumber"; - final static String ARTICLE_CONTENT_URL = "articleContentUrl"; + final static String ARTICLE_CONTENT_CSID = "articleContentCsid"; final static String ARTICLE_JOB_ID = "articleJobId"; final static String ARTICLE_SOURCE = "articleSource"; final static String ARTICLE_PUBLISHER = "articlePublisher"; diff --git a/services/common/src/main/cspace/config/services/tenants/tenant-bindings-proto.xml b/services/common/src/main/cspace/config/services/tenants/tenant-bindings-proto.xml index baae7d62c..594f69c10 100644 --- a/services/common/src/main/cspace/config/services/tenants/tenant-bindings-proto.xml +++ b/services/common/src/main/cspace/config/services/tenants/tenant-bindings-proto.xml @@ -2926,8 +2926,8 @@ articleNumber - articleContentUrl - articleContentUrl + articleContentCsid + articleContentCsid @@ -2936,7 +2936,7 @@ objectNameProperty - articleContentUrl + articleContentCsid objectNumberProperty diff --git a/services/common/src/main/java/org/collectionspace/services/common/imaging/nuxeo/NuxeoBlobUtils.java b/services/common/src/main/java/org/collectionspace/services/common/imaging/nuxeo/NuxeoBlobUtils.java index e82530497..3b70eb5aa 100644 --- a/services/common/src/main/java/org/collectionspace/services/common/imaging/nuxeo/NuxeoBlobUtils.java +++ b/services/common/src/main/java/org/collectionspace/services/common/imaging/nuxeo/NuxeoBlobUtils.java @@ -984,9 +984,12 @@ public class NuxeoBlobUtils { try { result = getBlobOutput(ctx, repoSession, repositoryId, null, true, outMimeType); - } - - finally { + if (outMimeType.length() == 0) { + BlobsCommon blobsCommon = result.getBlobsCommon(); + String mimeType = blobsCommon.getMimeType(); + outMimeType.append(mimeType); + } + } finally { if (repoSessionCleanup == true) { releaseRepositorySession(ctx, repositoryClient, repoSession); } diff --git a/services/common/src/main/java/org/collectionspace/services/nuxeo/client/java/RemoteDocumentModelHandlerImpl.java b/services/common/src/main/java/org/collectionspace/services/nuxeo/client/java/RemoteDocumentModelHandlerImpl.java index 7a5e386f5..16b507172 100644 --- a/services/common/src/main/java/org/collectionspace/services/nuxeo/client/java/RemoteDocumentModelHandlerImpl.java +++ b/services/common/src/main/java/org/collectionspace/services/nuxeo/client/java/RemoteDocumentModelHandlerImpl.java @@ -37,6 +37,7 @@ import javax.ws.rs.core.Response; import javax.ws.rs.core.UriInfo; import javax.xml.bind.JAXBElement; +import org.collectionspace.authentication.spi.AuthNContext; import org.collectionspace.services.authorization.AccountPermission; import org.collectionspace.services.jaxb.AbstractCommonList; import org.collectionspace.services.lifecycle.TransitionDef; @@ -324,8 +325,9 @@ public abstract class RemoteDocumentModelHandlerImpl addOutputPart(unQObjectProperties, schema, partMeta); } + MultipartServiceContext ctx = (MultipartServiceContext) getServiceContext(); + if (supportsHierarchy() == true) { - MultipartServiceContext ctx = (MultipartServiceContext) getServiceContext(); String showSiblings = ctx.getQueryParams().getFirst(CommonAPI.showSiblings_QP); if (Tools.isTrue(showSiblings)) { showSiblings(wrapDoc, ctx); @@ -345,7 +347,10 @@ public abstract class RemoteDocumentModelHandlerImpl } } - addAccountPermissionsPart(); + String currentUser = ctx.getUserId(); + if (currentUser.equalsIgnoreCase(AuthNContext.ANONYMOUS_USER) == false) { + addAccountPermissionsPart(); + } } private void addExtraCoreValues(DocumentModel docModel, Map unQObjectProperties)