The Digizuite™ DAM for Optimizely connector is a fairly large and advanced integration with many moving parts.
The goal for this chapter is to give a bit of a basic understanding of how the parts fit together. Some concepts require deeper explanation and examples and they are split into their own chapters, following this.
The DigizuiteClient
A central component to the integration is the DigizuiteClient. It's exposed through dependency injection using it's interface, IDigizuiteClient and is a singleton. It is the central point that all the other components of the integration use for the actual connection and configuration to the DAM Center. If you, as a developer, need to do code that, for example, queries the DAM for specific assets, you'll most likely find the need to use the ServiceLocator in Optimizely to get an instance of IDigizuiteClient and use that as your starting point.
The DigizuiteClient initializes itself by connecting to various services in the DAM Center and fetches relevant configuration and settings defined in the DAM. For example, which languages, media formats, sort orders, media types, metadata and crops that are available. It then also retrieves the DAM's "Media Manager Menu" tree structure which is exposed in Optimizely as the folder structure of the assets.
But - it's also in charge of numerous other important tasks:
...
- Caching relevant in-memory data
- Client notifications
- Connection status in case of resilience needed for unstable DAM connections
- It contains the main methods used for all CRUD interactions with the DAM center.It builds the proper Optimizely content objects for the corresponding assets
- Handling uploads
- In-memory draft storage of asset metadata changes
- Much, much more...
DigizuiteContentProvider
...
In Optimizely, all content typically have both a ContentReference and a GUID - and in some cases a URL. The DAM Center typically exposes only an AssetId (int) or a folderId (int). In order to easily map these over to Optimizely ContentReference (that also has an int ID) the convention has been made that negative ID numbers are folders and positive ID numbers are assets. To ensure a uniform way of dealing with this - even if the future changes this approach, there is a helper class called ConversionHelper that provides methods to easily convert between the needed formats.The . The GUIDs are slightly more tricky. For the content provider to work well, it needs to be able to quickly identify if a given GUID belongs to the current provider, and if so - which corresponding asset ID should be looked up. As this lookup happens many times per request, it isn't feasible to do a database mapping lookup every single time. Instead, the integration uses a 'base' GUID defined in configuration and simply stores the int ID in the first 4 bytes (32-bit) of the GUID. The ConversionHelper also contains methods for dealing with this. However, under normal circumstances, you shouldn't need to go to the level of complexity and to indicate that, those methods are in an "internal" namespace.
Drafts and versioning
The DAM Center doesn't support the same concept of draft/versioning/publish as Optimizely does. In Optimizely, every single change results in a new draft version being created or saved, where as, in the DAM Center, changes are not saved unless you actively decide to press "Save". In order to support updating metadata fields in the DAM from Optimizely, the DigizuiteClient will instead keep track of the changes in-memory, until the editor decides to publish - at which point, the changes will be sent back to the DAM Center and the asset is updated.
Folder hierarchy
Once again, the DAM Center and Optimizely have slightly different opinions on the concept of a folder structure. Where in Optimizely it's important that every single content item lives under exactly one parent. The Digizuite DAM considers the folder nothing but a metadata attribute for the asset that you filter on. This means that all assets from Digizuite exist just beneath the root (entry point in Optimizely) but also can be visible in one or more sub-folders.
Cropping and Crops
The DAM Center has a series of predefined crop settings with different aspect ratios (that can be changed in the DAM Center). Typically named something like "Square", "Banner", and "Widescreen". These are the crop types you can create for the various images. In Optimizely, just as in the DAM Center, they will appear as separate assets/content objects, but, if a content object is the crop of another content object, it will hold a reference to the 'parent' in its properties, and will have the name of the crop listed in its "CropName" metadata property.
...