Bucketable Sitecore Sharepoint Connector

Geschrieben von Maks Ponomarenko veröffentlich am in der Kategorie Sitecore
According to the Sitecore Best Practices, each item should contain less than 100 child items. Otherwise it will impact the performance. Especially of the Content Editor. 
But when we take a look at the Sharepoint Connector, it doesn’t support any items structure. All integration items are located under the root item. In our case there were five thousand documents - so the performance was dead.

According to the Sitecore Best Practices, each item should contain less than 100 child items. Otherwise it will impact the performance. Especially of the Content Editor. 
But when we take a look at the Sharepoint Connector, it doesn’t support any items structure. All integration items are located under the root item. In our case there were five thousand documents - so the performance was dead 😊

Thank God, the Sharepoint Connector is very easy to customize. So let’s do it:

The integration process runs in the “synchronizeTree” pipeline where the process “GetSitecoreItemList” retrieves the list of the integration items under your documents root item. 

 

Here is the code:

public class GetSitecoreItemList { public void Process(Sitecore.Sharepoint.Pipelines.SynchronizeTree.SynchronizeTreeArgs args) { Assert.ArgumentNotNull(args, "args"); Assert.IsNotNull(args.Context, "Value can't be null: args.Context"); args.IntegrationItems = (from x in args.Context.ParentItem.Children.Where(new Func<item,>(SharepointProvider.IsIntegrationItem)) select new Sitecore.Sharepoint.Data.Providers.Items.IntegrationItem(x)).ToList<sitecore.sharepoint.data.providers.items.integrationitem>(); } } </sitecore.sharepoint.data.providers.items.integrationitem></item,>

Our code should be like this:

public void Process(Sitecore.Sharepoint.Pipelines.SynchronizeTree.SynchronizeTreeArgs args) { Assert.ArgumentNotNull(args, "args"); Assert.IsNotNull(args.Context, "Value can't be null: args.Context"); args.IntegrationItems = (from x in args.Context.ParentItem.Axes.GetDescendants().Where(SharepointProvider.IsIntegrationItem) select new Sitecore.Sharepoint.Data.Providers.Items.IntegrationItem(x)).ToList(); FanucLog.Debug("GetSitecoreItemList : {0} Integration Items Found".FormatWith(args.IntegrationItems.Count)); }

Do not forget to update the config

Now set the integration items as bucketable using the standard values and set the root item as Bucket: