ACSCE-5X practice question 12 of 15
Select two ways to audit Alfresco Content Services events in an Alfresco Content Services extension? (Choose two.)
Full set: 87 questionsAlfresco Content Services provides two primary, officially supported methods for an extension to generate audit events.
1. Declarative Auditing (@Auditable): An extension can use the @Auditable annotation on a service method. The Alfresco framework intercepts the method call and automatically generates an audit entry based on the annotation's configuration. This is the simplest way to audit method executions.
2. Programmatic Auditing (AuditService): For more complex scenarios requiring custom data or conditional auditing, an extension can inject the AuditService bean. By calling the recordAuditValues method on this service, the developer can programmatically create a detailed audit entry at any point in their code.
B. Open a connection to the database and write the audit information to the audit tables. This is incorrect because directly manipulating the database bypasses the Alfresco service layer, transaction control, and caching, leading to data inconsistency and potential corruption.
C. Inject AuditComponent into the extension and call recordAuditValues. While AuditComponent is the implementation of AuditService, best practice is to code against the public interface (AuditService). This option describes the same programmatic method as option E, making E the more appropriate answer.
D. Use the Alfresco REST API to record an audit event. This is incorrect. The standard Alfresco v1 REST API provides endpoints for retrieving and purging audit data but does not include an endpoint for creating new audit entries.
1. Official Alfresco Documentation (ACS 5.2): Auditing Concepts. This document explicitly describes the two main approaches.
For @Auditable (Option A): "The @Auditable annotation can be used to audit method calls declaratively. This is the simplest way to audit a method call and requires no code other than the annotation itself."
For AuditService (Option E): "For more complex auditing, the AuditService can be used directly. This allows for more control over the data that is audited and also allows for auditing to be conditional."
Source: Alfresco Content Services 5.2 Documentation, "Auditing concepts". (docs.alfresco.com/5.2/concepts/audit-concepts.html)
2. Official Alfresco Documentation (ACS 5.2): AuditService JavaDoc. The JavaDoc for the AuditService interface confirms it is the public API for auditing functions, including recordAuditValues.
Source: Alfresco Content Services 5.2 JavaDoc, org.alfresco.service.cmr.audit.AuditService.
3. Official Alfresco Documentation (ACS 5.2): Audit REST API. The API reference for auditing shows only GET and DELETE endpoints for retrieving and managing audit entries, confirming the absence of a POST endpoint for creation.
Source: Alfresco Content Services 5.2 Documentation, "Audit REST API". (docs.alfresco.com/5.2/references/RESTful-Audit.html)
Keep practicing
Take the free ACSCE-5X practice test
Ten exam-style questions with answers and explanations, plus the exam facts and study guides.
More questions
Other ACSCE-5X practice questions
- Question 1Alfresco Content Services defines some root objects to use with Web Scripts FreeMarker te…
- Question 2You want to increase the maximum number of results returned by searches in Share from the…
- Question 3What does it mean when it is said in Solr indexing that the index is “eventually consiste…
- Question 4What are the minimum steps needed to add a custom search form in Alfresco Share?
- Question 5How should s be identified and recognized?
- Question 6What are the variable’s scopes available for Activiti workflows?
