Search in sources :

Example 1 with TransformationSourceOptionsSerializer

use of org.alfresco.service.cmr.repository.TransformationSourceOptions.TransformationSourceOptionsSerializer in project alfresco-repository by Alfresco.

the class AbstractTransformationRenderingEngine method getTransformOptionsImpl.

protected TransformationOptions getTransformOptionsImpl(TransformationOptions options, RenderingContext context) {
    Long timeoutMs = context.getCheckedParam(PARAM_TIMEOUT_MS, Long.class);
    if (timeoutMs != null) {
        options.setTimeoutMs(timeoutMs);
    }
    Long readLimitTimeMs = context.getCheckedParam(PARAM_READ_LIMIT_TIME_MS, Long.class);
    if (readLimitTimeMs != null) {
        options.setReadLimitTimeMs(readLimitTimeMs);
    }
    Long maxSourceSizeKBytes = context.getCheckedParam(PARAM_MAX_SOURCE_SIZE_K_BYTES, Long.class);
    if (maxSourceSizeKBytes != null) {
        options.setMaxSourceSizeKBytes(maxSourceSizeKBytes);
    }
    Long readLimitKBytes = context.getCheckedParam(PARAM_READ_LIMIT_K_BYTES, Long.class);
    if (readLimitKBytes != null) {
        options.setReadLimitKBytes(readLimitKBytes);
    }
    Integer maxPages = context.getCheckedParam(PARAM_MAX_PAGES, Integer.class);
    if (maxPages != null) {
        options.setMaxPages(maxPages);
    }
    Integer pageLimit = context.getCheckedParam(PARAM_PAGE_LIMIT, Integer.class);
    if (pageLimit != null) {
        options.setPageLimit(pageLimit);
    }
    String use = context.getCheckedParam(PARAM_USE, String.class);
    if (use != null) {
        options.setUse(use);
    }
    if (getSourceOptionsSerializers() != null) {
        for (TransformationSourceOptionsSerializer sourceSerializer : getSourceOptionsSerializers()) {
            TransformationSourceOptions sourceOptions = sourceSerializer.deserialize(context);
            if (sourceOptions != null) {
                options.addSourceOptions(sourceOptions);
            }
        }
    }
    return options;
}
Also used : TransformationSourceOptionsSerializer(org.alfresco.service.cmr.repository.TransformationSourceOptions.TransformationSourceOptionsSerializer) TransformationSourceOptions(org.alfresco.service.cmr.repository.TransformationSourceOptions)

Aggregations

TransformationSourceOptions (org.alfresco.service.cmr.repository.TransformationSourceOptions)1 TransformationSourceOptionsSerializer (org.alfresco.service.cmr.repository.TransformationSourceOptions.TransformationSourceOptionsSerializer)1