diff --git a/config/alfresco/repository.properties b/config/alfresco/repository.properties
index 27e7b381dd..8a3b6054b7 100644
--- a/config/alfresco/repository.properties
+++ b/config/alfresco/repository.properties
@@ -554,15 +554,14 @@ swf.languagedir=.
# Thumbnail Service
system.thumbnail.generate=true
-# Generate doclib icons
-# When creating a doclib icon, only use the first pageLimit pages (currently only understood by pdfbox
-# TextToPdfContentTransformer)
-system.thumbnail.definition.doclib.timeoutMs=-1
-system.thumbnail.definition.doclib.readLimitTimeMs=-1
-system.thumbnail.definition.doclib.maxSourceSizeKBytes=-1
-system.thumbnail.definition.doclib.readLimitKBytes=-1
-system.thumbnail.definition.doclib.pageLimit=1
-system.thumbnail.definition.doclib.maxPages=-1
+# Default thumbnail limits
+# When creating thumbnails, only use the first pageLimit pages
+system.thumbnail.definition.default.timeoutMs=-1
+system.thumbnail.definition.default.readLimitTimeMs=-1
+system.thumbnail.definition.default.maxSourceSizeKBytes=-1
+system.thumbnail.definition.default.readLimitKBytes=-1
+system.thumbnail.definition.default.pageLimit=1
+system.thumbnail.definition.default.maxPages=-1
# Max mimetype sizes to create thumbnail icons
system.thumbnail.mimetype.maxSourceSizeKBytes.pdf=-1
diff --git a/config/alfresco/thumbnail-service-context.xml b/config/alfresco/thumbnail-service-context.xml
index 52374bd5a3..e8bcc6f4b7 100644
--- a/config/alfresco/thumbnail-service-context.xml
+++ b/config/alfresco/thumbnail-service-context.xml
@@ -53,6 +53,152 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -61,133 +207,12 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
diff --git a/source/java/org/alfresco/repo/thumbnail/ThumbnailDefinition.java b/source/java/org/alfresco/repo/thumbnail/ThumbnailDefinition.java
index 597a77c8a3..2248f3ad60 100644
--- a/source/java/org/alfresco/repo/thumbnail/ThumbnailDefinition.java
+++ b/source/java/org/alfresco/repo/thumbnail/ThumbnailDefinition.java
@@ -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);
+ }
}