View build.yml
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 |
View EdgeService.cs
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> |
View EdgeItemCrawler.cs
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; |
View PublishUtils.cs
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 class PublishUtils | |
{ | |
public static void CreateAndPublishQueue(Database sourceDatabase, Database[] targetDatabases, Language[] targetLanguages, IEnumerable<ID> itemIds, bool skipEvents = false, bool useSecurityDisabler = true) | |
{ | |
Assert.IsNotNull(sourceDatabase, "sourceDatabase"); | |
Assert.IsNotNull(targetDatabases, "targetDatabases"); | |
Assert.IsNotNull(targetLanguages, "targetLanguages"); | |
var publishingCandidates = SetPublishingCandidates(sourceDatabase, targetDatabases, targetLanguages, itemIds); |
View RemoteDelete.config
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> |
View Example.cs
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); |
View ItemsLookup.cs
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)) | |
); |
View ItemsContextExtensions.cs
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; |
View zItemsLookup.xml
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> |
View PublishDeployedItemsWithPublishingQueue.cs
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
[Description("Publishes deployed items after deployment using publishing queue.\nPublishing targets are specified in the Parameter as a comma separated list.")] | |
public class PublishDeployedItemsWithPublishingQueue : IPostDeployAction | |
{ | |
/// <summary> | |
/// Borrowed directly from HedgehogDevelopment.SitecoreProject.PackageInstallPostProcessor.BuiltIn.PublishDeployedItems, HedgehogDevelopment.SitecoreProject.PackageInstallPostProcessor | |
/// </summary> | |
private static Database[] GetPublishingTargetDatabases(string parameters) | |
{ | |
if (string.IsNullOrEmpty(parameters)) | |
{ |
NewerOlder