From 21ddbf2f07dc7eba0a07ca3a829ac44a7f1a3084 Mon Sep 17 00:00:00 2001 From: Richard Millet Date: Thu, 23 Aug 2012 16:35:02 -0700 Subject: [PATCH] CSPACE-5466: Removing generic thumbnail generator Nuxeo listener since it is having integration issues with ImageMagick on Linux systems --- .gitignore | 4 ++++ 3rdparty/nuxeo/pom.xml | 2 ++ .../common/imaging/nuxeo/NuxeoImageUtils.java | 18 ++++++++++++++++-- 3 files changed, 22 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 32b9962d6..c7db4707b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,7 @@ +3rdparty/nuxeo/nuxeo-platform-thumbnail/.classpath +3rdparty/nuxeo/nuxeo-platform-thumbnail/.project +3rdparty/nuxeo/nuxeo-platform-thumbnail/.settings/ +logo.miff target/ *tenant-bindings.merged.xml .settings/org.eclipse.core.resources.prefs diff --git a/3rdparty/nuxeo/pom.xml b/3rdparty/nuxeo/pom.xml index 3ac17551a..773efa9a5 100644 --- a/3rdparty/nuxeo/pom.xml +++ b/3rdparty/nuxeo/pom.xml @@ -17,7 +17,9 @@ nuxeo-platform-collectionspace nuxeo-platform-quote-api nuxeo-platform-quote + diff --git a/services/common/src/main/java/org/collectionspace/services/common/imaging/nuxeo/NuxeoImageUtils.java b/services/common/src/main/java/org/collectionspace/services/common/imaging/nuxeo/NuxeoImageUtils.java index 67af453bc..a02b1f86a 100644 --- a/services/common/src/main/java/org/collectionspace/services/common/imaging/nuxeo/NuxeoImageUtils.java +++ b/services/common/src/main/java/org/collectionspace/services/common/imaging/nuxeo/NuxeoImageUtils.java @@ -798,6 +798,20 @@ public class NuxeoImageUtils { return result; } + + /* + * Find out if this document's blob/file-contents are allowed to be purged. For instance, we currently + * only want to allow the purging the contents of Nuxeo "Picture" documents. + */ + static private boolean isPurgeAllowed(DocumentModel docModel) { + boolean result = false; + + if (docModel.hasFacet(ImagingDocumentConstants.PICTURE_FACET) == true) { + result = true; // Yes, delete/purge the original content + } + + return result; + } /** * Creates the image blob. @@ -837,8 +851,8 @@ public class NuxeoImageUtils { result = createBlobsCommon(documentModel, fileBlob); // Now create our metadata resource document - // If the sender only wanted use to generate derivatives, we need to clear the original content - if (purgeOriginal == true) { + // If the sender wanted us to generate only derivatives, we need to purge/clear the original contents + if (purgeOriginal == true && isPurgeAllowed(documentModel) == true) { // Empty the document model's "content" property -this does not delete the actual file/blob documentModel.setPropertyValue("file:content", (Serializable) null); -- 2.47.3