diff --git a/build.gradle b/build.gradle
index ca38580ce5..aea74c6c88 100644
--- a/build.gradle
+++ b/build.gradle
@@ -210,7 +210,7 @@ subprojects {
copy {
from "${configModuleDir}"
include "${moduleProperties}"
- include "${fileMapping}"
+ include "${fileMapping}"
into assembleDir
}
@@ -222,7 +222,8 @@ subprojects {
copy {
from configDir
exclude "**/${moduleProperties}"
- exclude "**/${fileMapping}"
+ exclude "**/${fileMapping}"
+ exclude "**/dev-context.xml"
into "${assembleDir}/config"
}
diff --git a/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/audit/RecordsManagementAuditServiceImpl.java b/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/audit/RecordsManagementAuditServiceImpl.java
index 117d3b1e29..994ea8dbb0 100644
--- a/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/audit/RecordsManagementAuditServiceImpl.java
+++ b/rm-server/source/java/org/alfresco/module/org_alfresco_module_rm/audit/RecordsManagementAuditServiceImpl.java
@@ -768,7 +768,7 @@ public class RecordsManagementAuditServiceImpl
* @param reportFormat Format to write the audit trail in, ignored if writer is null
*/
private void getAuditTrailImpl(
- RecordsManagementAuditQueryParameters params,
+ final RecordsManagementAuditQueryParameters params,
final List results,
final Writer writer,
final ReportFormat reportFormat)
@@ -811,6 +811,7 @@ public class RecordsManagementAuditServiceImpl
return false;
}
+
Date timestamp = new Date(time);
String eventName = null;
String fullName = null;
@@ -872,6 +873,22 @@ public class RecordsManagementAuditServiceImpl
return true;
}
+ // filter out events if set
+ if (params.getEvent() != null &&
+ params.getEvent().endsWith(eventName) == false)
+ {
+ // skip it
+ return true;
+ }
+
+
+ if (params.getProperty() != null &&
+ getChangedProperties(beforeProperties, afterProperties).contains(params.getProperty()) == false)
+ {
+ // skip it
+ return false;
+ }
+
// TODO: Refactor this to use the builder pattern
RecordsManagementAuditEntry entry = new RecordsManagementAuditEntry(
timestamp,
@@ -904,6 +921,32 @@ public class RecordsManagementAuditServiceImpl
return true;
}
+ private List getChangedProperties(Map beforeProperties, Map afterProperties)
+ {
+ List changedProperties = new ArrayList(21);
+
+ if (beforeProperties != null && afterProperties != null)
+ {
+ // add all the properties present before the audited action
+ for (QName valuePropName : beforeProperties.keySet())
+ {
+ changedProperties.add(valuePropName);
+ }
+
+ // add all the properties present after the audited action that
+ // have not already been added
+ for (QName valuePropName : afterProperties.keySet())
+ {
+ if (!beforeProperties.containsKey(valuePropName))
+ {
+ changedProperties.add(valuePropName);
+ }
+ }
+ }
+
+ return changedProperties;
+ }
+
private void writeEntryToFile(RecordsManagementAuditEntry entry)
{
if (writer == null)
@@ -947,8 +990,6 @@ public class RecordsManagementAuditServiceImpl
Long fromTime = (params.getDateFrom() == null ? null : new Long(params.getDateFrom().getTime()));
Long toTime = (params.getDateTo() == null ? null : new Long(params.getDateTo().getTime()));
NodeRef nodeRef = params.getNodeRef();
- String eventName = params.getEvent();
- QName propertyQName = params.getProperty();
int maxEntries = params.getMaxEntries();
boolean forward = maxEntries > 0 ? false : true; // Reverse order if the results are limited