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:
DamBlobStorageProviderBase
string GetItemThumbnailUrl (IBlobContentLocation content, ThumbnailArgs thumbnailArgs)
content
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">
content.FilePath
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:
IBlobStorageConfiguration
IEnumerable<DataProviderSettings> GetProviderConfigElements(ConfigElement parent)
IEnumerable<BlobStorageTypeConfigElement> GetProviderTypeConfigElements(ConfigElement parent)
BlobStorageTypeConfigurationElement
Name
ProviderType
Title
Description
NameValueCollection
Here is sample implementation:
Where:
DamBlobStorageProviderBase.ScriptUrlKey
DamBlobStorageProviderBase.SupportedThumbnailFormatsKey
CustomBlobStorageProvider.UrlKey
CustomBlobStorageProvider.ClientIdKey
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:
RegisteringIoCTypes
ObjectFactory
Application_Start
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.
CustomDamProvider
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
@using Telerik.Sitefinity.Modules.Libraries;
Increase your Sitefinity skills by signing up for our free trainings. Get Sitefinity-certified at Progress Education Community to boost your credentials.
This free lesson teaches administrators, marketers, and other business professionals how to use the Integration hub service to create automated workflows between Sitefinity and other business systems.
This free lesson teaches administrators the basics about protecting yor Sitefinity instance and its sites from external threats. Configure HTTPS, SSL, allow lists for trusted sites, and cookie security, among others.
The free on-demand video course teaches developers how to use Sitefinity .NET Core and leverage its decoupled architecture and new way of coding against the platform.
To submit feedback, please update your cookie settings and allow the usage of Functional cookies.
Your feedback about this content is important