mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-14 17:58:59 +00:00
ALF-4106 AuditService enhancements and fixes
- Enabling DEBUG logging for 'org.alfresco.repo.audit.inbound' will dump all auditable data - Fixed values output so that Serializable map entries are converted to Strings - Made plain the pre-audit client check (i.e. it doesn't need a path for checking) git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@22203 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -29,6 +29,7 @@ import org.alfresco.service.cmr.audit.AuditQueryParameters;
|
||||
import org.alfresco.service.cmr.audit.AuditService.AuditApplication;
|
||||
import org.alfresco.service.cmr.audit.AuditService.AuditQueryCallback;
|
||||
import org.alfresco.service.cmr.repository.datatype.DefaultTypeConverter;
|
||||
import org.alfresco.service.cmr.repository.datatype.TypeConversionException;
|
||||
import org.springframework.extensions.webscripts.Cache;
|
||||
import org.springframework.extensions.webscripts.Status;
|
||||
import org.springframework.extensions.webscripts.WebScriptException;
|
||||
@@ -135,7 +136,25 @@ public class AuditQueryGet extends AbstractAuditWebScript
|
||||
entry.put(JSON_KEY_ENTRY_TIME, new Date(time));
|
||||
if (values != null)
|
||||
{
|
||||
entry.put(JSON_KEY_ENTRY_VALUES, values);
|
||||
// Convert values to Strings
|
||||
Map<String, String> valueStrings = new HashMap<String, String>(values.size() * 2);
|
||||
for (Map.Entry<String, Serializable> mapEntry : values.entrySet())
|
||||
{
|
||||
String key = mapEntry.getKey();
|
||||
Serializable value = mapEntry.getValue();
|
||||
try
|
||||
{
|
||||
String valueString = DefaultTypeConverter.INSTANCE.convert(String.class, value);
|
||||
valueStrings.put(key, valueString);
|
||||
}
|
||||
catch (TypeConversionException e)
|
||||
{
|
||||
// Use the toString()
|
||||
valueStrings.put(key, value.toString());
|
||||
}
|
||||
|
||||
}
|
||||
entry.put(JSON_KEY_ENTRY_VALUES, valueStrings);
|
||||
}
|
||||
entries.add(entry);
|
||||
|
||||
|
Reference in New Issue
Block a user