Permalink
Browse files

Merge branch 'develop' into feature/Caching

Conflicts:
	Sites/Sitecore/Glass.Mapper.Sites.Sc/Glass.Mapper.Sites.Sc.csproj
	Tests/Integration Tests/Sitecore/Glass.Mapper.Sc.Integration.Tds/sitecore/content/Tests/PerformanceTests.item
	Tests/Integration Tests/Sitecore/Glass.Mapper.Sc.Integration.Tds/sitecore/content/Tests/PerformanceTests/Target.item
	Tests/Integration Tests/Sitecore/Glass.Mapper.Sc.Integration.Tds/sitecore/content/Tests/SitecoreContext.item
	Tests/Integration Tests/Sitecore/Glass.Mapper.Sc.Integration.Tds/sitecore/content/Tests/SitecoreContext/GetCurrentItem.item
	Tests/Integration Tests/Sitecore/Glass.Mapper.Sc.Integration.Tds/sitecore/content/Tests/SitecoreContext/GetCurrentItem/Target.item
	Tests/Integration Tests/Sitecore/Glass.Mapper.Sc.Integration/SetupSitecoreForTesting.cs
  • Loading branch information...
gravypower committed Jan 15, 2013
2 parents db93da3 + 33d8db7 commit 505218ebbfb4be84e8a11fd95422214210006751
Showing with 406 additions and 27 deletions.
  1. +1 −1 Sites/Sitecore/Glass.Mapper.Sites.Sc/Glass.Mapper.Sites.Sc.csproj
  2. +1 −1 Source/Glass.Mapper.Sc/DataMappers/SitecoreFieldStringMapper.cs
  3. +1 −1 Source/Glass.Mapper.Sc/SitecoreService.cs
  4. +1 −1 Source/Glass.Mapper/Configuration/AbstractTypeConfiguration.cs
  5. +3 −1 Source/Glass.Mapper/Pipelines/ObjectConstruction/Tasks/CreateConcrete/CreateConcreteTask.cs
  6. +3 −3 Source/Glass.Mapper/Utilities.cs
  7. +25 −0 ...Integration Tests/Sitecore/Glass.Mapper.Sc.Integration.Tds/Glass.Mapper.Sc.Integration.Tds.scproj
  8. +10 −3 ....Integration.Tds/sitecore/content/Tests/DataMappers/SitecoreFieldImageMapper/20121222_001405.item
  9. +51 −0 ...ation Tests/Sitecore/Glass.Mapper.Sc.Integration.Tds/sitecore/content/Tests/PerformanceTests.item
  10. +65 −0 ...ests/Sitecore/Glass.Mapper.Sc.Integration.Tds/sitecore/content/Tests/PerformanceTests/Target.item
  11. +51 −0 ...ration Tests/Sitecore/Glass.Mapper.Sc.Integration.Tds/sitecore/content/Tests/SitecoreContext.item
  12. +51 −0 ...tecore/Glass.Mapper.Sc.Integration.Tds/sitecore/content/Tests/SitecoreContext/GetCurrentItem.item
  13. +58 −0 ...Glass.Mapper.Sc.Integration.Tds/sitecore/content/Tests/SitecoreContext/GetCurrentItem/Target.item
  14. +2 −1 ...ration Tests/Sitecore/Glass.Mapper.Sc.Integration/DataMappers/SitecoreFieldStringMapperFixture.cs
  15. +1 −0 Tests/Integration Tests/Sitecore/Glass.Mapper.Sc.Integration/Glass.Mapper.Sc.Integration.csproj
  16. +9 −3 Tests/Integration Tests/Sitecore/Glass.Mapper.Sc.Integration/SetupSitecoreForTesting.cs
  17. +61 −0 Tests/Integration Tests/Sitecore/Glass.Mapper.Sc.Integration/SitecoreContextFixture.cs
  18. +5 −5 Tests/Integration Tests/Sitecore/Glass.Mapper.Sc.Integration/SitecoreServiceFixture.cs
  19. +7 −7 Tests/Unit Tests/Glass.Mapper.Tests/UtilitiesFixture.cs
@@ -230,7 +230,7 @@
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\Source\Glass.Mapper.Sc\Glass.Mapper.Sc.csproj">
- <Project>{0B8E0B06-46B8-4794-862F-73B391F8B1A1}</Project>
+ <Project>{0b8e0b06-46b8-4794-862f-73b391f8b1a1}</Project>
<Name>Glass.Mapper.Sc</Name>
</ProjectReference>
<ProjectReference Include="..\..\..\Source\Glass.Mapper\Glass.Mapper.csproj">
@@ -18,7 +18,7 @@ public override object GetField(Sitecore.Data.Fields.Field field, SitecoreFieldC
if (field == null)
return string.Empty;
- if (config.Setting != SitecoreFieldSettings.RichTextRaw)
+ if (config.Setting == SitecoreFieldSettings.RichTextRaw)
return field.Value;
if (field.Type.StartsWith("Rich Text"))
@@ -290,7 +290,7 @@ public void WriteToItem<T>(T target, Item item, SitecoreTypeConfiguration config
/// <param name="inferType"></param>
/// <param name="constructorParameters">Parameters to pass to the constructor of the new class. Must be in the order specified on the consturctor.</param>
/// <returns></returns>
- public object CreateClass(Type type, Item item, bool isLazy = false, bool inferType = false, params object[] constructorParameters)
+ public object CreateClass(Type type, Item item, bool isLazy , bool inferType, params object[] constructorParameters)
{
if (item == null || item.Versions.Count == 0) return null;
@@ -27,7 +27,7 @@ public abstract class AbstractTypeConfiguration
/// <summary>
/// A list of the constructors on a type
/// </summary>
- public IDictionary<Type[], Delegate> ConstructorMethods { get; set; }
+ public IDictionary<ConstructorInfo, Delegate> ConstructorMethods { get; set; }
public AbstractTypeConfiguration()
@@ -66,7 +66,9 @@ protected virtual object CreateObject(ObjectConstructionArgs args)
var parameters =
constructorParameters == null || !constructorParameters.Any() ? Type.EmptyTypes : constructorParameters.Select(x => x.GetType()).ToArray();
- Delegate conMethod = args.Configuration.ConstructorMethods[parameters];
+ var constructorInfo = args.Configuration.Type.GetConstructor(parameters);
+
+ Delegate conMethod = args.Configuration.ConstructorMethods[constructorInfo];
var obj = conMethod.DynamicInvoke(constructorParameters);
@@ -15,11 +15,11 @@ public static class Utilities
/// Returns a delegate method that will load a class based on its constuctor
/// </summary>
/// <returns></returns>
- public static IDictionary<Type[], Delegate> CreateConstructorDelegates(Type type)
+ public static IDictionary<ConstructorInfo, Delegate> CreateConstructorDelegates(Type type)
{
var constructors = type.GetConstructors();
- var dic = new Dictionary<Type[], Delegate>();
+ var dic = new Dictionary<ConstructorInfo, Delegate>();
foreach (var constructor in constructors)
{
@@ -67,7 +67,7 @@ public static class Utilities
if (!types.Any())
types = Type.EmptyTypes;
- dic[types] = dynMethod.CreateDelegate(delegateType);
+ dic[constructor] = dynMethod.CreateDelegate(delegateType);
}
return dic;
@@ -550,6 +550,31 @@
<ChildItemSynchronization>KeepAllChildrenSynchronized</ChildItemSynchronization>
<ItemDeployment>AlwaysUpdate</ItemDeployment>
</SitecoreItem>
+ <SitecoreItem Include="sitecore\content\Tests\PerformanceTests.item">
+ <Icon>/temp/IconCache/Applications/16x16/folder.png</Icon>
+ <ItemDeployment>AlwaysUpdate</ItemDeployment>
+ <ChildItemSynchronization>KeepAllChildrenSynchronized</ChildItemSynchronization>
+ </SitecoreItem>
+ <SitecoreItem Include="sitecore\content\Tests\PerformanceTests\Target.item">
+ <Icon>/temp/IconCache/Applications/32x32/form_blue.png</Icon>
+ <ChildItemSynchronization>KeepAllChildrenSynchronized</ChildItemSynchronization>
+ <ItemDeployment>AlwaysUpdate</ItemDeployment>
+ </SitecoreItem>
+ <SitecoreItem Include="sitecore\content\Tests\SitecoreContext.item">
+ <Icon>/temp/IconCache/Applications/16x16/folder.png</Icon>
+ <ItemDeployment>AlwaysUpdate</ItemDeployment>
+ <ChildItemSynchronization>KeepAllChildrenSynchronized</ChildItemSynchronization>
+ </SitecoreItem>
+ <SitecoreItem Include="sitecore\content\Tests\SitecoreContext\GetCurrentItem.item">
+ <Icon>/temp/IconCache/Applications/16x16/folder.png</Icon>
+ <ChildItemSynchronization>KeepAllChildrenSynchronized</ChildItemSynchronization>
+ <ItemDeployment>AlwaysUpdate</ItemDeployment>
+ </SitecoreItem>
+ <SitecoreItem Include="sitecore\content\Tests\SitecoreContext\GetCurrentItem\Target.item">
+ <Icon>/temp/IconCache/Applications/32x32/Document.png</Icon>
+ <ChildItemSynchronization>KeepAllChildrenSynchronized</ChildItemSynchronization>
+ <ItemDeployment>AlwaysUpdate</ItemDeployment>
+ </SitecoreItem>
<SitecoreItem Include="sitecore\content\Tests\SitecoreService.item">
<Icon>/temp/IconCache/Applications/16x16/folder.png</Icon>
<ItemDeployment>AlwaysUpdate</ItemDeployment>
@@ -2438,8 +2438,15 @@ content-length: 61
----version----
language: en
version: 1
-revision: b921fe6b-4a76-463a-8313-162d7c3ba638
+revision: c50c00dc-1f70-4c09-9f19-0daf8f3509ec
+----field----
+field: {65885C44-8FCD-4A7F-94F1-EE63703FE193}
+name: Alt
+key: alt
+content-length: 8
+
+test alt
----field----
field: {25BED78C-4957-4165-998A-CA1B52F67497}
name: __Created
@@ -2453,14 +2460,14 @@ name: __Revision
key: __revision
content-length: 36
-b921fe6b-4a76-463a-8313-162d7c3ba638
+c50c00dc-1f70-4c09-9f19-0daf8f3509ec
----field----
field: {D9CF14B1-FA16-4BA6-9288-E8A174D4D522}
name: __Updated
key: __updated
content-length: 34
-20121223T183331:634918844113941335
+20130114T222035:634937988354212047
----field----
field: {BADD9CF9-53E0-4D0C-BCC0-2D784C282F6A}
name: __Updated by
@@ -0,0 +1,51 @@
+----item----
+version: 1
+id: {30E9F1A0-E1F4-4CD3-B476-FDB5F54D9E4E}
+database: master
+path: /sitecore/content/Tests/PerformanceTests
+parent: {09AF9019-011A-4142-A2D7-497D461A5B6C}
+name: PerformanceTests
+master: {00000000-0000-0000-0000-000000000000}
+template: {A87A00B1-E6DB-45AB-8B54-636FEC3B5523}
+templatekey: Folder
+
+----version----
+language: en
+version: 1
+revision: 26c2c655-64d5-4ba1-837c-dd07fa287fac
+
+----field----
+field: {25BED78C-4957-4165-998A-CA1B52F67497}
+name: __Created
+key: __created
+content-length: 15
+
+20121228T131124
+----field----
+field: {5DD74568-4D4B-44C1-B513-0AF5F4CDA34F}
+name: __Created by
+key: __created by
+content-length: 14
+
+sitecore\admin
+----field----
+field: {8CDC337E-A112-42FB-BBB4-4143751E123F}
+name: __Revision
+key: __revision
+content-length: 36
+
+26c2c655-64d5-4ba1-837c-dd07fa287fac
+----field----
+field: {D9CF14B1-FA16-4BA6-9288-E8A174D4D522}
+name: __Updated
+key: __updated
+content-length: 34
+
+20121228T131136:634922970963632655
+----field----
+field: {BADD9CF9-53E0-4D0C-BCC0-2D784C282F6A}
+name: __Updated by
+key: __updated by
+content-length: 14
+
+sitecore\admin
@@ -0,0 +1,65 @@
+----item----
+version: 1
+id: {59784F74-F830-4BCD-B1F0-1A08616EF726}
+database: master
+path: /sitecore/content/Tests/PerformanceTests/Target
+parent: {30E9F1A0-E1F4-4CD3-B476-FDB5F54D9E4E}
+name: Target
+master: {00000000-0000-0000-0000-000000000000}
+template: {3A1B89BA-3885-4BD6-8326-67605764676C}
+templatekey: DataMappersSingleField
+
+----version----
+language: en
+version: 1
+revision: 030797f2-e96f-4d6c-9a8e-0d982e43e591
+
+----field----
+field: {6B43481F-F129-4F53-BEEE-EA84F9B1A6D4}
+name: Field
+key: field
+content-length: 11
+
+hello world
+----field----
+field: {52807595-0F8F-4B20-8D2A-CB71D28C6103}
+name: __Owner
+key: __owner
+content-length: 14
+
+sitecore\admin
+----field----
+field: {25BED78C-4957-4165-998A-CA1B52F67497}
+name: __Created
+key: __created
+content-length: 15
+
+20121228T131214
+----field----
+field: {5DD74568-4D4B-44C1-B513-0AF5F4CDA34F}
+name: __Created by
+key: __created by
+content-length: 14
+
+sitecore\admin
+----field----
+field: {8CDC337E-A112-42FB-BBB4-4143751E123F}
+name: __Revision
+key: __revision
+content-length: 36
+
+030797f2-e96f-4d6c-9a8e-0d982e43e591
+----field----
+field: {D9CF14B1-FA16-4BA6-9288-E8A174D4D522}
+name: __Updated
+key: __updated
+content-length: 34
+
+20121228T132645:634922980058532854
+----field----
+field: {BADD9CF9-53E0-4D0C-BCC0-2D784C282F6A}
+name: __Updated by
+key: __updated by
+content-length: 17
+
+default\Anonymous
@@ -0,0 +1,51 @@
+----item----
+version: 1
+id: {1B5B35E1-6A07-4625-8CB3-C4B893A4CB90}
+database: master
+path: /sitecore/content/Tests/SitecoreContext
+parent: {09AF9019-011A-4142-A2D7-497D461A5B6C}
+name: SitecoreContext
+master: {00000000-0000-0000-0000-000000000000}
+template: {A87A00B1-E6DB-45AB-8B54-636FEC3B5523}
+templatekey: Folder
+
+----version----
+language: en
+version: 1
+revision: 02602026-aee1-452f-9b96-1d1e4c935973
+
+----field----
+field: {25BED78C-4957-4165-998A-CA1B52F67497}
+name: __Created
+key: __created
+content-length: 15
+
+20130114T205408
+----field----
+field: {5DD74568-4D4B-44C1-B513-0AF5F4CDA34F}
+name: __Created by
+key: __created by
+content-length: 14
+
+sitecore\admin
+----field----
+field: {8CDC337E-A112-42FB-BBB4-4143751E123F}
+name: __Revision
+key: __revision
+content-length: 36
+
+02602026-aee1-452f-9b96-1d1e4c935973
+----field----
+field: {D9CF14B1-FA16-4BA6-9288-E8A174D4D522}
+name: __Updated
+key: __updated
+content-length: 34
+
+20130114T205413:634937936536628251
+----field----
+field: {BADD9CF9-53E0-4D0C-BCC0-2D784C282F6A}
+name: __Updated by
+key: __updated by
+content-length: 14
+
+sitecore\admin
@@ -0,0 +1,51 @@
+----item----
+version: 1
+id: {07A18B06-C14D-4C88-99D1-7C3518B49855}
+database: master
+path: /sitecore/content/Tests/SitecoreContext/GetCurrentItem
+parent: {1B5B35E1-6A07-4625-8CB3-C4B893A4CB90}
+name: GetCurrentItem
+master: {00000000-0000-0000-0000-000000000000}
+template: {A87A00B1-E6DB-45AB-8B54-636FEC3B5523}
+templatekey: Folder
+
+----version----
+language: en
+version: 1
+revision: cc5bb0cf-18ad-4ec9-853e-ab1e8679483e
+
+----field----
+field: {25BED78C-4957-4165-998A-CA1B52F67497}
+name: __Created
+key: __created
+content-length: 15
+
+20130114T205424
+----field----
+field: {5DD74568-4D4B-44C1-B513-0AF5F4CDA34F}
+name: __Created by
+key: __created by
+content-length: 14
+
+sitecore\admin
+----field----
+field: {8CDC337E-A112-42FB-BBB4-4143751E123F}
+name: __Revision
+key: __revision
+content-length: 36
+
+cc5bb0cf-18ad-4ec9-853e-ab1e8679483e
+----field----
+field: {D9CF14B1-FA16-4BA6-9288-E8A174D4D522}
+name: __Updated
+key: __updated
+content-length: 34
+
+20130114T205430:634937936700817642
+----field----
+field: {BADD9CF9-53E0-4D0C-BCC0-2D784C282F6A}
+name: __Updated by
+key: __updated by
+content-length: 14
+
+sitecore\admin
Oops, something went wrong.

0 comments on commit 505218e

Please sign in to comment.