コード例 #1
0
        private void ReIndexForMedia(IMedia sender, bool isPublished)
        {
            var actions = DeferedActions.Get(_scopeProvider);

            if (actions != null)
            {
                actions.Add(new DeferedReIndexForMedia(this, sender, isPublished));
            }
            else
            {
                DeferedReIndexForMedia.Execute(this, sender, isPublished);
            }
        }
コード例 #2
0
        /// <summary>
        /// Remove items from an index
        /// </summary>
        /// <param name="entityId"></param>
        /// <param name="keepIfUnpublished">
        /// If true, indicates that we will only delete this item from indexes that don't support unpublished content.
        /// If false it will delete this from all indexes regardless.
        /// </param>
        private void DeleteIndexForEntity(int entityId, bool keepIfUnpublished)
        {
            var actions = DeferedActions.Get(_scopeProvider);

            if (actions != null)
            {
                actions.Add(new DeferedDeleteIndex(this, entityId, keepIfUnpublished));
            }
            else
            {
                DeferedDeleteIndex.Execute(this, entityId, keepIfUnpublished);
            }
        }
コード例 #3
0
        /// <summary>
        /// Re-indexes a content item whether published or not but only indexes them for indexes supporting unpublished content
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="isContentPublished">
        /// Value indicating whether the item is published or not
        /// </param>
        private static void ReIndexForContent(IContent sender, bool isContentPublished)
        {
            var actions = DeferedActions.Get(ApplicationContext.Current.ScopeProvider);

            if (actions != null)
            {
                actions.Add(new DeferedReIndexForContent(sender, isContentPublished));
            }
            else
            {
                DeferedReIndexForContent.Execute(sender, isContentPublished);
            }
        }
コード例 #4
0
        private void ReIndexForMember(IMember member)
        {
            var actions = DeferedActions.Get(_scopeProvider);

            if (actions != null)
            {
                actions.Add(new DeferedReIndexForMember(this, member));
            }
            else
            {
                DeferedReIndexForMember.Execute(this, member);
            }
        }
コード例 #5
0
        /// <summary>
        /// Remove items from any index that doesn't support unpublished content
        /// </summary>
        /// <param name="entityId"></param>
        /// <param name="keepIfUnpublished">
        /// If true, indicates that we will only delete this item from indexes that don't support unpublished content.
        /// If false it will delete this from all indexes regardless.
        /// </param>
        private static void DeleteIndexForEntity(int entityId, bool keepIfUnpublished)
        {
            var actions = DeferedActions.Get(ApplicationContext.Current.ScopeProvider);

            if (actions != null)
            {
                actions.Add(new DeferedDeleteIndex(entityId, keepIfUnpublished));
            }
            else
            {
                DeferedDeleteIndex.Execute(entityId, keepIfUnpublished);
            }
        }
コード例 #6
0
        private static void ReIndexForMember(IMember member)
        {
            var actions = DeferedActions.Get(ApplicationContext.Current.ScopeProvider);

            if (actions != null)
            {
                actions.Add(new DeferedReIndexForMember(member));
            }
            else
            {
                DeferedReIndexForMember.Execute(member);
            }
        }
コード例 #7
0
        /// <inheritdoc />
        public void ReIndexForMember(IMember member)
        {
            var actions = DeferedActions.Get(_scopeProvider);

            if (actions != null)
            {
                actions.Add(new DeferedReIndexForMember(_backgroundTaskQueue, this, member));
            }
            else
            {
                DeferedReIndexForMember.Execute(_backgroundTaskQueue, this, member);
            }
        }
コード例 #8
0
        /// <inheritdoc />
        public void ReIndexForMedia(IMedia sender, bool isPublished)
        {
            var actions = DeferedActions.Get(_scopeProvider);

            if (actions != null)
            {
                actions.Add(new DeferedReIndexForMedia(_backgroundTaskQueue, this, sender, isPublished));
            }
            else
            {
                DeferedReIndexForMedia.Execute(_backgroundTaskQueue, this, sender, isPublished);
            }
        }
コード例 #9
0
        /// <inheritdoc />
        public void DeleteIndexForEntities(IReadOnlyCollection <int> entityIds, bool keepIfUnpublished)
        {
            var actions = DeferedActions.Get(_scopeProvider);

            if (actions != null)
            {
                actions.Add(new DeferedDeleteIndex(this, entityIds, keepIfUnpublished));
            }
            else
            {
                DeferedDeleteIndex.Execute(this, entityIds, keepIfUnpublished);
            }
        }