Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagec#
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();
            }
        }
    }
}
ContentIndexer

dsfsdfsdfsdfsdf sdfdsfsdf sdf dsf

Code Block
languagec#
using Digizuite.Episerver.Models.Media;
using EPiServer.Find.Cms;
using EPiServer.Find.Cms.Conventions;
using EPiServer.Find.Cms.Module;
using EPiServer.Framework;
using EPiServer.Framework.Initialization;
using System;

namespace Test_Digizuite.Episerver_2._3.Business.Initialization
{
    [InitializableModule]
    [ModuleDependency(typeof(IndexingModule))]
    public class FileIndexingConventions : IInitializableModule
    {
        public void Initialize(InitializationEngine context)
        {
            ContentIndexer.Instance.Conventions.ForInstancesOf<IDigizuiteContent>().IndexAttachment(x => false);
        }
        public void Uninitialize(InitializationEngine context)
        {
            throw new NotImplementedException();
        }
    }
}