DAM for Sitecore is constructed using pipelines, and it is possible to hook into the pipelines.
Note: Be aware that if you do change the pipelines, you are changing how DAM for Sitecore is supposed to work out of the box, and this may result in undesirable side effects.
The pipelines are defined in the .config files App_Config → Include → damforsitecore → DFS.Pipelines.config
Below are descriptions of the most important pipelines used in the module.
App_Config/Include/damforsitecore/DFS.Pipelines.config
Pipeline | Description | PipelineArgs |
---|
DFS.GetAssetFieldValue | This pipeline will return rendering html for an asset item.
First it will get the html template, determined by the media type and the fieldId (HtmlForAssetType). The html templates are located at: Sitecore → System → Modules → Digizuite → MedaDataRoot → AssetTypeOutputRoot. The different processors will replace the stampvalue in the html template. The property FieldValue of GetAssetFieldValueArgs will contain the rendering html.
List of processors DFS.Client.Services.Pipelines.GetAssetFieldValue.GetAssetTypeOutput DFS.Client.Services.Pipelines.GetAssetFieldValue.ReplaceTagsWithSelectedValues DFS.Client.Services.Pipelines.GetAssetFieldValue.ReplaceTagsWithAccessValues DFS.Client.Services.Pipelines.GetAssetFieldValue.ReplaceTagsWithConfigValues DFS.Client.Services.Pipelines.GetAssetFieldValue.AppendTagsWithParameterValues DFS.Client.Services.Pipelines.GetAssetFieldValue.ReplaceTagsWithAssetIndexValues DFS.Client.Services.Pipelines.GetAssetFieldValue.RemoveEmptyAttributes DFS.Client.Services.Pipelines.GetAssetFieldValue.SplitFieldValueIntoResult
|
var renderArgs = new GetAssetFieldValueArgs
{
AssetItemId = new ID(this.AssetItemId),
ContextLanguage = Context.Language,
FieldId = DFS.Fields.HtmlForAssetType.FieldAssetMedia,
Quality = this.Quality
};
|
Pipeline | Description | PipelineArgs |
---|
DFS.Services.DFSMedia | This pipeline will return the media stream either from the cache or from Digizuite DAM. On ContentManagement server, we synchronize the asset if it does not exists in the asset silo. Fetch the asset from the asset silo. If the media is in the cache we return that. The media was not in the cache, fetch the media from Digizuite DAM. We resize the image, if resizing parameters was added. Store the media in the cache. Resolve download filename.
List of processors DFS.Client.Services.Pipelines.DFSMedia.SynchronizeAsset (Only In Role: ContentManagement) DFS.Client.Services.Pipelines.DFSMedia.LoadAssetEntity DFS.Client.Services.Pipelines.DFSMedia.GetMediaFromCache DFS.Client.Services.Pipelines.DFSMedia.GetMediaFromDigizuite DFS.Client.Services.Pipelines.DFSMedia.ResizeImage DFS.Client.Services.Pipelines.DFSMedia.SaveToCache DFS.Client.Services.Pipelines.DFSMedia.ResolveFilename
|
var arguments = new DFSMediaPipelineArgs
{
Request = mediaRequest,
Result = new MediaResult()
};
|
Synchronization
Pipeline | Description | PipelineArgs |
---|
DFS.SyncAsset | This pipeline is triggered when you insert Digizuite assets into on of the DAM for Sitecore custom fields. First it tests if the requested asset is allready synchronized and exists in the asset silo. If the forceUpdate is true, then we skip this check. Fetch the asset from Digizuite. Save the asset in /sitecore/media library/Digizuite/Assets.
List of processors DFS.Connect.Pipelines.SyncAsset.ItemExists DFS.Connect.Pipelines.SyncAsset.FetchAsset DFS.Connect.Pipelines.SyncAsset.SaveItem
|
var arguments = new SyncAssetArgs
{
AssetId = aid,
Language = DfsLanguage.GetLanguage(language),
ForceUpdate = true
};
|
Pipeline | Description | PipelineArgs |
---|
DFS.SyncAssets | This pipeline is used in Administration DAM for Sitecore. Under the menu Broken links and Synchronization. Fetch a list of assets from Digizuite. Save the assets in /sitecore/media library/Digizuite/Assets.
List of processors |
var arguments = new SyncAssetsArgs
{
FacetList = new List<FacetField>
{
new FacetField()
{
facetMode = "QueryOnly",
recursive = true,
searchKey = "assetId",
values = assetIds
}
},
Count = assetIds.Count,
Language = DfsLanguage.GetLanguage(language)
}
|
Pipeline | Description | PipelineArgs |
---|
DFS.BatchSync | This pipeline is used in Administration DAM for Sitecore. Under the menu Synchronization. This pipeline is used to synchronize a large number of assets. It will run in a Sitecore job. This will call the pipeline DFS.BatchSyncAssets with a batch of 50 assets ( the batch number is configuable). Once all assets are done synchronizing we will rebuild the Sitecore index sitecore_master_index.
List of processors |
var arguments = new SyncAssetsArgs
{
FacetList = facetList,
Language = language,
Count = 1,
Job = Job
}
|
Pipeline | Description | PipelineArgs |
---|
DFS.BatchSyncAssets | This pipeline is triggered by the pipeline DFS.BatchSync. Fetch a list of assets from Digizuite. Save the assets in /sitecore/media library/Digizuite/Assets, with the following disables around: SecurityDisabler, DatabaseCacheDisabler, EventDisabler and BulkUpdateContext to optimize the creation of alot of items in Sitecore.
List of processors |
var arguments = new SyncAssetsArgs
{
Count = batchLSize,
Skip = x * batchLSize,
FacetList = args.FacetList,
Language = DfsLanguage.GetLanguage(args.Language)
}
|