Expose audit service as public service and in freemarker.

Tests


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@3683 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Andrew Hind
2006-09-04 19:12:55 +00:00
parent 6777f68fa5
commit e244f2c93c
19 changed files with 753 additions and 53 deletions

View File

@@ -68,6 +68,11 @@ public class AuditServiceImpl implements AuditService
auditComponent.audit(source, description, key, args);
}
public List<AuditInfo> getAuditTrail(NodeRef nodeRef)
{
return auditComponent.getAuditTrail(nodeRef);
}
public static void main(String[] args) throws Exception
{
@@ -82,17 +87,25 @@ public class AuditServiceImpl implements AuditService
try
{
NodeRef nodeRef = new NodeRef(new StoreRef("test", "audit"), "id");
as.audit("AuditedApp", "First");
as.audit("AuditedApp", "Second", new NodeRef(new StoreRef("test", "audit"), "id"));
System.out.println("Audit entries for node "+as.getAuditTrail(nodeRef).size());
as.audit("AuditedApp", "Second", nodeRef);
System.out.println("Audit entries for node "+as.getAuditTrail(nodeRef).size());
as.audit("AuditedApp", "Third", new Object[] { "one", "two", "three" });
as.audit("AuditedApp", "Fourth", new NodeRef(new StoreRef("test", "audit"), "id"), new Object[] { "one",
System.out.println("Audit entries for node "+as.getAuditTrail(nodeRef).size());
as.audit("AuditedApp", "Fourth",nodeRef, new Object[] { "one",
"two", "three" });
System.out.println("Audit entries for node "+as.getAuditTrail(nodeRef).size());
as.audit("UnAuditedApp", "First");
as.audit("UnAuditedApp", "Second", new NodeRef(new StoreRef("test", "audit"), "id"));
System.out.println("Audit entries for node "+as.getAuditTrail(nodeRef).size());
as.audit("UnAuditedApp", "Second", nodeRef);
System.out.println("Audit entries for node "+as.getAuditTrail(nodeRef).size());
as.audit("UnAuditedApp", "Third", new Object[] { "one", "two", "three" });
as.audit("UnAuditedApp", "Fourth", new NodeRef(new StoreRef("test", "audit"), "id"), new Object[] { "one",
System.out.println("Audit entries for node "+as.getAuditTrail(nodeRef).size());
as.audit("UnAuditedApp", "Fourth", nodeRef, new Object[] { "one",
"two", "three" });
System.out.println("Audit entries for node "+as.getAuditTrail(nodeRef).size());
}
finally
{
@@ -101,10 +114,4 @@ public class AuditServiceImpl implements AuditService
tx.commit();
}
public List<AuditInfo> getAuditTrail(NodeRef nodeRef)
{
// TODO Auto-generated method stub
return null;
}
}