Exemplo n.º 1
0
        private bool IgnoreCurrentItem()
        {
            Item item = Sitecore.Context.Item;

            if (item == null)
            {
                return(false);
            }

            string cacheKey = String.Format("TrackingField_{0}", item.ID);

            if (BoostContext.PublishAwareCache.Contains(cacheKey))
            {
                bool result = BoostContext.PublishAwareCache.GetValue <bool>(cacheKey);
                return(result);
            }

            LightTrackingField trackingField = LightTrackingField.FindTrackingField(item);

            if (trackingField != null)
            {
                var result = trackingField.Ignore;
                BoostContext.PublishAwareCache.AddValue(cacheKey, result);
                return(result);
            }

            BoostContext.PublishAwareCache.AddValue(cacheKey, false);
            return(false);
        }
Exemplo n.º 2
0
            protected virtual ContentProfile GetPresetProfileData(ContentProfile profile, string presetKey)
            {
                Assert.ArgumentNotNull(profile, "profile");
                Assert.ArgumentNotNull(presetKey, "presetKey");
                LightTrackingField presetTrackingField = GetPresetTrackingField(profile, presetKey);

                if (presetTrackingField == null)
                {
                    return(null);
                }
                return(presetTrackingField.Profiles.FirstOrDefault(p => p.ProfileID == profile.ProfileID));
            }
Exemplo n.º 3
0
        internal static LightTrackingField FindTrackingField(Item item)
        {
            Assert.ArgumentNotNull(item, "item");
            LightTrackingField trackingField = GetTrackingField(item);

            if (trackingField != null)
            {
                return(trackingField);
            }
            TemplateItem template = item.Template;

            if (template == null)
            {
                return(null);
            }
            return(GetTrackingField(template.InnerItem));
        }
Exemplo n.º 4
0
        internal static bool HasTracking(Item item)
        {
            LightTrackingField trackingField = FindTrackingField(item);

            return(trackingField != null && !trackingField.IsEmpty);
        }