You can add custom DAM providers if you want to integrate Sitefinity CMS with a provider that is not supported by default.
Implementing custom DAM provider consists of two parts:
The custom DAM provider must inherit DamBlobStorageProviderBase class. It has one abstract method that needs to be implemented: string GetItemThumbnailUrl (IBlobContentLocation content, ThumbnailArgs thumbnailArgs).
This method has two parameters:
string GetItemThumbnailUrl (IBlobContentLocation content, ThumbnailArgs thumbnailArgs)
The method must return the thumbnail URL of the media content item. The URL of the asset is stored in content.FilePath property and must be updated according to the other parameter – <cod">thumbnailArgs considering the specifics of the DAM provider that you want to integrate with.</cod">
Here is sample implementation of custom provider:
Each provider must have its corresponding configuration. The configuration class must implement IBlobStorageConfiguration interface. There are two methods that must be implemented:
The first one is IEnumerable<DataProviderSettings> GetProviderConfigElements(ConfigElement parent) as the assets are stored and managed by the DAM provider this one must return empty list.
The other one is IEnumerable<BlobStorageTypeConfigElement> GetProviderTypeConfigElements(ConfigElement parent). It returns the configuration type of the provider which will be added to the collection of all blob storage configurations. It returns enumerable of type BlobStorageTypeConfigurationElement. An object of that type needs to be created (in the constructor pass the input parameter parent) and return an enumerable containing only that object. The properties are:
IEnumerable<DataProviderSettings> GetProviderConfigElements(ConfigElement parent)
IEnumerable<BlobStorageTypeConfigElement> GetProviderTypeConfigElements(ConfigElement parent)
Here is sample implementation:
Finally, the provider type configuration must be registered in Sitefinity CMS. You can do that by attaching to RegisteringIoCTypes event of the ObjectFactory on Application_Start in your Global.asax.cs file:
After the configuration is registered in Sitefinity you will be able to add a provider of type CustomDamProvider by opening Administration » Settings » Storage providers » Add storage provider. The custom provider will be listed in the Provider type dropdown.
If you want to modify the implementation of a default DAM provider, you can do so by registering a custom DAM provider following the steps listed above but instead of inheriting DamBlobStorageProviderBase you must inherit the provider which you want to override. Note that the name of the custom provider class must be the same as the one you want to override.
You can choose from all (default and custom) thumbnail profiles for related images field if that image comes from DAM (Digital Asset Management) provider.
Here are the modifications that must be applied in the template
Sign up for our free beginner training. Boost your credentials through advanced courses and certification. Register for Sitefinity training and certification.
To submit feedback, please update your cookie settings and allow the usage of Functional cookies.
Your feedback about this content is important