ALF-17766: ImageCropOptions Should be Refactored as TransformationSourceOptions

- Moved code in ImageCropOptions to CropSourceOptions
   - Moved crop rendition parameters to CropSourceOptionsSerializer
   - Removed notion of crop options from ImageRenderingEnding as its now handled by the source options processing of AbstractTransformationRenderingEngine and CropSourceOptionsSerializer
   - Removed notion of crop options from ImageTransformationOptions as its now handled by the source options in TransformationOptions
   - Changed ImageMagickContentTransformerWorker to get crop options from the TransformationOptions source options
   - Added CropSourceOptions to imageRenderingEngine's sourceOptionsSerializers in rendition-services-context.xml
   - Deprecated ImageCropOptions
   - Removed unused imports and log declaration in TransformationOptions


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@46218 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Ray Gauss
2013-02-05 01:13:53 +00:00
parent e015d94242
commit 7bfed4b0c3
10 changed files with 417 additions and 343 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2005-2011 Alfresco Software Limited.
* Copyright (C) 2005-2013 Alfresco Software Limited.
*
* This file is part of Alfresco
*
@@ -62,6 +62,7 @@ import org.alfresco.service.cmr.repository.ContentData;
import org.alfresco.service.cmr.repository.ContentReader;
import org.alfresco.service.cmr.repository.ContentService;
import org.alfresco.service.cmr.repository.ContentWriter;
import org.alfresco.service.cmr.repository.CropSourceOptions.CropSourceOptionsSerializer;
import org.alfresco.service.cmr.repository.NodeRef;
import org.alfresco.service.cmr.repository.NodeService;
import org.alfresco.service.cmr.repository.ScriptLocation;
@@ -652,8 +653,8 @@ public class RenditionServiceIntegrationTest extends BaseAlfrescoSpringTest
final int imageNewXSize = 36;
final int imageNewYSize = 47;
final Map<String, Serializable> parameterValues = new HashMap<String, Serializable>();
parameterValues.put(ImageRenderingEngine.PARAM_CROP_WIDTH, imageNewXSize);
parameterValues.put(ImageRenderingEngine.PARAM_CROP_HEIGHT, imageNewYSize);
parameterValues.put(CropSourceOptionsSerializer.PARAM_CROP_WIDTH, imageNewXSize);
parameterValues.put(CropSourceOptionsSerializer.PARAM_CROP_HEIGHT, imageNewYSize);
ImageTransformationOptions imageTransformationOptions = new ImageTransformationOptions();
final NodeRef newRenditionNode = performImageRendition(parameterValues,nodeWithImageContent);
@@ -707,9 +708,9 @@ public class RenditionServiceIntegrationTest extends BaseAlfrescoSpringTest
// Create a rendition of the same image, this time cropping by 50/25%
parameterValues.clear();
parameterValues.put(ImageRenderingEngine.PARAM_CROP_WIDTH, 50); // 256 picels
parameterValues.put(ImageRenderingEngine.PARAM_CROP_HEIGHT, 25); // 128 pixels
parameterValues.put(ImageRenderingEngine.PARAM_IS_PERCENT_CROP, true);
parameterValues.put(CropSourceOptionsSerializer.PARAM_CROP_WIDTH, 50); // 256 picels
parameterValues.put(CropSourceOptionsSerializer.PARAM_CROP_HEIGHT, 25); // 128 pixels
parameterValues.put(CropSourceOptionsSerializer.PARAM_IS_PERCENT_CROP, true);
final NodeRef secondRenditionNode = performImageRendition(parameterValues,nodeWithImageContent);