Search in sources :

Example 1 with AuditEvent

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;
        }
    });
}
Also used : AuditEvent(org.alfresco.module.org_alfresco_module_rm.audit.event.AuditEvent) JavaBehaviour(org.alfresco.repo.policy.JavaBehaviour) AlfrescoRuntimeException(org.alfresco.error.AlfrescoRuntimeException)

Example 2 with AuditEvent

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;
}
Also used : AuditEvent(org.alfresco.module.org_alfresco_module_rm.audit.event.AuditEvent)

Example 3 with AuditEvent

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;
}
Also used : HashMap(java.util.HashMap) ArrayList(java.util.ArrayList) AuditEvent(org.alfresco.module.org_alfresco_module_rm.audit.event.AuditEvent) HashMap(java.util.HashMap) Map(java.util.Map)

Aggregations

AuditEvent (org.alfresco.module.org_alfresco_module_rm.audit.event.AuditEvent)3 ArrayList (java.util.ArrayList)1 HashMap (java.util.HashMap)1 Map (java.util.Map)1 AlfrescoRuntimeException (org.alfresco.error.AlfrescoRuntimeException)1 JavaBehaviour (org.alfresco.repo.policy.JavaBehaviour)1