Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 12 Next »

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:

  1. Delete blobs for the notified assetid.

  2. 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, updateNotification, EventRaiseOption.RaiseBroadcast);

We also listning for these events and for AssetChanged we clear the in-memory cache and if the RaiserId is coming from another instance (broadcast) and the configuration “DeleteBlob” is true, then we delete the blobs and database entries for the notified assetid.

var digizuiteIntegrationEvent = _eventRegistry.Get(GlobalConstants.ContentEventRegistry.DigizuiteAssetChangeEventId);
digizuiteIntegrationEvent.Raised += DigizuiteIntegrationEvent_Raised;

As an developer you can also build you own logic around the notifications from Digizuite, as you can listening for the event by register to the events, just as we do above.

1. Setup the endpoint

Open the web.config and locate the Digizuite node. The sub node “digizuiteIntegration” is the one we should update.

<digizuiteIntegration guid="e01553bd-f66a-4fba-8b6b-884133d8ae80" subscriptions="1" deleteBlob="false"/>

The first parameter guid you add a new guid. The default value is empty so you have to generate a new one. The second parameter subscription indicates which changetypes you want to listning for. The possible values can be found her DFE 2.0.0 - 3 Setting up Episerver. The default value is 1 which is AssetChanged. The last parameter deleteBlob indicates whether we should delete the blobs for the asset or not. In a load balanced invironment where you have multiple instances and each of the instances cantains it own local blob storage, then this should be true. If the blob storage is share between the instances then leave i false.

Once the change has been made and you reload the site, you should see the following log statment in the file Digizuite.log:

2020-05-14 08:22:33,529 [1] INFO DigizuiteProviderInit::Initialize: DigizuiteIntegration has been setup and configured

2. Verify connection

If you have access to the Digizuite server. Åben an browser from that server and access your episerver site. If you cannot access the site, Digizuite won't be able to send notifications to it.

If the server

  • No labels