DAM for Optimizely works well with Optimizely 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 Task<IEnumerable<ContentReference>> FindGetAll(List<FacetRequest> facets)
, is used to add digizuite assets to the Find index.
ReindexInformation Provider
Code Block |
---|
language | c# | title | ReindexInformation Provider |
---|
|
using SystemDigizuite.Collections.GenericModels;
using SystemDigizuite.GlobalizationOptimizely;
using System.Linq;
using EPiServer;
using EPiServer.CoreEPiServer.Find.Cms;
using EPiServer.Find.CmsServiceLocation;
using EPiServer.ServiceLocationWeb;
using EPiServerSystem.WebGlobalization;
namespace Digizuite.Episerver.Examples.FindAlloyDevSiteNet6.Business
{
[ServiceConfiguration(typeof(IReindexInformation), Lifecycle = ServiceInstanceScope.Singleton)]
public class DigizuiteReindexInformation : IReindexInformation
{
public IContentLoaderIDigizuiteClient ContentLoaderClient { get; set; }
public DigizuiteReindexInformation(IDigizuiteClient client)
{
this.Client {= get; set;client;
}
public DigizuiteReindexInformation(IContentLoader contentloader, IDigizuiteClient client) IEnumerable<ReindexTarget> ReindexTargets
{
get
{
var languages this.ContentLoader= Client.Languages.Select(lang = contentloader;> new CultureInfo(lang.LanguageCode)).ToList();
this.Client var facets = client;new List<FacetRequest>()
} {
public virtual IEnumerable<ReindexTarget> ReindexTargets { new FacetRequest()
get {
if (Client.Folders == null) FacetMode = FacetMode.QueryOnly,
Recursive = true,
return new List<ReindexTarget>(); var contentLinksSearchKey = new List<ContentReference>();"assetType",
var languages = Client.Languages.Select(lang Values => new CultureInfo(lang.LanguageShort)).ToList(); List<string>{"image"}
var entrypoint}
= DigizuiteContentProvider.GetEntryPoint(); }; var
childrens = ContentLoader.GetDescendents(entrypoint); var assets contentLinks.AddRange(childrens= Client.FindGetAll(facets).GetAwaiter().GetResult();
return new List<ReindexTarget>()
{
new ReindexTarget
{
ContentLinks = contentLinksassets,
Languages = languages,
SiteDefinition = SiteDefinition.Empty
}
};
}
}
public virtual ContentReference Root
{
get
{
var entrypoint = DigizuiteContentProvider.GetEntryPoint();
return entrypointDigizuiteContentProvider.GetEntryPoint();
}
}
}
}
|