mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-31 17:39:05 +00:00
Merged BRANCHES/DEV/V4.1-BUG-FIX to HEAD:
42476: ALF-5051: Define ThumbnailDefinition Beans Outside of ThumbnailRegistry Bean - Created defaultImageResizeOptions abstract bean for common properties - Changed system.thumbnail.definition.doclib.* to system.thumbnail.definition.default.* in repository.properties - Created defaultImageTransformationOptions abstract bean for common properties defined by system.thumbnail.definition.default.* in repository.properties - Created thumbnail definition beans with ids outside of the thumbnailRegistry with defaultImageTransformationOptions and defaultImageResizeOptions - Added thumbnailRegistry property to ThumbnailDefinition and register method which calls thumbnailRegistry.addThumbnailDefinition(this) - Added baseThumbnailDefinition bean with init-method="register" but did not yet make it the parent of the thumbnail definitions for backwards compatibility - Changed thumbnailRegistry thumbnailDefinitions list to reference thumbnail definition beans from above, also for backwards compatibility git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@42486 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2005-2011 Alfresco Software Limited.
|
||||
* Copyright (C) 2005-2012 Alfresco Software Limited.
|
||||
*
|
||||
* This file is part of Alfresco
|
||||
*
|
||||
@@ -18,6 +18,9 @@
|
||||
*/
|
||||
package org.alfresco.repo.thumbnail;
|
||||
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
|
||||
import org.alfresco.service.cmr.repository.TransformationOptions;
|
||||
|
||||
/**
|
||||
@@ -27,6 +30,9 @@ import org.alfresco.service.cmr.repository.TransformationOptions;
|
||||
*/
|
||||
public class ThumbnailDefinition
|
||||
{
|
||||
|
||||
private static final Log logger = LogFactory.getLog(ThumbnailDefinition.class);
|
||||
|
||||
/** Name of the thumbnail */
|
||||
private String name;
|
||||
|
||||
@@ -50,6 +56,9 @@ public class ThumbnailDefinition
|
||||
/** Username to run the thumbnailrendition as */
|
||||
private String runAs;
|
||||
|
||||
/** The thumbnail registry */
|
||||
private ThumbnailRegistry thumbnailRegistry;
|
||||
|
||||
/**
|
||||
* Default constructor
|
||||
*/
|
||||
@@ -225,4 +234,40 @@ public class ThumbnailDefinition
|
||||
{
|
||||
return mimeAwarePlaceHolderResourcePath;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the thumbnail registry
|
||||
*
|
||||
* @return the thumbnail registry
|
||||
*/
|
||||
public ThumbnailRegistry getThumbnailRegistry()
|
||||
{
|
||||
return thumbnailRegistry;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the thumbnail registry
|
||||
*
|
||||
* @param thumbnailRegistry
|
||||
*/
|
||||
public void setThumbnailRegistry(ThumbnailRegistry thumbnailRegistry)
|
||||
{
|
||||
this.thumbnailRegistry = thumbnailRegistry;
|
||||
}
|
||||
|
||||
/**
|
||||
* Registers the thumbnail definition with the thumbnail registry.
|
||||
*
|
||||
* @see #setThumbnailRegistry(ThumbnailRegistry)
|
||||
*/
|
||||
public void register()
|
||||
{
|
||||
if (thumbnailRegistry == null)
|
||||
{
|
||||
logger.warn("Property 'thumbnailRegistry' has not been set. Ignoring auto-registration: \n" +
|
||||
" extracter: " + this);
|
||||
return;
|
||||
}
|
||||
thumbnailRegistry.addThumbnailDefinition(this);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user