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
namespace MyClient.Foundation.Services | |
{ | |
using Sitecore.Data.Items; | |
using Sitecore.ExperienceEdge.Connector.Abstraction.DirectPublishing; | |
public class EdgeService : IEdgeService | |
{ | |
private const string EdgePublishingTargetId = "{3013BEED-71CA-4DE3-A1D2-17DD871597F1}"; | |
/// <summary> |
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
namespace Foundation.Search.Crawlers | |
{ | |
using System; | |
using Microsoft.Extensions.DependencyInjection; | |
using Sitecore; | |
using Sitecore.Abstractions; | |
using Sitecore.ContentSearch; | |
using Sitecore.ContentSearch.Events; | |
using Sitecore.Data.Items; |
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
- powershell: | # generates a hash of all packages.config and saves each on a single line on 'hash.txt' | |
Get-FileHash -Algorithm MD5 -Path (Get-ChildItem packages.config -Recurse) >> hash.txt | |
Write-Host "Hash File saved to $pwd\hash.txt" | |
workingDirectory: src | |
displayName: 'Calculate and save packages.config hash' | |
- task: CacheBeta@0 # speed up builds by caching packages folder | |
inputs: | |
key: nuget|1|$(Agent.OS)|$(Build.SourcesDirectory)\src\hash.txt # hash map generated in previous step | |
path: $(Build.SourcesDirectory)\src\packages |
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 localCopyrightSettingsItem = Context.Items.Get(MultisiteConstants.LocalCopyrightSettingsItem); |
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
namespace MyProject.Pipelines | |
{ | |
public class ItemsLookup : HttpRequestProcessor | |
{ | |
public override void Process(HttpRequestArgs args) | |
{ | |
// Shared Data Folder | |
Context.Items.SetLazy(MultisiteConstants.SharedDataFolderItem, () => | |
Context.Database.GetItem(new ID(MultisiteConstants.SharedDataFolderId)) | |
); |
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
namespace MyProject.Extensions | |
{ | |
public static class ItemsContextExtensions | |
{ | |
public static Item Get(this ItemsContext source, string identifier) | |
{ | |
if (string.IsNullOrWhiteSpace(identifier)) | |
throw new Exception("Must set identifier for getting global property"); | |
var dictionary = source as IDictionary; |
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
<?xml version="1.0"?> | |
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/"> | |
<sitecore> | |
<pipelines> | |
<httpRequestBegin> | |
<processor type="MyProject.Pipelines.ItemsLookup, MyProject" resolve="true" patch:after="*[@type='Sitecore.Pipelines.HttpRequest.ItemResolver, Sitecore.Kernel']" /> | |
</httpRequestBegin> | |
</pipelines> | |
</sitecore> | |
</configuration> |
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
<?xml version="1.0" encoding="utf-8"?> | |
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/"> | |
<sitecore> | |
<events> | |
<event name="item:deleting"> | |
<handler type="MyProject.MyNamespace.RemoteDeleteHandler, MyProject" method="OnItemDeleting" /> | |
</event> | |
</events> | |
</sitecore> | |
</configuration> |
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
using Quartz; | |
using Sitecron.SitecronSettings; | |
public abstract class SiteCronBase : IJob | |
{ | |
private DateTime _lastLogEntry; | |
protected abstract void Run(IJobExecutionContext args); | |
public void Execute(IJobExecutionContext context) | |
{ |
NewerOlder