Skip to content
Browse files

Merge branch 'develop' of https://github.com/mikeedwards83/Glass.Mapper

… into develop

Conflicts:
	Tests/Integration Tests/Sitecore/Glass.Mapper.Sc.Integration.Tds/Glass.Mapper.Sc.Integration.Tds.scproj
  • Loading branch information...
2 parents 2f2792f + 8fdd092 commit f9569d96858719e7c3872cb8527c0f6a53345d41 @CharlesTurano CharlesTurano committed Jan 5, 2013
Showing with 5,062 additions and 138 deletions.
  1. +111 −0 Glass.Mapper - Sitecore.sln
  2. +79 −0 Glass.Mapper - Umbraco.sln
  3. +12 −5 ...serialization/master/sitecore/content/Tests/DataMappers/AbstractSitecoreFieldMapper/MapToCms.item
  4. +12 −5 ...lization/master/sitecore/content/Tests/DataMappers/AbstractSitecoreFieldMapper/MapToProperty.item
  5. +5 −5 ...lass.Mapper.Sites.Sc/data/serialization/master/sitecore/content/Tests/DataMappers/New Folder.item
  6. +1 −1 Source/Glass.Mapper.Sc/Configuration/Attributes/SitecoreNodeAttribute.cs
  7. +0 −1 Source/Glass.Mapper.Sc/DataMappers/SitecoreChildrenMapper.cs
  8. +18 −0 Source/Glass.Mapper.Sc/DataMappers/SitecoreFieldNullableMapper.cs
  9. +65 −0 Source/Glass.Mapper.Sc/DataMappers/SitecoreItemMapper.cs
  10. +80 −0 Source/Glass.Mapper.Sc/DataMappers/SitecoreLinkedMapper.cs
  11. +142 −0 Source/Glass.Mapper.Sc/DataMappers/SitecoreQueryMapper.cs
  12. +14 −0 Source/Glass.Mapper.Sc/DataMappers/SitecoreQueryParameters/ISitecoreQueryParameter.cs
  13. +25 −0 Source/Glass.Mapper.Sc/DataMappers/SitecoreQueryParameters/ItemDateNowParameter.cs
  14. +35 −0 Source/Glass.Mapper.Sc/DataMappers/SitecoreQueryParameters/ItemEscapedPathParameter.cs
  15. +29 −0 Source/Glass.Mapper.Sc/DataMappers/SitecoreQueryParameters/ItemIdNoBracketsParameter.cs
  16. +28 −0 Source/Glass.Mapper.Sc/DataMappers/SitecoreQueryParameters/ItemIdParameter.cs
  17. +24 −0 Source/Glass.Mapper.Sc/DataMappers/SitecoreQueryParameters/ItemPathParameter.cs
  18. +21 −0 Source/Glass.Mapper.Sc/Glass.Mapper.Sc.csproj
  19. +46 −4 ...s/Integration Tests/Sitecore/Glass.Mapper.Sc.Integration → Source/Glass.Mapper.Sc}/GlassConfig.cs
  20. +12 −2 Source/Glass.Mapper.Sc/ISitecoreService.cs
  21. +1 −2 Source/Glass.Mapper.Sc/LazyItemEnumerable.cs
  22. +133 −6 Source/Glass.Mapper.Sc/SitecoreService.cs
  23. +23 −0 Source/Glass.Mapper.Sc/Utilities.cs
  24. +5 −0 Source/Glass.Mapper.Sc/packages.config
  25. +1 −5 Source/Glass.Mapper/Configuration/Attributes/NodeAttribute.cs
  26. +1 −1 Source/Glass.Mapper/Configuration/NodeConfiguration.cs
  27. +22 −0 Source/Glass.Mapper/Context.cs
  28. +2 −2 Source/Glass.Mapper/Pipelines/ObjectConstruction/Tasks/CreateConcrete/CreateConcreteTask.cs
  29. +42 −1 ...e/Glass.Mapper/Pipelines/ObjectConstruction/Tasks/CreateInterface/InterfacePropertyInterceptor.cs
  30. +1 −0 Source/Glass.Mapper/Utilities.cs
  31. +142 −2 ...Integration Tests/Sitecore/Glass.Mapper.Sc.Integration.Tds/Glass.Mapper.Sc.Integration.Tds.scproj
  32. +51 −0 ...tecore/Glass.Mapper.Sc.Integration.Tds/sitecore/content/Tests/DataMappers/SitecoreItemMapper.item
  33. +105 −0 ...Glass.Mapper.Sc.Integration.Tds/sitecore/content/Tests/DataMappers/SitecoreItemMapper/Source.item
  34. +112 −0 ...Glass.Mapper.Sc.Integration.Tds/sitecore/content/Tests/DataMappers/SitecoreItemMapper/Target.item
  35. +58 −0 ...r.Sc.Integration.Tds/sitecore/content/Tests/DataMappers/SitecoreItemMapper/TargetOneLanguage.item
  36. +51 −0 ...core/Glass.Mapper.Sc.Integration.Tds/sitecore/content/Tests/DataMappers/SitecoreLinkedMapper.item
  37. +58 −0 ...ass.Mapper.Sc.Integration.Tds/sitecore/content/Tests/DataMappers/SitecoreLinkedMapper/Source.item
  38. +58 −0 ...ass.Mapper.Sc.Integration.Tds/sitecore/content/Tests/DataMappers/SitecoreLinkedMapper/Target.item
  39. +51 −0 ...ecore/Glass.Mapper.Sc.Integration.Tds/sitecore/content/Tests/DataMappers/SitecoreQueryMapper.item
  40. +51 −0 ...ass.Mapper.Sc.Integration.Tds/sitecore/content/Tests/DataMappers/SitecoreQueryMapper/Results.item
  41. +58 −0 ...er.Sc.Integration.Tds/sitecore/content/Tests/DataMappers/SitecoreQueryMapper/Results/Result1.item
  42. +58 −0 ...er.Sc.Integration.Tds/sitecore/content/Tests/DataMappers/SitecoreQueryMapper/Results/Result2.item
  43. +58 −0 ...lass.Mapper.Sc.Integration.Tds/sitecore/content/Tests/DataMappers/SitecoreQueryMapper/Source.item
  44. +51 −0 ...e/Glass.Mapper.Sc.Integration.Tds/sitecore/content/Tests/DataMappers/SitecoreQueryParameters.item
  45. +51 −0 ...egration.Tds/sitecore/content/Tests/DataMappers/SitecoreQueryParameters/ItemDateNowParameter.item
  46. +51 −0 ...tion.Tds/sitecore/content/Tests/DataMappers/SitecoreQueryParameters/ItemEscapedPathParameter.item
  47. +51 −0 ...ion.Tds/sitecore/content/Tests/DataMappers/SitecoreQueryParameters/ItemIdNoBracketsParameter.item
  48. +51 −0 ...c.Integration.Tds/sitecore/content/Tests/DataMappers/SitecoreQueryParameters/ItemIdParameter.item
  49. +51 −0 ...Integration.Tds/sitecore/content/Tests/DataMappers/SitecoreQueryParameters/ItemPathParameter.item
  50. +51 −0 .../Sitecore/Glass.Mapper.Sc.Integration.Tds/sitecore/content/Tests/SitecoreService/CreateClass.item
  51. +58 −0 ...re/Glass.Mapper.Sc.Integration.Tds/sitecore/content/Tests/SitecoreService/CreateClass/Target.item
  52. +51 −0 ...itecore/Glass.Mapper.Sc.Integration.Tds/sitecore/content/Tests/SitecoreService/CreateClasses.item
  53. +105 −0 ...Glass.Mapper.Sc.Integration.Tds/sitecore/content/Tests/SitecoreService/CreateClasses/Result1.item
  54. +58 −0 ...Glass.Mapper.Sc.Integration.Tds/sitecore/content/Tests/SitecoreService/CreateClasses/Result2.item
  55. +51 −0 ...n Tests/Sitecore/Glass.Mapper.Sc.Integration.Tds/sitecore/content/Tests/SitecoreService/Save.item
  56. +65 −0 ...tecore/Glass.Mapper.Sc.Integration.Tds/sitecore/content/Tests/SitecoreService/Save/EmptyItem.item
  57. +304 −0 Tests/Integration Tests/Sitecore/Glass.Mapper.Sc.Integration.Tds/sitecore/system.item
  58. +234 −0 Tests/Integration Tests/Sitecore/Glass.Mapper.Sc.Integration.Tds/sitecore/system/Languages.item
  59. +100 −0 ...s/Integration Tests/Sitecore/Glass.Mapper.Sc.Integration.Tds/sitecore/system/Languages/af-ZA.item
  60. +21 −20 ...tegration Tests/Sitecore/Glass.Mapper.Sc.Integration/DataMappers/SitecoreChildrenMapperFixture.cs
  61. +3 −0 ...egration Tests/Sitecore/Glass.Mapper.Sc.Integration/DataMappers/SitecoreFieldLinkMapperFixture.cs
  62. +2 −0 ...s/Integration Tests/Sitecore/Glass.Mapper.Sc.Integration/DataMappers/SitecoreInfoMapperFixture.cs
  63. +413 −0 ...s/Integration Tests/Sitecore/Glass.Mapper.Sc.Integration/DataMappers/SitecoreItemMapperFixture.cs
  64. +259 −0 ...Integration Tests/Sitecore/Glass.Mapper.Sc.Integration/DataMappers/SitecoreLinkedMapperFixture.cs
  65. +373 −0 .../Integration Tests/Sitecore/Glass.Mapper.Sc.Integration/DataMappers/SitecoreQueryMapperFixture.cs
  66. +31 −0 ...re/Glass.Mapper.Sc.Integration/DataMappers/SitecoreQueryParameters/ItemDateNowParameterFixture.cs
  67. +31 −0 ...lass.Mapper.Sc.Integration/DataMappers/SitecoreQueryParameters/ItemEscapedPathParameterFixture.cs
  68. +31 −0 ...ass.Mapper.Sc.Integration/DataMappers/SitecoreQueryParameters/ItemIdNoBracketsParameterFixture.cs
  69. +31 −0 ...itecore/Glass.Mapper.Sc.Integration/DataMappers/SitecoreQueryParameters/ItemIdParameterFixture.cs
  70. +31 −0 ...ecore/Glass.Mapper.Sc.Integration/DataMappers/SitecoreQueryParameters/ItemPathParameterFixture.cs
  71. +8 −1 Tests/Integration Tests/Sitecore/Glass.Mapper.Sc.Integration/Glass.Mapper.Sc.Integration.csproj
  72. +19 −13 Tests/Integration Tests/Sitecore/Glass.Mapper.Sc.Integration/PerformanceTests.cs
  73. +428 −0 Tests/Integration Tests/Sitecore/Glass.Mapper.Sc.Integration/SitecoreServiceFixture.cs
  74. +5 −11 Tests/Unit Tests/Glass.Mapper.Tests/Configuration/Attributes/NodeAttributeFixture.cs
  75. +91 −51 Tests/Unit Tests/Glass.Mapper.Tests/UtilitiesFixture.cs
  76. +1 −0 packages/repositories.config
View
111 Glass.Mapper - Sitecore.sln
@@ -0,0 +1,111 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio 2012
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Source", "Source", "{5D6EA9DE-3C8B-4381-82EF-4824DED2BA58}"
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Sites", "Sites", "{53D4AA07-205B-47B7-B040-F29F82855772}"
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Sitecore", "Sitecore", "{3A907A16-C131-4B03-A819-5962866C875E}"
+ ProjectSection(SolutionItems) = preProject
+ Sites\Sitecore\Setup.txt = Sites\Sitecore\Setup.txt
+ EndProjectSection
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Glass.Mapper.Sites.Sc", "Sites\Sitecore\Glass.Mapper.Sites.Sc\Glass.Mapper.Sites.Sc.csproj", "{C6E8F5C7-7D3C-4492-B38B-707A885B7D27}"
+EndProject
+Project("{CAA73BB0-EF22-4D79-A57E-DF67B3BA9C80}") = "Glass.Mapper.Sites.Sc.Tds", "Sites\Sitecore\Glass.Mapper.Sites.Sc.Tds\Glass.Mapper.Sites.Sc.Tds.scproj", "{90D86CFB-1744-4D9D-A294-A5B64618DC50}"
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{AE1024DD-D8C9-4068-B183-6DB114888D39}"
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Integration Tests", "Integration Tests", "{D213393F-AC22-4424-A982-1B66D09AB9B5}"
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Sitecore", "Sitecore", "{CD5D2D4B-47EF-47D6-B863-F3C9BD98EB8E}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Glass.Mapper.Sc.Integration", "Tests\Integration Tests\Sitecore\Glass.Mapper.Sc.Integration\Glass.Mapper.Sc.Integration.csproj", "{ED059096-C6AC-42AA-B0B2-74104E1AF861}"
+EndProject
+Project("{CAA73BB0-EF22-4D79-A57E-DF67B3BA9C80}") = "Glass.Mapper.Sc.Integration.Tds", "Tests\Integration Tests\Sitecore\Glass.Mapper.Sc.Integration.Tds\Glass.Mapper.Sc.Integration.Tds.scproj", "{FEE6B0E9-B4A4-404C-9236-4396B2261C17}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Glass.Mapper", "Source\Glass.Mapper\Glass.Mapper.csproj", "{566109ED-A88A-467E-BDDB-BBF7F831A006}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Glass.Mapper.Sc", "Source\Glass.Mapper.Sc\Glass.Mapper.Sc.csproj", "{0B8E0B06-46B8-4794-862F-73B391F8B1A1}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Glass.Mapper.Sc.Upgrade", "Source\Glass.Mapper.Sc.Upgrade\Glass.Mapper.Sc.Upgrade.csproj", "{AFC35AE3-307B-43BC-A9B8-9BCFB4EA3CCF}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Glass.Mapper.Sc.Website", "Source\Glass.Mapper.Sc.Website\Glass.Mapper.Sc.Website.csproj", "{93420975-6370-4E1F-BC3C-9F9B4EEECEB1}"
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Unit Tests", "Unit Tests", "{B3AD5A1C-51FC-4D1A-9C3F-80C79B173B77}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Glass.Mapper.Tests", "Tests\Unit Tests\Glass.Mapper.Tests\Glass.Mapper.Tests.csproj", "{728CF1A7-0F06-4464-B434-33A982D97C82}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Glass.Mapper.Sc.Tests", "Tests\Unit Tests\Glass.Mapper.Sc.Tests\Glass.Mapper.Sc.Tests.csproj", "{38DB0F01-9232-45BE-BC14-8DEDB738D538}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Any CPU = Debug|Any CPU
+ Release|Any CPU = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {C6E8F5C7-7D3C-4492-B38B-707A885B7D27}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {C6E8F5C7-7D3C-4492-B38B-707A885B7D27}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {C6E8F5C7-7D3C-4492-B38B-707A885B7D27}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {C6E8F5C7-7D3C-4492-B38B-707A885B7D27}.Release|Any CPU.Build.0 = Release|Any CPU
+ {90D86CFB-1744-4D9D-A294-A5B64618DC50}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {90D86CFB-1744-4D9D-A294-A5B64618DC50}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {90D86CFB-1744-4D9D-A294-A5B64618DC50}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
+ {90D86CFB-1744-4D9D-A294-A5B64618DC50}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {90D86CFB-1744-4D9D-A294-A5B64618DC50}.Release|Any CPU.Build.0 = Release|Any CPU
+ {90D86CFB-1744-4D9D-A294-A5B64618DC50}.Release|Any CPU.Deploy.0 = Release|Any CPU
+ {ED059096-C6AC-42AA-B0B2-74104E1AF861}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {ED059096-C6AC-42AA-B0B2-74104E1AF861}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {ED059096-C6AC-42AA-B0B2-74104E1AF861}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {ED059096-C6AC-42AA-B0B2-74104E1AF861}.Release|Any CPU.Build.0 = Release|Any CPU
+ {FEE6B0E9-B4A4-404C-9236-4396B2261C17}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {FEE6B0E9-B4A4-404C-9236-4396B2261C17}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {FEE6B0E9-B4A4-404C-9236-4396B2261C17}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
+ {FEE6B0E9-B4A4-404C-9236-4396B2261C17}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {FEE6B0E9-B4A4-404C-9236-4396B2261C17}.Release|Any CPU.Build.0 = Release|Any CPU
+ {FEE6B0E9-B4A4-404C-9236-4396B2261C17}.Release|Any CPU.Deploy.0 = Release|Any CPU
+ {566109ED-A88A-467E-BDDB-BBF7F831A006}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {566109ED-A88A-467E-BDDB-BBF7F831A006}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {566109ED-A88A-467E-BDDB-BBF7F831A006}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {566109ED-A88A-467E-BDDB-BBF7F831A006}.Release|Any CPU.Build.0 = Release|Any CPU
+ {0B8E0B06-46B8-4794-862F-73B391F8B1A1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {0B8E0B06-46B8-4794-862F-73B391F8B1A1}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {0B8E0B06-46B8-4794-862F-73B391F8B1A1}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {0B8E0B06-46B8-4794-862F-73B391F8B1A1}.Release|Any CPU.Build.0 = Release|Any CPU
+ {AFC35AE3-307B-43BC-A9B8-9BCFB4EA3CCF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {AFC35AE3-307B-43BC-A9B8-9BCFB4EA3CCF}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {AFC35AE3-307B-43BC-A9B8-9BCFB4EA3CCF}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {AFC35AE3-307B-43BC-A9B8-9BCFB4EA3CCF}.Release|Any CPU.Build.0 = Release|Any CPU
+ {93420975-6370-4E1F-BC3C-9F9B4EEECEB1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {93420975-6370-4E1F-BC3C-9F9B4EEECEB1}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {93420975-6370-4E1F-BC3C-9F9B4EEECEB1}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {93420975-6370-4E1F-BC3C-9F9B4EEECEB1}.Release|Any CPU.Build.0 = Release|Any CPU
+ {728CF1A7-0F06-4464-B434-33A982D97C82}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {728CF1A7-0F06-4464-B434-33A982D97C82}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {728CF1A7-0F06-4464-B434-33A982D97C82}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {728CF1A7-0F06-4464-B434-33A982D97C82}.Release|Any CPU.Build.0 = Release|Any CPU
+ {38DB0F01-9232-45BE-BC14-8DEDB738D538}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {38DB0F01-9232-45BE-BC14-8DEDB738D538}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {38DB0F01-9232-45BE-BC14-8DEDB738D538}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {38DB0F01-9232-45BE-BC14-8DEDB738D538}.Release|Any CPU.Build.0 = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+ GlobalSection(NestedProjects) = preSolution
+ {566109ED-A88A-467E-BDDB-BBF7F831A006} = {5D6EA9DE-3C8B-4381-82EF-4824DED2BA58}
+ {0B8E0B06-46B8-4794-862F-73B391F8B1A1} = {5D6EA9DE-3C8B-4381-82EF-4824DED2BA58}
+ {AFC35AE3-307B-43BC-A9B8-9BCFB4EA3CCF} = {5D6EA9DE-3C8B-4381-82EF-4824DED2BA58}
+ {93420975-6370-4E1F-BC3C-9F9B4EEECEB1} = {5D6EA9DE-3C8B-4381-82EF-4824DED2BA58}
+ {3A907A16-C131-4B03-A819-5962866C875E} = {53D4AA07-205B-47B7-B040-F29F82855772}
+ {C6E8F5C7-7D3C-4492-B38B-707A885B7D27} = {3A907A16-C131-4B03-A819-5962866C875E}
+ {90D86CFB-1744-4D9D-A294-A5B64618DC50} = {3A907A16-C131-4B03-A819-5962866C875E}
+ {D213393F-AC22-4424-A982-1B66D09AB9B5} = {AE1024DD-D8C9-4068-B183-6DB114888D39}
+ {B3AD5A1C-51FC-4D1A-9C3F-80C79B173B77} = {AE1024DD-D8C9-4068-B183-6DB114888D39}
+ {CD5D2D4B-47EF-47D6-B863-F3C9BD98EB8E} = {D213393F-AC22-4424-A982-1B66D09AB9B5}
+ {ED059096-C6AC-42AA-B0B2-74104E1AF861} = {CD5D2D4B-47EF-47D6-B863-F3C9BD98EB8E}
+ {FEE6B0E9-B4A4-404C-9236-4396B2261C17} = {CD5D2D4B-47EF-47D6-B863-F3C9BD98EB8E}
+ {728CF1A7-0F06-4464-B434-33A982D97C82} = {B3AD5A1C-51FC-4D1A-9C3F-80C79B173B77}
+ {38DB0F01-9232-45BE-BC14-8DEDB738D538} = {B3AD5A1C-51FC-4D1A-9C3F-80C79B173B77}
+ EndGlobalSection
+EndGlobal
View
79 Glass.Mapper - Umbraco.sln
@@ -0,0 +1,79 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio 2012
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Source", "Source", "{07AC460C-E621-4C3E-AEFE-CEA5E5B14532}"
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{C0959749-C641-4740-869C-84F61B3B4BB5}"
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Integration Tests", "Integration Tests", "{2B40DC7D-5AE0-4581-9250-836E875A29A2}"
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Unit Tests", "Unit Tests", "{06F01B65-43F7-44E1-9923-2ACD43EF9A12}"
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Umbraco", "Umbraco", "{D6F39B38-42BA-4227-A532-8C3E476F0FB8}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Glass.Mapper.Umb.Integration", "Tests\Integration Tests\Umbraco\Glass.Mapper.Umb.Integration\Glass.Mapper.Umb.Integration.csproj", "{F6C553A6-5021-4903-8EE2-9F3B0E23C5B9}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Glass.Mapper.Tests", "Tests\Unit Tests\Glass.Mapper.Tests\Glass.Mapper.Tests.csproj", "{728CF1A7-0F06-4464-B434-33A982D97C82}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Glass.Mapper.Umb.Tests", "Tests\Unit Tests\Glass.Mapper.Umb.Tests\Glass.Mapper.Umb.Tests.csproj", "{5BE06222-6401-40C5-B6D2-617D4C35D99F}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Glass.Mapper", "Source\Glass.Mapper\Glass.Mapper.csproj", "{566109ED-A88A-467E-BDDB-BBF7F831A006}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Glass.Mapper.Umb", "Source\Glass.Mapper.Umb\Glass.Mapper.Umb.csproj", "{7BFBD78C-70AF-45B3-83BD-B5F9B0DE2FBF}"
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Sites", "Sites", "{ECD5D385-5AAF-4ECD-81A8-62D92093365F}"
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Umbraco", "Umbraco", "{D23F7DDD-85CF-410F-A755-4CFC07AA6830}"
+ ProjectSection(SolutionItems) = preProject
+ Sites\Umbraco\Setup.txt = Sites\Umbraco\Setup.txt
+ EndProjectSection
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Glass.Mapper.Sites.Umb", "Sites\Umbraco\Glass.Mapper.Sites.Umb\Glass.Mapper.Sites.Umb.csproj", "{1CE133F3-FEAC-425C-A82A-87D57429BBEC}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Any CPU = Debug|Any CPU
+ Release|Any CPU = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {F6C553A6-5021-4903-8EE2-9F3B0E23C5B9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {F6C553A6-5021-4903-8EE2-9F3B0E23C5B9}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {F6C553A6-5021-4903-8EE2-9F3B0E23C5B9}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {F6C553A6-5021-4903-8EE2-9F3B0E23C5B9}.Release|Any CPU.Build.0 = Release|Any CPU
+ {728CF1A7-0F06-4464-B434-33A982D97C82}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {728CF1A7-0F06-4464-B434-33A982D97C82}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {728CF1A7-0F06-4464-B434-33A982D97C82}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {728CF1A7-0F06-4464-B434-33A982D97C82}.Release|Any CPU.Build.0 = Release|Any CPU
+ {5BE06222-6401-40C5-B6D2-617D4C35D99F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {5BE06222-6401-40C5-B6D2-617D4C35D99F}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {5BE06222-6401-40C5-B6D2-617D4C35D99F}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {5BE06222-6401-40C5-B6D2-617D4C35D99F}.Release|Any CPU.Build.0 = Release|Any CPU
+ {566109ED-A88A-467E-BDDB-BBF7F831A006}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {566109ED-A88A-467E-BDDB-BBF7F831A006}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {566109ED-A88A-467E-BDDB-BBF7F831A006}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {566109ED-A88A-467E-BDDB-BBF7F831A006}.Release|Any CPU.Build.0 = Release|Any CPU
+ {7BFBD78C-70AF-45B3-83BD-B5F9B0DE2FBF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {7BFBD78C-70AF-45B3-83BD-B5F9B0DE2FBF}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {7BFBD78C-70AF-45B3-83BD-B5F9B0DE2FBF}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {7BFBD78C-70AF-45B3-83BD-B5F9B0DE2FBF}.Release|Any CPU.Build.0 = Release|Any CPU
+ {1CE133F3-FEAC-425C-A82A-87D57429BBEC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {1CE133F3-FEAC-425C-A82A-87D57429BBEC}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {1CE133F3-FEAC-425C-A82A-87D57429BBEC}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {1CE133F3-FEAC-425C-A82A-87D57429BBEC}.Release|Any CPU.Build.0 = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+ GlobalSection(NestedProjects) = preSolution
+ {566109ED-A88A-467E-BDDB-BBF7F831A006} = {07AC460C-E621-4C3E-AEFE-CEA5E5B14532}
+ {7BFBD78C-70AF-45B3-83BD-B5F9B0DE2FBF} = {07AC460C-E621-4C3E-AEFE-CEA5E5B14532}
+ {2B40DC7D-5AE0-4581-9250-836E875A29A2} = {C0959749-C641-4740-869C-84F61B3B4BB5}
+ {06F01B65-43F7-44E1-9923-2ACD43EF9A12} = {C0959749-C641-4740-869C-84F61B3B4BB5}
+ {D6F39B38-42BA-4227-A532-8C3E476F0FB8} = {2B40DC7D-5AE0-4581-9250-836E875A29A2}
+ {728CF1A7-0F06-4464-B434-33A982D97C82} = {06F01B65-43F7-44E1-9923-2ACD43EF9A12}
+ {5BE06222-6401-40C5-B6D2-617D4C35D99F} = {06F01B65-43F7-44E1-9923-2ACD43EF9A12}
+ {F6C553A6-5021-4903-8EE2-9F3B0E23C5B9} = {D6F39B38-42BA-4227-A532-8C3E476F0FB8}
+ {D23F7DDD-85CF-410F-A755-4CFC07AA6830} = {ECD5D385-5AAF-4ECD-81A8-62D92093365F}
+ {1CE133F3-FEAC-425C-A82A-87D57429BBEC} = {D23F7DDD-85CF-410F-A755-4CFC07AA6830}
+ EndGlobalSection
+EndGlobal
View
17 ...ation/master/sitecore/content/Tests/DataMappers/AbstractSitecoreFieldMapper/MapToCms.item
@@ -12,9 +12,16 @@ templatekey: DataMappersSingleField
----version----
language: en
version: 1
-revision: 10ad90c1-04e0-47a9-b6ea-b04898894dfb
+revision: 82fdbb79-74ec-4f4b-91db-32645319ab47
----field----
+field: {6B43481F-F129-4F53-BEEE-EA84F9B1A6D4}
+name: Field
+key: field
+content-length: 14
+
+test value set
+----field----
field: {52807595-0F8F-4B20-8D2A-CB71D28C6103}
name: __Owner
key: __owner
@@ -41,18 +48,18 @@ name: __Revision
key: __revision
content-length: 36
-10ad90c1-04e0-47a9-b6ea-b04898894dfb
+82fdbb79-74ec-4f4b-91db-32645319ab47
----field----
field: {D9CF14B1-FA16-4BA6-9288-E8A174D4D522}
name: __Updated
key: __updated
content-length: 34
-20121216T214506:634912911063321174
+20121230T212310:634924993906093380
----field----
field: {BADD9CF9-53E0-4D0C-BCC0-2D784C282F6A}
name: __Updated by
key: __updated by
-content-length: 14
+content-length: 17
-sitecore\admin
+default\Anonymous
View
17 .../master/sitecore/content/Tests/DataMappers/AbstractSitecoreFieldMapper/MapToProperty.item
@@ -12,9 +12,16 @@ templatekey: DataMappersSingleField
----version----
language: en
version: 1
-revision: 77b1b8cc-698b-4836-ae48-b2aab9e83835
+revision: 95489c06-c3d5-4940-bba6-295c396218d4
----field----
+field: {6B43481F-F129-4F53-BEEE-EA84F9B1A6D4}
+name: Field
+key: field
+content-length: 10
+
+test value
+----field----
field: {52807595-0F8F-4B20-8D2A-CB71D28C6103}
name: __Owner
key: __owner
@@ -41,18 +48,18 @@ name: __Revision
key: __revision
content-length: 36
-77b1b8cc-698b-4836-ae48-b2aab9e83835
+95489c06-c3d5-4940-bba6-295c396218d4
----field----
field: {D9CF14B1-FA16-4BA6-9288-E8A174D4D522}
name: __Updated
key: __updated
content-length: 34
-20121216T204049:634912872495975248
+20121216T214532:634912911320045857
----field----
field: {BADD9CF9-53E0-4D0C-BCC0-2D784C282F6A}
name: __Updated by
key: __updated by
-content-length: 14
+content-length: 17
-sitecore\admin
+default\Anonymous
View
10 ...per.Sites.Sc/data/serialization/master/sitecore/content/Tests/DataMappers/New Folder.item
@@ -1,6 +1,6 @@
----item----
version: 1
-id: {BBDEFFA7-3786-4912-9841-5BE590D6BFF7}
+id: {7D7BB7F6-938D-4716-A6CA-1BA5E6A5868F}
database: master
path: /sitecore/content/Tests/DataMappers/New Folder
parent: {949328F9-AB43-4AA8-9B09-B3FF0C0F1C7B}
@@ -12,15 +12,15 @@ templatekey: Folder
----version----
language: en
version: 1
-revision: 2488ea55-d46f-4532-8a4d-58f1d75617a7
+revision: f25cda0d-3e61-4be8-9101-5ced63d7aefa
----field----
field: {25BED78C-4957-4165-998A-CA1B52F67497}
name: __Created
key: __created
content-length: 15
-20121223T182658
+20130101T121838
----field----
field: {5DD74568-4D4B-44C1-B513-0AF5F4CDA34F}
name: __Created by
@@ -34,14 +34,14 @@ name: __Revision
key: __revision
content-length: 36
-2488ea55-d46f-4532-8a4d-58f1d75617a7
+f25cda0d-3e61-4be8-9101-5ced63d7aefa
----field----
field: {D9CF14B1-FA16-4BA6-9288-E8A174D4D522}
name: __Updated
key: __updated
content-length: 34
-20121223T182658:634918840187006727
+20130101T121838:634926395187392908
----field----
field: {BADD9CF9-53E0-4D0C-BCC0-2D784C282F6A}
name: __Updated by
View
2 Source/Glass.Mapper.Sc/Configuration/Attributes/SitecoreNodeAttribute.cs
@@ -9,7 +9,7 @@ namespace Glass.Mapper.Sc.Configuration.Attributes
{
public class SitecoreNodeAttribute : NodeAttribute
{
- public SitecoreNodeAttribute():base(typeof(Guid))
+ public SitecoreNodeAttribute():base()
{
}
View
1 Source/Glass.Mapper.Sc/DataMappers/SitecoreChildrenMapper.cs
@@ -32,7 +32,6 @@ public override object MapToProperty(AbstractDataMappingContext mappingContext)
typeof (LazyItemEnumerable<>),
new[] {genericType},
getItems,
- scConfig.PropertyInfo.PropertyType,
scConfig.IsLazy,
scConfig.InferType,
scContext.Service
View
18 Source/Glass.Mapper.Sc/DataMappers/SitecoreFieldNullableMapper.cs
@@ -54,4 +54,22 @@ public override void Setup(Pipelines.DataMapperResolver.DataMapperResolverArgs a
base.Setup(args);
}
}
+
+ public class SitecoreFieldNullableDateTimeMapper :
+ SitecoreFieldNullableMapper<DateTime, SitecoreFieldDateTimeMapper> { }
+
+ public class SitecoreFieldNullableDecimalMapper :
+ SitecoreFieldNullableMapper<Decimal, SitecoreFieldDecimalMapper> { }
+
+ public class SitecoreFieldNullableDoubleMapper :
+ SitecoreFieldNullableMapper<Double, SitecoreFieldDoubleMapper> { }
+
+ public class SitecoreFieldNullableFloatMapper :
+ SitecoreFieldNullableMapper<float, SitecoreFieldFloatMapper> { }
+
+ public class SitecoreFieldNullableGuidMapper :
+ SitecoreFieldNullableMapper<Guid, SitecoreFieldGuidMapper> { }
+
+ public class SitecoreFieldNullableIntMapper :
+ SitecoreFieldNullableMapper<int, SitecoreFieldIntegerMapper> { }
}
View
65 Source/Glass.Mapper.Sc/DataMappers/SitecoreItemMapper.cs
@@ -0,0 +1,65 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using Glass.Mapper.Configuration;
+using Glass.Mapper.Sc.Configuration;
+using Glass.Mapper.Sc.Configuration.Attributes;
+using Sitecore.Data;
+using Sitecore.Data.Items;
+
+namespace Glass.Mapper.Sc.DataMappers
+{
+ public class SitecoreItemMapper : AbstractDataMapper
+ {
+ public SitecoreItemMapper()
+ {
+ ReadOnly = true;
+ }
+
+
+ public override void MapToCms(AbstractDataMappingContext mappingContext)
+ {
+ throw new NotImplementedException();
+ }
+
+ public override object MapToProperty(AbstractDataMappingContext mappingContext)
+ {
+ var scConfig = Configuration as SitecoreNodeConfiguration;
+ var scContext = mappingContext as SitecoreDataMappingContext;
+ var item = scContext.Item;
+
+ Item targetItem = null;
+
+ if (scConfig.Id.IsNotNullOrEmpty())
+ {
+ var guid = Guid.Empty;
+
+ if (Guid.TryParse(scConfig.Id, out guid) && guid != Guid.Empty)
+ {
+ targetItem = item.Database.GetItem(new ID(guid), item.Language);
+ }
+ }
+ else if (!scConfig.Path.IsNullOrEmpty())
+ {
+ targetItem = item.Database.GetItem(scConfig.Path, item.Language);
+ }
+
+ if (targetItem == null || targetItem.Versions.Count == 0)
+ {
+ return null;
+ }
+ else
+ {
+ return scContext.Service.CreateClass(scConfig.PropertyInfo.PropertyType, targetItem, scConfig.IsLazy,
+ scConfig.InferType);
+ }
+
+ }
+
+ public override bool CanHandle(AbstractPropertyConfiguration configuration, Context context)
+ {
+ return configuration is SitecoreNodeConfiguration && context.TypeConfigurations.ContainsKey(configuration.PropertyInfo.PropertyType);
+ }
+ }
+}
View
80 Source/Glass.Mapper.Sc/DataMappers/SitecoreLinkedMapper.cs
@@ -0,0 +1,80 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using Glass.Mapper.Configuration;
+using Glass.Mapper.Sc.Configuration;
+using Glass.Mapper.Sc.Configuration.Attributes;
+using Sitecore.Data.Items;
+using Sitecore.Data.Managers;
+
+namespace Glass.Mapper.Sc.DataMappers
+{
+ public class SitecoreLinkedMapper : AbstractDataMapper
+ {
+ public SitecoreLinkedMapper()
+ {
+ ReadOnly = true;
+ }
+
+
+ public override void MapToCms(AbstractDataMappingContext mappingContext)
+ {
+ throw new NotImplementedException();
+ }
+
+ public override object MapToProperty(AbstractDataMappingContext mappingContext)
+ {
+ var scConfig = Configuration as SitecoreLinkedConfiguration;
+ var scContext = mappingContext as SitecoreDataMappingContext;
+
+ Type genericType = Utilities.GetGenericArgument(scConfig.PropertyInfo.PropertyType);
+
+ var item = scContext.Item;
+
+ //ME - i am not sure this is correct but there is an odd behaviour of references
+ // lanugauges come back as invariant, going with default language in this scenario
+ var references = new Func<IEnumerable<Item>>(() =>{
+ var itemLinks = global::Sitecore.Configuration.Factory.GetLinkDatabase().GetReferences(item);
+ var items = itemLinks.Select(x => x.GetTargetItem());
+ return Utilities.GetLanguageItems(items, LanguageManager.DefaultLanguage);
+ });
+
+ var getItems = new Func<IEnumerable<Item>>(() =>
+ {
+ switch (scConfig.Option)
+ {
+ case SitecoreLinkedOptions.All:
+ var itemLinks1 = references();
+ var itemLinks2 = global::Sitecore.Configuration.Factory.GetLinkDatabase().GetReferrers(item);
+ return itemLinks1.Union(itemLinks2.Select(x => x.GetSourceItem()));
+ break;
+ case SitecoreLinkedOptions.References:
+ return references();
+ break;
+ case SitecoreLinkedOptions.Referrers:
+ var itemLinks4 = global::Sitecore.Configuration.Factory.GetLinkDatabase().GetReferrers(item);
+ return itemLinks4.Select(x => x.GetSourceItem());
+ break;
+ default:
+ return new List<Item>();
+ }
+ });
+
+ return scContext.Service.CreateClasses(scConfig.IsLazy, scConfig.InferType, genericType, getItems);
+ }
+
+ public override bool CanHandle(AbstractPropertyConfiguration configuration, Context context)
+ {
+ if (!(configuration is SitecoreLinkedConfiguration))
+ return false;
+
+ if (!configuration.PropertyInfo.PropertyType.IsGenericType) return false;
+
+ Type outerType = Utilities.GetGenericOuter(configuration.PropertyInfo.PropertyType);
+ Type innerType = Utilities.GetGenericArgument(configuration.PropertyInfo.PropertyType);
+
+ return typeof (IEnumerable<>) == outerType && context.TypeConfigurations.ContainsKey(innerType);
+ }
+ }
+}
View
142 Source/Glass.Mapper.Sc/DataMappers/SitecoreQueryMapper.cs
@@ -0,0 +1,142 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using Glass.Mapper.Configuration;
+using Glass.Mapper.Sc.Configuration;
+using Glass.Mapper.Sc.DataMappers.SitecoreQueryParameters;
+using Sitecore.Data.Items;
+using Sitecore.Data.Query;
+using Sitecore.Globalization;
+
+namespace Glass.Mapper.Sc.DataMappers
+{
+ public class SitecoreQueryMapper : AbstractDataMapper
+ {
+ List<ISitecoreQueryParameter> _parameters;
+
+
+ public SitecoreQueryMapper(IEnumerable<ISitecoreQueryParameter> parameters)
+ {
+
+ _parameters = new List<ISitecoreQueryParameter>();
+ if (parameters != null)
+ _parameters.AddRange(parameters);
+
+ //default parameters
+ _parameters.Add(new ItemDateNowParameter());
+ _parameters.Add(new ItemIdParameter());
+ _parameters.Add(new ItemPathParameter());
+ _parameters.Add(new ItemIdNoBracketsParameter());
+ _parameters.Add(new ItemEscapedPathParameter());
+
+ ReadOnly = true;
+ }
+
+ public override void MapToCms(AbstractDataMappingContext mappingContext)
+ {
+ throw new NotImplementedException();
+ }
+
+ public override object MapToProperty(AbstractDataMappingContext mappingContext)
+ {
+ var scConfig = Configuration as SitecoreQueryConfiguration;
+ var scContext = mappingContext as SitecoreDataMappingContext;
+
+ string query = ParseQuery(scConfig.Query, scContext.Item);
+
+ if (scConfig.PropertyInfo.PropertyType.IsGenericType)
+ {
+ Type outerType = Utilities.GetGenericOuter(scConfig.PropertyInfo.PropertyType);
+
+ if (typeof(IEnumerable<>) == outerType)
+ {
+ Type genericType = Utilities.GetGenericArgument(scConfig.PropertyInfo.PropertyType);
+
+ Func<IEnumerable<Item>> getItems = null;
+ if (scConfig.IsRelative)
+ {
+ getItems = new Func<IEnumerable<Item>>(() =>
+ {
+
+ return Utilities.GetLanguageItems(scContext.Item.Axes.SelectItems(query), scContext.Item.Language);
+ });
+ }
+ else
+ {
+ getItems = new Func<IEnumerable<Item>>(() =>
+ {
+ if (scConfig.UseQueryContext)
+ {
+ Query conQuery = new Query(query);
+ QueryContext queryContext = new QueryContext(scContext.Item.Database.DataManager);
+
+ object obj = conQuery.Execute(queryContext);
+ QueryContext[] contextArray = obj as QueryContext[];
+ QueryContext context = obj as QueryContext;
+
+ if (contextArray == null)
+ contextArray = new QueryContext[] { context };
+
+ return Utilities.GetLanguageItems(contextArray.Select(x => scContext.Item.Database.GetItem(x.ID)), scContext.Item.Language);
+ }
+ else
+ return Utilities.GetLanguageItems(scContext.Item.Database.SelectItems(query), scContext.Item.Language);
+ });
+ }
+ var array = getItems.Invoke().ToArray();
+
+
+ return scContext.Service.CreateClasses(scConfig.IsLazy, scConfig.InferType, genericType, getItems);
+ }
+ else throw new NotSupportedException("Generic type not supported {0}. Must be IEnumerable<>.".Formatted(outerType.FullName));
+ }
+ else
+ {
+ Item result = null;
+ if (scConfig.IsRelative)
+ {
+ result = Utilities.GetLanguageItem(scContext.Item.Axes.SelectSingleItem(query), scContext.Item.Language);
+ }
+ else
+ {
+ result = Utilities.GetLanguageItem(scContext.Item.Database.SelectSingleItem(query), scContext.Item.Language);
+ }
+ return scContext.Service.CreateClass(scConfig.PropertyInfo.PropertyType, result,scConfig.IsLazy, scConfig.InferType);
+ }
+ }
+
+
+
+
+ public override bool CanHandle(AbstractPropertyConfiguration configuration, Context context)
+ {
+ if (!(configuration is SitecoreQueryConfiguration)) return false;
+
+ if (configuration.PropertyInfo.PropertyType.IsGenericType)
+ {
+
+ Type outerType = Utilities.GetGenericOuter(configuration.PropertyInfo.PropertyType);
+ Type innerType = Utilities.GetGenericArgument(configuration.PropertyInfo.PropertyType);
+
+ return typeof (IEnumerable<>) == outerType && context.TypeConfigurations.ContainsKey(innerType);
+ }
+ else
+ {
+ return context.TypeConfigurations.ContainsKey(configuration.PropertyInfo.PropertyType);
+ }
+ }
+
+ public string ParseQuery(string query, Item item)
+ {
+ StringBuilder sb = new StringBuilder(query);
+ foreach (var param in _parameters)
+ {
+ sb.Replace("{" + param.Name + "}", param.GetValue(item));
+ }
+ return sb.ToString();
+ }
+
+
+ }
+}
View
14 Source/Glass.Mapper.Sc/DataMappers/SitecoreQueryParameters/ISitecoreQueryParameter.cs
@@ -0,0 +1,14 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using Sitecore.Data.Items;
+
+namespace Glass.Mapper.Sc.DataMappers.SitecoreQueryParameters
+{
+ public interface ISitecoreQueryParameter
+ {
+ string Name { get; }
+ string GetValue(Item item);
+ }
+}
View
25 Source/Glass.Mapper.Sc/DataMappers/SitecoreQueryParameters/ItemDateNowParameter.cs
@@ -0,0 +1,25 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace Glass.Mapper.Sc.DataMappers.SitecoreQueryParameters
+{
+ public class ItemDateNowParameter : ISitecoreQueryParameter
+ {
+
+ #region ISitecoreQueryParameter Members
+
+ public string Name
+ {
+ get { return "dataNow"; }
+ }
+
+ public string GetValue(global::Sitecore.Data.Items.Item item)
+ {
+ return global::Sitecore.DateUtil.ToIsoDate(DateTime.Now);
+ }
+
+ #endregion
+ }
+}
View
35 Source/Glass.Mapper.Sc/DataMappers/SitecoreQueryParameters/ItemEscapedPathParameter.cs
@@ -0,0 +1,35 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace Glass.Mapper.Sc.DataMappers.SitecoreQueryParameters
+{
+ public class ItemEscapedPathParameter : ISitecoreQueryParameter
+ {
+ #region ISitecoreQueryParameter Members
+
+ public string Name
+ {
+ get { return "escapedPath"; }
+ }
+
+ public string GetValue(global::Sitecore.Data.Items.Item item)
+ {
+ string path = item.Paths.FullPath;
+ string[] pathSections = path.Split('/');
+
+ StringBuilder escapedPath = new StringBuilder();
+
+ foreach (var pathSection in pathSections)
+ {
+ if (!string.IsNullOrEmpty(pathSection)) escapedPath.AppendFormat("/#{0}#", pathSection);
+ }
+
+ return escapedPath.ToString();
+ }
+
+ #endregion
+ }
+
+}
View
29 Source/Glass.Mapper.Sc/DataMappers/SitecoreQueryParameters/ItemIdNoBracketsParameter.cs
@@ -0,0 +1,29 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace Glass.Mapper.Sc.DataMappers.SitecoreQueryParameters
+{
+ public class ItemIdNoBracketsParameter : ISitecoreQueryParameter
+ {
+ #region ISitecoreQueryParameter Members
+
+ public string Name
+ {
+ get
+ {
+ return "id:N";
+ }
+
+ }
+
+ public string GetValue(global::Sitecore.Data.Items.Item item)
+ {
+ return item.ID.Guid.ToString("N");
+ }
+
+ #endregion
+ }
+
+}
View
28 Source/Glass.Mapper.Sc/DataMappers/SitecoreQueryParameters/ItemIdParameter.cs
@@ -0,0 +1,28 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace Glass.Mapper.Sc.DataMappers.SitecoreQueryParameters
+{
+ public class ItemIdParameter : ISitecoreQueryParameter
+ {
+ #region ISitecoreQueryParameter Members
+
+ public string Name
+ {
+ get
+ {
+ return "id";
+ }
+
+ }
+
+ public string GetValue(global::Sitecore.Data.Items.Item item)
+ {
+ return item.ID.ToString();
+ }
+
+ #endregion
+ }
+}
View
24 Source/Glass.Mapper.Sc/DataMappers/SitecoreQueryParameters/ItemPathParameter.cs
@@ -0,0 +1,24 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace Glass.Mapper.Sc.DataMappers.SitecoreQueryParameters
+{
+ public class ItemPathParameter : ISitecoreQueryParameter
+ {
+ #region ISitecoreQueryParameter Members
+
+ public string Name
+ {
+ get { return "path"; }
+ }
+
+ public string GetValue(global::Sitecore.Data.Items.Item item)
+ {
+ return item.Paths.FullPath;
+ }
+
+ #endregion
+ }
+}
View
21 Source/Glass.Mapper.Sc/Glass.Mapper.Sc.csproj
@@ -31,6 +31,14 @@
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
+ <Reference Include="Castle.Core, Version=3.1.0.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc, processorArchitecture=MSIL">
+ <SpecificVersion>False</SpecificVersion>
+ <HintPath>..\..\packages\Castle.Core.3.1.0\lib\net40-client\Castle.Core.dll</HintPath>
+ </Reference>
+ <Reference Include="Castle.Windsor, Version=3.1.0.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc, processorArchitecture=MSIL">
+ <SpecificVersion>False</SpecificVersion>
+ <HintPath>..\..\packages\Castle.Windsor.3.1.0\lib\net40\Castle.Windsor.dll</HintPath>
+ </Reference>
<Reference Include="Sitecore.Kernel">
<HintPath>..\..\Depends\Sitecore\bin\Sitecore.Kernel.dll</HintPath>
</Reference>
@@ -70,6 +78,7 @@
<Compile Include="Configuration\SitecoreQueryConfiguration.cs" />
<Compile Include="Configuration\SitecoreTypeConfiguration.cs" />
<Compile Include="DataMappers\AbstractSitecoreFieldMapper.cs" />
+ <Compile Include="DataMappers\SitecoreItemMapper.cs" />
<Compile Include="DataMappers\SitecoreFieldLongMapper.cs" />
<Compile Include="DataMappers\SitecoreFieldIntegerMapper.cs" />
<Compile Include="DataMappers\SitecoreFieldImageMapper.cs" />
@@ -91,13 +100,22 @@
<Compile Include="DataMappers\SitecoreFieldStringMapper.cs" />
<Compile Include="DataMappers\SitecoreIdMapper.cs" />
<Compile Include="DataMappers\SitecoreInfoMapper.cs" />
+ <Compile Include="DataMappers\SitecoreLinkedMapper.cs" />
<Compile Include="DataMappers\SitecoreParentMapper.cs" />
<Compile Include="DataMappers\SitecoreFieldTypeMapper.cs" />
+ <Compile Include="DataMappers\SitecoreQueryMapper.cs" />
+ <Compile Include="DataMappers\SitecoreQueryParameters\ISitecoreQueryParameter.cs" />
+ <Compile Include="DataMappers\SitecoreQueryParameters\ItemDateNowParameter.cs" />
+ <Compile Include="DataMappers\SitecoreQueryParameters\ItemEscapedPathParameter.cs" />
+ <Compile Include="DataMappers\SitecoreQueryParameters\ItemIdNoBracketsParameter.cs" />
+ <Compile Include="DataMappers\SitecoreQueryParameters\ItemIdParameter.cs" />
+ <Compile Include="DataMappers\SitecoreQueryParameters\ItemPathParameter.cs" />
<Compile Include="Fields\File.cs" />
<Compile Include="Fields\Image.cs" />
<Compile Include="Fields\Link.cs" />
<Compile Include="Fields\LinkType.cs" />
<Compile Include="Fields\TriState.cs" />
+ <Compile Include="GlassConfig.cs" />
<Compile Include="Global.cs" />
<Compile Include="ISitecoreService.cs" />
<Compile Include="ItemEditing.cs" />
@@ -126,6 +144,9 @@
<ItemGroup>
<Compile Include="Configuration\SitecorePropertyConfiguration.cs" />
</ItemGroup>
+ <ItemGroup>
+ <None Include="packages.config" />
+ </ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
View
50 ...lass.Mapper.Sc.Integration/GlassConfig.cs → Source/Glass.Mapper.Sc/GlassConfig.cs
@@ -16,20 +16,62 @@
using Glass.Mapper.Pipelines.TypeResolver;
using Glass.Mapper.Pipelines.TypeResolver.Tasks.StandardResolver;
using Glass.Mapper.Sc.DataMappers;
+using Glass.Mapper.Sc.DataMappers.SitecoreQueryParameters;
namespace Glass.Mapper.Sc.Integration
{
public class GlassConfig : GlassCastleConfigBase
{
public override void Configure(WindsorContainer container, string contextName)
{
- container.Register(
- Component.For<AbstractDataMapper>().ImplementedBy<SitecoreInfoMapper>().LifestyleTransient(),
- Component.For<AbstractDataMapper>().ImplementedBy<SitecoreIdMapper>().LifestyleTransient(),
+ //****** Data Mappers ******//
+ // Used to convert data to and from Sitecore
+ container.Register(
Component.For<AbstractDataMapper>().ImplementedBy<SitecoreChildrenMapper>().LifestyleTransient(),
- Component.For<AbstractDataMapper>().ImplementedBy<SitecoreParentMapper>().LifestyleTransient(),
+ Component.For<AbstractDataMapper>().ImplementedBy<SitecoreFieldBooleanMapper>().LifestyleTransient(),
+ Component.For<AbstractDataMapper>().ImplementedBy<SitecoreFieldDateTimeMapper>().LifestyleTransient(),
+ Component.For<AbstractDataMapper>().ImplementedBy<SitecoreFieldDecimalMapper>().LifestyleTransient(),
+ Component.For<AbstractDataMapper>().ImplementedBy<SitecoreFieldDoubleMapper>().LifestyleTransient(),
+ Component.For<AbstractDataMapper>().ImplementedBy<SitecoreFieldEnumMapper>().LifestyleTransient(),
+ Component.For<AbstractDataMapper>().ImplementedBy<SitecoreFieldFileMapper>().LifestyleTransient(),
+ Component.For<AbstractDataMapper>().ImplementedBy<SitecoreFieldFloatMapper>().LifestyleTransient(),
+ Component.For<AbstractDataMapper>().ImplementedBy<SitecoreFieldGuidMapper>().LifestyleTransient(),
+ Component.For<AbstractDataMapper>().ImplementedBy<SitecoreFieldIEnumerableMapper>().LifestyleTransient(),
+ Component.For<AbstractDataMapper>().ImplementedBy<SitecoreFieldImageMapper>().LifestyleTransient(),
+ Component.For<AbstractDataMapper>().ImplementedBy<SitecoreFieldIntegerMapper>().LifestyleTransient(),
+ Component.For<AbstractDataMapper>().ImplementedBy<SitecoreFieldLinkMapper>().LifestyleTransient(),
+ Component.For<AbstractDataMapper>().ImplementedBy<SitecoreFieldLongMapper>().LifestyleTransient(),
+ Component.For<AbstractDataMapper>().ImplementedBy<SitecoreFieldNameValueCollectionMapper>().LifestyleTransient(),
+ Component.For<AbstractDataMapper>().ImplementedBy<SitecoreFieldNullableDateTimeMapper>().LifestyleTransient(),
+ Component.For<AbstractDataMapper>().ImplementedBy<SitecoreFieldNullableDoubleMapper>().LifestyleTransient(),
+ Component.For<AbstractDataMapper>().ImplementedBy<SitecoreFieldNullableDecimalMapper>().LifestyleTransient(),
+ Component.For<AbstractDataMapper>().ImplementedBy<SitecoreFieldNullableFloatMapper>().LifestyleTransient(),
+ Component.For<AbstractDataMapper>().ImplementedBy<SitecoreFieldNullableGuidMapper>().LifestyleTransient(),
+ Component.For<AbstractDataMapper>().ImplementedBy<SitecoreFieldNullableIntMapper>().LifestyleTransient(),
+ Component.For<AbstractDataMapper>().ImplementedBy<SitecoreFieldRulesMapper>().LifestyleTransient(),
+ Component.For<AbstractDataMapper>().ImplementedBy<SitecoreFieldStreamMapper>().LifestyleTransient(),
Component.For<AbstractDataMapper>().ImplementedBy<SitecoreFieldStringMapper>().LifestyleTransient(),
+ Component.For<AbstractDataMapper>().ImplementedBy<SitecoreFieldTypeMapper>().LifestyleTransient(),
+ Component.For<AbstractDataMapper>().ImplementedBy<SitecoreIdMapper>().LifestyleTransient(),
+ Component.For<AbstractDataMapper>().ImplementedBy<SitecoreInfoMapper>().LifestyleTransient(),
+ Component.For<AbstractDataMapper>().ImplementedBy<SitecoreItemMapper>().LifestyleTransient(),
+ Component.For<AbstractDataMapper>().ImplementedBy<SitecoreLinkedMapper>().LifestyleTransient(),
+ Component.For<AbstractDataMapper>().ImplementedBy<SitecoreParentMapper>().LifestyleTransient(),
+ Component.For<AbstractDataMapper>().ImplementedBy<SitecoreQueryMapper>()
+ .DynamicParameters((k, d) =>
+ {
+ d["parameters"] = k.ResolveAll<ISitecoreQueryParameter>();
+ })
+ .LifestyleTransient(),
+
+ //****** SitecoreQueryMapper parameters ******//
+ // Used by the SitecoreQueryMapper to replace placeholders in queries
+ Component.For<ISitecoreQueryParameter>().ImplementedBy<ItemDateNowParameter>().LifestyleTransient(),
+ Component.For<ISitecoreQueryParameter>().ImplementedBy<ItemEscapedPathParameter>().LifestyleTransient(),
+ Component.For<ISitecoreQueryParameter>().ImplementedBy<ItemIdNoBracketsParameter>().LifestyleTransient(),
+ Component.For<ISitecoreQueryParameter>().ImplementedBy<ItemIdParameter>().LifestyleTransient(),
+ Component.For<ISitecoreQueryParameter>().ImplementedBy<ItemPathParameter>().LifestyleTransient(),
//****** Data Mapper Resolver Tasks ******//
View
14 Source/Glass.Mapper.Sc/ISitecoreService.cs
@@ -1,4 +1,5 @@
using System;
+using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
@@ -10,7 +11,16 @@ namespace Glass.Mapper.Sc
public interface ISitecoreService: IAbstractService
{
Database Database { get; }
- object CreateClass(Type type, Item item, bool isLazy = false, bool inferType = false);
-
+ object CreateClass(Type type, Item item, bool isLazy = false, bool inferType = false, params object[] constructorParameters);
+
+ /// <summary>
+ /// Create a collection of classes from the specified type
+ /// </summary>
+ /// <param name="isLazy">If true creates a proxy for each class</param>
+ /// <param name="type">The type to return</param>
+ /// <param name="getItems">A function that returns the list of items to load</param>
+ /// <param name="inferType">Infer the type to be loaded from the item template</param>
+ /// <returns>An enumerable of the items as the specified type</returns>
+ IEnumerable CreateClasses(bool isLazy, bool inferType, Type type, Func<IEnumerable<Item>> getItems);
}
}
View
3 Source/Glass.Mapper.Sc/LazyItemEnumerable.cs
@@ -16,14 +16,13 @@ public class LazyItemEnumerable<T> : LazyEnumerable<T> where T:class
public LazyItemEnumerable(
Func<IEnumerable<Item>> getItems,
- Type type,
bool isLazy,
bool inferType,
ISitecoreService service
)
{
_getItems = getItems;
- _type = type;
+ _type = typeof(T);
_isLazy = isLazy;
_inferType = inferType;
_service = service;
View
139 Source/Glass.Mapper.Sc/SitecoreService.cs
@@ -1,4 +1,5 @@
using System;
+using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
@@ -37,26 +38,39 @@ public SitecoreService(Database database, Context context)
}
- public T GetItem<T>(Guid id) where T:class
+ public T GetItem<T>(Guid id, bool isLazy = false, bool inferType = false) where T:class
{
var item = Database.GetItem(new ID(id));
- return CreateClass(typeof (T), item) as T;
+ return CreateClass(typeof (T), item, isLazy, inferType) as T;
}
+ public T GetItem<T>(string path, bool isLazy = false, bool inferType = false) where T : class
+ {
+ var item = Database.GetItem(path);
+ return CreateClass(typeof(T), item, isLazy, inferType) as T;
+ }
+
public void Save<T>(T obj)
{
//TODO: should this be a separate context
// SitecoreTypeContext context = new SitecoreTypeContext();
//TODO: ME - this may not work with a proxy
- var config = GlassContext[obj.GetType()] as SitecoreTypeConfiguration;
+ var config = GlassContext.GetTypeConfiguration(obj) as SitecoreTypeConfiguration;
+
+ if(config == null)
+ throw new NullReferenceException("Can not save class, could not find configuration for {0}".Formatted(typeof(T).FullName));
+
var item = config.ResolveItem(obj, Database);
if(item == null)
throw new MapperException("Could not save class, item not found");
SitecoreTypeSavingContext savingContext = new SitecoreTypeSavingContext();
savingContext.Config = config;
+
+ //ME-an item with no versions should be null
+
savingContext.Item = item;
savingContext.Object = obj;
@@ -67,14 +81,28 @@ public void Save<T>(T obj)
item.Editing.EndEdit();
}
- public object CreateClass(Type type, Item item, bool isLazy = false, bool inferType = false)
+
+ /// <summary>
+ ///
+ /// </summary>
+ /// <param name="type"></param>
+ /// <param name="item"></param>
+ /// <param name="isLazy"></param>
+ /// <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)
{
- if (item == null) return null;
+ if (item == null || item.Versions.Count == 0) return null;
+
+
+ if (constructorParameters != null && constructorParameters.Count() > 4)
+ throw new NotSupportedException("Maximum number of constructor parameters is 4");
SitecoreTypeCreationContext creationContext = new SitecoreTypeCreationContext();
creationContext.SitecoreService = this;
creationContext.RequestedType = type;
- creationContext.ConstructorParameters = null;
+ creationContext.ConstructorParameters = constructorParameters;
creationContext.Item = item;
creationContext.InferType = inferType;
creationContext.IsLazy = isLazy;
@@ -83,6 +111,19 @@ public object CreateClass(Type type, Item item, bool isLazy = false, bool inferT
return obj;
}
+ /// <summary>
+ /// Create a collection of classes from the specified type
+ /// </summary>
+ /// <param name="isLazy">If true creates a proxy for each class</param>
+ /// <param name="type">The type to return</param>
+ /// <param name="getItems">A function that returns the list of items to load</param>
+ /// <param name="inferType">Infer the type to be loaded from the item template</param>
+ /// <returns>An enumerable of the items as the specified type</returns>
+ public IEnumerable CreateClasses(bool isLazy, bool inferType, Type type, Func<IEnumerable<Item>> getItems)
+ {
+ return Utilities.CreateGenericType(typeof(LazyItemEnumerable<>), new Type[] { type }, getItems, isLazy, inferType, this) as IEnumerable;
+ }
+
public override AbstractDataMappingContext CreateDataMappingContext(AbstractTypeCreationContext abstractTypeCreationContext, Object obj)
{
var scTypeContext = abstractTypeCreationContext as SitecoreTypeCreationContext;
@@ -95,6 +136,92 @@ public override AbstractDataMappingContext CreateDataMappingContext(AbstractType
return new SitecoreDataMappingContext(scContext.Object, scContext.Item, this);
}
+
+ /// <summary>
+ /// Creates a class from the specified item
+ /// </summary>
+ /// <typeparam name="T">The type to return</typeparam>
+ /// <param name="isLazy">If true creates a proxy for the class</param>
+ /// <param name="item">The item to load data from</param>
+ /// <param name="inferType">Infer the type to be loaded from the template</param>
+ /// <returns>The item as the specified type</returns>
+ public T CreateClass<T>(Item item, bool isLazy, bool inferType) where T : class
+ {
+ return (T)CreateClass(typeof(T), item, isLazy, inferType);
+ }
+
+ /// <summary>
+ /// Creates a class from the specified item with a single constructor parameter
+ /// </summary>
+ /// <typeparam name="T">The type to return</typeparam>
+ /// <typeparam name="K">The type of the first constructor parameter</typeparam>
+ /// <param name="isLazy">If true creates a proxy for the class</param>
+ /// <param name="item">The item to load data from</param>
+ /// <param name="inferType">Infer the type to be loaded from the template</param>
+ /// <param name="param1">The value of the first parameter of the constructor</param>
+ /// <returns>The item as the specified type</returns>
+ public T CreateClass<T, K>(Item item, bool isLazy, bool inferType, K param1)
+ {
+ return (T)CreateClass(typeof(T), item, isLazy, inferType, param1);
+
+ }
+
+ /// <summary>
+ /// Creates a class from the specified item with a two constructor parameter
+ /// </summary>
+ /// <typeparam name="T">The type to return</typeparam>
+ /// <typeparam name="K">The type of the first constructor parameter</typeparam>
+ /// <typeparam name="L">The type of the second constructor parameter</typeparam>
+ /// <param name="isLazy">If true creates a proxy for the class</param>
+ /// <param name="item">The item to load data from</param>
+ /// <param name="inferType">Infer the type to be loaded from the template</param>
+ /// <param name="param1">The value of the first parameter of the constructor</param>
+ /// <param name="param2">The value of the second parameter of the constructor</param>
+ /// <returns>The item as the specified type</returns>
+ public T CreateClass<T, K, L>(Item item, bool isLazy, bool inferType, K param1, L param2)
+ {
+ return (T)CreateClass(typeof(T), item, isLazy, inferType, param1, param2);
+ }
+
+ /// <summary>
+ /// Creates a class from the specified item with a two constructor parameter
+ /// </summary>
+ /// <typeparam name="T">The type to return</typeparam>
+ /// <typeparam name="K">The type of the first constructor parameter</typeparam>
+ /// <typeparam name="L">The type of the second constructor parameter</typeparam>
+ /// <typeparam name="M">The type of the third constructor parameter</typeparam>
+ /// <param name="isLazy">If true creates a proxy for the class</param>
+ /// <param name="item">The item to load data from</param>
+ /// <param name="inferType">Infer the type to be loaded from the template</param>
+ /// <param name="param1">The value of the first parameter of the constructor</param>
+ /// <param name="param2">The value of the second parameter of the constructor</param>
+ /// <param name="param3">The value of the third parameter of the constructor</param>
+ /// <returns>The item as the specified type</returns>
+ public T CreateClass<T, K, L, M>(Item item, bool isLazy, bool inferType, K param1, L param2, M param3)
+ {
+ return (T)CreateClass(typeof(T), item, isLazy, inferType, param1, param2, param3);
+ }
+
+ /// <summary>
+ /// Creates a class from the specified item with a two constructor parameter
+ /// </summary>
+ /// <typeparam name="T">The type to return</typeparam>
+ /// <typeparam name="K">The type of the first constructor parameter</typeparam>
+ /// <typeparam name="L">The type of the second constructor parameter</typeparam>
+ /// <typeparam name="M">The type of the third constructor parameter</typeparam>
+ /// <typeparam name="N">The type of the fourth constructor parameter</typeparam>
+ /// <param name="isLazy">If true creates a proxy for the class</param>
+ /// <param name="item">The item to load data from</param>
+ /// <param name="inferType">Infer the type to be loaded from the template</param>
+ /// <param name="param1">The value of the first parameter of the constructor</param>
+ /// <param name="param2">The value of the second parameter of the constructor</param>
+ /// <param name="param3">The value of the third parameter of the constructor</param>
+ /// <param name="param4">The value of the fourth parameter of the constructor</param>
+ /// <returns>The item as the specified type</returns>
+ public T CreateClass<T, K, L, M, N>(Item item, bool isLazy, bool inferType, K param1, L param2, M param3, N param4)
+ {
+ return (T)CreateClass(typeof(T), item, isLazy, inferType, param1, param2, param3, param4);
+ }
}
}
View
23 Source/Glass.Mapper.Sc/Utilities.cs
@@ -7,6 +7,7 @@
using Sitecore.Data;
using Sitecore.Data.Fields;
using Sitecore.Data.Items;
+using Sitecore.Globalization;
using Sitecore.Links;
namespace Glass.Mapper.Sc
@@ -103,5 +104,27 @@ public static string ConstructQueryString(NameValueCollection parameters)
return String.Empty;
}
+
+ public static Type GetGenericOuter(Type type)
+ {
+ return type.GetGenericTypeDefinition();
+ }
+
+ public static Item GetLanguageItem(Item foundItem, Language language)
+ {
+ if (foundItem == null) return null;
+
+ var item = foundItem.Database.GetItem(foundItem.ID, language);
+ if (item.Versions.Count > 0)
+ return item;
+ else
+ return null;
+ }
+ public static IEnumerable<Item> GetLanguageItems(IEnumerable<Item> foundItems, Language language)
+ {
+ if (foundItems == null) return Enumerable.Empty<Item>();
+
+ return foundItems.Select(x => Utilities.GetLanguageItem(x, language)).Where(x => x != null);
+ }
}
}
View
5 Source/Glass.Mapper.Sc/packages.config
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<packages>
+ <package id="Castle.Core" version="3.1.0" targetFramework="net40" />
+ <package id="Castle.Windsor" version="3.1.0" targetFramework="net40" />
+</packages>
View
6 Source/Glass.Mapper/Configuration/Attributes/NodeAttribute.cs
@@ -8,11 +8,8 @@ namespace Glass.Mapper.Configuration.Attributes
{
public abstract class NodeAttribute : AbstractPropertyAttribute
{
- public Type Type { get; set; }
-
- public NodeAttribute(Type type)
+ public NodeAttribute()
{
- Type = type;
IsLazy = true;
}
@@ -40,7 +37,6 @@ public void Configure(PropertyInfo propertyInfo, NodeConfiguration config)
config.Id = this.Id;
config.IsLazy = this.IsLazy;
config.Path = this.Path;
- config.Type = this.Type;
base.Configure(propertyInfo, config);
}
View
2 Source/Glass.Mapper/Configuration/NodeConfiguration.cs
@@ -13,6 +13,6 @@ public class NodeConfiguration : AbstractPropertyConfiguration
public string Path { get; set; }
- public Type Type { get; set; }
+ public bool InferType { get; set; }
}
}
View
22 Source/Glass.Mapper/Context.cs
@@ -156,5 +156,27 @@ private void ProcessProperties(IEnumerable<AbstractPropertyConfiguration> proper
property.Mapper = args.Result;
}
}
+
+ public AbstractTypeConfiguration GetTypeConfiguration(object obj)
+ {
+ var type = obj.GetType();
+ var config = TypeConfigurations.ContainsKey(type) ? TypeConfigurations[type] : null;
+
+ if (config != null) return config;
+
+ //check base type encase of proxy
+ config = TypeConfigurations.ContainsKey(type.BaseType) ? TypeConfigurations[type.BaseType] : null;
+
+ if (config != null) return config;
+
+ //check interfaces encase this is an interface proxy
+ string name = type.Name;
+ var interfaceType = type.GetInterfaces().FirstOrDefault(x => name.Contains(x.Name));
+
+ if (interfaceType != null)
+ config = TypeConfigurations.ContainsKey(interfaceType) ? TypeConfigurations[interfaceType] : null;
+
+ return config;
+ }
}
}
View
4 Source/Glass.Mapper/Pipelines/ObjectConstruction/Tasks/CreateConcrete/CreateConcreteTask.cs
@@ -73,8 +73,8 @@ protected virtual object CreateObject(ObjectConstructionArgs args)
.Aggregate((x, y) => x + "," + y)));
Delegate conMethod = args.Configuration.ConstructorMethods[constructor];
-
- var obj = conMethod.DynamicInvoke(parameters);
+
+ var obj = conMethod.DynamicInvoke(constructorParameters);
//create properties
AbstractDataMappingContext dataMappingContext = args.Service.CreateDataMappingContext(args.AbstractTypeCreationContext, obj);
View
43 ...Mapper/Pipelines/ObjectConstruction/Tasks/CreateInterface/InterfacePropertyInterceptor.cs
@@ -8,12 +8,53 @@ namespace Glass.Mapper.Pipelines.ObjectConstruction.Tasks.CreateInterface
{
public class InterfacePropertyInterceptor : IInterceptor
{
+ private readonly ObjectConstructionArgs _args;
+ Dictionary<string, object> _values;
+ bool _isLoaded = false;
+
public InterfacePropertyInterceptor(ObjectConstructionArgs args)
{
+ _args = args;
}
+
public void Intercept(IInvocation invocation)
{
- throw new NotImplementedException();
+ //do initial gets
+ if (!_isLoaded)
+ {
+ _values = new Dictionary<string, object>();
+ var config = _args.Configuration;
+ var mappingContext = _args.Service.CreateDataMappingContext(_args.AbstractTypeCreationContext, null);
+
+ foreach (var property in config.Properties)
+ {
+ var result = property.Mapper.MapToProperty(mappingContext);
+ _values[property.PropertyInfo.Name] = result;
+ }
+ _isLoaded = true;
+ }
+
+ if (invocation.Method.IsSpecialName)
+ {
+ if (invocation.Method.Name.StartsWith("get_") || invocation.Method.Name.StartsWith("set_"))
+ {
+
+ string method = invocation.Method.Name.Substring(0, 4);
+ string name = invocation.Method.Name.Substring(4);
+
+ if (method == "get_")
+ {
+ var result = _values[name];
+ invocation.ReturnValue = result;
+ }
+ else if (method == "set_")
+ {
+ _values[name] = invocation.Arguments[0];
+ }
+ else
+ throw new MapperException("Method with name {0}{1} on type {2} not supported.".Formatted(method, name, _args.Configuration.Type.FullName));
+ }
+ }
}
}
}
View
1 Source/Glass.Mapper/Utilities.cs
@@ -10,6 +10,7 @@ namespace Glass.Mapper
public static class Utilities
{
+
/// <summary>
/// Returns a delegate method that will load a class based on its constuctor
/// </summary>
View
144 ...ion Tests/Sitecore/Glass.Mapper.Sc.Integration.Tds/Glass.Mapper.Sc.Integration.Tds.scproj
@@ -26,8 +26,8 @@
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
<DebugSymbols>true</DebugSymbols>
<OutputPath>.\Debug\</OutputPath>
- <RecursiveDeployAction>SitecoreRecycle</RecursiveDeployAction>
- <SitecoreDeployFolder>C:\Git\Glass.Mapper\Sites\Sitecore\Glass.Mapper.Sites.Sc</SitecoreDeployFolder>
+ <RecursiveDeployAction>Ignore</RecursiveDeployAction>
+ <SitecoreDeployFolder>F:\Glass\Glass.Mapper\Sites\Sitecore\Glass.Mapper.Sites.Sc</SitecoreDeployFolder>
<SitecoreWebUrl>http://sitecore.glass.com</SitecoreWebUrl>
<SitecoreAccessGuid>fd21ce01-25b5-4388-a335-6211a7a211b9</SitecoreAccessGuid>
<InstallSitecoreConnector>True</InstallSitecoreConnector>
@@ -441,6 +441,41 @@
<ChildItemSynchronization>KeepAllChildrenSynchronized</ChildItemSynchronization>
<ItemDeployment>AlwaysUpdate</ItemDeployment>
</SitecoreItem>
+ <SitecoreItem Include="sitecore\content\Tests\DataMappers\SitecoreItemMapper.item">
+ <Icon>/temp/IconCache/Applications/16x16/folder.png</Icon>
+ <ChildItemSynchronization>KeepAllChildrenSynchronized</ChildItemSynchronization>
+ <ItemDeployment>AlwaysUpdate</ItemDeployment>
+ </SitecoreItem>
+ <SitecoreItem Include="sitecore\content\Tests\DataMappers\SitecoreItemMapper\Source.item">
+ <Icon>/temp/IconCache/Applications/32x32/Document.png</Icon>
+ <ChildItemSynchronization>KeepAllChildrenSynchronized</ChildItemSynchronization>
+ <ItemDeployment>AlwaysUpdate</ItemDeployment>
+ </SitecoreItem>
+ <SitecoreItem Include="sitecore\content\Tests\DataMappers\SitecoreItemMapper\Target.item">
+ <Icon>/temp/IconCache/Applications/32x32/form_blue.png</Icon>
+ <ChildItemSynchronization>KeepAllChildrenSynchronized</ChildItemSynchronization>
+ <ItemDeployment>AlwaysUpdate</ItemDeployment>
+ </SitecoreItem>
+ <SitecoreItem Include="sitecore\content\Tests\DataMappers\SitecoreItemMapper\TargetOneLanguage.item">
+ <Icon>/temp/IconCache/Applications/32x32/form_blue.png</Icon>
+ <ChildItemSynchronization>KeepAllChildrenSynchronized</ChildItemSynchronization>
+ <ItemDeployment>AlwaysUpdate</ItemDeployment>
+ </SitecoreItem>
+ <SitecoreItem Include="sitecore\content\Tests\DataMappers\SitecoreLinkedMapper.item">
+ <Icon>/temp/IconCache/Applications/16x16/folder.png</Icon>
+ <ChildItemSynchronization>KeepAllChildrenSynchronized</ChildItemSynchronization>
+ <ItemDeployment>AlwaysUpdate</ItemDeployment>
+ </SitecoreItem>
+ <SitecoreItem Include="sitecore\content\Tests\DataMappers\SitecoreLinkedMapper\Source.item">
+ <Icon>/temp/IconCache/Applications/32x32/form_blue.png</Icon>
+ <ChildItemSynchronization>KeepAllChildrenSynchronized</ChildItemSynchronization>
+ <ItemDeployment>AlwaysUpdate</ItemDeployment>
+ </SitecoreItem>
+ <SitecoreItem Include="sitecore\content\Tests\DataMappers\SitecoreLinkedMapper\Target.item">
+ <Icon>/temp/IconCache/Applications/32x32/form_blue.png</Icon>
+ <ChildItemSynchronization>KeepAllChildrenSynchronized</ChildItemSynchronization>
+ <ItemDeployment>AlwaysUpdate</ItemDeployment>
+ </SitecoreItem>
<SitecoreItem Include="sitecore\content\Tests\DataMappers\SitecoreParentMapperFixture.item">
<Icon>/temp/IconCache/Applications/16x16/folder.png</Icon>
<ChildItemSynchronization>KeepAllChildrenSynchronized</ChildItemSynchronization>
@@ -451,11 +486,91 @@
<ChildItemSynchronization>KeepAllChildrenSynchronized</ChildItemSynchronization>
<ItemDeployment>AlwaysUpdate</ItemDeployment>
</SitecoreItem>
+ <SitecoreItem Include="sitecore\content\Tests\DataMappers\SitecoreQueryMapper.item">
+ <Icon>/temp/IconCache/Applications/16x16/folder.png</Icon>
+ <ChildItemSynchronization>KeepAllChildrenSynchronized</ChildItemSynchronization>
+ <ItemDeployment>AlwaysUpdate</ItemDeployment>
+ </SitecoreItem>
+ <SitecoreItem Include="sitecore\content\Tests\DataMappers\SitecoreQueryMapper\Results.item">
+ <Icon>/temp/IconCache/Applications/16x16/folder.png</Icon>
+ <ChildItemSynchronization>KeepAllChildrenSynchronized</ChildItemSynchronization>
+ <ItemDeployment>AlwaysUpdate</ItemDeployment>
+ </SitecoreItem>
+ <SitecoreItem Include="sitecore\content\Tests\DataMappers\SitecoreQueryMapper\Results\Result1.item">
+ <Icon>/temp/IconCache/Applications/32x32/Document.png</Icon>
+ <ChildItemSynchronization>KeepAllChildrenSynchronized</ChildItemSynchronization>
+ <ItemDeployment>AlwaysUpdate</ItemDeployment>
+ </SitecoreItem>
+ <SitecoreItem Include="sitecore\content\Tests\DataMappers\SitecoreQueryMapper\Results\Result2.item">
+ <Icon>/temp/IconCache/Applications/32x32/Document.png</Icon>
+ <ChildItemSynchronization>KeepAllChildrenSynchronized</ChildItemSynchronization>
+ <ItemDeployment>AlwaysUpdate</ItemDeployment>
+ </SitecoreItem>
+ <SitecoreItem Include="sitecore\content\Tests\DataMappers\SitecoreQueryMapper\Source.item">
+ <Icon>/temp/IconCache/Applications/32x32/Document.png</Icon>
+ <ChildItemSynchronization>KeepAllChildrenSynchronized</ChildItemSynchronization>
+ <ItemDeployment>AlwaysUpdate</ItemDeployment>
+ </SitecoreItem>
+ <SitecoreItem Include="sitecore\content\Tests\DataMappers\SitecoreQueryParameters.item">
+ <Icon>/temp/IconCache/Applications/16x16/folder.png</Icon>
+ <ChildItemSynchronization>KeepAllChildrenSynchronized</ChildItemSynchronization>
+ <ItemDeployment>AlwaysUpdate</ItemDeployment>
+ </SitecoreItem>
+ <SitecoreItem Include="sitecore\content\Tests\DataMappers\SitecoreQueryParameters\ItemDateNowParameter.item">
+ <Icon>/temp/IconCache/Applications/16x16/folder.png</Icon>
+ <ChildItemSynchronization>KeepAllChildrenSynchronized</ChildItemSynchronization>
+ <ItemDeployment>AlwaysUpdate</ItemDeployment>
+ </SitecoreItem>
+ <SitecoreItem Include="sitecore\content\Tests\DataMappers\SitecoreQueryParameters\ItemEscapedPathParameter.item">
+ <Icon>/temp/IconCache/Applications/16x16/folder.png</Icon>
+ <ChildItemSynchronization>KeepAllChildrenSynchronized</ChildItemSynchronization>
+ <ItemDeployment>AlwaysUpdate</ItemDeployment>
+ </SitecoreItem>
+ <SitecoreItem Include="sitecore\content\Tests\DataMappers\SitecoreQueryParameters\ItemIdNoBracketsParameter.item">
+ <Icon>/temp/IconCache/Applications/16x16/folder.png</Icon>
+ <ChildItemSynchronization>KeepAllChildrenSynchronized</ChildItemSynchronization>
+ <ItemDeployment>AlwaysUpdate</ItemDeployment>
+ </SitecoreItem>
+ <SitecoreItem Include="sitecore\content\Tests\DataMappers\SitecoreQueryParameters\ItemIdParameter.item">
+ <Icon>/temp/IconCache/Applications/16x16/folder.png</Icon>
+ <ChildItemSynchronization>KeepAllChildrenSynchronized</ChildItemSynchronization>
+ <ItemDeployment>AlwaysUpdate</ItemDeployment>
+ </SitecoreItem>
+ <SitecoreItem Include="sitecore\content\Tests\DataMappers\SitecoreQueryParameters\ItemPathParameter.item">
+ <Icon>/temp/IconCache/Applications/16x16/folder.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>
<ChildItemSynchronization>NoChildSynchronization</ChildItemSynchronization>
</SitecoreItem>
+ <SitecoreItem Include="sitecore\content\Tests\SitecoreService\CreateClass.item">
+ <Icon>/temp/IconCache/Applications/16x16/folder.png</Icon>
+ <ItemDeployment>AlwaysUpdate</ItemDeployment>
+ <ChildItemSynchronization>KeepAllChildrenSynchronized</ChildItemSynchronization>
+ </SitecoreItem>
+ <SitecoreItem Include="sitecore\content\Tests\SitecoreService\CreateClass\Target.item">
+ <Icon>/temp/IconCache/Applications/32x32/Document.png</Icon>
+ <ChildItemSynchronization>KeepAllChildrenSynchronized</ChildItemSynchronization>
+ <ItemDeployment>AlwaysUpdate</ItemDeployment>
+ </SitecoreItem>
+ <SitecoreItem Include="sitecore\content\Tests\SitecoreService\CreateClasses.item">
+ <Icon>/temp/IconCache/Applications/16x16/folder.png</Icon>
+ <ItemDeployment>AlwaysUpdate</ItemDeployment>
+ <ChildItemSynchronization>KeepAllChildrenSynchronized</ChildItemSynchronization>
+ </SitecoreItem>
+ <SitecoreItem Include="sitecore\content\Tests\SitecoreService\CreateClasses\Result1.item">
+ <Icon>/temp/IconCache/Applications/32x32/Document.png</Icon>
+ <ChildItemSynchronization>KeepAllChildrenSynchronized</ChildItemSynchronization>
+ <ItemDeployment>AlwaysUpdate</ItemDeployment>
+ </SitecoreItem>
+ <SitecoreItem Include="sitecore\content\Tests\SitecoreService\CreateClasses\Result2.item">
+ <Icon>/temp/IconCache/Applications/32x32/Document.png</Icon>
+ <ChildItemSynchronization>KeepAllChildrenSynchronized</ChildItemSynchronization>
+ <ItemDeployment>AlwaysUpdate</ItemDeployment>
+ </SitecoreItem>
<SitecoreItem Include="sitecore\content\Tests\SitecoreService\GetItem.item">
<Icon>/temp/IconCache/Applications/16x16/folder.png</Icon>
<ItemDeployment>AlwaysUpdate</ItemDeployment>
@@ -466,6 +581,31 @@
<ItemDeployment>AlwaysUpdate</ItemDeployment>
<ChildItemSynchronization>NoChildSynchronization</ChildItemSynchronization>
</SitecoreItem>
+ <SitecoreItem Include="sitecore\content\Tests\SitecoreService\Save.item">
+ <Icon>/temp/IconCache/Applications/16x16/folder.png</Icon>
+ <ItemDeployment>AlwaysUpdate</ItemDeployment>
+ <ChildItemSynchronization>KeepAllChildrenSynchronized</ChildItemSynchronization>
+ </SitecoreItem>
+ <SitecoreItem Include="sitecore\content\Tests\SitecoreService\Save\EmptyItem.item">
+ <Icon>/temp/IconCache/Applications/32x32/Document.png</Icon>
+ <ChildItemSynchronization>KeepAllChildrenSynchronized</ChildItemSynchronization>
+ <ItemDeployment>AlwaysUpdate</ItemDeployment>
+ </SitecoreItem>
+ <SitecoreItem Include="sitecore\system.item">
+ <Icon>/temp/IconCache/People/16x16/workstation1.png</Icon>
+ <ChildItemSynchronization>NoChildSynchronization</ChildItemSynchronization>
+ <ItemDeployment>AlwaysUpdate</ItemDeployment>
+ </SitecoreItem>
+ <SitecoreItem Include="sitecore\system\Languages.item">
+ <Icon>/temp/IconCache/Flags/16x16/flag_generic.png</Icon>
+ <ItemDeployment>AlwaysUpdate</ItemDeployment>
+ <ChildItemSynchronization>NoChildSynchronization</ChildItemSynchronization>
+ </SitecoreItem>
+ <SitecoreItem Include="sitecore\system\Languages\af-ZA.item">
+ <Icon>/temp/IconCache/flags/16x16/flag_South_Africa.PNG</Icon>
+ <ItemDeployment>AlwaysUpdate</ItemDeployment>
+ <ChildItemSynchronization>NoChildSynchronization</ChildItemSynchronization>
+ </SitecoreItem>
<SitecoreItem Include="sitecore\templates.item">
<Icon>/temp/IconCache/Applications/16x16/form_blue.png</Icon>
<ChildItemSynchronization>NoChildSynchronization</ChildItemSynchronization>
View
51 ...lass.Mapper.Sc.Integration.Tds/sitecore/content/Tests/DataMappers/SitecoreItemMapper.item
@@ -0,0 +1,51 @@
+----item----
+version: 1
+id: {D14070A3-FD00-4A8F-968F-8D760BCDF2F2}
+database: master
+path: /sitecore/content/Tests/DataMappers/SitecoreItemMapper
+parent: {949328F9-AB43-4AA8-9B09-B3FF0C0F1C7B}
+name: SitecoreItemMapper
+master: {00000000-0000-0000-0000-000000000000}
+template: {A87A00B1-E6DB-45AB-8B54-636FEC3B5523}
+templatekey: Folder
+
+----version----
+language: en
+version: 1
+revision: df05280a-025a-47b7-83f4-0a8c5d381269
+
+----field----
+field: {25BED78C-4957-4165-998A-CA1B52F67497}
+name: __Created
+key: __created
+content-length: 15
+
+20121230T200507
+----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
+
+df05280a-025a-47b7-83f4-0a8c5d381269
+----field----
+field: {D9CF14B1-FA16-4BA6-9288-E8A174D4D522}
+name: __Updated
+key: __updated
+content-length: 34
+
+20121230T200523:634924947232623811
+----field----
+field: {BADD9CF9-53E0-4D0C-BCC0-2D784C282F6A}
+name: __Updated by
+key: __updated by
+content-length: 14
+
+sitecore\admin
View
105 ...pper.Sc.Integration.Tds/sitecore/content/Tests/DataMappers/SitecoreItemMapper/Source.item
@@ -0,0 +1,105 @@
+----item----
+version: 1
+id: {489ACA19-145A-4935-B352-14C7EDB54697}
+database: master
+path: /sitecore/content/Tests/DataMappers/SitecoreItemMapper/Source
+parent: {D14070A3-FD00-4A8F-968F-8D760BCDF2F2}
+name: Source
+master: {00000000-0000-0000-0000-000000000000}
+template: {C586447C-8D3D-46D1-B987-09883DCDCFE7}
+templatekey: DataMappersEmptyItem
+
+----version----
+language: af-ZA
+version: 1
+revision: cfbec0e2-7871-43bf-a167-68063b138e8f
+
+----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
+
+20121230T204449
+----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
+
+cfbec0e2-7871-43bf-a167-68063b138e8f
+----field----
+field: {D9CF14B1-FA16-4BA6-9288-E8A174D4D522}
+name: __Updated
+key: __updated
+content-length: 34
+
+20121230T204449:634924970898317411
+----field----
+field: {BADD9CF9-53E0-4D0C-BCC0-2D784C282F6A}
+name: __Updated by
+key: __updated by
+content-length: 14
+
+sitecore\admin
+----version----
+language: en
+version: 1
+revision: 44e280b9-b1ae-428a-a7f9-faf165e4e37d
+
+----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
+
+20121230T201715
+----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
+
+44e280b9-b1ae-428a-a7f9-faf165e4e37d
+----field----
+field: {D9CF14B1-FA16-4BA6-9288-E8A174D4D522}
+name: __Updated
+key: __updated
+content-length: 34
+
+20121230T201715:634924954353731115
+----field----
+field: {BADD9CF9-53E0-4D0C-BCC0-2D784C282F6A}
+name: __Updated by
+key: __updated by
+content-length: 14
+
+sitecore\admin
View
112 ...pper.Sc.Integration.Tds/sitecore/content/Tests/DataMappers/SitecoreItemMapper/Target.item
@@ -0,0 +1,112 @@
+----item----
+version: 1
+id: {EC4351CE-C5F1-4F01-B354-3D26DC7A66CD}
+database: master
+path: /sitecore/content/Tests/DataMappers/SitecoreItemMapper/Target
+parent: {D14070A3-FD00-4A8F-968F-8D760BCDF2F2}
+name: Target
+master: {00000000-0000-0000-0000-000000000000}
+template: {3A1B89BA-3885-4BD6-8326-67605764676C}
+templatekey: DataMappersSingleField
+
+----version----
+language: af-ZA
+version: 1
+revision: 1a160f85-c84e-46cc-a746-b79825ec93d4
+
+----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
+
+20121230T204440
+----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
+
+1a160f85-c84e-46cc-a746-b79825ec93d4
+----field----
+field: {D9CF14B1-FA16-4BA6-9288-E8A174D4D522}
+name: __Updated
+key: __updated
+content-length: 34
+
+20121230T204440:634924970808572278
+----field----
+field: {BADD9CF9-53E0-4D0C-BCC0-2D784C282F6A}
+name: __Updated by
+key: __updated by
+content-length: 14
+
+sitecore\admin
+----version----
+language: en
+version: 1
+revision: 501603d8-0e61-4c31-93c3-1360c8a8cae7
+
+----field----
+field: {6B43481F-F129-4F53-BEEE-EA84F9B1A6D4}
+name: Field
+key: field
+content-length: 7
+
+English
+----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
+
+20121230T201302
+----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
+
+501603d8-0e61-4c31-93c3-1360c8a8cae7
+----field----
+field: {D9CF14B1-FA16-4BA6-9288-E8A174D4D522}
+name: __Updated
+key: __updated
+content-length: 34
+
+20121230T201310:634924951901020828
+----field----
+field: {BADD9CF9-53E0-4D0C-BCC0-2D784C282F6A}
+name: __Updated by
+key: __updated by
+content-length: 14
+
+sitecore\admin
View
58 ...egration.Tds/sitecore/content/Tests/DataMappers/SitecoreItemMapper/TargetOneLanguage.item
@@ -0,0 +1,58 @@
+----item----
+version: 1
+id: {03CDE6B5-B2A2-40D6-A944-53D66DDD2CA4}
+database: master
+path: /sitecore/content/Tests/DataMappers/SitecoreItemMapper/TargetOneLanguage
+parent: {D14070A3-FD00-4A8F-968F-8D760BCDF2F2}
+name: TargetOneLanguage
+master: {00000000-0000-0000-0000-000000000000}
+template: {3A1B89BA-3885-4BD6-8326-67605764676C}
+templatekey: DataMappersSingleField
+
+----version----
+language: en
+version: 1
+revision: 53e2c6c8-690c-48eb-98b6-331867db3662
+
+----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
+
+20121230T205419
+----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
+
+53e2c6c8-690c-48eb-98b6-331867db3662
+----field----
+field: {D9CF14B1-FA16-4BA6-9288-E8A174D4D522}
+name: __Updated
+key: __updated
+content-length: 34
+
+20121230T205419:634924976595593276
+----field----
+field: {BADD9CF9-53E0-4D0C-BCC0-2D784C282F6A}
+name: __Updated by
+key: __updated by
+content-length: 14
+
+sitecore\admin
View
51 ...ss.Mapper.Sc.Integration.Tds/sitecore/content/Tests/DataMappers/SitecoreLinkedMapper.item
@@ -0,0 +1,51 @@
+----item----
+version: 1
+id: {5ACF8AD0-15B0-4650-A185-C867E1E50A31}
+database: master
+path: /sitecore/content/Tests/DataMappers/SitecoreLinkedMapper
+parent: {949328F9-AB43-4AA8-9B09-B3FF0C0F1C7B}
+name: SitecoreLinkedMapper
+master: {00000000-0000-0000-0000-000000000000}
+template: {A87A00B1-E6DB-45AB-8B54-636FEC3B5523}
+templatekey: Folder
+
+----version----
+language: en
+version: 1
+revision: 65d1158f-cad1-43ab-bd93-05d92cf6dd2f
+
+----field----
+field: {25BED78C-4957-4165-998A-CA1B52F67497}
+name: __Created
+key: __created
+content-length: 15
+
+20121231T101710
+----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
+
+65d1158f-cad1-43ab-bd93-05d92cf6dd2f
+----field----
+field: {D9CF14B1-FA16-4BA6-9288-E8A174D4D522}
+name: __Updated
+key: __updated
+content-length: 34
+
+20121231T101717:634925458370549544
+----field----
+field: {BADD9CF9-53E0-4D0C-BCC0-2D784C282F6A}
+name: __Updated by
+key: __updated by
+content-length: 14
+
+sitecore\admin
View
58 ...er.Sc.Integration.Tds/sitecore/content/Tests/DataMappers/SitecoreLinkedMapper/Source.item
@@ -0,0 +1,58 @@
+----item----
+version: 1
+id: {CD5EA8B6-71C1-4076-8FA5-EF53F0BD4074}
+database: master
+path: /sitecore/content/Tests/DataMappers/SitecoreLinkedMapper/Source
+parent: {5ACF8AD0-15B0-4650-A185-C867E1E50A31}
+name: Source
+master: {00000000-0000-0000-0000-000000000000}
+template: {EA18940A-ACC5-4450-8176-AE3AC15A8CC4}
+templatekey: DataMapperRichTextField
+
+----version----
+language: en
+version: 1
+revision: 13415a90-d2ce-4e34-912d-0cecc27e32c5
+
+----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
+
+20121231T102030
+----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
+
+13415a90-d2ce-4e34-912d-0cecc27e32c5
+----field----
+field: {D9CF14B1-FA16-4BA6-9288-E8A174D4D522}
+name: __Updated
+key: __updated
+content-length: 34
+
+20121231T102030:634925460309610452
+----field----
+field: {BADD9CF9-53E0-4D0C-BCC0-2D784C282F6A}
+name: __Updated by
+key: __updated by
+content-length: 14
+
+sitecore\admin
View
58 ...er.Sc.Integration.Tds/sitecore/content/Tests/DataMappers/SitecoreLinkedMapper/Target.item
@@ -0,0 +1,58 @@
+----item----
+version: 1
+id: {216C0015-8626-4951-9730-85BCA34EC2A3}
+database: master
+path: /sitecore/content/Tests/DataMappers/SitecoreLinkedMapper/Target
+parent: {5ACF8AD0-15B0-4650-A185-C867E1E50A31}
+name: Target
+master: {00000000-0000-0000-0000-000000000000}
+template: {3A1B89BA-3885-4BD6-8326-67605764676C}
+templatekey: DataMappersSingleField
+
+----version----
+language: en
+version: 1
+revision: becae479-f0ca-490a-b4a3-e93bc6b177c0
+
+----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
+
+20121231T101735
+----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
+
+becae479-f0ca-490a-b4a3-e93bc6b177c0
+----field----
+field: {D9CF14B1-FA16-4BA6-9288-E8A174D4D522}
+name: __Updated
+key: __updated
+content-length: 34
+
+20130101T141023:634926462235847860
+----field----
+field: {BADD9CF9-53E0-4D0C-BCC0-2D784C282F6A}
+name: __Updated by
+key: __updated by
+content-length: 14
+
+sitecore\admin
View
51 ...ass.Mapper.Sc.Integration.Tds/sitecore/content/Tests/DataMappers/SitecoreQueryMapper.item
@@ -0,0 +1,51 @@
+----item----
+version: 1
+id: {E85A4594-DB0B-4ED6-BF1C-C0FEA31F68EC}
+database: master
+path: /sitecore/content/Tests/DataMappers/SitecoreQueryMapper
+parent: {949328F9-AB43-4AA8-9B09-B3FF0C0F1C7B}
+name: SitecoreQueryMapper
+master: {00000000-0000-0000-0000-000000000000}
+template: {A87A00B1-E6DB-45AB-8B54-636FEC3B5523}
+templatekey: Folder
+
+----version----
+language: en
+version: 1
+revision: 365ba5c9-395a-4daf-8775-63a431573b6f
+
+----field----
+field: {25BED78C-4957-4165-998A-CA1B52F67497}
+name: __Created
+key: __created
+content-length: 15
+
+20130101T114906
+----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
+
+365ba5c9-395a-4daf-8775-63a431573b6f
+----field----
+field: {D9CF14B1-FA16-4BA6-9288-E8A174D4D522}
+name: __Updated
+key: __updated
+content-length: 34
+
+20130101T114906:634926377464239202
+----field----
+field: {BADD9CF9-53E0-4D0C-BCC0-2D784C282F6A}
+name: __Updated by
+key: __updated by
+content-length: 14
+
+sitecore\admin
View
51 ...er.Sc.Integration.Tds/sitecore/content/Tests/DataMappers/SitecoreQueryMapper/Results.item
@@ -0,0 +1,51 @@
+----item----
+version: 1
+id: {A514B571-9B6D-4416-9157-A46F13349E94}
+database: master
+path: /sitecore/content/Tests/DataMappers/SitecoreQueryMapper/Results
+parent: {E85A4594-DB0B-4ED6-BF1C-C0FEA31F68EC}
+name: Results
+master: {00000000-0000-0000-0000-000000000000}
+template: {A87A00B1-E6DB-45AB-8B54-636FEC3B5523}
+templatekey: Folder
+
+----version----
+language: en
+version: 1
+revision: a056f5e8-bfc1-4f12-921b-27b7a000c322
+
+----field----
+field: {25BED78C-4957-4165-998A-CA1B52F67497}
+name: __Created
+key: __created
+content-length: 15