void CreateIndexingTask(PublishContentContext context, ContentPart part)
 {
     // "Unpublish" case: Same as "remove"
     if (context.PublishingItemVersionRecord == null)
     {
         _indexingTaskManager.CreateDeleteIndexTask(context.ContentItem);
         return;
     }
     // "Publish" case: update index
     _indexingTaskManager.CreateUpdateIndexTask(context.ContentItem);
 }
Esempio n. 2
0
        public void Delete()
        {
            int contentItemId;

            if (!int.TryParse(ContentItem, out contentItemId))
            {
                Context.Output.WriteLine(T("Invalid content item id. Not an integer."));
                return;
            }

            var contentItem = _contentManager.Get(contentItemId);

            _indexingTaskManager.CreateDeleteIndexTask(contentItem);

            Context.Output.WriteLine(T("Content Item marked for deletion"));
        }