RenditionService. Reintroduced the spring-based configuration of ThumbnailDefinitions.

Major overhaul to the ThumbnailDefinition - RenditionDefinition conversion code.
Removed the imported rendition definitions acp, replacing it with the original rendering_actions_space xml.


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@19129 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Neil McErlean
2010-03-08 17:18:40 +00:00
parent 724d28279b
commit 52dc95264c
10 changed files with 344 additions and 91 deletions

View File

@@ -28,6 +28,7 @@ import org.alfresco.repo.content.MimetypeMap;
import org.alfresco.repo.content.transform.magick.ImageTransformationOptions;
import org.alfresco.repo.content.transform.swf.SWFTransformationOptions;
import org.alfresco.repo.policy.BehaviourFilter;
import org.alfresco.repo.rendition.executer.AbstractRenderingEngine;
import org.alfresco.repo.rendition.executer.ImageRenderingEngine;
import org.alfresco.repo.rendition.executer.ReformatRenderingEngine;
import org.alfresco.repo.security.authentication.AuthenticationUtil;
@@ -202,20 +203,19 @@ public class ThumbnailServiceImpl implements ThumbnailService
// We're prepending the cm namespace here.
QName thumbnailQName = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, localThumbnailName);
RenditionDefinition renderingAction = renditionService.loadRenditionDefinition(thumbnailQName);
if (renderingAction == null)
{
// If the provided thumbnailName does not map to a built-in rendition definition
// then we must create a dynamic rendition definition for this thumbnail.
// To do this we must have a renderingEngineName.
//
// The transformation will either be a imageRenderingEngine or a reformat (pdf2swf)
String renderingEngineName = getRenderingEngineNameFor(transformationOptions);
renderingAction = renditionService.createRenditionDefinition(thumbnailQName, renderingEngineName);
}
// Convert the TransformationOptions and ThumbnailParentAssocDetails to
// rendition-style parameters
Map<String, Serializable> params = thumbnailRegistry.getThumbnailRenditionConvertor().convert(transformationOptions, assocDetails);
// Add the other parameters given in this method signature.
params.put(AbstractRenderingEngine.PARAM_SOURCE_CONTENT_PROPERTY, contentProperty);
params.put(AbstractRenderingEngine.PARAM_MIME_TYPE, mimetype);
// Create the renditionDefinition
String renderingEngineName = getRenderingEngineNameFor(transformationOptions);
RenditionDefinition renderingAction = renditionService.createRenditionDefinition(thumbnailQName, renderingEngineName);
// Set the parameters
for (String key : params.keySet())
{
renderingAction.setParameterValue(key, params.get(key));