DAM for Optimizely works well with Episerver Find. Out of the box, no assets from Digizuite will be indexed. Adding Digizuite assets to the index, can be done by adding a ReindexInformation provider as shown below. In the example below we use the IDigizuiteClient
class to access assets from Digizuite. The method Client.GetAllAssetIds
, is used for getting all assets from digizuite that has been added to the Episerver channel in Digizuite backend.
ReindexInformation Provider
using System.Collections.Generic; using EPiServer.Find.Cms; using EPiServer.ServiceLocation; using EPiServer.Web; using System.Globalization; using System.Linq; using Digizuite.Episerver; using Digizuite.Episerver.Helpers.Internal; using EPiServer.Core; namespace EpiserverSite.Business { [ServiceConfiguration(typeof(IReindexInformation), Lifecycle = ServiceInstanceScope.Singleton)] public class DigizuiteReindexInformation : IReindexInformation { public IDigizuiteClient Client { get; set; } public DigizuiteReindexInformation(IDigizuiteClient client) { this.Client = client; } public IEnumerable<ReindexTarget> ReindexTargets { get { var assets = Client.GetAllAssetIds(); if (assets != null) { var searchResult = assets.Select(asset => ConversionHelper.GetReferenceFromAssetId(asset.AssetId)).ToList(); var languages = Client.Languages.Select(lang => new CultureInfo(lang.LanguageShort)).ToList(); return new List<ReindexTarget>() { new ReindexTarget { ContentLinks = searchResult, Languages = languages, SiteDefinition = SiteDefinition.Empty } }; } return null; } } public ContentReference Root { get { return DigizuiteContentProvider.GetEntryPoint(); } } } }