Merged HEAD-BUG-FIX (4.3/Cloud) to HEAD (4.3/Cloud)

57480: Merged V4.2-BUG-FIX (4.2.1) to HEAD-BUG-FIX (Cloud/4.3)
      57290: Merged V4.1-BUG-FIX (4.1.7) to V4.2-BUG-FIX (4.2.1)
         57279: Fix for MNT-9801.
         I have very slightly refactored the configuration of thumbnails. Rather than inject system.thumbnail.generate into both CreateThumbnail- and UpdateThumbnailActionExecuter, I am now injecting it into the ThumbnailService centrally. I left the old injector methods for backwards compatibility, but deprecated them.
         Now all requests to create a thumbnail via the ScriptNode API pre-check that thumbnail generation is enabled.


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@61822 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Alan Davis
2014-02-11 20:46:44 +00:00
parent 57f7266e48
commit 0995ee2824
6 changed files with 103 additions and 73 deletions

View File

@@ -62,9 +62,6 @@ public class UpdateThumbnailActionExecuter extends ActionExecuterAbstractBase
/** Node Service */
private NodeService nodeService;
/** Property turns on and off all thumbnail creation */
private boolean generateThumbnails = true;
// Size limitations indexed by mime type for thumbnail creation
private HashMap<String,Long> mimetypeMaxSourceSizeKBytes;
@@ -115,10 +112,17 @@ public class UpdateThumbnailActionExecuter extends ActionExecuterAbstractBase
/**
* Enable thumbnail creation at all regardless of mimetype.
* @param generateThumbnails a {@code false} value turns off all thumbnail creation.
* @deprecated Use {@link ThumbnailServiceImpl#setThumbnailsEnabled(boolean)} instead.
*/
public void setGenerateThumbnails(boolean generateThumbnails)
{
this.generateThumbnails = generateThumbnails;
if (logger.isDebugEnabled())
{
logger.debug("Thumbnail generation is " +
(generateThumbnails ? "enabled" : "disabled") +
"via deprecated method in " + this.getClass().getSimpleName());
}
this.thumbnailService.setThumbnailsEnabled(generateThumbnails);
}
/**
@@ -128,7 +132,7 @@ public class UpdateThumbnailActionExecuter extends ActionExecuterAbstractBase
protected void executeImpl(Action action, NodeRef actionedUponNodeRef)
{
// Check if thumbnailing is generally disabled
if (!generateThumbnails)
if (!thumbnailService.getThumbnailsEnabled())
{
if (logger.isDebugEnabled())
{