DAM for Episerver Optimizely works well with Episerver Find. To get the most out of it you might want to even add the individual Out of the box, no assets from Digizuite will be indexed. Adding Digizuite assets to the index. This , 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
Code Block |
---|
language | c# | title | ReindexInformation Provider |
---|
|
using System.Collections.Generic;
using SystemEPiServer.Find.GlobalizationCms;
using SystemEPiServer.LinqServiceLocation;
using EPiServer.Web;
using EPiServerSystem.CoreGlobalization;
using EPiServer.Find.CmsSystem.Linq;
using Digizuite.Episerver;
using EPiServer.ServiceLocationDigizuite.Episerver.Helpers.Internal;
using EPiServer.WebCore;
namespace Digizuite.Episerver.Examples.FindEpiserverSite.Business
{
[ServiceConfiguration(typeof(IReindexInformation), Lifecycle = ServiceInstanceScope.Singleton)]
public class DigizuiteReindexInformation : IReindexInformation
{
public
IContentLoader ContentLoader { get; set; } public IDigizuiteClient Client { get; set; }
public DigizuiteReindexInformation(IContentLoader contentloader, IDigizuiteClient client)
{
this.ContentLoaderClient = contentloaderclient;
}
this.Client = client;
public IEnumerable<ReindexTarget> ReindexTargets
} {
public virtual IEnumerable<ReindexTarget> ReindexTargets get
{ {
get var assets {= Client.GetAllAssetIds();
if (Client.Foldersassets =!= null)
{
return new List<ReindexTarget>(); var searchResult var contentLinks= assets.Select(asset = new List<ContentReference>> ConversionHelper.GetReferenceFromAssetId(asset.AssetId)).ToList();
var languages = Client.Languages.Select(lang => new CultureInfo(lang.LanguageShort)).ToList();
var entrypointreturn =new DigizuiteContentProvider.GetEntryPointList<ReindexTarget>();
{
var childrens = ContentLoader.GetDescendents(entrypoint); contentLinks.AddRange(childrens);
new ReindexTarget
return new List<ReindexTarget>() {
{ ContentLinks = searchResult,
new ReindexTarget { Languages = languages,
ContentLinks = contentLinks, SiteDefinition = SiteDefinition.Empty
Languages = languages, }
SiteDefinition = SiteDefinition.Empty };
}
}return null;
}
}
public virtual ContentReference Root
{
get
{
var entrypoint = DigizuiteContentProvider.GetEntryPoint(); return entrypointDigizuiteContentProvider.GetEntryPoint();
}
}
}
} |