Skip to content

Commit

Permalink
Merge pull request #353 from Sitecore/develop
Browse files Browse the repository at this point in the history
Release SIM.Tool 1.6.0
  • Loading branch information
AndreyFilchenkov authored Jan 24, 2020
2 parents a6b03cd + e6da232 commit 0599e3c
Show file tree
Hide file tree
Showing 246 changed files with 12,282 additions and 576 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,7 @@ src/SIM.Foundation.SqlAdapter/bin/
src/SIM.Foundation.SqlAdapter/obj/
src/SIM.Foundation.SqlAdapter.IntegrationTests/bin/
src/SIM.Foundation.SqlAdapter.IntegrationTests/obj/
src/SIM.Sitecore9Installer/bin/
src/SIM.Telemetry/bin/
src/SIM.SitecoreEnvironments/bin/
/.vs
5 changes: 2 additions & 3 deletions ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,8 @@ I hereby confirm the issue is new:
* it is not a [known issue](https://github.com/Sitecore/Sitecore-Instance-Manager/blob/develop/README.md#knwon-ssue)
* it was not discussed before (I used GitHub Issues search)

**Valid for QA**
I hereby confirm the issue is reproducible on the latest QA version [PUT HERE EXACT VERSION NUMBER]
which was downloaded today from http://dl.sitecore.net/updater/qa/sim
**Valid for QA/DEV**
I hereby confirm the issue is reproducible on the latest QA/DEV version [PUT HERE EXACT VERSION NUMBER]

**Screenshots:**
Please find screenshots attached.
Expand Down
8 changes: 4 additions & 4 deletions build/PostCompile.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ Get-Content stdout.txt | Write-Host
Get-Content stderr.txt | Write-Host

# create manifest
Write-Host "> tools\mage.exe -New Application -IconFile `"$Icon`" -ToFile `"$ManifestFile`" -FromDirectory `"$ReleaseFolder`" -Name `"$Name`" -Version `"$Version`" -Processor x86"
Start-Process -FilePath "tools\mage.exe" -ArgumentList "-New Application -IconFile `"$Icon`" -ToFile `"$ManifestFile`" -FromDirectory `"$ReleaseFolder`" -Name `"$Name`" -Version `"$Version`" -Processor x86" -Wait -RedirectStandardOutput stdout.txt -RedirectStandardError stderr.txt
Write-Host "> tools\mage.exe -New Application -IconFile `"$Icon`" -ToFile `"$ManifestFile`" -FromDirectory `"$ReleaseFolder`" -Name `"$Name`" -Version `"$Version`" -Processor msil"
Start-Process -FilePath "tools\mage.exe" -ArgumentList "-New Application -IconFile `"$Icon`" -ToFile `"$ManifestFile`" -FromDirectory `"$ReleaseFolder`" -Name `"$Name`" -Version `"$Version`" -Processor msil" -Wait -RedirectStandardOutput stdout.txt -RedirectStandardError stderr.txt
Get-Content stdout.txt | Write-Host
Get-Content stderr.txt | Write-Host

Expand All @@ -68,8 +68,8 @@ Get-Content stdout.txt | Write-Host
Get-Content stderr.txt | Write-Host

# create application file
Write-Host "> tools\mage.exe -New Deployment -AppManifest `"$ManifestFile`" -ToFile `"$ApplicationFile`" -Processor x86 -Install true -Publisher `"$PublisherName`" -ProviderUrl `"$URL`""
Start-Process -FilePath "tools\mage.exe" -ArgumentList "-New Deployment -AppManifest `"$ManifestFile`" -ToFile `"$ApplicationFile`" -Processor x86 -Install true -Publisher `"$PublisherName`" -ProviderUrl `"$URL`"" -Wait -RedirectStandardOutput stdout.txt -RedirectStandardError stderr.txt
Write-Host "> tools\mage.exe -New Deployment -AppManifest `"$ManifestFile`" -ToFile `"$ApplicationFile`" -Processor msil -Install true -Publisher `"$PublisherName`" -ProviderUrl `"$URL`""
Start-Process -FilePath "tools\mage.exe" -ArgumentList "-New Deployment -AppManifest `"$ManifestFile`" -ToFile `"$ApplicationFile`" -Processor msil -Install true -Publisher `"$PublisherName`" -ProviderUrl `"$URL`"" -Wait -RedirectStandardOutput stdout.txt -RedirectStandardError stderr.txt
Get-Content stdout.txt | Write-Host
Get-Content stderr.txt | Write-Host

Expand Down
8 changes: 4 additions & 4 deletions src/SIM.Adapters/SIM.Adapters.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,11 @@
<Reference Include="MongoDB.Driver">
<HintPath>..\packages\mongocsharpdriver.1.10.1\lib\net35\MongoDB.Driver.dll</HintPath>
</Reference>
<Reference Include="Sitecore.Diagnostics.Base, Version=2.0.1.65, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Sitecore.Diagnostics.Base.2.0.1.65\lib\Sitecore.Diagnostics.Base.dll</HintPath>
<Reference Include="Sitecore.Diagnostics.Base, Version=2.0.1.171, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Sitecore.Diagnostics.Base.2.0.1.171\lib\Sitecore.Diagnostics.Base.dll</HintPath>
</Reference>
<Reference Include="Sitecore.Diagnostics.Logging, Version=2.0.1.65, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Sitecore.Diagnostics.Logging.2.0.1.65\lib\Sitecore.Diagnostics.Logging.dll</HintPath>
<Reference Include="Sitecore.Diagnostics.Logging, Version=2.0.1.171, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Sitecore.Diagnostics.Logging.2.0.1.171\lib\Sitecore.Diagnostics.Logging.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
Expand Down
4 changes: 2 additions & 2 deletions src/SIM.Adapters/packages.config
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
<packages>
<package id="JetBrains.Annotations" version="11.1.0" targetFramework="net45" />
<package id="Microsoft.Web.Administration" version="7.0.0.0" targetFramework="net45" />
<package id="Sitecore.Diagnostics.Base" version="2.0.1.65" targetFramework="net45" />
<package id="Sitecore.Diagnostics.Logging" version="2.0.1.65" targetFramework="net45" />
<package id="Sitecore.Diagnostics.Base" version="2.0.1.171" targetFramework="net45" />
<package id="Sitecore.Diagnostics.Logging" version="2.0.1.171" targetFramework="net45" />
</packages>
4 changes: 3 additions & 1 deletion src/SIM.Base/ApplicationManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ public static class ApplicationManager

#endregion

[NotNull]
#region Fields
public static string UnInstallParamsFolder { get; set; }

[NotNull]
public static string AppLabel { get; }
Expand Down Expand Up @@ -104,7 +106,7 @@ static ApplicationManager()
AppVersion = GetVersion();
AppShortVersion = GetShortVersion();
AppLabel = GetLabel();

UnInstallParamsFolder = InitializeDataFolder("UnInstallParams");
TempFolder = InitializeDataFolder("Temp");
}

Expand Down
9 changes: 9 additions & 0 deletions src/SIM.Base/IProfile.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
namespace SIM
{
using JetBrains.Annotations;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;

public interface IProfile
{
Expand All @@ -16,6 +20,11 @@ public interface IProfile
[CanBeNull]
string LocalRepository { get; set; }

[CanBeNull]
List<SolrDefinition> Solrs { get; set; }

List<VersionToSolr> VersionToSolrMap { get; set; }

void Save();
}
}
13 changes: 13 additions & 0 deletions src/SIM.Base/IValidateable.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace SIM
{
public interface IValidateable
{
string ValidateAndGetError();
}
}
24 changes: 21 additions & 3 deletions src/SIM.Base/Pipelines/Processors/MultipleProcessorDefinition.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,28 @@ public class MultipleProcessorDefinition : ProcessorDefinition
{
#region Public Methods and Operators

public override IEnumerable<Processor> CreateProcessors(ProcessorArgs args)
public override IEnumerable<Processor> CreateProcessors(ProcessorArgs args, IPipelineController controller)
{
var hive = (ProcessorHive)ReflectionUtil.CreateObject(Type);
return hive.CreateProcessors(args);
var hive = (ProcessorHive)ReflectionUtil.CreateObject(Type,this);
IEnumerable<Processor> proc=hive.CreateProcessors(args);
if (controller != null)
{
this.SetControllerForDynamicNestedProcessors(proc, controller);
}

return proc;
}

private void SetControllerForDynamicNestedProcessors(IEnumerable<Processor>processors, IPipelineController controller)
{
foreach(Processor p in processors)
{
p.Controller = controller;
if (p._NestedProcessors != null && p._NestedProcessors.Count > 0)
{
this.SetControllerForDynamicNestedProcessors(p._NestedProcessors, controller);
}
}
}

#endregion
Expand Down
16 changes: 15 additions & 1 deletion src/SIM.Base/Pipelines/Processors/Processor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ public abstract class Processor : DataObject

public readonly List<Processor> _NestedProcessors = new List<Processor>();

string title;
#endregion

#region Constructors
Expand Down Expand Up @@ -58,10 +59,23 @@ public string Title
{
get
{
return ProcessorDefinition.Title;
if (string.IsNullOrEmpty(this.title))
{
return ProcessorDefinition.Title;
}

return this.title;
}

set
{
this.title = value;
}
}

[CanBeNull]
public string CustomLogLocation { get; set; }

#endregion

#region Properties
Expand Down
13 changes: 13 additions & 0 deletions src/SIM.Base/Pipelines/Processors/ProcessorArgs.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
namespace SIM.Pipelines.Processors
{
using Sitecore.Diagnostics.Base;
using System;

#region
Expand All @@ -14,6 +15,18 @@ public class ProcessorArgs : IDisposable

#endregion

public ProcessorArgs()
{

}
public ProcessorArgs(string pipelineName)
{
Assert.ArgumentNotNullOrEmpty(pipelineName, nameof(pipelineName));
this.PipelineName = pipelineName;
}

public string PipelineName { get; protected set; }

#region Public Methods

public virtual void Dispose()
Expand Down
2 changes: 1 addition & 1 deletion src/SIM.Base/Pipelines/Processors/ProcessorDefinition.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public abstract class ProcessorDefinition

#region Public Methods and Operators

public abstract IEnumerable<Processor> CreateProcessors(ProcessorArgs args);
public abstract IEnumerable<Processor> CreateProcessors(ProcessorArgs args, IPipelineController controller);

public override string ToString()
{
Expand Down
8 changes: 8 additions & 0 deletions src/SIM.Base/Pipelines/Processors/ProcessorHive.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,19 @@
using Sitecore.Diagnostics.Base;

namespace SIM.Pipelines.Processors
{
using System.Collections.Generic;

public abstract class ProcessorHive
{
protected ProcessorDefinition ParentDefinition { get; set; }
#region Public Methods and Operators

public ProcessorHive(ProcessorDefinition parentDefinition)
{
Assert.ArgumentNotNull(parentDefinition, nameof(parentDefinition));
this.ParentDefinition = parentDefinition;
}
public abstract IEnumerable<Processor> CreateProcessors(ProcessorArgs args);

#endregion
Expand Down
8 changes: 6 additions & 2 deletions src/SIM.Base/Pipelines/Processors/ProcessorManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,13 @@ private static IEnumerable<Processor> CreateProcessorsPrivate([NotNull] IEnumera

foreach (ProcessorDefinition processorDefinition in processorDefinitions)
{
foreach (Processor processor in processorDefinition.CreateProcessors(args))
foreach (Processor processor in processorDefinition.CreateProcessors(args,controller))
{
processor.ProcessorDefinition = processorDefinition;
if (processor.ProcessorDefinition == null)
{
processor.ProcessorDefinition = processorDefinition;
}

bool isRequireProcessing = true;
try
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ public class SingleProcessorDefinition : ProcessorDefinition
{
#region Public Methods and Operators

public override IEnumerable<Processor> CreateProcessors(ProcessorArgs args)
public override IEnumerable<Processor> CreateProcessors(ProcessorArgs args, IPipelineController controller)
{
return new[]
{
Expand Down
11 changes: 7 additions & 4 deletions src/SIM.Base/SIM.Base.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@
<Reference Include="JetBrains.Annotations, Version=11.1.0.0, Culture=neutral, PublicKeyToken=1010a0d8d6380325, processorArchitecture=MSIL">
<HintPath>..\packages\JetBrains.Annotations.11.1.0\lib\net20\JetBrains.Annotations.dll</HintPath>
</Reference>
<Reference Include="Sitecore.Diagnostics.Base, Version=2.0.1.65, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Sitecore.Diagnostics.Base.2.0.1.65\lib\Sitecore.Diagnostics.Base.dll</HintPath>
<Reference Include="Sitecore.Diagnostics.Base, Version=2.0.1.171, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Sitecore.Diagnostics.Base.2.0.1.171\lib\Sitecore.Diagnostics.Base.dll</HintPath>
</Reference>
<Reference Include="Sitecore.Diagnostics.Logging, Version=2.0.1.65, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Sitecore.Diagnostics.Logging.2.0.1.65\lib\Sitecore.Diagnostics.Logging.dll</HintPath>
<Reference Include="Sitecore.Diagnostics.Logging, Version=2.0.1.171, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Sitecore.Diagnostics.Logging.2.0.1.171\lib\Sitecore.Diagnostics.Logging.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.configuration" />
Expand Down Expand Up @@ -77,6 +77,7 @@
<Compile Include="FileSystem\TempFolder.cs" />
<Compile Include="IAdvancedSettingsStorage.cs" />
<Compile Include="IProfile.cs" />
<Compile Include="IValidateable.cs" />
<Compile Include="Safe.cs" />
<Compile Include="Parameters.cs" />
<Compile Include="Pipelines\Pipeline.cs" />
Expand All @@ -102,6 +103,8 @@
<Compile Include="ReflectionUtil.cs" />
<Compile Include="Services\ConnectionString.cs" />
<Compile Include="Services\SqlConnectionString.cs" />
<Compile Include="SolrDefinition.cs" />
<Compile Include="VersionToSolr.cs" />
<Compile Include="WebRequestHelper.cs" />
<Compile Include="XmlBasedAdvancedSettingsStorage.cs" />
<Compile Include="AppConfigSectionHandler.cs" />
Expand Down
95 changes: 95 additions & 0 deletions src/SIM.Base/SolrDefinition.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
using Sitecore.Diagnostics.Base;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace SIM
{
[Serializable]
public class SolrDefinition: ICloneable, IValidateable
{
string url;
string root;
string name;

public string Name {
get
{
return this.name;
}
set
{
name = value;
}
}

public string Url {
get
{
return url;
}
set
{
url = value.Trim().TrimEnd('/','#');
}
}
public string Root
{
get
{
return root;
}
set
{
root = value;
}
}
public string Service { get; set; }

public object Clone()
{
return new SolrDefinition()
{
root = Root,
name = Name,
url = Url,
Service = Service
};
}

public string ValidateAndGetError()
{
if (string.IsNullOrWhiteSpace(this.Name) || string.IsNullOrWhiteSpace(this.Url) ||
string.IsNullOrWhiteSpace(this.Root))
{
return "Name, Root and Url must not be empty.";
}

Uri uri;

try
{
uri = new Uri(this.Url, UriKind.Absolute);
}
catch (Exception ex)
{
return "Invalid solr URL.";
}

if (!uri.Scheme.Equals("https", StringComparison.InvariantCultureIgnoreCase))
{
return "Solr must be HTTPS";
}

if (!Directory.Exists(this.Root))
{
return "Solr root path does not exist.";
}

return string.Empty;
}
}
}
Loading

0 comments on commit 0599e3c

Please sign in to comment.