diff --git a/src/Umbraco.Core/CoreBootManager.cs b/src/Umbraco.Core/CoreBootManager.cs
index eb9cc6903e..61947ac165 100644
--- a/src/Umbraco.Core/CoreBootManager.cs
+++ b/src/Umbraco.Core/CoreBootManager.cs
@@ -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;
diff --git a/src/Umbraco.Core/DependencyInjection/ServicesCompositionRoot.cs b/src/Umbraco.Core/DependencyInjection/ServicesCompositionRoot.cs
index e6a100b3e2..9d8bafa354 100644
--- a/src/Umbraco.Core/DependencyInjection/ServicesCompositionRoot.cs
+++ b/src/Umbraco.Core/DependencyInjection/ServicesCompositionRoot.cs
@@ -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
{
diff --git a/src/Umbraco.Core/Publishing/BasePublishingStrategy.cs b/src/Umbraco.Core/Publishing/BasePublishingStrategy.cs
deleted file mode 100644
index 63f32c41c5..0000000000
--- a/src/Umbraco.Core/Publishing/BasePublishingStrategy.cs
+++ /dev/null
@@ -1,46 +0,0 @@
-using System.Collections.Generic;
-using Umbraco.Core.Models;
-
-namespace Umbraco.Core.Publishing
-{
- ///
- /// Abstract class for the implementation of an , which provides the events used for publishing/unpublishing.
- ///
- public abstract class BasePublishingStrategy : IPublishingStrategy
- {
-
- public abstract bool Publish(IContent content, int userId);
- public abstract bool PublishWithChildren(IEnumerable content, int userId);
- public abstract bool UnPublish(IContent content, int userId);
- public abstract bool UnPublish(IEnumerable content, int userId);
-
- ///
- /// Call to fire event that updating the published content has finalized.
- ///
- ///
- /// 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.
- ///
- /// thats being published
- public abstract void PublishingFinalized(IContent content);
-
- ///
- /// Call to fire event that updating the published content has finalized.
- ///
- /// An enumerable list of thats being published
- /// Boolean indicating whether its all content that is republished
- public abstract void PublishingFinalized(IEnumerable content, bool isAllRepublished);
-
- ///
- /// Call to fire event that updating the unpublished content has finalized.
- ///
- /// thats being unpublished
- public abstract void UnPublishingFinalized(IContent content);
-
- ///
- /// Call to fire event that updating the unpublished content has finalized.
- ///
- /// An enumerable list of thats being unpublished
- public abstract void UnPublishingFinalized(IEnumerable content);
- }
-}
\ No newline at end of file
diff --git a/src/Umbraco.Core/Publishing/IPublishingStrategy.cs b/src/Umbraco.Core/Publishing/IPublishingStrategy.cs
deleted file mode 100644
index 0408409488..0000000000
--- a/src/Umbraco.Core/Publishing/IPublishingStrategy.cs
+++ /dev/null
@@ -1,72 +0,0 @@
-using System.Collections.Generic;
-using Umbraco.Core.Models;
-
-namespace Umbraco.Core.Publishing
-{
- ///
- /// Defines the Publishing Strategy
- ///
- public interface IPublishingStrategy
- {
- ///
- /// Publishes a single piece of Content
- ///
- /// to publish
- /// Id of the User issueing the publish operation
- /// True if the publish operation was successfull and not cancelled, otherwise false
- bool Publish(IContent content, int userId);
-
- ///
- /// Publishes a list of Content
- ///
- /// An enumerable list of
- /// Id of the User issueing the publish operation
- /// True if the publish operation was successfull and not cancelled, otherwise false
- bool PublishWithChildren(IEnumerable content, int userId);
-
- ///
- /// Unpublishes a single piece of Content
- ///
- /// to unpublish
- /// Id of the User issueing the unpublish operation
- /// True if the unpublish operation was successfull and not cancelled, otherwise false
- bool UnPublish(IContent content, int userId);
-
- ///
- /// Unpublishes a list of Content
- ///
- /// An enumerable list of
- /// Id of the User issueing the unpublish operation
- /// True if the unpublish operation was successfull and not cancelled, otherwise false
- bool UnPublish(IEnumerable content, int userId);
-
- ///
- /// Call to fire event that updating the published content has finalized.
- ///
- ///
- /// 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.
- ///
- /// thats being published
- void PublishingFinalized(IContent content);
-
- ///
- /// Call to fire event that updating the published content has finalized.
- ///
- /// An enumerable list of thats being published
- /// Boolean indicating whether its all content that is republished
- void PublishingFinalized(IEnumerable content, bool isAllRepublished);
-
- ///
- /// Call to fire event that updating the unpublished content has finalized.
- ///
- /// thats being unpublished
- void UnPublishingFinalized(IContent content);
-
- ///
- /// Call to fire event that updating the unpublished content has finalized.
- ///
- /// An enumerable list of thats being unpublished
- void UnPublishingFinalized(IEnumerable content);
- }
-}
\ No newline at end of file
diff --git a/src/Umbraco.Core/Publishing/ScheduledPublisher.cs b/src/Umbraco.Core/Publishing/ScheduledPublisher.cs
deleted file mode 100644
index 45492423ab..0000000000
--- a/src/Umbraco.Core/Publishing/ScheduledPublisher.cs
+++ /dev/null
@@ -1,61 +0,0 @@
-using System;
-using Umbraco.Core.Logging;
-using Umbraco.Core.Models;
-using Umbraco.Core.Services;
-
-namespace Umbraco.Core.Publishing
-{
- ///
- /// Used to perform scheduled publishing/unpublishing
- ///
- 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("Could not published the document (" + d.Id + ") based on it's scheduled release, status result: " + result.Result.StatusType, result.Exception);
- }
- else
- {
- LogHelper.Warn("Could not published the document (" + d.Id + ") based on it's scheduled release. Status result: " + result.Result.StatusType);
- }
- }
- }
- catch (Exception ee)
- {
- LogHelper.Error(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(string.Format("Error unpublishing node {0}", d.Id), ee);
- throw;
- }
- }
- }
- }
-}
\ No newline at end of file
diff --git a/src/Umbraco.Core/Services/ContentService.cs b/src/Umbraco.Core/Services/ContentService.cs
index ce9c9ad323..2cc3a2a002 100644
--- a/src/Umbraco.Core/Services/ContentService.cs
+++ b/src/Umbraco.Core/Services/ContentService.cs
@@ -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);
}
+ ///
+ /// Used to perform scheduled publishing/unpublishing
+ ///
+ public IEnumerable> 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("Could not published the document (" + d.Id + ") based on it's scheduled release, status result: " + result.Result.StatusType, result.Exception);
+ }
+ else
+ {
+ Logger.Warn("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($"Error unpublishing node {d.Id}", ee);
+ throw;
+ }
+ }
+ }
+
///
/// Publishes a object and all its children
///
diff --git a/src/Umbraco.Core/Services/IContentService.cs b/src/Umbraco.Core/Services/IContentService.cs
index 625f917ffe..14d1791814 100644
--- a/src/Umbraco.Core/Services/IContentService.cs
+++ b/src/Umbraco.Core/Services/IContentService.cs
@@ -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
/// The list of statuses for all published items
IEnumerable> PublishWithChildren(IContent content, int userId = 0, bool includeUnpublished = false);
+ ///
+ /// Used to perform scheduled publishing/unpublishing
+ ///
+ IEnumerable> PerformScheduledPublish();
+
///
/// Saves and Publishes a single object
///
@@ -94,6 +98,8 @@ namespace Umbraco.Core.Services
///
public interface IContentService : IService
{
+
+
///
/// Returns the persisted content's XML structure
///
diff --git a/src/Umbraco.Core/Services/MediaService.cs b/src/Umbraco.Core/Services/MediaService.cs
index f7849ce640..0ebc3d71be 100644
--- a/src/Umbraco.Core/Services/MediaService.cs
+++ b/src/Umbraco.Core/Services/MediaService.cs
@@ -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
diff --git a/src/Umbraco.Core/Publishing/PublishStatus.cs b/src/Umbraco.Core/Services/PublishStatus.cs
similarity index 94%
rename from src/Umbraco.Core/Publishing/PublishStatus.cs
rename to src/Umbraco.Core/Services/PublishStatus.cs
index f348367f22..046ef2e806 100644
--- a/src/Umbraco.Core/Publishing/PublishStatus.cs
+++ b/src/Umbraco.Core/Services/PublishStatus.cs
@@ -1,42 +1,41 @@
-using System.Collections.Generic;
-using Umbraco.Core.Events;
-using Umbraco.Core.Models;
-using Umbraco.Core.Services;
-
-namespace Umbraco.Core.Publishing
-{
- ///
- /// Represents the result of publishing a content item.
- ///
- public class PublishStatus : OperationStatus
- {
- ///
- /// Creates a new instance of the class with a status type, event messages, and a content item.
- ///
- /// The status of the operation.
- /// Event messages produced by the operation.
- /// The content item.
- public PublishStatus(PublishStatusType statusType, EventMessages eventMessages, IContent content)
- : base(statusType, eventMessages, content)
- { }
-
- ///
- /// Creates a new successful instance of the class with a event messages, and a content item.
- ///
- /// Event messages produced by the operation.
- /// The content item.
- public PublishStatus(IContent content, EventMessages eventMessages)
- : base(PublishStatusType.Success, eventMessages, content)
- { }
-
- ///
- /// Gets the content item.
- ///
- public IContent ContentItem => Value;
-
- ///
- /// Gets or sets the invalid properties, if the status failed due to validation.
- ///
- public IEnumerable InvalidProperties { get; set; }
- }
+using System.Collections.Generic;
+using Umbraco.Core.Events;
+using Umbraco.Core.Models;
+
+namespace Umbraco.Core.Services
+{
+ ///
+ /// Represents the result of publishing a content item.
+ ///
+ public class PublishStatus : OperationStatus
+ {
+ ///
+ /// Creates a new instance of the class with a status type, event messages, and a content item.
+ ///
+ /// The status of the operation.
+ /// Event messages produced by the operation.
+ /// The content item.
+ public PublishStatus(PublishStatusType statusType, EventMessages eventMessages, IContent content)
+ : base(statusType, eventMessages, content)
+ { }
+
+ ///
+ /// Creates a new successful instance of the class with a event messages, and a content item.
+ ///
+ /// Event messages produced by the operation.
+ /// The content item.
+ public PublishStatus(IContent content, EventMessages eventMessages)
+ : base(PublishStatusType.Success, eventMessages, content)
+ { }
+
+ ///
+ /// Gets the content item.
+ ///
+ public IContent ContentItem => Value;
+
+ ///
+ /// Gets or sets the invalid properties, if the status failed due to validation.
+ ///
+ public IEnumerable InvalidProperties { get; set; }
+ }
}
\ No newline at end of file
diff --git a/src/Umbraco.Core/Publishing/PublishStatusType.cs b/src/Umbraco.Core/Services/PublishStatusType.cs
similarity index 96%
rename from src/Umbraco.Core/Publishing/PublishStatusType.cs
rename to src/Umbraco.Core/Services/PublishStatusType.cs
index e68b31c887..cc9f21d94d 100644
--- a/src/Umbraco.Core/Publishing/PublishStatusType.cs
+++ b/src/Umbraco.Core/Services/PublishStatusType.cs
@@ -1,84 +1,84 @@
-namespace Umbraco.Core.Publishing
-{
- ///
- /// A value indicating the result of publishing a content item.
- ///
- /// 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.
- ///
- public enum PublishStatusType
- {
- ///
- /// The publishing was successful.
- ///
- Success = 0,
-
- ///
- /// The item was already published.
- ///
- SuccessAlreadyPublished = 1,
-
- // Values below this value indicate a success, values above it indicate a failure.
- // This value is considered a failure.
- //Reserved = 10,
-
- ///
- /// The content could not be published because it's ancestor path isn't published.
- ///
- FailedPathNotPublished = 11,
-
- ///
- /// 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.
- ///
- FailedHasExpired = 12,
-
- ///
- /// 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.
- ///
- FailedAwaitingRelease = 13,
-
- ///
- /// The content item could not be published because it is in the trash.
- ///
- FailedIsTrashed = 14,
-
- ///
- /// The publish action has been cancelled by an event handler.
- ///
- FailedCancelledByEvent = 15,
-
- ///
- /// The content item could not be published because it contains invalid data (has not passed validation requirements).
- ///
- FailedContentInvalid = 16
- }
-
- ///
- /// Provides extension methods for the enum.
- ///
- public static class PublicStatusTypeExtensions
- {
- ///
- /// Gets a value indicating whether the status indicates a success.
- ///
- /// The status.
- /// A value indicating whether the status indicates a success.
- public static bool IsSuccess(this PublishStatusType status)
- {
- return (int) status < 10;
- }
-
- ///
- /// Gets a value indicating whether the status indicates a failure.
- ///
- /// The status.
- /// A value indicating whether the status indicates a failure.
- public static bool IsFailure(this PublishStatusType status)
- {
- return (int) status >= 10;
- }
- }
+namespace Umbraco.Core.Services
+{
+ ///
+ /// A value indicating the result of publishing a content item.
+ ///
+ /// 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.
+ ///
+ public enum PublishStatusType
+ {
+ ///
+ /// The publishing was successful.
+ ///
+ Success = 0,
+
+ ///
+ /// The item was already published.
+ ///
+ SuccessAlreadyPublished = 1,
+
+ // Values below this value indicate a success, values above it indicate a failure.
+ // This value is considered a failure.
+ //Reserved = 10,
+
+ ///
+ /// The content could not be published because it's ancestor path isn't published.
+ ///
+ FailedPathNotPublished = 11,
+
+ ///
+ /// 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.
+ ///
+ FailedHasExpired = 12,
+
+ ///
+ /// 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.
+ ///
+ FailedAwaitingRelease = 13,
+
+ ///
+ /// The content item could not be published because it is in the trash.
+ ///
+ FailedIsTrashed = 14,
+
+ ///
+ /// The publish action has been cancelled by an event handler.
+ ///
+ FailedCancelledByEvent = 15,
+
+ ///
+ /// The content item could not be published because it contains invalid data (has not passed validation requirements).
+ ///
+ FailedContentInvalid = 16
+ }
+
+ ///
+ /// Provides extension methods for the enum.
+ ///
+ public static class PublicStatusTypeExtensions
+ {
+ ///
+ /// Gets a value indicating whether the status indicates a success.
+ ///
+ /// The status.
+ /// A value indicating whether the status indicates a success.
+ public static bool IsSuccess(this PublishStatusType status)
+ {
+ return (int) status < 10;
+ }
+
+ ///
+ /// Gets a value indicating whether the status indicates a failure.
+ ///
+ /// The status.
+ /// A value indicating whether the status indicates a failure.
+ public static bool IsFailure(this PublishStatusType status)
+ {
+ return (int) status >= 10;
+ }
+ }
}
\ No newline at end of file
diff --git a/src/Umbraco.Core/Publishing/UnPublishStatus.cs b/src/Umbraco.Core/Services/UnPublishStatus.cs
similarity index 95%
rename from src/Umbraco.Core/Publishing/UnPublishStatus.cs
rename to src/Umbraco.Core/Services/UnPublishStatus.cs
index 91f242cc6f..42a48177a3 100644
--- a/src/Umbraco.Core/Publishing/UnPublishStatus.cs
+++ b/src/Umbraco.Core/Services/UnPublishStatus.cs
@@ -1,8 +1,7 @@
using Umbraco.Core.Events;
using Umbraco.Core.Models;
-using Umbraco.Core.Services;
-namespace Umbraco.Core.Publishing
+namespace Umbraco.Core.Services
{
///
/// Represents the result of unpublishing a content item.
diff --git a/src/Umbraco.Core/Publishing/UnPublishedStatusType.cs b/src/Umbraco.Core/Services/UnPublishedStatusType.cs
similarity index 94%
rename from src/Umbraco.Core/Publishing/UnPublishedStatusType.cs
rename to src/Umbraco.Core/Services/UnPublishedStatusType.cs
index 515e98daf4..cf887871ef 100644
--- a/src/Umbraco.Core/Publishing/UnPublishedStatusType.cs
+++ b/src/Umbraco.Core/Services/UnPublishedStatusType.cs
@@ -1,4 +1,4 @@
-namespace Umbraco.Core.Publishing
+namespace Umbraco.Core.Services
{
///
/// A status type of the result of unpublishing a content item
diff --git a/src/Umbraco.Core/Umbraco.Core.csproj b/src/Umbraco.Core/Umbraco.Core.csproj
index b15060f743..ac034c170b 100644
--- a/src/Umbraco.Core/Umbraco.Core.csproj
+++ b/src/Umbraco.Core/Umbraco.Core.csproj
@@ -499,8 +499,8 @@
-
-
+
+
@@ -1202,12 +1202,9 @@
-
-
-
-
+
+
-
diff --git a/src/Umbraco.Tests/Persistence/SqlCeTableByTableTest.cs b/src/Umbraco.Tests/Persistence/SqlCeTableByTableTest.cs
index cb6bac7571..a06354c513 100644
--- a/src/Umbraco.Tests/Persistence/SqlCeTableByTableTest.cs
+++ b/src/Umbraco.Tests/Persistence/SqlCeTableByTableTest.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
{
diff --git a/src/Umbraco.Tests/PropertyEditors/MultiValuePropertyEditorTests.cs b/src/Umbraco.Tests/PropertyEditors/MultiValuePropertyEditorTests.cs
index 7bb0b3660a..6d55801631 100644
--- a/src/Umbraco.Tests/PropertyEditors/MultiValuePropertyEditorTests.cs
+++ b/src/Umbraco.Tests/PropertyEditors/MultiValuePropertyEditorTests.cs
@@ -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;
diff --git a/src/Umbraco.Tests/Publishing/PublishingStrategyTests.cs b/src/Umbraco.Tests/Publishing/PublishingStrategyTests.cs
index eaad5b22a2..50f5542de3 100644
--- a/src/Umbraco.Tests/Publishing/PublishingStrategyTests.cs
+++ b/src/Umbraco.Tests/Publishing/PublishingStrategyTests.cs
@@ -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;
diff --git a/src/Umbraco.Tests/Services/ThreadSafetyServiceTest.cs b/src/Umbraco.Tests/Services/ThreadSafetyServiceTest.cs
index cf5cc6212b..0534599173 100644
--- a/src/Umbraco.Tests/Services/ThreadSafetyServiceTest.cs
+++ b/src/Umbraco.Tests/Services/ThreadSafetyServiceTest.cs
@@ -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;
diff --git a/src/Umbraco.Tests/TestHelpers/BaseDatabaseFactoryTest.cs b/src/Umbraco.Tests/TestHelpers/BaseDatabaseFactoryTest.cs
index 10ddecdd57..dc49b6c20e 100644
--- a/src/Umbraco.Tests/TestHelpers/BaseDatabaseFactoryTest.cs
+++ b/src/Umbraco.Tests/TestHelpers/BaseDatabaseFactoryTest.cs
@@ -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
diff --git a/src/Umbraco.Tests/TestHelpers/BaseUmbracoApplicationTest.cs b/src/Umbraco.Tests/TestHelpers/BaseUmbracoApplicationTest.cs
index 2be8423a76..d36042e180 100644
--- a/src/Umbraco.Tests/TestHelpers/BaseUmbracoApplicationTest.cs
+++ b/src/Umbraco.Tests/TestHelpers/BaseUmbracoApplicationTest.cs
@@ -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
{
diff --git a/src/Umbraco.Tests/TestHelpers/TestObjects.cs b/src/Umbraco.Tests/TestHelpers/TestObjects.cs
index eccc68d07e..1c0f7c1b82 100644
--- a/src/Umbraco.Tests/TestHelpers/TestObjects.cs
+++ b/src/Umbraco.Tests/TestHelpers/TestObjects.cs
@@ -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;
diff --git a/src/Umbraco.Web/Cache/CacheRefresherEventHandler.cs b/src/Umbraco.Web/Cache/CacheRefresherEventHandler.cs
index 1e63c67e3e..b354bb8a8f 100644
--- a/src/Umbraco.Web/Cache/CacheRefresherEventHandler.cs
+++ b/src/Umbraco.Web/Cache/CacheRefresherEventHandler.cs
@@ -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;
diff --git a/src/Umbraco.Web/Editors/ContentController.cs b/src/Umbraco.Web/Editors/ContentController.cs
index 93407bcbbd..0dbd75171a 100644
--- a/src/Umbraco.Web/Editors/ContentController.cs
+++ b/src/Umbraco.Web/Editors/ContentController.cs
@@ -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
{
diff --git a/src/Umbraco.Web/Strategies/LegacyClasses.cs b/src/Umbraco.Web/Strategies/LegacyClasses.cs
deleted file mode 100644
index 434ab8ccbf..0000000000
--- a/src/Umbraco.Web/Strategies/LegacyClasses.cs
+++ /dev/null
@@ -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
- {
- }
-}
\ No newline at end of file
diff --git a/src/Umbraco.Web/Umbraco.Web.csproj b/src/Umbraco.Web/Umbraco.Web.csproj
index 41c9338134..afa98a407b 100644
--- a/src/Umbraco.Web/Umbraco.Web.csproj
+++ b/src/Umbraco.Web/Umbraco.Web.csproj
@@ -1057,7 +1057,6 @@
-
diff --git a/src/Umbraco.Web/WebServices/BulkPublishController.cs b/src/Umbraco.Web/WebServices/BulkPublishController.cs
index 65e0078ace..5411beb61f 100644
--- a/src/Umbraco.Web/WebServices/BulkPublishController.cs
+++ b/src/Umbraco.Web/WebServices/BulkPublishController.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
{
diff --git a/src/Umbraco.Web/WebServices/CoreStringsController.cs b/src/Umbraco.Web/WebServices/CoreStringsController.cs
index de7bcd55d5..43be19908c 100644
--- a/src/Umbraco.Web/WebServices/CoreStringsController.cs
+++ b/src/Umbraco.Web/WebServices/CoreStringsController.cs
@@ -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
{
diff --git a/src/Umbraco.Web/WebServices/ScheduledPublishController.cs b/src/Umbraco.Web/WebServices/ScheduledPublishController.cs
index 0ab76738dc..8169a44284 100644
--- a/src/Umbraco.Web/WebServices/ScheduledPublishController.cs
+++ b/src/Umbraco.Web/WebServices/ScheduledPublishController.cs
@@ -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
diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/sort.aspx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/sort.aspx.cs
index f55a08aead..47325af895 100644
--- a/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/sort.aspx.cs
+++ b/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/sort.aspx.cs
@@ -144,7 +144,7 @@ namespace umbraco.cms.presentation
return node;
}
- public struct SortableNode
+ public class SortableNode
{
public string id;
public int sortOrder;