From b0ee1a63e916265a03fd58ddb98a93f679b6e1f8 Mon Sep 17 00:00:00 2001 From: Chris Smith Date: Fri, 5 Aug 2016 13:41:43 -0400 Subject: [PATCH 1/8] Fixing issue related to salt-to-byte conversion --- .../Cryptography/AesHmacCryptoService.cs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/Jabberwocky.Core/Cryptography/AesHmacCryptoService.cs b/Jabberwocky.Core/Cryptography/AesHmacCryptoService.cs index 219bdde..f777314 100644 --- a/Jabberwocky.Core/Cryptography/AesHmacCryptoService.cs +++ b/Jabberwocky.Core/Cryptography/AesHmacCryptoService.cs @@ -45,6 +45,7 @@ public static AesHmacCryptoService Create(string secretKey, string digestKey, st public AesHmacCryptoService(CryptoConfiguration config, ISerializationProvider serializationProvider) { if (serializationProvider == null) throw new ArgumentNullException(nameof(serializationProvider)); + if (!IsCryptoConfigurationValid(config)) throw new ArgumentException("All configuration properties must be valid.", nameof(config)); SerializationProvider = serializationProvider; _lazyDerivedBytes = new Lazy(() => GenerateDerivedBytes(config)); @@ -147,7 +148,9 @@ protected virtual byte[] ComputeHash(byte[] content) private static KeySaltPair GenerateDerivedBytes(CryptoConfiguration config) { var saltBytes = new byte[SaltSize]; - Encoding.UTF8.GetBytes(config.InitializationVector, 0, config.InitializationVector.Length, saltBytes, 0); + var charSizeInBytes = sizeof(char); + var characterCount = Math.Min(SaltSize / charSizeInBytes, config.InitializationVector.Length); + Encoding.UTF8.GetBytes(config.InitializationVector, 0, characterCount, saltBytes, 0); using (var derivePassword = new Rfc2898DeriveBytes(config.SecretKey, saltBytes)) { @@ -163,6 +166,13 @@ private static KeySaltPair GenerateDerivedBytes(CryptoConfiguration config) } } + private static bool IsCryptoConfigurationValid(CryptoConfiguration config) + { + return !string.IsNullOrEmpty(config.DigestKey) + && !string.IsNullOrEmpty(config.InitializationVector) + && !string.IsNullOrEmpty(config.SecretKey); + } + #endregion protected struct KeySaltPair From 7be1bdc6c709ce39472c68b0fdfd9dd15c8671c0 Mon Sep 17 00:00:00 2001 From: Chris Smith Date: Fri, 5 Aug 2016 14:17:21 -0400 Subject: [PATCH 2/8] Fixing generated nonce length in AesHmacCryptoService being too long --- .../Cryptography/AesHmacCryptoService.cs | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/Jabberwocky.Core/Cryptography/AesHmacCryptoService.cs b/Jabberwocky.Core/Cryptography/AesHmacCryptoService.cs index f777314..8316f19 100644 --- a/Jabberwocky.Core/Cryptography/AesHmacCryptoService.cs +++ b/Jabberwocky.Core/Cryptography/AesHmacCryptoService.cs @@ -18,15 +18,15 @@ public class AesHmacCryptoService : IHmacCryptoService protected ISerializationProvider SerializationProvider { get; } /// - /// Symmetric Key size for 256-bit cipher + /// Symmetric Key size for 256-bit cipher (in bytes) /// private const int KeySize = 32; /// - /// AES cipher block-size + /// AES cipher block-size (in bytes) /// - private const int BlockSize = 128; + private const int BlockSize = 16; /// - /// Initialization Vector size + /// Initialization Vector size (in bytes) /// private const int SaltSize = 16; @@ -123,9 +123,11 @@ protected virtual byte[] GenerateNonce() protected virtual byte[] CryptContent(byte[] contentBytes, Func cryptorFunc) { + const int blockSizeInBits = BlockSize * 8; + using (var aes = new RijndaelManaged()) { - aes.BlockSize = BlockSize; + aes.BlockSize = blockSizeInBits; aes.Mode = CipherMode.CBC; aes.Key = SymmetricKey; aes.IV = Salt; From 40cc5813155ab959d43928427ccc54f971bee07e Mon Sep 17 00:00:00 2001 From: Chris Smith Date: Fri, 2 Sep 2016 15:46:28 -0400 Subject: [PATCH 3/8] Adding support for nested interface definitions for the Glass Interface Factory --- .../Factory/GlassInterfaceFactoryTests.cs | 44 ++++++++++++++++++- .../Interceptors/FallbackInterceptor.cs | 35 +++++++++++---- 2 files changed, 69 insertions(+), 10 deletions(-) diff --git a/Jabberwocky.Glass.Tests/Factory/GlassInterfaceFactoryTests.cs b/Jabberwocky.Glass.Tests/Factory/GlassInterfaceFactoryTests.cs index 332a903..0365370 100644 --- a/Jabberwocky.Glass.Tests/Factory/GlassInterfaceFactoryTests.cs +++ b/Jabberwocky.Glass.Tests/Factory/GlassInterfaceFactoryTests.cs @@ -76,6 +76,26 @@ public void Initialize() ZIndex = 0 } } + }, + { + typeof(INestedTestInterface), new[] + { + new GlassInterfaceMetadata + { + GlassType = typeof (IIntermediateTemplate), + ImplementationType = typeof(IIntermediateTemplateModel), + IsFallback = false, + ZIndex = 0 + }, + // Base Type, matches no direct template + new GlassInterfaceMetadata + { + GlassType = typeof (IBaseType), + ImplementationType = typeof (IBaseTypeModel), + IsFallback = true, + ZIndex = 0 + }, + } } }; @@ -289,6 +309,20 @@ public void GlassFactory_ZIndexBehavior_WillHigherPriorityImplementation() Assert.AreEqual("IInheritedTemplateModel", testItem.ZIndexTest); // Should fallback to IInheritedTemplateModel -> BaseType } + [Test] + public void GlassFactory_FallbackBehavior_WorksWithNestedInterfaces() + { + + var mockItem = Substitute.For(); + mockItem._Id = Guid.NewGuid(); + mockItem._TemplateId.Returns(new Guid(FakeIntermediateTemplate)); // matching template + mockItem._BaseTemplates.Returns(new Guid[0]); + + var testItem = _glassFactory.GetItem(mockItem); + Assert.IsNotNull(testItem); + Assert.AreEqual("IBaseTypeModel", testItem.ZIndexTest); // Should fallback to IIntermediateTemplateModel -> BaseType + } + private ITestInterface GetItemWithFallback() { var mockItem = Substitute.For(); @@ -350,6 +384,12 @@ private interface ITestInterface string ZIndexTest { get; } } + [GlassFactoryInterface] + private interface INestedTestInterface : ITestInterface + { + + } + [GlassFactoryType(typeof (IInheritedTemplate), ZIndex = 1)] public abstract class IInheritedTemplateModel : ITestInterface { @@ -415,7 +455,7 @@ public object DontCallMe() } [GlassFactoryType(typeof (IBaseType))] - public abstract class IBaseTypeModel : ITestInterface + public abstract class IBaseTypeModel : ITestInterface, INestedTestInterface { private readonly IBaseType _innerItem; protected IBaseTypeModel(IBaseType innerItem) @@ -452,7 +492,7 @@ public object DontCallMe() } [GlassFactoryType(typeof(IIntermediateTemplate))] - public abstract class IIntermediateTemplateModel : ITestInterface + public abstract class IIntermediateTemplateModel : INestedTestInterface { public abstract bool IsNotFallback { get; } public abstract bool IsFallback { get; } diff --git a/Jabberwocky.Glass/Factory/Interceptors/FallbackInterceptor.cs b/Jabberwocky.Glass/Factory/Interceptors/FallbackInterceptor.cs index 25391d4..b30d8a2 100644 --- a/Jabberwocky.Glass/Factory/Interceptors/FallbackInterceptor.cs +++ b/Jabberwocky.Glass/Factory/Interceptors/FallbackInterceptor.cs @@ -1,7 +1,9 @@ using System; +using System.Linq; using System.Reflection; using Castle.DynamicProxy; using Glass.Mapper.Sc.Configuration.Attributes; +using Jabberwocky.Core.Utils.Extensions; using Jabberwocky.Glass.Factory.Attributes; using Jabberwocky.Glass.Factory.Caching; using Jabberwocky.Glass.Factory.Implementation; @@ -78,17 +80,34 @@ private void ResolveInvocation(IInvocation invocation, GlassFactoryTypeAttribute ? invocationTarget.GetGenericMethodDefinition() : invocationTarget; - var map = invocation.TargetType.GetInterfaceMap(_interfaceType); - var index = Array.IndexOf(map.TargetMethods, targetMethod); + var fallbackMethod = GetFallbackInterfaceMethod(invocation, _interfaceType, invocationTarget, targetMethod); + if (fallbackMethod != null) + { + invocation.ReturnValue = fallbackMethod.Invoke(fallbackImpl, invocation.Arguments); + } + } - if (index == -1) return; + private static MethodInfo GetFallbackInterfaceMethod(IInvocation invocation, Type targetInterfaceType, + MethodInfo invocationTarget, MethodInfo targetMethod) + { + var interfaceCandidates = new[] { targetInterfaceType }.Concat(targetInterfaceType.GetInterfaces()); - MethodInfo interfaceMethod = map.InterfaceMethods[index]; - interfaceMethod = interfaceMethod.IsGenericMethod - ? interfaceMethod.MakeGenericMethod(invocationTarget.GetGenericArguments()) - : interfaceMethod; + foreach (var interfaceType in interfaceCandidates) + { + var map = invocation.TargetType.GetInterfaceMap(interfaceType); + var index = Array.IndexOf(map.TargetMethods, targetMethod); + + if (index == -1) continue; + + MethodInfo interfaceMethod = map.InterfaceMethods[index]; + interfaceMethod = interfaceMethod.IsGenericMethod + ? interfaceMethod.MakeGenericMethod(invocationTarget.GetGenericArguments()) + : interfaceMethod; + + return interfaceMethod; + } - invocation.ReturnValue = interfaceMethod.Invoke(fallbackImpl, invocation.Arguments); + return null; } } } From bb5bcb8320359fc671f1bc34114fdcb190c36a0a Mon Sep 17 00:00:00 2001 From: Kevin Mazzoni Date: Fri, 24 Jun 2016 12:02:01 -0400 Subject: [PATCH 4/8] Refactoring Jabberwocky.Glass.Autofac.Mvc into two separate projects. Created Jabberwocky.Glass.Mvc and Jabberwocky.Glass.Mvc.Tests projects. Moved, MVC code with no Autofac dependencies to new projects. --- ...Jabberwocky.Glass.Autofac.Mvc.Tests.csproj | 26 +- .../Factory/AutofacViewModelFactoryTests.cs | 2 +- .../Extensions/MvcRegistrationExtensions.cs | 3 +- .../Jabberwocky.Glass.Autofac.Mvc.csproj | 12 +- .../Models/Factory/AutofacViewModelFactory.cs | 3 +- .../Models/GlassViewModel.cs | 11 +- .../Models/InjectableGlassViewModelBase.cs | 4 +- .../Processors/GetModelFromViewProcessor.cs | 2 +- .../Pipelines/Processors/GetModelProcessor.cs | 2 +- .../Services/IRenderingContextService.cs | 24 - Jabberwocky.Glass.Mvc.Tests/Class1.cs | 12 + .../Fakes/Sitecore.Kernel.fakes | Bin .../Sitecore.Kernel.7.0.0.0.Fakes.dll | Bin 0 -> 37376 bytes .../Sitecore.Kernel.7.0.0.0.Fakes.fakesconfig | Bin 0 -> 54 bytes .../Sitecore.Kernel.7.0.0.0.Fakes.xml | 653 ++++++++++++++++++ .../Jabberwocky.Glass.Mvc.Tests.csproj | 117 ++++ .../Properties/AssemblyInfo.cs | 36 + .../Services/RenderingContextServiceTests.cs | 6 +- Jabberwocky.Glass.Mvc.Tests/app.config | 11 + Jabberwocky.Glass.Mvc.Tests/packages.config | 7 + .../HttpGetOrInvalidHttpPostAttribute.cs | 4 +- .../Attributes/ValidHttpPostAttribute.cs | 2 +- .../ValidateFormHandlerAttribute.cs | 2 +- .../Jabberwocky.Glass.Mvc.csproj | 122 ++++ .../Models/Factory/IViewModelFactory.cs | 4 +- .../Properties/AssemblyInfo.cs | 36 + .../Services/DatasourceNestingOptions.cs | 9 + .../Services/IRenderingContextService.cs | 17 + .../Services/RenderingContextService.cs | 8 +- .../Util/CustomSitecoreHelper.cs | 6 +- .../Views/CustomGlassView.cs | 6 +- Jabberwocky.Glass.Mvc/app.config | 11 + Jabberwocky.Glass.Mvc/packages.config | 9 + .../Jabberwocky.Glass.Tests.csproj | 7 + Jabberwocky.sln | 14 + 35 files changed, 1104 insertions(+), 84 deletions(-) delete mode 100644 Jabberwocky.Glass.Autofac.Mvc/Services/IRenderingContextService.cs create mode 100644 Jabberwocky.Glass.Mvc.Tests/Class1.cs rename {Jabberwocky.Glass.Autofac.Mvc.Tests => Jabberwocky.Glass.Mvc.Tests}/Fakes/Sitecore.Kernel.fakes (100%) create mode 100644 Jabberwocky.Glass.Mvc.Tests/FakesAssemblies/Sitecore.Kernel.7.0.0.0.Fakes.dll create mode 100644 Jabberwocky.Glass.Mvc.Tests/FakesAssemblies/Sitecore.Kernel.7.0.0.0.Fakes.fakesconfig create mode 100644 Jabberwocky.Glass.Mvc.Tests/FakesAssemblies/Sitecore.Kernel.7.0.0.0.Fakes.xml create mode 100644 Jabberwocky.Glass.Mvc.Tests/Jabberwocky.Glass.Mvc.Tests.csproj create mode 100644 Jabberwocky.Glass.Mvc.Tests/Properties/AssemblyInfo.cs rename {Jabberwocky.Glass.Autofac.Mvc.Tests => Jabberwocky.Glass.Mvc.Tests}/Services/RenderingContextServiceTests.cs (98%) create mode 100644 Jabberwocky.Glass.Mvc.Tests/app.config create mode 100644 Jabberwocky.Glass.Mvc.Tests/packages.config rename {Jabberwocky.Glass.Autofac.Mvc => Jabberwocky.Glass.Mvc}/Attributes/HttpGetOrInvalidHttpPostAttribute.cs (91%) rename {Jabberwocky.Glass.Autofac.Mvc => Jabberwocky.Glass.Mvc}/Attributes/ValidHttpPostAttribute.cs (92%) rename {Jabberwocky.Glass.Autofac.Mvc => Jabberwocky.Glass.Mvc}/Attributes/ValidateFormHandlerAttribute.cs (95%) create mode 100644 Jabberwocky.Glass.Mvc/Jabberwocky.Glass.Mvc.csproj rename {Jabberwocky.Glass.Autofac.Mvc => Jabberwocky.Glass.Mvc}/Models/Factory/IViewModelFactory.cs (63%) create mode 100644 Jabberwocky.Glass.Mvc/Properties/AssemblyInfo.cs create mode 100644 Jabberwocky.Glass.Mvc/Services/DatasourceNestingOptions.cs create mode 100644 Jabberwocky.Glass.Mvc/Services/IRenderingContextService.cs rename {Jabberwocky.Glass.Autofac.Mvc => Jabberwocky.Glass.Mvc}/Services/RenderingContextService.cs (98%) rename {Jabberwocky.Glass.Autofac.Mvc => Jabberwocky.Glass.Mvc}/Util/CustomSitecoreHelper.cs (88%) rename {Jabberwocky.Glass.Autofac.Mvc => Jabberwocky.Glass.Mvc}/Views/CustomGlassView.cs (85%) create mode 100644 Jabberwocky.Glass.Mvc/app.config create mode 100644 Jabberwocky.Glass.Mvc/packages.config diff --git a/Jabberwocky.Glass.Autofac.Mvc.Tests/Jabberwocky.Glass.Autofac.Mvc.Tests.csproj b/Jabberwocky.Glass.Autofac.Mvc.Tests/Jabberwocky.Glass.Autofac.Mvc.Tests.csproj index fa180c0..18d3df2 100644 --- a/Jabberwocky.Glass.Autofac.Mvc.Tests/Jabberwocky.Glass.Autofac.Mvc.Tests.csproj +++ b/Jabberwocky.Glass.Autofac.Mvc.Tests/Jabberwocky.Glass.Autofac.Mvc.Tests.csproj @@ -51,19 +51,7 @@ False ..\packages\Glass.Mapper.Sc.4.0.3.51\lib\72\Glass.Mapper.Sc.dll - - ..\lib\Sitecore\Testing\HtmlAgilityPack.dll - - - ..\lib\Sitecore\Testing\ITHit.WebDAV.Server.dll - - - ..\lib\Sitecore\Testing\Lucene.Net.dll - - - False - ..\lib\Sitecore\Testing\Mvp.Xml.dll @@ -79,13 +67,6 @@ False ..\lib\Sitecore\Sitecore.Kernel.dll - - FakesAssemblies\Sitecore.Kernel.7.0.0.0.Fakes.dll - - - False - ..\lib\Sitecore\Testing\Sitecore.Logging.dll - False ..\lib\Sitecore\Sitecore.Mvc.dll @@ -103,11 +84,9 @@ - - @@ -119,11 +98,16 @@ {5EAD110F-F074-47E4-8B93-C0EECB9FC27A} Jabberwocky.Glass.Autofac.Mvc + + {dd17db22-247c-44a6-b0dd-091786863626} + Jabberwocky.Glass.Mvc + {13E08D30-B2A4-45EF-A28E-C916EB80B70D} Jabberwocky.Glass + diff --git a/Jabberwocky.Glass.Autofac.Mvc.Tests/Models/Factory/AutofacViewModelFactoryTests.cs b/Jabberwocky.Glass.Autofac.Mvc.Tests/Models/Factory/AutofacViewModelFactoryTests.cs index 9517c57..c96d898 100644 --- a/Jabberwocky.Glass.Autofac.Mvc.Tests/Models/Factory/AutofacViewModelFactoryTests.cs +++ b/Jabberwocky.Glass.Autofac.Mvc.Tests/Models/Factory/AutofacViewModelFactoryTests.cs @@ -3,8 +3,8 @@ using Jabberwocky.Glass.Autofac.Mvc.Models; using Jabberwocky.Glass.Autofac.Mvc.Models.Attributes; using Jabberwocky.Glass.Autofac.Mvc.Models.Factory; -using Jabberwocky.Glass.Autofac.Mvc.Services; using Jabberwocky.Glass.Models; +using Jabberwocky.Glass.Mvc.Services; using NSubstitute; using NUnit.Framework; using Sitecore.Mvc.Presentation; diff --git a/Jabberwocky.Glass.Autofac.Mvc/Extensions/MvcRegistrationExtensions.cs b/Jabberwocky.Glass.Autofac.Mvc/Extensions/MvcRegistrationExtensions.cs index e8605e7..b048a71 100644 --- a/Jabberwocky.Glass.Autofac.Mvc/Extensions/MvcRegistrationExtensions.cs +++ b/Jabberwocky.Glass.Autofac.Mvc/Extensions/MvcRegistrationExtensions.cs @@ -5,7 +5,8 @@ using Glass.Mapper.Sc.ModelCache; using Jabberwocky.Glass.Autofac.Mvc.Models; using Jabberwocky.Glass.Autofac.Mvc.Models.Factory; -using Jabberwocky.Glass.Autofac.Mvc.Services; +using Jabberwocky.Glass.Mvc.Models.Factory; +using Jabberwocky.Glass.Mvc.Services; namespace Jabberwocky.Glass.Autofac.Mvc.Extensions { diff --git a/Jabberwocky.Glass.Autofac.Mvc/Jabberwocky.Glass.Autofac.Mvc.csproj b/Jabberwocky.Glass.Autofac.Mvc/Jabberwocky.Glass.Autofac.Mvc.csproj index 6c26c35..db9ee74 100644 --- a/Jabberwocky.Glass.Autofac.Mvc/Jabberwocky.Glass.Autofac.Mvc.csproj +++ b/Jabberwocky.Glass.Autofac.Mvc/Jabberwocky.Glass.Autofac.Mvc.csproj @@ -99,14 +99,10 @@ - - - - @@ -114,10 +110,6 @@ - - - - @@ -130,6 +122,10 @@ {EA620F62-8D08-4031-BAC4-1C60D5C5CBC9} Jabberwocky.Glass.Autofac + + {dd17db22-247c-44a6-b0dd-091786863626} + Jabberwocky.Glass.Mvc + {13E08D30-B2A4-45EF-A28E-C916EB80B70D} Jabberwocky.Glass diff --git a/Jabberwocky.Glass.Autofac.Mvc/Models/Factory/AutofacViewModelFactory.cs b/Jabberwocky.Glass.Autofac.Mvc/Models/Factory/AutofacViewModelFactory.cs index 2d8bb51..63eb9c1 100644 --- a/Jabberwocky.Glass.Autofac.Mvc/Models/Factory/AutofacViewModelFactory.cs +++ b/Jabberwocky.Glass.Autofac.Mvc/Models/Factory/AutofacViewModelFactory.cs @@ -5,8 +5,9 @@ using Autofac; using Autofac.Core; using Jabberwocky.Glass.Autofac.Mvc.Models.Attributes; -using Jabberwocky.Glass.Autofac.Mvc.Services; using Jabberwocky.Glass.Models; +using Jabberwocky.Glass.Mvc.Models.Factory; +using Jabberwocky.Glass.Mvc.Services; namespace Jabberwocky.Glass.Autofac.Mvc.Models.Factory { diff --git a/Jabberwocky.Glass.Autofac.Mvc/Models/GlassViewModel.cs b/Jabberwocky.Glass.Autofac.Mvc/Models/GlassViewModel.cs index 2b54f28..d29a661 100644 --- a/Jabberwocky.Glass.Autofac.Mvc/Models/GlassViewModel.cs +++ b/Jabberwocky.Glass.Autofac.Mvc/Models/GlassViewModel.cs @@ -1,4 +1,5 @@ using Jabberwocky.Glass.Models; +using Jabberwocky.Glass.Mvc.Models; namespace Jabberwocky.Glass.Autofac.Mvc.Models { @@ -7,9 +8,9 @@ public abstract class GlassViewModel : InjectableGlassViewModelBase public virtual TGlassModel GlassModel => InternalDatasourceModel as TGlassModel; } - public abstract class GlassViewModel : GlassViewModel - where TDatasource : class, IGlassBase where TRenderingParameter : class - { - public virtual TRenderingParameter RenderingParameters => InternalRenderingParameterModel as TRenderingParameter; - } + public abstract class GlassViewModel : GlassViewModel + where TDatasource : class, IGlassBase where TRenderingParameter : class + { + public virtual TRenderingParameter RenderingParameters => InternalRenderingParameterModel as TRenderingParameter; + } } diff --git a/Jabberwocky.Glass.Autofac.Mvc/Models/InjectableGlassViewModelBase.cs b/Jabberwocky.Glass.Autofac.Mvc/Models/InjectableGlassViewModelBase.cs index de38c10..4cfa1d8 100644 --- a/Jabberwocky.Glass.Autofac.Mvc/Models/InjectableGlassViewModelBase.cs +++ b/Jabberwocky.Glass.Autofac.Mvc/Models/InjectableGlassViewModelBase.cs @@ -1,9 +1,9 @@ -namespace Jabberwocky.Glass.Autofac.Mvc.Models +namespace Jabberwocky.Glass.Autofac.Mvc.Models { public abstract class InjectableGlassViewModelBase { internal object InternalDatasourceModel; - internal object InternalRenderingParameterModel; + internal object InternalRenderingParameterModel; } } diff --git a/Jabberwocky.Glass.Autofac.Mvc/Pipelines/Processors/GetModelFromViewProcessor.cs b/Jabberwocky.Glass.Autofac.Mvc/Pipelines/Processors/GetModelFromViewProcessor.cs index a6fda69..8f793c1 100644 --- a/Jabberwocky.Glass.Autofac.Mvc/Pipelines/Processors/GetModelFromViewProcessor.cs +++ b/Jabberwocky.Glass.Autofac.Mvc/Pipelines/Processors/GetModelFromViewProcessor.cs @@ -6,7 +6,7 @@ using Sitecore.Diagnostics; using Sitecore.Mvc.Pipelines.Response.GetModel; using Glass.Mapper; -using Jabberwocky.Glass.Autofac.Mvc.Models.Factory; +using Jabberwocky.Glass.Mvc.Models.Factory; using Sitecore.Data.Items; namespace Jabberwocky.Glass.Autofac.Mvc.Pipelines.Processors diff --git a/Jabberwocky.Glass.Autofac.Mvc/Pipelines/Processors/GetModelProcessor.cs b/Jabberwocky.Glass.Autofac.Mvc/Pipelines/Processors/GetModelProcessor.cs index d7d9d0c..61b6208 100644 --- a/Jabberwocky.Glass.Autofac.Mvc/Pipelines/Processors/GetModelProcessor.cs +++ b/Jabberwocky.Glass.Autofac.Mvc/Pipelines/Processors/GetModelProcessor.cs @@ -1,7 +1,7 @@ using System; using Glass.Mapper.Sc.Configuration.Attributes; -using Jabberwocky.Glass.Autofac.Mvc.Models.Factory; using Jabberwocky.Glass.Autofac.Pipelines.Processors; +using Jabberwocky.Glass.Mvc.Models.Factory; using Sitecore.Data; using Sitecore.Data.Items; using Sitecore.Mvc.Configuration; diff --git a/Jabberwocky.Glass.Autofac.Mvc/Services/IRenderingContextService.cs b/Jabberwocky.Glass.Autofac.Mvc/Services/IRenderingContextService.cs deleted file mode 100644 index e8f100c..0000000 --- a/Jabberwocky.Glass.Autofac.Mvc/Services/IRenderingContextService.cs +++ /dev/null @@ -1,24 +0,0 @@ -using System; -using Jabberwocky.Glass.Models; -using Sitecore.Mvc.Presentation; - -namespace Jabberwocky.Glass.Autofac.Mvc.Services -{ - public interface IRenderingContextService - { - Rendering GetCurrentRendering(); - - T GetCurrentRenderingDatasource(DatasourceNestingOptions options = DatasourceNestingOptions.Default) where T : class, IGlassBase; - - T GetCurrentRenderingParameters() where T : class; - - object GetCurrentRenderingParameters(Type renderingParamType); - } - - public enum DatasourceNestingOptions - { - Default, - Never, - Always - } -} diff --git a/Jabberwocky.Glass.Mvc.Tests/Class1.cs b/Jabberwocky.Glass.Mvc.Tests/Class1.cs new file mode 100644 index 0000000..6423e81 --- /dev/null +++ b/Jabberwocky.Glass.Mvc.Tests/Class1.cs @@ -0,0 +1,12 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Jabberwocky.Glass.Mvc.Tests +{ + public class Class1 + { + } +} diff --git a/Jabberwocky.Glass.Autofac.Mvc.Tests/Fakes/Sitecore.Kernel.fakes b/Jabberwocky.Glass.Mvc.Tests/Fakes/Sitecore.Kernel.fakes similarity index 100% rename from Jabberwocky.Glass.Autofac.Mvc.Tests/Fakes/Sitecore.Kernel.fakes rename to Jabberwocky.Glass.Mvc.Tests/Fakes/Sitecore.Kernel.fakes diff --git a/Jabberwocky.Glass.Mvc.Tests/FakesAssemblies/Sitecore.Kernel.7.0.0.0.Fakes.dll b/Jabberwocky.Glass.Mvc.Tests/FakesAssemblies/Sitecore.Kernel.7.0.0.0.Fakes.dll new file mode 100644 index 0000000000000000000000000000000000000000..cfe165fc2504f918f5a92600be5a25d2ea4bf2e8 GIT binary patch literal 37376 zcmeHv34D~*)%SU3pUKRGtR$?XsGwq4L~%nB5|#*IOF$HmOp*}>l1!MHC=o1^QgOw) zfm*c&ck62vcVDptty``8R%?9?Z(r?etG0gDF8Zq9|J-|@Ei;4Ee!uVc{eEAg^PhXp zz31F>&pmgU``m|y(=Q_@5xMaB<{P3%@XdeK0{0IYWQRxpdzc>Zzi`ka+PoJIYFZOd zMY@uS)yZf_q&3>vnMg-kVv%HbXC&Sksawz(=}5H2szRZ_AxibanMCt6C(T{hajIV1 z0394D&?XXH1dc~?Ke!X$5q$dbAsQmm4rw`p(e3t!+Keo+5ZhB-s z(JiM5FADxY3Zoq3iiiS79PDt8E9S)0&T;6GBVR@zXyZ!3af~YiCc*4_xk6`_Z!6?v zIZIHc6u_pcWn^xgC# zyrhS2%4x6ryXqa8t=C7@%D)cNi^{OJ|jYQ{(?#0l{ZtzOh710Y@ zyB7iB%_XssB@W6XfuWRL$2Ob2);g-jq4NXd!k8D1s2Yb3Q|VL8);h+)-+{x9IKz2V zL2@TFrQoN)IS5-n>T+=0269z;4_9i0fVEOc6y%b4iX{%s)iCq{$NI^tFP!5rdb6AP zo~@Zf^;kDF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agT2`j6ho9~z5UrG>d zmAuI0a{U5RE1o5uDysOfN+YfwK#B6o$ zK59VC{8xuj!0&_eogH0vu(zeJBPbKY-Ki?{&m{PLBHnYKO#IKz9*5t){I)vZBIUa! hd_SoNrE=*p{VS^fzYBfxP2K;-m5+b@{r~5I{|%(zaJ~Ql literal 0 HcmV?d00001 diff --git a/Jabberwocky.Glass.Mvc.Tests/FakesAssemblies/Sitecore.Kernel.7.0.0.0.Fakes.fakesconfig b/Jabberwocky.Glass.Mvc.Tests/FakesAssemblies/Sitecore.Kernel.7.0.0.0.Fakes.fakesconfig new file mode 100644 index 0000000000000000000000000000000000000000..8bae71b464271bc6c83b448cb05e92df03ac367c GIT binary patch literal 54 tcmezWFPI^dp@booA( + + + Sitecore.Kernel.7.0.0.0.Fakes + + + +

Shim type of Sitecore.Data.Items.Item + + + Initializes a new shim instance + + + Initializes a new shim for the given instance + + + Sets the shim of Item.get_Access() + + + Sets the shim of Item.Add(String name, BranchId branchId) + + + Sets the shim of Item.Add(String name, BranchItem branch) + + + Sets the shim of Item.Add(String name, TemplateID templateID) + + + Sets the shim of Item.Add(String name, TemplateItem template) + + + Sets the shim of Item.AddToItemCloningRelationsCache(Item item, ItemUri uri) + + + Define shims for all instances members + + + Sets the shim of Item.get_Access() + + + Sets the shim of Item.Add(String name, BranchId branchId) + + + Sets the shim of Item.Add(String name, BranchItem branch) + + + Sets the shim of Item.Add(String name, TemplateID templateID) + + + Sets the shim of Item.Add(String name, TemplateItem template) + + + Sets the shim of Item.get_Appearance() + + + Sets the shim of Item.get_Axes() + + + Sets the shim of Item.BeginEdit() + + + Sets the shim of Item.get_Branch() + + + Sets the shim of Item.get_BranchId() + + + Sets the shim of Item.set_BranchId(ID value) + + + Sets the shim of Item.get_Branches() + + + Sets the shim of Item.ChangeTemplate(TemplateItem template) + + + Sets the shim of Item.get_Children() + + + Sets the shim of Item.Clone(ID cloneID, Database ownerDatabase) + + + Sets the shim of Item.Clone(Item item) + + + Sets the shim of Item.CloneTo(Item destination) + + + Sets the shim of Item.CloneTo(Item destination, Boolean deep) + + + Sets the shim of Item.CloneTo(Item destination, String name, Boolean deep) + + + Sets the shim of Item.CopyTo(Item destination, String copyName) + + + Sets the shim of Item.CopyTo(Item destination, String copyName, ID copyID, Boolean deep) + + + Sets the shim of Item.get_Database() + + + Sets the shim of Item.Delete() + + + Sets the shim of Item.Delete(Boolean removeBlobs) + + + Sets the shim of Item.DeleteChildren() + + + Sets the shim of Item.get_DisplayName() + + + Sets the shim of Item.Duplicate() + + + Sets the shim of Item.Duplicate(String copyName) + + + Sets the shim of Item.get_Editing() + + + Sets the shim of Item.get_Empty() + + + Sets the shim of Item.EndEdit() + + + Sets the shim of Item.get_Fields() + + + Sets the shim of Item.GetChanges(Boolean force) + + + Sets the shim of Item.GetChildren() + + + Sets the shim of Item.GetChildren(ChildListOptions options) + + + Sets the shim of Item.GetClones() + + + Sets the shim of Item.GetClones(Boolean processChildren) + + + Sets the shim of Item.GetFullChanges() + + + Sets the shim of Item.GetOuterXml(Boolean includeSubitems) + + + Sets the shim of Item.GetOuterXml(ItemSerializerOptions options) + + + Sets the shim of Item.GetProperty(String name) + + + Sets the shim of Item.GetUniqueId() + + + Sets the shim of Item.get_HasChildren() + + + Sets the shim of Item.get_HasClones() + + + Sets the shim of Item.get_Help() + + + Sets the shim of Item.get_ID() + + + Sets the shim of Item.get_InnerData() + + + Sets the shim of Item.get_IsClone() + + + Sets the shim of Item.get_IsEditing() + + + Sets the shim of Item.get_IsItemClone() + + + Sets the shim of Item.get_Key() + + + Sets the shim of Item.get_Language() + + + Sets the shim of Item.get_Languages() + + + Sets the shim of Item.get_Links() + + + Sets the shim of Item.get_Locking() + + + Sets the shim of Item.get_Master() + + + Sets the shim of Item.get_MasterID() + + + Sets the shim of Item.set_MasterID(ID value) + + + Sets the shim of Item.get_Masters() + + + Sets the shim of Item.get_Modified() + + + Sets the shim of Item.MoveTo(Item destination) + + + Sets the shim of Item.get_Name() + + + Sets the shim of Item.set_Name(String value) + + + Sets the shim of Item.get_OriginatorId() + + + Sets the shim of Item.get_Parent() + + + Sets the shim of Item.get_ParentID() + + + Sets the shim of Item.PasteItem(String xml, Boolean changeIDs, PasteMode mode) + + + Sets the shim of Item.Paste(String xml, Boolean changeIDs, PasteMode mode) + + + Sets the shim of Item.get_Paths() + + + Sets the shim of Item.get_Publishing() + + + Sets the shim of Item.Recycle() + + + Sets the shim of Item.RecycleChildren() + + + Sets the shim of Item.RecycleVersion() + + + Sets the shim of Item.RejectChanges() + + + Sets the shim of Item.Reload() + + + Sets the shim of Item.get_RuntimeSettings() + + + Sets the shim of Item.get_Security() + + + Sets the shim of Item.set_Security(ItemSecurity value) + + + Sets the shim of Item.SetChanges(ItemChanges changes) + + + Sets the shim of Item.SetDatabase(Database database) + + + Sets the shim of Item.SetInnerData(Item item) + + + Sets the shim of Item.SetProperty(String name, ID value, ID originalValue) + + + Sets the shim of Item.SetProperty(String name, String value, String originalValue) + + + Sets the shim of Item.get_SharedFieldsSource() + + + Sets the shim of Item.get_Source() + + + Sets the shim of Item.get_SourceUri() + + + Sets the shim of Item.get_State() + + + Sets the shim of Item.get_Statistics() + + + Sets the shim of Item.get_SyncRoot() + + + Sets the shim of Item.get_Template() + + + Sets the shim of Item.get_TemplateID() + + + Sets the shim of Item.set_TemplateID(ID value) + + + Sets the shim of Item.get_TemplateName() + + + Sets the shim of Item.get_Uri() + + + Sets the shim of Item.get_Version() + + + Sets the shim of Item.get_Versions() + + + Sets the shim of Item.get_Visualization() + + + Sets the shim of Item.<Delete>b__1b(ID id) + + + Sets the shim of Item.get_Appearance() + + + Sets the shim of Item.get_Axes() + + + Sets the shim of Item.BeginEdit() + + + Assigns the 'Current' behavior for all methods of the shimmed type + + + Assigns the 'NotImplemented' behavior for all methods of the shimmed type + + + Assigns the behavior for all methods of the shimmed type + + + Binds the members of the interface to the shim. + + + Sets the shim of Item.get_Branch() + + + Sets the shim of Item.get_BranchId() + + + Sets the shim of Item.set_BranchId(ID value) + + + Sets the shim of Item.get_Branches() + + + Sets the shim of Item.ChangeTemplate(TemplateItem template) + + + Sets the shim of Item.get_Children() + + + Sets the shim of Item.Clone(ID cloneID, Database ownerDatabase) + + + Sets the shim of Item.Clone(Item item) + + + Sets the shim of Item.CloneTo(Item destination) + + + Sets the shim of Item.CloneTo(Item destination, Boolean deep) + + + Sets the shim of Item.CloneTo(Item destination, String name, Boolean deep) + + + Sets the shim of Item.Item(ID itemID, ItemData data, Database database) + + + Sets the shim of Item.CopyTo(Item destination, String copyName) + + + Sets the shim of Item.CopyTo(Item destination, String copyName, ID copyID, Boolean deep) + + + Sets the shim of Item.get_Database() + + + Sets the shim of Item.Delete() + + + Sets the shim of Item.Delete(Boolean removeBlobs) + + + Sets the shim of Item.DeleteChildren() + + + Sets the shim of Item.get_DisplayName() + + + Sets the shim of Item.Duplicate() + + + Sets the shim of Item.Duplicate(String copyName) + + + Sets the shim of Item.get_Editing() + + + Sets the shim of Item.get_Empty() + + + Sets the shim of Item.EndEdit() + + + Sets the shim of Item.get_Fields() + + + Sets the shim of Item.GetCacheKey(Item item) + + + Sets the shim of Item.GetChanges(Boolean force) + + + Sets the shim of Item.GetChildren() + + + Sets the shim of Item.GetChildren(ChildListOptions options) + + + Sets the shim of Item.GetClones() + + + Sets the shim of Item.GetClones(Boolean processChildren) + + + Sets the shim of Item.GetClonesInternal(Item item, Boolean processChildren) + + + Sets the shim of Item.GetFullChanges() + + + Sets the shim of Item.GetOuterXml(Boolean includeSubitems) + + + Sets the shim of Item.GetOuterXml(ItemSerializerOptions options) + + + Sets the shim of Item.GetProperty(String name) + + + Sets the shim of Item.GetUniqueId() + + + Sets the shim of Item.get_HasChildren() + + + Sets the shim of Item.get_HasClones() + + + Sets the shim of Item.get_Help() + + + Sets the shim of Item.get_ID() + + + Sets the shim of Item.get_InnerData() + + + Sets the shim of Item.get_IsClone() + + + Sets the shim of Item.get_IsEditing() + + + Sets the shim of Item.IsEmpty(ID itemID, Database database) + + + Sets the shim of Item.get_IsItemClone() + + + Sets the shim of Item.get_Key() + + + Sets the shim of Item.get_Language() + + + Sets the shim of Item.get_Languages() + + + Sets the shim of Item.get_Links() + + + Sets the shim of Item.get_Locking() + + + Sets the shim of Item.get_Master() + + + Sets the shim of Item.get_MasterID() + + + Sets the shim of Item.set_MasterID(ID value) + + + Sets the shim of Item.get_Masters() + + + Sets the shim of Item.get_Modified() + + + Sets the shim of Item.MoveTo(Item destination) + + + Sets the shim of Item.get_Name() + + + Sets the shim of Item.set_Name(String value) + + + Sets the shim of Item.get_OriginatorId() + + + Sets the shim of Item.get_Parent() + + + Sets the shim of Item.get_ParentID() + + + Sets the shim of Item.PasteItem(String xml, Boolean changeIDs, PasteMode mode) + + + Sets the shim of Item.Paste(String xml, Boolean changeIDs, PasteMode mode) + + + Sets the shim of Item.get_Paths() + + + Sets the shim of Item.get_Publishing() + + + Sets the shim of Item.Recycle() + + + Sets the shim of Item.RecycleChildren() + + + Sets the shim of Item.RecycleVersion() + + + Sets the shim of Item.RejectChanges() + + + Sets the shim of Item.Reload() + + + Sets the shim of Item.RemoveItemFromCloningCache(Item item) + + + Sets the shim of Item.get_RuntimeSettings() + + + Sets the shim of Item.get_Security() + + + Sets the shim of Item.set_Security(ItemSecurity value) + + + Sets the shim of Item.SetChanges(ItemChanges changes) + + + Sets the shim of Item.SetDatabase(Database database) + + + Sets the shim of Item.SetInnerData(Item item) + + + Sets the shim of Item.SetProperty(String name, ID value, ID originalValue) + + + Sets the shim of Item.SetProperty(String name, String value, String originalValue) + + + Sets the shim of Item.get_SharedFieldsSource() + + + Sets the shim of Item.get_Source() + + + Sets the shim of Item.get_SourceUri() + + + Sets the shim of Item.get_State() + + + Sets the shim of Item.Item() + + + Sets the shim of Item.get_Statistics() + + + Sets the shim of Item.get_SyncRoot() + + + Sets the shim of Item.get_Template() + + + Sets the shim of Item.get_TemplateID() + + + Sets the shim of Item.set_TemplateID(ID value) + + + Sets the shim of Item.get_TemplateName() + + + Sets the shim of Item.TryGetCacheValue(Item item, ItemUri& itemUri) + + + Sets the shim of Item.get_Uri() + + + Sets the shim of Item.get_Version() + + + Sets the shim of Item.get_Versions() + + + Sets the shim of Item.get_Visualization() + + + Sets the shim of Item.<Delete>b__19(TemplateField f) + + + Sets the shim of Item.<Delete>b__1a(TemplateField f) + + + Sets the shim of Item.<Delete>b__1b(ID id) + + + Sets the shim of Item.<Delete>b__1c(Guid guid) + + + diff --git a/Jabberwocky.Glass.Mvc.Tests/Jabberwocky.Glass.Mvc.Tests.csproj b/Jabberwocky.Glass.Mvc.Tests/Jabberwocky.Glass.Mvc.Tests.csproj new file mode 100644 index 0000000..780dfb5 --- /dev/null +++ b/Jabberwocky.Glass.Mvc.Tests/Jabberwocky.Glass.Mvc.Tests.csproj @@ -0,0 +1,117 @@ + + + + + Debug + AnyCPU + {949B682F-643F-4422-B598-9F5176DB8E2A} + Library + Properties + Jabberwocky.Glass.Mvc.Tests + Jabberwocky.Glass.Mvc.Tests + v4.5.2 + 512 + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + ..\packages\Castle.Core.3.3.3\lib\net45\Castle.Core.dll + True + + + ..\packages\Glass.Mapper.Sc.4.0.3.51\lib\net45\Glass.Mapper.dll + True + + + ..\packages\Glass.Mapper.Sc.4.0.3.51\lib\72\Glass.Mapper.Sc.dll + + + ..\packages\Glass.Mapper.Sc.4.0.3.51\lib\Mvc5\Glass.Mapper.Sc.Mvc.dll + + + ..\lib\Sitecore\Testing\HtmlAgilityPack.dll + + + ..\lib\Sitecore\Testing\ITHit.WebDAV.Server.dll + + + ..\lib\Sitecore\Testing\Lucene.Net.dll + + + + ..\lib\Sitecore\Testing\Mvp.Xml.dll + + + ..\packages\NSubstitute.1.8.1.0\lib\net45\NSubstitute.dll + True + + + ..\packages\NUnit.2.6.4\lib\nunit.framework.dll + True + + + ..\lib\Sitecore\Sitecore.Kernel.dll + + + FakesAssemblies\Sitecore.Kernel.7.0.0.0.Fakes.dll + + + ..\lib\Sitecore\Testing\Sitecore.Logging.dll + + + ..\lib\Sitecore\Sitecore.Mvc.dll + + + + + + + + + + + + + + + + + + {dd17db22-247c-44a6-b0dd-091786863626} + Jabberwocky.Glass.Mvc + + + {13e08d30-b2a4-45ef-a28e-c916eb80b70d} + Jabberwocky.Glass + + + + + + + + + + \ No newline at end of file diff --git a/Jabberwocky.Glass.Mvc.Tests/Properties/AssemblyInfo.cs b/Jabberwocky.Glass.Mvc.Tests/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..dcc89a0 --- /dev/null +++ b/Jabberwocky.Glass.Mvc.Tests/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("Jabberwocky.Glass.Mvc.Tests")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("Jabberwocky.Glass.Mvc.Tests")] +[assembly: AssemblyCopyright("Copyright © 2016")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("949b682f-643f-4422-b598-9f5176db8e2a")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Jabberwocky.Glass.Autofac.Mvc.Tests/Services/RenderingContextServiceTests.cs b/Jabberwocky.Glass.Mvc.Tests/Services/RenderingContextServiceTests.cs similarity index 98% rename from Jabberwocky.Glass.Autofac.Mvc.Tests/Services/RenderingContextServiceTests.cs rename to Jabberwocky.Glass.Mvc.Tests/Services/RenderingContextServiceTests.cs index f70389c..34c3faa 100644 --- a/Jabberwocky.Glass.Autofac.Mvc.Tests/Services/RenderingContextServiceTests.cs +++ b/Jabberwocky.Glass.Mvc.Tests/Services/RenderingContextServiceTests.cs @@ -1,7 +1,7 @@ -using System; +using System; using Glass.Mapper.Sc; -using Jabberwocky.Glass.Autofac.Mvc.Services; using Jabberwocky.Glass.Models; +using Jabberwocky.Glass.Mvc.Services; using Microsoft.QualityTools.Testing.Fakes; using NSubstitute; using NUnit.Framework; @@ -10,7 +10,7 @@ using Sitecore.Mvc.Common; using Sitecore.Mvc.Presentation; -namespace Jabberwocky.Glass.Autofac.Mvc.Tests.Services +namespace Jabberwocky.Glass.Mvc.Tests.Services { [TestFixture] public class RenderingContextServiceTests diff --git a/Jabberwocky.Glass.Mvc.Tests/app.config b/Jabberwocky.Glass.Mvc.Tests/app.config new file mode 100644 index 0000000..d7256aa --- /dev/null +++ b/Jabberwocky.Glass.Mvc.Tests/app.config @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/Jabberwocky.Glass.Mvc.Tests/packages.config b/Jabberwocky.Glass.Mvc.Tests/packages.config new file mode 100644 index 0000000..7cc1878 --- /dev/null +++ b/Jabberwocky.Glass.Mvc.Tests/packages.config @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/Jabberwocky.Glass.Autofac.Mvc/Attributes/HttpGetOrInvalidHttpPostAttribute.cs b/Jabberwocky.Glass.Mvc/Attributes/HttpGetOrInvalidHttpPostAttribute.cs similarity index 91% rename from Jabberwocky.Glass.Autofac.Mvc/Attributes/HttpGetOrInvalidHttpPostAttribute.cs rename to Jabberwocky.Glass.Mvc/Attributes/HttpGetOrInvalidHttpPostAttribute.cs index a837044..302b029 100644 --- a/Jabberwocky.Glass.Autofac.Mvc/Attributes/HttpGetOrInvalidHttpPostAttribute.cs +++ b/Jabberwocky.Glass.Mvc/Attributes/HttpGetOrInvalidHttpPostAttribute.cs @@ -1,8 +1,8 @@ -using System; +using System; using System.Reflection; using System.Web.Mvc; -namespace Jabberwocky.Glass.Autofac.Mvc.Attributes +namespace Jabberwocky.Glass.Mvc.Attributes { [AttributeUsage(AttributeTargets.Method, AllowMultiple = false, Inherited = true)] public class HttpGetOrInvalidHttpPostAttribute : ActionMethodSelectorAttribute diff --git a/Jabberwocky.Glass.Autofac.Mvc/Attributes/ValidHttpPostAttribute.cs b/Jabberwocky.Glass.Mvc/Attributes/ValidHttpPostAttribute.cs similarity index 92% rename from Jabberwocky.Glass.Autofac.Mvc/Attributes/ValidHttpPostAttribute.cs rename to Jabberwocky.Glass.Mvc/Attributes/ValidHttpPostAttribute.cs index ae5f698..24444e9 100644 --- a/Jabberwocky.Glass.Autofac.Mvc/Attributes/ValidHttpPostAttribute.cs +++ b/Jabberwocky.Glass.Mvc/Attributes/ValidHttpPostAttribute.cs @@ -1,7 +1,7 @@ using System.Reflection; using System.Web.Mvc; -namespace Jabberwocky.Glass.Autofac.Mvc.Attributes +namespace Jabberwocky.Glass.Mvc.Attributes { public class ValidHttpPostAttribute : ActionMethodSelectorAttribute { diff --git a/Jabberwocky.Glass.Autofac.Mvc/Attributes/ValidateFormHandlerAttribute.cs b/Jabberwocky.Glass.Mvc/Attributes/ValidateFormHandlerAttribute.cs similarity index 95% rename from Jabberwocky.Glass.Autofac.Mvc/Attributes/ValidateFormHandlerAttribute.cs rename to Jabberwocky.Glass.Mvc/Attributes/ValidateFormHandlerAttribute.cs index 98d1a84..96a2dd4 100644 --- a/Jabberwocky.Glass.Autofac.Mvc/Attributes/ValidateFormHandlerAttribute.cs +++ b/Jabberwocky.Glass.Mvc/Attributes/ValidateFormHandlerAttribute.cs @@ -2,7 +2,7 @@ using System.Reflection; using System.Web.Mvc; -namespace Jabberwocky.Glass.Autofac.Mvc.Attributes +namespace Jabberwocky.Glass.Mvc.Attributes { public class ValidateFormHandlerAttribute : ActionMethodSelectorAttribute { diff --git a/Jabberwocky.Glass.Mvc/Jabberwocky.Glass.Mvc.csproj b/Jabberwocky.Glass.Mvc/Jabberwocky.Glass.Mvc.csproj new file mode 100644 index 0000000..59a8208 --- /dev/null +++ b/Jabberwocky.Glass.Mvc/Jabberwocky.Glass.Mvc.csproj @@ -0,0 +1,122 @@ + + + + + Debug + AnyCPU + {DD17DB22-247C-44A6-B0DD-091786863626} + Library + Properties + Jabberwocky.Glass.Mvc + Jabberwocky.Glass.Mvc + v4.5 + 512 + + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + ..\packages\Castle.Core.3.3.3\lib\net45\Castle.Core.dll + True + + + ..\packages\Glass.Mapper.Sc.4.0.3.51\lib\net45\Glass.Mapper.dll + True + + + ..\packages\Glass.Mapper.Sc.4.0.3.51\lib\80\Glass.Mapper.Sc.dll + + + ..\packages\Glass.Mapper.Sc.4.0.3.51\lib\Mvc5\Glass.Mapper.Sc.Mvc.dll + + + ..\packages\Microsoft.Web.Infrastructure.1.0.0.0\lib\net40\Microsoft.Web.Infrastructure.dll + True + + + ..\lib\Sitecore\Sitecore.Kernel.dll + + + ..\lib\Sitecore\Sitecore.Mvc.dll + + + + + + ..\packages\Microsoft.AspNet.WebPages.3.2.3\lib\net45\System.Web.Helpers.dll + True + + + ..\packages\Microsoft.AspNet.Mvc.5.2.3\lib\net45\System.Web.Mvc.dll + True + + + ..\packages\Microsoft.AspNet.Razor.3.2.3\lib\net45\System.Web.Razor.dll + True + + + ..\packages\Microsoft.AspNet.WebPages.3.2.3\lib\net45\System.Web.WebPages.dll + True + + + ..\packages\Microsoft.AspNet.WebPages.3.2.3\lib\net45\System.Web.WebPages.Deployment.dll + True + + + ..\packages\Microsoft.AspNet.WebPages.3.2.3\lib\net45\System.Web.WebPages.Razor.dll + True + + + + + + + + + + + + + + + + + + + + + + + + + + + {13e08d30-b2a4-45ef-a28e-c916eb80b70d} + Jabberwocky.Glass + + + + + \ No newline at end of file diff --git a/Jabberwocky.Glass.Autofac.Mvc/Models/Factory/IViewModelFactory.cs b/Jabberwocky.Glass.Mvc/Models/Factory/IViewModelFactory.cs similarity index 63% rename from Jabberwocky.Glass.Autofac.Mvc/Models/Factory/IViewModelFactory.cs rename to Jabberwocky.Glass.Mvc/Models/Factory/IViewModelFactory.cs index 5ca9850..a45e224 100644 --- a/Jabberwocky.Glass.Autofac.Mvc/Models/Factory/IViewModelFactory.cs +++ b/Jabberwocky.Glass.Mvc/Models/Factory/IViewModelFactory.cs @@ -1,6 +1,6 @@ -using System; +using System; -namespace Jabberwocky.Glass.Autofac.Mvc.Models.Factory +namespace Jabberwocky.Glass.Mvc.Models.Factory { public interface IViewModelFactory { diff --git a/Jabberwocky.Glass.Mvc/Properties/AssemblyInfo.cs b/Jabberwocky.Glass.Mvc/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..b7df09a --- /dev/null +++ b/Jabberwocky.Glass.Mvc/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("Jabberwocky.Glass.Mvc")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("Jabberwocky.Glass.Mvc")] +[assembly: AssemblyCopyright("Copyright © 2016")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("dd17db22-247c-44a6-b0dd-091786863626")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Jabberwocky.Glass.Mvc/Services/DatasourceNestingOptions.cs b/Jabberwocky.Glass.Mvc/Services/DatasourceNestingOptions.cs new file mode 100644 index 0000000..7483ade --- /dev/null +++ b/Jabberwocky.Glass.Mvc/Services/DatasourceNestingOptions.cs @@ -0,0 +1,9 @@ +namespace Jabberwocky.Glass.Mvc.Services +{ + public enum DatasourceNestingOptions + { + Default, + Never, + Always + } +} diff --git a/Jabberwocky.Glass.Mvc/Services/IRenderingContextService.cs b/Jabberwocky.Glass.Mvc/Services/IRenderingContextService.cs new file mode 100644 index 0000000..7e82f94 --- /dev/null +++ b/Jabberwocky.Glass.Mvc/Services/IRenderingContextService.cs @@ -0,0 +1,17 @@ +using System; +using Jabberwocky.Glass.Models; +using Sitecore.Mvc.Presentation; + +namespace Jabberwocky.Glass.Mvc.Services +{ + public interface IRenderingContextService + { + Rendering GetCurrentRendering(); + + T GetCurrentRenderingDatasource(DatasourceNestingOptions options = DatasourceNestingOptions.Default) where T : class, IGlassBase; + + T GetCurrentRenderingParameters() where T : class; + + object GetCurrentRenderingParameters(Type renderingParamType); + } +} \ No newline at end of file diff --git a/Jabberwocky.Glass.Autofac.Mvc/Services/RenderingContextService.cs b/Jabberwocky.Glass.Mvc/Services/RenderingContextService.cs similarity index 98% rename from Jabberwocky.Glass.Autofac.Mvc/Services/RenderingContextService.cs rename to Jabberwocky.Glass.Mvc/Services/RenderingContextService.cs index 39550bc..b94b95f 100644 --- a/Jabberwocky.Glass.Autofac.Mvc/Services/RenderingContextService.cs +++ b/Jabberwocky.Glass.Mvc/Services/RenderingContextService.cs @@ -1,12 +1,12 @@ -using System; +using System; using System.Collections.Concurrent; +using System.Linq; using System.Reflection; -using Sitecore.Mvc.Presentation; using Glass.Mapper.Sc; -using System.Linq; using Jabberwocky.Glass.Models; +using Sitecore.Mvc.Presentation; -namespace Jabberwocky.Glass.Autofac.Mvc.Services +namespace Jabberwocky.Glass.Mvc.Services { public class RenderingContextService : IRenderingContextService { diff --git a/Jabberwocky.Glass.Autofac.Mvc/Util/CustomSitecoreHelper.cs b/Jabberwocky.Glass.Mvc/Util/CustomSitecoreHelper.cs similarity index 88% rename from Jabberwocky.Glass.Autofac.Mvc/Util/CustomSitecoreHelper.cs rename to Jabberwocky.Glass.Mvc/Util/CustomSitecoreHelper.cs index e8f4fa1..3ac4806 100644 --- a/Jabberwocky.Glass.Autofac.Mvc/Util/CustomSitecoreHelper.cs +++ b/Jabberwocky.Glass.Mvc/Util/CustomSitecoreHelper.cs @@ -1,11 +1,11 @@ -using System.Web; +using System.Web; using System.Web.Mvc; using System.Web.Mvc.Html; -using Jabberwocky.Glass.Autofac.Mvc.Attributes; +using Jabberwocky.Glass.Mvc.Attributes; using Sitecore.Mvc.Extensions; using Sitecore.Mvc.Helpers; -namespace Jabberwocky.Glass.Autofac.Mvc.Util +namespace Jabberwocky.Glass.Mvc.Util { public class CustomSitecoreHelper : SitecoreHelper { diff --git a/Jabberwocky.Glass.Autofac.Mvc/Views/CustomGlassView.cs b/Jabberwocky.Glass.Mvc/Views/CustomGlassView.cs similarity index 85% rename from Jabberwocky.Glass.Autofac.Mvc/Views/CustomGlassView.cs rename to Jabberwocky.Glass.Mvc/Views/CustomGlassView.cs index c9cfa1c..e968623 100644 --- a/Jabberwocky.Glass.Autofac.Mvc/Views/CustomGlassView.cs +++ b/Jabberwocky.Glass.Mvc/Views/CustomGlassView.cs @@ -1,9 +1,9 @@ -using System.Web.Mvc; +using System.Web.Mvc; using Glass.Mapper.Sc.Configuration.Attributes; using Glass.Mapper.Sc.Web.Mvc; -using Jabberwocky.Glass.Autofac.Mvc.Models.Factory; +using Jabberwocky.Glass.Mvc.Models.Factory; -namespace Jabberwocky.Glass.Autofac.Mvc.Views +namespace Jabberwocky.Glass.Mvc.Views { public abstract class CustomGlassView : GlassView where TModel : class { diff --git a/Jabberwocky.Glass.Mvc/app.config b/Jabberwocky.Glass.Mvc/app.config new file mode 100644 index 0000000..22b850b --- /dev/null +++ b/Jabberwocky.Glass.Mvc/app.config @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/Jabberwocky.Glass.Mvc/packages.config b/Jabberwocky.Glass.Mvc/packages.config new file mode 100644 index 0000000..d1679b0 --- /dev/null +++ b/Jabberwocky.Glass.Mvc/packages.config @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/Jabberwocky.Glass.Tests/Jabberwocky.Glass.Tests.csproj b/Jabberwocky.Glass.Tests/Jabberwocky.Glass.Tests.csproj index 84eb1f5..fe6eb66 100644 --- a/Jabberwocky.Glass.Tests/Jabberwocky.Glass.Tests.csproj +++ b/Jabberwocky.Glass.Tests/Jabberwocky.Glass.Tests.csproj @@ -57,6 +57,13 @@ False ..\packages\NUnit.2.6.4\lib\nunit.framework.dll
+ + False + ..\lib\Sitecore\Sitecore.Kernel.dll + + + ..\lib\Sitecore\Sitecore.Mvc.dll + diff --git a/Jabberwocky.sln b/Jabberwocky.sln index 4491bc7..d1c859e 100644 --- a/Jabberwocky.sln +++ b/Jabberwocky.sln @@ -60,6 +60,10 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Jabberwocky.Glass.Autofac.W EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Jabberwocky.Autofac.Tests", "Jabberwocky.Autofac.Tests\Jabberwocky.Autofac.Tests.csproj", "{87913926-895A-422B-B462-EF685DCAE215}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Jabberwocky.Glass.Mvc", "Jabberwocky.Glass.Mvc\Jabberwocky.Glass.Mvc.csproj", "{DD17DB22-247C-44A6-B0DD-091786863626}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Jabberwocky.Glass.Mvc.Tests", "Jabberwocky.Glass.Mvc.Tests\Jabberwocky.Glass.Mvc.Tests.csproj", "{949B682F-643F-4422-B598-9F5176DB8E2A}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -142,6 +146,14 @@ Global {87913926-895A-422B-B462-EF685DCAE215}.Debug|Any CPU.Build.0 = Debug|Any CPU {87913926-895A-422B-B462-EF685DCAE215}.Release|Any CPU.ActiveCfg = Release|Any CPU {87913926-895A-422B-B462-EF685DCAE215}.Release|Any CPU.Build.0 = Release|Any CPU + {DD17DB22-247C-44A6-B0DD-091786863626}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {DD17DB22-247C-44A6-B0DD-091786863626}.Debug|Any CPU.Build.0 = Debug|Any CPU + {DD17DB22-247C-44A6-B0DD-091786863626}.Release|Any CPU.ActiveCfg = Release|Any CPU + {DD17DB22-247C-44A6-B0DD-091786863626}.Release|Any CPU.Build.0 = Release|Any CPU + {949B682F-643F-4422-B598-9F5176DB8E2A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {949B682F-643F-4422-B598-9F5176DB8E2A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {949B682F-643F-4422-B598-9F5176DB8E2A}.Release|Any CPU.ActiveCfg = Release|Any CPU + {949B682F-643F-4422-B598-9F5176DB8E2A}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -169,5 +181,7 @@ Global {44DB88AB-C38E-4CAE-ADA0-BC64778A1D4A} = {338A9D71-3ED1-4E69-AC1B-E5033846B3A4} {86B4E810-DCA7-4510-BA2B-EC1DDA9CB7FE} = {FF1D41BA-5DE4-49CC-8CFF-08B1BF700C3D} {87913926-895A-422B-B462-EF685DCAE215} = {7EF6690B-FB53-4BC9-A915-93E893FE3225} + {DD17DB22-247C-44A6-B0DD-091786863626} = {FF1D41BA-5DE4-49CC-8CFF-08B1BF700C3D} + {949B682F-643F-4422-B598-9F5176DB8E2A} = {7EF6690B-FB53-4BC9-A915-93E893FE3225} EndGlobalSection EndGlobal From b951826fea7fdc084d9ca62c21db5ceec54e157d Mon Sep 17 00:00:00 2001 From: Chris Smith Date: Mon, 27 Jun 2016 16:06:34 -0400 Subject: [PATCH 5/8] Removing unnecessary class from the new test project. --- Jabberwocky.Glass.Mvc.Tests/Class1.cs | 12 ------------ .../Jabberwocky.Glass.Mvc.Tests.csproj | 4 +++- 2 files changed, 3 insertions(+), 13 deletions(-) delete mode 100644 Jabberwocky.Glass.Mvc.Tests/Class1.cs diff --git a/Jabberwocky.Glass.Mvc.Tests/Class1.cs b/Jabberwocky.Glass.Mvc.Tests/Class1.cs deleted file mode 100644 index 6423e81..0000000 --- a/Jabberwocky.Glass.Mvc.Tests/Class1.cs +++ /dev/null @@ -1,12 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Jabberwocky.Glass.Mvc.Tests -{ - public class Class1 - { - } -} diff --git a/Jabberwocky.Glass.Mvc.Tests/Jabberwocky.Glass.Mvc.Tests.csproj b/Jabberwocky.Glass.Mvc.Tests/Jabberwocky.Glass.Mvc.Tests.csproj index 780dfb5..91c85db 100644 --- a/Jabberwocky.Glass.Mvc.Tests/Jabberwocky.Glass.Mvc.Tests.csproj +++ b/Jabberwocky.Glass.Mvc.Tests/Jabberwocky.Glass.Mvc.Tests.csproj @@ -87,7 +87,6 @@ - @@ -106,6 +105,9 @@ + + +