From fcadb0db973803965c038178572ec6ebaa00dcae Mon Sep 17 00:00:00 2001 From: Alan Davis Date: Wed, 27 Feb 2013 21:22:13 +0000 Subject: [PATCH] Merged V4.1-BUg-FIX (4.1.4) to HEAD (4.2) 47218: ALF-15526 (Incorrect behaviour on filtering by tag) 47220: ALF-17174 pdf2swf supports converting N first pages but alfresco does not support it via the pageLimit - Possible unit test fix. Not sure why the test fail given they don't when the same command is run on the build m/c from the command line. - Changed the command so that the new -p parameter is not there is there are no page restrictions and moved it to before the source file. 47241: Calendar tagging bug fixes: - Fixes ALF-10533 - Tags don't reload after event create/edit - Merges & modifies fix for ALF-16998 - clean up of unused code and comments. 47243: Fix for ALF-18194 - Bad performance with multiple contentstores browsing files on the slower store - removed the need to acquire an InputStream for the content just to avoid thumbnail generation for the edge case of nodes with missing content... Also fixed issue with display of content size for nodes with missing content - now displays "0 bytes" rather than "NaN GB" 47248: V4.1-BUG-FIX (4.1.4) - Use "-p 0-" rather than "-p ''" - Reverse Merge the previous attrempt. On Linux this resulted in an extra argument to the command. Was not a problem on Windows. 47220: ALF-17174 pdf2swf supports converting N first pages but alfresco does not support it via the pageLimit - Possible unit test fix. Not sure why the test fail given they don't when the same command is run on the build m/c from the command line. - Changed the command so that the new -p parameter is not there is there are no page restrictions and moved it to before the source file. 47251: Fix for ALF-17395 - server error if session expires when a tenant is logged into Share git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@47255 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261 --- .../RuntimeExecutableContentTransformerWorker.java | 10 +--------- source/java/org/alfresco/repo/jscript/ScriptNode.java | 10 ++++++---- 2 files changed, 7 insertions(+), 13 deletions(-) diff --git a/source/java/org/alfresco/repo/content/transform/RuntimeExecutableContentTransformerWorker.java b/source/java/org/alfresco/repo/content/transform/RuntimeExecutableContentTransformerWorker.java index 455ee27be3..8edaeefd77 100644 --- a/source/java/org/alfresco/repo/content/transform/RuntimeExecutableContentTransformerWorker.java +++ b/source/java/org/alfresco/repo/content/transform/RuntimeExecutableContentTransformerWorker.java @@ -240,15 +240,7 @@ public class RuntimeExecutableContentTransformerWorker extends ContentTransforme // add the source and target properties properties.put(VAR_SOURCE, sourceFile.getAbsolutePath()); properties.put(VAR_TARGET, targetFile.getAbsolutePath()); - - if (options.getPageLimit() >=0) - { - properties.put(VAR_PAGE_RANGE, "0-" + options.getPageLimit()); - } - else - { - properties.put(VAR_PAGE_RANGE, ""); - } + properties.put(VAR_PAGE_RANGE, "0-"+(options.getPageLimit() >=0 ? options.getPageLimit() : "")); // pull reader file into source temp file reader.getContent(sourceFile); diff --git a/source/java/org/alfresco/repo/jscript/ScriptNode.java b/source/java/org/alfresco/repo/jscript/ScriptNode.java index 7e35936dc2..13a7171874 100644 --- a/source/java/org/alfresco/repo/jscript/ScriptNode.java +++ b/source/java/org/alfresco/repo/jscript/ScriptNode.java @@ -2798,19 +2798,21 @@ public class ScriptNode implements Scopeable, NamespacePrefixResolverProvider } // If there's nothing currently registered to generate thumbnails for the - // specified mimetype, then log a message and bail out + // specified mimetype, then log a message and bail out String nodeMimeType = getMimetype(); Serializable value = this.nodeService.getProperty(nodeRef, ContentModel.PROP_CONTENT); ContentData contentData = DefaultTypeConverter.INSTANCE.convert(ContentData.class, value); - if (contentData == null) + if (!ContentData.hasContent(contentData) || + !services.getContentService().getReader(nodeRef, ContentModel.PROP_CONTENT).exists()) { - logger.info("Unable to create thumbnail '" + details.getName() + "' as there is no content"); + if (logger.isDebugEnabled()) + logger.debug("Unable to create thumbnail '" + details.getName() + "' as there is no content"); return null; } if (!registry.isThumbnailDefinitionAvailable(contentData.getContentUrl(), nodeMimeType, getSize(), nodeRef, details)) { logger.info("Unable to create thumbnail '" + details.getName() + "' for " + - nodeMimeType + " as no transformer is currently available"); + nodeMimeType + " as no transformer is currently available."); return null; }