Posts

Showing posts with the label item buckets

Set Workflow using Item Buckets Search Operations

Image
Recently one of our clients asked to set the workflow on large number of items that were created without workflow, so i was thinking of writing a script on powershell to do that, but then i thought why not extend Item buckets Search operation and add "Set Workflow" option there! Basically, You will need to write a command that sets the workflow for all items in search results, and register that command. 1- The Code: 2- The Configurations: <configuration xmlns:patch="http://www.sitecore.net/xmlconfig/">   <sitecore>     <commands>       <command name="bucket:setworkflow" type="Sitecore.SharedSource.Buckets.SearchOperations.SetWorkflow, Sitecore.SharedSource.Buckets.SearchOperations"/>     </commands>   </sitecore> </configuration> 3- Adding Command item in Sitecore:  Open Content Editor and go to " /sitecore/system/Settings/Buckets/Settings/Search Operations/Fiel...

Convert item to bucket item programmatically

Item buckets lets you store millions of items in a repository without having a direct parent-child relationship, which solves the problem of having large number of items in content tree. Any item in sitecore can be converted into item bucket from Content Editor, by going to ' Configure ' tab then clicking ' Bucket ' to convert the item into item bucket. I was able to write some helper methods to conver item to Item bucket programmatically , in case you were importing large number of data and you wanted to covert items into buckets on the fly. public static void ConvertToBucketItem(Item item)     {         using (new SecurityDisabler())         {               Sitecore.Buckets.Managers.BucketManager.CreateBucket(item);             using (new Sitecore.Data.Items.EditContext(it...