コード例 #1
0
        public override void Process(StartTrackingArgs args)
        {
            var item  = Sitecore.Context.Item;
            var args2 = new GetSourceItemsArgs(item);

            CorePipeline.Run("contentTracker.getSourceItems", args2);
            var sourceItems = args2.SourceItems;

            if (sourceItems == null)
            {
                return;
            }
            var visit = Tracker.Visitor.GetOrCreateCurrentVisit();

            foreach (var sourceItem in sourceItems)
            {
                ContentTrackingManager.ApplyTracking(sourceItem);
            }
        }
コード例 #2
0
        public override void Apply(T ruleContext)
        {
            var sourceItems = GetSourceItems(ruleContext);

            if (sourceItems == null || !sourceItems.Any())
            {
                return;
            }
            //var allProfiles = new List<ContentProfile>();
            foreach (var sourceItem in sourceItems)
            {
                ContentTrackingManager.ApplyTracking(sourceItem);
                //var profiles = ContentProfilingManager.GetProfiles(sourceItem);
                //if (profiles == null)
                //{
                //    continue;
                //}
                //allProfiles.AddRange(profiles);
            }
            //ContentProfilingManager.ApplyProfiles(allProfiles, ruleContext.Visit);
        }