Hi,
I am struggling a little bit with the Audit Log. I am trying to add an event to the Audit Log but I do not know which interface to use.
This is what I got so far:
private static AuditManager auditManager;
private static AuditRecordEntityFactory auditRecordEntityFactory;
/**
* Which manager, etc. could I use?
* @return
*/
public static AuditManager getAuditManager() {
//new DefaultAuditManager(auditRecordDao) how would I get this?
if (auditManager == null) {
auditManager = (AuditManager) ContainerManager.getComponent("auditManager");
}
return auditManager;
}
public static AuditRecordEntityFactory getAuditRecordEntityFactory() {
if (auditRecordEntityFactory == null) {
auditRecordEntityFactory = new AuditRecordEntityFactory(new DefaultI18NBeanFactory(), new DefaultLocaleManager());
}
return auditRecordEntityFactory;
}
public static void logClone(String name, String url) {
AuditRecord a = AuditRecord.builder().category("MyPlugin").affectedObject(AffectedObject.builder().objectType("object1").name(name).build()).changedValue(ChangedValue.builder().name("CLONE").build()).description("description").build();
getAuditManager().storeRecord(getAuditRecordEntityFactory().fromAuditRecord(a));
}
Any help would be greatly appreciated.

