From 9eea46b19b88341306c44653fcabd3c3201b2126 Mon Sep 17 00:00:00 2001 From: Casey Neehouse Date: Thu, 29 Nov 2012 21:27:42 +0500 Subject: [PATCH 01/11] Modification of UserControl usage to allow for Virtual Path to be used correctly. --- .../config/restExtensions.config | 10 ++++---- .../config/xsltExtensions.config | 24 +++++++++++-------- src/Umbraco.Web/umbraco.presentation/macro.cs | 10 +++++++- .../developer/Macros/editMacro.aspx.cs | 4 ++-- .../usercontrolDataEditor.cs | 7 ++++++ .../userControlWrapper/usercontrolDataType.cs | 2 +- .../usercontrolPrevalueEditor.cs | 7 +++--- 7 files changed, 42 insertions(+), 22 deletions(-) diff --git a/src/Umbraco.Web.UI/config/restExtensions.config b/src/Umbraco.Web.UI/config/restExtensions.config index 7c022a4267..42a64b14b1 100644 --- a/src/Umbraco.Web.UI/config/restExtensions.config +++ b/src/Umbraco.Web.UI/config/restExtensions.config @@ -2,8 +2,8 @@ - - + + @@ -11,9 +11,9 @@ - - - + + + diff --git a/src/Umbraco.Web.UI/config/xsltExtensions.config b/src/Umbraco.Web.UI/config/xsltExtensions.config index 17962f8205..354f37fd64 100644 --- a/src/Umbraco.Web.UI/config/xsltExtensions.config +++ b/src/Umbraco.Web.UI/config/xsltExtensions.config @@ -1,11 +1,15 @@ - + - - - - - - - - - + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/Umbraco.Web/umbraco.presentation/macro.cs b/src/Umbraco.Web/umbraco.presentation/macro.cs index 7bca6df326..ffdd59879a 100644 --- a/src/Umbraco.Web/umbraco.presentation/macro.cs +++ b/src/Umbraco.Web/umbraco.presentation/macro.cs @@ -1419,7 +1419,15 @@ namespace umbraco Debug.Assert(pageElements != null, "pageElements cannot be null"); try { - string userControlPath = @"~/" + fileName; + string userControlPath = fileName; + + if (!userControlPath.StartsWith("~")) + { + if (userControlPath.StartsWith("/")) + userControlPath = "~" + userControlPath; + else + userControlPath = "~/" + userControlPath; + } if (!File.Exists(IOHelper.MapPath(userControlPath))) return new LiteralControl(string.Format("UserControl {0} does not exist.", fileName)); diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/developer/Macros/editMacro.aspx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/developer/Macros/editMacro.aspx.cs index 41eb408161..8ef7995f36 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/developer/Macros/editMacro.aspx.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/developer/Macros/editMacro.aspx.cs @@ -308,12 +308,12 @@ namespace umbraco.cms.presentation.developer { DirectoryInfo di = new DirectoryInfo(path); - string rootDir = IOHelper.MapPath(SystemDirectories.Root); + string rootDir = IOHelper.MapPath(SystemDirectories.Usercontrols); foreach (FileInfo uc in di.GetFiles("*.ascx")) { userControlList.Items.Add( - new ListItem( + new ListItem(SystemDirectories.Usercontrols + uc.FullName.Substring(rootDir.Length).Replace(IOHelper.DirSepChar, '/'))); /* uc.FullName.IndexOf(usercontrolsDir), diff --git a/src/umbraco.editorControls/userControlWrapper/usercontrolDataEditor.cs b/src/umbraco.editorControls/userControlWrapper/usercontrolDataEditor.cs index 8e1831ea50..fedc5465f8 100644 --- a/src/umbraco.editorControls/userControlWrapper/usercontrolDataEditor.cs +++ b/src/umbraco.editorControls/userControlWrapper/usercontrolDataEditor.cs @@ -60,6 +60,13 @@ namespace umbraco.editorControls.userControlGrapper { base.OnInit (e); + if (!_usercontrolPath.StartsWith("~")) + { + if (_usercontrolPath.StartsWith("/")) + _usercontrolPath = "~" + _usercontrolPath; + else + _usercontrolPath = "~/" + _usercontrolPath; + } Control oControl = new System.Web.UI.UserControl().LoadControl(_usercontrolPath); if (HasSettings(oControl.GetType())) diff --git a/src/umbraco.editorControls/userControlWrapper/usercontrolDataType.cs b/src/umbraco.editorControls/userControlWrapper/usercontrolDataType.cs index b9d99982ce..45fcd2047b 100644 --- a/src/umbraco.editorControls/userControlWrapper/usercontrolDataType.cs +++ b/src/umbraco.editorControls/userControlWrapper/usercontrolDataType.cs @@ -42,7 +42,7 @@ namespace umbraco.editorControls.userControlGrapper public override string DataTypeName { - get { return "umbraco usercontrol wrapper"; } + get { return "Umbraco Usercontrol Wrapper"; } } public override umbraco.interfaces.IDataPrevalue PrevalueEditor diff --git a/src/umbraco.editorControls/userControlWrapper/usercontrolPrevalueEditor.cs b/src/umbraco.editorControls/userControlWrapper/usercontrolPrevalueEditor.cs index 5e40494258..3b2ce64443 100644 --- a/src/umbraco.editorControls/userControlWrapper/usercontrolPrevalueEditor.cs +++ b/src/umbraco.editorControls/userControlWrapper/usercontrolPrevalueEditor.cs @@ -76,14 +76,15 @@ namespace umbraco.editorControls.userControlGrapper private void populateUserControls(string path) { DirectoryInfo di = new DirectoryInfo(path); + foreach (FileInfo uc in di.GetFiles("*.ascx")) { - string root = IOHelper.MapPath(SystemDirectories.Root); + string ucRoot = IOHelper.MapPath(SystemDirectories.Usercontrols); _dropdownlistUserControl.Items.Add( - new ListItem( - uc.FullName.Substring(root.Length).Replace(IOHelper.DirSepChar, '/')) + new ListItem( SystemDirectories.Usercontrols + + uc.FullName.Substring(ucRoot.Length).Replace(IOHelper.DirSepChar, '/')) /* new ListItem( From 3bd98d851ad0daf5f8bf2d887291a596a072ded0 Mon Sep 17 00:00:00 2001 From: Casey Neehouse Date: Thu, 29 Nov 2012 21:42:37 +0500 Subject: [PATCH 02/11] Reverting the config files that inadvertently got committed. --- .../config/restExtensions.config | 30 +++++++++---------- .../config/xsltExtensions.config | 24 +++++++-------- 2 files changed, 25 insertions(+), 29 deletions(-) diff --git a/src/Umbraco.Web.UI/config/restExtensions.config b/src/Umbraco.Web.UI/config/restExtensions.config index 42a64b14b1..f451683297 100644 --- a/src/Umbraco.Web.UI/config/restExtensions.config +++ b/src/Umbraco.Web.UI/config/restExtensions.config @@ -2,19 +2,19 @@ - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/Umbraco.Web.UI/config/xsltExtensions.config b/src/Umbraco.Web.UI/config/xsltExtensions.config index 354f37fd64..17962f8205 100644 --- a/src/Umbraco.Web.UI/config/xsltExtensions.config +++ b/src/Umbraco.Web.UI/config/xsltExtensions.config @@ -1,15 +1,11 @@ - + - - - - - - - - - - - - - \ No newline at end of file + + + + + + + + + From ca62b3aedb42bc0c9a255ea157d1b47e57cef508 Mon Sep 17 00:00:00 2001 From: Shannon Deminick Date: Mon, 3 Dec 2012 03:21:07 +0500 Subject: [PATCH 03/11] adds umb favicon to installer and back office. This also ensures it doesn't get overridden by package files (some do that). --- src/Umbraco.Web.UI/config/splashes/noNodes.aspx | 2 +- src/Umbraco.Web.UI/install/default.aspx | 6 ++++-- src/Umbraco.Web.UI/umbraco/umbraco.aspx | 1 + 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/Umbraco.Web.UI/config/splashes/noNodes.aspx b/src/Umbraco.Web.UI/config/splashes/noNodes.aspx index 640bb0229f..49ef40210c 100644 --- a/src/Umbraco.Web.UI/config/splashes/noNodes.aspx +++ b/src/Umbraco.Web.UI/config/splashes/noNodes.aspx @@ -11,7 +11,7 @@ <%=UmbracoVersion.Current.ToString(3)%> - no pages found - + " /> diff --git a/src/Umbraco.Web.UI/install/default.aspx b/src/Umbraco.Web.UI/install/default.aspx index e34a8bab43..2d0acda187 100644 --- a/src/Umbraco.Web.UI/install/default.aspx +++ b/src/Umbraco.Web.UI/install/default.aspx @@ -11,10 +11,12 @@ + + " /> - + - + diff --git a/src/Umbraco.Web.UI/umbraco/umbraco.aspx b/src/Umbraco.Web.UI/umbraco/umbraco.aspx index 7822e7167d..3d3d911bd6 100644 --- a/src/Umbraco.Web.UI/umbraco/umbraco.aspx +++ b/src/Umbraco.Web.UI/umbraco/umbraco.aspx @@ -13,6 +13,7 @@ Umbraco CMS - <%=Request.Url.Host.ToLower().Replace("www.", "") %> + " /> From 24dc6abcc0453de91954324f2c14de2ec74a3517 Mon Sep 17 00:00:00 2001 From: Shannon Deminick Date: Mon, 3 Dec 2012 05:43:31 +0500 Subject: [PATCH 04/11] Fixed folder casing in the UI project for all folders (except the Umbraco_Client one which will be in the next commit). Now, VS thinks that all folders in the UI project are properly cased even though on the file system they are not. This means that any webforms classes that are created in the UI project will automatically have the correct namespace casing. --- src/Umbraco.Web.UI/Umbraco.Web.UI.csproj | 3604 +++++++++++----------- 1 file changed, 1793 insertions(+), 1811 deletions(-) diff --git a/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj b/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj index 906e0070c4..59fb4b11f3 100644 --- a/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj +++ b/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj @@ -1,4 +1,3 @@ - @@ -8,13 +7,10 @@ {E53F8FEA-EAE0-44A6-8774-FFD645390401};{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} Debug AnyCPU - - - - + + Umbraco.Web.UI - - + JScript Grid IE50 @@ -22,20 +18,13 @@ Library Umbraco.Web.UI OnBuildSuccess - - - - - - - - - - - - - - + + + + + + + 4.0 v4.0 @@ -52,16 +41,13 @@ false 285212672 false - - + DEBUG;TRACE - - + true 4096 false - - + false false false @@ -76,16 +62,13 @@ false 285212672 false - - + TRACE - - + false 4096 false - - + true false false @@ -243,49 +226,50 @@ Properties\SolutionInfo.cs - + + default.aspx ASPXCodeBehind - + default.aspx - + loadStarterKitDesigns.ascx ASPXCodeBehind - + loadStarterKitDesigns.ascx - + ASPXCodeBehind - + loadStarterKits.ascx - + ASPXCodeBehind - + editMacro.aspx - + StarterKits.aspx ASPXCodeBehind - + StarterKits.aspx - + ASPXCodeBehind - + umbracoDialog.Master - + ASPXCodeBehind - + umbracoPage.Master @@ -295,17 +279,17 @@ QuickSearch.ascx - + ASPXCodeBehind - + editTemplate.aspx - + EditView.aspx ASPXCodeBehind - + EditView.aspx @@ -322,1415 +306,1415 @@ Umbraco.aspx - - - + + + 404handlers.config - + ClientDependency.config Designer - + Designer - + BaseRestExtensions.config - + log4net.config - + FileSystemProviders.config - + EmbeddedMedia.config - + xsltExtensions.config - + UrlRewriting.config - + umbracoSettings.config - + trees.config - + tinyMceConfig.config - + Skinning.config - + scripting.config - + restExtensions.config - + metablogConfig.config - + ExamineSettings.config - + feedProxy.config - + ExamineIndex.config - + Dashboard.config - + UI.xml - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + jquery.tagsinput.js - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - + + + + + + + + - + - - - - - + + + + + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + UserControl - + UserControl - + UserControl - + UserControl - - + + Designer - - - - - - - - - - + + + + + + + + + + @@ -1743,34 +1727,34 @@ - - - - - - + + + + + + Designer - - - - - - - - - + + + + + + + + + applications.config Designer - - - - - - - - + + + + + + + + Web.Template.config @@ -1780,437 +1764,437 @@ Web.Template.config Designer - + - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - + + + - - + + UserControl - - - + + + UserControl - - + + UserControl - - - - + + + + - + - - - - - - - - - + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Form - - + + Form - + Form - - - - - - - - - + + + + + + + + + - - + + - - + + Form - - - - - - + + + + + + Form - - + + Form - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - + + + + + + Designer - - - - + + + + Designer - - - - - - - + + + + + + + Designer @@ -2219,15 +2203,15 @@ - - - - - - - - - + + + + + + + + + 10.0 @@ -2235,8 +2219,7 @@ - - + xcopy "$(ProjectDir)"..\packages\SqlServerCE.4.0.0.0\amd64\*.* "$(TargetDir)amd64\" /Y /F /E /D xcopy "$(ProjectDir)"..\packages\SqlServerCE.4.0.0.0\x86\*.* "$(TargetDir)x86\" /Y /F /E /D @@ -2253,8 +2236,7 @@ xcopy "$(ProjectDir)"..\packages\SqlServerCE.4.0.0.0\x86\*.* "$(TargetDir)x86\" http://localhost:61638/ False False - - + False From 41acb091eb710df6c15e9df49eb15d90bcc25cd3 Mon Sep 17 00:00:00 2001 From: Shannon Deminick Date: Mon, 3 Dec 2012 05:58:27 +0500 Subject: [PATCH 05/11] Updated the Umbraco_Client folder casing in the UI project. All folders are now properly cased in the UI proj. --- src/Umbraco.Web.UI/Umbraco.Web.UI.csproj | 2016 +++++++++++----------- 1 file changed, 1008 insertions(+), 1008 deletions(-) diff --git a/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj b/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj index 59fb4b11f3..1c69096a78 100644 --- a/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj +++ b/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj @@ -429,774 +429,774 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - - - - - - - - - - - - - + + + + + + + + + + + + + jquery.tagsinput.js - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -1211,109 +1211,109 @@ - - - - - + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -1368,43 +1368,43 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - + + + + + + + @@ -1425,10 +1425,10 @@ - - - - + + + + @@ -1445,9 +1445,9 @@ - - - + + + @@ -1476,22 +1476,22 @@ - - - - - - - - + + + + + + + + - - - + + + @@ -1514,32 +1514,32 @@ - - + + - - + + - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + @@ -1552,7 +1552,7 @@ - + @@ -1572,13 +1572,13 @@ - - + + - - + + @@ -1747,14 +1747,14 @@ applications.config Designer - - - - - - - - + + + + + + + + Web.Template.config @@ -1792,7 +1792,7 @@ - + @@ -1962,7 +1962,7 @@ - + @@ -1976,7 +1976,7 @@ - + @@ -2110,67 +2110,67 @@ - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From 40e7b9bc0a44910c84187c0ed3d11a3a6b4c63e0 Mon Sep 17 00:00:00 2001 From: Sebastiaan Janssen Date: Mon, 3 Dec 2012 11:49:09 -0100 Subject: [PATCH 06/11] Fix the DB creation and population (tested only on SQL CE so far) --- .../Models/Rdbms/ContentXmlDto.cs | 6 +- .../Models/Rdbms/DataTypePreValueDto.cs | 2 +- src/Umbraco.Core/Models/Rdbms/DocumentDto.cs | 2 +- src/Umbraco.Core/Models/Rdbms/TaskDto.cs | 2 +- .../Migrations/Initial/BaseDataCreation.cs | 70 +++++++++++++------ .../Routing/LookupByAliasTests.cs | 8 +++ 6 files changed, 64 insertions(+), 26 deletions(-) diff --git a/src/Umbraco.Core/Models/Rdbms/ContentXmlDto.cs b/src/Umbraco.Core/Models/Rdbms/ContentXmlDto.cs index f6487a8fb3..9cb1da238d 100644 --- a/src/Umbraco.Core/Models/Rdbms/ContentXmlDto.cs +++ b/src/Umbraco.Core/Models/Rdbms/ContentXmlDto.cs @@ -1,4 +1,5 @@ -using Umbraco.Core.Persistence; +using System.Data; +using Umbraco.Core.Persistence; using Umbraco.Core.Persistence.DatabaseAnnotations; namespace Umbraco.Core.Models.Rdbms @@ -10,10 +11,11 @@ namespace Umbraco.Core.Models.Rdbms { [Column("nodeId")] [PrimaryKeyColumn(AutoIncrement = false)] - [ForeignKey(typeof(ContentDto))] + //[ForeignKey(typeof(ContentDto))] public int NodeId { get; set; } [Column("xml")] + [SpecialDbType(SpecialDbTypes.NTEXT)] public string Xml { get; set; } } } \ No newline at end of file diff --git a/src/Umbraco.Core/Models/Rdbms/DataTypePreValueDto.cs b/src/Umbraco.Core/Models/Rdbms/DataTypePreValueDto.cs index 4f19d60abd..deb23a00c9 100644 --- a/src/Umbraco.Core/Models/Rdbms/DataTypePreValueDto.cs +++ b/src/Umbraco.Core/Models/Rdbms/DataTypePreValueDto.cs @@ -13,7 +13,7 @@ namespace Umbraco.Core.Models.Rdbms public int Id { get; set; } [Column("datatypeNodeId")] - [ForeignKey(typeof(DataTypeDto), Column = "nodeId")] + //[ForeignKey(typeof(DataTypeDto), Column = "nodeId")] public int DataTypeNodeId { get; set; } [Column("value")] diff --git a/src/Umbraco.Core/Models/Rdbms/DocumentDto.cs b/src/Umbraco.Core/Models/Rdbms/DocumentDto.cs index 59391c6551..4eda74dcc9 100644 --- a/src/Umbraco.Core/Models/Rdbms/DocumentDto.cs +++ b/src/Umbraco.Core/Models/Rdbms/DocumentDto.cs @@ -42,7 +42,7 @@ namespace Umbraco.Core.Models.Rdbms [Column("templateId")] [NullSetting(NullSetting = NullSettings.Null)] - [ForeignKey(typeof(TemplateDto))] + //[ForeignKey(typeof(TemplateDto))] public int? TemplateId { get; set; } [Column("alias")] diff --git a/src/Umbraco.Core/Models/Rdbms/TaskDto.cs b/src/Umbraco.Core/Models/Rdbms/TaskDto.cs index 4c38197d67..41fb59c380 100644 --- a/src/Umbraco.Core/Models/Rdbms/TaskDto.cs +++ b/src/Umbraco.Core/Models/Rdbms/TaskDto.cs @@ -18,7 +18,7 @@ namespace Umbraco.Core.Models.Rdbms public int Id { get; set; } [Column("taskTypeId")] - [ForeignKey(typeof(TaskTypeDto))] + //[ForeignKey(typeof(TaskTypeDto))] public byte TaskTypeId { get; set; } [Column("nodeId")] diff --git a/src/Umbraco.Core/Persistence/Migrations/Initial/BaseDataCreation.cs b/src/Umbraco.Core/Persistence/Migrations/Initial/BaseDataCreation.cs index 5bc4074432..e0fc83eec9 100644 --- a/src/Umbraco.Core/Persistence/Migrations/Initial/BaseDataCreation.cs +++ b/src/Umbraco.Core/Persistence/Migrations/Initial/BaseDataCreation.cs @@ -77,10 +77,19 @@ namespace Umbraco.Core.Persistence.Migrations.Initial CreateCmsDataTypeData(); } + if (tableName.Equals("cmsDataTypePreValues")) + { + CreateCmsDataTypePreValuesData(); + } + if (tableName.Equals("umbracoRelationType")) { CreateUmbracoRelationTypeData(); } + if (tableName.Equals("cmsTaskType")) + { + CreateCmsTaskTypeData(); + } } private void CreateUmbracNodeData() @@ -127,8 +136,8 @@ namespace Umbraco.Core.Persistence.Migrations.Initial private void CreateCmsContentTypeData() { _database.Insert(new ContentTypeDto { PrimaryKey = 532, NodeId = 1031, Alias = "Folder", Icon = "folder.gif", Thumbnail = "folder.png", IsContainer = true, AllowAtRoot = true }); - _database.Insert(new ContentTypeDto { PrimaryKey = 533, NodeId = 1032, Alias = "Image", Icon = "mediaPhoto.gif", Thumbnail = "folder.png" }); - _database.Insert(new ContentTypeDto { PrimaryKey = 534, NodeId = 1033, Alias = "File", Icon = "mediaFile.gif", Thumbnail = "folder.png" }); + _database.Insert(new ContentTypeDto { PrimaryKey = 533, NodeId = 1032, Alias = "Image", Icon = "mediaPhoto.gif", Thumbnail = "mediaPhoto.png" }); + _database.Insert(new ContentTypeDto { PrimaryKey = 534, NodeId = 1033, Alias = "File", Icon = "mediaFile.gif", Thumbnail = "mediaFile.png" }); } private void CreateUmbracoUserData() @@ -285,7 +294,32 @@ namespace Umbraco.Core.Persistence.Migrations.Initial } private void CreateCmsDataTypePreValuesData() - {} + { + using (var transaction = _database.GetTransaction()) + { + _database.Execute(new Sql("SET IDENTITY_INSERT [cmsDataTypePreValues] ON ")); + _database.Insert("cmsDataTypePreValues", "id", false, + new DataTypePreValueDto + { + Id = 3, + Alias = "", + SortOrder = 0, + DataTypeNodeId = -87, + Value = ",code,undo,redo,cut,copy,mcepasteword,stylepicker,bold,italic,bullist,numlist,outdent,indent,mcelink,unlink,mceinsertanchor,mceimage,umbracomacro,mceinserttable,umbracoembed,mcecharmap,' + char(124) + '1' + char(124) + '1,2,3,' + char(124) + '0' + char(124) + '500,400' + char(124) + '1049,' + char(124) + 'true' + char(124) + '" + }); + _database.Insert("cmsDataTypePreValues", "id", false, new DataTypePreValueDto + { + Id = 4, + Alias = "group", + SortOrder = 0, + DataTypeNodeId = 1041, + Value = "default" + }); + _database.Execute(new Sql("SET IDENTITY_INSERT [cmsDataTypePreValues] OFF;")); + + transaction.Complete(); + } + } private void CreateUmbracoRelationTypeData() { @@ -309,24 +343,18 @@ namespace Umbraco.Core.Persistence.Migrations.Initial } private void CreateCmsTaskTypeData() - { } + { + //TODO: It tries to do an identity insert it seems, why? Error: The column cannot be modified. [ Column name = id ] + //using (var transaction = _database.GetTransaction()) + //{ + // _database.Insert("cmsTaskType", "id", false, + // new TaskTypeDto + // { + // Alias = "toTranslate" + // }); - /* - - * SET IDENTITY_INSERT [cmsDataTypePreValues] ON -insert into cmsDataTypePreValues (id, dataTypeNodeId, [value], sortorder, alias) -values (3,-87,',code,undo,redo,cut,copy,mcepasteword,stylepicker,bold,italic,bullist,numlist,outdent,indent,mcelink,unlink,mceinsertanchor,mceimage,umbracomacro,mceinserttable,umbracoembed,mcecharmap,' + char(124) + '1' + char(124) + '1,2,3,' + char(124) + '0' + char(124) + '500,400' + char(124) + '1049,' + char(124) + 'true' + char(124) + '', 0, '') - -insert into cmsDataTypePreValues (id, dataTypeNodeId, [value], sortorder, alias) -values (4,1041,'default', 0, 'group') - -SET IDENTITY_INSERT [cmsDataTypePreValues] OFF -; - - * - * - - insert into cmsTaskType (alias) values ('toTranslate'); - */ + // transaction.Complete(); + //} + } } } \ No newline at end of file diff --git a/src/Umbraco.Tests/Routing/LookupByAliasTests.cs b/src/Umbraco.Tests/Routing/LookupByAliasTests.cs index 3f0667ee97..975ab16cbf 100644 --- a/src/Umbraco.Tests/Routing/LookupByAliasTests.cs +++ b/src/Umbraco.Tests/Routing/LookupByAliasTests.cs @@ -15,6 +15,14 @@ namespace Umbraco.Tests.Routing Umbraco.Core.Configuration.UmbracoSettings.UseLegacyXmlSchema = false; } + /// + /// We don't need a db for this test, will run faster without one + /// + protected override bool RequiresDbSetup + { + get { return false; } + } + [TestCase("/this/is/my/alias", 1046)] [TestCase("/anotheralias", 1046)] [TestCase("/page2/alias", 1173)] From bbd88be00b1b707f0f8dd9b488db14229af68901 Mon Sep 17 00:00:00 2001 From: Sebastiaan Janssen Date: Fri, 30 Nov 2012 08:00:04 -0100 Subject: [PATCH 07/11] LookupByAliasTests didn't require a DB after all --- src/Umbraco.Tests/Routing/LookupByAliasTests.cs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/Umbraco.Tests/Routing/LookupByAliasTests.cs b/src/Umbraco.Tests/Routing/LookupByAliasTests.cs index 975ab16cbf..d1aa2ddc47 100644 --- a/src/Umbraco.Tests/Routing/LookupByAliasTests.cs +++ b/src/Umbraco.Tests/Routing/LookupByAliasTests.cs @@ -23,6 +23,14 @@ namespace Umbraco.Tests.Routing get { return false; } } + /// + /// We don't need a db for this test, will run faster without one + /// + protected override bool RequiresDbSetup + { + get { return false; } + } + [TestCase("/this/is/my/alias", 1046)] [TestCase("/anotheralias", 1046)] [TestCase("/page2/alias", 1173)] From 4f373541ac1b6947e83e8cfbbff5219e07238f72 Mon Sep 17 00:00:00 2001 From: Sebastiaan Janssen Date: Mon, 3 Dec 2012 11:57:28 -0100 Subject: [PATCH 08/11] Accidentally added TWO RequiredDbSetup properties --- src/Umbraco.Tests/Routing/LookupByAliasTests.cs | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/src/Umbraco.Tests/Routing/LookupByAliasTests.cs b/src/Umbraco.Tests/Routing/LookupByAliasTests.cs index d1aa2ddc47..f8a72c5c7c 100644 --- a/src/Umbraco.Tests/Routing/LookupByAliasTests.cs +++ b/src/Umbraco.Tests/Routing/LookupByAliasTests.cs @@ -1,8 +1,6 @@ using NUnit.Framework; using Umbraco.Tests.TestHelpers; using Umbraco.Web.Routing; -using umbraco.BusinessLogic; -using umbraco.cms.businesslogic.template; namespace Umbraco.Tests.Routing { @@ -12,18 +10,10 @@ namespace Umbraco.Tests.Routing public override void Initialize() { base.Initialize(); - Umbraco.Core.Configuration.UmbracoSettings.UseLegacyXmlSchema = false; + Core.Configuration.UmbracoSettings.UseLegacyXmlSchema = false; } - - /// - /// We don't need a db for this test, will run faster without one - /// - protected override bool RequiresDbSetup - { - get { return false; } - } - - /// + + /// /// We don't need a db for this test, will run faster without one /// protected override bool RequiresDbSetup From b02ad9e6985cf01f2372af533d9d1c082e0b5fe7 Mon Sep 17 00:00:00 2001 From: Sebastiaan Janssen Date: Mon, 3 Dec 2012 13:22:23 -0100 Subject: [PATCH 09/11] Remove foreign keys that never used to be in 4.x. Fix the datacreation of CmsTaskTypeData --- src/Umbraco.Core/Models/Rdbms/AppTreeDto.cs | 2 +- src/Umbraco.Core/Models/Rdbms/DataTypeDto.cs | 1 - .../Models/Rdbms/DocumentTypeDto.cs | 3 --- src/Umbraco.Core/Models/Rdbms/DomainDto.cs | 1 - .../Models/Rdbms/MacroPropertyDto.cs | 1 - .../Models/Rdbms/Member2MemberGroupDto.cs | 2 -- src/Umbraco.Core/Models/Rdbms/MemberDto.cs | 2 -- .../Models/Rdbms/MemberTypeDto.cs | 2 -- .../Models/Rdbms/PropertyDataDto.cs | 2 +- .../Models/Rdbms/PropertyTypeGroupDto.cs | 2 -- src/Umbraco.Core/Models/Rdbms/RelationDto.cs | 3 --- .../Models/Rdbms/StylesheetDto.cs | 1 - .../Models/Rdbms/TagRelationshipDto.cs | 2 -- src/Umbraco.Core/Models/Rdbms/TaskDto.cs | 5 +--- src/Umbraco.Core/Models/Rdbms/TemplateDto.cs | 1 - .../Models/Rdbms/User2NodeNotifyDto.cs | 2 -- .../Models/Rdbms/User2NodePermissionDto.cs | 2 -- .../Migrations/Initial/BaseDataCreation.cs | 25 +++++++++++-------- 18 files changed, 17 insertions(+), 42 deletions(-) diff --git a/src/Umbraco.Core/Models/Rdbms/AppTreeDto.cs b/src/Umbraco.Core/Models/Rdbms/AppTreeDto.cs index cab38fa201..1667486ca9 100644 --- a/src/Umbraco.Core/Models/Rdbms/AppTreeDto.cs +++ b/src/Umbraco.Core/Models/Rdbms/AppTreeDto.cs @@ -17,7 +17,7 @@ namespace Umbraco.Core.Models.Rdbms public bool Initialize { get; set; } [Column("treeSortOrder")] - public byte SortOrder { get; set; } + public int SortOrder { get; set; } [Column("appAlias")] [PrimaryKeyColumn(AutoIncrement = false, Clustered = true, Name = "PK_umbracoAppTree", OnColumns = "[appAlias], [treeAlias]")] diff --git a/src/Umbraco.Core/Models/Rdbms/DataTypeDto.cs b/src/Umbraco.Core/Models/Rdbms/DataTypeDto.cs index 66d2f059f2..db678dd3a1 100644 --- a/src/Umbraco.Core/Models/Rdbms/DataTypeDto.cs +++ b/src/Umbraco.Core/Models/Rdbms/DataTypeDto.cs @@ -14,7 +14,6 @@ namespace Umbraco.Core.Models.Rdbms public int PrimaryKey { get; set; } [Column("nodeId")] - [ForeignKey(typeof(NodeDto))] [Index(IndexTypes.UniqueNonClustered)] public int DataTypeId { get; set; } diff --git a/src/Umbraco.Core/Models/Rdbms/DocumentTypeDto.cs b/src/Umbraco.Core/Models/Rdbms/DocumentTypeDto.cs index 7fbf15f00f..09f3a03461 100644 --- a/src/Umbraco.Core/Models/Rdbms/DocumentTypeDto.cs +++ b/src/Umbraco.Core/Models/Rdbms/DocumentTypeDto.cs @@ -10,12 +10,9 @@ namespace Umbraco.Core.Models.Rdbms { [Column("contentTypeNodeId")] [PrimaryKeyColumn(AutoIncrement = false, Name = "PK_cmsDocumentType", OnColumns = "contentTypeNodeId, templateNodeId")] - [ForeignKey(typeof(ContentTypeDto), Column = "nodeId")] - [ForeignKey(typeof(NodeDto))] public int ContentTypeNodeId { get; set; } [Column("templateNodeId")] - /*[ForeignKey(typeof(TemplateDto))]*/ public int TemplateNodeId { get; set; } [Column("IsDefault")] diff --git a/src/Umbraco.Core/Models/Rdbms/DomainDto.cs b/src/Umbraco.Core/Models/Rdbms/DomainDto.cs index bd0bbc859c..e462007ca2 100644 --- a/src/Umbraco.Core/Models/Rdbms/DomainDto.cs +++ b/src/Umbraco.Core/Models/Rdbms/DomainDto.cs @@ -18,7 +18,6 @@ namespace Umbraco.Core.Models.Rdbms [Column("domainRootStructureID")] [NullSetting(NullSetting = NullSettings.Null)] - [ForeignKey(typeof(NodeDto))] public int? RootStructureId { get; set; } [Column("domainName")] diff --git a/src/Umbraco.Core/Models/Rdbms/MacroPropertyDto.cs b/src/Umbraco.Core/Models/Rdbms/MacroPropertyDto.cs index 729d0d97f3..8387da2581 100644 --- a/src/Umbraco.Core/Models/Rdbms/MacroPropertyDto.cs +++ b/src/Umbraco.Core/Models/Rdbms/MacroPropertyDto.cs @@ -21,7 +21,6 @@ namespace Umbraco.Core.Models.Rdbms public short Type { get; set; } [Column("macro")] - [ForeignKey(typeof(MacroDto))] public int Macro { get; set; } [Column("macroPropertySortOrder")] diff --git a/src/Umbraco.Core/Models/Rdbms/Member2MemberGroupDto.cs b/src/Umbraco.Core/Models/Rdbms/Member2MemberGroupDto.cs index 89e07c25ea..66855681d5 100644 --- a/src/Umbraco.Core/Models/Rdbms/Member2MemberGroupDto.cs +++ b/src/Umbraco.Core/Models/Rdbms/Member2MemberGroupDto.cs @@ -10,11 +10,9 @@ namespace Umbraco.Core.Models.Rdbms { [Column("Member")] [PrimaryKeyColumn(AutoIncrement = false, Name = "PK_cmsMember2MemberGroup", OnColumns = "[Member], [MemberGroup]")] - [ForeignKey(typeof(MemberDto))] public int Member { get; set; } [Column("MemberGroup")] - [ForeignKey(typeof(NodeDto))] public int MemberGroup { get; set; } } } \ No newline at end of file diff --git a/src/Umbraco.Core/Models/Rdbms/MemberDto.cs b/src/Umbraco.Core/Models/Rdbms/MemberDto.cs index 32e03f75d0..5d64d79283 100644 --- a/src/Umbraco.Core/Models/Rdbms/MemberDto.cs +++ b/src/Umbraco.Core/Models/Rdbms/MemberDto.cs @@ -10,8 +10,6 @@ namespace Umbraco.Core.Models.Rdbms { [Column("nodeId")] [PrimaryKeyColumn(AutoIncrement = false)] - [ForeignKey(typeof(ContentDto), Column = "nodeId")] - [ForeignKey(typeof(NodeDto))] public int NodeId { get; set; } [Column("Email")] diff --git a/src/Umbraco.Core/Models/Rdbms/MemberTypeDto.cs b/src/Umbraco.Core/Models/Rdbms/MemberTypeDto.cs index c9432652af..0791730ac9 100644 --- a/src/Umbraco.Core/Models/Rdbms/MemberTypeDto.cs +++ b/src/Umbraco.Core/Models/Rdbms/MemberTypeDto.cs @@ -13,8 +13,6 @@ namespace Umbraco.Core.Models.Rdbms public int PrimaryKey { get; set; } [Column("NodeId")] - [ForeignKey(typeof(NodeDto))] - [ForeignKey(typeof(ContentTypeDto), Column = "nodeId")] public int NodeId { get; set; } [Column("propertytypeId")] diff --git a/src/Umbraco.Core/Models/Rdbms/PropertyDataDto.cs b/src/Umbraco.Core/Models/Rdbms/PropertyDataDto.cs index f125c6eaf3..f85078e1bb 100644 --- a/src/Umbraco.Core/Models/Rdbms/PropertyDataDto.cs +++ b/src/Umbraco.Core/Models/Rdbms/PropertyDataDto.cs @@ -25,7 +25,7 @@ namespace Umbraco.Core.Models.Rdbms public Guid? VersionId { get; set; } [Column("propertytypeid")] - [ForeignKey(typeof(PropertyTypeDto))] + //[ForeignKey(typeof(PropertyTypeDto))] [Index(IndexTypes.NonClustered, Name = "IX_cmsPropertyData_3")] public int PropertyTypeId { get; set; } diff --git a/src/Umbraco.Core/Models/Rdbms/PropertyTypeGroupDto.cs b/src/Umbraco.Core/Models/Rdbms/PropertyTypeGroupDto.cs index 0bbf3a891f..61781a4285 100644 --- a/src/Umbraco.Core/Models/Rdbms/PropertyTypeGroupDto.cs +++ b/src/Umbraco.Core/Models/Rdbms/PropertyTypeGroupDto.cs @@ -15,8 +15,6 @@ namespace Umbraco.Core.Models.Rdbms [Column("parentGroupId")] [NullSetting(NullSetting = NullSettings.Null)] - //[Constraint(Default = "NULL")] - [ForeignKey(typeof(PropertyTypeGroupDto))] public int? ParentGroupId { get; set; } [Column("contenttypeNodeId")] diff --git a/src/Umbraco.Core/Models/Rdbms/RelationDto.cs b/src/Umbraco.Core/Models/Rdbms/RelationDto.cs index e204e42040..f3889dfd21 100644 --- a/src/Umbraco.Core/Models/Rdbms/RelationDto.cs +++ b/src/Umbraco.Core/Models/Rdbms/RelationDto.cs @@ -14,15 +14,12 @@ namespace Umbraco.Core.Models.Rdbms public int Id { get; set; } [Column("parentId")] - [ForeignKey(typeof(NodeDto), Name = "FK_umbracoRelation_umbracoNode")] public int ParentId { get; set; } [Column("childId")] - [ForeignKey(typeof(NodeDto), Name = "FK_umbracoRelation_umbracoNode1")] public int ChildId { get; set; } [Column("relType")] - [ForeignKey(typeof(RelationTypeDto))] public int RelationType { get; set; } [Column("datetime")] diff --git a/src/Umbraco.Core/Models/Rdbms/StylesheetDto.cs b/src/Umbraco.Core/Models/Rdbms/StylesheetDto.cs index 23ba061b9b..89165a1920 100644 --- a/src/Umbraco.Core/Models/Rdbms/StylesheetDto.cs +++ b/src/Umbraco.Core/Models/Rdbms/StylesheetDto.cs @@ -10,7 +10,6 @@ namespace Umbraco.Core.Models.Rdbms { [Column("nodeId")] [PrimaryKeyColumn(AutoIncrement = false)] - [ForeignKey(typeof(NodeDto))] public int NodeId { get; set; } [Column("filename")] diff --git a/src/Umbraco.Core/Models/Rdbms/TagRelationshipDto.cs b/src/Umbraco.Core/Models/Rdbms/TagRelationshipDto.cs index e18cbeeb12..06e2fec3d1 100644 --- a/src/Umbraco.Core/Models/Rdbms/TagRelationshipDto.cs +++ b/src/Umbraco.Core/Models/Rdbms/TagRelationshipDto.cs @@ -10,11 +10,9 @@ namespace Umbraco.Core.Models.Rdbms { [Column("nodeId")] [PrimaryKeyColumn(AutoIncrement = false, Name = "PK_cmsTagRelationship", OnColumns = "[nodeId], [tagId]")] - [ForeignKey(typeof(NodeDto))] public int NodeId { get; set; } [Column("tagId")] - [ForeignKey(typeof(TagDto))] public int TagId { get; set; } } } \ No newline at end of file diff --git a/src/Umbraco.Core/Models/Rdbms/TaskDto.cs b/src/Umbraco.Core/Models/Rdbms/TaskDto.cs index 41fb59c380..5187c601e9 100644 --- a/src/Umbraco.Core/Models/Rdbms/TaskDto.cs +++ b/src/Umbraco.Core/Models/Rdbms/TaskDto.cs @@ -18,19 +18,16 @@ namespace Umbraco.Core.Models.Rdbms public int Id { get; set; } [Column("taskTypeId")] - //[ForeignKey(typeof(TaskTypeDto))] + [ForeignKey(typeof(TaskTypeDto))] public byte TaskTypeId { get; set; } [Column("nodeId")] - [ForeignKey(typeof(NodeDto))] public int NodeId { get; set; } [Column("parentUserId")] - [ForeignKey(typeof(UserDto), Name = "FK_cmsTask_umbracoUser")] public int ParentUserId { get; set; } [Column("userId")] - [ForeignKey(typeof(UserDto), Name = "FK_cmsTask_umbracoUser1")] public int UserId { get; set; } [Column("DateTime")] diff --git a/src/Umbraco.Core/Models/Rdbms/TemplateDto.cs b/src/Umbraco.Core/Models/Rdbms/TemplateDto.cs index a68704c361..ee24e4a0a6 100644 --- a/src/Umbraco.Core/Models/Rdbms/TemplateDto.cs +++ b/src/Umbraco.Core/Models/Rdbms/TemplateDto.cs @@ -19,7 +19,6 @@ namespace Umbraco.Core.Models.Rdbms [Column("master")] [NullSetting(NullSetting = NullSettings.Null)] - /*[ForeignKey(typeof(TemplateDto), Column = "nodeId")]*/ [ForeignKey(typeof(NodeDto), Name = "FK_cmsTemplate_cmsTemplate")] public int? Master { get; set; } diff --git a/src/Umbraco.Core/Models/Rdbms/User2NodeNotifyDto.cs b/src/Umbraco.Core/Models/Rdbms/User2NodeNotifyDto.cs index 2163ca32c3..30414fd0c2 100644 --- a/src/Umbraco.Core/Models/Rdbms/User2NodeNotifyDto.cs +++ b/src/Umbraco.Core/Models/Rdbms/User2NodeNotifyDto.cs @@ -10,11 +10,9 @@ namespace Umbraco.Core.Models.Rdbms { [Column("userId")] [PrimaryKeyColumn(AutoIncrement = false, Name = "PK_umbracoUser2NodeNotify", OnColumns = "[userId], [nodeId], [action]")] - [ForeignKey(typeof(UserDto))] public int UserId { get; set; } [Column("nodeId")] - [ForeignKey(typeof(NodeDto))] public int NodeId { get; set; } [Column("action")] diff --git a/src/Umbraco.Core/Models/Rdbms/User2NodePermissionDto.cs b/src/Umbraco.Core/Models/Rdbms/User2NodePermissionDto.cs index 5ddd6dd07a..2354e887c4 100644 --- a/src/Umbraco.Core/Models/Rdbms/User2NodePermissionDto.cs +++ b/src/Umbraco.Core/Models/Rdbms/User2NodePermissionDto.cs @@ -10,11 +10,9 @@ namespace Umbraco.Core.Models.Rdbms { [Column("userId")] [PrimaryKeyColumn(AutoIncrement = false, Name = "PK_umbracoUser2NodePermission", OnColumns = "[userId], [nodeId], [permission]")] - [ForeignKey(typeof(UserDto))] public int UserId { get; set; } [Column("nodeId")] - [ForeignKey(typeof(NodeDto))] public int NodeId { get; set; } [Column("permission")] diff --git a/src/Umbraco.Core/Persistence/Migrations/Initial/BaseDataCreation.cs b/src/Umbraco.Core/Persistence/Migrations/Initial/BaseDataCreation.cs index e0fc83eec9..a7bf29b3e7 100644 --- a/src/Umbraco.Core/Persistence/Migrations/Initial/BaseDataCreation.cs +++ b/src/Umbraco.Core/Persistence/Migrations/Initial/BaseDataCreation.cs @@ -305,8 +305,9 @@ namespace Umbraco.Core.Persistence.Migrations.Initial Alias = "", SortOrder = 0, DataTypeNodeId = -87, - Value = ",code,undo,redo,cut,copy,mcepasteword,stylepicker,bold,italic,bullist,numlist,outdent,indent,mcelink,unlink,mceinsertanchor,mceimage,umbracomacro,mceinserttable,umbracoembed,mcecharmap,' + char(124) + '1' + char(124) + '1,2,3,' + char(124) + '0' + char(124) + '500,400' + char(124) + '1049,' + char(124) + 'true' + char(124) + '" + Value = ",code,undo,redo,cut,copy,mcepasteword,stylepicker,bold,italic,bullist,numlist,outdent,indent,mcelink,unlink,mceinsertanchor,mceimage,umbracomacro,mceinserttable,umbracoembed,mcecharmap,|1|1,2,3,|0|500,400|1049,|true|',0,N''" }); + _database.Insert("cmsDataTypePreValues", "id", false, new DataTypePreValueDto { Id = 4, @@ -344,17 +345,19 @@ namespace Umbraco.Core.Persistence.Migrations.Initial private void CreateCmsTaskTypeData() { - //TODO: It tries to do an identity insert it seems, why? Error: The column cannot be modified. [ Column name = id ] - //using (var transaction = _database.GetTransaction()) - //{ - // _database.Insert("cmsTaskType", "id", false, - // new TaskTypeDto - // { - // Alias = "toTranslate" - // }); + using (var transaction = _database.GetTransaction()) + { + _database.Execute(new Sql("SET IDENTITY_INSERT [cmsTaskType] ON ")); + _database.Insert("cmsTaskType", "id", false, + new TaskTypeDto + { + Id = 1, + Alias = "toTranslate" + }); + _database.Execute(new Sql("SET IDENTITY_INSERT [cmsTaskType] OFF;")); - // transaction.Complete(); - //} + transaction.Complete(); + } } } } \ No newline at end of file From 97639040f092ff129155c2d1eef600c8fa0aadf3 Mon Sep 17 00:00:00 2001 From: Sebastiaan Janssen Date: Mon, 3 Dec 2012 15:53:06 -0100 Subject: [PATCH 10/11] New way of transforming web.config file that should work in both VS2010 and 2012 Moved transform responsibility to Umbraco.Web.UI (mainly because circular dependency has been solved already a few months ago) Managed to clean up build.proj significantly in the process --- .hgignore | 3 +- build/Build.proj | 98 +---- src/Umbraco.Web.UI/Umbraco.Web.UI.csproj | 23 +- src/umbraco.presentation.targets | 33 -- .../Microsoft.WebApplication.targets | 389 ------------------ 5 files changed, 41 insertions(+), 505 deletions(-) delete mode 100644 tools/BuildTargets/WebApplications/Microsoft.WebApplication.targets diff --git a/.hgignore b/.hgignore index 37f74d35c3..7709452fba 100644 --- a/.hgignore +++ b/.hgignore @@ -64,4 +64,5 @@ src/Umbraco.Tests/config/umbracoSettings.config src/Umbraco.Web.UI/App_Plugins/* src/Umbraco.Web.UI/Views/* -src\Umbraco.Web.UI\[W]eb.config \ No newline at end of file +src\Umbraco.Web.UI\[W]eb.config +*.transformed diff --git a/build/Build.proj b/build/Build.proj index e4a506b350..7f962f29d6 100644 --- a/build/Build.proj +++ b/build/Build.proj @@ -1,4 +1,4 @@ - + @@ -84,13 +84,6 @@ - - @@ -101,11 +94,9 @@ - - @@ -119,7 +110,6 @@ - @@ -143,7 +133,7 @@ - + @@ -152,80 +142,26 @@ + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj b/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj index 1c69096a78..1b159e1032 100644 --- a/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj +++ b/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj @@ -2245,7 +2245,28 @@ xcopy "$(ProjectDir)"..\packages\SqlServerCE.4.0.0.0\x86\*.* "$(TargetDir)x86\" - + + + + + + + + + + \ No newline at end of file diff --git a/src/umbraco.presentation.targets b/src/umbraco.presentation.targets index d0d2922b3e..6bceb13987 100644 --- a/src/umbraco.presentation.targets +++ b/src/umbraco.presentation.targets @@ -57,39 +57,6 @@ ***************************************************** --> - - - - - $(ProjDir)Web.Template.config - $(ProjOutputDir)Web.config - - - - - - - - - - - $(ProjDir)Web.Template.config - $(ProjOutputDir)Web.config - - - - - - - - - diff --git a/tools/BuildTargets/WebApplications/Microsoft.WebApplication.targets b/tools/BuildTargets/WebApplications/Microsoft.WebApplication.targets deleted file mode 100644 index 0c9085319c..0000000000 --- a/tools/BuildTargets/WebApplications/Microsoft.WebApplication.targets +++ /dev/null @@ -1,389 +0,0 @@ - - - - - - - False - True - False - $(WebProjectOutputDirInsideProjectDefault) - False - False - False - True - False - - - - - $(MSBuildProjectDirectory) - $(OutDir)_PublishedWebsites\$(MSBuildProjectName) - - - - - $(PrepareForRunDependsOn); - CopySilverlightApplications; - _CopyBinDeployableAssemblies; - - - $(PrepareForRunDependsOn); - _CopyWebApplication; - _BuiltWebOutputGroupOutput - - - - - - - - - $(CleanDependsOn); - CleanWebProjectOutputDir; - - - - - - - - - - - - - - - - - - - - - - _CopyWebApplicationLegacy; - - - _WPPCopyWebApplication; - - - $(OnBefore_CopyWebApplicationDefault); - - - - - - <_CopyWebApplicationDependsOn Condition="'$(_CopyWebApplicationDependsOn)'==''"> - $(OnBefore_CopyWebApplication); - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - <_SilverlightApplications Include="@(_AllSilverlightApplications)" Condition="Exists('%(Identity)')"/> - <_SilverlightApplicationsNotExist Include="@(_AllSilverlightApplications)" Condition="!Exists('%(Identity)')"/> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - _bin_deployableAssemblies\ - $([System.IO.Path]::GetFullPath($(BinDeployableFolder))) - - - - - - - - - - <_binDeployableAssemblies Include ="@(__binDeployableAssemblies)" Condition="'@(__binDeployableAssemblies)' != ''"> - $([System.String]::Concat($([System.IO.Path]::GetDirectoryName($([System.String]::new('%(__binDeployableAssemblies.FullPath)')))),'\').SubString($(BinDeployableFolderFullPath.Length))) - - - - - - - - - - - - - - - - - - - - $(OnBeforePipelineCollectFilesPhase); - CopySilverlightApplications; - - - - - From f1f8759bde6e078b91e7f10515b5d3e1adc86f6b Mon Sep 17 00:00:00 2001 From: Sebastiaan Janssen Date: Mon, 3 Dec 2012 16:53:47 -0100 Subject: [PATCH 11/11] Change string parsing to VirtualPathUtility.ToAppRelative --- src/Umbraco.Web/umbraco.presentation/macro.cs | 10 +--------- .../userControlWrapper/usercontrolDataEditor.cs | 9 +-------- 2 files changed, 2 insertions(+), 17 deletions(-) diff --git a/src/Umbraco.Web/umbraco.presentation/macro.cs b/src/Umbraco.Web/umbraco.presentation/macro.cs index ffdd59879a..ec6f921d39 100644 --- a/src/Umbraco.Web/umbraco.presentation/macro.cs +++ b/src/Umbraco.Web/umbraco.presentation/macro.cs @@ -1419,15 +1419,7 @@ namespace umbraco Debug.Assert(pageElements != null, "pageElements cannot be null"); try { - string userControlPath = fileName; - - if (!userControlPath.StartsWith("~")) - { - if (userControlPath.StartsWith("/")) - userControlPath = "~" + userControlPath; - else - userControlPath = "~/" + userControlPath; - } + string userControlPath = VirtualPathUtility.ToAppRelative(fileName); if (!File.Exists(IOHelper.MapPath(userControlPath))) return new LiteralControl(string.Format("UserControl {0} does not exist.", fileName)); diff --git a/src/umbraco.editorControls/userControlWrapper/usercontrolDataEditor.cs b/src/umbraco.editorControls/userControlWrapper/usercontrolDataEditor.cs index fedc5465f8..b51b028df3 100644 --- a/src/umbraco.editorControls/userControlWrapper/usercontrolDataEditor.cs +++ b/src/umbraco.editorControls/userControlWrapper/usercontrolDataEditor.cs @@ -33,7 +33,7 @@ namespace umbraco.editorControls.userControlGrapper public usercontrolDataEditor(umbraco.interfaces.IData Data, string UsercontrolPath) { _data = Data; - _usercontrolPath = UsercontrolPath; + _usercontrolPath = VirtualPathUtility.ToAppRelative(UsercontrolPath); } public virtual bool TreatAsRichTextEditor @@ -60,13 +60,6 @@ namespace umbraco.editorControls.userControlGrapper { base.OnInit (e); - if (!_usercontrolPath.StartsWith("~")) - { - if (_usercontrolPath.StartsWith("/")) - _usercontrolPath = "~" + _usercontrolPath; - else - _usercontrolPath = "~/" + _usercontrolPath; - } Control oControl = new System.Web.UI.UserControl().LoadControl(_usercontrolPath); if (HasSettings(oControl.GetType()))