/// <summary> /// Call to fire event that updating the unpublished content has finalized. /// </summary> /// <param name="content">An enumerable list of <see cref="IContent"/> thats being unpublished</param> public override void UnPublishingFinalized(IEnumerable <IContent> content) { using (var uow = new ScopeUnitOfWork(_scopeProvider)) { ((IPublishingStrategy2)this).UnPublishingFinalized(uow, content); uow.Commit(); } }
/// <summary> /// Unpublishes a single piece of Content /// </summary> /// <param name="content"><see cref="IContent"/> to unpublish</param> /// <param name="userId">Id of the User issueing the unpublish operation</param> /// <returns>True if the unpublish operation was successfull and not cancelled, otherwise false</returns> public override bool UnPublish(IContent content, int userId) { using (var uow = new ScopeUnitOfWork(_scopeProvider)) { uow.Commit(); return(((IPublishingStrategy2)this).UnPublish(uow, content, userId).Success); } }
/// <summary> /// Unpublishes a list of Content /// </summary> /// <param name="content">An enumerable list of <see cref="IContent"/></param> /// <param name="userId">Id of the User issueing the unpublish operation</param> /// <returns>True if the unpublish operation was successfull and not cancelled, otherwise false</returns> public override bool UnPublish(IEnumerable <IContent> content, int userId) { using (var uow = new ScopeUnitOfWork(_scopeProvider)) { var result = UnPublishInternal(uow, content, userId); uow.Commit(); //NOTE: This previously always returned true so I've left it that way. It returned true because (from Morten)... // ... if one item couldn't be published it wouldn't be correct to return false. // in retrospect it should have returned a list of with Ids and Publish Status // come to think of it ... the cache would still be updated for a failed item or at least tried updated. // It would call the Published event for the entire list, but if the Published property isn't set to True it // wouldn't actually update the cache for that item. But not really ideal nevertheless... return(true); } }