mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Merged HEAD-BUG-FIX (4.3/Cloud) to HEAD (4.3/Cloud)
63067: Merged V4.2-BUG-FIX (4.2.2) to HEAD-BUG-FIX (Cloud/4.3) 62765: MNT-10611: Merged DEV to V4.2-BUG-FIX (4.2.2) 62735: MNT-10611: Exception generated in .AccessAuditor. when audited String values bigger than 1024 characters (non-MySQL) - Trim String and MLtext audit values to not exceed system.maximumStringLength. Add unit test for case. git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@64255 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -24,7 +24,9 @@ import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.concurrent.ThreadPoolExecutor;
|
||||
|
||||
@@ -37,6 +39,7 @@ import org.alfresco.repo.domain.schema.SchemaBootstrap;
|
||||
import org.alfresco.repo.security.authentication.AuthenticationUtil;
|
||||
import org.alfresco.repo.transaction.RetryingTransactionHelper.RetryingTransactionCallback;
|
||||
import org.alfresco.service.Auditable;
|
||||
import org.alfresco.service.cmr.repository.MLText;
|
||||
import org.alfresco.service.cmr.repository.datatype.DefaultTypeConverter;
|
||||
import org.alfresco.service.cmr.repository.datatype.TypeConversionException;
|
||||
import org.alfresco.service.transaction.TransactionService;
|
||||
@@ -373,6 +376,16 @@ public class AuditMethodInterceptor implements MethodInterceptor
|
||||
{
|
||||
audit = SchemaBootstrap.trimStringForTextFields((String) audit);
|
||||
}
|
||||
// trim MLText
|
||||
else if (audit instanceof MLText)
|
||||
{
|
||||
MLText mltext = (MLText) audit;
|
||||
Set<Locale> locales = mltext.getLocales();
|
||||
for (Locale locale : locales)
|
||||
{
|
||||
mltext.put(locale, SchemaBootstrap.trimStringForTextFields(mltext.getValue(locale)));
|
||||
}
|
||||
}
|
||||
}
|
||||
return audit;
|
||||
}
|
||||
|
Reference in New Issue
Block a user