mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
ALF-14306: Merged DEV to HEAD (4.2)
Add priorities to transformers - Addition of a separate Transformers subsystem (holds configuration to allow JMX to be used to reset it on the fly) - Moved supported, unsupported and explicit transformation configuration from spring into transformers.properties in the subsystem - Moved all transformer limits configuration from spring and into transformers.properties with the exception of some added for thumbnails and the rendering service - not done as this code is known to be changing. - Added priority, errorTimes and thresholdCount to enable selection of transformers by priority. - Removed the concept of 'Explicit' transformation and replaced with priority and unsupported. - Added logging to aid in the creation of global properties and removal of spring configuration. - Implementation of spring pluggable transformation selector that uses priority. - Merging current state of code changes to allow other work in this area to take place. git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@46719 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2005-2012 Alfresco Software Limited.
|
||||
* Copyright (C) 2005-2013 Alfresco Software Limited.
|
||||
*
|
||||
* This file is part of Alfresco
|
||||
*
|
||||
@@ -150,6 +150,18 @@ public class TransformationOptionLimits
|
||||
pages.setLimit(pageLimit, PAGES_MESSAGE);
|
||||
}
|
||||
|
||||
// --------------- Enabled ---------------
|
||||
|
||||
/**
|
||||
* Indicates if the limits allow a transformation to take place at all.
|
||||
* If any of the limits are 0, it would not be possible.
|
||||
* @return true if a transformation is possible.
|
||||
*/
|
||||
public boolean supported()
|
||||
{
|
||||
return time.supported() && kbytes.supported() && pages.supported();
|
||||
}
|
||||
|
||||
// --------------- Map ---------------
|
||||
public Map<String, Object> toMap(Map<String, Object> optionsMap)
|
||||
{
|
||||
|
@@ -37,7 +37,7 @@ import org.apache.commons.logging.LogFactory;
|
||||
* <bean id="mimetypeLimits.OpenOffice" class="org.alfresco.service.cmr.repository.TransformationOptionLimitsMap">
|
||||
* <constructor-arg>
|
||||
* <value>
|
||||
* * txt TransformationOptionLimits ${content.transformer.OpenOffice.mimeTypeLimits.txt.pdf.maxSourceSizeKBytes} ;
|
||||
* * txt maxSourceSizeKBytes ${content.transformer.OpenOffice.mimeTypeLimits.txt.pdf.maxSourceSizeKBytes} ;
|
||||
* doc pdf maxSourceSizeKBytes ${content.transformer.OpenOffice.mimeTypeLimits.doc.pdf.maxSourceSizeKBytes}
|
||||
* </value>
|
||||
* </constructor-arg>
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2005-2012 Alfresco Software Limited.
|
||||
* Copyright (C) 2005-2013 Alfresco Software Limited.
|
||||
*
|
||||
* This file is part of Alfresco
|
||||
*
|
||||
@@ -104,6 +104,16 @@ public class TransformationOptionPair
|
||||
return minSet(getMax(), getLimit());
|
||||
}
|
||||
|
||||
/**
|
||||
* Indicates if the limit allows a transformation to take place at all.
|
||||
* If 0, it would not be possible.
|
||||
* @return true if a transformation is possible.
|
||||
*/
|
||||
public boolean supported()
|
||||
{
|
||||
return getValue() != 0;
|
||||
}
|
||||
|
||||
public Action getAction()
|
||||
{
|
||||
return
|
||||
@@ -112,6 +122,19 @@ public class TransformationOptionPair
|
||||
: null;
|
||||
}
|
||||
|
||||
public String toString(String max, String limit)
|
||||
{
|
||||
if (getMax() >= 0)
|
||||
{
|
||||
return max+'='+getValue();
|
||||
}
|
||||
if (getLimit() >= 0)
|
||||
{
|
||||
return limit+'='+getValue();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the lower of the two value supplied, ignoring values less than
|
||||
* 0 unless both are less than zero.
|
||||
|
@@ -517,7 +517,7 @@ public class TransformationOptions implements Cloneable
|
||||
* <li>{@link #OPT_INCLUDE_EMBEDDED}</li>
|
||||
* <li>{@link TransformationOptionLimits#OPT_TIMEOUT_MS}</li>
|
||||
* <li>{@link TransformationOptionLimits#OPT_READ_LIMIT_TIME_MS}</li>
|
||||
* <li>{@link TransformationOptionLimits#OPT_MAX_SOURCE_SIZE_K_BYTES = "maxSourceSizeKBytes";
|
||||
* <li>{@link TransformationOptionLimits#OPT_MAX_SOURCE_SIZE_K_BYTES</li>
|
||||
* <li>{@link TransformationOptionLimits#OPT_READ_LIMIT_K_BYTES}</li>
|
||||
* <li>{@link TransformationOptionLimits#OPT_MAX_PAGES}</li>
|
||||
* <li>{@link TransformationOptionLimits#OPT_PAGE_LIMIT}</li>
|
||||
|
Reference in New Issue
Block a user