Skip to content

Commit

Permalink
Merge pull request #637 from Sitecore/rc/1.12.0
Browse files Browse the repository at this point in the history
Release 1.12.0
  • Loading branch information
AndreyFilchenkov authored Nov 8, 2021
2 parents 0c96e42 + 8ec9e8b commit 0429212
Show file tree
Hide file tree
Showing 82 changed files with 1,567 additions and 564 deletions.
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.171, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Sitecore.Diagnostics.Base.2.0.1.171\lib\Sitecore.Diagnostics.Base.dll</HintPath>
<Reference Include="Sitecore.Diagnostics.Base, Version=2.1.4.203, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Sitecore.Diagnostics.Base.2.1.4.203\lib\Sitecore.Diagnostics.Base.dll</HintPath>
</Reference>
<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 Include="Sitecore.Diagnostics.Logging, Version=2.1.4.203, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Sitecore.Diagnostics.Logging.2.1.4.203\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.171" targetFramework="net45" />
<package id="Sitecore.Diagnostics.Logging" version="2.0.1.171" targetFramework="net45" />
<package id="Sitecore.Diagnostics.Base" version="2.1.4.203" targetFramework="net471" />
<package id="Sitecore.Diagnostics.Logging" version="2.1.4.203" targetFramework="net471" />
</packages>
35 changes: 33 additions & 2 deletions src/SIM.Base/ApplicationManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ public static class ApplicationManager
[NotNull]
public static string AppShortVersion { get; }

[NotNull]
public static string AppThreePartVersion { get; }

[NotNull]
public static string AppVersion { get; }

Expand Down Expand Up @@ -126,6 +129,7 @@ static ApplicationManager()
AppRevision = GetRevision();
AppVersion = GetVersion();
AppShortVersion = GetShortVersion();
AppThreePartVersion = GetThreePartVersion();
AppLabel = GetLabel();
UnInstallParamsFolder = InitializeDataFolder("UnInstallParams");
TempFolder = InitializeDataFolder("Temp");
Expand Down Expand Up @@ -362,8 +366,18 @@ private static string GetRevision()
}

var revision = revisionAttribute[0] as AssemblyInformationalVersionAttribute;
var rev = "rev. ";
return revision != null ? revision.InformationalVersion.Remove(0, revision.InformationalVersion.IndexOf(rev, StringComparison.Ordinal) + rev.Length) : string.Empty;
if (revision == null)
{
return String.Empty;
}

int revisionLength = revision.InformationalVersion.LastIndexOf(".", StringComparison.Ordinal);
if (revisionLength != -1)
{
return revision.InformationalVersion.Substring(revisionLength + 1);
}

return String.Empty;
}

private static string GetShortVersion()
Expand All @@ -377,6 +391,23 @@ private static string GetShortVersion()
return version.Substring(0, 3);
}

private static string GetThreePartVersion()
{
var version = GetVersion();
if (string.IsNullOrEmpty(version))
{
return string.Empty;
}

int threePartVersionLength = version.LastIndexOf(".", StringComparison.Ordinal);
if (threePartVersionLength != -1)
{
return version.Substring(0, threePartVersionLength);
}

return version;
}

private static string GetVersion()
{
var assembly = Assembly.GetExecutingAssembly();
Expand Down
16 changes: 12 additions & 4 deletions src/SIM.Base/SIM.Base.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
<LangVersion>7.0</LangVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
Expand All @@ -34,6 +35,7 @@
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
<LangVersion>7.0</LangVersion>
</PropertyGroup>
<ItemGroup>
<Reference Include="Ionic.Zip.Reduced, Version=1.9.1.8, Culture=neutral, PublicKeyToken=edbe51ad942a3f5c, processorArchitecture=MSIL">
Expand All @@ -43,16 +45,20 @@
<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.171, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Sitecore.Diagnostics.Base.2.0.1.171\lib\Sitecore.Diagnostics.Base.dll</HintPath>
<Reference Include="Newtonsoft.Json, Version=10.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.10.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
<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 Include="Sitecore.Diagnostics.Base, Version=2.1.4.203, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Sitecore.Diagnostics.Base.2.1.4.203\lib\Sitecore.Diagnostics.Base.dll</HintPath>
</Reference>
<Reference Include="Sitecore.Diagnostics.Logging, Version=2.1.4.203, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Sitecore.Diagnostics.Logging.2.1.4.203\lib\Sitecore.Diagnostics.Logging.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.configuration" />
<Reference Include="System.Core" />
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Runtime.Serialization" />
<Reference Include="System.ServiceProcess" />
<Reference Include="System.Xml" />
Expand Down Expand Up @@ -109,6 +115,8 @@
<Compile Include="Services\ConnectionString.cs" />
<Compile Include="Services\SqlConnectionString.cs" />
<Compile Include="SolrDefinition.cs" />
<Compile Include="SolrState.cs" />
<Compile Include="SolrStateResolver.cs" />
<Compile Include="VersionToSolr.cs" />
<Compile Include="WebRequestHelper.cs" />
<Compile Include="XmlBasedAdvancedSettingsStorage.cs" />
Expand Down
23 changes: 23 additions & 0 deletions src/SIM.Base/SolrState.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
namespace SIM
{
public class SolrState
{
[RenderInDataGreed]
public string Name { get; set; }

[RenderInDataGreed]
public CurrentState State { get; set; }

[RenderInDataGreed]
public string Version { get; set; }

[RenderInDataGreed]
public string Url { get; set; }

public enum CurrentState
{
Running,
Stopped
}
}
}
97 changes: 97 additions & 0 deletions src/SIM.Base/SolrStateResolver.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
using System;
using System.IO;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.ServiceProcess;
using Newtonsoft.Json;

namespace SIM
{
public class SolrStateResolver
{
public virtual SolrState.CurrentState GetServiceState(string solrServiceName)
{
ServiceControllerWrapper service = GetService(solrServiceName);

if (service == null)
{
return SolrState.CurrentState.Stopped;
}

if (service.Status != ServiceControllerStatus.Running)
{
return SolrState.CurrentState.Stopped;
}

return SolrState.CurrentState.Running;
}

public virtual SolrState.CurrentState GetUrlState(string solrUrl)
{
HttpWebRequest httpWebRequest = (HttpWebRequest)WebRequest.Create(solrUrl);
HttpWebResponse httpWebResponse;
try
{
httpWebResponse = (HttpWebResponse)httpWebRequest.GetResponse();
}
catch
{
return SolrState.CurrentState.Stopped;
}

if (httpWebResponse.StatusCode != HttpStatusCode.OK)
{
return SolrState.CurrentState.Stopped;
}

return SolrState.CurrentState.Running;
}

public virtual string GetVersion(string solrUrl)
{
HttpClient client = new HttpClient();

using (Stream stream = client.GetStreamAsync($"{solrUrl}/admin/info/system?wt=json").Result)
using (StreamReader streamReader = new StreamReader(stream))
using (JsonReader reader = new JsonTextReader(streamReader))
{
while (reader.Read())
{
if (string.Equals(reader.Path, "lucene.solr-spec-version", StringComparison.OrdinalIgnoreCase)
&& !string.Equals((string)reader.Value, "solr-spec-version", StringComparison.OrdinalIgnoreCase))
{
return (string)reader.Value;
}
}
}

return string.Empty;
}

public virtual ServiceControllerWrapper GetService(string serviceName)
{
ServiceController service = ServiceController.GetServices().FirstOrDefault(s => s.ServiceName == serviceName);
if (service == null)
{
return null;
}

return new ServiceControllerWrapper(service);
}
}

public class ServiceControllerWrapper
{
ServiceController _service;

public ServiceControllerWrapper(ServiceController service)
{
this._service = service;
}

public virtual ServiceControllerStatus Status => this._service.Status;

public virtual string ServiceName => this._service.ServiceName;
}
}
5 changes: 3 additions & 2 deletions src/SIM.Base/packages.config
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<packages>
<package id="DotNetZip.Reduced" version="1.9.1.8" targetFramework="net45" />
<package id="JetBrains.Annotations" version="11.1.0" 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" />
<package id="Newtonsoft.Json" version="10.0.3" targetFramework="net471" />
<package id="Sitecore.Diagnostics.Base" version="2.1.4.203" targetFramework="net471" />
<package id="Sitecore.Diagnostics.Logging" version="2.1.4.203" targetFramework="net471" />
</packages>
8 changes: 4 additions & 4 deletions src/SIM.ContainerInstaller/SIM.ContainerInstaller.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,11 @@
<Reference Include="Newtonsoft.Json, Version=10.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.10.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
<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 Include="Sitecore.Diagnostics.Base, Version=2.1.4.203, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Sitecore.Diagnostics.Base.2.1.4.203\lib\Sitecore.Diagnostics.Base.dll</HintPath>
</Reference>
<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 Include="Sitecore.Diagnostics.Logging, Version=2.1.4.203, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Sitecore.Diagnostics.Logging.2.1.4.203\lib\Sitecore.Diagnostics.Logging.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
Expand Down
4 changes: 2 additions & 2 deletions src/SIM.ContainerInstaller/packages.config
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<packages>
<package id="JetBrains.Annotations" version="11.1.0" targetFramework="net471" />
<package id="Newtonsoft.Json" version="10.0.3" targetFramework="net471" />
<package id="Sitecore.Diagnostics.Base" version="2.0.1.171" targetFramework="net471" />
<package id="Sitecore.Diagnostics.Logging" version="2.0.1.171" targetFramework="net471" />
<package id="Sitecore.Diagnostics.Base" version="2.1.4.203" targetFramework="net471" />
<package id="Sitecore.Diagnostics.Logging" version="2.1.4.203" targetFramework="net471" />
<package id="YamlDotNet" version="8.1.2" targetFramework="net471" />
</packages>
45 changes: 25 additions & 20 deletions src/SIM.Core/SIM.Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@
<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="log4net, Version=2.0.8.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
<HintPath>..\packages\log4net.2.0.8\lib\net45-full\log4net.dll</HintPath>
<Reference Include="log4net, Version=2.0.12.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
<HintPath>..\packages\log4net.2.0.12\lib\net45\log4net.dll</HintPath>
</Reference>
<Reference Include="Microsoft.ApplicationInsights, Version=1.2.3.490, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.ApplicationInsights.1.2.3\lib\net45\Microsoft.ApplicationInsights.dll</HintPath>
Expand All @@ -51,6 +51,9 @@
<Reference Include="Microsoft.Extensions.Logging.Abstractions, Version=3.1.2.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Extensions.Logging.Abstractions.3.1.2\lib\netstandard2.0\Microsoft.Extensions.Logging.Abstractions.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Practices.EnterpriseLibrary.Common, Version=6.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\EnterpriseLibrary.Common.6.0.1304.0\lib\NET45\Microsoft.Practices.EnterpriseLibrary.Common.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Web.Administration, Version=7.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Web.Administration.7.0.0.0\lib\net20\Microsoft.Web.Administration.dll</HintPath>
<SpecificVersion>False</SpecificVersion>
Expand All @@ -59,37 +62,39 @@
<Reference Include="Newtonsoft.Json, Version=10.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.10.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
<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 Include="Sitecore.Diagnostics.Base, Version=2.1.4.203, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Sitecore.Diagnostics.Base.2.1.4.203\lib\Sitecore.Diagnostics.Base.dll</HintPath>
</Reference>
<Reference Include="Sitecore.Diagnostics.ConfigBuilder, Version=2.0.1.171, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Sitecore.Diagnostics.ConfigBuilder.2.0.1.171\lib\Sitecore.Diagnostics.ConfigBuilder.dll</HintPath>
<Reference Include="Sitecore.Diagnostics.ConfigBuilder, Version=2.1.4.203, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Sitecore.Diagnostics.ConfigBuilder.2.1.4.203\lib\Sitecore.Diagnostics.ConfigBuilder.dll</HintPath>
</Reference>
<Reference Include="Sitecore.Diagnostics.ConfigBuilder.Base, Version=2.0.1.171, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Sitecore.Diagnostics.ConfigBuilder.Base.2.0.1.171\lib\Sitecore.Diagnostics.ConfigBuilder.Base.dll</HintPath>
<Reference Include="Sitecore.Diagnostics.ConfigBuilder.Base, Version=2.1.4.203, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Sitecore.Diagnostics.ConfigBuilder.Base.2.1.4.203\lib\Sitecore.Diagnostics.ConfigBuilder.Base.dll</HintPath>
</Reference>
<Reference Include="Sitecore.Diagnostics.FileSystem, Version=2.0.1.171, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Sitecore.Diagnostics.FileSystem.2.0.1.171\lib\Sitecore.Diagnostics.FileSystem.dll</HintPath>
<Reference Include="Sitecore.Diagnostics.FileSystem, Version=2.1.4.203, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Sitecore.Diagnostics.FileSystem.2.1.4.203\lib\Sitecore.Diagnostics.FileSystem.dll</HintPath>
</Reference>
<Reference Include="Sitecore.Diagnostics.InfoService.Client.Core, Version=2.0.1.171, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Sitecore.Diagnostics.InfoService.Client.Core.2.0.1.171\lib\Sitecore.Diagnostics.InfoService.Client.Core.dll</HintPath>
<Reference Include="Sitecore.Diagnostics.InfoService.Client.Core, Version=2.1.4.203, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Sitecore.Diagnostics.InfoService.Client.Core.2.1.4.203\lib\Sitecore.Diagnostics.InfoService.Client.Core.dll</HintPath>
</Reference>
<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 Include="Sitecore.Diagnostics.Logging, Version=2.1.4.203, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Sitecore.Diagnostics.Logging.2.1.4.203\lib\Sitecore.Diagnostics.Logging.dll</HintPath>
</Reference>
<Reference Include="Sitecore.Diagnostics.Logging.Log4Net, Version=2.0.1.171, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Sitecore.Diagnostics.Logging.Log4Net.2.0.1.171\lib\Sitecore.Diagnostics.Logging.Log4Net.dll</HintPath>
<Reference Include="Sitecore.Diagnostics.Logging.Log4Net, Version=2.1.4.203, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Sitecore.Diagnostics.Logging.Log4Net.2.1.4.203\lib\Sitecore.Diagnostics.Logging.Log4Net.dll</HintPath>
</Reference>
<Reference Include="Sitecore.Diagnostics.Net, Version=2.0.1.171, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Sitecore.Diagnostics.Net.2.0.1.171\lib\Sitecore.Diagnostics.Net.dll</HintPath>
<Reference Include="Sitecore.Diagnostics.Net, Version=2.1.4.203, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Sitecore.Diagnostics.Net.2.1.4.203\lib\Sitecore.Diagnostics.Net.dll</HintPath>
</Reference>
<Reference Include="Sitecore.Diagnostics.Objects, Version=2.0.1.171, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Sitecore.Diagnostics.Objects.2.0.1.171\lib\Sitecore.Diagnostics.Objects.dll</HintPath>
<Reference Include="Sitecore.Diagnostics.Objects, Version=2.1.4.203, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Sitecore.Diagnostics.Objects.2.1.4.203\lib\Sitecore.Diagnostics.Objects.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Configuration" />
<Reference Include="System.Core" />
<Reference Include="System.Net" />
<Reference Include="System.Data" />
<Reference Include="System.Web" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
Expand Down
Loading

0 comments on commit 0429212

Please sign in to comment.