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 Quartz; | |
using Sitecron.SitecronSettings; | |
public abstract class SiteCronBase : IJob | |
{ | |
private DateTime _lastLogEntry; | |
protected abstract void Run(IJobExecutionContext args); | |
public void Execute(IJobExecutionContext context) | |
{ |
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 Quartz; | |
public class TestJob : SiteCronBase | |
{ | |
protected override void Run(IJobExecutionContext context) | |
{ | |
WriteLogLine(context, "Starting SiteCron job"); | |
// core functionality lives here | |
// obtain databases with Factory.GetDatabase("master"); for example |
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
[DataContract] | |
public class LogMessageRemoteEvent : IHasEventName | |
{ | |
public LogMessageRemoteEvent(string instanceName, string eventName) | |
{ | |
InstanceName = instanceName; | |
EventName = eventName; | |
} | |
// This is the custom data you will be passing between servers |
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
var pipelineItem = Factory.GetDatabase("master").GetItem("/sitecore/content/My Pipeline"); | |
var pipelineArgs = new PipelineArgs(); | |
Pipeline.Start(pipelineItem, pipelineArgs); | |
var customData = pipelineArgs.CustomData; |
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
public class Step1 | |
{ | |
public void Process(PipelineArgs args) | |
{ | |
var processorItem = args.ProcessorItem; | |
var customField = processorItem.InnerItem["Custom Referenced Item"]; | |
var referencedItem = processorItem.InnerItem.Database.GetItem(new ID(customField)); |
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
WorkflowPipelineArgs workflowPipelineArgs = new WorkflowPipelineArgs(item, null, null); | |
Pipeline pipeline = Pipeline.Start(stateItem, workflowPipelineArgs); | |
if (pipeline != null) | |
{ | |
WorkflowCounters.ActionsExecuted.IncrementBy(pipeline.Processors.Count); | |
} |
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
public static Processor Parse(ProcessorItem item) | |
{ | |
Sitecore.Diagnostics.Assert.ArgumentNotNull((object) item, nameof (item)); | |
if (item.Disabled || item.Type.Trim().Length == 0) | |
return (Processor) null; | |
return new Processor(item); | |
} |
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
public class LogMessageRemoteMap | |
{ | |
public void Initialize(PipelineArgs args) | |
{ | |
EventManager.Subscribe<LogMessageRemoteEvent>(new Action<LogMessageRemoteEvent>(OnGenericRemoteEvent<LogMessageRemoteEvent>)); | |
} | |
private static void OnGenericRemoteEvent<TEvent>(TEvent @event) where TEvent : IHasEventName | |
{ | |
RemoteEventArgs<TEvent> remoteEventArgs = new RemoteEventArgs<TEvent>(@event); |
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
public class LogMessageRemote | |
{ | |
public void LogInstanceName(object sender, EventArgs args) | |
{ | |
var logMessageArgs = args as RemoteEventArgs<LogMessageRemoteEvent>; | |
if (logMessageArgs == null) | |
throw new InvalidOperationException("Unexpected event args: {0}".FormatWith((object) args.GetType().FullName)); | |
Log.Info($"Triggered from {logMessageArgs.InstanceName}.", (object) this); | |
} |
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 System; | |
using System.Collections.Generic; | |
using System.IO; | |
using System.Linq; | |
using System.Text.RegularExpressions; | |
using System.Xml.Linq; | |
using HedgehogDevelopment.SitecoreProject.Tasks; | |
using HedgehogDevelopment.SitecoreProject.Tasks.ProjectAnalysis; | |
namespace TDS.Validators |