Fix for ALF-2047. The fix was to ensure that rendition definitions that produce thumbnails always have PARAM_RENDITION_NODETYPE=cm:thumbnail. To do this, I removed the parameter from the create thumbnail code and added it to the ThumbnailRenditionConvertor, from where it will be picked up by all the code that needs it.

Formerly, the parameter was only set for create thumbnail calls, but not for update thumbnail calls. Therefore when the content nodes were changed as described in the issue, the updated thumbnails were of the default type in the rendition service, which is cm:content which leads to problems in various views.


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@19955 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Neil McErlean
2010-04-22 14:40:10 +00:00
parent c3e0afa696
commit 42390dfd1b
3 changed files with 12 additions and 1 deletions

View File

@@ -22,6 +22,7 @@ import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;
import org.alfresco.model.ContentModel;
import org.alfresco.repo.content.transform.magick.ImageResizeOptions;
import org.alfresco.repo.content.transform.magick.ImageTransformationOptions;
import org.alfresco.repo.content.transform.swf.SWFTransformationOptions;
@@ -130,7 +131,12 @@ public class ThumbnailRenditionConvertor
{
Map<String, Serializable> parameters = new HashMap<String, Serializable>();
// All TransformationOptions-based renditions are considered to be "thumbnails".
// Therefore they should be created with a node type of cm:thumbnail
parameters.put(RenditionService.PARAM_RENDITION_NODETYPE, ContentModel.TYPE_THUMBNAIL);
// parameters common to all transformations
putParameterIfNotNull(AbstractRenderingEngine.PARAM_SOURCE_CONTENT_PROPERTY, transformationOptions.getSourceContentProperty(), parameters);
putParameterIfNotNull(AbstractRenderingEngine.PARAM_TARGET_CONTENT_PROPERTY, transformationOptions.getTargetContentProperty(), parameters);
putParameterIfNotNull(RenditionService.PARAM_DESTINATION_NODE, transformationOptions.getTargetNodeRef(), parameters);