diff --git a/src/Umbraco.Core/ApplicationContext.cs b/src/Umbraco.Core/ApplicationContext.cs index 3e626ca922..36dd3e23fe 100644 --- a/src/Umbraco.Core/ApplicationContext.cs +++ b/src/Umbraco.Core/ApplicationContext.cs @@ -4,6 +4,7 @@ using System.Web; using System.Web.Caching; using Umbraco.Core.Configuration; using Umbraco.Core.Logging; +using Umbraco.Core.Services; namespace Umbraco.Core @@ -141,5 +142,10 @@ namespace Umbraco.Core { get { return DatabaseContext.Current; } } + + /// + /// Gets the current ServiceContext + /// + public ServiceContext Services { get { return ServiceContext.Current; } } } } diff --git a/src/Umbraco.Web/Services/ContentService.cs b/src/Umbraco.Core/Services/ContentService.cs similarity index 97% rename from src/Umbraco.Web/Services/ContentService.cs rename to src/Umbraco.Core/Services/ContentService.cs index b6bbce3517..433b48fcfa 100644 --- a/src/Umbraco.Web/Services/ContentService.cs +++ b/src/Umbraco.Core/Services/ContentService.cs @@ -1,7 +1,6 @@ using System; using System.Collections.Generic; using System.Linq; -using System.Web; using Umbraco.Core.Logging; using Umbraco.Core.Models; using Umbraco.Core.Models.EntityBase; @@ -10,9 +9,8 @@ using Umbraco.Core.Persistence.Querying; using Umbraco.Core.Persistence.Repositories; using Umbraco.Core.Persistence.UnitOfWork; using Umbraco.Core.Publishing; -using Umbraco.Core.Services; -namespace Umbraco.Web.Services +namespace Umbraco.Core.Services { /// /// Represents the Content Service, which is an easy access to operations involving diff --git a/src/Umbraco.Web/Services/ContentTypeService.cs b/src/Umbraco.Core/Services/ContentTypeService.cs similarity index 97% rename from src/Umbraco.Web/Services/ContentTypeService.cs rename to src/Umbraco.Core/Services/ContentTypeService.cs index 4c714b0683..836f23318e 100644 --- a/src/Umbraco.Web/Services/ContentTypeService.cs +++ b/src/Umbraco.Core/Services/ContentTypeService.cs @@ -2,16 +2,14 @@ using System; using System.Collections.Generic; using System.Linq; using System.Text; -using Umbraco.Core; using Umbraco.Core.Configuration; using Umbraco.Core.Models; using Umbraco.Core.Persistence; using Umbraco.Core.Persistence.Querying; using Umbraco.Core.Persistence.Repositories; using Umbraco.Core.Persistence.UnitOfWork; -using Umbraco.Core.Services; -namespace Umbraco.Web.Services +namespace Umbraco.Core.Services { /// /// Represents the ContentType Service, which is an easy access to operations involving diff --git a/src/Umbraco.Web/Services/DataTypeService.cs b/src/Umbraco.Core/Services/DataTypeService.cs similarity index 96% rename from src/Umbraco.Web/Services/DataTypeService.cs rename to src/Umbraco.Core/Services/DataTypeService.cs index 5d926f89c4..c5aa8951d9 100644 --- a/src/Umbraco.Web/Services/DataTypeService.cs +++ b/src/Umbraco.Core/Services/DataTypeService.cs @@ -1,16 +1,14 @@ using System; using System.Collections.Generic; using System.Linq; -using Umbraco.Core; using Umbraco.Core.Models; using Umbraco.Core.Persistence; using Umbraco.Core.Persistence.Querying; using Umbraco.Core.Persistence.Repositories; using Umbraco.Core.Persistence.UnitOfWork; -using Umbraco.Core.Services; using umbraco.interfaces; -namespace Umbraco.Web.Services +namespace Umbraco.Core.Services { /// /// Represents the DataType Service, which is an easy access to operations involving and diff --git a/src/Umbraco.Web/Services/FileService.cs b/src/Umbraco.Core/Services/FileService.cs similarity index 96% rename from src/Umbraco.Web/Services/FileService.cs rename to src/Umbraco.Core/Services/FileService.cs index 4d7ef2ac79..1ad2a53570 100644 --- a/src/Umbraco.Web/Services/FileService.cs +++ b/src/Umbraco.Core/Services/FileService.cs @@ -3,9 +3,8 @@ using Umbraco.Core.Models; using Umbraco.Core.Persistence; using Umbraco.Core.Persistence.Repositories; using Umbraco.Core.Persistence.UnitOfWork; -using Umbraco.Core.Services; -namespace Umbraco.Web.Services +namespace Umbraco.Core.Services { /// /// Represents the File Service, which is an easy access to operations involving objects like Scripts, Stylesheets and Templates diff --git a/src/Umbraco.Core/Services/IMacroService.cs b/src/Umbraco.Core/Services/IMacroService.cs index cb327d3630..f935b2d809 100644 --- a/src/Umbraco.Core/Services/IMacroService.cs +++ b/src/Umbraco.Core/Services/IMacroService.cs @@ -6,7 +6,7 @@ namespace Umbraco.Core.Services /// /// Defines the ContentService, which is an easy access to operations involving /// - public interface IMacroService : IService + internal interface IMacroService : IService { //TODO Possibly create import macro method and ToXml? diff --git a/src/Umbraco.Web/Services/LocalizationService.cs b/src/Umbraco.Core/Services/LocalizationService.cs similarity index 96% rename from src/Umbraco.Web/Services/LocalizationService.cs rename to src/Umbraco.Core/Services/LocalizationService.cs index ae0e189c85..1c60ad5caf 100644 --- a/src/Umbraco.Web/Services/LocalizationService.cs +++ b/src/Umbraco.Core/Services/LocalizationService.cs @@ -6,9 +6,8 @@ using Umbraco.Core.Persistence; using Umbraco.Core.Persistence.Querying; using Umbraco.Core.Persistence.Repositories; using Umbraco.Core.Persistence.UnitOfWork; -using Umbraco.Core.Services; -namespace Umbraco.Web.Services +namespace Umbraco.Core.Services { /// /// Represents the Localization Service, which is an easy access to operations involving and diff --git a/src/Umbraco.Web/Services/MacroService.cs b/src/Umbraco.Core/Services/MacroService.cs similarity index 94% rename from src/Umbraco.Web/Services/MacroService.cs rename to src/Umbraco.Core/Services/MacroService.cs index 76bce4f469..0eee5d7ec4 100644 --- a/src/Umbraco.Web/Services/MacroService.cs +++ b/src/Umbraco.Core/Services/MacroService.cs @@ -1,18 +1,16 @@ using System.Collections.Generic; using System.Linq; -using Umbraco.Core; using Umbraco.Core.Models; using Umbraco.Core.Persistence; using Umbraco.Core.Persistence.Repositories; using Umbraco.Core.Persistence.UnitOfWork; -using Umbraco.Core.Services; -namespace Umbraco.Web.Services +namespace Umbraco.Core.Services { /// /// Represents the Macro Service, which is an easy access to operations involving /// - public class MacroService : IMacroService + internal class MacroService : IMacroService { private readonly IUnitOfWork _unitOfWork; diff --git a/src/Umbraco.Web/Services/MediaService.cs b/src/Umbraco.Core/Services/MediaService.cs similarity index 96% rename from src/Umbraco.Web/Services/MediaService.cs rename to src/Umbraco.Core/Services/MediaService.cs index ef5a16178f..eaf4c7011c 100644 --- a/src/Umbraco.Web/Services/MediaService.cs +++ b/src/Umbraco.Core/Services/MediaService.cs @@ -4,9 +4,8 @@ using Umbraco.Core.Persistence; using Umbraco.Core.Persistence.Querying; using Umbraco.Core.Persistence.Repositories; using Umbraco.Core.Persistence.UnitOfWork; -using Umbraco.Core.Services; -namespace Umbraco.Web.Services +namespace Umbraco.Core.Services { /// /// Represents the Media Service, which is an easy access to operations involving diff --git a/src/Umbraco.Web/Services/ServiceContext.cs b/src/Umbraco.Core/Services/ServiceContext.cs similarity index 95% rename from src/Umbraco.Web/Services/ServiceContext.cs rename to src/Umbraco.Core/Services/ServiceContext.cs index f0f44ca000..088e470938 100644 --- a/src/Umbraco.Web/Services/ServiceContext.cs +++ b/src/Umbraco.Core/Services/ServiceContext.cs @@ -2,9 +2,8 @@ using System; using System.Collections.Concurrent; using Umbraco.Core.Persistence.UnitOfWork; using Umbraco.Core.Publishing; -using Umbraco.Core.Services; -namespace Umbraco.Web.Services +namespace Umbraco.Core.Services { /// /// The Umbraco ServiceContext, which provides access to the following services: @@ -116,7 +115,7 @@ namespace Umbraco.Web.Services /// /// Gets the /// - public IMacroService MacroService + internal IMacroService MacroService { get { return _cache[typeof(IMacroService).Name] as IMacroService; } } diff --git a/src/Umbraco.Web/Services/ServiceFactory.cs b/src/Umbraco.Core/Services/ServiceFactory.cs similarity index 91% rename from src/Umbraco.Web/Services/ServiceFactory.cs rename to src/Umbraco.Core/Services/ServiceFactory.cs index b9f984a717..0d4bbac2e8 100644 --- a/src/Umbraco.Web/Services/ServiceFactory.cs +++ b/src/Umbraco.Core/Services/ServiceFactory.cs @@ -1,6 +1,4 @@ -using Umbraco.Core.Services; - -namespace Umbraco.Web.Services +namespace Umbraco.Core.Services { /// /// Represents the ServiceFactory, which provides access to the various services in @@ -59,7 +57,7 @@ namespace Umbraco.Web.Services /// /// Gets the /// - public static IMacroService MacroService + internal static IMacroService MacroService { get { return ServiceContext.Current.MacroService; } } diff --git a/src/Umbraco.Web/Services/UserService.cs b/src/Umbraco.Core/Services/UserService.cs similarity index 95% rename from src/Umbraco.Web/Services/UserService.cs rename to src/Umbraco.Core/Services/UserService.cs index cd9ccae500..1e15e76d39 100644 --- a/src/Umbraco.Web/Services/UserService.cs +++ b/src/Umbraco.Core/Services/UserService.cs @@ -1,13 +1,11 @@ using System; using System.Web; -using Umbraco.Core; using Umbraco.Core.Models.Membership; using Umbraco.Core.Persistence; using Umbraco.Core.Persistence.Repositories; using Umbraco.Core.Persistence.UnitOfWork; -using Umbraco.Core.Services; -namespace Umbraco.Web.Services +namespace Umbraco.Core.Services { /// /// Represents the UserService, which is an easy access to operations involving and eventually Users and Members. diff --git a/src/Umbraco.Core/Umbraco.Core.csproj b/src/Umbraco.Core/Umbraco.Core.csproj index 6f0565f54c..175eb2a833 100644 --- a/src/Umbraco.Core/Umbraco.Core.csproj +++ b/src/Umbraco.Core/Umbraco.Core.csproj @@ -408,6 +408,10 @@ + + + + @@ -417,6 +421,12 @@ + + + + + + diff --git a/src/Umbraco.Tests/ContentStores/PublishContentStoreTests.cs b/src/Umbraco.Tests/ContentStores/PublishContentStoreTests.cs index 2a59e7888e..26594a57da 100644 --- a/src/Umbraco.Tests/ContentStores/PublishContentStoreTests.cs +++ b/src/Umbraco.Tests/ContentStores/PublishContentStoreTests.cs @@ -5,7 +5,6 @@ using Umbraco.Core; using Umbraco.Tests.TestHelpers; using Umbraco.Web; using Umbraco.Web.Routing; -using Umbraco.Web.Services; using umbraco.BusinessLogic; namespace Umbraco.Tests.ContentStores diff --git a/src/Umbraco.Tests/Persistence/Repositories/ContentTypeRepositoryTest.cs b/src/Umbraco.Tests/Persistence/Repositories/ContentTypeRepositoryTest.cs index 59321639fd..cc1c049cce 100644 --- a/src/Umbraco.Tests/Persistence/Repositories/ContentTypeRepositoryTest.cs +++ b/src/Umbraco.Tests/Persistence/Repositories/ContentTypeRepositoryTest.cs @@ -4,7 +4,6 @@ using NUnit.Framework; using Umbraco.Core.Models; using Umbraco.Core.Models.EntityBase; using Umbraco.Core.Persistence; -using Umbraco.Core.Persistence.Caching; using Umbraco.Core.Persistence.Repositories; using Umbraco.Core.Persistence.UnitOfWork; using Umbraco.Tests.TestHelpers; @@ -29,6 +28,8 @@ namespace Umbraco.Tests.Persistence.Repositories base.TearDown(); } + //TODO Add test to verify SetDefaultTemplates updates both AllowedTemplates and DefaultTemplate(id). + [Test] public void Can_Instantiate_Repository() { diff --git a/src/Umbraco.Tests/Services/ContentServiceTests.cs b/src/Umbraco.Tests/Services/ContentServiceTests.cs index 1508f507a0..4be955960b 100644 --- a/src/Umbraco.Tests/Services/ContentServiceTests.cs +++ b/src/Umbraco.Tests/Services/ContentServiceTests.cs @@ -4,10 +4,8 @@ using System.Linq; using NUnit.Framework; using Umbraco.Core.Models; using Umbraco.Core.Models.Rdbms; -using Umbraco.Core.Services; using Umbraco.Tests.TestHelpers; using Umbraco.Tests.TestHelpers.Entities; -using Umbraco.Web.Services; namespace Umbraco.Tests.Services { @@ -28,6 +26,7 @@ namespace Umbraco.Tests.Services } //TODO Add test to verify there is only ONE newest document/content in cmsDocument table after updating. + //TODO Add test to delete specific version (with and without deleting prior versions) and versions by date. [Test] public void Can_Create_Content() diff --git a/src/Umbraco.Tests/TestHelpers/BaseDatabaseFactoryTest.cs b/src/Umbraco.Tests/TestHelpers/BaseDatabaseFactoryTest.cs index dcc87d4dca..5184230ab2 100644 --- a/src/Umbraco.Tests/TestHelpers/BaseDatabaseFactoryTest.cs +++ b/src/Umbraco.Tests/TestHelpers/BaseDatabaseFactoryTest.cs @@ -10,10 +10,10 @@ using Umbraco.Core.Configuration; using Umbraco.Core.IO; using Umbraco.Core.ObjectResolution; using Umbraco.Core.Persistence; +using Umbraco.Core.Services; using Umbraco.Tests.Stubs; using Umbraco.Web; using Umbraco.Web.Routing; -using Umbraco.Web.Services; using umbraco.BusinessLogic; namespace Umbraco.Tests.TestHelpers diff --git a/src/Umbraco.Web/Strategies/UpdateContentCache.cs b/src/Umbraco.Web/Strategies/UpdateContentCache.cs index c3c529e984..4dc81a5576 100644 --- a/src/Umbraco.Web/Strategies/UpdateContentCache.cs +++ b/src/Umbraco.Web/Strategies/UpdateContentCache.cs @@ -8,7 +8,7 @@ using Umbraco.Core; using Umbraco.Core.Configuration; using Umbraco.Core.Models; using Umbraco.Core.Publishing; -using Umbraco.Web.Services; +using Umbraco.Core.Services; using umbraco.interfaces; using umbraco.presentation.nodeFactory; using Node = umbraco.NodeFactory.Node; diff --git a/src/Umbraco.Web/Umbraco.Web.csproj b/src/Umbraco.Web/Umbraco.Web.csproj index 5c30c2a4fe..61425a13fc 100644 --- a/src/Umbraco.Web/Umbraco.Web.csproj +++ b/src/Umbraco.Web/Umbraco.Web.csproj @@ -313,16 +313,6 @@ - - - - - - - - - - @@ -2168,9 +2158,7 @@ umbraco_org_umbraco_update_CheckForUpgrade - - - + 10.0 $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) diff --git a/src/Umbraco.Web/UmbracoContext.cs b/src/Umbraco.Web/UmbracoContext.cs index 87b846cde8..bf722a4300 100644 --- a/src/Umbraco.Web/UmbracoContext.cs +++ b/src/Umbraco.Web/UmbracoContext.cs @@ -1,8 +1,8 @@ using System; using System.Web; using Umbraco.Core; +using Umbraco.Core.Services; using Umbraco.Web.Routing; -using Umbraco.Web.Services; using umbraco; using umbraco.IO; using umbraco.presentation; @@ -103,12 +103,7 @@ namespace Umbraco.Web /// /// Gets the current ApplicationContext /// - public ApplicationContext Application { get; private set; } - - /// - /// Gets the current ServiceContext - /// - public ServiceContext Services { get { return ServiceContext.Current; } } + public ApplicationContext Application { get; private set; } /// /// Gets the