This file contains hidden or 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.Linq; | |
| using System.Xml.Linq; | |
| using Sitecore.ContentSearch.SolrProvider.Pipelines.PopulateSolrSchema; | |
| using SolrNet.Schema; | |
| public class ExtSchemaPopulateHelper : SchemaPopulateHelper | |
| { | |
| private readonly SolrSchema schema; |
This file contains hidden or 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.ContentSearch.SolrProvider.Abstractions; | |
| using Sitecore.ContentSearch.SolrProvider.Pipelines.PopulateSolrSchema; | |
| using SolrNet.Schema; | |
| public class ExtPopulateHelperFactory : IPopulateHelperFactory | |
| { | |
| public ISchemaPopulateHelper GetPopulateHelper(SolrSchema solrSchema) => new ExtSchemaPopulateHelper(solrSchema); | |
| } |
This file contains hidden or 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.Install.Framework; | |
| using Sitecore.Diagnostics; | |
| using Sitecore.IO; | |
| using System.Linq; | |
| public class CustomPackageInstallationProcessor : IItemInstallerEvents | |
| { | |
| public void OnItemInstalling(object sender, InstallerEventArgs args) | |
| { | |
| Assert.ArgumentNotNull(sender, nameof(sender)); |
This file contains hidden or 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
| IProcessingContext installationContext = InstallerManager.CreateInstallationContext(this._skipFile); | |
| public static IProcessingContext CreateInstallationContext(bool skipFile = false) => (IProcessingContext)new ExtSimpleProcessingContext(skipFile); | |
| public void InstallPackage(string path, bool registerInstallation, ISource<PackageEntry> source, IProcessingContext context) | |
| { | |
| //..omit for brevity | |
| using (new PackageInstallationContext()) | |
| { |
This file contains hidden or 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 CustomEntrySorter : EntrySorter | |
| { | |
| private bool SkipFile { get; set; } | |
| public CustomEntrySorter(ISource<PackageEntry> baseSource, bool skipFile = false) : base(baseSource) | |
| { | |
| this.SkipFile = skipFile; | |
| } | |
| public override void Put(PackageEntry entry) |
This file contains hidden or 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 ExtSimpleProcessingContext : SimpleProcessingContext | |
| { | |
| public ExtSimpleProcessingContext(bool skip) | |
| { | |
| this.SkipFile = skip; | |
| } | |
| public bool SkipFile { get; set; } | |
| } |
This file contains hidden or 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 Program | |
| { | |
| public static void Main(string[] args) | |
| { | |
| var filePath = $@"Update filepath of the Package.zip"; | |
| ISource<PackageEntry> source = new Sitecore.Install.Zip.PackageReader(filePath); | |
| var packageSinkHelper = new PackageSinkManager(); |
This file contains hidden or 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 Program | |
| { | |
| public static void Main(string[] args) | |
| { | |
| var filePath = $@"Path to package.zip"; | |
| ISource<PackageEntry> source = new Sitecore.Install.Zip.PackageReader(filePath); | |
| var packageSinkHelper = new PackageSinkManager(); |
This file contains hidden or 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 PackageSinkManager : BaseSink<PackageEntry> | |
| { | |
| public override void Put(PackageEntry entry) | |
| { | |
| Console.WriteLine($"Key: {entry.Key}. Source: {PackageUtils.TryGetValue(entry.Properties, "source")}."); | |
| } | |
| } |
This file contains hidden or 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 PackageSinkManager : BaseSink<PackageEntry> | |
| { | |
| public override void Put(PackageEntry entry) | |
| { | |
| // Implementation goes here | |
| } | |
| } |