ALF-14306 Add priorities to transformers

- Fix build failures

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@46909 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Alan Davis
2013-02-21 11:10:08 +00:00
parent 2b1d9fc813
commit 3207aa4603
3 changed files with 28 additions and 5 deletions

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright (C) 2005-2012 Alfresco Software Limited. * Copyright (C) 2005-2013 Alfresco Software Limited.
* *
* This file is part of Alfresco * This file is part of Alfresco
* *
@@ -107,6 +107,22 @@ public class DoubleMap<K1, K2, V>
return value; return value;
} }
/**
* Returns a value for the given keys without using wildcards.
*/
public V getNoWildcards(K1 key1, K2 key2)
{
V value = null;
Map<K2, V> map = mapMap.get(key1);
if (map != null)
{
value = map.get(key2);
}
return value;
}
/** /**
* Adds a value for the given keys. * Adds a value for the given keys.

View File

@@ -67,8 +67,7 @@ public class TransformerConfigLimits extends TransformerPropertyNameExtractor
{ {
options = getOrCreateTransformerOptionLimits(property.transformerName, options = getOrCreateTransformerOptionLimits(property.transformerName,
property.sourceMimetype, property.targetMimetype); property.sourceMimetype, property.targetMimetype);
setTransformationOptionsFromProperties(options, property.transformerName, property.sourceExt, property.targetExt, setTransformationOptionsFromProperties(options, property.value, property.suffix);
property.value, property.suffix);
} }
} }
@@ -87,7 +86,7 @@ public class TransformerConfigLimits extends TransformerPropertyNameExtractor
limits.put(transformerName, mimetypeLimits); limits.put(transformerName, mimetypeLimits);
} }
TransformationOptionLimits options = mimetypeLimits.get(sourceMimetype, targetMimetype); TransformationOptionLimits options = mimetypeLimits.getNoWildcards(sourceMimetype, targetMimetype);
if (options == null) if (options == null)
{ {
options = new TransformationOptionLimits(); options = new TransformationOptionLimits();
@@ -97,7 +96,7 @@ public class TransformerConfigLimits extends TransformerPropertyNameExtractor
} }
private void setTransformationOptionsFromProperties(TransformationOptionLimits options, private void setTransformationOptionsFromProperties(TransformationOptionLimits options,
String transformerName, String sourceExt, String targetExt, String value, String suffix) String value, String suffix)
{ {
long l = Long.parseLong(value); long l = Long.parseLong(value);
if (suffix == TransformerConfig.MAX_SOURCE_SIZE_K_BYTES) if (suffix == TransformerConfig.MAX_SOURCE_SIZE_K_BYTES)

View File

@@ -222,6 +222,14 @@ class TransformerSourceTargetValue
{ {
return new Triple<String, String, String>(transformerName, sourceExt, targetExt); return new Triple<String, String, String>(transformerName, sourceExt, targetExt);
} }
public String toString()
{
return transformerName+'.'+(sourceExt.equals(ANY) && targetExt.equals(ANY)
? ""
: TransformerConfig.EXTENSIONS+'.'+sourceExt+'.'+targetExt+'.')+
suffix+'='+value;
}
@Override @Override
public int hashCode() public int hashCode()