mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-31 17:39:05 +00:00
ALF-19700 BM-0013: Soak: V420b227_03: Transformation server overloaded
- Modified the way content.transformer.<transformer name>.extensions.<source>.<target>*.*.supported=[true|false] work so they are still backward compatible AND one can define if unmatched mimetypes are supported or not. For example: content.transformer.remoteServer.extensions.*.*.supported=false - Added properties to transformers.properties so that the Transformation server ONLY supports the transformations it did in 4.1.5 AND allows customers to change just one property to allow the Transformation Server to do all transformations that it can with the exception of those that go to text, as generally the default transformers do a better job and are faster. git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@55704 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -99,48 +99,45 @@ public class TransformerConfigSupported extends TransformerPropertyNameExtractor
|
||||
return isSupported;
|
||||
}
|
||||
|
||||
// Class contains both supported and unsupported combinations to avoid having to
|
||||
// add in an extra ANY to ANY combination which could be true or false. Having an
|
||||
// extra combination might reduce understandability.
|
||||
private class SupportedAndUnsupportedTransformations
|
||||
{
|
||||
DoubleMap<String, String, Boolean> supportedTransformations;
|
||||
DoubleMap<String, String, Boolean> unsupportedTransformations;
|
||||
boolean supportedSet = false;
|
||||
|
||||
SupportedAndUnsupportedTransformations()
|
||||
{
|
||||
}
|
||||
|
||||
public void put(String sourceMimetype, String targetMimetype, boolean supported)
|
||||
{
|
||||
if (supportedTransformations == null)
|
||||
{
|
||||
supportedTransformations = new DoubleMap<String, String, Boolean>(ANY, ANY);
|
||||
if (supported)
|
||||
{
|
||||
supportedSet = true;
|
||||
}
|
||||
}
|
||||
supportedTransformations.put(sourceMimetype, targetMimetype, supported);
|
||||
}
|
||||
|
||||
boolean isSupported(String sourceMimetype, String targetMimetype)
|
||||
{
|
||||
boolean isSupported = true;
|
||||
// To be backward compatible, the default (ANY to ANY) transformation
|
||||
// needs to be true if only unsupported values are set or neither
|
||||
// unsupported nor supported values are set. If supported values are
|
||||
// set the default is false.
|
||||
boolean isSupported = !supportedSet;
|
||||
|
||||
if (supportedTransformations != null)
|
||||
{
|
||||
Boolean sup = supportedTransformations.get(sourceMimetype, targetMimetype);
|
||||
isSupported = sup != null;
|
||||
}
|
||||
if (isSupported && unsupportedTransformations != null)
|
||||
{
|
||||
Boolean sup = unsupportedTransformations.get(sourceMimetype, targetMimetype);
|
||||
isSupported = sup == null;
|
||||
Boolean sup = supportedTransformations.get(sourceMimetype, targetMimetype);
|
||||
if (sup != null)
|
||||
{
|
||||
isSupported = sup;
|
||||
}
|
||||
}
|
||||
return isSupported;
|
||||
}
|
||||
|
||||
public void put(String sourceMimetype, String targetMimetype, boolean supported)
|
||||
{
|
||||
if (supported)
|
||||
{
|
||||
if (supportedTransformations == null)
|
||||
{
|
||||
supportedTransformations = new DoubleMap<String, String, Boolean>(ANY, ANY);
|
||||
}
|
||||
supportedTransformations.put(sourceMimetype, targetMimetype, supported);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (unsupportedTransformations == null)
|
||||
{
|
||||
unsupportedTransformations = new DoubleMap<String, String, Boolean>(ANY, ANY);
|
||||
}
|
||||
unsupportedTransformations.put(sourceMimetype, targetMimetype, supported);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user