Audit Trail Extension Points

The extension point ChangeSummaryTransformer

For the history view it is possible to customize the visualization of the change summary tree. For a unique customer experience it may be required to have a special visualization for some entities or fields. One example is the attributes, where the values should be formatted depending on the attribute data type. The extension point com.heiler.ppm.audittrail.server.changeSummaryTransformer provides the possibility to customize the display of (custom) fields or (custom) entities.

In the screenshot below you can see the change summary tree for a changed short description. As mentioned above, this visualization could be changed by implementing a custom ChangeSummaryTransformer

images/download/attachments/278331838/ChangeSummaryTree_ShortDescription.png

In the screenshot below you can find an example of an extension for the attribute value field.

images/download/attachments/278331838/ChangeSummaryTransformerContribution_ArticleAttributeValue.png

Please note that all parameters are described in detail in the extension point itself. Please have a look there in case you need more details about a specific parameter.

Implementing a custom ChangeSummaryTransformer

If you want to implement a change summary transformer that transforms a json node from an EntityItemChangeDocument object into a ChangeDocumentNode object which is the model object for the visual representation in the UI, you need the transformer and a factory that is able to create instances of that transformer.

ChangeSummaryTransformerFactory

The factory has to implement the interface ChangeSummaryTransformerFactory, a constructor without any parameters is mandatory to be able to initialize the class. This factory has to be registered at the extension point changeSummaryTransformer.

The factory interface contains one method to create the transformer:

ChangeSummaryTransformerFactory interface method
ChangeSummaryTransformer getTransformer( String shortIdentifier, ChangeDocumentNode parentNode );

ChangeSummaryTransformer

The transformer implementation has to implement the interface ChangeSummaryTransformer. You may inherit from an OOB class FieldTransformer or EntityTransformer in case you have only small adjustments.

The interface contains the method

ChangeSummaryTransformer interface method
ChangeDocumentNode transform( JsonNode value, Locale locale, DocumentFilter documentFilter ) throws CoreException;

which mainly does the work. It returns a ChangeDocumentNode which is also an interface. You can use the OOB classes FieldNode or EntityNode and subclass them, or write your custom node.

Please find more detailed information in the java doc of the corresponding interfaces.

The extension point historyTabToDetailViewBinder

In case you want to display a history tab for a custom entity, you need to bind the history tab to the corresponding web detail view. This can be done via the extension point com.heiler.ppm.audittrail.core.historyTabToDetailViewBinder.

In the screenshot below you can see the history tab for the "Product" entity. The detail view for products is marked with a red border.

images/download/attachments/278331838/ProductHistoryView.png

In order to make this work, we contributed the extension shown below in our standard code. If you want to show a history tab for your custom entity you have to do the same thing, of course with adjusted entity identifier as well as detailViewIdentifier.

images/download/attachments/278331838/ProductHistoryDetailViewContribution.png

In addition to the "Product" entity, also some other entities (Article, Variant, Structure group, Characteristic and Lookup value) are already contributed out of the box and should not be overridden. Please find more detailed information about the extension point as well as its parameters in the extension point definition.