This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0"?> | |
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/"> | |
<sitecore> | |
<pipelines> | |
<endAnalytics> | |
<processor type="Website.Logic.Analytics.Views.ViewPageEventProcessor, Website" patch:before="processor[@type='Sitecore.Analytics.Pipelines.EndAnalytics.SaveDuration, Sitecore.Analytics']"/> | |
</endAnalytics> | |
</pipelines> | |
</sitecore> | |
</configuration> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Sitecore.Analytics.Aggregation.Data.Model; | |
using System; | |
namespace Website.Logic.Analytics.Views | |
{ | |
public class ViewValue : DictionaryValue | |
{ | |
internal static ViewValue Reduce(ViewValue left, ViewValue right) | |
{ | |
var viewValue = new ViewValue(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ALTER TABLE [dbo].[Fact_Views] DROP CONSTRAINT [FK_Fact_Views_Items] | |
GO | |
/****** Object: Table [dbo].[Fact_Views] Script Date: 8/22/2016 8:44:14 AM ******/ | |
DROP TABLE [dbo].[Fact_Views] | |
GO | |
/****** Object: Table [dbo].[Fact_Views] Script Date: 8/22/2016 8:44:14 AM ******/ | |
SET ANSI_NULLS ON | |
GO |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Sitecore.Analytics.Aggregation.Data.Model; | |
namespace Website.Logic.Analytics.Views | |
{ | |
public class ViewFact : Fact<ViewKey, ViewValue> | |
{ | |
public ViewFact() : base(ViewValue.Reduce) | |
{ | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using Sitecore.Analytics.Aggregation.Data.Model; | |
namespace Website.Logic.Analytics.Views | |
{ | |
public class ViewKey : DictionaryKey | |
{ | |
public Guid ItemId { get; set; } | |
public DateTime Date { get; set; } | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class EvaluateResult : PublishItemProcessor | |
{ | |
public override void Process(PublishItemContext context) | |
{ | |
Assert.ArgumentNotNull(context, "context"); | |
// We want to rely on smart publishing so we don't send unnecessary data. Deletes are a weird sceneiro. | |
// If a Republish is performed, we need the delete actions to come through. We cant rely on the Result.Operation for this. | |
if ((context.Action != PublishAction.DeleteTargetItem || context.PublishOptions.CompareRevisions) && | |
(context.Result.Operation == PublishOperation.Skipped || |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/"> | |
<sitecore> | |
<pipelines> | |
<publishItem> | |
<processor patch:after="*[@type='Sitecore.Publishing.Pipelines.PublishItem.PerformAction, Sitecore.Kernel']" type="MyAssembly.VersionToPublish, MyAssembly"/> | |
</publishItem> | |
</pipelines> | |
</sitecore> | |
</configuration> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Linq; | |
using System.Web.UI; | |
using Sitecore; | |
using Sitecore.Configuration; | |
using Sitecore.Data; | |
using Sitecore.Data.Items; | |
using Sitecore.Diagnostics; | |
using Sitecore.IO; | |
using Sitecore.Links; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public ActionResult Content() | |
{ | |
var spanish = LanguageManager.GetLanguage("es"); | |
var english = LanguageManager.GetLanguage("en"); | |
using (new LanguageItemFallback(spanish, english)) | |
{ | |
var model = GetContextItem<IContentGlass>(); | |
return View(model); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static class GlassMapperScCustom | |
{ | |
public static IDependencyResolver CreateResolver() | |
{ | |
var config = new Glass.Mapper.Sc.Config(); | |
var resolver = new DependencyResolver(config); | |
// Add ResolveItemTask at the beginning of the Configuration Resolver. | |
resolver.ConfigurationResolverFactory.Insert(0, () => new ResolveItemTask()); |