Merged BRANCHES/DEV/RGAUSS/HEAD-SOURCE-TARGET-TRANS-OPTIONS to HEAD:

45449: ALF-13254: TransformationOptions Should Have Separate Source and Target Options
        - Added SerializedTransformationOptionsAccessor interface which defines the methods used in the protected AbstractRenderingEngine.RenderContext class in a public manner
        - Changed AbstractRenderingEngine.RenderContext to implement SerializedTransformationOptionsAccessor
        - Added TransformationSourceOptions interface which also contains TransformationSourceOptionsSerializer interface which uses SerializedTransformationOptionsAccessor for deserialization
        - Added base AbstractTransformationSourceOptions class
        - Added PagedSourceOptions class which extends TransformationSourceOptions for start and end page options
        - Added TemporalSourceOptions class which extends TransformationSourceOptions for time-based offset and duration options
        - Changed TransformationOptions to contain TransformationSourceOptions held as a map with class as key
        - Changed ImageTransformationOptions to extend copyFrom
        - Changed ImageMagickContentTransformerWorker.getSourcePageRange to check for paged source options in the TransformationOptions passed in
        - Added ImageMagickContentTransformerTest.testPageSourceOptions to test null, default, page 2, and invalid options
        - Changed ThumbnailRenditionConvertor to iterate the transformationOptions.sourceOptionsList and use each serializer to add to the parameters
        - Changed AbstractTransformationRenderingEngine to iterate a list of TransformationSourceOptionsSerializers and use each to deserialize the RenderContext parameters and construct a TransformationSourceOptions object
        - Changed rendition-services-context.xml to set imageRenderingEngine's list of known sourceOptionsSerializers
        - Changed ThumbnailServiceImplParameterTest to test paged and temporal options
        - Added ThumbanailServiceImplTest.testCreateRenditionThumbnailFromPdfPage2 which tests grabbing the second page of a PDF


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@46062 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Ray Gauss
2013-01-30 20:32:55 +00:00
parent 259ceebf47
commit 1c928e4c9f
15 changed files with 1005 additions and 27 deletions

View File

@@ -59,6 +59,7 @@ import org.alfresco.service.cmr.repository.ContentService;
import org.alfresco.service.cmr.repository.ContentWriter;
import org.alfresco.service.cmr.repository.NodeRef;
import org.alfresco.service.cmr.repository.NodeService;
import org.alfresco.service.cmr.repository.SerializedTransformationOptionsAccessor;
import org.alfresco.service.namespace.NamespaceException;
import org.alfresco.service.namespace.NamespaceService;
import org.alfresco.service.namespace.QName;
@@ -732,7 +733,7 @@ public abstract class AbstractRenderingEngine extends ActionExecuterAbstractBase
return result;
}
protected class RenderingContext
protected class RenderingContext implements SerializedTransformationOptionsAccessor
{
private final NodeRef sourceNode;
private final RenditionDefinition definition;
@@ -792,31 +793,11 @@ public abstract class AbstractRenderingEngine extends ActionExecuterAbstractBase
return this.definition;
}
/**
* Gets the value for the named parameter from the . Checks the type of
* the parameter is correct and throws and Exception if it isn't.
* Returns <code>null</code> if the parameter value is <code>null</code>
*
* @param paramName the name of the parameter being checked.
* @param clazz the expected {@link Class} of the parameter value.
* @return the parameter value or <code>null</code>.
*/
public <T> T getCheckedParam(String paramName, Class<T> clazz)
{
return AbstractRenderingEngine.getCheckedParam(paramName, clazz, definition);
}
/**
* Gets the value for the named parameter. Checks the type of the
* parameter is the same as the type of <code>defaultValue</code> and
* throws a {@link RenditionServiceException} if it isn't. Returns
* <code>defaultValue</code> if the parameter value is <code>null</code>
*
* @param <T>
* @param paramName
* @param defaultValue
* @return
*/
public <T> T getParamWithDefault(String paramName, T defaultValue)
{
return AbstractRenderingEngine.getParamWithDefault(paramName, defaultValue, definition);