diff --git a/build/NuSpecs/UmbracoCms.Compat7.nuspec b/build/NuSpecs/UmbracoCms.Compat7.nuspec deleted file mode 100644 index d2719a694e..0000000000 --- a/build/NuSpecs/UmbracoCms.Compat7.nuspec +++ /dev/null @@ -1,27 +0,0 @@ - - - - UmbracoCms.Compat7 - 8.0.0 - Umbraco Cms Compat7 - Umbraco HQ - Umbraco HQ - http://opensource.org/licenses/MIT - http://umbraco.com/ - http://umbraco.com/media/357769/100px_transparent.png - false - Contains resources aiming at providing a better v7-to-v8 backward compatibility. - Umbraco v7 compatibility layer for v8. - en-US - umbraco - - - - - - - - - \ No newline at end of file diff --git a/build/NuSpecs/UmbracoCms.Core.nuspec b/build/NuSpecs/UmbracoCms.Core.nuspec index 64c8b89f49..d06b5e7136 100644 --- a/build/NuSpecs/UmbracoCms.Core.nuspec +++ b/build/NuSpecs/UmbracoCms.Core.nuspec @@ -15,32 +15,57 @@ en-US umbraco - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/build/NuSpecs/UmbracoCms.nuspec b/build/NuSpecs/UmbracoCms.nuspec index 8f5cf495c7..241a46d2c2 100644 --- a/build/NuSpecs/UmbracoCms.nuspec +++ b/build/NuSpecs/UmbracoCms.nuspec @@ -16,8 +16,7 @@ umbraco - - + diff --git a/build/build.ps1 b/build/build.ps1 index d2c505dede..0db043cafe 100644 --- a/build/build.ps1 +++ b/build/build.ps1 @@ -153,7 +153,6 @@ $src = "$($this.SolutionRoot)\src" $log = "$($this.BuildTemp)\msbuild.umbraco.log" - $log7 = "$($this.BuildTemp)\msbuild.compat7.log" if ($this.BuildEnv.VisualStudio -eq $null) { @@ -181,24 +180,6 @@ if (-not $?) { throw "Failed to compile Umbraco.Web.UI." } - Write-Host "Logging to $log7" - - &$this.BuildEnv.VisualStudio.MsBuild "$src\Umbraco.Compat7\Umbraco.Compat7.csproj" ` - /p:WarningLevel=0 ` - /p:Configuration=$buildConfiguration ` - /p:Platform=AnyCPU ` - /p:UseWPP_CopyWebApplication=True ` - /p:PipelineDependsOnBuild=False ` - /p:OutDir="$($this.BuildTemp)\bin\\" ` - /p:WebProjectOutputDir="$($this.BuildTemp)\WebApp\\" ` - /p:Verbosity=minimal ` - /t:Rebuild ` - /tv:"$($this.BuildEnv.VisualStudio.ToolsVersion)" ` - /p:UmbracoBuild=True ` - > $log7 - - if (-not $?) { throw "Failed to compile Umbraco.Compat7." } - # /p:UmbracoBuild tells the csproj that we are building from PS, not VS }) @@ -342,14 +323,14 @@ Write-Host "Zip all binaries" &$this.BuildEnv.Zip a -r "$out\UmbracoCms.AllBinaries.$($this.Version.Semver).zip" ` "$tmp\bin\*" ` - "-x!dotless.Core.*" "-x!Umbraco.Compat7.*" ` + "-x!dotless.Core.*" ` > $null if (-not $?) { throw "Failed to zip UmbracoCms.AllBinaries." } Write-Host "Zip cms" &$this.BuildEnv.Zip a -r "$out\UmbracoCms.$($this.Version.Semver).zip" ` "$tmp\WebApp\*" ` - "-x!dotless.Core.*" "-x!Content_Types.xml" "-x!*.pdb" "-x!Umbraco.Compat7.*" ` + "-x!dotless.Core.*" "-x!Content_Types.xml" "-x!*.pdb" ` > $null if (-not $?) { throw "Failed to zip UmbracoCms." } }) @@ -362,6 +343,26 @@ $this.TempStoreFile("$($this.SolutionRoot)\src\Umbraco.Web.UI\web.config") Write-Host "Create clean web.config" $this.CopyFile("$($this.SolutionRoot)\src\Umbraco.Web.UI\web.Template.config", "$($this.SolutionRoot)\src\Umbraco.Web.UI\web.config") + + Write-host "Set environment" + $env:UMBRACO_VERSION=$this.Version.Semver.ToString() + $env:UMBRACO_RELEASE=$this.Version.Release + $env:UMBRACO_COMMENT=$this.Version.Comment + $env:UMBRACO_BUILD=$this.Version.Build + + if ($args -and $args[0] -eq "vso") + { + Write-host "Set VSO environment" + # set environment variable for VSO + # https://github.com/Microsoft/vsts-tasks/issues/375 + # https://github.com/Microsoft/vsts-tasks/blob/master/docs/authoring/commands.md + Write-Host ("##vso[task.setvariable variable=UMBRACO_VERSION;]$($this.Version.Semver.ToString())") + Write-Host ("##vso[task.setvariable variable=UMBRACO_RELEASE;]$($this.Version.Release)") + Write-Host ("##vso[task.setvariable variable=UMBRACO_COMMENT;]$($this.Version.Comment)") + Write-Host ("##vso[task.setvariable variable=UMBRACO_BUILD;]$($this.Version.Build)") + + Write-Host ("##vso[task.setvariable variable=UMBRACO_TMP;]$($this.SolutionRoot)\build.tmp") + } }) $ubuild.DefineMethod("PrepareNuGet", @@ -407,12 +408,6 @@ -Verbosity detailed -outputDirectory "$($this.BuildOutput)" > "$($this.BuildTemp)\nupack.cms.log" if (-not $?) { throw "Failed to pack NuGet UmbracoCms." } - &$this.BuildEnv.NuGet Pack "$nuspecs\UmbracoCms.Compat7.nuspec" ` - -Properties BuildTmp="$($this.BuildTemp)" ` - -Version $this.Version.Semver.ToString() ` - -Verbosity detailed -outputDirectory "$($this.BuildOutput)" > "$($this.BuildTemp)\nupack.compat7.log" - if (-not $?) { throw "Failed to pack NuGet UmbracoCms.Compat7." } - # run hook if ($this.HasMethod("PostPackageNuGet")) { @@ -425,8 +420,8 @@ $ubuild.DefineMethod("VerifyNuGet", { $this.VerifyNuGetConsistency( - ("UmbracoCms", "UmbracoCms.Core", "UmbracoCms.Compat7"), - ("Umbraco.Core", "Umbraco.Web", "Umbraco.Web.UI", "Umbraco.Examine", "Umbraco.Compat7")) + ("UmbracoCms", "UmbracoCms.Core"), + ("Umbraco.Core", "Umbraco.Web", "Umbraco.Web.UI", "Umbraco.Examine")) if ($this.OnError()) { return } }) diff --git a/src/SolutionInfo.cs b/src/SolutionInfo.cs index 02fb9034b7..e1071334d6 100644 --- a/src/SolutionInfo.cs +++ b/src/SolutionInfo.cs @@ -17,4 +17,4 @@ using System.Resources; // these are FYI and changed automatically [assembly: AssemblyFileVersion("8.0.0")] -[assembly: AssemblyInformationalVersion("8.0.0-alpha.32")] +[assembly: AssemblyInformationalVersion("8.0.0-alpha.33")] diff --git a/src/Umbraco.Compat7/Compat7Component.cs b/src/Umbraco.Compat7/Compat7Component.cs deleted file mode 100644 index 6fe60ad31b..0000000000 --- a/src/Umbraco.Compat7/Compat7Component.cs +++ /dev/null @@ -1,70 +0,0 @@ -using System; -using System.Collections.Generic; -using LightInject; -using System.Linq; -using Umbraco.Core; -using Umbraco.Core.Components; -using Umbraco.Core.Logging; -using Umbraco.Core.Composing; - -namespace Umbraco.Compat7 -{ - public class Compat7Component : UmbracoComponentBase, IUmbracoUserComponent - { - private List _handlers; - private UmbracoApplicationBase _app; - - // these events replace the UmbracoApplicationBase corresponding events - public static event EventHandler ApplicationStarting; - public static event EventHandler ApplicationStarted; - - public override void Compose(Composition composition) - { - base.Compose(composition); - - var container = composition.Container; - _app = container.GetInstance(); - var logger = container.GetInstance(); - - var pluginManager = container.GetInstance(); - var handlerTypes = pluginManager.GetTypes(); - - _handlers = handlerTypes.Select(Activator.CreateInstance).Cast().ToList(); - - foreach (var handler in _handlers) - logger.Debug($"Adding ApplicationEventHandler {handler.GetType().FullName}."); - - foreach (var handler in _handlers) - handler.OnApplicationInitialized(_app, ApplicationContext.Current); - - foreach (var handler in _handlers) - handler.OnApplicationStarting(_app, ApplicationContext.Current); - - try - { - ApplicationStarting?.Invoke(_app, EventArgs.Empty); - } - catch (Exception ex) - { - logger.Error("An error occurred in an ApplicationStarting event handler", ex); - throw; - } - } - - public void Initialize(ILogger logger) - { - foreach (var handler in _handlers) - handler.OnApplicationStarted(_app, ApplicationContext.Current); - - try - { - ApplicationStarted?.Invoke(_app, EventArgs.Empty); - } - catch (Exception ex) - { - logger.Error("An error occurred in an ApplicationStarting event handler", ex); - throw; - } - } - } -} diff --git a/src/Umbraco.Compat7/Core/ActionsResolver.cs b/src/Umbraco.Compat7/Core/ActionsResolver.cs deleted file mode 100644 index 3ee2a26ee0..0000000000 --- a/src/Umbraco.Compat7/Core/ActionsResolver.cs +++ /dev/null @@ -1,17 +0,0 @@ -using System.Collections.Generic; -using Umbraco.Web._Legacy.Actions; -using WebCurrent = Umbraco.Web.Composing.Current; - -// ReSharper disable once CheckNamespace -namespace Umbraco.Core -{ - public class ActionsResolver - { - private ActionsResolver() - { } - - public static ActionsResolver Current { get; } = new ActionsResolver(); - - public IEnumerable Actions => WebCurrent.Actions; - } -} diff --git a/src/Umbraco.Compat7/Core/ApplicationContext.cs b/src/Umbraco.Compat7/Core/ApplicationContext.cs deleted file mode 100644 index 136ab42138..0000000000 --- a/src/Umbraco.Compat7/Core/ApplicationContext.cs +++ /dev/null @@ -1,37 +0,0 @@ -using System; -using Umbraco.Core.Cache; -using Umbraco.Core.Logging; -using Umbraco.Core.Persistence; -using Umbraco.Core.Services; -using LightInject; - -// ReSharper disable once CheckNamespace -namespace Umbraco.Core -{ - public class ApplicationContext : IDisposable - { - private ApplicationContext() - { - DatabaseContext = new DatabaseContext(Composing.Current.Container.GetInstance()); - } - - public static ApplicationContext Current { get; } = new ApplicationContext(); - - public CacheHelper ApplicationCache => Composing.Current.ApplicationCache; - - public ProfilingLogger ProfilingLogger => Composing.Current.ProfilingLogger; - - public bool IsReady { get; } = true; // because... not accessible before we are ready - - public bool IsConfigured => Composing.Current.RuntimeState.Level == RuntimeLevel.Run; - - public bool IsUpgrading => Composing.Current.RuntimeState.Level == RuntimeLevel.Upgrade; - - public DatabaseContext DatabaseContext { get; } - - public ServiceContext Services => Composing.Current.Services; - - public void Dispose() - { } - } -} diff --git a/src/Umbraco.Compat7/Core/ApplicationEventHandler.cs b/src/Umbraco.Compat7/Core/ApplicationEventHandler.cs deleted file mode 100644 index b60c5dd49f..0000000000 --- a/src/Umbraco.Compat7/Core/ApplicationEventHandler.cs +++ /dev/null @@ -1,63 +0,0 @@ -// ReSharper disable once CheckNamespace -namespace Umbraco.Core -{ - public abstract class ApplicationEventHandler : IApplicationEventHandler - { - public void OnApplicationInitialized(UmbracoApplicationBase umbracoApplication, ApplicationContext applicationContext) - { - if (ShouldExecute(applicationContext)) - { - ApplicationInitialized(umbracoApplication, applicationContext); - } - } - - public void OnApplicationStarting(UmbracoApplicationBase umbracoApplication, ApplicationContext applicationContext) - { - if (ShouldExecute(applicationContext)) - { - ApplicationStarting(umbracoApplication, applicationContext); - } - } - - public void OnApplicationStarted(UmbracoApplicationBase umbracoApplication, ApplicationContext applicationContext) - { - if (ShouldExecute(applicationContext)) - { - ApplicationStarted(umbracoApplication, applicationContext); - } - } - - protected virtual void ApplicationInitialized(UmbracoApplicationBase umbracoApplication, ApplicationContext applicationContext) - { } - - protected virtual void ApplicationStarting(UmbracoApplicationBase umbracoApplication, ApplicationContext applicationContext) - { } - - protected virtual void ApplicationStarted(UmbracoApplicationBase umbracoApplication, ApplicationContext applicationContext) - { } - - private bool ShouldExecute(ApplicationContext applicationContext) - { - if (applicationContext.IsConfigured && applicationContext.DatabaseContext.IsDatabaseConfigured) - { - return true; - } - - if (applicationContext.IsConfigured == false && ExecuteWhenApplicationNotConfigured) - { - return true; - } - - if (applicationContext.DatabaseContext.IsDatabaseConfigured == false && ExecuteWhenDatabaseNotConfigured) - { - return true; - } - - return false; - } - - protected virtual bool ExecuteWhenApplicationNotConfigured => false; - - protected virtual bool ExecuteWhenDatabaseNotConfigured => false; - } -} diff --git a/src/Umbraco.Compat7/Core/Cache/CacheRefreshersResolver.cs b/src/Umbraco.Compat7/Core/Cache/CacheRefreshersResolver.cs deleted file mode 100644 index 849e9ad483..0000000000 --- a/src/Umbraco.Compat7/Core/Cache/CacheRefreshersResolver.cs +++ /dev/null @@ -1,23 +0,0 @@ -using System; -using System.Collections.Generic; -using Umbraco.Core.ObjectResolution; -using CoreCurrent = Umbraco.Core.Composing.Current; -using LightInject; - -// ReSharper disable once CheckNamespace -namespace Umbraco.Core.Cache -{ - public class CacheRefreshersResolver : LazyManyObjectsResolverBase - { - private CacheRefreshersResolver(CacheRefresherCollectionBuilder builder) - : base(builder) - { } - - public static CacheRefreshersResolver Current { get; } - = new CacheRefreshersResolver(CoreCurrent.Container.GetInstance()); - - public IEnumerable CacheRefreshers => CoreCurrent.CacheRefreshers; - - public ICacheRefresher GetById(Guid id) => CoreCurrent.CacheRefreshers[id]; - } -} diff --git a/src/Umbraco.Compat7/Core/DatabaseContext.cs b/src/Umbraco.Compat7/Core/DatabaseContext.cs deleted file mode 100644 index 35a5829a56..0000000000 --- a/src/Umbraco.Compat7/Core/DatabaseContext.cs +++ /dev/null @@ -1,65 +0,0 @@ -using System; -using NPoco; -using Umbraco.Core.Persistence; -using Umbraco.Core.Persistence.Querying; -using Umbraco.Core.Persistence.SqlSyntax; - -// ReSharper disable once CheckNamespace -namespace Umbraco.Core -{ - public class DatabaseContext - { - private readonly IUmbracoDatabaseFactory _databaseFactory; - - /// - /// Initializes a new instance of the class. - /// - /// A database factory. - /// The database factory will try to configure itself but may fail eg if the default - /// Umbraco connection string is not available because we are installing. In which case this - /// database builder must sort things out and configure the database factory before it can be - /// used. - public DatabaseContext(IUmbracoDatabaseFactory databaseFactory) - { - _databaseFactory = databaseFactory ?? throw new ArgumentNullException(nameof(databaseFactory)); - } - - /// - /// Gets the database Sql syntax. - /// - public ISqlSyntaxProvider SqlSyntax => _databaseFactory.SqlContext.SqlSyntax; - - /// - /// Creates a Sql statement. - /// - public Sql Sql() => _databaseFactory.SqlContext.Sql(); - - /// - /// Creates a Sql statement. - /// - public Sql Sql(string sql, params object[] args) => _databaseFactory.SqlContext.Sql(sql, args); - - /// - /// Creates a Query expression. - /// - public IQuery Query() => _databaseFactory.SqlContext.Query(); - - /// - /// Gets an ambient database for doing CRUD operations against custom tables that resides in the Umbraco database. - /// - /// Should not be used for operation against standard Umbraco tables; as services should be used instead. - public IUmbracoDatabase Database => throw new NotImplementedException(); // there's no magic? - - /// - /// Gets a value indicating whether the database is configured. - /// - /// It does not necessarily mean that it is possible to - /// connect, nor that Umbraco is installed, nor up-to-date. - public bool IsDatabaseConfigured => _databaseFactory.Configured; - - /// - /// Gets a value indicating whether it is possible to connect to the database. - /// - public bool CanConnect => _databaseFactory.Configured && _databaseFactory.CanConnect; - } -} diff --git a/src/Umbraco.Compat7/Core/Dictionary/CultureDictionaryFactoryResolver.cs b/src/Umbraco.Compat7/Core/Dictionary/CultureDictionaryFactoryResolver.cs deleted file mode 100644 index 10bab2f875..0000000000 --- a/src/Umbraco.Compat7/Core/Dictionary/CultureDictionaryFactoryResolver.cs +++ /dev/null @@ -1,24 +0,0 @@ -using Umbraco.Core.Composing; -using CoreCurrent = Umbraco.Core.Composing.Current; - -// ReSharper disable once CheckNamespace -namespace Umbraco.Core.Dictionary -{ - public class CultureDictionaryFactoryResolver - { - private CultureDictionaryFactoryResolver() - { } - - public static bool HasCurrent => true; - - public static CultureDictionaryFactoryResolver Current { get; } - = new CultureDictionaryFactoryResolver(); - - public ICultureDictionaryFactory Factory => CoreCurrent.CultureDictionaryFactory; - - public void SetDictionaryFactory(ICultureDictionaryFactory factory) - { - CoreCurrent.Container.RegisterSingleton(_ => factory); - } - } -} diff --git a/src/Umbraco.Compat7/Core/IApplicationEventHandler.cs b/src/Umbraco.Compat7/Core/IApplicationEventHandler.cs deleted file mode 100644 index 098e66e1aa..0000000000 --- a/src/Umbraco.Compat7/Core/IApplicationEventHandler.cs +++ /dev/null @@ -1,34 +0,0 @@ -// ReSharper disable once CheckNamespace - -using Umbraco.Core.Composing; - -namespace Umbraco.Core -{ - /// - /// Custom IApplicationStartupHandler that auto subscribes to the applications events - /// - public interface IApplicationEventHandler : IDiscoverable - { - /// - /// ApplicationContext is created and other static objects that require initialization have been setup - /// - /// - /// - void OnApplicationInitialized(UmbracoApplicationBase umbracoApplication, ApplicationContext applicationContext); - - /// - /// All resolvers have been initialized but resolution is not frozen so they can be modified in this method - /// - /// - /// - void OnApplicationStarting(UmbracoApplicationBase umbracoApplication, ApplicationContext applicationContext); - - /// - /// Bootup is completed, this allows you to perform any other bootup logic required for the application. - /// Resolution is frozen so now they can be used to resolve instances. - /// - /// - /// - void OnApplicationStarted(UmbracoApplicationBase umbracoApplication, ApplicationContext applicationContext); - } -} diff --git a/src/Umbraco.Compat7/Core/Logging/LogHelper.cs b/src/Umbraco.Compat7/Core/Logging/LogHelper.cs deleted file mode 100644 index 060c2b9c53..0000000000 --- a/src/Umbraco.Compat7/Core/Logging/LogHelper.cs +++ /dev/null @@ -1,222 +0,0 @@ -using System; -using System.Linq; -using System.Web; -using Umbraco.Core.Composing; -using Umbraco.Core.Exceptions; -using Umbraco.Web; - -// ReSharper disable once CheckNamespace -namespace Umbraco.Core.Logging -{ - public static class LogHelper - { - #region Error - /// - /// Adds an error log - /// - /// - /// - /// - public static void Error(string message, Exception exception) - { - Current.Logger.Error(typeof(T), message, exception); - } - - public static void Error(Type callingType, string message, Exception exception) - { - Current.Logger.Error(callingType, message, exception); - } - - #endregion - - #region Warn - - public static void Warn(Type callingType, string message, params Func[] formatItems) - { - Current.Logger.Warn(callingType, () => string.Format(message, formatItems.Select(x => x.Invoke()).ToArray())); - } - - [Obsolete("Warnings with http trace should not be used. This method will be removed in future versions")] - public static void Warn(Type callingType, string message, bool showHttpTrace, params Func[] formatItems) - { - if (callingType == null) throw new ArgumentNullException(nameof(callingType)); - if (string.IsNullOrEmpty(message)) throw new ArgumentNullOrEmptyException(nameof(message)); - - if (showHttpTrace && HttpContext.Current != null) - { - HttpContext.Current.Trace.Warn(callingType.Name, string.Format(message, formatItems.Select(x => x.Invoke()).ToArray())); - } - - Current.Logger.Warn(callingType, () => string.Format(message, formatItems.Select(x => x.Invoke()).ToArray())); - } - - [Obsolete("Warnings with http trace should not be used. This method will be removed in future versions")] - public static void WarnWithException(Type callingType, string message, Exception e, params Func[] formatItems) - { - WarnWithException(callingType, message, false, e, formatItems); - } - - [Obsolete("Warnings with http trace should not be used. This method will be removed in future versions")] - public static void WarnWithException(Type callingType, string message, bool showHttpTrace, Exception e, params Func[] formatItems) - { - if (e == null) throw new ArgumentNullException(nameof(e)); - if (callingType == null) throw new ArgumentNullException(nameof(callingType)); - if (string.IsNullOrEmpty(message)) throw new ArgumentNullOrEmptyException(nameof(message)); - - if (showHttpTrace && HttpContext.Current != null) - { - HttpContext.Current.Trace.Warn( - callingType.Name, - string.Format(message, formatItems.Select(x => x.Invoke()).ToArray()), - e); - } - - Current.Logger.Warn(callingType, e, string.Format(message, formatItems.Select(x => x.Invoke()).ToArray())); - } - - /// - /// Adds a warn log - /// - /// - /// - /// - public static void Warn(string message, params Func[] formatItems) - { - Warn(typeof(T), message, formatItems); - } - - [Obsolete("Warnings with http trace should not be used. This method will be removed in future versions")] - public static void Warn(string message, bool showHttpTrace, params Func[] formatItems) - { - Warn(typeof(T), message, showHttpTrace, formatItems); - } - - [Obsolete("Warnings with http trace should not be used. This method will be removed in future versions")] - public static void WarnWithException(string message, Exception e, params Func[] formatItems) - { - WarnWithException(typeof(T), message, e, formatItems); - } - - [Obsolete("Warnings with http trace should not be used. This method will be removed in future versions")] - public static void WarnWithException(string message, bool showHttpTrace, Exception e, params Func[] formatItems) - { - WarnWithException(typeof(T), message, showHttpTrace, e, formatItems); - } - - #endregion - - #region Info - /// - /// Traces a message, only generating the message if tracing is actually enabled. Use this method to avoid calling any long-running methods such as "ToDebugString" if logging is disabled. - /// - /// - /// The delegate to generate a message. - /// - public static void Info(Func generateMessage) - { - Info(typeof(T), generateMessage); - } - - /// - /// Traces if tracing is enabled. - /// - /// - /// - public static void Info(Type callingType, Func generateMessage) - { - Current.Logger.Info(callingType, generateMessage); - } - - /// - /// Traces if tracing is enabled. - /// - /// The type for the logging namespace. - /// The message format. - /// The format items. - public static void Info(Type type, string generateMessageFormat, params Func[] formatItems) - { - Current.Logger.Info(type, string.Format(generateMessageFormat, formatItems.Select(x => x.Invoke()).ToArray())); - } - - /// - /// Traces a message, only generating the message if tracing is actually enabled. Use this method to avoid calling any long-running methods such as "ToDebugString" if logging is disabled. - /// - /// - /// The generate message format. - /// The format items. - /// - public static void Info(string generateMessageFormat, params Func[] formatItems) - { - Info(typeof(T), generateMessageFormat, formatItems); - } - #endregion - - #region Debug - /// - /// Debugs a message, only generating the message if tracing is actually enabled. Use this method to avoid calling any long-running methods such as "ToDebugString" if logging is disabled. - /// - /// - /// The delegate to generate a message. - /// - public static void Debug(Func generateMessage) - { - Debug(typeof(T), generateMessage); - } - - /// - /// Debugs if tracing is enabled. - /// - /// - /// - public static void Debug(Type callingType, Func generateMessage) - { - Current.Logger.Debug(callingType, generateMessage); - } - - /// - /// Debugs if tracing is enabled. - /// - /// The type for the logging namespace. - /// The message format. - /// The format items. - public static void Debug(Type type, string generateMessageFormat, params Func[] formatItems) - { - Current.Logger.Debug(type, string.Format(generateMessageFormat, formatItems.Select(x => x.Invoke()).ToArray())); - } - - /// - /// Debugs a message, only generating the message if debug is actually enabled. Use this method to avoid calling any long-running methods such as "ToDebugString" if logging is disabled. - /// - /// - /// The generate message format. - /// The format items. - /// - public static void Debug(string generateMessageFormat, params Func[] formatItems) - { - Debug(typeof(T), generateMessageFormat, formatItems); - } - - /// - /// Debugs a message and also writes to the TraceContext specified, useful for when you would like the debug - /// output also displayed in the Http trace output. - /// - /// - /// - /// - /// - [Obsolete("Warnings with http trace should not be used. This method will be removed in future versions")] - public static void Debug(string generateMessageFormat, bool showHttpTrace, params Func[] formatItems) - { - if (showHttpTrace && HttpContext.Current != null) - { - HttpContext.Current.Trace.Write( - typeof(T).Name, - string.Format(generateMessageFormat, formatItems.Select(x => x()).ToArray())); - } - Debug(typeof(T), generateMessageFormat, formatItems); - } - - #endregion - - } -} diff --git a/src/Umbraco.Compat7/Core/Logging/LoggerResolver.cs b/src/Umbraco.Compat7/Core/Logging/LoggerResolver.cs deleted file mode 100644 index c98ae29962..0000000000 --- a/src/Umbraco.Compat7/Core/Logging/LoggerResolver.cs +++ /dev/null @@ -1,25 +0,0 @@ -using System; -using CoreCurrent = Umbraco.Core.Composing.Current; - -// ReSharper disable once CheckNamespace -namespace Umbraco.Core.Logging -{ - public class LoggerResolver - { - private LoggerResolver() - { } - - public static bool HasCurrent => true; - - public static LoggerResolver Current { get; } - = new LoggerResolver(); - - public ILogger Logger => CoreCurrent.Logger; - - public void SetLogger(ILogger logger) - { - throw new NotSupportedException("The logger is determined by the UmbracoApplicationBase and cannot be modified afterwards." - + " To use a different logger, override the UmbracoApplicationBase (global.asax) class."); - } - } -} diff --git a/src/Umbraco.Compat7/Core/Logging/ProfilerResolver.cs b/src/Umbraco.Compat7/Core/Logging/ProfilerResolver.cs deleted file mode 100644 index 08263be451..0000000000 --- a/src/Umbraco.Compat7/Core/Logging/ProfilerResolver.cs +++ /dev/null @@ -1,25 +0,0 @@ -using System; -using CoreCurrent = Umbraco.Core.Composing.Current; - -// ReSharper disable once CheckNamespace -namespace Umbraco.Core.Logging -{ - public class ProfilerResolver - { - private ProfilerResolver() - { } - - public static bool HasCurrent => true; - - public static ProfilerResolver Current { get; } - = new ProfilerResolver(); - - public IProfiler Profiler => CoreCurrent.Profiler; - - public void SetProfiler(IProfiler profiler) - { - throw new NotSupportedException("The profiler is configured during the IRuntime Compose() method. Implement a" - + " custom IRuntime if you need to specify your own custom profiler."); - } - } -} diff --git a/src/Umbraco.Compat7/Core/Models/PublishedContent/PublishedContentModelFactoryResolver.cs b/src/Umbraco.Compat7/Core/Models/PublishedContent/PublishedContentModelFactoryResolver.cs deleted file mode 100644 index 1f4ab8acf9..0000000000 --- a/src/Umbraco.Compat7/Core/Models/PublishedContent/PublishedContentModelFactoryResolver.cs +++ /dev/null @@ -1,23 +0,0 @@ -using Umbraco.Core.Composing; -using CoreCurrent = Umbraco.Core.Composing.Current; - -// ReSharper disable once CheckNamespace -namespace Umbraco.Core.Models.PublishedContent -{ - public class PublishedContentModelFactoryResolver - { - private PublishedContentModelFactoryResolver() - { } - - public static PublishedContentModelFactoryResolver Current { get; } = new PublishedContentModelFactoryResolver(); - - public static bool HasCurrent => true; - - public void SetFactory(IPublishedModelFactory factory) - { - CoreCurrent.Container.RegisterSingleton(_ => factory); - } - - public IPublishedModelFactory Factory => CoreCurrent.PublishedModelFactory; - } -} diff --git a/src/Umbraco.Compat7/Core/ObjectResolution/LazyManyObjectsResolverBase.cs b/src/Umbraco.Compat7/Core/ObjectResolution/LazyManyObjectsResolverBase.cs deleted file mode 100644 index d9b0dbc4d4..0000000000 --- a/src/Umbraco.Compat7/Core/ObjectResolution/LazyManyObjectsResolverBase.cs +++ /dev/null @@ -1,57 +0,0 @@ -using System; -using System.Collections.Generic; -using Umbraco.Core.Composing; - -// ReSharper disable once CheckNamespace -namespace Umbraco.Core.ObjectResolution -{ - public abstract class LazyManyObjectsResolverBase - where TBuilder : LazyCollectionBuilderBase - where TCollection : IBuilderCollection - { - protected LazyManyObjectsResolverBase(TBuilder builder) - { - Builder = builder; - } - - protected TBuilder Builder { get; } - - public static bool HasCurrent => true; - - /// - /// Removes types from the list of types, once it has been lazily evaluated, and before actual objects are instanciated. - /// - /// The type to remove. - public void RemoveType(Type value) - { - Builder.Exclude(value); - } - - /// - /// Lazily adds types from a function producing types. - /// - /// The functions producing types, to add. - public void AddTypeListDelegate(Func> typeListProducer) - { - Builder.Add(typeListProducer); - } - - /// - /// Lazily adds a type from an actual type. - /// - /// The actual type, to add. - /// The type is converted to a lazy type. - public void AddType(Type value) - { - Builder.Add(value); - } - - /// - /// Clears all lazy types - /// - public void Clear() - { - Builder.Clear(); - } - } -} diff --git a/src/Umbraco.Compat7/Core/ObjectResolution/ManyObjectsResolverBase.cs b/src/Umbraco.Compat7/Core/ObjectResolution/ManyObjectsResolverBase.cs deleted file mode 100644 index 3b45998fee..0000000000 --- a/src/Umbraco.Compat7/Core/ObjectResolution/ManyObjectsResolverBase.cs +++ /dev/null @@ -1,103 +0,0 @@ -using System; -using System.Collections.Generic; -using Umbraco.Core.Composing; - -// ReSharper disable once CheckNamespace -namespace Umbraco.Core.ObjectResolution -{ - public abstract class ManyObjectsResolverBase - where TBuilder : OrderedCollectionBuilderBase - where TCollection : IBuilderCollection - { - private readonly TBuilder _builder; - - protected ManyObjectsResolverBase(TBuilder builder) - { - _builder = builder; - } - - public static bool HasCurrent => true; - - public void RemoveType(Type value) - { - _builder.Remove(value); - } - - public void RemoveType() - where T : TItem - { - _builder.Remove(); - } - - protected void AddTypes(IEnumerable types) - { - _builder.Append(types); - } - - public void AddType(Type value) - { - _builder.Append(value); - } - - public void AddType() - where T : TItem - { - _builder.Append(); - } - - public void Clear() - { - _builder.Clear(); - } - - public void InsertType(int index, Type value) - { - _builder.Insert(index, value); - } - - public void InsertType(Type value) - { - _builder.Insert(value); - } - - public void InsertType(int index) - where T : TItem - { - _builder.Insert(index); - } - - public void InsertType() - where T : TItem - { - _builder.Insert(); - } - - public void InsertTypeBefore(Type existingType, Type value) - { - _builder.InsertBefore(existingType, value); - } - - public void InsertTypeBefore() - where TExisting : TItem - where T : TItem - { - _builder.InsertBefore(); - } - - public bool ContainsType(Type value) - { - return _builder.Has(value); - } - - public IEnumerable GetTypes() - { - return _builder.GetTypes(); - } - - public bool ContainsType() - where T : TItem - { - return _builder.Has(); - } - } -} diff --git a/src/Umbraco.Compat7/Core/ObjectResolution/WeightedObjectsResolverBase.cs b/src/Umbraco.Compat7/Core/ObjectResolution/WeightedObjectsResolverBase.cs deleted file mode 100644 index d665cd6be5..0000000000 --- a/src/Umbraco.Compat7/Core/ObjectResolution/WeightedObjectsResolverBase.cs +++ /dev/null @@ -1,103 +0,0 @@ -using System; -using System.Collections.Generic; -using Umbraco.Core.Composing; - -// ReSharper disable once CheckNamespace -namespace Umbraco.Core.ObjectResolution -{ - public class WeightedObjectsResolverBase - where TBuilder : WeightedCollectionBuilderBase - where TCollection : IBuilderCollection - { - private readonly TBuilder _builder; - - protected WeightedObjectsResolverBase(TBuilder builder) - { - _builder = builder; - } - - public static bool HasCurrent => true; - - public void RemoveType(Type value) - { - _builder.Remove(value); - } - - public void RemoveType() - where T : TItem - { - _builder.Remove(); - } - - protected void AddTypes(IEnumerable types) - { - _builder.Add(types); - } - - public void AddType(Type value) - { - _builder.Add(value); - } - - public void AddType() - where T : TItem - { - _builder.Add(); - } - - public void Clear() - { - _builder.Clear(); - } - - public void InsertType(int index, Type value) - { - _builder.Add(value); - } - - public void InsertType(Type value) - { - _builder.Add(value); - } - - public void InsertType(int index) - where T : TItem - { - _builder.Add(); - } - - public void InsertType() - where T : TItem - { - _builder.Add(); - } - - public void InsertTypeBefore(Type existingType, Type value) - { - _builder.Add(value); - } - - public void InsertTypeBefore() - where TExisting : TItem - where T : TItem - { - _builder.Add(); - } - - public bool ContainsType(Type value) - { - return _builder.Has(value); - } - - public IEnumerable GetTypes() - { - return _builder.GetTypes(); - } - - public bool ContainsType() - where T : TItem - { - return _builder.Has(); - } - } -} diff --git a/src/Umbraco.Compat7/Core/PropertyEditors/PropertyEditorResolver.cs b/src/Umbraco.Compat7/Core/PropertyEditors/PropertyEditorResolver.cs deleted file mode 100644 index 8b063afcce..0000000000 --- a/src/Umbraco.Compat7/Core/PropertyEditors/PropertyEditorResolver.cs +++ /dev/null @@ -1,22 +0,0 @@ -using System.Collections.Generic; -using Umbraco.Core.ObjectResolution; -using CoreCurrent = Umbraco.Core.Composing.Current; -using LightInject; - -// ReSharper disable once CheckNamespace -namespace Umbraco.Core.PropertyEditors -{ - public class PropertyEditorResolver : LazyManyObjectsResolverBase - { - private PropertyEditorResolver(DataEditorCollectionBuilder builder) - : base(builder) - { } - - public static PropertyEditorResolver Current { get; } - = new PropertyEditorResolver(CoreCurrent.Container.GetInstance()); - - public IEnumerable PropertyEditors => CoreCurrent.PropertyEditors; - - public IDataEditor GetByAlias(string alias) => CoreCurrent.PropertyEditors[alias]; - } -} diff --git a/src/Umbraco.Compat7/Core/PropertyEditors/PropertyValueConvertersResolver.cs b/src/Umbraco.Compat7/Core/PropertyEditors/PropertyValueConvertersResolver.cs deleted file mode 100644 index 1e31de05ac..0000000000 --- a/src/Umbraco.Compat7/Core/PropertyEditors/PropertyValueConvertersResolver.cs +++ /dev/null @@ -1,20 +0,0 @@ -using System.Collections.Generic; -using Umbraco.Core.ObjectResolution; -using CoreCurrent = Umbraco.Core.Composing.Current; -using LightInject; - -// ReSharper disable once CheckNamespace -namespace Umbraco.Core.PropertyEditors -{ - public class PropertyValueConvertersResolver : ManyObjectsResolverBase - { - private PropertyValueConvertersResolver(PropertyValueConverterCollectionBuilder builder) - : base(builder) - { } - - public static PropertyValueConvertersResolver Current { get; } - = new PropertyValueConvertersResolver(CoreCurrent.Container.GetInstance()); - - public IEnumerable Converters => CoreCurrent.PropertyValueConverters; - } -} diff --git a/src/Umbraco.Compat7/Core/Strings/ShortStringHelperResolver.cs b/src/Umbraco.Compat7/Core/Strings/ShortStringHelperResolver.cs deleted file mode 100644 index f4929154fa..0000000000 --- a/src/Umbraco.Compat7/Core/Strings/ShortStringHelperResolver.cs +++ /dev/null @@ -1,24 +0,0 @@ -using Umbraco.Core.Composing; -using CoreCurrent = Umbraco.Core.Composing.Current; - -// ReSharper disable once CheckNamespace -namespace Umbraco.Core.Strings -{ - public class ShortStringHelperResolver - { - private ShortStringHelperResolver() - { } - - public static bool HasCurrent => true; - - public static ShortStringHelperResolver Current { get; } - = new ShortStringHelperResolver(); - - public IShortStringHelper Helper => CoreCurrent.ShortStringHelper; - - public void SetHelper(IShortStringHelper helper) - { - CoreCurrent.Container.RegisterSingleton(_ => helper); - } - } -} diff --git a/src/Umbraco.Compat7/Core/Strings/UrlSegmentProviderResolver.cs b/src/Umbraco.Compat7/Core/Strings/UrlSegmentProviderResolver.cs deleted file mode 100644 index 2677ddb618..0000000000 --- a/src/Umbraco.Compat7/Core/Strings/UrlSegmentProviderResolver.cs +++ /dev/null @@ -1,20 +0,0 @@ -using System.Collections.Generic; -using Umbraco.Core.ObjectResolution; -using CoreCurrent = Umbraco.Core.Composing.Current; -using LightInject; - -// ReSharper disable once CheckNamespace -namespace Umbraco.Core.Strings -{ - public class UrlSegmentProviderResolver : ManyObjectsResolverBase - { - private UrlSegmentProviderResolver(UrlSegmentProviderCollectionBuilder builder) - : base(builder) - { } - - public static UrlSegmentProviderResolver Current { get; } - = new UrlSegmentProviderResolver(CoreCurrent.Container.GetInstance()); - - public IEnumerable Providers => CoreCurrent.UrlSegmentProviders; - } -} diff --git a/src/Umbraco.Compat7/Core/Sync/ServerMessengerResolver.cs b/src/Umbraco.Compat7/Core/Sync/ServerMessengerResolver.cs deleted file mode 100644 index b4316335e3..0000000000 --- a/src/Umbraco.Compat7/Core/Sync/ServerMessengerResolver.cs +++ /dev/null @@ -1,24 +0,0 @@ -using Umbraco.Core.Composing; -using CoreCurrent = Umbraco.Core.Composing.Current; - -// ReSharper disable once CheckNamespace -namespace Umbraco.Core.Sync -{ - public class ServerMessengerResolver - { - private ServerMessengerResolver() - { } - - public static bool HasCurrent => true; - - public static ServerMessengerResolver Current { get; } - = new ServerMessengerResolver(); - - public IServerMessenger Messenger => CoreCurrent.ServerMessenger; - - public void SetServerMessenger(IServerMessenger messenger) - { - CoreCurrent.Container.RegisterSingleton(_ => messenger); - } - } -} diff --git a/src/Umbraco.Compat7/Core/Sync/ServerRegistrarResolver.cs b/src/Umbraco.Compat7/Core/Sync/ServerRegistrarResolver.cs deleted file mode 100644 index 156d1c2968..0000000000 --- a/src/Umbraco.Compat7/Core/Sync/ServerRegistrarResolver.cs +++ /dev/null @@ -1,24 +0,0 @@ -using Umbraco.Core.Composing; -using CoreCurrent = Umbraco.Core.Composing.Current; - -// ReSharper disable once CheckNamespace -namespace Umbraco.Core.Sync -{ - public class ServerRegistrarResolver - { - private ServerRegistrarResolver() - { } - - public static bool HasCurrent => true; - - public static ServerRegistrarResolver Current { get; } - = new ServerRegistrarResolver(); - - public IServerRegistrar Registrar => CoreCurrent.ServerRegistrar; - - public void SetServerRegistrar(IServerRegistrar registrar) - { - CoreCurrent.Container.RegisterSingleton(_ => registrar); - } - } -} diff --git a/src/Umbraco.Compat7/Properties/AssemblyInfo.cs b/src/Umbraco.Compat7/Properties/AssemblyInfo.cs deleted file mode 100644 index 412c975d0b..0000000000 --- a/src/Umbraco.Compat7/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,10 +0,0 @@ -using System.Reflection; -using System.Runtime.InteropServices; - -[assembly: AssemblyTitle("Umbraco.Compat7")] -[assembly: AssemblyDescription("Umbraco v7 compatibility layer for v8.")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyProduct("Umbraco CMS")] - -[assembly: ComVisible(false)] -[assembly: Guid("185e098f-5706-4b97-b404-eb974f05f633")] diff --git a/src/Umbraco.Compat7/Umbraco.Compat7.csproj b/src/Umbraco.Compat7/Umbraco.Compat7.csproj deleted file mode 100644 index bd22959264..0000000000 --- a/src/Umbraco.Compat7/Umbraco.Compat7.csproj +++ /dev/null @@ -1,110 +0,0 @@ - - - - - v4.7 - false - {185E098F-5706-4B97-B404-EB974F05F633} - Library - Umbraco.Compat7 - Umbraco.Compat7 - ..\ - - - - true - full - false - bin\Debug\ - TRACE;DEBUG - prompt - 4 - latest - - - pdbonly - true - bin\Release\ - TRACE;COMPAT7 - prompt - 4 - bin\Release\Umbraco.Compat7.xml - latest - - - - - - - - - - - - - - - - - - - Umbraco.Core - - - {651e1350-91b6-44b7-bd60-7207006d7003} - Umbraco.Web - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Properties\SolutionInfo.cs - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/Umbraco.Compat7/Web/HealthCheck/HealthCheckResolver.cs b/src/Umbraco.Compat7/Web/HealthCheck/HealthCheckResolver.cs deleted file mode 100644 index ea5334239a..0000000000 --- a/src/Umbraco.Compat7/Web/HealthCheck/HealthCheckResolver.cs +++ /dev/null @@ -1,20 +0,0 @@ -using System.Collections.Generic; -using Umbraco.Core.ObjectResolution; -using CoreCurrent = Umbraco.Core.Composing.Current; -using LightInject; - -// ReSharper disable once CheckNamespace -namespace Umbraco.Web.HealthCheck -{ - public class HealthCheckResolver : LazyManyObjectsResolverBase - { - private HealthCheckResolver(HealthCheckCollectionBuilder builder) - : base(builder) - { } - - public static HealthCheckResolver Current { get; } - = new HealthCheckResolver(CoreCurrent.Container.GetInstance()); - - public IEnumerable HealthChecks => Builder.CreateCollection(); // transient - } -} diff --git a/src/Umbraco.Compat7/Web/Media/ThumbnailProvidersResolver.cs b/src/Umbraco.Compat7/Web/Media/ThumbnailProvidersResolver.cs deleted file mode 100644 index 9b76be23e9..0000000000 --- a/src/Umbraco.Compat7/Web/Media/ThumbnailProvidersResolver.cs +++ /dev/null @@ -1,24 +0,0 @@ -using System.Collections.Generic; -using Umbraco.Core.Media; -using Umbraco.Core.ObjectResolution; -using Umbraco.Web.Media.ThumbnailProviders; -using WebCurrent = Umbraco.Web.Composing.Current; -using LightInject; - -// ReSharper disable once CheckNamespace -namespace Umbraco.Web.Media -{ - public class ThumbnailProvidersResolver : WeightedObjectsResolverBase - { - private ThumbnailProvidersResolver(ThumbnailProviderCollectionBuilder builder) - : base(builder) - { } - - public static ThumbnailProvidersResolver Current { get; } - = new ThumbnailProvidersResolver(WebCurrent.Container.GetInstance()); - - public IEnumerable Providers => WebCurrent.ThumbnailProviders; - - public string GetThumbnailUrl(string fileUrl) => WebCurrent.ThumbnailProviders.GetThumbnailUrl(fileUrl); - } -} diff --git a/src/Umbraco.Compat7/Web/Models/IRenderModel.cs b/src/Umbraco.Compat7/Web/Models/IRenderModel.cs deleted file mode 100644 index 699a37fcd8..0000000000 --- a/src/Umbraco.Compat7/Web/Models/IRenderModel.cs +++ /dev/null @@ -1,10 +0,0 @@ -using Umbraco.Core.Models.PublishedContent; - -// ReSharper disable once CheckNamespace -namespace Umbraco.Web.Models -{ - public interface IRenderModel - { - IPublishedContent Content { get; } - } -} diff --git a/src/Umbraco.Compat7/Web/Models/RenderModel.cs b/src/Umbraco.Compat7/Web/Models/RenderModel.cs deleted file mode 100644 index c843d48388..0000000000 --- a/src/Umbraco.Compat7/Web/Models/RenderModel.cs +++ /dev/null @@ -1,39 +0,0 @@ -using System; -using System.Globalization; -using Umbraco.Core.Models.PublishedContent; - -// ReSharper disable once CheckNamespace -namespace Umbraco.Web.Models -{ - public class RenderModel : IRenderModel - { - public RenderModel(IPublishedContent content, CultureInfo culture) - { - if (content == null) throw new ArgumentNullException(nameof(content)); - if (culture == null) throw new ArgumentNullException(nameof(culture)); - Content = content; - CurrentCulture = culture; - } - - public RenderModel(IPublishedContent content) - { - if (content == null) throw new ArgumentNullException(nameof(content)); - if (UmbracoContext.Current == null) - { - throw new InvalidOperationException("Cannot construct a RenderModel without specifying a CultureInfo when no UmbracoContext has been initialized"); - } - Content = content; - CurrentCulture = UmbracoContext.Current.PublishedRequest.Culture; - } - - /// - /// Returns the current IPublishedContent object - /// - public IPublishedContent Content { get; private set; } - - /// - /// Returns the current Culture assigned to the page being rendered - /// - public CultureInfo CurrentCulture { get; private set; } - } -} diff --git a/src/Umbraco.Compat7/Web/Models/RenderModelOfTContent.cs b/src/Umbraco.Compat7/Web/Models/RenderModelOfTContent.cs deleted file mode 100644 index bb23ac6792..0000000000 --- a/src/Umbraco.Compat7/Web/Models/RenderModelOfTContent.cs +++ /dev/null @@ -1,24 +0,0 @@ -using System.Globalization; -using Umbraco.Core.Models.PublishedContent; - -// ReSharper disable once CheckNamespace -namespace Umbraco.Web.Models -{ - public class RenderModel : RenderModel - where TContent : IPublishedContent - { - public RenderModel(TContent content, CultureInfo culture) - : base(content, culture) - { - Content = content; - } - - public RenderModel(TContent content) - : base(content) - { - Content = content; - } - - public new TContent Content { get; private set; } - } -} diff --git a/src/Umbraco.Compat7/Web/Mvc/DefaultRenderMvcControllerResolver.cs b/src/Umbraco.Compat7/Web/Mvc/DefaultRenderMvcControllerResolver.cs deleted file mode 100644 index 28e4eacadb..0000000000 --- a/src/Umbraco.Compat7/Web/Mvc/DefaultRenderMvcControllerResolver.cs +++ /dev/null @@ -1,24 +0,0 @@ -using System; -using WebCurrent = Umbraco.Web.Composing.Current; - -// ReSharper disable once CheckNamespace -namespace Umbraco.Web.Mvc -{ - public class DefaultRenderMvcControllerResolver - { - private DefaultRenderMvcControllerResolver() - { } - - public static bool HasCurrent => true; - - public static DefaultRenderMvcControllerResolver Current { get; } - = new DefaultRenderMvcControllerResolver(); - - public Type GetDefaultControllerType() => WebCurrent.DefaultRenderMvcControllerType; - - public void SetDefaultControllerType(Type type) - { - WebCurrent.DefaultRenderMvcControllerType = type; - } - } -} diff --git a/src/Umbraco.Compat7/Web/Mvc/FilteredControllerFactoriesResolver.cs b/src/Umbraco.Compat7/Web/Mvc/FilteredControllerFactoriesResolver.cs deleted file mode 100644 index ceec453c3d..0000000000 --- a/src/Umbraco.Compat7/Web/Mvc/FilteredControllerFactoriesResolver.cs +++ /dev/null @@ -1,21 +0,0 @@ -using System.Collections.Generic; -using Umbraco.Core.ObjectResolution; -using CoreCurrent = Umbraco.Core.Composing.Current; -using WebCurrent = Umbraco.Web.Composing.Current; -using LightInject; - -// ReSharper disable once CheckNamespace -namespace Umbraco.Web.Mvc -{ - public class FilteredControllerFactoriesResolver : ManyObjectsResolverBase - { - public FilteredControllerFactoriesResolver(FilteredControllerFactoryCollectionBuilder builder) - : base(builder) - { } - - public static FilteredControllerFactoriesResolver Current { get; } - = new FilteredControllerFactoriesResolver(CoreCurrent.Container.GetInstance()); - - public IEnumerable Factories => WebCurrent.FilteredControllerFactories; - } -} diff --git a/src/Umbraco.Compat7/Web/Mvc/UmbracoTemplatePage.cs b/src/Umbraco.Compat7/Web/Mvc/UmbracoTemplatePage.cs deleted file mode 100644 index 70124ab3c9..0000000000 --- a/src/Umbraco.Compat7/Web/Mvc/UmbracoTemplatePage.cs +++ /dev/null @@ -1,29 +0,0 @@ -using Umbraco.Web.Models; -//using Umbraco.Core.Dynamics; - -// ReSharper disable once CheckNamespace -namespace Umbraco.Web.Mvc -{ - /// - /// The View that front-end templates inherit from - /// - public abstract class UmbracoTemplatePage : UmbracoViewPage - { - private object _currentPage; - - /// - /// Returns the content as a dynamic object - /// - public dynamic CurrentPage - { - get - { - // it's invalid to create a DynamicPublishedContent around a null content anyway - // fixme - should we return null or DynamicNull.Null? - if (Model == null || Model.Content == null) return null; - //return _currentPage ?? (_currentPage = Model.Content.AsDynamic()); - return _currentPage ?? (_currentPage = Model.Content); - } - } - } -} diff --git a/src/Umbraco.Compat7/Web/Mvc/UmbracoTemplatePageOfTContent.cs b/src/Umbraco.Compat7/Web/Mvc/UmbracoTemplatePageOfTContent.cs deleted file mode 100644 index e73685b134..0000000000 --- a/src/Umbraco.Compat7/Web/Mvc/UmbracoTemplatePageOfTContent.cs +++ /dev/null @@ -1,28 +0,0 @@ -using Umbraco.Core.Models.PublishedContent; -using Umbraco.Web.Models; -//using Umbraco.Core.Dynamics; - -// ReSharper disable once CheckNamespace -namespace Umbraco.Web.Mvc -{ - public abstract class UmbracoTemplatePage : UmbracoViewPage> - where TContent : IPublishedContent - { - private object _currentPage; - - /// - /// Returns the content as a dynamic object - /// - public dynamic CurrentPage - { - get - { - // it's invalid to create a DynamicPublishedContent around a null content anyway - // fixme - should we return null or DynamicNull.Null? - if (Model == null || Model.Content == null) return null; - //return _currentPage ?? (_currentPage = Model.Content.AsDynamic()); - return _currentPage ?? (_currentPage = Model.Content); - } - } - } -} diff --git a/src/Umbraco.Compat7/Web/PublishedCache/PublishedSnapshotServiceResolver.cs b/src/Umbraco.Compat7/Web/PublishedCache/PublishedSnapshotServiceResolver.cs deleted file mode 100644 index 13bbfd72b9..0000000000 --- a/src/Umbraco.Compat7/Web/PublishedCache/PublishedSnapshotServiceResolver.cs +++ /dev/null @@ -1,15 +0,0 @@ -using WebCurrent = Umbraco.Web.Composing.Current; - -// ReSharper disable once CheckNamespace -namespace Umbraco.Web.PublishedCache -{ - public class PublishedSnapshotServiceResolver - { - private PublishedSnapshotServiceResolver() - { } - - public static PublishedSnapshotServiceResolver Current { get; } = new PublishedSnapshotServiceResolver(); - - public IPublishedSnapshotService Service => WebCurrent.PublishedSnapshotService; - } -} diff --git a/src/Umbraco.Compat7/Web/Routing/ContentFinderResolver.cs b/src/Umbraco.Compat7/Web/Routing/ContentFinderResolver.cs deleted file mode 100644 index 620dcfac8d..0000000000 --- a/src/Umbraco.Compat7/Web/Routing/ContentFinderResolver.cs +++ /dev/null @@ -1,21 +0,0 @@ -using System.Collections.Generic; -using Umbraco.Core.ObjectResolution; -using CoreCurrent = Umbraco.Core.Composing.Current; -using WebCurrent = Umbraco.Web.Composing.Current; -using LightInject; - -// ReSharper disable once CheckNamespace -namespace Umbraco.Web.Routing -{ - public class ContentFinderResolver : ManyObjectsResolverBase - { - private ContentFinderResolver(ContentFinderCollectionBuilder builder) - : base(builder) - { } - - public static ContentFinderResolver Current { get; } - = new ContentFinderResolver(CoreCurrent.Container.GetInstance()); - - public IEnumerable Finders => WebCurrent.ContentFinders; - } -} diff --git a/src/Umbraco.Compat7/Web/Routing/ContentLastChangeFinderResolver.cs b/src/Umbraco.Compat7/Web/Routing/ContentLastChangeFinderResolver.cs deleted file mode 100644 index bb46f79bf4..0000000000 --- a/src/Umbraco.Compat7/Web/Routing/ContentLastChangeFinderResolver.cs +++ /dev/null @@ -1,40 +0,0 @@ -using System; -using Umbraco.Core.Composing; -using CoreCurrent = Umbraco.Core.Composing.Current; -using WebCurrent = Umbraco.Web.Composing.Current; - -// ReSharper disable once CheckNamespace -namespace Umbraco.Web.Routing -{ - public class ContentLastChangeFinderResolver - { - private ContentLastChangeFinderResolver() - { } - - public static ContentLastChangeFinderResolver Current { get; } = new ContentLastChangeFinderResolver(); - - public IContentFinder Finder => WebCurrent.LastChanceContentFinder; - - public void SetFinder(IContentFinder finder) - { - if (finder == null) throw new ArgumentNullException(nameof(finder)); - var lastChance = finder as IContentLastChanceFinder ?? new FinderWrapper(finder); - CoreCurrent.Container.RegisterSingleton(_ => lastChance); - } - - private class FinderWrapper : IContentLastChanceFinder - { - private readonly IContentFinder _inner; - - public FinderWrapper(IContentFinder inner) - { - _inner = inner; - } - - public bool TryFindContent(PublishedRequest frequest) - { - return _inner.TryFindContent(frequest); - } - } - } -} diff --git a/src/Umbraco.Compat7/Web/Routing/SiteDomainHelperResolver.cs b/src/Umbraco.Compat7/Web/Routing/SiteDomainHelperResolver.cs deleted file mode 100644 index ee3bb77f68..0000000000 --- a/src/Umbraco.Compat7/Web/Routing/SiteDomainHelperResolver.cs +++ /dev/null @@ -1,25 +0,0 @@ -using Umbraco.Core.Composing; -using CoreCurrent = Umbraco.Core.Composing.Current; -using WebCurrent = Umbraco.Web.Composing.Current; - -// ReSharper disable once CheckNamespace -namespace Umbraco.Web.Routing -{ - public class SiteDomainHelperResolver - { - private SiteDomainHelperResolver() - { } - - public static bool HasCurrent => true; - - public static SiteDomainHelperResolver Current { get; } - = new SiteDomainHelperResolver(); - - public ISiteDomainHelper Helper => WebCurrent.SiteDomainHelper; - - public void SetHelper(ISiteDomainHelper helper) - { - CoreCurrent.Container.RegisterSingleton(_ => helper); - } - } -} diff --git a/src/Umbraco.Compat7/Web/Routing/UrlProviderResolver.cs b/src/Umbraco.Compat7/Web/Routing/UrlProviderResolver.cs deleted file mode 100644 index 0a3a8e2b38..0000000000 --- a/src/Umbraco.Compat7/Web/Routing/UrlProviderResolver.cs +++ /dev/null @@ -1,21 +0,0 @@ -using System.Collections.Generic; -using Umbraco.Core.ObjectResolution; -using CoreCurrent = Umbraco.Core.Composing.Current; -using WebCurrent = Umbraco.Web.Composing.Current; -using LightInject; - -// ReSharper disable once CheckNamespace -namespace Umbraco.Web.Routing -{ - public class UrlProviderResolver : ManyObjectsResolverBase - { - private UrlProviderResolver(UrlProviderCollectionBuilder builder) - : base(builder) - { } - - public static UrlProviderResolver Current { get; } - = new UrlProviderResolver(CoreCurrent.Container.GetInstance()); - - public IEnumerable Providers => WebCurrent.UrlProviders; - } -} diff --git a/src/Umbraco.Compat7/Web/UmbracoHelperExtensions.cs b/src/Umbraco.Compat7/Web/UmbracoHelperExtensions.cs deleted file mode 100644 index 60f7cb5a4a..0000000000 --- a/src/Umbraco.Compat7/Web/UmbracoHelperExtensions.cs +++ /dev/null @@ -1,13 +0,0 @@ -using Umbraco.Core.Models.PublishedContent; - -// ReSharper disable once CheckNamespace -namespace Umbraco.Web -{ - public static class UmbracoHelperExtensions - { - // fixme - missing many more - - public static IPublishedContent TypedMedia(this UmbracoHelper helper, int id) - => helper.Media(id); - } -} diff --git a/src/Umbraco.Compat7/notes.txt b/src/Umbraco.Compat7/notes.txt deleted file mode 100644 index f153361aae..0000000000 --- a/src/Umbraco.Compat7/notes.txt +++ /dev/null @@ -1,41 +0,0 @@ - - -** Umbraco.Compat7 - -The purpose of Umbraco.Compat7 is to help support v7 sites in v8, by providing -an implementation of most of the important interfaces and services that have -been removed in v8. - -This includes: - -- ApplicationContext - compat: full - status: done - -- IApplicationEventHandler - compat: UmbracoApplicationBase ApplicationStarting & ApplicationStarted events - are gone. Use corresponding Compat7Component events instead, should be mostly - the same. - status: to be tested - -- Resolvers - compat: full - status: - base resolvers: done - resolvers: TODO - -- RenderModel, UmbracoTemplatePage - compat: will NOT support dynamics, so CurrentPage will prob not work - status: need to test RendeModel, not sure it works at all - -What else? - -- IPublishedContent GetPropertyValue extension methods -- ? - -** Building - -By default, Umbraco.Compat7 is built but not copied / nothing. -If the conditional symbol 'COMPAT7' is defined, it is copied to Umbraco.Web.UI/bin. -Currently, that symbol is defined for the DEBUG build. -Eventually it should become an extra NuGet package. diff --git a/src/Umbraco.Core/Configuration/UmbracoVersion.cs b/src/Umbraco.Core/Configuration/UmbracoVersion.cs index 9c5c38c916..0e8e473cf0 100644 --- a/src/Umbraco.Core/Configuration/UmbracoVersion.cs +++ b/src/Umbraco.Core/Configuration/UmbracoVersion.cs @@ -22,7 +22,7 @@ namespace Umbraco.Core.Configuration /// /// Gets the version comment of the executing code (eg "beta"). /// - public static string CurrentComment => "alpha.32"; + public static string CurrentComment => "alpha.33"; /// /// Gets the assembly version of Umbraco.Code.dll. diff --git a/src/Umbraco.Core/Umbraco.Core.csproj b/src/Umbraco.Core/Umbraco.Core.csproj index 7086a0ec19..38762b17da 100644 --- a/src/Umbraco.Core/Umbraco.Core.csproj +++ b/src/Umbraco.Core/Umbraco.Core.csproj @@ -69,7 +69,6 @@ - diff --git a/src/Umbraco.Web.UI.Client/src/less/components/card.less b/src/Umbraco.Web.UI.Client/src/less/components/card.less index bceef1767b..60aec5c036 100644 --- a/src/Umbraco.Web.UI.Client/src/less/components/card.less +++ b/src/Umbraco.Web.UI.Client/src/less/components/card.less @@ -185,3 +185,30 @@ border: none !important; background: none !important; } + +.umb-training-videos { + display: grid; + grid-gap: 10px; + grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); +} + +.umb-training-video { + background: @white; + box-shadow: 0 1px 1px 0 rgba(0,0,0,0.16); + border-radius: @baseBorderRadius; + transition: box-shadow 0.1s ease-in-out, border 0.1s ease-in-out; + box-sizing: border-box; + padding: 20px; +} + +.umb-training-video:hover { + box-shadow: 0 3px 6px 0 rgba(0,0,0,0.16); + text-decoration: none; +} + +.umb-training-video__label { + font-weight: bold; + margin-top: 20px; + display: block; + text-align: center; +} diff --git a/src/Umbraco.Web.UI.Client/src/less/healthcheck.less b/src/Umbraco.Web.UI.Client/src/less/healthcheck.less index 9a8c55d08b..7a96c906e3 100644 --- a/src/Umbraco.Web.UI.Client/src/less/healthcheck.less +++ b/src/Umbraco.Web.UI.Client/src/less/healthcheck.less @@ -24,17 +24,18 @@ display: flex; flex-wrap: wrap; flex-direction: column; - background: @gray-10; + background: @white; border-radius: 3px; - padding: 15px 10px; + padding: 20px; box-sizing: border-box; text-align: center; - border: 1px solid @gray-8; + box-shadow: 0 1px 1px 0 rgba(0,0,0,0.16); height: 100%; + box-sizing: border-box; } .umb-healthcheck-group:hover { - border: 1px solid @turquoise; + box-shadow: 0 3px 6px 0 rgba(0,0,0,0.16); cursor: pointer; } @@ -60,7 +61,7 @@ .umb-healthcheck-message { position: relative; - background: @white; + background: @gray-10; border-radius: 50px; display: inline-flex; align-items: center; @@ -125,6 +126,12 @@ margin-bottom: 40px; } +.umb-healthcheck-group__details-group { + background: @white; + box-shadow: 0 1px 1px 0 rgba(0,0,0,0.16); + border-radius: @baseBorderRadius; +} + .umb-healthcheck-group__details-group-title { background-color: @purple-l1; padding: 10px 20px; @@ -141,9 +148,9 @@ } .umb-healthcheck-group__details-checks { - border: 1px solid @gray-8; border-top: none; border-radius: 0 0 3px 3px; + background: @white; } .umb-healthcheck-group__details-check { @@ -152,14 +159,13 @@ .umb-healthcheck-group__details-check-title { padding: 15px 20px; - background-color: @gray-10; } .umb-healthcheck-group__details-check-name { font-size: 15px; color: @black; font-weight: bold; - margin-bottom: 5px; + margin-bottom: 3px; } .umb-healthcheck-group__details-check-description { @@ -171,7 +177,7 @@ .umb-healthcheck-group__details-status { padding: 15px 0; display: flex; - border-bottom: 2px solid @gray-10; + border-top: 2px solid @gray-10; } .umb-healthcheck-group__details-status-overlay { diff --git a/src/Umbraco.Web.UI.Client/src/less/tables.less b/src/Umbraco.Web.UI.Client/src/less/tables.less index abf3af40f6..7317d93d4a 100644 --- a/src/Umbraco.Web.UI.Client/src/less/tables.less +++ b/src/Umbraco.Web.UI.Client/src/less/tables.less @@ -82,6 +82,7 @@ table { border-collapse: separate; // Done so we can round those corners! *border-collapse: collapse; // IE7 can't round corners anyway border-left: 0; + box-shadow: none; .border-radius(@baseBorderRadius); th, td { diff --git a/src/Umbraco.Web.UI.Client/src/views/dashboard/developer/developerdashboardvideos.html b/src/Umbraco.Web.UI.Client/src/views/dashboard/developer/developerdashboardvideos.html index 0ad779cf3e..9c31ece7a0 100644 --- a/src/Umbraco.Web.UI.Client/src/views/dashboard/developer/developerdashboardvideos.html +++ b/src/Umbraco.Web.UI.Client/src/views/dashboard/developer/developerdashboardvideos.html @@ -1,18 +1,15 @@ -

Hours of Umbraco training videos are only a click away

-

Want to master Umbraco? Spend a couple of minutes learning some best practices by watching one of these videos about using Umbraco, then visit umbraco.tv for even more Umbraco videos.

+

Hours of Umbraco training videos are only a click away

+

Want to master Umbraco? Spend a couple of minutes learning some best practices by watching one of these videos about using Umbraco, then visit umbraco.tv for even more Umbraco videos.

-
+ diff --git a/src/Umbraco.Web.UI.Client/src/views/dashboard/developer/examinemanagement.html b/src/Umbraco.Web.UI.Client/src/views/dashboard/developer/examinemanagement.html index 645b783c65..021d2b45d9 100644 --- a/src/Umbraco.Web.UI.Client/src/views/dashboard/developer/examinemanagement.html +++ b/src/Umbraco.Web.UI.Client/src/views/dashboard/developer/examinemanagement.html @@ -9,260 +9,270 @@
-
-
Indexers
-
+
-
-
-
-
Manage Examine's indexes
-
Allows you to view the details of each index and provides some tools for managing the indexes
-
+
+
Indexers
+
-
- -
- +
+
+
+
Manage Examine's indexes
+
Allows you to view the details of each index and provides some tools for managing the indexes
-
-
-
- {{indexer.name}} -
- - {{indexer.name}} - -
- The index cannot be read and will need to be rebuilt -
+
+ +
+
-
-
- +
+
+
+ {{indexer.name}} +
+ + {{indexer.name}} + +
+ The index cannot be read and will need to be rebuilt +
-
-
-
    -
  • - Index info & tools +
    +
    + + +
    +
    -
    -
    -
    +
    +
      +
    • + Index info & tools -
      - -
      - -
      - The process is taking longer than expected, check the umbraco log to see if there have been any errors during this operation +
      +
      +
      + +
      + +
      + +
      + The process is taking longer than expected, check the umbraco log to see if there have been any errors during this operation +
      + + + + + + + + + + +
       
      Documents in index{{indexer.documentCount}}
      Fields in index{{indexer.fieldCount}}
      - - - - - + +
    • + Node types +
    •  
      Documents in index{{indexer.documentCount}}
      + + + + + + + + + + + - - - -
      Include node types{{indexer.indexCriteria.IncludeNodeTypes | json}}
      Exclude node types{{indexer.indexCriteria.ExcludeNodeTypes | json}}
      Parent node id{{indexer.indexCriteria.ParentNodeId}}
      Fields in index{{indexer.fieldCount}}
      -
      -
    • -
    • - Node types - - - - - - - - - - - - - -
      Include node types{{indexer.indexCriteria.IncludeNodeTypes | json}}
      Exclude node types{{indexer.indexCriteria.ExcludeNodeTypes | json}}
      Parent node id{{indexer.indexCriteria.ParentNodeId}}
      -
    • -
    • - System fields - - - - - - - + +
    • + System fields +
    •  
      NameEnable sortingType
      + + + + + + + + + + + + + + + +
       
      NameEnable sortingType
      {{field.Name}}{{field.EnableSorting}}{{field.Type}}
      +
    • +
    • + User fields + + + + + + + + + + + + + + + + +
       
      NameEnable sortingType
      {{field.Name}}{{field.EnableSorting}}{{field.Type}}
      +
    • +
    • + Provider properties + + + + + - - - - - - - - -
       
      {{key}}{{val}}
      {{field.Name}}{{field.EnableSorting}}{{field.Type}}
      -
    • -
    • - User fields - - - - - - - - - - - - - - - - -
       
      NameEnable sortingType
      {{field.Name}}{{field.EnableSorting}}{{field.Type}}
      -
    • -
    • - Provider properties - - - - - - -
       
      {{key}}{{val}}
      -
    • -
    + +
  • +
+
-
-
-
- +
+
+ +
+

-
-
Searchers
-
+
-
-
-
-
Search indexes
-
Allows you to search the indexes and view the searcher properties
-
+
+
Searchers
+
-
- -
- +
+
+
+
Search indexes
+
Allows you to search the indexes and view the searcher properties
- -
-
- - {{searcher.name}} - + +
+ +
+
-
-
    -
  • +
    + + +
    +
      +
    • - Search tools + Search tools -
      - Hide search results +
      + Hide search results -
      +
      -
      + -
    • -
    • - Provider properties - - - - - - -
       
      {{key}}{{val}}
      -
    • -
    +
  • +
  • + Provider properties + + + + + + +
     
    {{key}}{{val}}
    +
  • +
+
+
diff --git a/src/Umbraco.Web.UI.Client/src/views/dashboard/developer/healthcheck.html b/src/Umbraco.Web.UI.Client/src/views/dashboard/developer/healthcheck.html index 3d913012d7..23bace18c4 100644 --- a/src/Umbraco.Web.UI.Client/src/views/dashboard/developer/healthcheck.html +++ b/src/Umbraco.Web.UI.Client/src/views/dashboard/developer/healthcheck.html @@ -4,7 +4,12 @@

Health Check

- + +
@@ -65,67 +70,75 @@
-
-
{{ vm.selectedGroup.name }}
- -
+
-
+
+
{{ vm.selectedGroup.name }}
+ + +
-
+
-
-
{{ check.name }}
-
{{ check.description }}
-
+
-
- -
- - - - +
+
{{ check.name }}
+
{{ check.description }}
-
+
-
-
-
+
+ + + +
-
-
- +
-
-
- -
- - - - - -
+
+
+
+ +
+
+ + +
+
+ +
+ + + +
+ +
+
+
+
-
+
+
+ +
-
-
-
diff --git a/src/Umbraco.Web.UI.Client/src/views/dashboard/developer/publishedstatus.html b/src/Umbraco.Web.UI.Client/src/views/dashboard/developer/publishedstatus.html index 29d136d107..09a02bc67e 100644 --- a/src/Umbraco.Web.UI.Client/src/views/dashboard/developer/publishedstatus.html +++ b/src/Umbraco.Web.UI.Client/src/views/dashboard/developer/publishedstatus.html @@ -1,9 +1,11 @@ 
-

Published Status

- -
- Loading... -
- -
+

Published Status

+ + +
+ Loading... +
+
+
+
\ No newline at end of file diff --git a/src/Umbraco.Web.UI.Client/src/views/dashboard/settings/settingsdashboardintro.html b/src/Umbraco.Web.UI.Client/src/views/dashboard/settings/settingsdashboardintro.html index d59d10d393..dd3f83ca7d 100644 --- a/src/Umbraco.Web.UI.Client/src/views/dashboard/settings/settingsdashboardintro.html +++ b/src/Umbraco.Web.UI.Client/src/views/dashboard/settings/settingsdashboardintro.html @@ -1,14 +1,16 @@ -

Start here

-

This section contains the building blocks for your Umbraco site

-

Follow the below links to find out more about working with the items in the Settings section:

+

Start here

+ + +

This section contains the building blocks for your Umbraco site. Follow the below links to find out more about working with the items in the Settings section:

+
Find out more:
+ +
+
-

Find out more:

- - diff --git a/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj b/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj index f9a9fd09ec..3618a12480 100644 --- a/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj +++ b/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj @@ -103,85 +103,36 @@ - - - - - - - - - - All - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + @@ -796,7 +747,6 @@ - diff --git a/src/Umbraco.Web/Umbraco.Web.csproj b/src/Umbraco.Web/Umbraco.Web.csproj index 0869104282..6cdb7e2b29 100644 --- a/src/Umbraco.Web/Umbraco.Web.csproj +++ b/src/Umbraco.Web/Umbraco.Web.csproj @@ -75,33 +75,21 @@ - - - - - - - - - - - - @@ -1727,7 +1715,8 @@ $(PlatformTargetAsMSBuildArchitecture) - + +