Digizuite DAM integration service provides an API where integration endpoints can register for notifications regarding asset and metadata changes. We have made it easy to setup the connection between Episerver and Digizuite. All you have to do it to add some configuration in the web.config and you Episerver instance will recive notifications from Digizuite whenever and asset changes.
In Episerver we have created a new ApiController, which is located at the following route [siteUrl]/digizuite/integration, this it the endpoint that recives the notifications from Digizuite. An important note here is that the endpoint should be reachable from the Digizuite server otherwise Digizuite wont be able to send the notifications. This is usually the case for developers on their local environment.
let talk about what the controller does when it recives an notification. The data coming from Digizuite will be serilized in to an object of this type:
public class UpdateNotification { public int ChangeType { get; set; } public ChangeData Data { get; set; } } public class ChangeData { public int AssetId { get; set; } public int ComboValueId { get; set; } public int MetafieldId { get; set; } public int TreeValueId { get; set; } public int ItemId { get; set; } }
The property ChangeType indicates wheter it is and AssetChanged, MetafieldChanged, ComboValueChanged or TreeValueChanged. If it is an AssetChanged we do the following:
Delete blobs for the notified assetid.
Delete database enties for the notified assetid.
The last thing we do it to raise an episerver event with the UpdateNotification object.
_eventRegistry.Get(GlobalConstants.ContentEventRegistry.DigizuiteAssetChangeEventId).RaiseAsync( GlobalConstants.ContentEventRegistry.DigizuiteAssetChangeRaiserId, messageContent, EventRaiseOption.RaiseBroadcast);