U4-8465 Remove Core.Publishing namespace and classes
This commit is contained in:
@@ -1,17 +1,13 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using System.Threading;
|
||||
using AutoMapper;
|
||||
using LightInject;
|
||||
using NPoco;
|
||||
using Umbraco.Core.Cache;
|
||||
using Umbraco.Core.Configuration;
|
||||
using Umbraco.Core.Configuration.UmbracoSettings;
|
||||
using Umbraco.Core.DependencyInjection;
|
||||
using Umbraco.Core.Events;
|
||||
using Umbraco.Core.Exceptions;
|
||||
using Umbraco.Core.IO;
|
||||
using Umbraco.Core.Logging;
|
||||
@@ -19,18 +15,10 @@ using Umbraco.Core.Manifest;
|
||||
using Umbraco.Core.Models.Mapping;
|
||||
using Umbraco.Core.Models.PublishedContent;
|
||||
using Umbraco.Core.ObjectResolution;
|
||||
using Umbraco.Core.Persistence;
|
||||
using Umbraco.Core.Persistence.Mappers;
|
||||
using Umbraco.Core.Persistence.Migrations;
|
||||
using Umbraco.Core.Persistence.SqlSyntax;
|
||||
using Umbraco.Core.Persistence.UnitOfWork;
|
||||
using Umbraco.Core.Profiling;
|
||||
using Umbraco.Core.PropertyEditors;
|
||||
using Umbraco.Core.Publishing;
|
||||
using Umbraco.Core.Macros;
|
||||
using Umbraco.Core.Manifest;
|
||||
using Umbraco.Core.Models.Identity;
|
||||
using Umbraco.Core.Models.Membership;
|
||||
using Umbraco.Core.Services;
|
||||
using Umbraco.Core.Sync;
|
||||
using Umbraco.Core.Strings;
|
||||
|
||||
@@ -1,17 +1,11 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using LightInject;
|
||||
using Umbraco.Core.Events;
|
||||
using Umbraco.Core.IO;
|
||||
using Umbraco.Core.Logging;
|
||||
using Umbraco.Core.Persistence;
|
||||
using Umbraco.Core.Persistence.UnitOfWork;
|
||||
using Umbraco.Core.Publishing;
|
||||
using Umbraco.Core.Services;
|
||||
using Umbraco.Core.Strings;
|
||||
|
||||
namespace Umbraco.Core.DependencyInjection
|
||||
{
|
||||
|
||||
@@ -1,46 +0,0 @@
|
||||
using System.Collections.Generic;
|
||||
using Umbraco.Core.Models;
|
||||
|
||||
namespace Umbraco.Core.Publishing
|
||||
{
|
||||
/// <summary>
|
||||
/// Abstract class for the implementation of an <see cref="IPublishingStrategy"/>, which provides the events used for publishing/unpublishing.
|
||||
/// </summary>
|
||||
public abstract class BasePublishingStrategy : IPublishingStrategy
|
||||
{
|
||||
|
||||
public abstract bool Publish(IContent content, int userId);
|
||||
public abstract bool PublishWithChildren(IEnumerable<IContent> content, int userId);
|
||||
public abstract bool UnPublish(IContent content, int userId);
|
||||
public abstract bool UnPublish(IEnumerable<IContent> content, int userId);
|
||||
|
||||
/// <summary>
|
||||
/// Call to fire event that updating the published content has finalized.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// This seperation of the OnPublished event is done to ensure that the Content
|
||||
/// has been properly updated (committed unit of work) and xml saved in the db.
|
||||
/// </remarks>
|
||||
/// <param name="content"><see cref="IContent"/> thats being published</param>
|
||||
public abstract void PublishingFinalized(IContent content);
|
||||
|
||||
/// <summary>
|
||||
/// Call to fire event that updating the published content has finalized.
|
||||
/// </summary>
|
||||
/// <param name="content">An enumerable list of <see cref="IContent"/> thats being published</param>
|
||||
/// <param name="isAllRepublished">Boolean indicating whether its all content that is republished</param>
|
||||
public abstract void PublishingFinalized(IEnumerable<IContent> content, bool isAllRepublished);
|
||||
|
||||
/// <summary>
|
||||
/// Call to fire event that updating the unpublished content has finalized.
|
||||
/// </summary>
|
||||
/// <param name="content"><see cref="IContent"/> thats being unpublished</param>
|
||||
public abstract void UnPublishingFinalized(IContent content);
|
||||
|
||||
/// <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 abstract void UnPublishingFinalized(IEnumerable<IContent> content);
|
||||
}
|
||||
}
|
||||
@@ -1,72 +0,0 @@
|
||||
using System.Collections.Generic;
|
||||
using Umbraco.Core.Models;
|
||||
|
||||
namespace Umbraco.Core.Publishing
|
||||
{
|
||||
/// <summary>
|
||||
/// Defines the Publishing Strategy
|
||||
/// </summary>
|
||||
public interface IPublishingStrategy
|
||||
{
|
||||
/// <summary>
|
||||
/// Publishes a single piece of Content
|
||||
/// </summary>
|
||||
/// <param name="content"><see cref="IContent"/> to publish</param>
|
||||
/// <param name="userId">Id of the User issueing the publish operation</param>
|
||||
/// <returns>True if the publish operation was successfull and not cancelled, otherwise false</returns>
|
||||
bool Publish(IContent content, int userId);
|
||||
|
||||
/// <summary>
|
||||
/// Publishes 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 publish operation</param>
|
||||
/// <returns>True if the publish operation was successfull and not cancelled, otherwise false</returns>
|
||||
bool PublishWithChildren(IEnumerable<IContent> content, int userId);
|
||||
|
||||
/// <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>
|
||||
bool UnPublish(IContent content, int userId);
|
||||
|
||||
/// <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>
|
||||
bool UnPublish(IEnumerable<IContent> content, int userId);
|
||||
|
||||
/// <summary>
|
||||
/// Call to fire event that updating the published content has finalized.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// This seperation of the OnPublished event is done to ensure that the Content
|
||||
/// has been properly updated (committed unit of work) and xml saved in the db.
|
||||
/// </remarks>
|
||||
/// <param name="content"><see cref="IContent"/> thats being published</param>
|
||||
void PublishingFinalized(IContent content);
|
||||
|
||||
/// <summary>
|
||||
/// Call to fire event that updating the published content has finalized.
|
||||
/// </summary>
|
||||
/// <param name="content">An enumerable list of <see cref="IContent"/> thats being published</param>
|
||||
/// <param name="isAllRepublished">Boolean indicating whether its all content that is republished</param>
|
||||
void PublishingFinalized(IEnumerable<IContent> content, bool isAllRepublished);
|
||||
|
||||
/// <summary>
|
||||
/// Call to fire event that updating the unpublished content has finalized.
|
||||
/// </summary>
|
||||
/// <param name="content"><see cref="IContent"/> thats being unpublished</param>
|
||||
void UnPublishingFinalized(IContent content);
|
||||
|
||||
/// <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>
|
||||
void UnPublishingFinalized(IEnumerable<IContent> content);
|
||||
}
|
||||
}
|
||||
@@ -1,61 +0,0 @@
|
||||
using System;
|
||||
using Umbraco.Core.Logging;
|
||||
using Umbraco.Core.Models;
|
||||
using Umbraco.Core.Services;
|
||||
|
||||
namespace Umbraco.Core.Publishing
|
||||
{
|
||||
/// <summary>
|
||||
/// Used to perform scheduled publishing/unpublishing
|
||||
/// </summary>
|
||||
internal class ScheduledPublisher
|
||||
{
|
||||
private readonly IContentService _contentService;
|
||||
|
||||
public ScheduledPublisher(IContentService contentService)
|
||||
{
|
||||
_contentService = contentService;
|
||||
}
|
||||
|
||||
public void CheckPendingAndProcess()
|
||||
{
|
||||
foreach (var d in _contentService.GetContentForRelease())
|
||||
{
|
||||
try
|
||||
{
|
||||
d.ReleaseDate = null;
|
||||
var result = _contentService.SaveAndPublishWithStatus(d, (int)d.GetWriterProfile().Id);
|
||||
if (result.Success == false)
|
||||
{
|
||||
if (result.Exception != null)
|
||||
{
|
||||
LogHelper.Error<ScheduledPublisher>("Could not published the document (" + d.Id + ") based on it's scheduled release, status result: " + result.Result.StatusType, result.Exception);
|
||||
}
|
||||
else
|
||||
{
|
||||
LogHelper.Warn<ScheduledPublisher>("Could not published the document (" + d.Id + ") based on it's scheduled release. Status result: " + result.Result.StatusType);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ee)
|
||||
{
|
||||
LogHelper.Error<ScheduledPublisher>(string.Format("Error publishing node {0}", d.Id), ee);
|
||||
throw;
|
||||
}
|
||||
}
|
||||
foreach (var d in _contentService.GetContentForExpiration())
|
||||
{
|
||||
try
|
||||
{
|
||||
d.ExpireDate = null;
|
||||
_contentService.UnPublish(d, (int)d.GetWriterProfile().Id);
|
||||
}
|
||||
catch (Exception ee)
|
||||
{
|
||||
LogHelper.Error<ScheduledPublisher>(string.Format("Error unpublishing node {0}", d.Id), ee);
|
||||
throw;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -12,7 +12,6 @@ using Umbraco.Core.Persistence.DatabaseModelDefinitions;
|
||||
using Umbraco.Core.Persistence.Querying;
|
||||
using Umbraco.Core.Persistence.Repositories;
|
||||
using Umbraco.Core.Persistence.UnitOfWork;
|
||||
using Umbraco.Core.Publishing;
|
||||
using Umbraco.Core.Strings;
|
||||
|
||||
namespace Umbraco.Core.Services
|
||||
@@ -1220,6 +1219,45 @@ namespace Umbraco.Core.Services
|
||||
return ((IContentServiceOperations)this).PublishWithChildren(content, userId, includeUnpublished);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Used to perform scheduled publishing/unpublishing
|
||||
/// </summary>
|
||||
public IEnumerable<Attempt<PublishStatus>> PerformScheduledPublish()
|
||||
{
|
||||
//TODO: Do I need to move all of this logic to the repo? Or wrap this all in a unit of work?
|
||||
|
||||
foreach (var d in GetContentForRelease())
|
||||
{
|
||||
d.ReleaseDate = null;
|
||||
var result = SaveAndPublishWithStatus(d, (int)d.GetWriterProfile(_userService).Id);
|
||||
if (result.Success == false)
|
||||
{
|
||||
if (result.Exception != null)
|
||||
{
|
||||
Logger.Error<ContentService>("Could not published the document (" + d.Id + ") based on it's scheduled release, status result: " + result.Result.StatusType, result.Exception);
|
||||
}
|
||||
else
|
||||
{
|
||||
Logger.Warn<ContentService>("Could not published the document (" + d.Id + ") based on it's scheduled release. Status result: " + result.Result.StatusType);
|
||||
}
|
||||
}
|
||||
yield return result;
|
||||
}
|
||||
foreach (var d in GetContentForExpiration())
|
||||
{
|
||||
try
|
||||
{
|
||||
d.ExpireDate = null;
|
||||
UnPublish(d, (int)d.GetWriterProfile(_userService).Id);
|
||||
}
|
||||
catch (Exception ee)
|
||||
{
|
||||
Logger.Error<ContentService>($"Error unpublishing node {d.Id}", ee);
|
||||
throw;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Publishes a <see cref="IContent"/> object and all its children
|
||||
/// </summary>
|
||||
|
||||
@@ -5,7 +5,6 @@ using System.Xml.Linq;
|
||||
using Umbraco.Core.Models;
|
||||
using Umbraco.Core.Models.Membership;
|
||||
using Umbraco.Core.Persistence.DatabaseModelDefinitions;
|
||||
using Umbraco.Core.Publishing;
|
||||
|
||||
namespace Umbraco.Core.Services
|
||||
{
|
||||
@@ -63,6 +62,11 @@ namespace Umbraco.Core.Services
|
||||
/// <returns>The list of statuses for all published items</returns>
|
||||
IEnumerable<Attempt<PublishStatus>> PublishWithChildren(IContent content, int userId = 0, bool includeUnpublished = false);
|
||||
|
||||
/// <summary>
|
||||
/// Used to perform scheduled publishing/unpublishing
|
||||
/// </summary>
|
||||
IEnumerable<Attempt<PublishStatus>> PerformScheduledPublish();
|
||||
|
||||
/// <summary>
|
||||
/// Saves and Publishes a single <see cref="IContent"/> object
|
||||
/// </summary>
|
||||
@@ -94,6 +98,8 @@ namespace Umbraco.Core.Services
|
||||
/// </summary>
|
||||
public interface IContentService : IService
|
||||
{
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Returns the persisted content's XML structure
|
||||
/// </summary>
|
||||
|
||||
@@ -1,23 +1,17 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Threading;
|
||||
using System.Xml.Linq;
|
||||
using Umbraco.Core.Configuration;
|
||||
using Umbraco.Core.Events;
|
||||
using Umbraco.Core.Logging;
|
||||
using Umbraco.Core.Models;
|
||||
using Umbraco.Core.Models.Rdbms;
|
||||
using Umbraco.Core.Persistence;
|
||||
using Umbraco.Core.Persistence.DatabaseModelDefinitions;
|
||||
using Umbraco.Core.Persistence.Querying;
|
||||
using Umbraco.Core.Persistence.Repositories;
|
||||
using Umbraco.Core.Persistence.SqlSyntax;
|
||||
using Umbraco.Core.Persistence.UnitOfWork;
|
||||
using Umbraco.Core.Publishing;
|
||||
using Umbraco.Core.Strings;
|
||||
|
||||
namespace Umbraco.Core.Services
|
||||
|
||||
@@ -1,42 +1,41 @@
|
||||
using System.Collections.Generic;
|
||||
using Umbraco.Core.Events;
|
||||
using Umbraco.Core.Models;
|
||||
using Umbraco.Core.Services;
|
||||
|
||||
namespace Umbraco.Core.Publishing
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents the result of publishing a content item.
|
||||
/// </summary>
|
||||
public class PublishStatus : OperationStatus<PublishStatusType, IContent>
|
||||
{
|
||||
/// <summary>
|
||||
/// Creates a new instance of the <see cref="PublishStatus"/> class with a status type, event messages, and a content item.
|
||||
/// </summary>
|
||||
/// <param name="statusType">The status of the operation.</param>
|
||||
/// <param name="eventMessages">Event messages produced by the operation.</param>
|
||||
/// <param name="content">The content item.</param>
|
||||
public PublishStatus(PublishStatusType statusType, EventMessages eventMessages, IContent content)
|
||||
: base(statusType, eventMessages, content)
|
||||
{ }
|
||||
|
||||
/// <summary>
|
||||
/// Creates a new successful instance of the <see cref="PublishStatus"/> class with a event messages, and a content item.
|
||||
/// </summary>
|
||||
/// <param name="eventMessages">Event messages produced by the operation.</param>
|
||||
/// <param name="content">The content item.</param>
|
||||
public PublishStatus(IContent content, EventMessages eventMessages)
|
||||
: base(PublishStatusType.Success, eventMessages, content)
|
||||
{ }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the content item.
|
||||
/// </summary>
|
||||
public IContent ContentItem => Value;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the invalid properties, if the status failed due to validation.
|
||||
/// </summary>
|
||||
public IEnumerable<Property> InvalidProperties { get; set; }
|
||||
}
|
||||
using System.Collections.Generic;
|
||||
using Umbraco.Core.Events;
|
||||
using Umbraco.Core.Models;
|
||||
|
||||
namespace Umbraco.Core.Services
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents the result of publishing a content item.
|
||||
/// </summary>
|
||||
public class PublishStatus : OperationStatus<PublishStatusType, IContent>
|
||||
{
|
||||
/// <summary>
|
||||
/// Creates a new instance of the <see cref="PublishStatus"/> class with a status type, event messages, and a content item.
|
||||
/// </summary>
|
||||
/// <param name="statusType">The status of the operation.</param>
|
||||
/// <param name="eventMessages">Event messages produced by the operation.</param>
|
||||
/// <param name="content">The content item.</param>
|
||||
public PublishStatus(PublishStatusType statusType, EventMessages eventMessages, IContent content)
|
||||
: base(statusType, eventMessages, content)
|
||||
{ }
|
||||
|
||||
/// <summary>
|
||||
/// Creates a new successful instance of the <see cref="PublishStatus"/> class with a event messages, and a content item.
|
||||
/// </summary>
|
||||
/// <param name="eventMessages">Event messages produced by the operation.</param>
|
||||
/// <param name="content">The content item.</param>
|
||||
public PublishStatus(IContent content, EventMessages eventMessages)
|
||||
: base(PublishStatusType.Success, eventMessages, content)
|
||||
{ }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the content item.
|
||||
/// </summary>
|
||||
public IContent ContentItem => Value;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the invalid properties, if the status failed due to validation.
|
||||
/// </summary>
|
||||
public IEnumerable<Property> InvalidProperties { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,84 +1,84 @@
|
||||
namespace Umbraco.Core.Publishing
|
||||
{
|
||||
/// <summary>
|
||||
/// A value indicating the result of publishing a content item.
|
||||
/// </summary>
|
||||
/// <remarks>Do NOT compare against a hard-coded numeric value to check for success or failure,
|
||||
/// but instead use the IsSuccess() extension method defined below - which should be the unique
|
||||
/// place where the numeric test should take place.
|
||||
/// </remarks>
|
||||
public enum PublishStatusType
|
||||
{
|
||||
/// <summary>
|
||||
/// The publishing was successful.
|
||||
/// </summary>
|
||||
Success = 0,
|
||||
|
||||
/// <summary>
|
||||
/// The item was already published.
|
||||
/// </summary>
|
||||
SuccessAlreadyPublished = 1,
|
||||
|
||||
// Values below this value indicate a success, values above it indicate a failure.
|
||||
// This value is considered a failure.
|
||||
//Reserved = 10,
|
||||
|
||||
/// <summary>
|
||||
/// The content could not be published because it's ancestor path isn't published.
|
||||
/// </summary>
|
||||
FailedPathNotPublished = 11,
|
||||
|
||||
/// <summary>
|
||||
/// The content item was scheduled to be un-published and it has expired so we cannot force it to be
|
||||
/// published again as part of a bulk publish operation.
|
||||
/// </summary>
|
||||
FailedHasExpired = 12,
|
||||
|
||||
/// <summary>
|
||||
/// The content item is scheduled to be released in the future and therefore we cannot force it to
|
||||
/// be published during a bulk publish operation.
|
||||
/// </summary>
|
||||
FailedAwaitingRelease = 13,
|
||||
|
||||
/// <summary>
|
||||
/// The content item could not be published because it is in the trash.
|
||||
/// </summary>
|
||||
FailedIsTrashed = 14,
|
||||
|
||||
/// <summary>
|
||||
/// The publish action has been cancelled by an event handler.
|
||||
/// </summary>
|
||||
FailedCancelledByEvent = 15,
|
||||
|
||||
/// <summary>
|
||||
/// The content item could not be published because it contains invalid data (has not passed validation requirements).
|
||||
/// </summary>
|
||||
FailedContentInvalid = 16
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Provides extension methods for the <see cref="PublishStatusType"/> enum.
|
||||
/// </summary>
|
||||
public static class PublicStatusTypeExtensions
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets a value indicating whether the status indicates a success.
|
||||
/// </summary>
|
||||
/// <param name="status">The status.</param>
|
||||
/// <returns>A value indicating whether the status indicates a success.</returns>
|
||||
public static bool IsSuccess(this PublishStatusType status)
|
||||
{
|
||||
return (int) status < 10;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets a value indicating whether the status indicates a failure.
|
||||
/// </summary>
|
||||
/// <param name="status">The status.</param>
|
||||
/// <returns>A value indicating whether the status indicates a failure.</returns>
|
||||
public static bool IsFailure(this PublishStatusType status)
|
||||
{
|
||||
return (int) status >= 10;
|
||||
}
|
||||
}
|
||||
namespace Umbraco.Core.Services
|
||||
{
|
||||
/// <summary>
|
||||
/// A value indicating the result of publishing a content item.
|
||||
/// </summary>
|
||||
/// <remarks>Do NOT compare against a hard-coded numeric value to check for success or failure,
|
||||
/// but instead use the IsSuccess() extension method defined below - which should be the unique
|
||||
/// place where the numeric test should take place.
|
||||
/// </remarks>
|
||||
public enum PublishStatusType
|
||||
{
|
||||
/// <summary>
|
||||
/// The publishing was successful.
|
||||
/// </summary>
|
||||
Success = 0,
|
||||
|
||||
/// <summary>
|
||||
/// The item was already published.
|
||||
/// </summary>
|
||||
SuccessAlreadyPublished = 1,
|
||||
|
||||
// Values below this value indicate a success, values above it indicate a failure.
|
||||
// This value is considered a failure.
|
||||
//Reserved = 10,
|
||||
|
||||
/// <summary>
|
||||
/// The content could not be published because it's ancestor path isn't published.
|
||||
/// </summary>
|
||||
FailedPathNotPublished = 11,
|
||||
|
||||
/// <summary>
|
||||
/// The content item was scheduled to be un-published and it has expired so we cannot force it to be
|
||||
/// published again as part of a bulk publish operation.
|
||||
/// </summary>
|
||||
FailedHasExpired = 12,
|
||||
|
||||
/// <summary>
|
||||
/// The content item is scheduled to be released in the future and therefore we cannot force it to
|
||||
/// be published during a bulk publish operation.
|
||||
/// </summary>
|
||||
FailedAwaitingRelease = 13,
|
||||
|
||||
/// <summary>
|
||||
/// The content item could not be published because it is in the trash.
|
||||
/// </summary>
|
||||
FailedIsTrashed = 14,
|
||||
|
||||
/// <summary>
|
||||
/// The publish action has been cancelled by an event handler.
|
||||
/// </summary>
|
||||
FailedCancelledByEvent = 15,
|
||||
|
||||
/// <summary>
|
||||
/// The content item could not be published because it contains invalid data (has not passed validation requirements).
|
||||
/// </summary>
|
||||
FailedContentInvalid = 16
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Provides extension methods for the <see cref="PublishStatusType"/> enum.
|
||||
/// </summary>
|
||||
public static class PublicStatusTypeExtensions
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets a value indicating whether the status indicates a success.
|
||||
/// </summary>
|
||||
/// <param name="status">The status.</param>
|
||||
/// <returns>A value indicating whether the status indicates a success.</returns>
|
||||
public static bool IsSuccess(this PublishStatusType status)
|
||||
{
|
||||
return (int) status < 10;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets a value indicating whether the status indicates a failure.
|
||||
/// </summary>
|
||||
/// <param name="status">The status.</param>
|
||||
/// <returns>A value indicating whether the status indicates a failure.</returns>
|
||||
public static bool IsFailure(this PublishStatusType status)
|
||||
{
|
||||
return (int) status >= 10;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,8 +1,7 @@
|
||||
using Umbraco.Core.Events;
|
||||
using Umbraco.Core.Models;
|
||||
using Umbraco.Core.Services;
|
||||
|
||||
namespace Umbraco.Core.Publishing
|
||||
namespace Umbraco.Core.Services
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents the result of unpublishing a content item.
|
||||
@@ -1,4 +1,4 @@
|
||||
namespace Umbraco.Core.Publishing
|
||||
namespace Umbraco.Core.Services
|
||||
{
|
||||
/// <summary>
|
||||
/// A status type of the result of unpublishing a content item
|
||||
@@ -499,8 +499,8 @@
|
||||
<Compile Include="PropertyEditors\ValueConverters\DecimalValueConverter.cs" />
|
||||
<Compile Include="PropertyEditors\ValueConverters\LabelValueConverter.cs" />
|
||||
<Compile Include="PropertyEditors\ValueConverters\ImageCropperValueConverter.cs" />
|
||||
<Compile Include="Publishing\UnPublishedStatusType.cs" />
|
||||
<Compile Include="Publishing\UnPublishStatus.cs" />
|
||||
<Compile Include="Services\UnPublishedStatusType.cs" />
|
||||
<Compile Include="Services\UnPublishStatus.cs" />
|
||||
<Compile Include="Security\BackOfficeClaimsIdentityFactory.cs" />
|
||||
<Compile Include="Security\BackOfficeCookieAuthenticationProvider.cs" />
|
||||
<Compile Include="Security\BackOfficeSignInManager.cs" />
|
||||
@@ -1202,12 +1202,9 @@
|
||||
<Compile Include="ObjectResolution\ResolverBase.cs" />
|
||||
<Compile Include="ObjectResolution\SingleObjectResolverBase.cs" />
|
||||
<Compile Include="PropertyEditors\ValueConverters\YesNoValueConverter.cs" />
|
||||
<Compile Include="Publishing\BasePublishingStrategy.cs" />
|
||||
<Compile Include="Publishing\IPublishingStrategy.cs" />
|
||||
<Compile Include="Publishing\PublishStatus.cs" />
|
||||
<Compile Include="Publishing\PublishStatusType.cs" />
|
||||
<Compile Include="Services\PublishStatus.cs" />
|
||||
<Compile Include="Services\PublishStatusType.cs" />
|
||||
<Compile Include="Dynamics\QueryableExtensions.cs" />
|
||||
<Compile Include="Publishing\ScheduledPublisher.cs" />
|
||||
<Compile Include="RenderingEngine.cs" />
|
||||
<Compile Include="Models\Section.cs" />
|
||||
<Compile Include="Security\AuthenticationExtensions.cs" />
|
||||
|
||||
@@ -1,26 +1,7 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using Moq;
|
||||
using NPoco;
|
||||
using NUnit.Framework;
|
||||
using Umbraco.Core;
|
||||
using Umbraco.Core.Cache;
|
||||
using Umbraco.Core.Configuration;
|
||||
using Umbraco.Core.Configuration.UmbracoSettings;
|
||||
using Umbraco.Core.Events;
|
||||
using Umbraco.Core.Logging;
|
||||
using NUnit.Framework;
|
||||
using Umbraco.Core.Models.Rdbms;
|
||||
using Umbraco.Core.ObjectResolution;
|
||||
using Umbraco.Core.Persistence;
|
||||
using Umbraco.Core.Persistence.Mappers;
|
||||
using Umbraco.Core.Persistence.SqlSyntax;
|
||||
using Umbraco.Core.Persistence.UnitOfWork;
|
||||
using Umbraco.Core.Profiling;
|
||||
using Umbraco.Core.Publishing;
|
||||
using Umbraco.Core.Services;
|
||||
using Umbraco.Core.Strings;
|
||||
using Umbraco.Tests.TestHelpers;
|
||||
using GlobalSettings = Umbraco.Core.Configuration.GlobalSettings;
|
||||
|
||||
namespace Umbraco.Tests.Persistence
|
||||
{
|
||||
|
||||
@@ -1,21 +1,14 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
using Moq;
|
||||
using NUnit.Framework;
|
||||
using Umbraco.Core;
|
||||
using Umbraco.Core.Logging;
|
||||
using Umbraco.Core.Models;
|
||||
using Umbraco.Core.Persistence;
|
||||
using Umbraco.Core.Persistence.SqlSyntax;
|
||||
using Umbraco.Core.Persistence.UnitOfWork;
|
||||
using Umbraco.Core.Profiling;
|
||||
using Umbraco.Core.PropertyEditors;
|
||||
using Umbraco.Core.Publishing;
|
||||
using Umbraco.Core.Services;
|
||||
using Umbraco.Core.Strings;
|
||||
using Umbraco.Tests.TestHelpers;
|
||||
using Umbraco.Web.PropertyEditors;
|
||||
|
||||
|
||||
@@ -3,7 +3,6 @@ using NUnit.Framework;
|
||||
using Umbraco.Core;
|
||||
using Umbraco.Core.Events;
|
||||
using Umbraco.Core.Models;
|
||||
using Umbraco.Core.Publishing;
|
||||
using Umbraco.Tests.TestHelpers;
|
||||
using Umbraco.Tests.TestHelpers.Entities;
|
||||
using System.Linq;
|
||||
|
||||
@@ -14,7 +14,6 @@ using Umbraco.Core.Models;
|
||||
using Umbraco.Core.Persistence;
|
||||
using Umbraco.Core.Persistence.SqlSyntax;
|
||||
using Umbraco.Core.Persistence.UnitOfWork;
|
||||
using Umbraco.Core.Publishing;
|
||||
using Umbraco.Core.Services;
|
||||
using Umbraco.Core.Strings;
|
||||
using Umbraco.Tests.TestHelpers;
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Configuration;
|
||||
using System.Data.SqlServerCe;
|
||||
using System.IO;
|
||||
@@ -13,28 +11,21 @@ using SQLCE4Umbraco;
|
||||
using Umbraco.Core;
|
||||
using Umbraco.Core.Cache;
|
||||
using Umbraco.Core.Configuration;
|
||||
using Umbraco.Core.Configuration.UmbracoSettings;
|
||||
using Umbraco.Core.IO;
|
||||
using Umbraco.Core.Logging;
|
||||
using Umbraco.Core.Manifest;
|
||||
using Umbraco.Core.Models.PublishedContent;
|
||||
using Umbraco.Core.ObjectResolution;
|
||||
using Umbraco.Core.Persistence;
|
||||
using Umbraco.Core.Persistence.Mappers;
|
||||
using Umbraco.Core.Persistence.SqlSyntax;
|
||||
using Umbraco.Core.Persistence.UnitOfWork;
|
||||
using Umbraco.Core.PropertyEditors;
|
||||
using Umbraco.Core.Publishing;
|
||||
using Umbraco.Core.Services;
|
||||
using Umbraco.Core.Strings;
|
||||
using Umbraco.Web;
|
||||
using Umbraco.Web.PublishedCache;
|
||||
using Umbraco.Web.PublishedCache.XmlPublishedCache;
|
||||
using Umbraco.Web.Routing;
|
||||
using Umbraco.Web.Security;
|
||||
using umbraco.BusinessLogic;
|
||||
using Umbraco.Core.Events;
|
||||
using Umbraco.Core.Models;
|
||||
using File = System.IO.File;
|
||||
|
||||
namespace Umbraco.Tests.TestHelpers
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
@@ -16,24 +14,16 @@ using Umbraco.Core.Logging;
|
||||
using Umbraco.Core.Models.Mapping;
|
||||
using Umbraco.Core.ObjectResolution;
|
||||
using Umbraco.Core.Persistence;
|
||||
using Umbraco.Core.Persistence.Factories;
|
||||
using Umbraco.Core.Persistence.SqlSyntax;
|
||||
using Umbraco.Core.Persistence.UnitOfWork;
|
||||
using Umbraco.Core.Profiling;
|
||||
using Umbraco.Core.PropertyEditors;
|
||||
using Umbraco.Core.Publishing;
|
||||
using Umbraco.Core.Services;
|
||||
using Umbraco.Core.Strings;
|
||||
using Umbraco.Web;
|
||||
using Umbraco.Web.Models.Mapping;
|
||||
using umbraco.BusinessLogic;
|
||||
using Umbraco.Core.DependencyInjection;
|
||||
using Umbraco.Core.Persistence.Mappers;
|
||||
using Umbraco.Core.Events;
|
||||
using Umbraco.Core.Models.Identity;
|
||||
using Umbraco.Core.Persistence.Repositories;
|
||||
using Umbraco.Web.DependencyInjection;
|
||||
using ObjectExtensions = Umbraco.Core.ObjectExtensions;
|
||||
|
||||
namespace Umbraco.Tests.TestHelpers
|
||||
{
|
||||
|
||||
@@ -3,7 +3,6 @@ using System.Collections.Generic;
|
||||
using System.Data.Common;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using Moq;
|
||||
using NPoco;
|
||||
using Umbraco.Core;
|
||||
using Umbraco.Core.Events;
|
||||
@@ -12,7 +11,6 @@ using Umbraco.Core.Logging;
|
||||
using Umbraco.Core.Persistence;
|
||||
using Umbraco.Core.Persistence.SqlSyntax;
|
||||
using Umbraco.Core.Persistence.UnitOfWork;
|
||||
using Umbraco.Core.Publishing;
|
||||
using Umbraco.Core.Services;
|
||||
using Umbraco.Core.Strings;
|
||||
using Umbraco.Web.Services;
|
||||
|
||||
@@ -9,7 +9,6 @@ using Umbraco.Core.Services;
|
||||
using umbraco.BusinessLogic;
|
||||
using System.Linq;
|
||||
using Umbraco.Core.Logging;
|
||||
using Umbraco.Core.Publishing;
|
||||
using Umbraco.Web.Services;
|
||||
using Content = Umbraco.Core.Models.Content;
|
||||
using ApplicationTree = Umbraco.Core.Models.ApplicationTree;
|
||||
|
||||
@@ -4,36 +4,25 @@ using System.Globalization;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Net.Http;
|
||||
using System.Net.Http.Formatting;
|
||||
using System.Text;
|
||||
using System.Web.Http;
|
||||
using System.Web.Http.ModelBinding;
|
||||
using System.Web.Http.ModelBinding.Binders;
|
||||
using AutoMapper;
|
||||
using Umbraco.Core;
|
||||
using Umbraco.Core.Logging;
|
||||
using Umbraco.Core.Models;
|
||||
using Umbraco.Core.Models.Membership;
|
||||
using Umbraco.Core.Persistence.DatabaseModelDefinitions;
|
||||
using Umbraco.Core.Publishing;
|
||||
using Umbraco.Core.Services;
|
||||
using Umbraco.Web.Models;
|
||||
using Umbraco.Web.Models.ContentEditing;
|
||||
using Umbraco.Web.Models.Mapping;
|
||||
using Umbraco.Web.Mvc;
|
||||
using Umbraco.Web.Security;
|
||||
using Umbraco.Web.WebApi;
|
||||
using Umbraco.Web.WebApi.Binders;
|
||||
using Umbraco.Web.WebApi.Filters;
|
||||
using umbraco;
|
||||
using Umbraco.Core.Models;
|
||||
using Umbraco.Core.Dynamics;
|
||||
using umbraco.cms.businesslogic.web;
|
||||
using umbraco.presentation.preview;
|
||||
using Umbraco.Core.PropertyEditors;
|
||||
using Umbraco.Web.UI;
|
||||
using Constants = Umbraco.Core.Constants;
|
||||
using Notification = Umbraco.Web.Models.ContentEditing.Notification;
|
||||
|
||||
namespace Umbraco.Web.Editors
|
||||
{
|
||||
|
||||
@@ -1,22 +0,0 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
using Umbraco.Core;
|
||||
using Umbraco.Core.Configuration;
|
||||
using Umbraco.Core.Events;
|
||||
using Umbraco.Core.Models;
|
||||
using Umbraco.Core.Publishing;
|
||||
using Umbraco.Web.Cache;
|
||||
|
||||
|
||||
namespace Umbraco.Web.Strategies.Publishing
|
||||
{
|
||||
[Obsolete("This is not used and will be removed from the codebase in future versions")]
|
||||
public class UpdateCacheAfterPublish : ApplicationEventHandler
|
||||
{
|
||||
}
|
||||
|
||||
[Obsolete("This is not used and will be removed from the codebase in future versions")]
|
||||
public class UpdateCacheAfterUnPublish : ApplicationEventHandler
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -1057,7 +1057,6 @@
|
||||
<Compile Include="Search\ExamineSearcherModel.cs" />
|
||||
<Compile Include="Search\ExamineEvents.cs" />
|
||||
<Compile Include="Strategies\Migrations\PublishAfterUpgradeToVersionSixth.cs" />
|
||||
<Compile Include="Strategies\LegacyClasses.cs" />
|
||||
<Compile Include="Strategies\ServerRegistrationEventHandler.cs" />
|
||||
<Compile Include="Templates\TemplateRenderer.cs" />
|
||||
<Compile Include="Templates\TemplateUtilities.cs" />
|
||||
|
||||
@@ -4,11 +4,8 @@ using System.Text;
|
||||
using System.Web.Mvc;
|
||||
using Umbraco.Core;
|
||||
using Umbraco.Core.Models;
|
||||
using Umbraco.Core.Publishing;
|
||||
using Umbraco.Core.Services;
|
||||
using Umbraco.Web.Mvc;
|
||||
using umbraco;
|
||||
using umbraco.cms.businesslogic.web;
|
||||
|
||||
namespace Umbraco.Web.WebServices
|
||||
{
|
||||
|
||||
@@ -1,14 +1,7 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Web.Mvc;
|
||||
using System.Web.Mvc;
|
||||
using Umbraco.Core;
|
||||
using Umbraco.Core.Strings;
|
||||
using Umbraco.Core.Models;
|
||||
using Umbraco.Core.Publishing;
|
||||
using Umbraco.Core.Services;
|
||||
using Umbraco.Web.Mvc;
|
||||
using umbraco;
|
||||
|
||||
namespace Umbraco.Web.WebServices
|
||||
{
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
using System.Web.Mvc;
|
||||
using umbraco;
|
||||
using Umbraco.Core.Logging;
|
||||
using Umbraco.Core.Publishing;
|
||||
using Umbraco.Core.Services;
|
||||
using Umbraco.Web.Mvc;
|
||||
|
||||
namespace Umbraco.Web.WebServices
|
||||
@@ -27,8 +27,7 @@ namespace Umbraco.Web.WebServices
|
||||
// DO not run publishing if content is re-loading
|
||||
if (content.Instance.isInitializing == false)
|
||||
{
|
||||
var publisher = new ScheduledPublisher(Services.ContentService);
|
||||
publisher.CheckPendingAndProcess();
|
||||
Services.ContentService.WithResult().PerformScheduledPublish();
|
||||
}
|
||||
|
||||
return Json(new
|
||||
|
||||
@@ -144,7 +144,7 @@ namespace umbraco.cms.presentation
|
||||
return node;
|
||||
}
|
||||
|
||||
public struct SortableNode
|
||||
public class SortableNode
|
||||
{
|
||||
public string id;
|
||||
public int sortOrder;
|
||||
|
||||
Reference in New Issue
Block a user