mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-31 17:39:05 +00:00
ACS-2498 Add coreVersion to T-Engine config (#937)
Added isSupported(CoreFunction function, String transformerName) and isSupported(CoreFunction function, LocalTransform transform) ready for work on the ACS-2493 & ACS-2494.
This commit is contained in:
2
pom.xml
2
pom.xml
@@ -51,7 +51,7 @@
|
|||||||
<dependency.alfresco-log-sanitizer.version>0.2</dependency.alfresco-log-sanitizer.version>
|
<dependency.alfresco-log-sanitizer.version>0.2</dependency.alfresco-log-sanitizer.version>
|
||||||
<dependency.activiti-engine.version>5.23.0</dependency.activiti-engine.version>
|
<dependency.activiti-engine.version>5.23.0</dependency.activiti-engine.version>
|
||||||
<dependency.activiti.version>5.23.0</dependency.activiti.version>
|
<dependency.activiti.version>5.23.0</dependency.activiti.version>
|
||||||
<dependency.alfresco-transform-model.version>1.4.8</dependency.alfresco-transform-model.version>
|
<dependency.alfresco-transform-model.version>1.4.9</dependency.alfresco-transform-model.version>
|
||||||
<dependency.alfresco-greenmail.version>6.2</dependency.alfresco-greenmail.version>
|
<dependency.alfresco-greenmail.version>6.2</dependency.alfresco-greenmail.version>
|
||||||
<dependency.acs-event-model.version>0.0.13</dependency.acs-event-model.version>
|
<dependency.acs-event-model.version>0.0.13</dependency.acs-event-model.version>
|
||||||
|
|
||||||
|
@@ -86,6 +86,7 @@ public abstract class AbstractLocalTransform implements LocalTransform
|
|||||||
String renditionName, NodeRef sourceNodeRef)
|
String renditionName, NodeRef sourceNodeRef)
|
||||||
throws UnsupportedTransformationException, ContentIOException;
|
throws UnsupportedTransformationException, ContentIOException;
|
||||||
|
|
||||||
|
@Override
|
||||||
public String getName()
|
public String getName()
|
||||||
{
|
{
|
||||||
return name;
|
return name;
|
||||||
|
@@ -2,7 +2,7 @@
|
|||||||
* #%L
|
* #%L
|
||||||
* Alfresco Repository
|
* Alfresco Repository
|
||||||
* %%
|
* %%
|
||||||
* Copyright (C) 2019 Alfresco Software Limited
|
* Copyright (C) 2022 Alfresco Software Limited
|
||||||
* %%
|
* %%
|
||||||
* This file is part of the Alfresco software.
|
* This file is part of the Alfresco software.
|
||||||
* If the software was purchased under a paid Alfresco license, the terms of
|
* If the software was purchased under a paid Alfresco license, the terms of
|
||||||
@@ -25,6 +25,7 @@
|
|||||||
*/
|
*/
|
||||||
package org.alfresco.repo.content.transform;
|
package org.alfresco.repo.content.transform;
|
||||||
|
|
||||||
|
import org.alfresco.transform.client.model.config.CoreFunction;
|
||||||
import org.alfresco.transform.client.registry.TransformServiceRegistry;
|
import org.alfresco.transform.client.registry.TransformServiceRegistry;
|
||||||
|
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
@@ -49,4 +50,10 @@ public class DummyTransformServiceRegistry implements TransformServiceRegistry
|
|||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isSupported(CoreFunction function, String transformerName)
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@@ -2,7 +2,7 @@
|
|||||||
* #%L
|
* #%L
|
||||||
* Alfresco Repository
|
* Alfresco Repository
|
||||||
* %%
|
* %%
|
||||||
* Copyright (C) 2019 Alfresco Software Limited
|
* Copyright (C) 2022 Alfresco Software Limited
|
||||||
* %%
|
* %%
|
||||||
* This file is part of the Alfresco software.
|
* This file is part of the Alfresco software.
|
||||||
* If the software was purchased under a paid Alfresco license, the terms of
|
* If the software was purchased under a paid Alfresco license, the terms of
|
||||||
@@ -54,4 +54,9 @@ public interface LocalTransform
|
|||||||
void transform(ContentReader reader, ContentWriter writer, Map<String, String> transformOptions,
|
void transform(ContentReader reader, ContentWriter writer, Map<String, String> transformOptions,
|
||||||
String renditionName, NodeRef sourceNodeRef)
|
String renditionName, NodeRef sourceNodeRef)
|
||||||
throws UnsupportedTransformationException, ContentIOException;
|
throws UnsupportedTransformationException, ContentIOException;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return the name of the transform.
|
||||||
|
*/
|
||||||
|
String getName();
|
||||||
}
|
}
|
||||||
|
@@ -2,7 +2,7 @@
|
|||||||
* #%L
|
* #%L
|
||||||
* Alfresco Repository
|
* Alfresco Repository
|
||||||
* %%
|
* %%
|
||||||
* Copyright (C) 2019 - 2021 Alfresco Software Limited
|
* Copyright (C) 2019 - 2022 Alfresco Software Limited
|
||||||
* %%
|
* %%
|
||||||
* This file is part of the Alfresco software.
|
* This file is part of the Alfresco software.
|
||||||
* If the software was purchased under a paid Alfresco license, the terms of
|
* 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 java.util.stream.Collectors;
|
||||||
|
|
||||||
import org.alfresco.service.cmr.repository.MimetypeService;
|
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.model.config.TransformOptionGroup;
|
||||||
import org.alfresco.transform.client.registry.CombinedConfig;
|
import org.alfresco.transform.client.registry.CombinedConfig;
|
||||||
import org.alfresco.transform.client.model.config.TransformOption;
|
import org.alfresco.transform.client.model.config.TransformOption;
|
||||||
@@ -473,4 +474,17 @@ public class LocalTransformServiceRegistry extends TransformServiceRegistryImpl
|
|||||||
}
|
}
|
||||||
return localTransform;
|
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());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@@ -2,7 +2,7 @@
|
|||||||
* #%L
|
* #%L
|
||||||
* Alfresco Repository
|
* Alfresco Repository
|
||||||
* %%
|
* %%
|
||||||
* Copyright (C) 2005 - 2020 Alfresco Software Limited
|
* Copyright (C) 2005 - 2022 Alfresco Software Limited
|
||||||
* %%
|
* %%
|
||||||
* This file is part of the Alfresco software.
|
* This file is part of the Alfresco software.
|
||||||
* If the software was purchased under a paid Alfresco license, the terms of
|
* If the software was purchased under a paid Alfresco license, the terms of
|
||||||
@@ -25,6 +25,7 @@
|
|||||||
*/
|
*/
|
||||||
package org.alfresco.repo.rendition2;
|
package org.alfresco.repo.rendition2;
|
||||||
|
|
||||||
|
import org.alfresco.transform.client.model.config.CoreFunction;
|
||||||
import org.alfresco.transform.client.registry.TransformServiceRegistry;
|
import org.alfresco.transform.client.registry.TransformServiceRegistry;
|
||||||
|
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
@@ -78,4 +79,10 @@ public class SwitchingTransformServiceRegistry implements TransformServiceRegist
|
|||||||
}
|
}
|
||||||
return name;
|
return name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isSupported(CoreFunction function, String transformerName)
|
||||||
|
{
|
||||||
|
return primary.isSupported(function, transformerName) && secondary.isSupported(function, transformerName);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@@ -47,6 +47,8 @@ import java.io.StringReader;
|
|||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.List;
|
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
|
* 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.<p>
|
* in one file. Transform options are shared between all sources.<p>
|
||||||
@@ -104,7 +106,7 @@ public class CombinedConfig extends CombinedTransformConfig
|
|||||||
|
|
||||||
private boolean addRemoteConfig(String baseUrl, String remoteType)
|
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);
|
HttpGet httpGet = new HttpGet(url);
|
||||||
boolean successReadingConfig = true;
|
boolean successReadingConfig = true;
|
||||||
try
|
try
|
||||||
|
@@ -2,7 +2,7 @@
|
|||||||
* #%L
|
* #%L
|
||||||
* Alfresco Repository
|
* Alfresco Repository
|
||||||
* %%
|
* %%
|
||||||
* Copyright (C) 2005 - 2019 Alfresco Software Limited
|
* Copyright (C) 2005 - 2022 Alfresco Software Limited
|
||||||
* %%
|
* %%
|
||||||
* This file is part of the Alfresco software.
|
* This file is part of the Alfresco software.
|
||||||
* If the software was purchased under a paid Alfresco license, the terms of
|
* If the software was purchased under a paid Alfresco license, the terms of
|
||||||
@@ -25,6 +25,7 @@
|
|||||||
*/
|
*/
|
||||||
package org.alfresco.repo.rendition2;
|
package org.alfresco.repo.rendition2;
|
||||||
|
|
||||||
|
import org.alfresco.transform.client.model.config.CoreFunction;
|
||||||
import org.alfresco.transform.client.registry.TransformServiceRegistry;
|
import org.alfresco.transform.client.registry.TransformServiceRegistry;
|
||||||
|
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
@@ -69,4 +70,10 @@ public class TestTransformServiceRegistry implements TransformServiceRegistry
|
|||||||
{
|
{
|
||||||
throw new UnsupportedOperationException("not implemented");
|
throw new UnsupportedOperationException("not implemented");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isSupported(CoreFunction function, String transformerName)
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user