Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

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

Below are descriptions of the most important pipelines used in the module.


App_Config/Include/damforsitecore/DFS.Settings.config

PipelineDescriptionPipelineArgs
DFS.GetAssetFieldValueThis pipeline will return rendering html for an asset item. 
  1. 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.
  2. The different processors will replace the stampvalue in the html template.
  3. The property FieldValue of GetAssetFieldValueArgs will contain the rendering html.


List of processors

  • DFS.ContentSearch.Pipelines.GetAssetFieldValue.GetAssetTypeOutput
  • DFS.Pipelines.GetAssetFieldValue.ReplaceTagsWithSelectedValues
  • DFS.Services.Pipelines.GetAssetFieldValue.ReplaceTagsWithAccessValues
  • DFS.Pipelines.GetAssetFieldValue.ReplaceTagsWithConfigValues
  • DFS.Pipelines.GetAssetFieldValue.ReplaceTagsWithAssetItemFieldValues
  • DFS.ContentSearch.Pipelines.GetAssetFieldValue.ReplaceTagsWithAssetIndexValues
  • DFS.Pipelines.GetAssetFieldValue.RemoveEmptyAttributes
  • DFS.Pipelines.GetAssetFieldValue.AppendTagsWithParameterValues
  • DFS.ContentSearch.Pipelines.GetAssetFieldValue.AppendSeo
  • DFS.Pipelines.GetAssetFieldValue.SplitFieldValueIntoResult
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

PipelineDescriptionPipelineArgs
DFS.Services.DFSMedia

This pipeline will return the media stream either from the cache or from Digizuite DAM. 

  1. First we check security.
  2. If the media is in the cache we return that.
  3. The media was not in the cache, fetch the media from Digizuite DAM.
  4. We resize the image, if resizing parameters was added.
  5. Store the media in the cache.


List of processors

  • DFS.Services.Pipelines.DFSMedia.CheckSecurity
  • DFS.Services.Pipelines.DFSMedia.GetMediaFromCache
  • DFS.Services.Pipelines.DFSMedia.GetMediaPrerequisites
  • DFS.Services.Pipelines.DFSMedia.GetMediaFromDigizuite
  • DFS.Services.Pipelines.DFSMedia.ResizeImage
  • DFS.Services.Pipelines.DFSMedia.SaveToCache
  • DFS.Services.Pipelines.DFSMedia.ResolveDownloadFilename
var arguments = new DFSMediaPipelineArgs
{
	Request = mediaRequest,
    Result = new MediaResult()
};

App_Config/Include/damforsitecore/DFS.Connect.config

PipelineDescriptionPipelineArgs
DFS.Connect.DetectDamChanges

This pipeline will pick up any changes made to assets or metafield in Digizuite DAM.

  1. First we fetch assets that has been changed in a given date range. A list of assets are store on the detectDamChangesArgs.modifiedAssets.
  2. Then we fetch metafields that has been changed in a given date range. A list of metafield are store on the detectDamChangesArgs.modifiedMetafields.
  3. 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 processor.


List of processors

  • DFS.Connect.Pipelines.DetectDamChanges.RunGetModifiedAssets
  • DFS.Connect.Pipelines.DetectDamChanges.RunGetModifiedMetafields
  • DFS.Connect.Pipelines.DetectDamChanges.RunSyncDeletedAssets
  • DFS.Connect.Pipelines.DetectDamChanges.RunSyncMetagroups
  • DFS.Connect.Pipelines.DetectDamChanges.RunSyncDeletedMetafields
var detectDamChangesArgs = 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.

  1. 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.
  2. Then pauses out custom index: dfs_assets_master_index
  3. Fetch all configuration.
  4. Fetch all assets that are avaible in Digizuite DAM channel.
  5. Create/update all (new) Sitecore items from what you have fetched.
  6. Rebuild the index: dfs_assets_master_index
  7. Unlock the silo again. 


List of processors

  • DFS.Connect.Pipelines.SynchronizeAssetsSilo.CheckSiloLock
  • DFS.Connect.Pipelines.SynchronizeAssetsSilo.LockSilo
  • DFS.Connect.Pipelines.SynchronizeAssetsSilo.PauseSearchIndexing
  • DFS.Connect.Pipelines.SynchronizeAssetsSilo.RunEnsureMetaDataFolders
  • DFS.Connect.Pipelines.SynchronizeAssetsSilo.RunSynchronizeMetaDataLanguages
  • DFS.Connect.Pipelines.SynchronizeAssetsSilo.RunSynchronizeAssetTypes
  • DFS.Connect.Pipelines.SynchronizeAssetsSilo.RunSynchronizeMetaGroupRoots
  • DFS.Connect.Pipelines.SynchronizeAssetsSilo.RunSynchronizeAssetTypes
  • DFS.Connect.Pipelines.SynchronizeAssetsSilo.RunSynchronizeMediaFormatTypes
  • DFS.Connect.Pipelines.SynchronizeAssetsSilo.RunSynchronizeConfig
  • DFS.Connect.Pipelines.SynchronizeAssetsSilo.RunSynchronizeFormats
  • DFS.Connect.Pipelines.SynchronizeAssetsSilo.ResumeSearchIndexing
  • DFS.Connect.Pipelines.SynchronizeAssetsSilo.RebuildSearchIndexes
  • DFS.Connect.Pipelines.SynchronizeAssetsSilo.PauseSearchIndexing
  • DFS.Connect.Pipelines.SynchronizeAssetsSilo.RunSynchronizeAssets
  • DFS.Connect.Pipelines.SynchronizeAssetsSilo.ResumeSearchIndexing
  • DFS.Connect.Pipelines.SynchronizeAssetsSilo.RebuildSearchIndexes
  • DFS.Connect.Pipelines.SynchronizeAssetsSilo.UnLockSilo


var synchronizeAssetsSiloRequest = new SynchronizationRequest(0,SiloId) 
{ 
	Language = "en", 
	Direction = Direction.Inbound, 			PipelineName = "DFS.Connect.SynchronizeSilo" 
};
DFS.Connect.SynchronizeSiloConfiguration

This will only synchronize the configuration.

  1. 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.
  2. Pause the custom index: dfs_assets_master_index
  3. Fetch all configuration.
  4. Create/update all (new) Sitecore items
  5. Rebuild the index: dfs_assets_master_index
  6. Unlock the silo again. 


List of processors

  • DFS.Connect.Pipelines.SynchronizeAssetsSilo.CheckSiloLock
  • DFS.Connect.Pipelines.SynchronizeAssetsSilo.LockSilo
  • DFS.Connect.Pipelines.SynchronizeAssetsSilo.PauseSearchIndexing
  • DFS.Connect.Pipelines.SynchronizeAssetsSilo.RunEnsureMetaDataFolders
  • DFS.Connect.Pipelines.SynchronizeAssetsSilo.RunSynchronizeMetaDataLanguages
  • DFS.Connect.Pipelines.SynchronizeAssetsSilo.RunSynchronizeAssetTypes
  • DFS.Connect.Pipelines.SynchronizeAssetsSilo.RunSynchronizeMetaGroupRoots
  • DFS.Connect.Pipelines.SynchronizeAssetsSilo.RunSynchronizeAssetTypes
  • DFS.Connect.Pipelines.SynchronizeAssetsSilo.RunSynchronizeMediaFormatTypes
  • DFS.Connect.Pipelines.SynchronizeAssetsSilo.RunSynchronizeConfig
  • DFS.Connect.Pipelines.SynchronizeAssetsSilo.RunSynchronizeFormats
  • DFS.Connect.Pipelines.SynchronizeAssetsSilo.ResumeSearchIndexing
  • DFS.Connect.Pipelines.SynchronizeAssetsSilo.RebuildSearchIndexes
  • DFS.Connect.Pipelines.SynchronizeAssetsSilo.UnLockSilo


var synchronizeAssetsSiloRequest = new SynchronizationRequest(0,SiloId) 
{ 
	Language = "en", 
	Direction = Direction.Inbound, 
	PipelineName = "DFS.Connect.SynchronizeSiloConfiguration" 
};
DFS.Connect.SynchronizeSiloAssets

This will only synchronize the assets.

  1. 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.
  2. Then pauses out custom index: dfs_assets_master_index
  3. Fetch all assets.
  4. Create/build all (new) Sitecore items
  5. Rebuild the index: dfs_assets_master_index
  6. Unlock the silo again. 


List of processors

  • DFS.Connect.Pipelines.SynchronizeAssetsSilo.CheckSiloLock
  • DFS.Connect.Pipelines.SynchronizeAssetsSilo.LockSilo
  • DFS.Connect.Pipelines.SynchronizeAssetsSilo.PauseSearchIndexing
  • DFS.Connect.Pipelines.SynchronizeAssetsSilo.RunSynchronizeAssets
  • DFS.Connect.Pipelines.SynchronizeAssetsSilo.ResumeSearchIndexing
  • DFS.Connect.Pipelines.SynchronizeAssetsSilo.RebuildSearchIndexes
  • DFS.Connect.Pipelines.SynchronizeAssetsSilo.UnLockSilo
var synchronizeAssetsSiloRequest = new SynchronizationRequest(0,SiloId) 
{ 
	Language = "en", 
	Direction = Direction.Inbound, 
	PipelineName = 	"DFS.Connect.SynchronizeSiloAssets" 
};
DFS.Connect.SynchronizeAsset

This will re-synchronize one single asset item and update the data from Digizuite DAM.

  1. Find the bucket item in Sitecore.
  2. Fetch data from Digizuite DAM, for the specific assetId.
  3. We only update the sitecore item, if there are any changes.


List of processors

  • DFS.Connect.Pipelines.SynchronizeAsset.GetSitecoreAsset
  • DFS.Connect.Digizuite.Pipelines.SynchronizeAsset.GetAsset
  • DFS.Connect.Pipelines.SynchronizeAsset.ResolveAssetChanges
  • DFS.Connect.Pipelines.SynchronizeAsset.SaveAssetToSitecore
  • DFS.Connect.Digizuite.Pipelines.SynchronizeAsset.SaveAsset
var synchronizeAssetRequest = new SynchronizationRequest(AssetId, ID.Parse(assetSiloRootId).ToString()) 
{ 
	Language = language.Name, 
	Direction = Direction.Inbound, 
	Path = ID.Parse(assetSiloRootId).ToString() 
};
  • No labels