mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Merged HEAD-BUG-FIX (5.0/Cloud) to HEAD (5.0/Cloud)
75639: Merged V4.2-BUG-FIX (4.2.3) to HEAD-BUG-FIX (5.0/Cloud) 75253: Merged DEV to V4.2-BUG-FIX (4.2.3) 75193 : MNT-11771 : Disabling thumbnail also disables Share preview - Provide force parameter to ignore system.thumbnail.generate git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@77515 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -2876,13 +2876,35 @@ public class ScriptNode implements Scopeable, NamespacePrefixResolverProvider
|
||||
* @return ScriptThumbnail the newly create thumbnail node or null if async creation occures
|
||||
*/
|
||||
public ScriptThumbnail createThumbnail(String thumbnailName, boolean async)
|
||||
{
|
||||
return createThumbnail(thumbnailName, async, false);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a thumbnail for the content property of the node.
|
||||
*
|
||||
* The thumbnail name corresponds to pre-set thumbnail details stored in the
|
||||
* repository.
|
||||
*
|
||||
* If the thumbnail is created asynchronously then the result will be null and creation
|
||||
* of the thumbnail will occure at some point in the background.
|
||||
*
|
||||
* If foce param specified system.thumbnail.generate is ignoring. Could be used for preview creation
|
||||
*
|
||||
* @param thumbnailName the name of the thumbnail
|
||||
* @param async indicates whether the thumbnail is create asynchronously or not
|
||||
* @param force ignore system.thumbnail.generate=false
|
||||
* @return ScriptThumbnail the newly create thumbnail node or null if async creation occures
|
||||
*/
|
||||
public ScriptThumbnail createThumbnail(String thumbnailName, boolean async, boolean force)
|
||||
{
|
||||
final ThumbnailService thumbnailService = services.getThumbnailService();
|
||||
|
||||
ScriptThumbnail result = null;
|
||||
|
||||
// If thumbnail generation has been configured off, then don't bother with any of this.
|
||||
if ( thumbnailService.getThumbnailsEnabled())
|
||||
// We need to create preview for node even if system.thumbnail.generate=false
|
||||
if (force || thumbnailService.getThumbnailsEnabled())
|
||||
{
|
||||
// Use the thumbnail registy to get the details of the thumbail
|
||||
ThumbnailRegistry registry = thumbnailService.getThumbnailRegistry();
|
||||
|
Reference in New Issue
Block a user