Last active
March 20, 2018 18:02
-
-
Save trnktms/42a068b4d2fd2aa96a29f90497127b69 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Sitecore; | |
using Sitecore.ExperienceEditor.Utils; | |
using Sitecore.ExperienceEditor.WebEdit.Commands; | |
using Sitecore.Workflows.Simple; | |
using System.Linq; | |
namespace Helix.Skeleton.Foundation.ContentWorkflow.Commands | |
{ | |
public class WorkflowWithDatasourceItemsAndChildren : WorkflowWithDatasourceItems | |
{ | |
protected new void WorkflowCompleteCallback(WorkflowPipelineArgs args) | |
{ | |
base.WorkflowCompleteCallback(args); | |
var datasources = ItemUtility.GetItemsFromLayoutDefinedDatasources( | |
args.DataItem, | |
Context.Device, | |
args.DataItem.Language); | |
foreach (var child in ItemUtility.FilterSameItems(datasources).SelectMany(d => d.Children)) | |
{ | |
if (child.Access.CanWrite() && (!child.Locking.IsLocked() || child.Locking.HasLock())) | |
{ | |
WorkflowUtility.ExecuteWorkflowCommandIfAvailable( | |
child, | |
args.CommandItem, | |
args.CommentFields); | |
} | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment