use of org.alfresco.module.org_alfresco_module_rm.audit.event.AuditEvent in project records-management by Alfresco.
the class FilePlanPermissionServiceImpl method init.
/**
* Initialisation method
*/
public void init() {
getPolicyComponent().bindClassBehaviour(NodeServicePolicies.OnAddAspectPolicy.QNAME, ASPECT_RECORD, new JavaBehaviour(this, "onAddRecord", TRANSACTION_COMMIT));
getPolicyComponent().bindClassBehaviour(NodeServicePolicies.OnMoveNodePolicy.QNAME, ASPECT_RECORD, new JavaBehaviour(this, "onMoveRecord", TRANSACTION_COMMIT));
getPolicyComponent().bindClassBehaviour(NodeServicePolicies.OnMoveNodePolicy.QNAME, TYPE_RECORD_CATEGORY, new JavaBehaviour(this, "onMoveNode", TRANSACTION_COMMIT));
AuthenticationUtil.runAsSystem(new RunAsWork<Void>() {
@Override
public Void doWork() throws Exception {
recordsManagementAuditService.registerAuditEvent(new AuditEvent(AUDIT_SET_PERMISSION, "rm.audit.set-permission"));
return null;
}
});
}
use of org.alfresco.module.org_alfresco_module_rm.audit.event.AuditEvent in project records-management by Alfresco.
the class RecordsManagementAuditServiceImpl method getAuditEventLabel.
/**
* Returns the display label for the given audit event key
*
* @param eventKey The audit event key
* @return The display label or null if the key does not exist
*/
private String getAuditEventLabel(String eventKey) {
String label = eventKey;
AuditEvent event = this.auditEvents.get(eventKey);
if (event != null) {
label = event.getLabel();
}
return label;
}
use of org.alfresco.module.org_alfresco_module_rm.audit.event.AuditEvent in project records-management by Alfresco.
the class ListOfValuesGet method createAuditEventsModel.
/**
* Creates the model for the list of audit events.
*
* @param baseUrl The base URL of the service
* @return model of audit events list
*/
protected Map<String, Object> createAuditEventsModel(String baseUrl) {
// iterate over all audit events
List<AuditEvent> auditEvents = this.rmAuditService.getAuditEvents();
List<Map<String, String>> items = new ArrayList<Map<String, String>>(auditEvents.size());
for (AuditEvent event : auditEvents) {
Map<String, String> item = new HashMap<String, String>(2);
item.put("label", event.getLabel());
item.put("value", event.getName());
items.add(item);
}
// create the model
Map<String, Object> model = new HashMap<String, Object>(2);
model.put("url", baseUrl + "/auditevents");
model.put("items", items);
return model;
}
Aggregations