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
*
@@ -108,6 +108,22 @@ public class DoubleMap<K1, K2, V>
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.
*/

View File

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

View File

@@ -223,6 +223,14 @@ class TransformerSourceTargetValue
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
public int hashCode()
{