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
private static StartMenu.ApplicationShortcut GetApplicationShortcut(Item item) | |
{ | |
Assert.ArgumentNotNull((object) item, nameof (item)); | |
LinkField field = (LinkField) item.Fields["Application"]; | |
Assert.IsNotNull((object) field, "link field"); | |
string internalPath = field.InternalPath; | |
if (internalPath.Length > 0) | |
{ | |
Item obj = Client.Site.Database.Items[internalPath]; | |
if (obj != null) |
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/" xmlns:search="http://www.sitecore.net/xmlconfig/search/" xmlns:role="http://www.sitecore.net/xmlconfig/role/"> | |
<sitecore search:require="Solr" role:require="ContentManagement or Standalone"> | |
<pipelines> | |
<contentSearch.PopulateSolrSchema> | |
<processor type="Sitecore.ContentSearch.SolrProvider.Pipelines.PopulateSolrSchema.PopulateFields, Sitecore.ContentSearch.SolrProvider"> | |
<param patch:instead="*[@type='Sitecore.ContentSearch.SolrProvider.Factories.DefaultPopulateHelperFactory']" type="MyNamespace.ExtPopulateHelperFactory" /> | |
</processor> | |
</contentSearch.PopulateSolrSchema> | |
</pipelines> |
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.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 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 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 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 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 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 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 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(); |