(apps.size() * 2);
+ for (String app : apps.keySet())
+ {
+ String name = app;
+ String key = org.alfresco.repo.audit.model.AuditApplication.AUDIT_PATH_SEPARATOR + apps.get(app).getApplicationKey();
+ boolean enabled = auditComponent.isAuditPathEnabled(app, key);
+ AuditApplication auditApplication = new AuditApplication(name, key, enabled);
+ ret.put(name, auditApplication);
+ }
+ return ret;
}
/**
diff --git a/source/java/org/alfresco/repo/audit/model/AuditApplication.java b/source/java/org/alfresco/repo/audit/model/AuditApplication.java
index d030565fc4..3c24795622 100644
--- a/source/java/org/alfresco/repo/audit/model/AuditApplication.java
+++ b/source/java/org/alfresco/repo/audit/model/AuditApplication.java
@@ -199,11 +199,12 @@ public class AuditApplication
{
if (path == null || path.length() == 0)
{
- throw new AuditModelException("Empty or null audit path");
+ throw new AuditModelException("Empty or null audit path: " + path);
}
else if (!path.matches(AUDIT_PATH_REGEX))
{
- throw new AuditModelException("An audit must match regular expression: " + AUDIT_PATH_REGEX);
+ throw new AuditModelException(
+ "Audit path '" + path + "' does not match regular expression: " + AUDIT_PATH_REGEX);
}
}
diff --git a/source/java/org/alfresco/repo/node/NodeAuditor.java b/source/java/org/alfresco/repo/node/NodeAuditor.java
index 3457d46691..7ac10fef92 100644
--- a/source/java/org/alfresco/repo/node/NodeAuditor.java
+++ b/source/java/org/alfresco/repo/node/NodeAuditor.java
@@ -37,6 +37,14 @@ import org.alfresco.util.PropertyCheck;
* A listener that ensures that an event is audited for every deleted node in a tree of nodes, not just the top one
* captured by {@link AuditMethodInterceptor}!
*
+ * The values passed to the audit component are:
+ *
+ * /alfresco-node
+ * /beforeDeleteNode
+ * /node=<nodeRef>
+ *
+ *
+ *
* @author dward
*/
public class NodeAuditor implements InitializingBean, NodeServicePolicies.BeforeDeleteNodePolicy
diff --git a/source/java/org/alfresco/service/cmr/audit/AuditService.java b/source/java/org/alfresco/service/cmr/audit/AuditService.java
index 9f0f2d7abc..ea4c830898 100644
--- a/source/java/org/alfresco/service/cmr/audit/AuditService.java
+++ b/source/java/org/alfresco/service/cmr/audit/AuditService.java
@@ -20,7 +20,6 @@ package org.alfresco.service.cmr.audit;
import java.io.Serializable;
import java.util.Map;
-import java.util.Set;
import org.alfresco.service.PublicService;
@@ -47,15 +46,49 @@ public interface AuditService
* @since 3.4
*/
void setAuditEnabled(boolean enable);
+
+ /**
+ * Helper bean to carry information about an audit application.
+ *
+ * @author Derek Hulley
+ * @since 3.4
+ */
+ public static class AuditApplication
+ {
+ private final String name;
+ private final String key;
+ private final boolean enabled;
+ /**
+ * Constructor for final variables
+ */
+ public AuditApplication(String name, String key, boolean enabled)
+ {
+ this.name = name;
+ this.key = key;
+ this.enabled = enabled;
+ }
+ public String getName()
+ {
+ return name;
+ }
+ public String getKey()
+ {
+ return key;
+ }
+ public boolean isEnabled()
+ {
+ return enabled;
+ }
+ }
/**
* Get all registered audit applications
*
- * @return Returns a set of all available audit applications
+ * @return Returns a map of audit applications keyed by their name
*
* @since 3.4
*/
- Set getAuditApplications();
+ Map getAuditApplications();
/**
* @param applicationName the name of the application to check