use of org.alfresco.transform.client.registry.AbstractTransformRegistry in project alfresco-repository by Alfresco.
the class AbstractRenditionTest method logSourceTarget.
private void logSourceTarget(StringBuilder sourceTargetList, StringBuilder sourceTargetPriorityList, AtomicInteger count, String sourceMimetype, String targetMimetype) {
count.incrementAndGet();
String sourceExtension = mimetypeService.getExtension(sourceMimetype);
String targetExtension = mimetypeService.getExtension(targetMimetype);
String line = String.format("%4d %4s %4s\n", count.get(), sourceExtension, targetExtension);
sourceTargetList.append(line);
if (sourceTargetPriorityList != null) {
AbstractTransformRegistry registry = getAbstractTransformRegistry();
if (registry != null) {
Map<String, List<SupportedTransform>> supportedTransformsByTargetMimetype = registry.getData().retrieveTransforms(sourceMimetype);
List<SupportedTransform> supportedTransforms = new ArrayList<>(supportedTransformsByTargetMimetype.get(targetMimetype));
supportedTransforms.sort((t1, t2) -> t1.getPriority() - t2.getPriority());
char a = 'a';
int prevPriority = Integer.MAX_VALUE;
for (SupportedTransform supportedTransform : supportedTransforms) {
int priority = supportedTransform.getPriority();
long maxSourceSizeBytes = supportedTransform.getMaxSourceSizeBytes();
String priorityUnchanged = prevPriority == priority ? "*" : "";
String transformName = supportedTransform.getName();
line = String.format("%4d %4s %4s %c) [%d%s] %s %d\n", count.get(), sourceExtension, targetExtension, a++, priority, priorityUnchanged, transformName, maxSourceSizeBytes);
sourceTargetPriorityList.append(line);
prevPriority = priority;
}
}
}
}
Aggregations