ACS-1998 Enhance the transform config (#484)

This commit is contained in:
Alan Davis
2021-11-13 11:29:21 +00:00
committed by GitHub
parent 3b6169bb34
commit 00c8fc7b34
6 changed files with 35 additions and 33 deletions

View File

@@ -2,7 +2,7 @@
* #%L
* Alfresco Repository
* %%
* Copyright (C) 2005 - 2018 Alfresco Software Limited
* Copyright (C) 2005 - 2021 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* If the software was purchased under a paid Alfresco license, the terms of
@@ -36,6 +36,7 @@ import javax.annotation.PostConstruct;
import org.alfresco.transform.client.model.config.TransformConfig;
import org.alfresco.transform.client.registry.AbstractTransformRegistry;
import org.alfresco.transform.client.registry.CombinedTransformConfig;
import org.alfresco.transform.client.registry.TransformCache;
import org.alfresco.transform.exceptions.TransformException;
import org.slf4j.Logger;
@@ -67,7 +68,8 @@ public class TransformRegistryImpl extends AbstractTransformRegistry
{
engineConfig = resourceLoader.getResource(locationFromProperty);
TransformConfig transformConfig = getTransformConfig();
registerAll(transformConfig, null, locationFromProperty);
// There is only one TransformConfig in a T-Engine so the following call is fine
CombinedTransformConfig.combineAndRegister(transformConfig, locationFromProperty, "---", this);
}
// Holds the structures used by AbstractTransformRegistry to look up what is supported.

View File

@@ -503,7 +503,10 @@ public abstract class AbstractTransformerControllerTest
private Transformer buildTransformer(String sourceMediaType, String targetMediaType)
{
Set<SupportedSourceAndTarget> supportedSourceAndTargetList = ImmutableSet.of(
new SupportedSourceAndTarget(sourceMediaType, targetMediaType, -1));
SupportedSourceAndTarget.builder()
.withSourceMediaType(sourceMediaType)
.withTargetMediaType(targetMediaType)
.build());
Transformer transformer = new Transformer();
transformer.setSupportedSourceAndTargetList(supportedSourceAndTargetList);