예제 #1
0
 void IContentStorageFilter.Destroyed(DestroyContentContext context)
 {
     if (context.ContentItem.Is <TPart>())
     {
         Destroyed(context, context.ContentItem.As <TPart>());
     }
 }
        public void Destroy(ContentItem contentItem)
        {
            var session = _sessionLocator.Value.For(typeof(ContentItemRecord));
            var context = new DestroyContentContext(contentItem);

            // Give storage filters a chance to delete content part records.
            Handlers.Invoke(handler => handler.Destroying(context), Logger);

            // Delete the content item record itself.
            session
            .CreateQuery("delete from Orchard.ContentManagement.Records.ContentItemRecord ci where ci.Id = (:id)")
            .SetParameter("id", contentItem.Id)
            .ExecuteUpdate();

            Handlers.Invoke(handler => handler.Destroyed(context), Logger);
        }
        public virtual void Destroy(ContentItem contentItem) {
            var session = _transactionManager.Value.GetSession();
            var context = new DestroyContentContext(contentItem);

            // Give storage filters a chance to delete content part records.
            Handlers.Invoke(handler => handler.Destroying(context), Logger);

            // Delete content item version and content item records.
            session
                .CreateQuery("delete from Orchard.ContentManagement.Records.ContentItemVersionRecord civ where civ.ContentItemRecord.Id = (:id)")
                .SetParameter("id", contentItem.Id)
                .ExecuteUpdate();

            // Delete the content item record itself.
            session
                .CreateQuery("delete from Orchard.ContentManagement.Records.ContentItemRecord ci where ci.Id = (:id)")
                .SetParameter("id", contentItem.Id)
                .ExecuteUpdate();

            Handlers.Invoke(handler => handler.Destroyed(context), Logger);
        }
 public virtual void Destroyed(DestroyContentContext context) {}
예제 #5
0
 protected virtual void Destroyed(DestroyContentContext context, TPart instance)
 {
 }
예제 #6
0
 public void Destroyed(DestroyContentContext context)
 {
 }
예제 #7
0
 public void Destroying(DestroyContentContext context)
 {
 }
예제 #8
0
 protected override void Destroyed(DestroyContentContext context)
 {
     RecordAuditTrailEvent(ContentAuditTrailEventProvider.Destroyed, context.ContentItem);
 }