Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactoring Jabberwocky.Glass.Autofac.Mvc into two separate projects. #25

Merged
merged 3 commits into from
Sep 8, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -51,19 +51,7 @@
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\Glass.Mapper.Sc.4.0.3.51\lib\72\Glass.Mapper.Sc.dll</HintPath>
</Reference>
<Reference Include="HtmlAgilityPack">
<HintPath>..\lib\Sitecore\Testing\HtmlAgilityPack.dll</HintPath>
</Reference>
<Reference Include="ITHit.WebDAV.Server">
<HintPath>..\lib\Sitecore\Testing\ITHit.WebDAV.Server.dll</HintPath>
</Reference>
<Reference Include="Lucene.Net">
<HintPath>..\lib\Sitecore\Testing\Lucene.Net.dll</HintPath>
</Reference>
<Reference Include="Microsoft.CSharp" />
<Reference Include="Microsoft.QualityTools.Testing.Fakes, Version=12.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
</Reference>
<Reference Include="Mvp.Xml">
<HintPath>..\lib\Sitecore\Testing\Mvp.Xml.dll</HintPath>
</Reference>
Expand All @@ -79,13 +67,6 @@
<SpecificVersion>False</SpecificVersion>
<HintPath>..\lib\Sitecore\Sitecore.Kernel.dll</HintPath>
</Reference>
<Reference Include="Sitecore.Kernel.7.0.0.0.Fakes">
<HintPath>FakesAssemblies\Sitecore.Kernel.7.0.0.0.Fakes.dll</HintPath>
</Reference>
<Reference Include="Sitecore.Logging, Version=1.2.0.30715, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\lib\Sitecore\Testing\Sitecore.Logging.dll</HintPath>
</Reference>
<Reference Include="Sitecore.Mvc, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\lib\Sitecore\Sitecore.Mvc.dll</HintPath>
Expand All @@ -103,11 +84,9 @@
<ItemGroup>
<Compile Include="Models\Factory\AutofacViewModelFactoryTests.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Services\RenderingContextServiceTests.cs" />
</ItemGroup>
<ItemGroup>
<None Include="app.config" />
<Fakes Include="Fakes\Sitecore.Kernel.fakes" />
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
Expand All @@ -119,11 +98,16 @@
<Project>{5EAD110F-F074-47E4-8B93-C0EECB9FC27A}</Project>
<Name>Jabberwocky.Glass.Autofac.Mvc</Name>
</ProjectReference>
<ProjectReference Include="..\Jabberwocky.Glass.Mvc\Jabberwocky.Glass.Mvc.csproj">
<Project>{dd17db22-247c-44a6-b0dd-091786863626}</Project>
<Name>Jabberwocky.Glass.Mvc</Name>
</ProjectReference>
<ProjectReference Include="..\Jabberwocky.Glass\Jabberwocky.Glass.csproj">
<Project>{13E08D30-B2A4-45EF-A28E-C916EB80B70D}</Project>
<Name>Jabberwocky.Glass</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup />
<Choose>
<When Condition="'$(VisualStudioVersion)' == '10.0' And '$(IsCodedUITest)' == 'True'">
<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.Services;
using IViewModelFactory = Jabberwocky.Glass.Mvc.Models.Factory.IViewModelFactory;

namespace Jabberwocky.Glass.Autofac.Mvc.Extensions
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,25 +99,17 @@
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Attributes\HttpGetOrInvalidHttpPostAttribute.cs" />
<Compile Include="Attributes\ValidateFormHandlerAttribute.cs" />
<Compile Include="Attributes\ValidHttpPostAttribute.cs" />
<Compile Include="Extensions\MvcRegistrationExtensions.cs" />
<Compile Include="Models\Attributes\AllowNestedDatasourceAttribute.cs" />
<Compile Include="Models\Attributes\ConfigureDatasourceAttribute.cs" />
<Compile Include="Models\Attributes\DisableNestedDatasourceAttribute.cs" />
<Compile Include="Models\Factory\IViewModelFactory.cs" />
<Compile Include="Models\Factory\AutofacViewModelFactory.cs" />
<Compile Include="Models\GlassViewModel.cs" />
<Compile Include="Models\InjectableGlassViewModelBase.cs" />
<Compile Include="Pipelines\Factories\Providers\MvcLifetimeScopeProvider.cs" />
<Compile Include="Pipelines\Processors\GetModelFromViewProcessor.cs" />
<Compile Include="Pipelines\Processors\GetModelProcessor.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Services\IRenderingContextService.cs" />
<Compile Include="Services\RenderingContextService.cs" />
<Compile Include="Util\CustomSitecoreHelper.cs" />
<Compile Include="Views\CustomGlassView.cs" />
</ItemGroup>
<ItemGroup>
<None Include="App_Config\Include\Jabberwocky.Glass.Autofac.Mvc.config">
Expand All @@ -130,6 +122,10 @@
<Project>{EA620F62-8D08-4031-BAC4-1C60D5C5CBC9}</Project>
<Name>Jabberwocky.Glass.Autofac</Name>
</ProjectReference>
<ProjectReference Include="..\Jabberwocky.Glass.Mvc\Jabberwocky.Glass.Mvc.csproj">
<Project>{dd17db22-247c-44a6-b0dd-091786863626}</Project>
<Name>Jabberwocky.Glass.Mvc</Name>
</ProjectReference>
<ProjectReference Include="..\Jabberwocky.Glass\Jabberwocky.Glass.csproj">
<Project>{13E08D30-B2A4-45EF-A28E-C916EB80B70D}</Project>
<Name>Jabberwocky.Glass</Name>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
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.Services;

namespace Jabberwocky.Glass.Autofac.Mvc.Models.Factory
{
public class AutofacViewModelFactory : IViewModelFactory
public class AutofacViewModelFactory : Jabberwocky.Glass.Mvc.Models.Factory.IViewModelFactory
{
private static readonly ConcurrentDictionary<Type, TypeTuple?> ViewModelTypeCache = new ConcurrentDictionary<Type, TypeTuple?>();

Expand Down
11 changes: 6 additions & 5 deletions Jabberwocky.Glass.Autofac.Mvc/Models/GlassViewModel.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using Jabberwocky.Glass.Models;
using Jabberwocky.Glass.Mvc.Models;

namespace Jabberwocky.Glass.Autofac.Mvc.Models
{
Expand All @@ -7,9 +8,9 @@ public abstract class GlassViewModel<TGlassModel> : InjectableGlassViewModelBase
public virtual TGlassModel GlassModel => InternalDatasourceModel as TGlassModel;
}

public abstract class GlassViewModel<TDatasource, TRenderingParameter> : GlassViewModel<TDatasource>
where TDatasource : class, IGlassBase where TRenderingParameter : class
{
public virtual TRenderingParameter RenderingParameters => InternalRenderingParameterModel as TRenderingParameter;
}
public abstract class GlassViewModel<TDatasource, TRenderingParameter> : GlassViewModel<TDatasource>
where TDatasource : class, IGlassBase where TRenderingParameter : class
{
public virtual TRenderingParameter RenderingParameters => InternalRenderingParameterModel as TRenderingParameter;
}
}
Original file line number Diff line number Diff line change
@@ -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;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
18 changes: 17 additions & 1 deletion Jabberwocky.Glass.Autofac.Mvc/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,20 @@
[assembly: AssemblyVersion("1.1.1.0")]
[assembly: AssemblyFileVersion("1.1.1.0")]

[assembly: InternalsVisibleTo("Jabberwocky.Glass.Autofac.Mvc.Tests")]
[assembly: InternalsVisibleTo("Jabberwocky.Glass.Autofac.Mvc.Tests")]

#pragma warning disable 612
[assembly: TypeForwardedTo(typeof(Jabberwocky.Glass.Autofac.Mvc.Attributes.HttpGetOrInvalidHttpPostAttribute))]
[assembly: TypeForwardedTo(typeof(Jabberwocky.Glass.Autofac.Mvc.Attributes.ValidateFormHandlerAttribute))]
[assembly: TypeForwardedTo(typeof(Jabberwocky.Glass.Autofac.Mvc.Attributes.ValidHttpPostAttribute))]

[assembly: TypeForwardedTo(typeof(Jabberwocky.Glass.Autofac.Mvc.Models.Factory.IViewModelFactory))]

[assembly: TypeForwardedTo(typeof(Jabberwocky.Glass.Autofac.Mvc.Services.IRenderingContextService))]
[assembly: TypeForwardedTo(typeof(Jabberwocky.Glass.Autofac.Mvc.Services.RenderingContextService))]
[assembly: TypeForwardedTo(typeof(Jabberwocky.Glass.Autofac.Mvc.Services.DatasourceNestingOptions))]

[assembly: TypeForwardedTo(typeof(Jabberwocky.Glass.Autofac.Mvc.Util.CustomSitecoreHelper))]

[assembly: TypeForwardedTo(typeof(Jabberwocky.Glass.Autofac.Mvc.Views.CustomGlassView<>))]
#pragma warning restore 612
24 changes: 0 additions & 24 deletions Jabberwocky.Glass.Autofac.Mvc/Services/IRenderingContextService.cs

This file was deleted.

Binary file not shown.
Binary file not shown.
Loading