DocumentationAEM GuidesAEM Guides Documentation

Post-processing event handler

Last update: January 15, 2025
  • Topics:
  • Post-Processing Event Handler

CREATED FOR:

  • Experienced
  • Developer

UUID and Cloud Service

Adobe Experience Manager Guides exposes com/adobe/guides/postprocess/complete event that is used to perform any post-processing operations. This event is triggered whenever an operation is performed on a DITA file. The following operations on a DITA file trigger this event:

  • Upload
  • Create
  • Modify

You need to create an Adobe Experience Manager event handler to read the properties available in this event and do further processing.

Event details are explained below:

Event name:

com/adobe/guides/postprocess/complete

Parameters:

NameTypeDescription
pathStringThe path of the file that triggered this event. Typically, this is the file on which an operation has been performed.
eventTypeStringThe type of event i.e. CREATE or MODIFY.
statusStringThe return status for the operation performed. The possible options are: -
- SUCCESS: The post-processing operation completed successfully.
- FAILED: The post-processing operation failed due to some error.
errorMsgStringThe error message in case of post-processing operation failure.
uuidStringThe UUID of the file that triggered this event. Typically, this is the file on which an operation has been performed.

Sample Event Listerner

@Component(service = EventHandler.class,
        immediate = true,
        property = {
                EventConstants.EVENT_TOPIC + "=" + "com/adobe/guides/postprocess/complete",
        })
public class PostProcessCompleteEventHandler implements EventHandler {

    protected final Logger log = LoggerFactory.getLogger(this.getClass());

    @Override
    public void handleEvent(final Event event) {
        Set<String> propertyNames = new HashSet<>(Arrays.asList(event.getPropertyNames()));
        Map<String, String> properties = new HashMap<>();
        properties.put("path", (String) event.getProperty("path"));
        properties.put("eventType", (String) event.getProperty("eventType"));
        properties.put("status", (String) event.getProperty("status"));
        if(propertyNames.contains("errorMsg")) {
            properties.put("errorMsg", (String) event.getProperty("errorMsg"));
        }
        if (propertyNames.contains("uuid")) {
            properties.put("uuid", (String) event.getProperty("uuid"));
        }
        String eventTopic = event.getTopic();
        log.debug("eventTopic {}", eventTopic);
        for(Map.Entry entry:properties.entrySet()) {
            log.debug(entry.getKey() + " : " + entry.getValue());
        }
    }
}

Non UUID

Adobe Experience Manager Guides exposes com/adobe/fmdita/postprocess/complete event that is used to perform any post-processing operations. This event is triggered whenever an operation is performed on a DITA file. The following operations on a DITA file trigger this event:

NOTE
This event is not triggered for the Deletion operation in AEM 6.1.
  • Upload
  • Creation
  • Modification
  • Deletion

You need to create an Adobe Experience Manager event handler to read the properties available in this event and do further processing.

Event details are explained below:

Event name:

com/adobe/fmdita/postprocess/complete

Parameters:

NameTypeDescription
pathStringThe path of the file that triggered this event. Typically, this is the file on which an operation has been performed.
statusStringThe return status for the operation performed. The possible options are: -
- SUCCESS: The post-processing operation completed successfully.
- COMPLETED WITH ERRORS: The post-processing operation completed, but with some errors.
- FAILED: The post-processing operation failed due to some error.
messageStringIn case the status is COMPLETED WITH ERRORS or FAILED, this parameter contains the details about the error or the reason of failure.
operationStringThe post-processing operation performed on the file. The possible options are:
- Addition
- Updation
- Deletion
recommendation-more-help
11125c99-e1a1-4369-b5d7-fb3098b9b178