Skip to content

Commit

Permalink
Init
Browse files Browse the repository at this point in the history
  • Loading branch information
artem-chunikhin committed Jul 23, 2021
1 parent ecbf0aa commit 6e9f2c6
Show file tree
Hide file tree
Showing 8 changed files with 192 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
root = true

[*.{cs,sln,csproj,config,xml}]
indent_size = 4
indent_style = space
22 changes: 22 additions & 0 deletions src/Sitecore.Support.489284.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
VisualStudioVersion = 14.0.25123.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{0FBE0A89-F0FC-4B85-8722-ADDB76F9C575}") = "Sitecore.Support.489284", "Sitecore.Support.489284\Sitecore.Support.489284.csproj", "{BA10F3B3-D618-4087-AF3B-64AEEE8FE72C}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{BA10F3B3-D618-4087-AF3B-64AEEE8FE72C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{BA10F3B3-D618-4087-AF3B-64AEEE8FE72C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{BA10F3B3-D618-4087-AF3B-64AEEE8FE72C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{BA10F3B3-D618-4087-AF3B-64AEEE8FE72C}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/" xmlns:set="http://www.sitecore.net/xmlconfig/set/" xmlns:role="http://www.sitecore.net/xmlconfig/role/">
<sitecore role:require="Standalone OR ContentManagement OR ContentDelivery OR Processing OR Reporting">
</sitecore>
</configuration>
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
using System.Web;
using Microsoft.Extensions.DependencyInjection;
using Sitecore.DependencyInjection;
using Sitecore.Pipelines.HttpRequest;
using Sitecore.XA.Foundation.Abstractions;
using Sitecore.XA.Foundation.Multisite.Extensions;

namespace Sitecore.XA.Foundation.Multisite.Pipelines.HttpRequest
{
public class StoreSiteNameInCookie : HttpRequestProcessor
{
protected IContext Context { get; } = ServiceLocator.ServiceProvider.GetService<IContext>();

public override void Process(HttpRequestArgs args)
{
if (args.Context.Response.HeadersWritten)
{
return;
}
if (Context.Site != null && Context.Site.Name != "shell" && Context.Item != null)
{
var siteInfo = ServiceLocator.ServiceProvider.GetService<ISiteInfoResolver>().GetSiteInfo(Context.Item);
if (siteInfo != null)
{
args.Context.Response.Cookies.Add(new HttpCookie("sxa_site", siteInfo.Name));
}
}
}
}
}
6 changes: 6 additions & 0 deletions src/Sitecore.Support.489284/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
using System.Reflection;
using System.Runtime.InteropServices;

[assembly: AssemblyTitle("Sitecore.Support.489284")]
[assembly: AssemblyProduct("Sitecore.Support.489284")]
[assembly: ComVisible(false)]
112 changes: 112 additions & 0 deletions src/Sitecore.Support.489284/Sitecore.Support.489284.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>
</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{BA10F3B3-D618-4087-AF3B-64AEEE8FE72C}</ProjectGuid>
<ProjectTypeGuids>{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Sitecore.Support</RootNamespace>
<AssemblyName>Sitecore.Support.489284</AssemblyName>
<TargetFrameworkVersion>v4.6.2</TargetFrameworkVersion>
<UseIISExpress>true</UseIISExpress>
<IISExpressSSLPort />
<IISExpressAnonymousAuthentication />
<IISExpressWindowsAuthentication />
<IISExpressUseClassicPipelineMode />
<UseGlobalApplicationHostFile />
<TargetFrameworkProfile />
<LangVersion>6</LangVersion>
<Use64BitIISExpress />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="Microsoft.Extensions.DependencyInjection, Version=1.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
<HintPath>..\packages\SC.Microsoft.Extensions.DependencyInjection.9.0.1\lib\Microsoft.Extensions.DependencyInjection.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Microsoft.Extensions.DependencyInjection.Abstractions, Version=1.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
<HintPath>..\packages\SC.Microsoft.Extensions.DependencyInjection.Abstractions.9.0.1\lib\Microsoft.Extensions.DependencyInjection.Abstractions.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Sitecore.Kernel">
<HintPath>..\packages\SC.Sitecore.Kernel.9.0.1\lib\Sitecore.Kernel.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Sitecore.XA.Foundation.Abstractions, Version=3.7.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\SXA90.Sitecore.XA.Foundation.Abstractions.1.7.0\lib\Sitecore.XA.Foundation.Abstractions.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Sitecore.XA.Foundation.Common">
<HintPath>..\packages\SXA90.Sitecore.XA.Foundation.Common.1.7.0\lib\Sitecore.XA.Foundation.Common.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Sitecore.XA.Foundation.Multisite, Version=3.7.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\SXA90.Sitecore.XA.Foundation.Multisite.1.7.0\lib\Sitecore.XA.Foundation.Multisite.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="System" />
<Reference Include="System.Drawing" />
<Reference Include="System.Web" />
<Reference Include="System.Xml" />
<Reference Include="System.Configuration" />
</ItemGroup>
<ItemGroup>
<Compile Include="Pipelines\HttpRequest\StoreSiteNameInCookie.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<Content Include="App_Config\Include\zzz\Sitecore.Support.489284.config" />
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
<None Include="web.config" />
</ItemGroup>
<ItemGroup />
<PropertyGroup>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
</PropertyGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<Import Project="$(VSToolsPath)\WebApplications\Microsoft.WebApplication.targets" Condition="'$(VSToolsPath)' != ''" />
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" Condition="false" />
<ProjectExtensions>
<VisualStudio>
<FlavorProperties GUID="{349c5851-65df-11da-9384-00065b846f21}">
<WebProjectProperties>
<UseIIS>True</UseIIS>
<AutoAssignPort>True</AutoAssignPort>
<DevelopmentServerPort>0</DevelopmentServerPort>
<DevelopmentServerVPath>/</DevelopmentServerVPath>
<IISUrl>http://localhost:54514/</IISUrl>
<NTLMAuthentication>False</NTLMAuthentication>
<UseCustomServer>False</UseCustomServer>
<CustomServerUrl>
</CustomServerUrl>
<SaveServerSettingsInUserFile>False</SaveServerSettingsInUserFile>
</WebProjectProperties>
</FlavorProperties>
</VisualStudio>
</ProjectExtensions>
</Project>
9 changes: 9 additions & 0 deletions src/Sitecore.Support.489284/packages.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="SC.Microsoft.Extensions.DependencyInjection" version="9.0.1" targetFramework="net462" />
<package id="SC.Microsoft.Extensions.DependencyInjection.Abstractions" version="9.0.1" targetFramework="net462" />
<package id="SC.Sitecore.Kernel" version="9.0.1" targetFramework="net462" />
<package id="SXA90.Sitecore.XA.Foundation.Abstractions" version="1.7.0" targetFramework="net462" />
<package id="SXA90.Sitecore.XA.Foundation.Common" version="1.7.0" targetFramework="net462" />
<package id="SXA90.Sitecore.XA.Foundation.Multisite" version="1.7.0" targetFramework="net462" />
</packages>
4 changes: 4 additions & 0 deletions src/Sitecore.Support.489284/web.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<!-- Do not change this file - it must be empty, see https://github.com/SitecoreSupport/PatchCreator/issues/13 -->
</configuration>

0 comments on commit 6e9f2c6

Please sign in to comment.