From 0bb643672fd00665788df7a43388c519f2fb940f Mon Sep 17 00:00:00 2001 From: Morten Christensen Date: Fri, 7 Jun 2013 05:19:25 -0200 Subject: [PATCH 01/21] Adding some minor changes/adjustments to the TypeFinder to make a bit more flexible for external usage. --- src/Umbraco.Core/IO/IOHelper.cs | 26 +++++++++++++++++++ .../Standalone/ServiceContextManager.cs | 12 +++++++-- .../Standalone/StandaloneCoreApplication.cs | 12 ++++++--- .../Standalone/StandaloneCoreBootManager.cs | 12 ++++++--- src/Umbraco.Core/TypeFinder.cs | 6 +++-- .../Standalone/ServiceContextManager.cs | 8 ++++-- .../Standalone/StandaloneApplication.cs | 12 ++++++--- .../Standalone/StandaloneBootManager.cs | 8 ++++-- 8 files changed, 77 insertions(+), 19 deletions(-) diff --git a/src/Umbraco.Core/IO/IOHelper.cs b/src/Umbraco.Core/IO/IOHelper.cs index 34be23e1f1..bc860705a2 100644 --- a/src/Umbraco.Core/IO/IOHelper.cs +++ b/src/Umbraco.Core/IO/IOHelper.cs @@ -249,6 +249,32 @@ namespace Umbraco.Core.IO return _rootDir; } + internal static string GetRootDirectoryBinFolder() + { + string binFolder = string.Empty; + if (string.IsNullOrEmpty(_rootDir)) + { + binFolder = Assembly.GetExecutingAssembly().GetAssemblyFile().Directory.FullName; + return binFolder; + } + + binFolder = Path.Combine(GetRootDirectorySafe(), "bin"); + +#if DEBUG + var debugFolder = Path.Combine(binFolder, "debug"); + if (Directory.Exists(debugFolder)) + return debugFolder; +#endif + var releaseFolder = Path.Combine(binFolder, "release"); + if (Directory.Exists(releaseFolder)) + return releaseFolder; + + if (Directory.Exists(binFolder)) + return binFolder; + + return _rootDir; + } + /// /// Allows you to overwrite RootDirectory, which would otherwise be resolved /// automatically upon application start. diff --git a/src/Umbraco.Core/Standalone/ServiceContextManager.cs b/src/Umbraco.Core/Standalone/ServiceContextManager.cs index 29a2945edd..ea9464242b 100644 --- a/src/Umbraco.Core/Standalone/ServiceContextManager.cs +++ b/src/Umbraco.Core/Standalone/ServiceContextManager.cs @@ -1,4 +1,6 @@ using System; +using System.Diagnostics; +using System.Reflection; using Umbraco.Core.Persistence; using Umbraco.Core.Persistence.Mappers; using Umbraco.Core.Persistence.UnitOfWork; @@ -14,12 +16,18 @@ namespace Umbraco.Core.Standalone private ServiceContext _serviceContext; private readonly StandaloneCoreApplication _application; - public ServiceContextManager(string connectionString, string providerName) + public ServiceContextManager(string connectionString, string providerName, string baseDirectory) { _connectionString = connectionString; _providerName = providerName; - _application = StandaloneCoreApplication.GetApplication(); + Trace.WriteLine("ServiceContextManager-Current AppDomain: " + AppDomain.CurrentDomain.FriendlyName); + Trace.WriteLine("ServiceContextManager-Current AppDomain: " + AppDomain.CurrentDomain.BaseDirectory); + + var examineEventHandlerToRemove = Type.GetType("Umbraco.Web.Search.ExamineEvents, Umbraco.Web"); + + _application = StandaloneCoreApplication.GetApplication(baseDirectory); + _application.WithoutApplicationEventHandler(examineEventHandlerToRemove); _application.Start(); } diff --git a/src/Umbraco.Core/Standalone/StandaloneCoreApplication.cs b/src/Umbraco.Core/Standalone/StandaloneCoreApplication.cs index 0e0081d948..c22a648478 100644 --- a/src/Umbraco.Core/Standalone/StandaloneCoreApplication.cs +++ b/src/Umbraco.Core/Standalone/StandaloneCoreApplication.cs @@ -8,7 +8,10 @@ namespace Umbraco.Core.Standalone /// /// Initializes a new instance of the class. /// - protected StandaloneCoreApplication() { } + protected StandaloneCoreApplication(string baseDirectory) + { + _baseDirectory = baseDirectory; + } /// /// Provides the application boot manager. @@ -16,11 +19,12 @@ namespace Umbraco.Core.Standalone /// An application boot manager. protected override IBootManager GetBootManager() { - return new StandaloneCoreBootManager(this, _handlersToAdd, _handlersToRemove); + return new StandaloneCoreBootManager(this, _handlersToAdd, _handlersToRemove, _baseDirectory); } #region Application + private readonly string _baseDirectory; private static StandaloneCoreApplication _application; private static bool _started; private static readonly object AppLock = new object(); @@ -28,11 +32,11 @@ namespace Umbraco.Core.Standalone /// /// Gets the instance of the standalone Umbraco application. /// - public static StandaloneCoreApplication GetApplication() + public static StandaloneCoreApplication GetApplication(string baseDirectory) { lock (AppLock) { - return _application ?? (_application = new StandaloneCoreApplication()); + return _application ?? (_application = new StandaloneCoreApplication(baseDirectory)); } } diff --git a/src/Umbraco.Core/Standalone/StandaloneCoreBootManager.cs b/src/Umbraco.Core/Standalone/StandaloneCoreBootManager.cs index 46871e2055..84c73f95b7 100644 --- a/src/Umbraco.Core/Standalone/StandaloneCoreBootManager.cs +++ b/src/Umbraco.Core/Standalone/StandaloneCoreBootManager.cs @@ -10,12 +10,16 @@ namespace Umbraco.Core.Standalone { private readonly IEnumerable _handlersToAdd; private readonly IEnumerable _handlersToRemove; + private readonly string _baseDirectory; - public StandaloneCoreBootManager(UmbracoApplicationBase umbracoApplication, IEnumerable handlersToAdd, IEnumerable handlersToRemove) + public StandaloneCoreBootManager(UmbracoApplicationBase umbracoApplication, IEnumerable handlersToAdd, IEnumerable handlersToRemove, string baseDirectory) : base(umbracoApplication) { _handlersToAdd = handlersToAdd; _handlersToRemove = handlersToRemove; + _baseDirectory = baseDirectory; + + base.InitializeApplicationRootPath(_baseDirectory); // this is only here to ensure references to the assemblies needed for // the DataTypesResolver otherwise they won't be loaded into the AppDomain. @@ -25,8 +29,10 @@ namespace Umbraco.Core.Standalone protected override void InitializeApplicationEventsResolver() { base.InitializeApplicationEventsResolver(); + foreach (var type in _handlersToAdd) ApplicationEventsResolver.Current.AddType(type); + foreach (var type in _handlersToRemove) ApplicationEventsResolver.Current.RemoveType(type); } @@ -36,7 +42,7 @@ namespace Umbraco.Core.Standalone base.InitializeResolvers(); //Mappers are not resolved, which could be because of a known TypeMapper issue - MappingResolver.Reset(); + /*MappingResolver.Reset(); MappingResolver.Current = new MappingResolver( () => new List @@ -47,7 +53,7 @@ namespace Umbraco.Core.Standalone typeof (MediaTypeMapper), typeof (DataTypeDefinitionMapper), typeof (UmbracoEntityMapper) - }); + });*/ } } } \ No newline at end of file diff --git a/src/Umbraco.Core/TypeFinder.cs b/src/Umbraco.Core/TypeFinder.cs index 81be7564c0..c6b943b008 100644 --- a/src/Umbraco.Core/TypeFinder.cs +++ b/src/Umbraco.Core/TypeFinder.cs @@ -73,8 +73,10 @@ namespace Umbraco.Core { //NOTE: we cannot use AppDomain.CurrentDomain.GetAssemblies() because this only returns assemblies that have // already been loaded in to the app domain, instead we will look directly into the bin folder and load each one. - var binFolder = Assembly.GetExecutingAssembly().GetAssemblyFile().Directory; - var binAssemblyFiles = Directory.GetFiles(binFolder.FullName, "*.dll", SearchOption.TopDirectoryOnly).ToList(); + var binFolder = IOHelper.GetRootDirectoryBinFolder(); + var binAssemblyFiles = Directory.GetFiles(binFolder, "*.dll", SearchOption.TopDirectoryOnly).ToList(); + //var binFolder = Assembly.GetExecutingAssembly().GetAssemblyFile().Directory; + //var binAssemblyFiles = Directory.GetFiles(binFolder.FullName, "*.dll", SearchOption.TopDirectoryOnly).ToList(); assemblies = new List(); foreach (var a in binAssemblyFiles) { diff --git a/src/Umbraco.Web/Standalone/ServiceContextManager.cs b/src/Umbraco.Web/Standalone/ServiceContextManager.cs index badd77d21b..aa53b586ee 100644 --- a/src/Umbraco.Web/Standalone/ServiceContextManager.cs +++ b/src/Umbraco.Web/Standalone/ServiceContextManager.cs @@ -1,4 +1,5 @@ using System; +using System.Diagnostics; using Umbraco.Core; using Umbraco.Core.Persistence; using Umbraco.Core.Persistence.Mappers; @@ -15,12 +16,15 @@ namespace Umbraco.Web.Standalone private ServiceContext _serviceContext; private readonly StandaloneApplication _application; - public ServiceContextManager(string connectionString, string providerName) + public ServiceContextManager(string connectionString, string providerName, string baseDirectory) { _connectionString = connectionString; _providerName = providerName; - _application = StandaloneApplication.GetApplication(); + Trace.WriteLine("Current AppDomain: " + AppDomain.CurrentDomain.FriendlyName); + Trace.WriteLine("Current AppDomain: " + AppDomain.CurrentDomain.BaseDirectory); + + _application = StandaloneApplication.GetApplication(baseDirectory); _application.Start(); } diff --git a/src/Umbraco.Web/Standalone/StandaloneApplication.cs b/src/Umbraco.Web/Standalone/StandaloneApplication.cs index a1fd0249a7..cdaf8718c1 100644 --- a/src/Umbraco.Web/Standalone/StandaloneApplication.cs +++ b/src/Umbraco.Web/Standalone/StandaloneApplication.cs @@ -14,7 +14,10 @@ namespace Umbraco.Web.Standalone /// /// Initializes a new instance of the class. /// - protected StandaloneApplication(){ } + protected StandaloneApplication(string baseDirectory) + { + _baseDirectory = baseDirectory; + } /// /// Provides the application boot manager. @@ -22,23 +25,24 @@ namespace Umbraco.Web.Standalone /// An application boot manager. protected override IBootManager GetBootManager() { - return new StandaloneBootManager(this, _handlersToAdd, _handlersToRemove); + return new StandaloneBootManager(this, _handlersToAdd, _handlersToRemove, _baseDirectory); } #region Application private static StandaloneApplication _application; + private readonly string _baseDirectory; private static bool _started; private static readonly object AppLock = new object(); /// /// Gets the instance of the standalone Umbraco application. /// - public static StandaloneApplication GetApplication() + public static StandaloneApplication GetApplication(string baseDirectory) { lock (AppLock) { - return _application ?? (_application = new StandaloneApplication()); + return _application ?? (_application = new StandaloneApplication(baseDirectory)); } } diff --git a/src/Umbraco.Web/Standalone/StandaloneBootManager.cs b/src/Umbraco.Web/Standalone/StandaloneBootManager.cs index 1215ab89a7..cf2e8f7c11 100644 --- a/src/Umbraco.Web/Standalone/StandaloneBootManager.cs +++ b/src/Umbraco.Web/Standalone/StandaloneBootManager.cs @@ -20,12 +20,16 @@ namespace Umbraco.Web.Standalone private readonly IEnumerable _handlersToAdd; private readonly IEnumerable _handlersToRemove; + private readonly string _baseDirectory; - public StandaloneBootManager(UmbracoApplicationBase umbracoApplication, IEnumerable handlersToAdd, IEnumerable handlersToRemove) + public StandaloneBootManager(UmbracoApplicationBase umbracoApplication, IEnumerable handlersToAdd, IEnumerable handlersToRemove, string baseDirectory) : base(umbracoApplication) { _handlersToAdd = handlersToAdd; _handlersToRemove = handlersToRemove; + _baseDirectory = baseDirectory; + + base.InitializeApplicationRootPath(_baseDirectory); // this is only here to ensure references to the assemblies needed for // the DataTypesResolver otherwise they won't be loaded into the AppDomain. @@ -63,7 +67,7 @@ namespace Umbraco.Web.Standalone typeof (ContentFinderByPageIdQuery), typeof (ContentFinderByNiceUrl), typeof (ContentFinderByIdPath), - typeof(ContentFinderByNotFoundHandlers) + typeof (ContentFinderByNotFoundHandlers) ); // fixme - what else? From bc1b2dc5f40114d623f2ec88503b362f15592806 Mon Sep 17 00:00:00 2001 From: Morten Christensen Date: Fri, 7 Jun 2013 05:19:45 -0200 Subject: [PATCH 02/21] Fixes #U4-2333 --- .../Persistence/Repositories/ContentTypeBaseRepository.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Umbraco.Core/Persistence/Repositories/ContentTypeBaseRepository.cs b/src/Umbraco.Core/Persistence/Repositories/ContentTypeBaseRepository.cs index 7fa04e6e58..e4299bbced 100644 --- a/src/Umbraco.Core/Persistence/Repositories/ContentTypeBaseRepository.cs +++ b/src/Umbraco.Core/Persistence/Repositories/ContentTypeBaseRepository.cs @@ -321,7 +321,7 @@ namespace Umbraco.Core.Persistence.Repositories sql.Select("*") .From() .LeftJoin() - .On(left => left.Id, right => right.NodeId) + .On(left => left.AllowedId, right => right.NodeId) .Where(x => x.Id == id); var allowedContentTypeDtos = Database.Fetch(sql); From e0c68a8e1cd92b8f865409bf17e9e2e7d1525de0 Mon Sep 17 00:00:00 2001 From: leekelleher Date: Mon, 10 Jun 2013 13:55:58 -0100 Subject: [PATCH 03/21] Resolves #U4-184 Upgrade package when installing a newer version. Multiple package versions can be installed, only the latest version is listed under "Installed Packages". When the installed package is viewed, a list of previously installed versions (of that package) are listed. --- src/Umbraco.Web.UI/umbraco/config/lang/en.xml | 1 + .../developer/Packages/installedPackage.aspx | 12 +++++- .../umbraco/Trees/loadPackages.cs | 37 +++++++------------ .../developer/Packages/installedPackage.aspx | 12 +++++- .../Packages/installedPackage.aspx.cs | 16 ++++++++ .../installedPackage.aspx.designer.cs | 30 ++++++++++++++- 6 files changed, 81 insertions(+), 27 deletions(-) diff --git a/src/Umbraco.Web.UI/umbraco/config/lang/en.xml b/src/Umbraco.Web.UI/umbraco/config/lang/en.xml index 004794145b..5ca5a737a8 100644 --- a/src/Umbraco.Web.UI/umbraco/config/lang/en.xml +++ b/src/Umbraco.Web.UI/umbraco/config/lang/en.xml @@ -627,6 +627,7 @@ To manage your website, simply open the umbraco back office and start adding con Upgrade instructions There's an upgrade available for this package. You can download it directly from the umbraco package repository. Package version + Package version history View package website diff --git a/src/Umbraco.Web.UI/umbraco/developer/Packages/installedPackage.aspx b/src/Umbraco.Web.UI/umbraco/developer/Packages/installedPackage.aspx index b1c2d9c8ec..d624d4c7f9 100644 --- a/src/Umbraco.Web.UI/umbraco/developer/Packages/installedPackage.aspx +++ b/src/Umbraco.Web.UI/umbraco/developer/Packages/installedPackage.aspx @@ -56,7 +56,17 @@ - + + + + + + + + +
diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/Trees/loadPackages.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/Trees/loadPackages.cs index 8b7d85eea9..887901a124 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/Trees/loadPackages.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/Trees/loadPackages.cs @@ -1,28 +1,13 @@ using System; -using System.Collections; using System.Collections.Generic; -using System.Data; -using System.IO; +using System.Linq; using System.Text; using System.Web; using System.Xml; -using System.Configuration; -using umbraco.BasePages; -using umbraco.BusinessLogic; using umbraco.businesslogic; -using umbraco.cms.businesslogic; -using umbraco.cms.businesslogic.cache; -using umbraco.cms.businesslogic.contentitem; -using umbraco.cms.businesslogic.datatype; -using umbraco.cms.businesslogic.language; -using umbraco.cms.businesslogic.media; -using umbraco.cms.businesslogic.member; -using umbraco.cms.businesslogic.property; -using umbraco.cms.businesslogic.web; -using umbraco.interfaces; -using umbraco.DataLayer; -using umbraco.BusinessLogic.Utils; +using umbraco.cms.businesslogic.packager; using umbraco.cms.presentation.Trees; +using umbraco.interfaces; namespace umbraco { @@ -63,18 +48,24 @@ namespace umbraco switch (m_packageType) { case "installed": - foreach (cms.businesslogic.packager.InstalledPackage p in cms.businesslogic.packager.InstalledPackage.GetAllInstalledPackages()) + Version v; + // Display the unique packages, ordered by the latest version number. [LK 2013-06-10] + var uniquePackages = InstalledPackage.GetAllInstalledPackages() + .OrderByDescending(x => Version.TryParse(x.Data.Version, out v) ? v : new Version()) + .GroupBy(x => x.Data.Name) + .Select(x => x.First()) + .OrderBy(x => x.Data.Id); + foreach (var p in uniquePackages) { - XmlTreeNode xNode = XmlTreeNode.Create(this); - xNode.NodeID = PACKAGE_TREE_PREFIX + p.Data.Id.ToString(); + var xNode = XmlTreeNode.Create(this); + xNode.NodeID = string.Concat(PACKAGE_TREE_PREFIX, p.Data.Id); xNode.Text = p.Data.Name; - xNode.Action = "javascript:openInstalledPackage('" + p.Data.Id.ToString() + "');"; + xNode.Action = string.Format("javascript:openInstalledPackage('{0}');", p.Data.Id); xNode.Icon = "package.gif"; xNode.OpenIcon = "package.gif"; xNode.NodeType = "createdPackageInstance"; xNode.Menu = null; tree.Add(xNode); - } break; diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/developer/Packages/installedPackage.aspx b/src/Umbraco.Web/umbraco.presentation/umbraco/developer/Packages/installedPackage.aspx index b1c2d9c8ec..990e4394ae 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/developer/Packages/installedPackage.aspx +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/developer/Packages/installedPackage.aspx @@ -56,7 +56,17 @@ - + + + + + + + + +
diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/developer/Packages/installedPackage.aspx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/developer/Packages/installedPackage.aspx.cs index 67b58f1395..41e3bbad1b 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/developer/Packages/installedPackage.aspx.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/developer/Packages/installedPackage.aspx.cs @@ -335,6 +335,20 @@ namespace umbraco.presentation.developer.packages bt_uninstall.Visible = false; pane_uninstall.Visible = false; } + + // List the package version history [LK 2013-067-10] + Version v; + var packageVersionHistory = cms.businesslogic.packager.InstalledPackage.GetAllInstalledPackages() + .Where(x => x.Data.Id != _pack.Data.Id && string.Equals(x.Data.Name, _pack.Data.Name, StringComparison.OrdinalIgnoreCase)) + .OrderBy(x => Version.TryParse(x.Data.Version, out v) ? v : new Version()); + + if (packageVersionHistory != null && packageVersionHistory.Count() > 0) + { + rptr_versions.DataSource = packageVersionHistory; + rptr_versions.DataBind(); + + pane_versions.Visible = true; + } } } } @@ -613,6 +627,8 @@ namespace umbraco.presentation.developer.packages pp_upgradeInstruction.Text = ui.Text("packager", "packageUpgradeInstructions"); bt_gotoUpgrade.Text = ui.Text("packager", "packageUpgradeDownload"); + pane_versions.Text = ui.Text("packager", "packageVersionHistory"); + pane_noItems.Text = ui.Text("packager", "packageNoItemsHeader"); pane_uninstall.Text = ui.Text("packager", "packageUninstallHeader"); diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/developer/Packages/installedPackage.aspx.designer.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/developer/Packages/installedPackage.aspx.designer.cs index 398a23466d..e6dfc46646 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/developer/Packages/installedPackage.aspx.designer.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/developer/Packages/installedPackage.aspx.designer.cs @@ -1,10 +1,9 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:2.0.50727.4200 // // Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. +// the code is regenerated. // //------------------------------------------------------------------------------ @@ -175,6 +174,33 @@ namespace umbraco.presentation.developer.packages { /// protected global::System.Web.UI.WebControls.Literal lt_readme; + /// + /// pane_versions control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::umbraco.uicontrols.Pane pane_versions; + + /// + /// pp_versions control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::umbraco.uicontrols.PropertyPanel pp_versions; + + /// + /// rptr_versions control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Repeater rptr_versions; + /// /// pane_options control. /// From 33ff82e76679de2a9ae2e44b280e851b990c8461 Mon Sep 17 00:00:00 2001 From: Sebastiaan Janssen Date: Tue, 11 Jun 2013 00:47:44 +0200 Subject: [PATCH 04/21] Add missing files --- .gitignore | 67 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000000..339279d0f5 --- /dev/null +++ b/.gitignore @@ -0,0 +1,67 @@ +*.obj +*.pdb +*.user +*.aps +*.pch +*.vspscc +[Bb]in +[Db]ebug*/ +obj/ +[Rr]elease*/ +_ReSharper*/ +_NCrunch_*/ +*.ncrunchsolution +*.ncrunchsolution.user +*.ncrunchproject +*.crunchsolution.cache +[Tt]est[Rr]esult* +[Bb]uild[Ll]og.* +*.[Pp]ublish.xml +*.suo +[sS]ource +[sS]andbox +umbraco.config +*.vs10x +App_Data/TEMP/* +umbraco/presentation/umbraco/plugins/* +umbraco/presentation/usercontrols/* +umbraco/presentation/scripts/* +umbraco/presentation/fonts/* +umbraco/presentation/css/* + +src/Umbraco.Web.UI/[Cc]ss/* +src/Umbraco.Web.UI/App_Code/* +src/Umbraco.Web.UI/App_Data/* +src/Umbraco.Tests/App_Data/* +src/Umbraco.Web.UI/[Mm]edia/* +src/Umbraco.Web.UI/[Mm]aster[Pp]ages/* +src/Umbraco.Web.UI/[Mm]acro[Ss]cripts/* +src/Umbraco.Web.UI/[Xx]slt/* +src/Umbraco.Web.UI/[Ii]mages/* +src/Umbraco.Web.UI/[Ss]cripts/* +src/Umbraco.Web.UI/Web.*.config.transformed + +umbraco/presentation/umbraco/plugins/uComponents/uComponentsInstaller.ascx +umbraco/presentation/packages/uComponents/MultiNodePicker/CustomTreeService.asmx +_BuildOutput/* +*.ncrunchsolution +build/UmbracoCms.AllBinaries*zip +build/UmbracoCms.WebPI*zip +build/UmbracoCms*zip +build/*.nupkg +src/Umbraco.Tests/config/applications.config +src/Umbraco.Tests/config/trees.config +src/Umbraco.Web.UI/web.config +*.orig +src/Umbraco.Tests/config/404handlers.config +src/Umbraco.Web.UI/Views/*.cshtml +src/Umbraco.Web.UI/Views/*.vbhtml +src/Umbraco.Tests/config/umbracoSettings.config +src/Umbraco.Web.UI/App_Plugins/* +src/Umbraco.Web.UI/Views/* +src/packages/ +src/packages/repositories.config + +src/Umbraco.Web.UI/[W]eb.config +*.transformed +webpihash.txt \ No newline at end of file From acdcca0b91b7d3c0a5d27b953bcdebd6cf9e0838 Mon Sep 17 00:00:00 2001 From: Sebastiaan Janssen Date: Tue, 11 Jun 2013 00:48:29 +0200 Subject: [PATCH 05/21] Add missing files --- .gitignore | 67 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000000..339279d0f5 --- /dev/null +++ b/.gitignore @@ -0,0 +1,67 @@ +*.obj +*.pdb +*.user +*.aps +*.pch +*.vspscc +[Bb]in +[Db]ebug*/ +obj/ +[Rr]elease*/ +_ReSharper*/ +_NCrunch_*/ +*.ncrunchsolution +*.ncrunchsolution.user +*.ncrunchproject +*.crunchsolution.cache +[Tt]est[Rr]esult* +[Bb]uild[Ll]og.* +*.[Pp]ublish.xml +*.suo +[sS]ource +[sS]andbox +umbraco.config +*.vs10x +App_Data/TEMP/* +umbraco/presentation/umbraco/plugins/* +umbraco/presentation/usercontrols/* +umbraco/presentation/scripts/* +umbraco/presentation/fonts/* +umbraco/presentation/css/* + +src/Umbraco.Web.UI/[Cc]ss/* +src/Umbraco.Web.UI/App_Code/* +src/Umbraco.Web.UI/App_Data/* +src/Umbraco.Tests/App_Data/* +src/Umbraco.Web.UI/[Mm]edia/* +src/Umbraco.Web.UI/[Mm]aster[Pp]ages/* +src/Umbraco.Web.UI/[Mm]acro[Ss]cripts/* +src/Umbraco.Web.UI/[Xx]slt/* +src/Umbraco.Web.UI/[Ii]mages/* +src/Umbraco.Web.UI/[Ss]cripts/* +src/Umbraco.Web.UI/Web.*.config.transformed + +umbraco/presentation/umbraco/plugins/uComponents/uComponentsInstaller.ascx +umbraco/presentation/packages/uComponents/MultiNodePicker/CustomTreeService.asmx +_BuildOutput/* +*.ncrunchsolution +build/UmbracoCms.AllBinaries*zip +build/UmbracoCms.WebPI*zip +build/UmbracoCms*zip +build/*.nupkg +src/Umbraco.Tests/config/applications.config +src/Umbraco.Tests/config/trees.config +src/Umbraco.Web.UI/web.config +*.orig +src/Umbraco.Tests/config/404handlers.config +src/Umbraco.Web.UI/Views/*.cshtml +src/Umbraco.Web.UI/Views/*.vbhtml +src/Umbraco.Tests/config/umbracoSettings.config +src/Umbraco.Web.UI/App_Plugins/* +src/Umbraco.Web.UI/Views/* +src/packages/ +src/packages/repositories.config + +src/Umbraco.Web.UI/[W]eb.config +*.transformed +webpihash.txt \ No newline at end of file From a4098b5d250547fabd6dfff37ae67976f49bdc8a Mon Sep 17 00:00:00 2001 From: Sebastiaan Janssen Date: Tue, 11 Jun 2013 00:57:03 +0200 Subject: [PATCH 06/21] Update README.md --- README.md | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000000..5e7cb63499 --- /dev/null +++ b/README.md @@ -0,0 +1,24 @@ +Umbraco CMS +=========== +## Watch a five minute introduction video ## + +[![ScreenShot](http://umbraco.com/images/whatisumbraco.png)](http://umbraco.org/help-and-support/video-tutorials/getting-started/what-is-umbraco) + +## Umbraco - the simple, flexible and friendly ASP.NET CMS ## + +**More than 155,000 sites trust Umbraco** +For the first time on the Microsoft platform a free user and developer friendly cms that makes it quick and easy to create websites - or a breeze to build complex web applications. umbraco got award-winning integration capabilities and supports your ASP.NET User and Custom Controls out of the box. It's a developers dream and your users will love it too. Used by more than 110,000 active websites including [http://daviscup.com](http://daviscup.com), [http://heinz.com](http://heinz.com), [http://peugeot.com](http://peugeot.com), [http://www.hersheys.com/](http://www.hersheys.com/) and **The Official ASP.NET and IIS.NET website from Microsoft** ([http://asp.net](http://asp.net) / [http://iis.net](http://iis.net)) you can be sure that the technology is proven, stable and scales. +[More info at http://umbraco.org](http://umbraco.org) + +## Forums ## +We have a forum running on [http://our.umbraco.org](http://our.umbraco.org). The discussions area on CodePlex will be for discussions on developing the core, and not on Umbraco-implementations or extensions in general. For those topics, please use [http://our.umbraco.org](http://our.umbraco.org). + +## Contribute to Umbraco ## + +If you want to contribute back to Umbraco you should check out our [guide to contributing](http://our.umbraco.org/contribute). + +## Submitting Issues ## + +Another way you can contribute to Umbraco is by providing issue reports, for information on how to submit an issue report refer to our [online guide for reporting issues](http://our.umbraco.org/contribute/report-an-issue-or-request-a-feature). + +To view existing issues please visit [http://issues.umbraco.org](http://issues.umbraco.org) From 14c3acc4b7dc1022be55263823b8de0fa555835e Mon Sep 17 00:00:00 2001 From: Sebastiaan Janssen Date: Mon, 10 Jun 2013 18:05:07 +0200 Subject: [PATCH 07/21] Create README.md --- README.md | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000000..f8815f30eb --- /dev/null +++ b/README.md @@ -0,0 +1,26 @@ +Umbraco CMS +=========== +![](http://download-codeplex.sec.s-msft.com/Download?ProjectName=umbraco&DownloadId=55656) + +## Watch a five minute introduction video ## + +[http://umbraco.org/help-and-support/video-tutorials/getting-started/what-is-umbraco](http://umbraco.org/help-and-support/video-tutorials/getting-started/what-is-umbraco) + +## Umbraco - the simple, flexible and friendly ASP.NET CMS ## + +**More than 155,000 sites trust Umbraco** +For the first time on the Microsoft platform a free user and developer friendly cms that makes it quick and easy to create websites - or a breeze to build complex web applications. umbraco got award-winning integration capabilities and supports your ASP.NET User and Custom Controls out of the box. It's a developers dream and your users will love it too. Used by more than 110,000 active websites including [http://daviscup.com](http://daviscup.com), [http://heinz.com](http://heinz.com), [http://peugeot.com](http://peugeot.com), [http://www.hersheys.com/](http://www.hersheys.com/) and **The Official ASP.NET and IIS.NET website from Microsoft** ([http://asp.net](http://asp.net) / [http://iis.net](http://iis.net)) you can be sure that the technology is proven, stable and scales. +[More info at http://umbraco.org +Forums](http://umbraco.org) + +We have a forum running on [http://our.umbraco.org](http://our.umbraco.org). The discussions area on CodePlex will be for discussions on developing the core, and not on Umbraco-implementations or extensions in general. For those topics, please use [http://our.umbraco.org](http://our.umbraco.org). + +## Contribute to Umbraco ## + +If you want to contribute back to Umbraco you should check out our [guide to contributing](http://our.umbraco.org/contribute). + +## Submitting Issues ## + +Another way you can contribute to Umbraco is by providing issue reports, for information on how to submit an issue report refer to our [online guide for reporting issues](http://our.umbraco.org/contribute/report-an-issue-or-request-a-feature). + +To view existing issues please visit [http://issues.umbraco.org](http://issues.umbraco.org) From c6d0a9be006aaf835fe4275b9a9c280f503f5404 Mon Sep 17 00:00:00 2001 From: Sebastiaan Janssen Date: Mon, 10 Jun 2013 19:09:03 +0300 Subject: [PATCH 08/21] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index f8815f30eb..e16aa47db5 100644 --- a/README.md +++ b/README.md @@ -10,9 +10,9 @@ Umbraco CMS **More than 155,000 sites trust Umbraco** For the first time on the Microsoft platform a free user and developer friendly cms that makes it quick and easy to create websites - or a breeze to build complex web applications. umbraco got award-winning integration capabilities and supports your ASP.NET User and Custom Controls out of the box. It's a developers dream and your users will love it too. Used by more than 110,000 active websites including [http://daviscup.com](http://daviscup.com), [http://heinz.com](http://heinz.com), [http://peugeot.com](http://peugeot.com), [http://www.hersheys.com/](http://www.hersheys.com/) and **The Official ASP.NET and IIS.NET website from Microsoft** ([http://asp.net](http://asp.net) / [http://iis.net](http://iis.net)) you can be sure that the technology is proven, stable and scales. -[More info at http://umbraco.org -Forums](http://umbraco.org) +[More info at http://umbraco.org](http://umbraco.org) +## Forums ## We have a forum running on [http://our.umbraco.org](http://our.umbraco.org). The discussions area on CodePlex will be for discussions on developing the core, and not on Umbraco-implementations or extensions in general. For those topics, please use [http://our.umbraco.org](http://our.umbraco.org). ## Contribute to Umbraco ## From 292dd9115bd3aa2665637143116e2cc6028ac809 Mon Sep 17 00:00:00 2001 From: Sebastiaan Janssen Date: Mon, 10 Jun 2013 19:17:37 +0300 Subject: [PATCH 09/21] Update README.md --- README.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/README.md b/README.md index e16aa47db5..5e7cb63499 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,8 @@ Umbraco CMS =========== -![](http://download-codeplex.sec.s-msft.com/Download?ProjectName=umbraco&DownloadId=55656) - ## Watch a five minute introduction video ## -[http://umbraco.org/help-and-support/video-tutorials/getting-started/what-is-umbraco](http://umbraco.org/help-and-support/video-tutorials/getting-started/what-is-umbraco) +[![ScreenShot](http://umbraco.com/images/whatisumbraco.png)](http://umbraco.org/help-and-support/video-tutorials/getting-started/what-is-umbraco) ## Umbraco - the simple, flexible and friendly ASP.NET CMS ## From 2cd07c841fa118fb4f87c89014b60d5936d4219b Mon Sep 17 00:00:00 2001 From: Jayshoe Date: Wed, 12 Jun 2013 16:19:14 +0200 Subject: [PATCH 10/21] Sitemap provider be gone! Issue #U4-1950 --- src/Umbraco.Web.UI/web.Template.config | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/src/Umbraco.Web.UI/web.Template.config b/src/Umbraco.Web.UI/web.Template.config index c0e24992f3..e7a036fc40 100644 --- a/src/Umbraco.Web.UI/web.Template.config +++ b/src/Umbraco.Web.UI/web.Template.config @@ -167,13 +167,6 @@ - - - - - - - @@ -290,4 +283,4 @@ - \ No newline at end of file + From 773500332bf365d9102f1b033b7ef46e10072d6d Mon Sep 17 00:00:00 2001 From: "david.pendray" Date: Thu, 13 Jun 2013 02:50:25 +0100 Subject: [PATCH 11/21] Fix U4-2320 - Error on saving User Permissions Nodes can be null but NodeIds property always returns a collection and this will return Ids from Nodes if _nodeIds are null and Nodes is not. --- src/Umbraco.Web/Cache/CacheRefresherEventHandler.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Umbraco.Web/Cache/CacheRefresherEventHandler.cs b/src/Umbraco.Web/Cache/CacheRefresherEventHandler.cs index 0f529b8840..435fb9c7ef 100644 --- a/src/Umbraco.Web/Cache/CacheRefresherEventHandler.cs +++ b/src/Umbraco.Web/Cache/CacheRefresherEventHandler.cs @@ -402,7 +402,7 @@ namespace Umbraco.Web.Cache { DistributedCache.Instance.RefreshUserCache(sender.UserId); } - if (sender.Nodes.Any()) + if (sender.NodeIds.Any()) { DistributedCache.Instance.RefreshAllUserCache(); } From c6c90fde44738b52228c01deb1c73242ced6585d Mon Sep 17 00:00:00 2001 From: Jeremy Pyne Date: Wed, 12 Jun 2013 23:41:49 -0300 Subject: [PATCH 12/21] Fixed Ctl+S on stylesheets editor. --- .../umbraco/settings/stylesheet/editstylesheet.aspx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Umbraco.Web.UI/umbraco/settings/stylesheet/editstylesheet.aspx b/src/Umbraco.Web.UI/umbraco/settings/stylesheet/editstylesheet.aspx index e380ac0c17..5ed8dd435e 100644 --- a/src/Umbraco.Web.UI/umbraco/settings/stylesheet/editstylesheet.aspx +++ b/src/Umbraco.Web.UI/umbraco/settings/stylesheet/editstylesheet.aspx @@ -25,10 +25,11 @@ } }); editor.init(); - }); //bind save shortcut UmbClientMgr.appActions().bindSaveShortCut(); + }); + })(jQuery); From 9b78cb3f7cd8ee545481ad3a159110b907367127 Mon Sep 17 00:00:00 2001 From: mattbrailsford Date: Thu, 13 Jun 2013 09:26:45 +0100 Subject: [PATCH 13/21] Updated RenderMvcController to have the view engines test for file existance, rather than assuming views will always be razor. This allows alternative MVC view engines to be used. --- src/Umbraco.Web/Mvc/RenderMvcController.cs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/Umbraco.Web/Mvc/RenderMvcController.cs b/src/Umbraco.Web/Mvc/RenderMvcController.cs index 0f26610070..4615937e6b 100644 --- a/src/Umbraco.Web/Mvc/RenderMvcController.cs +++ b/src/Umbraco.Web/Mvc/RenderMvcController.cs @@ -73,13 +73,13 @@ namespace Umbraco.Web.Mvc /// protected bool EnsurePhsyicalViewExists(string template) { - if (!System.IO.File.Exists( - Path.Combine(Server.MapPath(Constants.ViewLocation), template + ".cshtml"))) - { - LogHelper.Warn("No physical template file was found for template " + template); - return false; - } - return true; + var result = ViewEngines.Engines.FindView(ControllerContext, template, null); + if(result.View == null) + { + LogHelper.Warn("No physical template file was found for template " + template); + return false; + } + return true; } /// From aecc3d28bf2723877ce3f5a2b7db12eb20f799a3 Mon Sep 17 00:00:00 2001 From: Floris Robbemont Date: Sat, 15 Jun 2013 22:46:01 +0200 Subject: [PATCH 14/21] Fix U4-2286 - IFilteredControllerFactory classes are not resolved by Umbraco Simple fix, just made the FilteredCOntrollerFactoriesResolver public. This way developers can add their own on application start --- src/Umbraco.Web/Mvc/FilteredControllerFactoriesResolver.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Umbraco.Web/Mvc/FilteredControllerFactoriesResolver.cs b/src/Umbraco.Web/Mvc/FilteredControllerFactoriesResolver.cs index c6c0e5d109..e4fadf7c4b 100644 --- a/src/Umbraco.Web/Mvc/FilteredControllerFactoriesResolver.cs +++ b/src/Umbraco.Web/Mvc/FilteredControllerFactoriesResolver.cs @@ -7,7 +7,7 @@ namespace Umbraco.Web.Mvc /// /// A resolver for storing IFilteredControllerFactories /// - internal sealed class FilteredControllerFactoriesResolver : ManyObjectsResolverBase + public sealed class FilteredControllerFactoriesResolver : ManyObjectsResolverBase { /// /// Constructor From c9c3623457c9f426dede01fce7e2b9724ad06197 Mon Sep 17 00:00:00 2001 From: Shannon Date: Tue, 11 Jun 2013 16:39:46 +0200 Subject: [PATCH 15/21] updated ignore Signed-off-by: Shannon --- .gitignore | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 339279d0f5..d52439158b 100644 --- a/.gitignore +++ b/.gitignore @@ -64,4 +64,20 @@ src/packages/repositories.config src/Umbraco.Web.UI/[W]eb.config *.transformed -webpihash.txt \ No newline at end of file +webpihash.txt + +node_modules +src/Umbraco.Web.UI/umbraco/lib/* +src/Umbraco.Web.UI/umbraco/js/umbraco.* +src/Umbraco.Web.UI/umbraco/js/routes.js +src/Umbraco.Web.UI/umbraco/js/main.js +src/Umbraco.Web.UI/umbraco/js/app.js +src/Umbraco.Web.UI/umbraco/Views/**/*.js +src/Umbraco.Web.UI/umbraco/Views/**/*.css +src/Umbraco.Web.UI/umbraco/Views/**/*.html +src/Umbraco.Web.UI/umbraco/assets/* +src/Umbraco.Web.UI.Client/build/* +src/Umbraco.Web.UI.Client/build/* +src/Umbraco.Web.UI.Client/build/belle/ +src/Umbraco.Web.UI/UserControls/ +build/_BuildOutput/ From 9d15228c6836e369fa6e0ad02b0b5a5da88b309d Mon Sep 17 00:00:00 2001 From: Shannon Date: Mon, 17 Jun 2013 03:06:24 +0200 Subject: [PATCH 16/21] manually applies patch for drag/drop fix in media for vdir --- .../umbraco_client/FolderBrowser/Js/folderbrowser.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Umbraco.Web.UI/umbraco_client/FolderBrowser/Js/folderbrowser.js b/src/Umbraco.Web.UI/umbraco_client/FolderBrowser/Js/folderbrowser.js index a8132ae7c7..438a04344a 100644 --- a/src/Umbraco.Web.UI/umbraco_client/FolderBrowser/Js/folderbrowser.js +++ b/src/Umbraco.Web.UI/umbraco_client/FolderBrowser/Js/folderbrowser.js @@ -178,7 +178,7 @@ Umbraco.Sys.registerNamespace("Umbraco.Controls"); var overlay = $("
" + "
" + instructions + - "
" + + "" + "" + "" + "" + From d3780848dc91ec14ce5b6a195fb6dbcc506229bf Mon Sep 17 00:00:00 2001 From: Shannon Date: Tue, 18 Jun 2013 14:20:50 +1000 Subject: [PATCH 17/21] updated ignore file with correct case sensitivity --- .gitignore | 47 ++++++++++++++++++++++------------------------- 1 file changed, 22 insertions(+), 25 deletions(-) diff --git a/.gitignore b/.gitignore index d52439158b..38d41211d5 100644 --- a/.gitignore +++ b/.gitignore @@ -23,11 +23,11 @@ _NCrunch_*/ umbraco.config *.vs10x App_Data/TEMP/* -umbraco/presentation/umbraco/plugins/* -umbraco/presentation/usercontrols/* -umbraco/presentation/scripts/* -umbraco/presentation/fonts/* -umbraco/presentation/css/* +[Uu]mbraco/[Pp]resentation/[Uu]mbraco/[Pp]lugins/* +[Uu]mbraco/[Pp]resentation/[Uu]ser[Cc]ontrols/* +[Uu]mbraco/[Pp]resentation/[Ss]cripts/* +[Uu]mbraco/[Pp]resentation/[Ff]onts/* +[Uu]mbraco/[Pp]resentation/[Cc]ss/* src/Umbraco.Web.UI/[Cc]ss/* src/Umbraco.Web.UI/App_Code/* @@ -44,7 +44,6 @@ src/Umbraco.Web.UI/Web.*.config.transformed umbraco/presentation/umbraco/plugins/uComponents/uComponentsInstaller.ascx umbraco/presentation/packages/uComponents/MultiNodePicker/CustomTreeService.asmx _BuildOutput/* -*.ncrunchsolution build/UmbracoCms.AllBinaries*zip build/UmbracoCms.WebPI*zip build/UmbracoCms*zip @@ -54,30 +53,28 @@ src/Umbraco.Tests/config/trees.config src/Umbraco.Web.UI/web.config *.orig src/Umbraco.Tests/config/404handlers.config -src/Umbraco.Web.UI/Views/*.cshtml -src/Umbraco.Web.UI/Views/*.vbhtml -src/Umbraco.Tests/config/umbracoSettings.config -src/Umbraco.Web.UI/App_Plugins/* -src/Umbraco.Web.UI/Views/* +src/Umbraco.Web.UI/[Vv]iews/*.cshtml +src/Umbraco.Web.UI/[Vv]iews/*.vbhtml +src/Umbraco.Tests/[Cc]onfig/umbracoSettings.config +src/Umbraco.Web.UI/[Vv]iews/* src/packages/ src/packages/repositories.config -src/Umbraco.Web.UI/[W]eb.config +src/Umbraco.Web.UI/[Ww]eb.config *.transformed webpihash.txt node_modules -src/Umbraco.Web.UI/umbraco/lib/* -src/Umbraco.Web.UI/umbraco/js/umbraco.* -src/Umbraco.Web.UI/umbraco/js/routes.js -src/Umbraco.Web.UI/umbraco/js/main.js -src/Umbraco.Web.UI/umbraco/js/app.js -src/Umbraco.Web.UI/umbraco/Views/**/*.js -src/Umbraco.Web.UI/umbraco/Views/**/*.css -src/Umbraco.Web.UI/umbraco/Views/**/*.html -src/Umbraco.Web.UI/umbraco/assets/* -src/Umbraco.Web.UI.Client/build/* -src/Umbraco.Web.UI.Client/build/* -src/Umbraco.Web.UI.Client/build/belle/ -src/Umbraco.Web.UI/UserControls/ +src/Umbraco.Web.UI/[Uu]mbraco/[Ll]ib/* +src/Umbraco.Web.UI/[Uu]mbraco/[Jj]s/umbraco.* +src/Umbraco.Web.UI/[Uu]mbraco/[Jj]s/routes.js +src/Umbraco.Web.UI/[Uu]mbraco/[Jj]s/main.js +src/Umbraco.Web.UI/[Uu]mbraco/[Jj]s/app.js +src/Umbraco.Web.UI/[Uu]mbraco/[Vv]iews/**/*.js +src/Umbraco.Web.UI/[Uu]mbraco/[Vv]iews/**/*.css +src/Umbraco.Web.UI/[Uu]mbraco/[Vv]iews/**/*.html +src/Umbraco.Web.UI/[Uu]mbraco/[Aa]ssets/* +src/Umbraco.Web.UI.Client/[Bb]uild/* +src/Umbraco.Web.UI.Client/[Bb]uild/[Bb]elle/ +src/Umbraco.Web.UI/[Uu]ser[Cc]ontrols/ build/_BuildOutput/ From a5041aa34ee239c521503723fad2afe359cbb032 Mon Sep 17 00:00:00 2001 From: Shannon Date: Tue, 18 Jun 2013 14:59:00 +1000 Subject: [PATCH 18/21] Backported changes to use a real Area to do Umbraco area routes and updates our extension methods with the UseNamespaceFallback data token to only check in one namespace. --- .../Mvc/AreaRegistrationExtensions.cs | 3 + src/Umbraco.Web/Mvc/BackOfficeArea.cs | 44 +++++++++++ src/Umbraco.Web/Umbraco.Web.csproj | 9 ++- src/Umbraco.Web/WebBootManager.cs | 77 ++++++++++--------- 4 files changed, 92 insertions(+), 41 deletions(-) create mode 100644 src/Umbraco.Web/Mvc/BackOfficeArea.cs diff --git a/src/Umbraco.Web/Mvc/AreaRegistrationExtensions.cs b/src/Umbraco.Web/Mvc/AreaRegistrationExtensions.cs index c867a0823d..6eec7fbe1b 100644 --- a/src/Umbraco.Web/Mvc/AreaRegistrationExtensions.cs +++ b/src/Umbraco.Web/Mvc/AreaRegistrationExtensions.cs @@ -60,6 +60,9 @@ namespace Umbraco.Web.Mvc { "id", defaultId } }); + //Don't look anywhere else except this namespace! + controllerPluginRoute.DataTokens.Add("UseNamespaceFallback", false); + //constraints: only match controllers ending with 'controllerSuffixName' and only match this controller's ID for this route controllerPluginRoute.Constraints = new RouteValueDictionary( new Dictionary diff --git a/src/Umbraco.Web/Mvc/BackOfficeArea.cs b/src/Umbraco.Web/Mvc/BackOfficeArea.cs new file mode 100644 index 0000000000..5393996d78 --- /dev/null +++ b/src/Umbraco.Web/Mvc/BackOfficeArea.cs @@ -0,0 +1,44 @@ +using System.Web.Mvc; +using Umbraco.Core.Configuration; +using Umbraco.Web.Install; + +namespace Umbraco.Web.Mvc +{ + /// + /// An area registration for back office components + /// + internal class BackOfficeArea : AreaRegistration + { + + /// + /// Create the routes for the area + /// + /// + /// + /// By using the context to register the routes it means that the area is already applied to them all + /// and that the namespaces searched for the controllers are ONLY the ones specified. + /// + public override void RegisterArea(AreaRegistrationContext context) + { + //Create the install routes + context.MapRoute( + "Umbraco_install_packages", + "Install/PackageInstaller/{action}/{id}", + new {controller = "InstallPackage", action = "Index", id = UrlParameter.Optional}, + new[] {typeof (InstallPackageController).Namespace}); + + //Create the REST/web/script service routes + context.MapRoute( + "Umbraco_web_services", + GlobalSettings.UmbracoMvcArea + "/RestServices/{controller}/{action}/{id}", + new {controller = "SaveFileController", action = "Index", id = UrlParameter.Optional}, + //look in this namespace for controllers + new[] {"Umbraco.Web.WebServices"}); + } + + public override string AreaName + { + get { return GlobalSettings.UmbracoMvcArea; } + } + } +} \ No newline at end of file diff --git a/src/Umbraco.Web/Umbraco.Web.csproj b/src/Umbraco.Web/Umbraco.Web.csproj index 21fa2d97bb..ea1c65c1bb 100644 --- a/src/Umbraco.Web/Umbraco.Web.csproj +++ b/src/Umbraco.Web/Umbraco.Web.csproj @@ -278,6 +278,7 @@ + @@ -420,9 +421,9 @@ ASPXCodeBehind - - ASPXCodeBehind - + + ASPXCodeBehind + ASPXCodeBehind @@ -1941,7 +1942,7 @@ ASPXCodeBehind - + ASPXCodeBehind diff --git a/src/Umbraco.Web/WebBootManager.cs b/src/Umbraco.Web/WebBootManager.cs index c112fcf1d1..d2e604055b 100644 --- a/src/Umbraco.Web/WebBootManager.cs +++ b/src/Umbraco.Web/WebBootManager.cs @@ -30,10 +30,10 @@ namespace Umbraco.Web { private readonly bool _isForTesting; - public WebBootManager(UmbracoApplicationBase umbracoApplication) + public WebBootManager(UmbracoApplicationBase umbracoApplication) : this(umbracoApplication, false) { - + } /// @@ -41,10 +41,10 @@ namespace Umbraco.Web /// /// /// - internal WebBootManager(UmbracoApplicationBase umbracoApplication, bool isForTesting) + internal WebBootManager(UmbracoApplicationBase umbracoApplication, bool isForTesting) : base(umbracoApplication) { - _isForTesting = isForTesting; + _isForTesting = isForTesting; } /// @@ -52,7 +52,7 @@ namespace Umbraco.Web /// /// public override IBootManager Initialize() - { + { base.Initialize(); // Backwards compatibility - set the path and URL type for ClientDependency 1.5.1 [LK] @@ -130,43 +130,36 @@ namespace Umbraco.Web ); defaultRoute.RouteHandler = new RenderRouteHandler(ControllerBuilder.Current.GetControllerFactory()); - //Create the install routes - var installPackageRoute = RouteTable.Routes.MapRoute( - "Umbraco_install_packages", - "Install/PackageInstaller/{action}/{id}", - new { controller = "InstallPackage", action = "Index", id = UrlParameter.Optional } - ); - installPackageRoute.DataTokens.Add("area", umbracoPath); + //register all back office routes + RouteBackOfficeControllers(); - //Create the REST/web/script service routes - var webServiceRoutes = RouteTable.Routes.MapRoute( - "Umbraco_web_services", - umbracoPath + "/RestServices/{controller}/{action}/{id}", - new {controller = "SaveFileController", action = "Index", id = UrlParameter.Optional}, - //VERY IMPORTANT! for this route, only match controllers in this namespace! - new string[] { "Umbraco.Web.WebServices" } - ); - webServiceRoutes.DataTokens.Add("area", umbracoPath); + //plugin controllers must come first because the next route will catch many things + RoutePluginControllers(); + } - //we need to find the surface controllers and route them - var surfaceControllers = SurfaceControllerResolver.Current.RegisteredSurfaceControllers.ToArray(); + private void RouteBackOfficeControllers() + { + var backOfficeArea = new BackOfficeArea(); + RouteTable.Routes.RegisterArea(backOfficeArea); + } - //local surface controllers do not contain the attribute - var localSurfaceControlleres = surfaceControllers.Where(x => PluginController.GetMetadata(x).AreaName.IsNullOrWhiteSpace()); - foreach (var s in localSurfaceControlleres) + private void RoutePluginControllers() + { + var umbracoPath = GlobalSettings.UmbracoMvcArea; + + //we need to find the plugin controllers and route them + var pluginControllers = + SurfaceControllerResolver.Current.RegisteredSurfaceControllers.ToArray(); + + //local controllers do not contain the attribute + var localControllers = pluginControllers.Where(x => PluginController.GetMetadata(x).AreaName.IsNullOrWhiteSpace()); + foreach (var s in localControllers) { - var meta = PluginController.GetMetadata(s); - var route = RouteTable.Routes.MapRoute( - string.Format("umbraco-{0}-{1}", "surface", meta.ControllerName), - umbracoPath + "/Surface/" + meta.ControllerName + "/{action}/{id}",//url to match - new { controller = meta.ControllerName, action = "Index", id = UrlParameter.Optional }, - new[] { meta.ControllerNamespace }); //only match this namespace - route.DataTokens.Add("umbraco", "surface"); //ensure the umbraco token is set + RouteLocalSurfaceController(s, umbracoPath); } //need to get the plugin controllers that are unique to each area (group by) - //TODO: One day when we have more plugin controllers, we will need to do a group by on ALL of them to pass into the ctor of PluginControllerArea - var pluginSurfaceControlleres = surfaceControllers.Where(x => !PluginController.GetMetadata(x).AreaName.IsNullOrWhiteSpace()); + var pluginSurfaceControlleres = pluginControllers.Where(x => !PluginController.GetMetadata(x).AreaName.IsNullOrWhiteSpace()); var groupedAreas = pluginSurfaceControlleres.GroupBy(controller => PluginController.GetMetadata(controller).AreaName); //loop through each area defined amongst the controllers foreach (var g in groupedAreas) @@ -178,7 +171,17 @@ namespace Umbraco.Web } } - + private void RouteLocalSurfaceController(Type controller, string umbracoPath) + { + var meta = PluginController.GetMetadata(controller); + var route = RouteTable.Routes.MapRoute( + string.Format("umbraco-{0}-{1}", "surface", meta.ControllerName), + umbracoPath + "/Surface/" + meta.ControllerName + "/{action}/{id}",//url to match + new { controller = meta.ControllerName, action = "Index", id = UrlParameter.Optional }, + new[] { meta.ControllerNamespace }); //look in this namespace to create the controller + route.DataTokens.Add("umbraco", "surface"); //ensure the umbraco token is set + route.DataTokens.Add("UseNamespaceFallback", false); //Don't look anywhere else except this namespace! + } /// /// Initializes all web based and core resolves @@ -212,7 +215,7 @@ namespace Umbraco.Web // the legacy 404 will run from within LookupByNotFoundHandlers below // so for the time being there is no last chance lookup - LastChanceLookupResolver.Current = new LastChanceLookupResolver(); + LastChanceLookupResolver.Current = new LastChanceLookupResolver(); DocumentLookupsResolver.Current = new DocumentLookupsResolver( //add all known resolvers in the correct order, devs can then modify this list on application startup either by binding to events From 120bdca9eb1948123955747c773ee1eebf458c32 Mon Sep 17 00:00:00 2001 From: Shannon Date: Tue, 18 Jun 2013 15:05:13 +1000 Subject: [PATCH 19/21] removed constraint names on SurfaceControllers, they don't need to be suffixed with SurfaceController, only Controller. --- .../Mvc/AreaRegistrationExtensions.cs | 16 +++++++++------- src/Umbraco.Web/Mvc/PluginControllerArea.cs | 2 +- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/src/Umbraco.Web/Mvc/AreaRegistrationExtensions.cs b/src/Umbraco.Web/Mvc/AreaRegistrationExtensions.cs index 6eec7fbe1b..d61257b760 100644 --- a/src/Umbraco.Web/Mvc/AreaRegistrationExtensions.cs +++ b/src/Umbraco.Web/Mvc/AreaRegistrationExtensions.cs @@ -7,7 +7,7 @@ using Umbraco.Core.Configuration; namespace Umbraco.Web.Mvc { - internal static class AreaRegistrationExtensions + internal static class AreaRegistrationExtensions { /// /// Creates a custom individual route for the specified controller plugin. Individual routes @@ -31,7 +31,7 @@ namespace Umbraco.Web.Mvc string umbracoTokenValue = "backoffice") { Mandate.ParameterNotNullOrEmpty(controllerName, "controllerName"); - Mandate.ParameterNotNullOrEmpty(controllerSuffixName, "controllerSuffixName"); + Mandate.ParameterNotNull(controllerSuffixName, "controllerSuffixName"); Mandate.ParameterNotNullOrEmpty(defaultAction, "defaultAction"); Mandate.ParameterNotNull(controllerType, "controllerType"); Mandate.ParameterNotNull(routes, "routes"); @@ -63,13 +63,15 @@ namespace Umbraco.Web.Mvc //Don't look anywhere else except this namespace! controllerPluginRoute.DataTokens.Add("UseNamespaceFallback", false); - //constraints: only match controllers ending with 'controllerSuffixName' and only match this controller's ID for this route - controllerPluginRoute.Constraints = new RouteValueDictionary( - new Dictionary + //constraints: only match controllers ending with 'controllerSuffixName' and only match this controller's ID for this route + if (controllerSuffixName.IsNullOrWhiteSpace() == false) + { + controllerPluginRoute.Constraints = new RouteValueDictionary( + new Dictionary { { "controller", @"(\w+)" + controllerSuffixName } - }); - + }); + } //match this area controllerPluginRoute.DataTokens.Add("area", area.AreaName); diff --git a/src/Umbraco.Web/Mvc/PluginControllerArea.cs b/src/Umbraco.Web/Mvc/PluginControllerArea.cs index 591d53480a..a8b6725534 100644 --- a/src/Umbraco.Web/Mvc/PluginControllerArea.cs +++ b/src/Umbraco.Web/Mvc/PluginControllerArea.cs @@ -67,7 +67,7 @@ namespace Umbraco.Web.Mvc { foreach (var s in surfaceControllers) { - this.RouteControllerPlugin(s.ControllerName, s.ControllerType, routes, "Surface", "Index", UrlParameter.Optional, "surface"); + this.RouteControllerPlugin(s.ControllerName, s.ControllerType, routes, "", "Index", UrlParameter.Optional, "surface"); } } } From 4143dbd02dcdf35166b1039142fa23b92308e46d Mon Sep 17 00:00:00 2001 From: Shannon Date: Tue, 18 Jun 2013 15:20:18 +1000 Subject: [PATCH 20/21] Fixed some merge issues --- src/Umbraco.Web/WebBootManager.cs | 2 -- .../umbraco.presentation/umbraco/Trees/loadPackages.cs | 1 + 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/src/Umbraco.Web/WebBootManager.cs b/src/Umbraco.Web/WebBootManager.cs index a796b70e62..830fe35cdd 100644 --- a/src/Umbraco.Web/WebBootManager.cs +++ b/src/Umbraco.Web/WebBootManager.cs @@ -227,8 +227,6 @@ namespace Umbraco.Web string.Format("umbraco-{0}-{1}", "surface", meta.ControllerName), umbracoPath + "/Surface/" + meta.ControllerName + "/{action}/{id}",//url to match new { controller = meta.ControllerName, action = "Index", id = UrlParameter.Optional }, - //NOTE: There SHOULD be a constraint here to only match controllers with a "SurfaceController" suffix but we forgot to include it in the - // 4.10 release so we can't include it now :( new[] { meta.ControllerNamespace }); //look in this namespace to create the controller route.DataTokens.Add("umbraco", "surface"); //ensure the umbraco token is set //make it use our custom/special SurfaceMvcHandler diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/Trees/loadPackages.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/Trees/loadPackages.cs index bb9401a8f9..cbdc3f0a90 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/Trees/loadPackages.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/Trees/loadPackages.cs @@ -8,6 +8,7 @@ using umbraco.businesslogic; using umbraco.cms.businesslogic.packager; using umbraco.cms.presentation.Trees; using Umbraco.Core; +using umbraco.interfaces; namespace umbraco { From f7c474ac2c539af2d61b3eb5cc0c3e50f6a30efd Mon Sep 17 00:00:00 2001 From: Shannon Date: Tue, 18 Jun 2013 15:24:44 +1000 Subject: [PATCH 21/21] fixed merge issue and ensures UseNamespaceFallback are set for plugin controllers. --- src/Umbraco.Web/WebBootManager.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Umbraco.Web/WebBootManager.cs b/src/Umbraco.Web/WebBootManager.cs index 830fe35cdd..94384aaca4 100644 --- a/src/Umbraco.Web/WebBootManager.cs +++ b/src/Umbraco.Web/WebBootManager.cs @@ -218,6 +218,7 @@ namespace Umbraco.Web route.DataTokens = new RouteValueDictionary(); } route.DataTokens.Add("Namespaces", new[] {meta.ControllerNamespace}); //look in this namespace to create the controller + route.DataTokens.Add("UseNamespaceFallback", false); //Don't look anywhere else except this namespace! route.DataTokens.Add("umbraco", "api"); //ensure the umbraco token is set } private void RouteLocalSurfaceController(Type controller, string umbracoPath) @@ -229,6 +230,7 @@ namespace Umbraco.Web new { controller = meta.ControllerName, action = "Index", id = UrlParameter.Optional }, new[] { meta.ControllerNamespace }); //look in this namespace to create the controller route.DataTokens.Add("umbraco", "surface"); //ensure the umbraco token is set + route.DataTokens.Add("UseNamespaceFallback", false); //Don't look anywhere else except this namespace! //make it use our custom/special SurfaceMvcHandler route.RouteHandler = new SurfaceRouteHandler(); }