From ffccad642ecc4bda9d6529b81a2142aa222d8942 Mon Sep 17 00:00:00 2001 From: Jonas Pyfferoen Date: Sat, 30 Jun 2018 19:43:35 +0200 Subject: [PATCH 01/12] Rewrite exportdocumenttype.aspx to Angular --- .../common/resources/contenttype.resource.js | 15 ++++- .../views/documenttypes/export.controller.js | 13 ++++ .../src/views/documenttypes/export.html | 10 ++++ src/Umbraco.Web.UI/Umbraco.Web.UI.csproj | 1 - .../umbraco/dialogs/exportDocumenttype.aspx | 1 - .../Application/UmbracoApplicationActions.js | 8 --- .../Editors/ContentTypeController.cs | 52 ++++++++++++---- .../Trees/ContentTypeTreeController.cs | 18 ++---- .../Trees/LegacyTreeDataConverter.cs | 20 ++----- src/Umbraco.Web/Umbraco.Web.csproj | 5 -- .../_Legacy/Actions/ActionExport.cs | 8 +-- .../umbraco/dialogs/exportDocumenttype.aspx | 1 - .../dialogs/exportDocumenttype.aspx.cs | 59 ------------------- 13 files changed, 90 insertions(+), 121 deletions(-) create mode 100644 src/Umbraco.Web.UI.Client/src/views/documenttypes/export.controller.js create mode 100644 src/Umbraco.Web.UI.Client/src/views/documenttypes/export.html delete mode 100644 src/Umbraco.Web.UI/umbraco/dialogs/exportDocumenttype.aspx delete mode 100644 src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/exportDocumenttype.aspx delete mode 100644 src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/exportDocumenttype.aspx.cs diff --git a/src/Umbraco.Web.UI.Client/src/common/resources/contenttype.resource.js b/src/Umbraco.Web.UI.Client/src/common/resources/contenttype.resource.js index f31550781a..e25496b147 100644 --- a/src/Umbraco.Web.UI.Client/src/common/resources/contenttype.resource.js +++ b/src/Umbraco.Web.UI.Client/src/common/resources/contenttype.resource.js @@ -307,8 +307,21 @@ function contentTypeResource($q, $http, umbRequestHelper, umbDataFormatter) { "Failed to rename the folder with id " + id ); - } + }, + export: function (id) { + if (!id) { + throw "id cannot be null"; + } + + return window.open(umbRequestHelper.getApiUrl("contentTypeApiBaseUrl", + "Export", + { + id: id + }), + '_blank', + ''); + } }; } angular.module('umbraco.resources').factory('contentTypeResource', contentTypeResource); diff --git a/src/Umbraco.Web.UI.Client/src/views/documenttypes/export.controller.js b/src/Umbraco.Web.UI.Client/src/views/documenttypes/export.controller.js new file mode 100644 index 0000000000..630dfb3f7f --- /dev/null +++ b/src/Umbraco.Web.UI.Client/src/views/documenttypes/export.controller.js @@ -0,0 +1,13 @@ +angular.module("umbraco") + .controller("Umbraco.Editors.DocumentTypes.ExportController", + function ($scope, contentTypeResource, navigationService) { + + $scope.export = function () { + contentTypeResource.export($scope.currentNode.id); + navigationService.hideMenu(); + }; + + $scope.cancel = function () { + navigationService.hideDialog(); + }; + }); diff --git a/src/Umbraco.Web.UI.Client/src/views/documenttypes/export.html b/src/Umbraco.Web.UI.Client/src/views/documenttypes/export.html new file mode 100644 index 0000000000..54c7ff0efe --- /dev/null +++ b/src/Umbraco.Web.UI.Client/src/views/documenttypes/export.html @@ -0,0 +1,10 @@ +
+ +
diff --git a/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj b/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj index d61ffc18bd..c116beef17 100644 --- a/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj +++ b/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj @@ -401,7 +401,6 @@ - diff --git a/src/Umbraco.Web.UI/umbraco/dialogs/exportDocumenttype.aspx b/src/Umbraco.Web.UI/umbraco/dialogs/exportDocumenttype.aspx deleted file mode 100644 index 34c3330c38..0000000000 --- a/src/Umbraco.Web.UI/umbraco/dialogs/exportDocumenttype.aspx +++ /dev/null @@ -1 +0,0 @@ -<%@ Page language="c#" Codebehind="exportDocumenttype.aspx.cs" AutoEventWireup="false" Inherits="umbraco.presentation.dialogs.exportDocumenttype" %> diff --git a/src/Umbraco.Web.UI/umbraco_client/Application/UmbracoApplicationActions.js b/src/Umbraco.Web.UI/umbraco_client/Application/UmbracoApplicationActions.js index 5abf321d74..7db9274e15 100644 --- a/src/Umbraco.Web.UI/umbraco_client/Application/UmbracoApplicationActions.js +++ b/src/Umbraco.Web.UI/umbraco_client/Application/UmbracoApplicationActions.js @@ -302,14 +302,6 @@ Umbraco.Application.Actions = function() { } }, - actionExport: function() { - /// - - if (UmbClientMgr.mainTree().getActionNode().nodeType != '') { - this.openDialog("Export", "dialogs/exportDocumentType.aspx?nodeId=" + UmbClientMgr.mainTree().getActionNode().nodeId + "&rnd=" + this._utils.generateRandom(), 320, 205); - } - }, - actionAudit: function() { /// diff --git a/src/Umbraco.Web/Editors/ContentTypeController.cs b/src/Umbraco.Web/Editors/ContentTypeController.cs index 69cc785f15..4bb133bf90 100644 --- a/src/Umbraco.Web/Editors/ContentTypeController.cs +++ b/src/Umbraco.Web/Editors/ContentTypeController.cs @@ -1,20 +1,21 @@ -using System.Collections.Generic; +using AutoMapper; +using System; +using System.Collections.Generic; using System.Linq; using System.Net; +using System.Net.Http; +using System.Net.Http.Headers; using System.Web.Http; -using AutoMapper; +using Umbraco.Core; +using Umbraco.Core.Logging; using Umbraco.Core.Models; +using Umbraco.Core.Services; +using Umbraco.Web.Composing; using Umbraco.Web.Models.ContentEditing; using Umbraco.Web.Mvc; -using Constants = Umbraco.Core.Constants; -using Umbraco.Core.Services; -using System.Net.Http; -using Umbraco.Core; using Umbraco.Web.WebApi; using Umbraco.Web.WebApi.Filters; -using Umbraco.Core.Logging; -using Umbraco.Web.Composing; -using ContentVariation = Umbraco.Core.Models.ContentVariation; +using Constants = Umbraco.Core.Constants; namespace Umbraco.Web.Editors { @@ -353,6 +354,35 @@ namespace Umbraco.Web.Editors copy, getContentType: i => Services.ContentTypeService.Get(i), doCopy: (type, i) => Services.ContentTypeService.Copy(type, i)); - } + } + + [HttpGet] + public HttpResponseMessage Export(int id) + { + var contentType = Services.ContentTypeService.Get(id); + if (contentType == null) throw new NullReferenceException("No content type found with id " + id); + + var serializer = new EntityXmlSerializer(); + var xml = serializer.Serialize( + Services.DataTypeService, + Services.ContentTypeService, + contentType); + var response = new HttpResponseMessage + { + Content = new StringContent(xml.ToDataString()) + { + Headers = + { + ContentDisposition = new ContentDispositionHeaderValue("attachment") + { + FileName = $"{contentType.Alias}.udt" + }, + ContentType = new MediaTypeHeaderValue( "application/octet-stream") + } + } + }; + + return response; + } } -} +} diff --git a/src/Umbraco.Web/Trees/ContentTypeTreeController.cs b/src/Umbraco.Web/Trees/ContentTypeTreeController.cs index 4bdef0246a..1295f32dd6 100644 --- a/src/Umbraco.Web/Trees/ContentTypeTreeController.cs +++ b/src/Umbraco.Web/Trees/ContentTypeTreeController.cs @@ -1,17 +1,17 @@ -using System; +using AutoMapper; +using System; using System.Collections.Generic; using System.Linq; using System.Net.Http.Formatting; -using AutoMapper; using Umbraco.Core; using Umbraco.Core.Configuration; using Umbraco.Core.Models; using Umbraco.Core.Models.Entities; +using Umbraco.Core.Services; +using Umbraco.Web._Legacy.Actions; +using Umbraco.Web.Models.ContentEditing; using Umbraco.Web.Models.Trees; using Umbraco.Web.WebApi.Filters; -using Umbraco.Core.Services; -using Umbraco.Web.Models.ContentEditing; -using Umbraco.Web._Legacy.Actions; namespace Umbraco.Web.Trees { @@ -132,13 +132,7 @@ namespace Umbraco.Web.Trees } } menu.Items.Add(Services.TextService.Localize(string.Format("actions/{0}", ActionCopy.Instance.Alias))); - menu.Items.Add(Services.TextService.Localize(string.Format("actions/{0}", ActionExport.Instance.Alias)), true).ConvertLegacyMenuItem(new EntitySlim - { - Id = int.Parse(id), - Level = 1, - ParentId = Constants.System.Root, - Name = "" - }, "documenttypes", "settings"); + menu.Items.Add(Services.TextService.Localize(string.Format("actions/{0}", ActionExport.Instance.Alias)), true); menu.Items.Add(Services.TextService.Localize(string.Format("actions/{0}", ActionDelete.Instance.Alias)), true); if (enableInheritedDocumentTypes) menu.Items.Add(Services.TextService.Localize(string.Format("actions/{0}", ActionRefresh.Instance.Alias)), true); diff --git a/src/Umbraco.Web/Trees/LegacyTreeDataConverter.cs b/src/Umbraco.Web/Trees/LegacyTreeDataConverter.cs index af3bca0e0a..9b89d32953 100644 --- a/src/Umbraco.Web/Trees/LegacyTreeDataConverter.cs +++ b/src/Umbraco.Web/Trees/LegacyTreeDataConverter.cs @@ -2,22 +2,15 @@ using System.Collections.Generic; using System.Linq; using System.Net.Http.Formatting; -using System.Text; -using System.Web; using System.Web.Http.Routing; +using umbraco.cms.presentation.Trees; using Umbraco.Core; -using Umbraco.Core.IO; +using Umbraco.Core.Configuration; using Umbraco.Core.Logging; using Umbraco.Core.Services; -using Umbraco.Web.Models.Trees; -using umbraco; - -using umbraco.cms.presentation.Trees; -using umbraco.controls.Tree; -using Umbraco.Core.Configuration; -using Umbraco.Core.Models; -using Umbraco.Web.Composing; using Umbraco.Web._Legacy.Actions; +using Umbraco.Web.Composing; +using Umbraco.Web.Models.Trees; namespace Umbraco.Web.Trees { @@ -280,11 +273,6 @@ namespace Umbraco.Web.Trees new LegacyUrlAction( "dialogs/importDocumentType.aspx", Current.Services.TextService.Localize("actions/importDocumentType"))); - case "UmbClientMgr.appActions().actionExport()": - return Attempt.Succeed( - new LegacyUrlAction( - "dialogs/exportDocumentType.aspx?nodeId=" + nodeId + "&rnd=" + DateTime.UtcNow.Ticks, - "")); case "UmbClientMgr.appActions().actionAudit()": return Attempt.Succeed( new LegacyUrlAction( diff --git a/src/Umbraco.Web/Umbraco.Web.csproj b/src/Umbraco.Web/Umbraco.Web.csproj index f9708e5c04..606dc9b240 100644 --- a/src/Umbraco.Web/Umbraco.Web.csproj +++ b/src/Umbraco.Web/Umbraco.Web.csproj @@ -1291,10 +1291,6 @@ editPackage.aspx - - exportDocumenttype.aspx - ASPXCodeBehind - importDocumenttype.aspx ASPXCodeBehind @@ -1492,7 +1488,6 @@ ASPXCodeBehind - ASPXCodeBehind diff --git a/src/Umbraco.Web/_Legacy/Actions/ActionExport.cs b/src/Umbraco.Web/_Legacy/Actions/ActionExport.cs index 3dc35073fe..ce1422ef66 100644 --- a/src/Umbraco.Web/_Legacy/Actions/ActionExport.cs +++ b/src/Umbraco.Web/_Legacy/Actions/ActionExport.cs @@ -1,5 +1,4 @@ using System; -using Umbraco.Web.UI.Pages; namespace Umbraco.Web._Legacy.Actions { @@ -38,10 +37,7 @@ namespace Umbraco.Web._Legacy.Actions public string JsFunctionName { - get - { - return string.Format("{0}.actionExport()", ClientTools.Scripts.GetAppActions); - } + get { return ""; } } public string JsSource @@ -56,7 +52,7 @@ namespace Umbraco.Web._Legacy.Actions { get { - return "exportDocumentType"; + return "export"; } } diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/exportDocumenttype.aspx b/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/exportDocumenttype.aspx deleted file mode 100644 index 34c3330c38..0000000000 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/exportDocumenttype.aspx +++ /dev/null @@ -1 +0,0 @@ -<%@ Page language="c#" Codebehind="exportDocumenttype.aspx.cs" AutoEventWireup="false" Inherits="umbraco.presentation.dialogs.exportDocumenttype" %> diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/exportDocumenttype.aspx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/exportDocumenttype.aspx.cs deleted file mode 100644 index ce1b4fdeaf..0000000000 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/exportDocumenttype.aspx.cs +++ /dev/null @@ -1,59 +0,0 @@ -using System; -using Umbraco.Core; -using Umbraco.Core.Services; -using Umbraco.Web; - -namespace umbraco.presentation.dialogs -{ - /// - /// Summary description for exportDocumenttype. - /// - public class exportDocumenttype : Umbraco.Web.UI.Pages.UmbracoEnsuredPage - { - public exportDocumenttype() - { - CurrentApp = Constants.Applications.Settings.ToString(); - - } - private void Page_Load(object sender, System.EventArgs e) - { - int documentTypeId = Request.GetItemAs("nodeID"); - if (documentTypeId > 0) - { - var contentType = Services.ContentTypeService.Get(documentTypeId); - if (contentType == null) throw new NullReferenceException("No content type found with id " + documentTypeId); - - Response.AddHeader("Content-Disposition", "attachment;filename=" + contentType.Alias + ".udt"); - Response.ContentType = "application/octet-stream"; - - var serializer = new EntityXmlSerializer(); - var xml = serializer.Serialize( - Services.DataTypeService, - Services.ContentTypeService, - contentType); - - xml.Save(Response.OutputStream); - } - } - - #region Web Form Designer generated code - override protected void OnInit(EventArgs e) - { - // - // CODEGEN: This call is required by the ASP.NET Web Form Designer. - // - InitializeComponent(); - base.OnInit(e); - } - - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - this.Load += new System.EventHandler(this.Page_Load); - } - #endregion - } -} From 9b5455c18659d7ce78d9430d43925c770c6e636d Mon Sep 17 00:00:00 2001 From: Mundairson Date: Mon, 16 Jul 2018 22:06:45 +0100 Subject: [PATCH 02/12] Changed the constructors so the two overloads have the same parameter in the same position. --- .../UmbracoExperimentalFeatureAttribute.cs | 32 ++++++++++++------- 1 file changed, 20 insertions(+), 12 deletions(-) diff --git a/src/Umbraco.Core/CodeAnnotations/UmbracoExperimentalFeatureAttribute.cs b/src/Umbraco.Core/CodeAnnotations/UmbracoExperimentalFeatureAttribute.cs index 74be6ab397..92e96fde7f 100644 --- a/src/Umbraco.Core/CodeAnnotations/UmbracoExperimentalFeatureAttribute.cs +++ b/src/Umbraco.Core/CodeAnnotations/UmbracoExperimentalFeatureAttribute.cs @@ -3,33 +3,41 @@ namespace Umbraco.Core.CodeAnnotations { /// - /// Marks the program elements that Umbraco is experimenting with and could become public. + /// Marks the program elements that Umbraco is experimenting with and could + /// become public. /// /// - /// Indicates that Umbraco is experimenting with code that potentially could become - /// public, but we're not sure, and the code is not stable and can be refactored at any time. - /// The issue tracker should contain more details, discussion, and planning. + /// Indicates that Umbraco is experimenting with code that potentially + /// could become public, but we're not sure, and the code is not stable and + /// can be refactored at any time. + /// The issue tracker should contain more details, discussion, and + /// planning. /// [AttributeUsage(AttributeTargets.All, AllowMultiple = false, Inherited = false)] internal sealed class UmbracoExperimentalFeatureAttribute : Attribute { /// - /// Initializes a new instance of the class with a description. + /// Initializes a new instance of the + /// class with a description. /// - /// The text string that describes what is intended. + /// The text string that describes what is + /// intended. public UmbracoExperimentalFeatureAttribute(string description) { - + /* empty */ } /// - /// Initializes a new instance of the class with a tracker url and a description. + /// Initializes a new instance of the + /// class with a tracker url and a description. /// - /// The url of a tracker issue containing more details, discussion, and planning. - /// The text string that describes what is intended. - public UmbracoExperimentalFeatureAttribute(string trackerUrl, string description) + /// The text string that describes what is + /// intended. + /// The url of a tracker issue containing more + /// details, discussion, and planning. + public UmbracoExperimentalFeatureAttribute(string description, string trackerUrl) { - + /* empty */ } } } From e17d2fbfc0084c9b8d8240df5adc0bf9f278080a Mon Sep 17 00:00:00 2001 From: Mundairson Date: Mon, 16 Jul 2018 22:09:03 +0100 Subject: [PATCH 03/12] Changed the constructors so the two overloads have the same parameter in the same position. --- .../UmbracoProposedPublicAttribute.cs | 34 ++++++++++++------- 1 file changed, 21 insertions(+), 13 deletions(-) diff --git a/src/Umbraco.Core/CodeAnnotations/UmbracoProposedPublicAttribute.cs b/src/Umbraco.Core/CodeAnnotations/UmbracoProposedPublicAttribute.cs index 1a65dc036e..8f15405cf8 100644 --- a/src/Umbraco.Core/CodeAnnotations/UmbracoProposedPublicAttribute.cs +++ b/src/Umbraco.Core/CodeAnnotations/UmbracoProposedPublicAttribute.cs @@ -6,31 +6,39 @@ namespace Umbraco.Core.CodeAnnotations /// Marks the program elements that Umbraco is considering making public. /// /// - /// Indicates that Umbraco considers making the (currently internal) program element public - /// at some point in the future, but the decision is not fully made yet and is still pending reviews. - /// Note that it is not a commitment to make the program element public. It may not ever become public. - /// The issue tracker should contain more details, discussion, and planning. + /// Indicates that Umbraco considers making the (currently internal) + /// program element public at some point in the future, but the decision is + /// not fully made yet and is still pending reviews. + /// Note that it is not a commitment to make the program element public. + /// It may not ever become public. + /// The issue tracker should contain more details, discussion, and + /// planning. /// - [AttributeUsage(AttributeTargets.All, AllowMultiple=false, Inherited=false)] + [AttributeUsage(AttributeTargets.All, AllowMultiple = false, Inherited = false)] internal sealed class UmbracoProposedPublicAttribute : Attribute { /// - /// Initializes a new instance of the class with a description. + /// Initializes a new instance of the + /// class with a description. /// - /// The text string that describes what is intended. + /// The text string that describes what is + /// intended. public UmbracoProposedPublicAttribute(string description) { - + /* empty */ } /// - /// Initializes a new instance of the class with a tracker url and a description. + /// Initializes a new instance of the + /// class with a tracker url and a description. /// - /// The url of a tracker issue containing more details, discussion, and planning. - /// The text string that describes what is intended. - public UmbracoProposedPublicAttribute(string trackerUrl, string description) + /// The text string that describes what is + /// intended. + /// The url of a tracker issue containing more + /// details, discussion, and planning. + public UmbracoProposedPublicAttribute(string description, string trackerUrl) { - + /* empty */ } } } From 9e21a7251583897f0e2735009af84ffe0ad093d0 Mon Sep 17 00:00:00 2001 From: Mundairson Date: Mon, 16 Jul 2018 22:12:03 +0100 Subject: [PATCH 04/12] Changed the constructors so the two overloads have the same parameter in the same position. --- .../UmbracoWillObsoleteAttribute.cs | 29 ++++++++++--------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/src/Umbraco.Core/CodeAnnotations/UmbracoWillObsoleteAttribute.cs b/src/Umbraco.Core/CodeAnnotations/UmbracoWillObsoleteAttribute.cs index 7babe71469..bb0fd35fb9 100644 --- a/src/Umbraco.Core/CodeAnnotations/UmbracoWillObsoleteAttribute.cs +++ b/src/Umbraco.Core/CodeAnnotations/UmbracoWillObsoleteAttribute.cs @@ -1,7 +1,4 @@ using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; namespace Umbraco.Core.CodeAnnotations { @@ -9,29 +6,35 @@ namespace Umbraco.Core.CodeAnnotations /// Marks the program elements that Umbraco will obsolete. /// /// - /// Indicates that Umbraco will obsolete the program element at some point in the future, but we do not want to - /// explicitely mark it [Obsolete] yet to avoid warning messages showing when developers compile Umbraco. + /// Indicates that Umbraco will obsolete the program element at some point + /// in the future, but we do not want to explicitly mark it [Obsolete] yet + /// to avoid warning messages showing when developers compile Umbraco. /// [AttributeUsage(AttributeTargets.All, AllowMultiple = false, Inherited = false)] internal sealed class UmbracoWillObsoleteAttribute : Attribute { /// - /// Initializes a new instance of the class with a description. + /// Initializes a new instance of the + /// class with a description. /// - /// The text string that describes what is intended. + /// The text string that describes what is + /// intended. public UmbracoWillObsoleteAttribute(string description) { - + /* empty */ } /// - /// Initializes a new instance of the class with a tracker url and a description. + /// Initializes a new instance of the + /// class with a tracker url and a description. /// - /// The url of a tracker issue containing more details, discussion, and planning. - /// The text string that describes what is intended. - public UmbracoWillObsoleteAttribute(string trackerUrl, string description) + /// The text string that describes what is + /// intended. + /// The url of a tracker issue containing more + /// details, discussion, and planning. + public UmbracoWillObsoleteAttribute(string description, string trackerUrl) { - + /* empty */ } } } From d7d36c34bed349936fa9ecf795185439bc740dc9 Mon Sep 17 00:00:00 2001 From: Mundairson Date: Wed, 18 Jul 2018 14:29:10 +0100 Subject: [PATCH 05/12] Removed empty block comments. --- .../CodeAnnotations/UmbracoExperimentalFeatureAttribute.cs | 2 -- .../CodeAnnotations/UmbracoProposedPublicAttribute.cs | 2 -- .../CodeAnnotations/UmbracoWillObsoleteAttribute.cs | 2 -- 3 files changed, 6 deletions(-) diff --git a/src/Umbraco.Core/CodeAnnotations/UmbracoExperimentalFeatureAttribute.cs b/src/Umbraco.Core/CodeAnnotations/UmbracoExperimentalFeatureAttribute.cs index 92e96fde7f..27d8b05c07 100644 --- a/src/Umbraco.Core/CodeAnnotations/UmbracoExperimentalFeatureAttribute.cs +++ b/src/Umbraco.Core/CodeAnnotations/UmbracoExperimentalFeatureAttribute.cs @@ -24,7 +24,6 @@ namespace Umbraco.Core.CodeAnnotations /// intended. public UmbracoExperimentalFeatureAttribute(string description) { - /* empty */ } /// @@ -37,7 +36,6 @@ namespace Umbraco.Core.CodeAnnotations /// details, discussion, and planning. public UmbracoExperimentalFeatureAttribute(string description, string trackerUrl) { - /* empty */ } } } diff --git a/src/Umbraco.Core/CodeAnnotations/UmbracoProposedPublicAttribute.cs b/src/Umbraco.Core/CodeAnnotations/UmbracoProposedPublicAttribute.cs index 8f15405cf8..fbd80a7613 100644 --- a/src/Umbraco.Core/CodeAnnotations/UmbracoProposedPublicAttribute.cs +++ b/src/Umbraco.Core/CodeAnnotations/UmbracoProposedPublicAttribute.cs @@ -25,7 +25,6 @@ namespace Umbraco.Core.CodeAnnotations /// intended. public UmbracoProposedPublicAttribute(string description) { - /* empty */ } /// @@ -38,7 +37,6 @@ namespace Umbraco.Core.CodeAnnotations /// details, discussion, and planning. public UmbracoProposedPublicAttribute(string description, string trackerUrl) { - /* empty */ } } } diff --git a/src/Umbraco.Core/CodeAnnotations/UmbracoWillObsoleteAttribute.cs b/src/Umbraco.Core/CodeAnnotations/UmbracoWillObsoleteAttribute.cs index bb0fd35fb9..65895cd2ff 100644 --- a/src/Umbraco.Core/CodeAnnotations/UmbracoWillObsoleteAttribute.cs +++ b/src/Umbraco.Core/CodeAnnotations/UmbracoWillObsoleteAttribute.cs @@ -21,7 +21,6 @@ namespace Umbraco.Core.CodeAnnotations /// intended. public UmbracoWillObsoleteAttribute(string description) { - /* empty */ } /// @@ -34,7 +33,6 @@ namespace Umbraco.Core.CodeAnnotations /// details, discussion, and planning. public UmbracoWillObsoleteAttribute(string description, string trackerUrl) { - /* empty */ } } } From d36ec6003924abb1ba7c425bf04a592cd303eabf Mon Sep 17 00:00:00 2001 From: Stephan Date: Thu, 19 Jul 2018 11:02:51 +0200 Subject: [PATCH 06/12] Fix IPropertyValueConverter determining HasValue --- .../PublishedContent/PublishedPropertyType.cs | 16 +++++++----- .../IPropertyValueConverter.cs | 11 ++++++-- .../PropertyValueConverterBase.cs | 21 +++++++++++++-- .../PropertyEditors/PropertyValueLevel.cs | 23 ++++++++++++++++ src/Umbraco.Core/Umbraco.Core.csproj | 1 + .../Published/ConvertersTests.cs | 24 ++++++++++++++--- .../Published/PropertyCacheLevelTests.cs | 2 +- .../PublishedCache/NuCache/Property.cs | 26 ++++++++++++++++++- .../PublishedElementPropertyBase.cs | 23 +++++++++++++++- 9 files changed, 130 insertions(+), 17 deletions(-) create mode 100644 src/Umbraco.Core/PropertyEditors/PropertyValueLevel.cs diff --git a/src/Umbraco.Core/Models/PublishedContent/PublishedPropertyType.cs b/src/Umbraco.Core/Models/PublishedContent/PublishedPropertyType.cs index 49f679d1f4..e019f9a5d1 100644 --- a/src/Umbraco.Core/Models/PublishedContent/PublishedPropertyType.cs +++ b/src/Umbraco.Core/Models/PublishedContent/PublishedPropertyType.cs @@ -194,17 +194,19 @@ namespace Umbraco.Core.Models.PublishedContent } /// - /// Determines whether a source value is an actual value, or not a value. + /// Determines whether a value is an actual value, or not a value. /// /// Used by property.HasValue and, for instance, in fallback scenarios. - public bool IsValue(object value) + public bool? IsValue(object value, PropertyValueLevel level) { - // if we have a converter, use the converter, - // otherwise use the old magic null & string comparisons + if (!_initialized) Initialize(); - return _converter == null - ? value != null && (!(value is string) || string.IsNullOrWhiteSpace((string) value) == false) - : _converter.IsValue(value); + // if we have a converter, use the converter + if (_converter != null) + return _converter.IsValue(value, level); + + // otherwise use the old magic null & string comparisons + return value != null && (!(value is string) || string.IsNullOrWhiteSpace((string) value) == false); } /// diff --git a/src/Umbraco.Core/PropertyEditors/IPropertyValueConverter.cs b/src/Umbraco.Core/PropertyEditors/IPropertyValueConverter.cs index 53851f8653..258febe813 100644 --- a/src/Umbraco.Core/PropertyEditors/IPropertyValueConverter.cs +++ b/src/Umbraco.Core/PropertyEditors/IPropertyValueConverter.cs @@ -18,9 +18,16 @@ namespace Umbraco.Core.PropertyEditors bool IsConverter(PublishedPropertyType propertyType); /// - /// Determines whether a source value is an actual value, or not a value. + /// Determines whether a value is an actual value, or not a value. /// - bool IsValue(object value); + /// + /// Called for Source, Inter and Object levels, until one does not return null. + /// Can return true (is a value), false (is not a value), or null to indicate that it + /// cannot be determined at the specified level. For instance, if source is a string that + /// could contain JSON, the decision could be made on the intermediate value. Or, if it is + /// a picker, it could be made on the object value (the actual picked object). + /// + bool? IsValue(object value, PropertyValueLevel level); /// /// Gets the type of values returned by the converter. diff --git a/src/Umbraco.Core/PropertyEditors/PropertyValueConverterBase.cs b/src/Umbraco.Core/PropertyEditors/PropertyValueConverterBase.cs index 9a82446edd..4c20016318 100644 --- a/src/Umbraco.Core/PropertyEditors/PropertyValueConverterBase.cs +++ b/src/Umbraco.Core/PropertyEditors/PropertyValueConverterBase.cs @@ -11,8 +11,25 @@ namespace Umbraco.Core.PropertyEditors public virtual bool IsConverter(PublishedPropertyType propertyType) => false; - public bool IsValue(object value) - => value != null && (!(value is string) || string.IsNullOrWhiteSpace((string) value) == false); + public virtual bool? IsValue(object value, PropertyValueLevel level) + { + switch (level) + { + case PropertyValueLevel.Source: + return value != null && (!(value is string) || string.IsNullOrWhiteSpace((string) value) == false); + default: + throw new NotSupportedException($"Invalid level: {level}."); + } + } + + public virtual bool HasValue(IPublishedProperty property, string culture, string segment) + { + // the default implementation uses the old magic null & string comparisons, + // other implementations may be more clever, and/or test the final converted object values + // fixme - cannot access the intermediate value here? + var value = property.GetSourceValue(culture, segment); + return value != null && (!(value is string) || string.IsNullOrWhiteSpace((string) value) == false); + } public virtual Type GetPropertyValueType(PublishedPropertyType propertyType) => typeof (object); diff --git a/src/Umbraco.Core/PropertyEditors/PropertyValueLevel.cs b/src/Umbraco.Core/PropertyEditors/PropertyValueLevel.cs new file mode 100644 index 0000000000..956ce03b30 --- /dev/null +++ b/src/Umbraco.Core/PropertyEditors/PropertyValueLevel.cs @@ -0,0 +1,23 @@ +namespace Umbraco.Core.PropertyEditors +{ + /// + /// Indicates the level of a value. + /// + public enum PropertyValueLevel + { + /// + /// The source value, i.e. what is in the database. + /// + Source, + + /// + /// The conversion intermediate value. + /// + Inter, + + /// + /// The converted value. + /// + Object + } +} diff --git a/src/Umbraco.Core/Umbraco.Core.csproj b/src/Umbraco.Core/Umbraco.Core.csproj index 1689be9b85..68b7142789 100644 --- a/src/Umbraco.Core/Umbraco.Core.csproj +++ b/src/Umbraco.Core/Umbraco.Core.csproj @@ -402,6 +402,7 @@ + diff --git a/src/Umbraco.Tests/Published/ConvertersTests.cs b/src/Umbraco.Tests/Published/ConvertersTests.cs index 39cb37f160..edc4face17 100644 --- a/src/Umbraco.Tests/Published/ConvertersTests.cs +++ b/src/Umbraco.Tests/Published/ConvertersTests.cs @@ -43,12 +43,30 @@ namespace Umbraco.Tests.Published var element1 = new PublishedElement(elementType1, Guid.NewGuid(), new Dictionary { { "prop1", "1234" } }, false); Assert.AreEqual(1234, element1.Value("prop1")); + + // 'null' would be considered a 'missing' value by the default, magic logic + var e = new PublishedElement(elementType1, Guid.NewGuid(), new Dictionary { { "prop1", null } }, false); + Assert.IsFalse(e.HasValue("prop1")); + + // '0' would not - it's a valid integer - but the converter knows better + e = new PublishedElement(elementType1, Guid.NewGuid(), new Dictionary { { "prop1", "0" } }, false); + Assert.IsFalse(e.HasValue("prop1")); } private class SimpleConverter1 : IPropertyValueConverter { - public bool IsValue(object value) - => value != null && (!(value is string) || string.IsNullOrWhiteSpace((string) value) == false); + public bool? IsValue(object value, PropertyValueLevel level) + { + switch (level) + { + case PropertyValueLevel.Source: + return null; + case PropertyValueLevel.Inter: + return value is int ivalue && ivalue != 0; + default: + throw new NotSupportedException($"Invalid level: {level}."); + } + } public bool IsConverter(PublishedPropertyType propertyType) => propertyType.EditorAlias.InvariantEquals("Umbraco.Void"); @@ -120,7 +138,7 @@ namespace Umbraco.Tests.Published _cacheLevel = cacheLevel; } - public bool IsValue(object value) + public bool? IsValue(object value, PropertyValueLevel level) => value != null && (!(value is string) || string.IsNullOrWhiteSpace((string) value) == false); public bool IsConverter(PublishedPropertyType propertyType) diff --git a/src/Umbraco.Tests/Published/PropertyCacheLevelTests.cs b/src/Umbraco.Tests/Published/PropertyCacheLevelTests.cs index 617429d205..33a595626e 100644 --- a/src/Umbraco.Tests/Published/PropertyCacheLevelTests.cs +++ b/src/Umbraco.Tests/Published/PropertyCacheLevelTests.cs @@ -210,7 +210,7 @@ namespace Umbraco.Tests.Published public int SourceConverts { get; private set; } public int InterConverts { get; private set; } - public bool IsValue(object value) + public bool? IsValue(object value, PropertyValueLevel level) => value != null && (!(value is string) || string.IsNullOrWhiteSpace((string) value) == false); public bool IsConverter(PublishedPropertyType propertyType) diff --git a/src/Umbraco.Web/PublishedCache/NuCache/Property.cs b/src/Umbraco.Web/PublishedCache/NuCache/Property.cs index 73a159cb19..8dd3bb8dc7 100644 --- a/src/Umbraco.Web/PublishedCache/NuCache/Property.cs +++ b/src/Umbraco.Web/PublishedCache/NuCache/Property.cs @@ -87,10 +87,34 @@ namespace Umbraco.Web.PublishedCache.NuCache _variations = origin._variations; } + // determines whether a property has value public override bool HasValue(string culture = null, string segment = null) { ContextualizeVariation(ref culture, ref segment); - return PropertyType.IsValue(GetSourceValue(culture, segment)); + + var value = GetSourceValue(culture, segment); + var hasValue = PropertyType.IsValue(value, PropertyValueLevel.Source); + if (hasValue.HasValue) return hasValue.Value; + + lock (_locko) + { + value = GetInterValue(culture, segment); + hasValue = PropertyType.IsValue(value, PropertyValueLevel.Inter); + if (hasValue.HasValue) return hasValue.Value; + + var cacheValues = GetCacheValues(PropertyType.CacheLevel).For(culture, segment); + + // initial reference cache level always is .Content + const PropertyCacheLevel initialCacheLevel = PropertyCacheLevel.Element; + + if (!cacheValues.ObjectInitialized) + { + cacheValues.ObjectValue = PropertyType.ConvertInterToObject(_content, initialCacheLevel, value, _isPreviewing); + cacheValues.ObjectInitialized = true; + } + value = cacheValues.ObjectValue; + return PropertyType.IsValue(value, PropertyValueLevel.Object) ?? false; + } } // used to cache the CacheValues of this property diff --git a/src/Umbraco.Web/PublishedCache/PublishedElementPropertyBase.cs b/src/Umbraco.Web/PublishedCache/PublishedElementPropertyBase.cs index d8db937ca8..cff1e40b69 100644 --- a/src/Umbraco.Web/PublishedCache/PublishedElementPropertyBase.cs +++ b/src/Umbraco.Web/PublishedCache/PublishedElementPropertyBase.cs @@ -37,7 +37,28 @@ namespace Umbraco.Web.PublishedCache } public override bool HasValue(string culture = null, string segment = null) - => _sourceValue != null && (!(_sourceValue is string s) || !string.IsNullOrWhiteSpace(s)); + { + var hasValue = PropertyType.IsValue(_sourceValue, PropertyValueLevel.Source); + if (hasValue.HasValue) return hasValue.Value; + + GetCacheLevels(out var cacheLevel, out var referenceCacheLevel); + + lock (_locko) + { + var value = GetInterValue(); + hasValue = PropertyType.IsValue(value, PropertyValueLevel.Inter); + if (hasValue.HasValue) return hasValue.Value; + + var cacheValues = GetCacheValues(cacheLevel); + if (!cacheValues.ObjectInitialized) + { + cacheValues.ObjectValue = PropertyType.ConvertInterToObject(Element, referenceCacheLevel, value, IsPreviewing); + cacheValues.ObjectInitialized = true; + } + value = cacheValues.ObjectValue; + return PropertyType.IsValue(value, PropertyValueLevel.Object) ?? false; + } + } // used to cache the CacheValues of this property // ReSharper disable InconsistentlySynchronizedField From 5fdaa451b82c9701686885261cd63e628c7123a6 Mon Sep 17 00:00:00 2001 From: Shannon Date: Thu, 19 Jul 2018 22:35:05 +1000 Subject: [PATCH 07/12] fixes null check on linkpicker changes with anchors, fixes ng-true-value constant value --- .../src/common/services/tinymce.service.js | 9 +++++++-- .../src/views/common/overlays/linkpicker/linkpicker.html | 2 +- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/common/services/tinymce.service.js b/src/Umbraco.Web.UI.Client/src/common/services/tinymce.service.js index 21588c9ede..aa53626a78 100644 --- a/src/Umbraco.Web.UI.Client/src/common/services/tinymce.service.js +++ b/src/Umbraco.Web.UI.Client/src/common/services/tinymce.service.js @@ -761,9 +761,14 @@ function tinyMceService($log, imageHelper, $http, $timeout, macroResource, macro * @param {string} input the string to parse */ getAnchorNames: function (input) { - var anchorPattern = //gi; + var anchors = []; + if (!input) { + return anchors; + } + + var anchorPattern = //gi; var matches = input.match(anchorPattern); - var anchors = []; + if (matches) { anchors = matches.map(function (v) { diff --git a/src/Umbraco.Web.UI.Client/src/views/common/overlays/linkpicker/linkpicker.html b/src/Umbraco.Web.UI.Client/src/views/common/overlays/linkpicker/linkpicker.html index e4ab635a44..5dd1275014 100644 --- a/src/Umbraco.Web.UI.Client/src/views/common/overlays/linkpicker/linkpicker.html +++ b/src/Umbraco.Web.UI.Client/src/views/common/overlays/linkpicker/linkpicker.html @@ -34,7 +34,7 @@ From ef7be48cc5c7ab63607bff225aa6e9818670b1f8 Mon Sep 17 00:00:00 2001 From: Stephan Date: Thu, 19 Jul 2018 15:05:55 +0200 Subject: [PATCH 08/12] Fix SqlTemplates concurrency --- src/Umbraco.Core/Persistence/SqlTemplates.cs | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/Umbraco.Core/Persistence/SqlTemplates.cs b/src/Umbraco.Core/Persistence/SqlTemplates.cs index 06c985232e..021f3a4670 100644 --- a/src/Umbraco.Core/Persistence/SqlTemplates.cs +++ b/src/Umbraco.Core/Persistence/SqlTemplates.cs @@ -1,12 +1,12 @@ using System; -using System.Collections.Generic; +using System.Collections.Concurrent; using NPoco; namespace Umbraco.Core.Persistence { public class SqlTemplates { - private readonly Dictionary _templates = new Dictionary(); + private readonly ConcurrentDictionary _templates = new ConcurrentDictionary(); private readonly ISqlContext _sqlContext; public SqlTemplates(ISqlContext sqlContext) @@ -22,9 +22,13 @@ namespace Umbraco.Core.Persistence public SqlTemplate Get(string key, Func, Sql> sqlBuilder) { - if (_templates.TryGetValue(key, out var template)) return template; - var sql = sqlBuilder(new Sql(_sqlContext)); - return _templates[key] = new SqlTemplate(_sqlContext, sql.SQL, sql.Arguments); + SqlTemplate CreateTemplate(string _) + { + var sql = sqlBuilder(new Sql(_sqlContext)); + return new SqlTemplate(_sqlContext, sql.SQL, sql.Arguments); + } + + return _templates.GetOrAdd(key, CreateTemplate); } } } From d7e97ac771e8c678f0d8f9abc8280f0e709f6b06 Mon Sep 17 00:00:00 2001 From: Stephan Date: Fri, 20 Jul 2018 10:59:25 +0200 Subject: [PATCH 09/12] Remove unused CodeAnnotations attributes, obsolete stuff --- src/Umbraco.Core/Cache/CacheKeys.cs | 36 +++--------------- .../UmbracoExperimentalFeatureAttribute.cs | 35 ------------------ .../UmbracoProposedPublicAttribute.cs | 36 ------------------ .../UmbracoWillObsoleteAttribute.cs | 37 ------------------- src/Umbraco.Core/StringAliasCaseType.cs | 12 ------ .../Strings/StringAliasCaseTypeExtensions.cs | 27 -------------- src/Umbraco.Core/Umbraco.Core.csproj | 5 --- .../Cache/ContentCacheRefresher.cs | 7 ---- .../Cache/ContentTypeCacheRefresher.cs | 25 ------------- src/Umbraco.Web/Cache/MacroCacheRefresher.cs | 1 - src/Umbraco.Web/Cache/MediaCacheRefresher.cs | 28 -------------- src/Umbraco.Web/Cache/MemberCacheRefresher.cs | 3 -- 12 files changed, 5 insertions(+), 247 deletions(-) delete mode 100644 src/Umbraco.Core/CodeAnnotations/UmbracoExperimentalFeatureAttribute.cs delete mode 100644 src/Umbraco.Core/CodeAnnotations/UmbracoProposedPublicAttribute.cs delete mode 100644 src/Umbraco.Core/CodeAnnotations/UmbracoWillObsoleteAttribute.cs delete mode 100644 src/Umbraco.Core/StringAliasCaseType.cs delete mode 100644 src/Umbraco.Core/Strings/StringAliasCaseTypeExtensions.cs diff --git a/src/Umbraco.Core/Cache/CacheKeys.cs b/src/Umbraco.Core/Cache/CacheKeys.cs index e7dcf7cd8c..f358c0f881 100644 --- a/src/Umbraco.Core/Cache/CacheKeys.cs +++ b/src/Umbraco.Core/Cache/CacheKeys.cs @@ -1,41 +1,15 @@ -using Umbraco.Core.CodeAnnotations; - -namespace Umbraco.Core.Cache +namespace Umbraco.Core.Cache { /// /// Constants storing cache keys used in caching /// public static class CacheKeys { - public const string ApplicationTreeCacheKey = "ApplicationTreeCache"; - public const string ApplicationsCacheKey = "ApplicationCache"; + public const string ApplicationTreeCacheKey = "ApplicationTreeCache"; // used by ApplicationTreeService + public const string ApplicationsCacheKey = "ApplicationCache"; // used by SectionService - [UmbracoWillObsolete("This cache key is only used for the legacy 'library' caching, remove in v8")] - public const string MediaCacheKey = "UL_GetMedia"; - - [UmbracoWillObsolete("This cache key is only used for legacy business logic caching, remove in v8")] - public const string MacroCacheKey = "UmbracoMacroCache"; + public const string TemplateFrontEndCacheKey = "template"; // fixme usage? - public const string MacroContentCacheKey = "macroContent_"; // for macro contents - - [UmbracoWillObsolete("This cache key is only used for legacy 'library' member caching, remove in v8")] - public const string MemberLibraryCacheKey = "UL_GetMember"; - - [UmbracoWillObsolete("This cache key is only used for legacy business logic caching, remove in v8")] - public const string MemberBusinessLogicCacheKey = "MemberCacheItem_"; - - [UmbracoWillObsolete("This cache key is only used for legacy template business logic caching, remove in v8")] - public const string TemplateFrontEndCacheKey = "template"; - - public const string UserContextTimeoutCacheKey = "UmbracoUserContextTimeout"; - - [UmbracoWillObsolete("This cache key is only used for legacy business logic caching, remove in v8")] - public const string ContentTypeCacheKey = "UmbracoContentType"; - - [UmbracoWillObsolete("This cache key is only used for legacy business logic caching, remove in v8")] - public const string ContentTypePropertiesCacheKey = "ContentType_PropertyTypes_Content:"; - - public const string IdToKeyCacheKey = "UI2K__"; - public const string KeyToIdCacheKey = "UK2I__"; + public const string MacroContentCacheKey = "macroContent_"; // used in MacroRenderers } } diff --git a/src/Umbraco.Core/CodeAnnotations/UmbracoExperimentalFeatureAttribute.cs b/src/Umbraco.Core/CodeAnnotations/UmbracoExperimentalFeatureAttribute.cs deleted file mode 100644 index 74be6ab397..0000000000 --- a/src/Umbraco.Core/CodeAnnotations/UmbracoExperimentalFeatureAttribute.cs +++ /dev/null @@ -1,35 +0,0 @@ -using System; - -namespace Umbraco.Core.CodeAnnotations -{ - /// - /// Marks the program elements that Umbraco is experimenting with and could become public. - /// - /// - /// Indicates that Umbraco is experimenting with code that potentially could become - /// public, but we're not sure, and the code is not stable and can be refactored at any time. - /// The issue tracker should contain more details, discussion, and planning. - /// - [AttributeUsage(AttributeTargets.All, AllowMultiple = false, Inherited = false)] - internal sealed class UmbracoExperimentalFeatureAttribute : Attribute - { - /// - /// Initializes a new instance of the class with a description. - /// - /// The text string that describes what is intended. - public UmbracoExperimentalFeatureAttribute(string description) - { - - } - - /// - /// Initializes a new instance of the class with a tracker url and a description. - /// - /// The url of a tracker issue containing more details, discussion, and planning. - /// The text string that describes what is intended. - public UmbracoExperimentalFeatureAttribute(string trackerUrl, string description) - { - - } - } -} diff --git a/src/Umbraco.Core/CodeAnnotations/UmbracoProposedPublicAttribute.cs b/src/Umbraco.Core/CodeAnnotations/UmbracoProposedPublicAttribute.cs deleted file mode 100644 index 1a65dc036e..0000000000 --- a/src/Umbraco.Core/CodeAnnotations/UmbracoProposedPublicAttribute.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System; - -namespace Umbraco.Core.CodeAnnotations -{ - /// - /// Marks the program elements that Umbraco is considering making public. - /// - /// - /// Indicates that Umbraco considers making the (currently internal) program element public - /// at some point in the future, but the decision is not fully made yet and is still pending reviews. - /// Note that it is not a commitment to make the program element public. It may not ever become public. - /// The issue tracker should contain more details, discussion, and planning. - /// - [AttributeUsage(AttributeTargets.All, AllowMultiple=false, Inherited=false)] - internal sealed class UmbracoProposedPublicAttribute : Attribute - { - /// - /// Initializes a new instance of the class with a description. - /// - /// The text string that describes what is intended. - public UmbracoProposedPublicAttribute(string description) - { - - } - - /// - /// Initializes a new instance of the class with a tracker url and a description. - /// - /// The url of a tracker issue containing more details, discussion, and planning. - /// The text string that describes what is intended. - public UmbracoProposedPublicAttribute(string trackerUrl, string description) - { - - } - } -} diff --git a/src/Umbraco.Core/CodeAnnotations/UmbracoWillObsoleteAttribute.cs b/src/Umbraco.Core/CodeAnnotations/UmbracoWillObsoleteAttribute.cs deleted file mode 100644 index 7babe71469..0000000000 --- a/src/Umbraco.Core/CodeAnnotations/UmbracoWillObsoleteAttribute.cs +++ /dev/null @@ -1,37 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; - -namespace Umbraco.Core.CodeAnnotations -{ - /// - /// Marks the program elements that Umbraco will obsolete. - /// - /// - /// Indicates that Umbraco will obsolete the program element at some point in the future, but we do not want to - /// explicitely mark it [Obsolete] yet to avoid warning messages showing when developers compile Umbraco. - /// - [AttributeUsage(AttributeTargets.All, AllowMultiple = false, Inherited = false)] - internal sealed class UmbracoWillObsoleteAttribute : Attribute - { - /// - /// Initializes a new instance of the class with a description. - /// - /// The text string that describes what is intended. - public UmbracoWillObsoleteAttribute(string description) - { - - } - - /// - /// Initializes a new instance of the class with a tracker url and a description. - /// - /// The url of a tracker issue containing more details, discussion, and planning. - /// The text string that describes what is intended. - public UmbracoWillObsoleteAttribute(string trackerUrl, string description) - { - - } - } -} diff --git a/src/Umbraco.Core/StringAliasCaseType.cs b/src/Umbraco.Core/StringAliasCaseType.cs deleted file mode 100644 index 328382e1c7..0000000000 --- a/src/Umbraco.Core/StringAliasCaseType.cs +++ /dev/null @@ -1,12 +0,0 @@ -using Umbraco.Core.CodeAnnotations; - -namespace Umbraco.Core -{ - [UmbracoWillObsolete("This enumeration should be removed. Use Umbraco.Core.Strings.CleanStringType instead.")] - public enum StringAliasCaseType - { - PascalCase, - CamelCase, - Unchanged - } -} diff --git a/src/Umbraco.Core/Strings/StringAliasCaseTypeExtensions.cs b/src/Umbraco.Core/Strings/StringAliasCaseTypeExtensions.cs deleted file mode 100644 index ce0b0f0c7a..0000000000 --- a/src/Umbraco.Core/Strings/StringAliasCaseTypeExtensions.cs +++ /dev/null @@ -1,27 +0,0 @@ -namespace Umbraco.Core.Strings -{ - /// - /// Provides extension methods to StringAliasCaseType to facilitate migration to CleanStringType. - /// - public static class StringAliasCaseTypeExtensions - { - /// - /// Gets the CleanStringType value corresponding to the StringAliasCaseType value. - /// - /// The value. - /// A CleanStringType value corresponding to the StringAliasCaseType value. - public static CleanStringType ToCleanStringType(this StringAliasCaseType aliasCaseType) - { - switch (aliasCaseType) - { - case StringAliasCaseType.PascalCase: - return CleanStringType.PascalCase; - case StringAliasCaseType.CamelCase: - return CleanStringType.CamelCase; - //case StringAliasCaseType.Unchanged: - default: - return CleanStringType.Unchanged; - } - } - } -} diff --git a/src/Umbraco.Core/Umbraco.Core.csproj b/src/Umbraco.Core/Umbraco.Core.csproj index 68b7142789..3954267118 100644 --- a/src/Umbraco.Core/Umbraco.Core.csproj +++ b/src/Umbraco.Core/Umbraco.Core.csproj @@ -128,11 +128,8 @@ - - - @@ -1436,7 +1433,6 @@ - @@ -1448,7 +1444,6 @@ - diff --git a/src/Umbraco.Web/Cache/ContentCacheRefresher.cs b/src/Umbraco.Web/Cache/ContentCacheRefresher.cs index 58c5732650..22f1554269 100644 --- a/src/Umbraco.Web/Cache/ContentCacheRefresher.cs +++ b/src/Umbraco.Web/Cache/ContentCacheRefresher.cs @@ -48,10 +48,6 @@ namespace Umbraco.Web.Cache runtimeCache.ClearCacheObjectTypes(); - // fixme - this is for entity service, not sure why we do it here and nowhere else? - runtimeCache.ClearCacheByKeySearch(CacheKeys.IdToKeyCacheKey); - runtimeCache.ClearCacheByKeySearch(CacheKeys.KeyToIdCacheKey); - var idsRemoved = new HashSet(); foreach (var payload in payloads) @@ -110,9 +106,6 @@ namespace Umbraco.Web.Cache // when a public version changes Current.ApplicationCache.ClearPartialViewCache(); MacroCacheRefresher.ClearMacroContentCache(CacheHelper); // just the content - - Current.ApplicationCache.RuntimeCache.ClearCacheByKeySearch(CacheKeys.IdToKeyCacheKey); - Current.ApplicationCache.RuntimeCache.ClearCacheByKeySearch(CacheKeys.KeyToIdCacheKey); } base.Refresh(payloads); diff --git a/src/Umbraco.Web/Cache/ContentTypeCacheRefresher.cs b/src/Umbraco.Web/Cache/ContentTypeCacheRefresher.cs index 55ad57e330..c1b99d25ec 100644 --- a/src/Umbraco.Web/Cache/ContentTypeCacheRefresher.cs +++ b/src/Umbraco.Web/Cache/ContentTypeCacheRefresher.cs @@ -61,7 +61,6 @@ namespace Umbraco.Web.Cache foreach (var id in payloads.Select(x => x.Id)) { _idkMap.ClearCache(id); - ClearLegacyCaches(id); } if (payloads.Any(x => x.ItemType == typeof(IContentType).Name)) @@ -103,30 +102,6 @@ namespace Umbraco.Web.Cache throw new NotSupportedException(); } - private void ClearLegacyCaches(int contentTypeId /*, string contentTypeAlias, IEnumerable propertyTypeIds*/) - { - // legacy umbraco.cms.businesslogic.ContentType - - // TODO - get rid of all this mess - - // clears the cache for each property type associated with the content type - // see src/umbraco.cms/businesslogic/propertytype/propertytype.cs - // that cache is disabled because we could not clear it properly - //foreach (var pid in propertyTypeIds) - // ApplicationContext.Current.ApplicationCache.RuntimeCache.ClearCacheItem(CacheKeys.PropertyTypeCacheKey + pid); - - // clears the cache associated with the content type itself - CacheHelper.RuntimeCache.ClearCacheItem(CacheKeys.ContentTypeCacheKey + contentTypeId); - - // clears the cache associated with the content type properties collection - CacheHelper.RuntimeCache.ClearCacheItem(CacheKeys.ContentTypePropertiesCacheKey + contentTypeId); - - // clears the dictionary object cache of the legacy ContentType - // see src/umbraco.cms/businesslogic/ContentType.cs - // that cache is disabled because we could not clear it properly - //global::umbraco.cms.businesslogic.ContentType.RemoveFromDataTypeCache(contentTypeAlias); - } - #endregion #region Json diff --git a/src/Umbraco.Web/Cache/MacroCacheRefresher.cs b/src/Umbraco.Web/Cache/MacroCacheRefresher.cs index 9164c64163..a4af601379 100644 --- a/src/Umbraco.Web/Cache/MacroCacheRefresher.cs +++ b/src/Umbraco.Web/Cache/MacroCacheRefresher.cs @@ -101,7 +101,6 @@ namespace Umbraco.Web.Cache { return new[] { - CacheKeys.MacroCacheKey, // umbraco.cms.businesslogic.macro.Macro objects cache CacheKeys.MacroContentCacheKey, // macro render cache }; } diff --git a/src/Umbraco.Web/Cache/MediaCacheRefresher.cs b/src/Umbraco.Web/Cache/MediaCacheRefresher.cs index eb53980422..7c64f3378b 100644 --- a/src/Umbraco.Web/Cache/MediaCacheRefresher.cs +++ b/src/Umbraco.Web/Cache/MediaCacheRefresher.cs @@ -56,34 +56,6 @@ namespace Umbraco.Web.Cache if (payload.ChangeTypes == TreeChangeTypes.Remove) _idkMap.ClearCache(payload.Id); - // note: ClearCacheByKeySearch - does StartsWith(...) - - // legacy alert! - // - // library cache library.GetMedia(int mediaId, bool deep) maintains a cache - // of media xml - and of *deep* media xml - using the key - // MediaCacheKey + "_" + mediaId + "_" + deep - // - // this clears the non-deep xml for the current media - // - Current.ApplicationCache.RuntimeCache.ClearCacheByKeySearch( - $"{CacheKeys.MediaCacheKey}_{payload.Id}_False"); - - // and then, for the entire path, we have to clear whatever might contain the media - // bearing in mind there are probably nasty race conditions here - this is all legacy - var k = $"{CacheKeys.MediaCacheKey}_{payload.Id}_"; - var x = Current.ApplicationCache.RuntimeCache.GetCacheItem(k) - as Tuple; - if (x == null) continue; - var path = x.Item2; - - foreach (var pathId in path.Split(',').Skip(1).Select(int.Parse)) - { - // this clears the deep xml for the medias in the path (skipping -1) - Current.ApplicationCache.RuntimeCache.ClearCacheByKeySearch( - $"{CacheKeys.MediaCacheKey}_{pathId}_True"); - } - // repository cache // it *was* done for each pathId but really that does not make sense // only need to do it for the current media diff --git a/src/Umbraco.Web/Cache/MemberCacheRefresher.cs b/src/Umbraco.Web/Cache/MemberCacheRefresher.cs index a1b896dbb4..237daa39b4 100644 --- a/src/Umbraco.Web/Cache/MemberCacheRefresher.cs +++ b/src/Umbraco.Web/Cache/MemberCacheRefresher.cs @@ -60,9 +60,6 @@ namespace Umbraco.Web.Cache _idkMap.ClearCache(id); CacheHelper.ClearPartialViewCache(); - CacheHelper.RuntimeCache.ClearCacheByKeySearch($"{CacheKeys.MemberLibraryCacheKey}_{id}"); - CacheHelper.RuntimeCache.ClearCacheByKeySearch($"{CacheKeys.MemberBusinessLogicCacheKey}{id}"); - var memberCache = CacheHelper.IsolatedRuntimeCache.GetCache(); if (memberCache) memberCache.Result.ClearCacheItem(RepositoryCacheKeys.GetKey(id)); From 3b771bf0f7d10508a9f3a42a1e296714639f07f5 Mon Sep 17 00:00:00 2001 From: Sebastiaan Janssen Date: Wed, 25 Jul 2018 12:09:46 +0200 Subject: [PATCH 10/12] Download using the umbraco built-in download method and adds notification for success/error --- .../common/resources/contenttype.resource.js | 192 +++++++++--------- src/Umbraco.Web.UI/Umbraco/config/lang/en.xml | 2 + .../Umbraco/config/lang/en_us.xml | 2 + .../Editors/ContentTypeController.cs | 5 + 4 files changed, 107 insertions(+), 94 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/common/resources/contenttype.resource.js b/src/Umbraco.Web.UI.Client/src/common/resources/contenttype.resource.js index 8e8bc72d43..cec9cf191e 100644 --- a/src/Umbraco.Web.UI.Client/src/common/resources/contenttype.resource.js +++ b/src/Umbraco.Web.UI.Client/src/common/resources/contenttype.resource.js @@ -3,17 +3,17 @@ * @name umbraco.resources.contentTypeResource * @description Loads in data for content types **/ -function contentTypeResource($q, $http, umbRequestHelper, umbDataFormatter) { +function contentTypeResource($q, $http, umbRequestHelper, umbDataFormatter, localizationService, notificationsService) { return { getCount: function () { return umbRequestHelper.resourcePromise( - $http.get( - umbRequestHelper.getApiUrl( - "contentTypeApiBaseUrl", - "GetCount")), - 'Failed to retrieve count'); + $http.get( + umbRequestHelper.getApiUrl( + "contentTypeApiBaseUrl", + "GetCount")), + 'Failed to retrieve count'); }, getAvailableCompositeContentTypes: function (contentTypeId, filterContentTypes, filterPropertyTypes) { @@ -31,32 +31,32 @@ function contentTypeResource($q, $http, umbRequestHelper, umbDataFormatter) { }; return umbRequestHelper.resourcePromise( - $http.post( - umbRequestHelper.getApiUrl( - "contentTypeApiBaseUrl", - "GetAvailableCompositeContentTypes"), - query), - 'Failed to retrieve data for content type id ' + contentTypeId); + $http.post( + umbRequestHelper.getApiUrl( + "contentTypeApiBaseUrl", + "GetAvailableCompositeContentTypes"), + query), + 'Failed to retrieve data for content type id ' + contentTypeId); }, - /** - * @ngdoc method - * @name umbraco.resources.contentTypeResource#getWhereCompositionIsUsedInContentTypes - * @methodOf umbraco.resources.contentTypeResource - * - * @description - * Returns a list of content types which use a specific composition with a given id - * - * ##usage - *
-         * contentTypeResource.getWhereCompositionIsUsedInContentTypes(1234)
-         *    .then(function(contentTypeList) {
-         *        console.log(contentTypeList);
-         *    });
-         * 
- * @param {Int} contentTypeId id of the composition content type to retrieve the list of the content types where it has been used - * @returns {Promise} resourcePromise object. - * - */ + /** + * @ngdoc method + * @name umbraco.resources.contentTypeResource#getWhereCompositionIsUsedInContentTypes + * @methodOf umbraco.resources.contentTypeResource + * + * @description + * Returns a list of content types which use a specific composition with a given id + * + * ##usage + *
+        * contentTypeResource.getWhereCompositionIsUsedInContentTypes(1234)
+        *    .then(function(contentTypeList) {
+        *        console.log(contentTypeList);
+        *    });
+        * 
+ * @param {Int} contentTypeId id of the composition content type to retrieve the list of the content types where it has been used + * @returns {Promise} resourcePromise object. + * + */ getWhereCompositionIsUsedInContentTypes: function (contentTypeId) { var query = { contentTypeId: contentTypeId @@ -92,12 +92,12 @@ function contentTypeResource($q, $http, umbRequestHelper, umbDataFormatter) { getAllowedTypes: function (contentTypeId) { return umbRequestHelper.resourcePromise( - $http.get( - umbRequestHelper.getApiUrl( - "contentTypeApiBaseUrl", - "GetAllowedChildren", - [{ contentId: contentTypeId }])), - 'Failed to retrieve data for content id ' + contentTypeId); + $http.get( + umbRequestHelper.getApiUrl( + "contentTypeApiBaseUrl", + "GetAllowedChildren", + [{ contentId: contentTypeId }])), + 'Failed to retrieve data for content id ' + contentTypeId); }, @@ -115,64 +115,64 @@ function contentTypeResource($q, $http, umbRequestHelper, umbDataFormatter) { getAllPropertyTypeAliases: function () { return umbRequestHelper.resourcePromise( - $http.get( - umbRequestHelper.getApiUrl( - "contentTypeApiBaseUrl", - "GetAllPropertyTypeAliases")), - 'Failed to retrieve property type aliases'); + $http.get( + umbRequestHelper.getApiUrl( + "contentTypeApiBaseUrl", + "GetAllPropertyTypeAliases")), + 'Failed to retrieve property type aliases'); }, getAllStandardFields: function () { return umbRequestHelper.resourcePromise( - $http.get( - umbRequestHelper.getApiUrl( - "contentTypeApiBaseUrl", - "GetAllStandardFields")), - 'Failed to retrieve standard fields'); + $http.get( + umbRequestHelper.getApiUrl( + "contentTypeApiBaseUrl", + "GetAllStandardFields")), + 'Failed to retrieve standard fields'); }, - getPropertyTypeScaffold : function (id) { - return umbRequestHelper.resourcePromise( - $http.get( - umbRequestHelper.getApiUrl( - "contentTypeApiBaseUrl", - "GetPropertyTypeScaffold", - [{ id: id }])), - 'Failed to retrieve property type scaffold'); + getPropertyTypeScaffold: function (id) { + return umbRequestHelper.resourcePromise( + $http.get( + umbRequestHelper.getApiUrl( + "contentTypeApiBaseUrl", + "GetPropertyTypeScaffold", + [{ id: id }])), + 'Failed to retrieve property type scaffold'); }, getById: function (id) { return umbRequestHelper.resourcePromise( - $http.get( - umbRequestHelper.getApiUrl( - "contentTypeApiBaseUrl", - "GetById", - [{ id: id }])), - 'Failed to retrieve content type'); + $http.get( + umbRequestHelper.getApiUrl( + "contentTypeApiBaseUrl", + "GetById", + [{ id: id }])), + 'Failed to retrieve content type'); }, deleteById: function (id) { return umbRequestHelper.resourcePromise( - $http.post( - umbRequestHelper.getApiUrl( - "contentTypeApiBaseUrl", - "DeleteById", - [{ id: id }])), - 'Failed to delete content type'); + $http.post( + umbRequestHelper.getApiUrl( + "contentTypeApiBaseUrl", + "DeleteById", + [{ id: id }])), + 'Failed to delete content type'); }, deleteContainerById: function (id) { return umbRequestHelper.resourcePromise( - $http.post( - umbRequestHelper.getApiUrl( - "contentTypeApiBaseUrl", - "DeleteContainer", - [{ id: id }])), - 'Failed to delete content type contaier'); + $http.post( + umbRequestHelper.getApiUrl( + "contentTypeApiBaseUrl", + "DeleteContainer", + [{ id: id }])), + 'Failed to delete content type contaier'); }, /** @@ -189,21 +189,21 @@ function contentTypeResource($q, $http, umbRequestHelper, umbDataFormatter) { getAll: function () { return umbRequestHelper.resourcePromise( - $http.get( - umbRequestHelper.getApiUrl( - "contentTypeApiBaseUrl", - "GetAll")), - 'Failed to retrieve all content types'); + $http.get( + umbRequestHelper.getApiUrl( + "contentTypeApiBaseUrl", + "GetAll")), + 'Failed to retrieve all content types'); }, getScaffold: function (parentId) { return umbRequestHelper.resourcePromise( - $http.get( - umbRequestHelper.getApiUrl( - "contentTypeApiBaseUrl", - "GetEmpty", { parentId: parentId })), - 'Failed to retrieve content type scaffold'); + $http.get( + umbRequestHelper.getApiUrl( + "contentTypeApiBaseUrl", + "GetEmpty", { parentId: parentId })), + 'Failed to retrieve content type scaffold'); }, /** @@ -223,7 +223,7 @@ function contentTypeResource($q, $http, umbRequestHelper, umbDataFormatter) { var saveModel = umbDataFormatter.formatContentTypePostData(contentType); return umbRequestHelper.resourcePromise( - $http.post(umbRequestHelper.getApiUrl("contentTypeApiBaseUrl", "PostSave"), saveModel), + $http.post(umbRequestHelper.getApiUrl("contentTypeApiBaseUrl", "PostSave"), saveModel), 'Failed to save data for content type id ' + contentType.id); }, @@ -270,7 +270,7 @@ function contentTypeResource($q, $http, umbRequestHelper, umbDataFormatter) { 'Failed to move content'); }, - copy: function(args) { + copy: function (args) { if (!args) { throw "args cannot be null"; } @@ -301,12 +301,12 @@ function contentTypeResource($q, $http, umbRequestHelper, umbDataFormatter) { createCollection: function (parentId, collectionName, collectionItemName, collectionIcon, collectionItemIcon) { return umbRequestHelper.resourcePromise( - $http.post(umbRequestHelper.getApiUrl("contentTypeApiBaseUrl", "PostCreateCollection", { parentId: parentId, collectionName: collectionName, collectionItemName: collectionItemName, collectionIcon: collectionIcon, collectionItemIcon: collectionItemIcon})), + $http.post(umbRequestHelper.getApiUrl("contentTypeApiBaseUrl", "PostCreateCollection", { parentId: parentId, collectionName: collectionName, collectionItemName: collectionItemName, collectionIcon: collectionIcon, collectionItemIcon: collectionItemIcon })), 'Failed to create collection under ' + parentId); }, - renameContainer: function(id, name) { + renameContainer: function (id, name) { return umbRequestHelper.resourcePromise( $http.post(umbRequestHelper.getApiUrl("contentTypeApiBaseUrl", @@ -322,13 +322,17 @@ function contentTypeResource($q, $http, umbRequestHelper, umbDataFormatter) { throw "id cannot be null"; } - return window.open(umbRequestHelper.getApiUrl("contentTypeApiBaseUrl", - "Export", - { - id: id - }), - '_blank', - ''); + var url = umbRequestHelper.getApiUrl("contentTypeApiBaseUrl", "Export", { id: id }); + + return umbRequestHelper.downloadFile(url).then(function () { + localizationService.localize("speechBubbles_documentTypeExportedSuccess").then(function(value) { + notificationsService.success(value); + }); + }, function (data) { + localizationService.localize("speechBubbles_documentTypeExportedError").then(function(value) { + notificationsService.error(value); + }); + }); } }; } diff --git a/src/Umbraco.Web.UI/Umbraco/config/lang/en.xml b/src/Umbraco.Web.UI/Umbraco/config/lang/en.xml index ee18248997..3de05dbbbf 100644 --- a/src/Umbraco.Web.UI/Umbraco/config/lang/en.xml +++ b/src/Umbraco.Web.UI/Umbraco/config/lang/en.xml @@ -1445,6 +1445,8 @@ To manage your website, simply open the Umbraco back office and start adding con User %0% was deleted Invite user Invitation has been re-sent to %0% + Document type was exported to file + An error occurred while exporting the document type Uses CSS syntax ex: h1, .redHeader, .blueTex diff --git a/src/Umbraco.Web.UI/Umbraco/config/lang/en_us.xml b/src/Umbraco.Web.UI/Umbraco/config/lang/en_us.xml index e61c406fae..0ecfb9c979 100644 --- a/src/Umbraco.Web.UI/Umbraco/config/lang/en_us.xml +++ b/src/Umbraco.Web.UI/Umbraco/config/lang/en_us.xml @@ -1455,6 +1455,8 @@ To manage your website, simply open the Umbraco back office and start adding con Cannot publish the document since the required '%0%' is not published Validation failed for language '%0%' Unexpected validation failed for language '%0%' + Document type was exported to file + An error occurred while exporting the document type Uses CSS syntax ex: h1, .redHeader, .blueTex diff --git a/src/Umbraco.Web/Editors/ContentTypeController.cs b/src/Umbraco.Web/Editors/ContentTypeController.cs index 57113d8e7b..4bd74bcbd3 100644 --- a/src/Umbraco.Web/Editors/ContentTypeController.cs +++ b/src/Umbraco.Web/Editors/ContentTypeController.cs @@ -419,6 +419,7 @@ namespace Umbraco.Web.Editors Services.DataTypeService, Services.ContentTypeService, contentType); + var response = new HttpResponseMessage { Content = new StringContent(xml.ToDataString()) @@ -430,10 +431,14 @@ namespace Umbraco.Web.Editors FileName = $"{contentType.Alias}.udt" }, ContentType = new MediaTypeHeaderValue( "application/octet-stream") + } } }; + // Set custom header so umbRequestHelper.downloadFile can save the correct filename + response.Headers.Add("x-filename", $"{contentType.Alias}.udt"); + return response; } } From 6f4ad059efa8e1957911fd5f74c66e5c9add5407 Mon Sep 17 00:00:00 2001 From: Stephan Date: Thu, 26 Jul 2018 09:41:43 +0200 Subject: [PATCH 11/12] Cleanup --- src/Umbraco.Web/Umbraco.Web.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Umbraco.Web/Umbraco.Web.csproj b/src/Umbraco.Web/Umbraco.Web.csproj index 437a027763..c539c8af98 100644 --- a/src/Umbraco.Web/Umbraco.Web.csproj +++ b/src/Umbraco.Web/Umbraco.Web.csproj @@ -1584,5 +1584,5 @@ - + \ No newline at end of file From 3c8a5c3a0de9e1d2709ba9bcb4423f0da19f13c9 Mon Sep 17 00:00:00 2001 From: Stephan Date: Thu, 26 Jul 2018 09:56:12 +0200 Subject: [PATCH 12/12] Remove obsolete code --- src/Umbraco.Web/RenderFieldCaseType.cs | 13 ------------- src/Umbraco.Web/RenderFieldEncodingType.cs | 13 ------------- src/Umbraco.Web/Umbraco.Web.csproj | 2 -- 3 files changed, 28 deletions(-) delete mode 100644 src/Umbraco.Web/RenderFieldCaseType.cs delete mode 100644 src/Umbraco.Web/RenderFieldEncodingType.cs diff --git a/src/Umbraco.Web/RenderFieldCaseType.cs b/src/Umbraco.Web/RenderFieldCaseType.cs deleted file mode 100644 index 176fbf2f1b..0000000000 --- a/src/Umbraco.Web/RenderFieldCaseType.cs +++ /dev/null @@ -1,13 +0,0 @@ -namespace Umbraco.Web -{ - /// - /// Used in the .Field method when rendering an Umbraco field to specify what case type it should be - /// - public enum RenderFieldCaseType - { - Upper, - Lower, - Title, - Unchanged - } -} diff --git a/src/Umbraco.Web/RenderFieldEncodingType.cs b/src/Umbraco.Web/RenderFieldEncodingType.cs deleted file mode 100644 index 3f6bd7a4ac..0000000000 --- a/src/Umbraco.Web/RenderFieldEncodingType.cs +++ /dev/null @@ -1,13 +0,0 @@ -namespace Umbraco.Web -{ - - /// - /// Used in the .Field method to render an Umbraco field to specify what encoding to use - /// - public enum RenderFieldEncodingType - { - Url, - Html, - Unchanged - } -} diff --git a/src/Umbraco.Web/Umbraco.Web.csproj b/src/Umbraco.Web/Umbraco.Web.csproj index c539c8af98..c97d838bab 100644 --- a/src/Umbraco.Web/Umbraco.Web.csproj +++ b/src/Umbraco.Web/Umbraco.Web.csproj @@ -1058,8 +1058,6 @@ - -