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 found in this folder: \ App_Config \→ Include \damforsitecore→ damforsitecore → DFS.Pipelines.config
Below are descriptions of the most important pipelines used in the module.
App_Config/Include/damforsitecore/DFS.SettingsPipelines.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 |
ContentSearchServices.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.
|
ReplaceTagsWithAssetItemFieldValuesContentSearchPipelinesGetAssetFieldValueRemoveEmptyAttributesDFS.AppendTagsWithParameterValuesRemoveEmptyAttributes DFS.
|
ContentSearchPipelines.GetAssetFieldValue.AppendSeoDFS. |
Code Block |
---|
| var renderArgs = new GetAssetFieldValueArgs
{
AssetItemId = new ID(this.AssetItemId),
ContextLanguage = Context.Language,
FieldId = DFS.Fields.HtmlForAssetType.FieldAssetMedia,
Quality = this.Quality
}; |
|
App_Config/Include/damforsitecore/DFS.Services.config
Pipeline | Description | PipelineArgs |
---|
DFS.Services.DFSMedia | This pipeline will return the media stream either from the cache or from Digizuite DAM. |
First we check securityOn 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 |
CheckSecurityGetMediaFromCacheGetMediaPrerequisitesGetMediaFromCache DFS.Client.Services.Pipelines.DFSMedia.GetMediaFromDigizuite DFS.Client.Services.Pipelines.DFSMedia.ResizeImage DFS.Client.Services.Pipelines.DFSMedia.SaveToCache DFS.Client.Services.Pipelines.DFSMedia.
|
ResolveDownloadFilename |
Code Block |
---|
| var arguments = new DFSMediaPipelineArgs
{
Request = mediaRequest,
Result = new MediaResult()
}; |
|
App_Config/Include/damforsitecore/DFS.Connect.config
Pipeline | Description | PipelineArgs |
---|
DFS. |
Connect.DetectDamChangesDigizuiteUpdateNotification | This pipeline will |
pick up any changes made to assets or metafield in Digizuite DAM.First we fetch assets that has been changed in a given date range. A list of assets are store on the detectDamChangesArgs.modifiedAssets.Then we fetch metafields that has been changed in a given date range. A list of metafield are store on the detectDamChangesArgs.modifiedMetafields.The RunSyncDeletedAssets processor will delete sitecore items from the silo bucket, that no longer exists in the DAM for Sitecore channel in Digizuite DAM, the same goes for the RunSyncDeletedMetafields processorrun every time Digizuite sends asset updates. Fetch the asset(s) from Digizuite. Save the assets as items in Sitecore. If the requested assets are not found in Digizuite and they exists as items in Sitecore, then we delete the items, because they nolonger are available to the Sitecore channel. Clear local cache, both data cache and cached images. Send a clear cache to all CD servers.
List of processors |
DetectDamChangesRunGetModifiedAssetsFetchAssets DFS.Connect.Pipelines.
|
DetectDamChangesRunGetModifiedMetafieldsSaveItems DFS.Connect.Pipelines.
|
DetectDamChangesRunSyncDeletedAssetsConnectDetectDamChangesRunSyncMetagroupsClearLocalCache DFS.Client.
|
ConnectDetectDamChangesRunSyncDeletedMetafieldsdetectDamChangesArgssyncAssetsArgs = new SyncAssetsArgs
{
FacetList = new |
|
DetectDamChangesArgs(assetSilo, LanguageManager.DefaultLanguage.Name, DateTime.Now);DFS.Connect.SynchronizeSilo | This is the full synchronization, is fetches both configurations and assets from Digizuite DAM. The assets are stored in the silo which is a item bucket.
Check if the silo is locked, we can only run one full synchronization at a time. If the silo is not locked, we lock it.Then pauses out custom index: dfs_assets_master_indexFetch all configuration.Fetch all assets that are avaible in Digizuite DAM channel.Create/update all (new) Sitecore items from what you have fetched.Rebuild the index: dfs_assets_master_indexUnlock the silo again. List<FacetField>
{
new FacetField()
{
facetMode = "QueryOnly",
recursive = true,
searchKey = "assetId",
values = assetIds
},
new FacetField()
{
recursive = false,
searchKey = "derivedFrom",
operation = "Or",
facetMode = "QueryOnly"
}
},
Count = assetIds.Count,
Language = DfsLanguage.GetLanguage(language),
AssetIds = BaseIds
}; |
|
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 |
SynchronizeAssetsSiloCheckSiloLockItemExists DFS.Connect.Pipelines.
|
SynchronizeAssetsSiloLockSiloFetchAsset DFS.Connect.Pipelines.
|
SynchronizeAssetsSilo.PauseSearchIndexingDFS.Connect.Pipelines.SynchronizeAssetsSilo.RunEnsureMetaDataFoldersDFS.Connect.Pipelines.SynchronizeAssetsSilo.RunSynchronizeMetaDataLanguagesDFS.Connect.Pipelines.SynchronizeAssetsSilo.RunSynchronizeAssetTypesDFS.Connect.Pipelines.SynchronizeAssetsSilo.RunSynchronizeMetaGroupRootsDFS.Connect.Pipelines.SynchronizeAssetsSilo.RunSynchronizeAssetTypesDFS.Connect.Pipelines.SynchronizeAssetsSilo.RunSynchronizeMediaFormatTypesDFS.Connect.Pipelines.SynchronizeAssetsSilo.RunSynchronizeConfigDFS.Connect.Pipelines.SynchronizeAssetsSilo.RunSynchronizeFormatsDFS.Connect.Pipelines.SynchronizeAssetsSilo.ResumeSearchIndexingDFS.Connect.Pipelines.SynchronizeAssetsSilo.RebuildSearchIndexesDFS.Connect.Pipelines.SynchronizeAssetsSilo.PauseSearchIndexingDFS.Connect.Pipelines.SynchronizeAssetsSilo.RunSynchronizeAssetsDFS.Connect.Pipelines.SynchronizeAssetsSilo.ResumeSearchIndexingDFS.Connect.Pipelines.SynchronizeAssetsSilo.RebuildSearchIndexesDFS.Connect.Pipelines.SynchronizeAssetsSilo.UnLockSilosynchronizeAssetsSiloRequestSynchronizationRequest(0,SiloId){ Language"en" DirectionDirection.Inbound, PipelineName = "DFS.Connect.SynchronizeSilo"
};DFS.Connect.SynchronizeSiloConfiguration | This will only synchronize the configuration.
Check if the silo is locked, we can only run one full synchronization at a time. If the silo is not locked, we lock it.Pause the custom index: dfs_assets_master_indexFetch all configuration.Create/update all (new) Sitecore itemsRebuild the index: dfs_assets_master_indexUnlock the silo again. 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 |
SynchronizeAssetsSiloCheckSiloLockFetchAssets DFS.Connect.Pipelines.
|
SynchronizeAssetsSilo.LockSiloDFS.Connect.Pipelines.SynchronizeAssetsSilo.PauseSearchIndexingDFS.Connect.Pipelines.SynchronizeAssetsSilo.RunEnsureMetaDataFoldersDFS.Connect.Pipelines.SynchronizeAssetsSilo.RunSynchronizeMetaDataLanguagesDFS.Connect.Pipelines.SynchronizeAssetsSilo.RunSynchronizeAssetTypesDFS.Connect.Pipelines.SynchronizeAssetsSilo.RunSynchronizeMetaGroupRootsDFS.Connect.Pipelines.SynchronizeAssetsSilo.RunSynchronizeAssetTypesDFS.Connect.Pipelines.SynchronizeAssetsSilo.RunSynchronizeMediaFormatTypesDFS.Connect.Pipelines.SynchronizeAssetsSilo.RunSynchronizeConfigDFS.Connect.Pipelines.SynchronizeAssetsSilo.RunSynchronizeFormatsDFS.Connect.Pipelines.SynchronizeAssetsSilo.ResumeSearchIndexingDFS.Connect.Pipelines.SynchronizeAssetsSilo.RebuildSearchIndexesDFS.Connect.Pipelines.SynchronizeAssetsSilo.UnLockSilo synchronizeAssetsSiloRequest arguments = new SyncAssetsArgs
{
FacetList = new |
|
SynchronizationRequest(0,SiloId)
{
Language List<FacetField>
{
new FacetField()
{
facetMode = " |
|
en DirectionDirection.Inbound PipelineNameDFS.Connect.SynchronizeSiloConfiguration"
};DFS.Connect.SynchronizeSiloAssets | This will only synchronize the assets.
Check if the silo is locked, we can only run one full synchronization at a time. If the silo is not locked, we lock it.Then pauses out custom index: dfs_assets_master_indexFetch all assets.Create/build all (new) Sitecore itemsRebuild the index: dfs_assets_master_indexUnlock the silo again. 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 |
SynchronizeAssetsSiloCheckSiloLockBatchSyncAssets DFS.Connect.Pipelines.
|
SynchronizeAssetsSilo.LockSiloDFS.Connect.Pipelines.SynchronizeAssetsSilo.PauseSearchIndexingDFS.Connect.Pipelines.SynchronizeAssetsSilo.RunSynchronizeAssetsDFS.Connect.Pipelines.SynchronizeAssetsSilo.ResumeSearchIndexingDFS.Connect.Pipelines.SynchronizeAssetsSilo.RebuildSearchIndexesDFS.Connect.Pipelines.SynchronizeAssetsSilo.UnLockSilosynchronizeAssetsSiloRequest SynchronizationRequest(0,SiloId)
{
SyncAssetsArgs
{
FacetList = facetList,
Language = |
|
"en", DirectionDirection.Inbound, PipelineName "DFS.Connect.SynchronizeSiloAssets"
};Pipeline | Description | PipelineArgs |
---|
DFS. |
Connect.SynchronizeAssetThis will re-synchronize one single asset item and update the data from Digizuite DAM.
Find the bucket item in Sitecore.Fetch data from Digizuite DAM, for the specific assetId.We only update the sitecore item, if there are any changesBatchSyncAssets | 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 |
SynchronizeAssetGetSitecoreAssetDigizuite.SynchronizeAsset.GetAssetDFS.Connect.Pipelines.SynchronizeAsset.ResolveAssetChangesDFS.Connect.Pipelines.SynchronizeAsset.SaveAssetToSitecoreDFS.Connect.Digizuite.Pipelines.SynchronizeAsset.SaveAssetsynchronizeAssetRequest SynchronizationRequest(AssetId, ID.Parse(assetSiloRootId).ToString())
{
Language = language.Name,
Direction = Direction.Inbound,
Path = ID.Parse(assetSiloRootId).ToString()
};
SyncAssetsArgs
{
Count = batchLSize,
Skip = x * batchLSize,
FacetList = args.FacetList,
Language = DfsLanguage.GetLanguage(args.Language)
} |
|