transformOptions,
String renditionName, NodeRef sourceNodeRef)
throws UnsupportedTransformationException, ContentIOException;
+
+ /**
+ * @return the name of the transform.
+ */
+ String getName();
}
diff --git a/repository/src/main/java/org/alfresco/repo/content/transform/LocalTransformServiceRegistry.java b/repository/src/main/java/org/alfresco/repo/content/transform/LocalTransformServiceRegistry.java
index cde68e2f63..7b2a13c1ea 100644
--- a/repository/src/main/java/org/alfresco/repo/content/transform/LocalTransformServiceRegistry.java
+++ b/repository/src/main/java/org/alfresco/repo/content/transform/LocalTransformServiceRegistry.java
@@ -2,7 +2,7 @@
* #%L
* Alfresco Repository
* %%
- * Copyright (C) 2019 - 2021 Alfresco Software Limited
+ * Copyright (C) 2019 - 2022 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 java.util.function.Consumer;
import java.util.stream.Collectors;
import org.alfresco.service.cmr.repository.MimetypeService;
+import org.alfresco.transform.client.model.config.CoreFunction;
import org.alfresco.transform.client.model.config.TransformOptionGroup;
import org.alfresco.transform.client.registry.CombinedConfig;
import org.alfresco.transform.client.model.config.TransformOption;
@@ -473,4 +474,17 @@ public class LocalTransformServiceRegistry extends TransformServiceRegistryImpl
}
return localTransform;
}
+
+ /**
+ * Returns {@code true} if the {@code function} is supported by the transform. Not all transforms are
+ * able to support all functionality, as newer features may have been introduced into the core t-engine code since
+ * it was released.
+ * @param function to be checked.
+ * @param transform the local transform.
+ * @return {@code true} is supported, {@code false} otherwise.
+ */
+ boolean isSupported(CoreFunction function, LocalTransform transform)
+ {
+ return isSupported(function, transform.getName());
+ }
}
diff --git a/repository/src/main/java/org/alfresco/repo/rendition2/SwitchingTransformServiceRegistry.java b/repository/src/main/java/org/alfresco/repo/rendition2/SwitchingTransformServiceRegistry.java
index 26a394c8ed..c9647621a7 100644
--- a/repository/src/main/java/org/alfresco/repo/rendition2/SwitchingTransformServiceRegistry.java
+++ b/repository/src/main/java/org/alfresco/repo/rendition2/SwitchingTransformServiceRegistry.java
@@ -2,7 +2,7 @@
* #%L
* Alfresco Repository
* %%
- * Copyright (C) 2005 - 2020 Alfresco Software Limited
+ * Copyright (C) 2005 - 2022 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* If the software was purchased under a paid Alfresco license, the terms of
@@ -25,6 +25,7 @@
*/
package org.alfresco.repo.rendition2;
+import org.alfresco.transform.client.model.config.CoreFunction;
import org.alfresco.transform.client.registry.TransformServiceRegistry;
import java.util.Map;
@@ -78,4 +79,10 @@ public class SwitchingTransformServiceRegistry implements TransformServiceRegist
}
return name;
}
+
+ @Override
+ public boolean isSupported(CoreFunction function, String transformerName)
+ {
+ return primary.isSupported(function, transformerName) && secondary.isSupported(function, transformerName);
+ }
}
diff --git a/repository/src/main/java/org/alfresco/transform/client/registry/CombinedConfig.java b/repository/src/main/java/org/alfresco/transform/client/registry/CombinedConfig.java
index cd6f3faded..5749f4443e 100644
--- a/repository/src/main/java/org/alfresco/transform/client/registry/CombinedConfig.java
+++ b/repository/src/main/java/org/alfresco/transform/client/registry/CombinedConfig.java
@@ -47,6 +47,8 @@ import java.io.StringReader;
import java.util.Collections;
import java.util.List;
+import static org.alfresco.transform.client.util.RequestParamMap.INCLUDE_CORE_VERSION;
+
/**
* This class reads multiple T-Engine config and local files and registers as if they were all
* in one file. Transform options are shared between all sources.
@@ -104,7 +106,7 @@ public class CombinedConfig extends CombinedTransformConfig
private boolean addRemoteConfig(String baseUrl, String remoteType)
{
- String url = baseUrl + (baseUrl.endsWith("/") ? "" : "/") + "transform/config";
+ String url = baseUrl + (baseUrl.endsWith("/") ? "" : "/") + "transform/config?" + INCLUDE_CORE_VERSION + "=" + true;
HttpGet httpGet = new HttpGet(url);
boolean successReadingConfig = true;
try
diff --git a/repository/src/test/java/org/alfresco/repo/rendition2/TestTransformServiceRegistry.java b/repository/src/test/java/org/alfresco/repo/rendition2/TestTransformServiceRegistry.java
index 4f332c5945..3e62a92378 100644
--- a/repository/src/test/java/org/alfresco/repo/rendition2/TestTransformServiceRegistry.java
+++ b/repository/src/test/java/org/alfresco/repo/rendition2/TestTransformServiceRegistry.java
@@ -2,7 +2,7 @@
* #%L
* Alfresco Repository
* %%
- * Copyright (C) 2005 - 2019 Alfresco Software Limited
+ * Copyright (C) 2005 - 2022 Alfresco Software Limited
* %%
* This file is part of the Alfresco software.
* If the software was purchased under a paid Alfresco license, the terms of
@@ -25,6 +25,7 @@
*/
package org.alfresco.repo.rendition2;
+import org.alfresco.transform.client.model.config.CoreFunction;
import org.alfresco.transform.client.registry.TransformServiceRegistry;
import java.util.Map;
@@ -69,4 +70,10 @@ public class TestTransformServiceRegistry implements TransformServiceRegistry
{
throw new UnsupportedOperationException("not implemented");
}
+
+ @Override
+ public boolean isSupported(CoreFunction function, String transformerName)
+ {
+ return true;
+ }
}