Permalink
Browse files

Merge branch 'temp-website' into develop

  • Loading branch information...
2 parents f9569d9 + b227204 commit 108092e5db41bb8aef5050751444612001b48b6e @mikeedwards83 committed Jan 14, 2013
Showing with 641 additions and 130 deletions.
  1. +21 −0 Sites/Sitecore/Glass.Mapper.Sites.Sc/Glass.Mapper.Sites.Sc.csproj
  2. +17 −0 Sites/Sitecore/Glass.Mapper.Sites.Sc/Models/ModelBase.cs
  3. +3 −0 Sites/Sitecore/Glass.Mapper.Sites.Sc/layouts/TestSub.ascx
  4. +31 −0 Sites/Sitecore/Glass.Mapper.Sites.Sc/layouts/TestSub.ascx.cs
  5. +33 −0 Sites/Sitecore/Glass.Mapper.Sites.Sc/layouts/TestSub.ascx.designer.cs
  6. +1 −1 Source/Glass.Mapper.Sc/DataMappers/AbstractSitecoreFieldMapper.cs
  7. +4 −1 Source/Glass.Mapper.Sc/DataMappers/SitecoreFieldStringMapper.cs
  8. +3 −2 Source/Glass.Mapper.Sc/DataMappers/SitecoreIdMapper.cs
  9. +1 −1 Source/Glass.Mapper.Sc/DataMappers/SitecoreLinkedMapper.cs
  10. +207 −8 Source/Glass.Mapper.Sc/SitecoreService.cs
  11. +1 −1 Source/Glass.Mapper.Sc/Utilities.cs
  12. +44 −34 Source/Glass.Mapper/AbstractService.cs
  13. +2 −0 Source/Glass.Mapper/AbstractTypeCreationContext.cs
  14. +1 −1 Source/Glass.Mapper/Configuration/AbstractTypeConfiguration.cs
  15. +16 −1 Source/Glass.Mapper/Configuration/Attributes/AttributeConfigurationLoader.cs
  16. +4 −0 Source/Glass.Mapper/Glass.Mapper.csproj
  17. +9 −0 Source/Glass.Mapper/Pipelines/AbstractPipelineRunner.cs
  18. +9 −13 Source/Glass.Mapper/Pipelines/ObjectConstruction/Tasks/CreateConcrete/CreateConcreteTask.cs
  19. +13 −0 Source/Glass.Mapper/Profilers/IPerformanceProfiler.cs
  20. +18 −0 Source/Glass.Mapper/Profilers/NullProfiler.cs
  21. +34 −0 Source/Glass.Mapper/Profilers/SimpleProfiler.cs
  22. +9 −4 Source/Glass.Mapper/Utilities.cs
  23. +152 −55 Tests/Integration Tests/Sitecore/Glass.Mapper.Sc.Integration/PerformanceTests.cs
  24. +1 −1 Tests/Unit Tests/Glass.Mapper.Tests/AbstractServiceFixture.cs
  25. +7 −7 Tests/Unit Tests/Glass.Mapper.Tests/UtilitiesFixture.cs
@@ -187,6 +187,7 @@
<Content Include="App_Config\XamlSharp.config" />
<None Include="default.htm.sitedown" />
<Content Include="Design.config" />
+ <Content Include="layouts\TestSub.ascx" />
<Content Include="sitecore_files\Web.config" />
<Content Include="Web.config" />
<None Include="Web.config.MVC" />
@@ -206,6 +207,26 @@
<Content Include="xsl\sample rendering.xslt" />
<Content Include="xsl\system\WebEdit\Hidden Rendering.xslt" />
</ItemGroup>
+ <ItemGroup>
+ <Compile Include="layouts\TestSub.ascx.cs">
+ <DependentUpon>TestSub.ascx</DependentUpon>
+ <SubType>ASPXCodeBehind</SubType>
+ </Compile>
+ <Compile Include="layouts\TestSub.ascx.designer.cs">
+ <DependentUpon>TestSub.ascx</DependentUpon>
+ </Compile>
+ <Compile Include="Models\ModelBase.cs" />
+ </ItemGroup>
+ <ItemGroup>
+ <ProjectReference Include="..\..\..\Source\Glass.Mapper.Sc\Glass.Mapper.Sc.csproj">
+ <Project>{0B8E0B06-46B8-4794-862F-73B391F8B1A1}</Project>
+ <Name>Glass.Mapper.Sc</Name>
+ </ProjectReference>
+ <ProjectReference Include="..\..\..\Source\Glass.Mapper\Glass.Mapper.csproj">
+ <Project>{566109ED-A88A-467E-BDDB-BBF7F831A006}</Project>
+ <Name>Glass.Mapper</Name>
+ </ProjectReference>
+ </ItemGroup>
<PropertyGroup>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
@@ -0,0 +1,17 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Web;
+using Glass.Mapper.Sc.Configuration.Attributes;
+
+namespace Glass.Mapper.Sites.Sc.Models
+{
+ [SitecoreType]
+ public class ModelBase
+ {
+ [SitecoreField]
+ public virtual string Title { get; set; }
+ [SitecoreField]
+ public virtual string Text { get; set; }
+ }
+}
@@ -0,0 +1,3 @@
+<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="TestSub.ascx.cs" Inherits="Glass.Mapper.Sites.Sc.layouts.TestSub" %>
+<asp:Literal runat="server" ID="Title"></asp:Literal>
+<asp:Literal runat="server" ID="Text"></asp:Literal>
@@ -0,0 +1,31 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Web;
+using System.Web.UI;
+using System.Web.UI.WebControls;
+using Glass.Mapper.Sc;
+using Glass.Mapper.Sc.Configuration.Attributes;
+using Glass.Mapper.Sc.Integration;
+using Glass.Mapper.Sites.Sc.Models;
+
+namespace Glass.Mapper.Sites.Sc.layouts
+{
+ public partial class TestSub : System.Web.UI.UserControl
+ {
+ protected void Page_Load(object sender, EventArgs e)
+ {
+ var context = Glass.Mapper.Context.Create(new GlassConfig());
+ context.Load(new SitecoreAttributeConfigurationLoader(
+ "Glass.Mapper.Sites.Sc"
+ ));
+
+ SitecoreService service = new SitecoreService(Sitecore.Context.Database);
+ var item = service.GetItem<ModelBase>(Sitecore.Context.Item.ID.Guid);
+
+ Text.Text = item.Text;
+ Title.Text = item.Title;
+
+ }
+ }
+}

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
@@ -19,7 +19,7 @@ public AbstractSitecoreFieldMapper(params Type [] typesHandled)
public override void MapToCms(AbstractDataMappingContext mappingContext)
{
var scConfig = Configuration as SitecoreFieldConfiguration;
- var scContext = mappingContext as SitecoreDataMappingContext;
+ var scContext = mappingContext as SitecoreDataMappingContext ;
var field = Utilities.GetField(scContext.Item, scConfig.FieldId, scConfig.FieldName);
object value = Configuration.PropertyInfo.GetValue(mappingContext.Object, null);
@@ -18,7 +18,10 @@ public override object GetField(Sitecore.Data.Fields.Field field, SitecoreFieldC
if (field == null)
return string.Empty;
- if (field.Type.StartsWith("Rich Text") && config.Setting != SitecoreFieldSettings.RichTextRaw)
+ if (config.Setting != SitecoreFieldSettings.RichTextRaw)
+ return field.Value;
+
+ if (field.Type.StartsWith("Rich Text"))
{
FieldRenderer renderer = new FieldRenderer();
renderer.Item = field.Item;
@@ -22,10 +22,11 @@ public override void MapToCms(AbstractDataMappingContext mappingContext)
public override object MapToProperty(AbstractDataMappingContext mappingContext)
{
- SitecoreDataMappingContext context = mappingContext as SitecoreDataMappingContext;
+
+ SitecoreDataMappingContext context = (SitecoreDataMappingContext)mappingContext;
var item = context.Item;
- var scConfig = Configuration as SitecoreIdConfiguration;
+ var scConfig = Configuration;
if (scConfig.PropertyInfo.PropertyType == typeof(Guid))
return item.ID.Guid;
@@ -33,7 +33,7 @@ public override object MapToProperty(AbstractDataMappingContext mappingContext)
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
+ // languges 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());
Oops, something went wrong.

0 comments on commit 108092e

Please sign in to comment.