From 9bb5869cdeb7fc0b894445b840a29ffbf83d4d25 Mon Sep 17 00:00:00 2001 From: Shannon Date: Fri, 12 Sep 2014 11:50:56 +1000 Subject: [PATCH] reverting all things to do with additional list view column in db which is no longer necessary and removing additions to ui changes in the content tyep editor which are also no longer necessary --- src/Umbraco.Core/Models/ContentTypeBase.cs | 19 --- src/Umbraco.Core/Models/IContentTypeBase.cs | 5 - .../Models/Rdbms/ContentTypeDto.cs | 4 - .../Models/Rdbms/MemberTypeReadOnlyDto.cs | 5 - .../Factories/ContentTypeFactory.cs | 2 - .../Persistence/Factories/MediaTypeFactory.cs | 2 - .../Factories/MemberTypeFactory.cs | 1 - .../Factories/MemberTypeReadOnlyFactory.cs | 1 - .../Persistence/Mappers/ContentTypeMapper.cs | 1 - .../Persistence/Mappers/MediaTypeMapper.cs | 1 - .../Persistence/Mappers/MemberTypeMapper.cs | 1 - .../Services/EntityXmlSerializer.cs | 3 +- src/Umbraco.Core/Services/PackagingService.cs | 9 - .../common/resources/mediatype.resource.js | 32 ---- src/Umbraco.Web.UI/umbraco/config/lang/en.xml | 10 +- .../umbraco/config/lang/en_us.xml | 8 - .../controls/ContentTypeControlNew.ascx.cs | 155 ++---------------- src/umbraco.cms/businesslogic/ContentType.cs | 38 +---- src/umbraco.cms/businesslogic/media/Media.cs | 7 +- src/umbraco.cms/businesslogic/web/Document.cs | 13 +- 20 files changed, 27 insertions(+), 290 deletions(-) diff --git a/src/Umbraco.Core/Models/ContentTypeBase.cs b/src/Umbraco.Core/Models/ContentTypeBase.cs index 1fc0faf8c3..50212f2722 100644 --- a/src/Umbraco.Core/Models/ContentTypeBase.cs +++ b/src/Umbraco.Core/Models/ContentTypeBase.cs @@ -29,7 +29,6 @@ namespace Umbraco.Core.Models private int _creatorId; private bool _allowedAsRoot; private bool _isContainer; - private string _containerConfig; private bool _trashed; private PropertyGroupCollection _propertyGroups; private PropertyTypeCollection _propertyTypes; @@ -73,7 +72,6 @@ namespace Umbraco.Core.Models private static readonly PropertyInfo CreatorIdSelector = ExpressionHelper.GetPropertyInfo(x => x.CreatorId); private static readonly PropertyInfo AllowedAsRootSelector = ExpressionHelper.GetPropertyInfo(x => x.AllowedAsRoot); private static readonly PropertyInfo IsContainerSelector = ExpressionHelper.GetPropertyInfo(x => x.IsContainer); - private static readonly PropertyInfo ContainerConfigSelector = ExpressionHelper.GetPropertyInfo(x => x.ContainerConfig); private static readonly PropertyInfo TrashedSelector = ExpressionHelper.GetPropertyInfo(x => x.Trashed); private static readonly PropertyInfo AllowedContentTypesSelector = ExpressionHelper.GetPropertyInfo>(x => x.AllowedContentTypes); private static readonly PropertyInfo PropertyGroupCollectionSelector = ExpressionHelper.GetPropertyInfo(x => x.PropertyGroups); @@ -305,23 +303,6 @@ namespace Umbraco.Core.Models } } - /// - /// Gets or Sets a JSON string defining the configuration for this ContentType if set as a container - /// - [DataMember] - public virtual string ContainerConfig - { - get { return _containerConfig; } - set - { - SetPropertyValueAndDetectChanges(o => - { - _containerConfig = value; - return _containerConfig; - }, _containerConfig, ContainerConfigSelector); - } - } - /// /// Boolean indicating whether this ContentType is Trashed or not. /// If ContentType is Trashed it will be located in the Recyclebin. diff --git a/src/Umbraco.Core/Models/IContentTypeBase.cs b/src/Umbraco.Core/Models/IContentTypeBase.cs index 57195762c1..89fca20b8e 100644 --- a/src/Umbraco.Core/Models/IContentTypeBase.cs +++ b/src/Umbraco.Core/Models/IContentTypeBase.cs @@ -43,11 +43,6 @@ namespace Umbraco.Core.Models /// bool IsContainer { get; set; } - /// - /// Gets or Sets a JSON string defining the configuration for this ContentType if set as a container - /// - string ContainerConfig { get; set; } - /// /// Gets or Sets a list of integer Ids of the ContentTypes allowed under the ContentType /// diff --git a/src/Umbraco.Core/Models/Rdbms/ContentTypeDto.cs b/src/Umbraco.Core/Models/Rdbms/ContentTypeDto.cs index 9651e94e71..8d163abf44 100644 --- a/src/Umbraco.Core/Models/Rdbms/ContentTypeDto.cs +++ b/src/Umbraco.Core/Models/Rdbms/ContentTypeDto.cs @@ -39,10 +39,6 @@ namespace Umbraco.Core.Models.Rdbms [Constraint(Default = "0")] public bool IsContainer { get; set; } - [Column("containerConfig")] - [NullSetting(NullSetting = NullSettings.Null)] - public string ContainerConfig { get; set; } - [Column("allowAtRoot")] [Constraint(Default = "0")] public bool AllowAtRoot { get; set; } diff --git a/src/Umbraco.Core/Models/Rdbms/MemberTypeReadOnlyDto.cs b/src/Umbraco.Core/Models/Rdbms/MemberTypeReadOnlyDto.cs index 8118ca1bad..4833cb33f0 100644 --- a/src/Umbraco.Core/Models/Rdbms/MemberTypeReadOnlyDto.cs +++ b/src/Umbraco.Core/Models/Rdbms/MemberTypeReadOnlyDto.cs @@ -1,7 +1,6 @@ using System; using System.Collections.Generic; using Umbraco.Core.Persistence; -using Umbraco.Core.Persistence.DatabaseAnnotations; namespace Umbraco.Core.Models.Rdbms { @@ -63,10 +62,6 @@ namespace Umbraco.Core.Models.Rdbms [Column("isContainer")] public bool IsContainer { get; set; } - [Column("containerConfig")] - [NullSetting(NullSetting = NullSettings.Null)] - public string ContainerConfig { get; set; } - [Column("allowAtRoot")] public bool AllowAtRoot { get; set; } diff --git a/src/Umbraco.Core/Persistence/Factories/ContentTypeFactory.cs b/src/Umbraco.Core/Persistence/Factories/ContentTypeFactory.cs index 20686269b0..cc9ab387f8 100644 --- a/src/Umbraco.Core/Persistence/Factories/ContentTypeFactory.cs +++ b/src/Umbraco.Core/Persistence/Factories/ContentTypeFactory.cs @@ -38,7 +38,6 @@ namespace Umbraco.Core.Persistence.Factories CreatorId = dto.ContentTypeDto.NodeDto.UserId.Value, AllowedAsRoot = dto.ContentTypeDto.AllowAtRoot, IsContainer = dto.ContentTypeDto.IsContainer, - ContainerConfig = dto.ContentTypeDto.ContainerConfig, Trashed = dto.ContentTypeDto.NodeDto.Trashed, DefaultTemplateId = dto.TemplateNodeId }; @@ -75,7 +74,6 @@ namespace Umbraco.Core.Persistence.Factories NodeId = entity.Id, AllowAtRoot = entity.AllowedAsRoot, IsContainer = entity.IsContainer, - ContainerConfig = entity.ContainerConfig, NodeDto = BuildNodeDto(entity) }; return contentTypeDto; diff --git a/src/Umbraco.Core/Persistence/Factories/MediaTypeFactory.cs b/src/Umbraco.Core/Persistence/Factories/MediaTypeFactory.cs index 498e35b83d..ee2709a79e 100644 --- a/src/Umbraco.Core/Persistence/Factories/MediaTypeFactory.cs +++ b/src/Umbraco.Core/Persistence/Factories/MediaTypeFactory.cs @@ -37,7 +37,6 @@ namespace Umbraco.Core.Persistence.Factories CreatorId = dto.NodeDto.UserId.Value, AllowedAsRoot = dto.AllowAtRoot, IsContainer = dto.IsContainer, - ContainerConfig = dto.ContainerConfig, Trashed = dto.NodeDto.Trashed }; //on initial construction we don't want to have dirty properties tracked @@ -57,7 +56,6 @@ namespace Umbraco.Core.Persistence.Factories NodeId = entity.Id, AllowAtRoot = entity.AllowedAsRoot, IsContainer = entity.IsContainer, - ContainerConfig = entity.ContainerConfig, NodeDto = BuildNodeDto(entity) }; return contentTypeDto; diff --git a/src/Umbraco.Core/Persistence/Factories/MemberTypeFactory.cs b/src/Umbraco.Core/Persistence/Factories/MemberTypeFactory.cs index f37db94c87..49feb5f8c8 100644 --- a/src/Umbraco.Core/Persistence/Factories/MemberTypeFactory.cs +++ b/src/Umbraco.Core/Persistence/Factories/MemberTypeFactory.cs @@ -32,7 +32,6 @@ namespace Umbraco.Core.Persistence.Factories NodeId = entity.Id, AllowAtRoot = entity.AllowedAsRoot, IsContainer = entity.IsContainer, - ContainerConfig = entity.ContainerConfig, NodeDto = BuildNodeDto(entity) }; return contentTypeDto; diff --git a/src/Umbraco.Core/Persistence/Factories/MemberTypeReadOnlyFactory.cs b/src/Umbraco.Core/Persistence/Factories/MemberTypeReadOnlyFactory.cs index 37f987930e..2a59f564e2 100644 --- a/src/Umbraco.Core/Persistence/Factories/MemberTypeReadOnlyFactory.cs +++ b/src/Umbraco.Core/Persistence/Factories/MemberTypeReadOnlyFactory.cs @@ -23,7 +23,6 @@ namespace Umbraco.Core.Persistence.Factories Icon = dto.Icon, Id = dto.NodeId, IsContainer = dto.IsContainer, - ContainerConfig = dto.ContainerConfig, Key = dto.UniqueId.Value, Level = dto.Level, Name = dto.Text, diff --git a/src/Umbraco.Core/Persistence/Mappers/ContentTypeMapper.cs b/src/Umbraco.Core/Persistence/Mappers/ContentTypeMapper.cs index c8b619161d..943b42b2ba 100644 --- a/src/Umbraco.Core/Persistence/Mappers/ContentTypeMapper.cs +++ b/src/Umbraco.Core/Persistence/Mappers/ContentTypeMapper.cs @@ -47,7 +47,6 @@ namespace Umbraco.Core.Persistence.Mappers CacheMap(src => src.Description, dto => dto.Description); CacheMap(src => src.Icon, dto => dto.Icon); CacheMap(src => src.IsContainer, dto => dto.IsContainer); - CacheMap(src => src.ContainerConfig, dto => dto.ContainerConfig); CacheMap(src => src.Thumbnail, dto => dto.Thumbnail); } } diff --git a/src/Umbraco.Core/Persistence/Mappers/MediaTypeMapper.cs b/src/Umbraco.Core/Persistence/Mappers/MediaTypeMapper.cs index 912ae19e2f..70e4b5c861 100644 --- a/src/Umbraco.Core/Persistence/Mappers/MediaTypeMapper.cs +++ b/src/Umbraco.Core/Persistence/Mappers/MediaTypeMapper.cs @@ -47,7 +47,6 @@ namespace Umbraco.Core.Persistence.Mappers CacheMap(src => src.Description, dto => dto.Description); CacheMap(src => src.Icon, dto => dto.Icon); CacheMap(src => src.IsContainer, dto => dto.IsContainer); - CacheMap(src => src.ContainerConfig, dto => dto.ContainerConfig); CacheMap(src => src.Thumbnail, dto => dto.Thumbnail); } } diff --git a/src/Umbraco.Core/Persistence/Mappers/MemberTypeMapper.cs b/src/Umbraco.Core/Persistence/Mappers/MemberTypeMapper.cs index 192c3ee090..69a5190b46 100644 --- a/src/Umbraco.Core/Persistence/Mappers/MemberTypeMapper.cs +++ b/src/Umbraco.Core/Persistence/Mappers/MemberTypeMapper.cs @@ -48,7 +48,6 @@ namespace Umbraco.Core.Persistence.Mappers CacheMap(src => src.Description, dto => dto.Description); CacheMap(src => src.Icon, dto => dto.Icon); CacheMap(src => src.IsContainer, dto => dto.IsContainer); - CacheMap(src => src.ContainerConfig, dto => dto.ContainerConfig); CacheMap(src => src.Thumbnail, dto => dto.Thumbnail); } } diff --git a/src/Umbraco.Core/Services/EntityXmlSerializer.cs b/src/Umbraco.Core/Services/EntityXmlSerializer.cs index b56d854044..c260b10418 100644 --- a/src/Umbraco.Core/Services/EntityXmlSerializer.cs +++ b/src/Umbraco.Core/Services/EntityXmlSerializer.cs @@ -305,8 +305,7 @@ namespace Umbraco.Core.Services new XElement("Thumbnail", contentType.Thumbnail), new XElement("Description", contentType.Description), new XElement("AllowAtRoot", contentType.AllowedAsRoot.ToString()), - new XElement("IsListView", contentType.IsContainer.ToString()), - new XElement("ContainerConfig", contentType.ContainerConfig.ToString())); + new XElement("IsListView", contentType.IsContainer.ToString())); var masterContentType = contentType.CompositionAliases().FirstOrDefault(); if (masterContentType != null) diff --git a/src/Umbraco.Core/Services/PackagingService.cs b/src/Umbraco.Core/Services/PackagingService.cs index 44551096c5..47310ab1c3 100644 --- a/src/Umbraco.Core/Services/PackagingService.cs +++ b/src/Umbraco.Core/Services/PackagingService.cs @@ -423,17 +423,8 @@ namespace Umbraco.Core.Services //NOTE IsListView is a new property in the package xml so we need to verify it exists before using it. var isListView = infoElement.Element("IsListView"); if (isListView != null) - { contentType.IsContainer = isListView.Value.InvariantEquals("true"); - //NOTE ContainerConfig is a new property in the package xml so we need to verify it exists before using it. - var containerConfig = infoElement.Element("ContainerConfig"); - if (containerConfig != null) - { - contentType.ContainerConfig = containerConfig.Value; - } - } - UpdateContentTypesAllowedTemplates(contentType, infoElement.Element("AllowedTemplates"), defaultTemplateElement); UpdateContentTypesTabs(contentType, documentType.Element("Tabs")); UpdateContentTypesProperties(contentType, documentType.Element("GenericProperties")); diff --git a/src/Umbraco.Web.UI.Client/src/common/resources/mediatype.resource.js b/src/Umbraco.Web.UI.Client/src/common/resources/mediatype.resource.js index 9f4ac83c11..94699d4195 100644 --- a/src/Umbraco.Web.UI.Client/src/common/resources/mediatype.resource.js +++ b/src/Umbraco.Web.UI.Client/src/common/resources/mediatype.resource.js @@ -35,38 +35,6 @@ function mediaTypeResource($q, $http, umbRequestHelper) { "GetAllowedChildren", [{ contentId: mediaId }])), 'Failed to retrieve allowed types for media id ' + mediaId); - }, - - /** - * @ngdoc method - * @name umbraco.resources.mediaTypeResource#getContainerConfig - * @methodOf umbraco.resources.mediaTypeResource - * - * @description - * Returns a JSON structure for configuration of the container content type - * - * ##usage - *
-         * mediaTypeResource.getContainerConfig(1234)
-         *    .then(function(config) {
-         *      $scope.options = {
-         *         pageSize: config.pageSize,
-         *      };
-         *    });
-         * 
- * @param {Int} contentId id of the content item to retrive the container config for - * @returns {Promise} resourcePromise object. - * - */ - getContainerConfig: function (contentId) { - - return umbRequestHelper.resourcePromise( - $http.get( - umbRequestHelper.getApiUrl( - "mediaTypeApiBaseUrl", - "GetContainerConfig", - [{ contentId: contentId }])), - 'Failed to retrieve container config data for media id ' + contentId); } }; diff --git a/src/Umbraco.Web.UI/umbraco/config/lang/en.xml b/src/Umbraco.Web.UI/umbraco/config/lang/en.xml index 06d1bf2ba4..b034f935b2 100644 --- a/src/Umbraco.Web.UI/umbraco/config/lang/en.xml +++ b/src/Umbraco.Web.UI/umbraco/config/lang/en.xml @@ -84,7 +84,6 @@ Insert macro Insert picture Edit relations - Return to list Save Save and publish Save and send for approval @@ -255,13 +254,6 @@ Tab Thumbnail Enable list view - Number of entries per page when selected for display in list view.]]> - Select the additional columns displayed after the node name.]]> - The default order for the list.]]> - The direction of the default order for the list.]]> - Indicates if bulk publishing is allowed when defined as a list view]]> - Indicates if bulk unpublishing is allowed when defined as a list view]]> - Indicates if bulk deletion is allowed when defined as a list view]]> Add prevalue @@ -996,4 +988,4 @@ To manage your website, simply open the Umbraco back office and start adding con Your recent history Session expires in - + \ No newline at end of file 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 8b12f9ee9c..a5f687ecfe 100644 --- a/src/Umbraco.Web.UI/umbraco/config/lang/en_us.xml +++ b/src/Umbraco.Web.UI/umbraco/config/lang/en_us.xml @@ -87,7 +87,6 @@ Insert macro Insert picture Edit relations - Return to list Save Save and publish Save and send for approval @@ -260,13 +259,6 @@ Tab Thumbnail Enable list view - Number of entries per page when selected for display in list view.]]> - Select the additional columns displayed after the node name.]]> - The default order for the list.]]> - The direction of the default order for the list.]]> - Indicates if bulk publishing is allowed when defined as a list view]]> - Indicates if bulk unpublishing is allowed when defined as a list view]]> - Indicates if bulk deletion is allowed when defined as a list view]]> Add prevalue diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/controls/ContentTypeControlNew.ascx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/controls/ContentTypeControlNew.ascx.cs index 93388b174b..15ef6a76e0 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/controls/ContentTypeControlNew.ascx.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/controls/ContentTypeControlNew.ascx.cs @@ -7,23 +7,30 @@ using System.IO; using System.Linq; using System.Web; using System.Web.Mvc; +using System.Threading.Tasks; +using System.Web; using System.Web.Routing; using System.Web.UI; using System.Web.UI.HtmlControls; using System.Web.UI.WebControls; using ClientDependency.Core; using Umbraco.Core; +using Umbraco.Core.Configuration; +using Umbraco.Core.Logging; using Umbraco.Core.Models; +using Umbraco.Core.Strings; using Umbraco.Web.UI.Controls; +using umbraco.BusinessLogic; +using umbraco.cms.businesslogic; +using umbraco.cms.businesslogic.propertytype; using umbraco.cms.businesslogic.web; using umbraco.cms.helpers; using umbraco.controls.GenericProperties; using Umbraco.Core.IO; +using umbraco.presentation; using umbraco.BasePages; using ContentType = umbraco.cms.businesslogic.ContentType; using PropertyType = Umbraco.Core.Models.PropertyType; -using Umbraco.Web.Models.ContentEditing; -using Newtonsoft.Json; namespace umbraco.controls { @@ -107,14 +114,6 @@ namespace umbraco.controls pp_icon.Text = ui.Text("icon", Security.CurrentUser); pp_isContainer.Text = ui.Text("editcontenttype", "hasListView", Security.CurrentUser); - - pp_containerConfigPageSize.Text = ui.Text("editcontenttype", "containerConfigPageSize", Security.CurrentUser); - pp_containerConfigAdditionalColumns.Text = ui.Text("editcontenttype", "containerConfigAdditionalColumns", Security.CurrentUser); - pp_containerConfigOrderBy.Text = ui.Text("editcontenttype", "containerConfigOrderBy", Security.CurrentUser); - pp_containerConfigOrderDirection.Text = ui.Text("editcontenttype", "containerConfigOrderDirection", Security.CurrentUser); - pp_allowBulkPublish.Text = ui.Text("editcontenttype", "allowBulkPublish", Security.CurrentUser); - pp_allowBulkUnpublish.Text = ui.Text("editcontenttype", "allowBulkUnpublish", Security.CurrentUser); - pp_allowBulkDelete.Text = ui.Text("editcontenttype", "allowBulkDelete", Security.CurrentUser); // we'll disable this... if (!Page.IsPostBack && _contentType.MasterContentType != 0) @@ -300,20 +299,12 @@ namespace umbraco.controls _contentType.ContentTypeItem.Name = txtName.Text; _contentType.ContentTypeItem.Alias = txtAlias.Text; // raw, contentType.Alias takes care of it - _contentType.ContentTypeItem.Icon = tb_icon.Value; + _contentType.ContentTypeItem.Icon = tb_icon.Value; _contentType.ContentTypeItem.Description = description.Text; //_contentType.ContentTypeItem.Thumbnail = ddlThumbnails.SelectedValue; _contentType.ContentTypeItem.AllowedAsRoot = allowAtRoot.Checked; - _contentType.ContentTypeItem.IsContainer = cb_isContainer.Checked; - if (cb_isContainer.Checked) - { - _contentType.ContentTypeItem.ContainerConfig = GetProvidedContainerConfigAsJsonString(); - } - else - { - _contentType.ContentTypeItem.ContainerConfig = string.Empty; - } - + _contentType.ContentTypeItem.IsContainer = cb_isContainer.Checked; + int i = 0; var ids = SaveAllowedChildTypes(); _contentType.ContentTypeItem.AllowedContentTypes = ids.Select(x => new ContentTypeSort {Id = new Lazy(() => x), SortOrder = i++}); @@ -412,49 +403,6 @@ namespace umbraco.controls Page.ExecuteRegisteredAsyncTasks(); } - /// - /// Helper to retrive the strongly typed container configuration from the persisted JSON string - /// - /// Container configuration as JSON string - private ContentTypeContainerConfiguration GetContentTypeContainerConfigurationFromJsonString(string config) - { - return JsonConvert.DeserializeObject(config); - } - - /// - /// Helper to parse the container configuration provided by the form fields into a JSON string for persistance - /// - /// Container configuration as JSON string - private string GetProvidedContainerConfigAsJsonString() - { - // Create configuation from form fields - var containerConfig = new ContentTypeContainerConfiguration - { - AdditionalColumnAliases = txtContainerConfigAdditionalColumns.Text, - OrderBy = ddlContainerConfigOrderBy.SelectedItem.Value, - OrderDirection = ddlContainerConfigOrderDirection.SelectedItem.Value, - AllowBulkPublish = ddlContainerConfigAllowBulkPublish.SelectedIndex == 0, - AllowBulkUnpublish = ddlContainerConfigAllowBulkUnpublish.SelectedIndex == 0, - AllowBulkDelete = ddlContainerConfigAllowBulkDelete.SelectedIndex == 0, - }; - - int pageSize; - if (!int.TryParse(txtContainerConfigPageSize.Text, out pageSize)) - { - pageSize = 10; - } - - containerConfig.PageSize = pageSize; - - // Serialize the object ignoring nulls so the calculated properties are not persisted - return JsonConvert.SerializeObject(containerConfig, - Formatting.None, - new JsonSerializerSettings - { - NullValueHandling = NullValueHandling.Ignore - }); - } - /// /// Loads the current ContentType from the id found in the querystring. /// The correct type is loaded based on editing location (DocumentType, MediaType or MemberType). @@ -661,63 +609,8 @@ jQuery(document).ready(function() {{ refreshDropDowns(); }}); DualAllowedContentTypes.Value = chosenContentTypeIDs; } - // Set up options for columns and order by - ddlContainerConfigOrderBy.Items.Add(new ListItem(string.Empty, string.Empty)); - ddlContainerConfigOrderBy.Items.Add(new ListItem("Node name", "Name")); - ddlContainerConfigOrderBy.Items.Add(new ListItem("Last edited on", "UpdateDate")); - ddlContainerConfigOrderBy.Items.Add(new ListItem("Last updated by", "Updator")); - ddlContainerConfigOrderBy.Items.Add(new ListItem("Created on", "CreateDate")); - ddlContainerConfigOrderBy.Items.Add(new ListItem("Created by", "Owner")); - - ddlContainerConfigAdditionalColumnsChooser.Items.Add(new ListItem("Select a column...", string.Empty)); - ddlContainerConfigAdditionalColumnsChooser.Items.Add(new ListItem("Last edited on", "UpdateDate")); - ddlContainerConfigAdditionalColumnsChooser.Items.Add(new ListItem("Last updated by", "Updator")); - ddlContainerConfigAdditionalColumnsChooser.Items.Add(new ListItem("Created on", "CreateDate")); - ddlContainerConfigAdditionalColumnsChooser.Items.Add(new ListItem("Created by", "Owner")); - ddlContainerConfigAdditionalColumnsChooser.Items.Add(new ListItem("---", string.Empty)); - - // - get properties from allowed document types (i.e. those that might appear in the list view) - var allPropertiesOfAllowedContentTypes = Services.ContentTypeService - .GetAllContentTypes(_contentType.AllowedChildContentTypeIDs) - .SelectMany(x => x.PropertyTypes) - .ToList(); - foreach (var property in allPropertiesOfAllowedContentTypes) - { - ddlContainerConfigAdditionalColumnsChooser.Items.Add(new ListItem(property.Name, property.Alias)); - } - - // Populate controls with values allowAtRoot.Checked = _contentType.AllowAtRoot; cb_isContainer.Checked = _contentType.IsContainerContentType; - - ddlContainerConfigOrderBy.SelectedIndex = -1; - ddlContainerConfigOrderDirection.SelectedIndex = -1; - ddlContainerConfigAllowBulkPublish.SelectedIndex = -1; - ddlContainerConfigAllowBulkUnpublish.SelectedIndex = -1; - ddlContainerConfigAllowBulkDelete.SelectedIndex = -1; - - if (_contentType.IsContainerContentType && !string.IsNullOrEmpty(_contentType.ContainerConfig)) - { - var containerConfig = GetContentTypeContainerConfigurationFromJsonString(_contentType.ContainerConfig); - txtContainerConfigPageSize.Text = containerConfig.PageSize.ToString(); - txtContainerConfigAdditionalColumns.Text = containerConfig.AdditionalColumnAliases; - ddlContainerConfigOrderBy.Items.FindByValue(containerConfig.OrderBy).Selected = true; - ddlContainerConfigOrderDirection.Items.FindByValue(containerConfig.OrderDirection).Selected = true; - ddlContainerConfigAllowBulkPublish.SelectedIndex = containerConfig.AllowBulkPublish ? 0 : 1; - ddlContainerConfigAllowBulkUnpublish.SelectedIndex = containerConfig.AllowBulkUnpublish ? 0 : 1; - ddlContainerConfigAllowBulkDelete.SelectedIndex = containerConfig.AllowBulkDelete ? 0 : 1; - } - else - { - // Set defaults matching original hard-coded values unless config has been provided - txtContainerConfigPageSize.Text = "10"; - txtContainerConfigAdditionalColumns.Text = "UpdateDate,Updator"; - ddlContainerConfigOrderBy.Items.FindByValue("UpdateDate").Selected = true; - ddlContainerConfigOrderDirection.Items.FindByValue("desc").Selected = true; - ddlContainerConfigAllowBulkPublish.SelectedIndex = 0; - ddlContainerConfigAllowBulkUnpublish.SelectedIndex = 0; - ddlContainerConfigAllowBulkDelete.SelectedIndex = 0; - } } private int[] SaveAllowedChildTypes() @@ -1540,29 +1433,7 @@ jQuery(document).ready(function() {{ refreshDropDowns(); }}); protected global::umbraco.uicontrols.PropertyPanel pp_newTab; protected global::umbraco.uicontrols.PropertyPanel pp_isContainer; - protected global::System.Web.UI.WebControls.CheckBox cb_isContainer; - - protected global::umbraco.uicontrols.PropertyPanel pp_containerConfigPageSize; - protected global::System.Web.UI.WebControls.TextBox txtContainerConfigPageSize; - - protected global::umbraco.uicontrols.PropertyPanel pp_containerConfigAdditionalColumns; - protected global::System.Web.UI.WebControls.DropDownList ddlContainerConfigAdditionalColumnsChooser; - protected global::System.Web.UI.WebControls.TextBox txtContainerConfigAdditionalColumns; - - protected global::umbraco.uicontrols.PropertyPanel pp_containerConfigOrderBy; - protected global::System.Web.UI.WebControls.DropDownList ddlContainerConfigOrderBy; - - protected global::umbraco.uicontrols.PropertyPanel pp_containerConfigOrderDirection; - protected global::System.Web.UI.WebControls.DropDownList ddlContainerConfigOrderDirection; - - protected global::umbraco.uicontrols.PropertyPanel pp_allowBulkPublish; - protected global::System.Web.UI.WebControls.DropDownList ddlContainerConfigAllowBulkPublish; - - protected global::umbraco.uicontrols.PropertyPanel pp_allowBulkUnpublish; - protected global::System.Web.UI.WebControls.DropDownList ddlContainerConfigAllowBulkUnpublish; - - protected global::umbraco.uicontrols.PropertyPanel pp_allowBulkDelete; - protected global::System.Web.UI.WebControls.DropDownList ddlContainerConfigAllowBulkDelete; + protected global::System.Web.UI.WebControls.CheckBox cb_isContainer; /// /// txtNewTab control. diff --git a/src/umbraco.cms/businesslogic/ContentType.cs b/src/umbraco.cms/businesslogic/ContentType.cs index 02d727621e..822bc79cc0 100644 --- a/src/umbraco.cms/businesslogic/ContentType.cs +++ b/src/umbraco.cms/businesslogic/ContentType.cs @@ -60,13 +60,12 @@ namespace umbraco.cms.businesslogic /// /// /// - /// containerConfig /// /// This is like creating a ContentType node using optimized mode but this lets you set /// all of the properties that are initialized normally from the database. /// This is used for performance reasons. /// - internal ContentType(int id, string alias, string icon, string thumbnail, int? masterContentType, bool? isContainer, string containerConfig) + internal ContentType(int id, string alias, string icon, string thumbnail, int? masterContentType, bool? isContainer) : base(id, true) { _alias = alias; @@ -78,8 +77,6 @@ namespace umbraco.cms.businesslogic if (isContainer.HasValue) _isContainerContentType = isContainer.Value; - - _containerConfig = containerConfig; } internal ContentType(IContentTypeComposition contentType) : base(contentType) @@ -93,7 +90,7 @@ namespace umbraco.cms.businesslogic protected internal const string m_SQLOptimizedGetAll = @" SELECT id, createDate, trashed, parentId, nodeObjectType, nodeUser, level, path, sortOrder, uniqueID, text, - allowAtRoot, isContainer, containerConfig, Alias,icon,thumbnail,description + allowAtRoot, isContainer, Alias,icon,thumbnail,description FROM umbracoNode INNER JOIN cmsContentType ON umbracoNode.id = cmsContentType.nodeId WHERE nodeObjectType = @nodeObjectType"; @@ -253,7 +250,6 @@ namespace umbraco.cms.businesslogic private string _thumbnail; List m_masterContentTypes; private bool _isContainerContentType; - private string _containerConfig; private List _allowedChildContentTypeIDs; private List _virtualTabs; @@ -434,32 +430,6 @@ namespace umbraco.cms.businesslogic } } - /// - /// Get or Sets the container configuration of the Content Type for types defined as containers - /// - public string ContainerConfig - { - get { return _containerConfig; } - set - { - _containerConfig = value; - - //This switches between using new vs. legacy api. - //Note that this is currently only done to support both DocumentType and MediaType, which use the new api and MemberType that doesn't. - if (ContentTypeItem == null) - { - SqlHelper.ExecuteNonQuery( - "update cmsContentType set containerConfig = @containerConfig where nodeId = @id", - SqlHelper.CreateParameter("@containerConfig", value), - SqlHelper.CreateParameter("@id", Id)); - } - else - { - ContentTypeItem.ContainerConfig = _containerConfig; - } - } - } - /// /// Gets or sets the 'allow at root' boolean /// @@ -1136,7 +1106,6 @@ namespace umbraco.cms.businesslogic _alias = contentType.Alias; _iconurl = contentType.Icon; _isContainerContentType = contentType.IsContainer; - _containerConfig = contentType.ContainerConfig; _allowAtRoot = contentType.AllowedAsRoot; _thumbnail = contentType.Thumbnail; _description = contentType.Description; @@ -1150,7 +1119,6 @@ namespace umbraco.cms.businesslogic _alias = dr.GetString("Alias"); _iconurl = dr.GetString("icon"); _isContainerContentType = dr.GetBoolean("isContainer"); - _containerConfig = dr.GetString("containerConfig"); _allowAtRoot = dr.GetBoolean("allowAtRoot"); if (!dr.IsNull("thumbnail")) @@ -1196,7 +1164,7 @@ namespace umbraco.cms.businesslogic } // TODO: Load master content types - using (var dr = SqlHelper.ExecuteReader("Select allowAtRoot, isContainer, containerConfig, Alias,icon,thumbnail,description from cmsContentType where nodeid=" + Id) + using (var dr = SqlHelper.ExecuteReader("Select allowAtRoot, isContainer, Alias,icon,thumbnail,description from cmsContentType where nodeid=" + Id) ) { if (dr.Read()) diff --git a/src/umbraco.cms/businesslogic/media/Media.cs b/src/umbraco.cms/businesslogic/media/Media.cs index 1b1208b44b..073977aca5 100644 --- a/src/umbraco.cms/businesslogic/media/Media.cs +++ b/src/umbraco.cms/businesslogic/media/Media.cs @@ -361,8 +361,7 @@ namespace umbraco.cms.businesslogic.media , dr.GetString("description") , null , dr.GetInt("contentTypeId") - , dr.GetBoolean("isContainer") - , dr.GetString("containerConfig")); + , dr.GetBoolean("isContainer")); } #endregion @@ -384,10 +383,10 @@ namespace umbraco.cms.businesslogic.media [Obsolete("Obsolete, This method is no longer needed", false)] private void SetupMediaForTree(Guid uniqueId, int level, int parentId, int user, string path, string text, DateTime createDate, string icon, bool hasChildren, string contentTypeAlias, string contentTypeThumb, - string contentTypeDesc, int? masterContentType, int contentTypeId, bool isContainer, string containerConfig) + string contentTypeDesc, int? masterContentType, int contentTypeId, bool isContainer) { SetupNodeForTree(uniqueId, _objectType, level, parentId, user, path, text, createDate, hasChildren); - ContentType = new ContentType(contentTypeId, contentTypeAlias, icon, contentTypeThumb, masterContentType, isContainer, containerConfig); + ContentType = new ContentType(contentTypeId, contentTypeAlias, icon, contentTypeThumb, masterContentType, isContainer); ContentTypeIcon = icon; } diff --git a/src/umbraco.cms/businesslogic/web/Document.cs b/src/umbraco.cms/businesslogic/web/Document.cs index 6bd6e1f028..44d22945c5 100644 --- a/src/umbraco.cms/businesslogic/web/Document.cs +++ b/src/umbraco.cms/businesslogic/web/Document.cs @@ -93,7 +93,7 @@ namespace umbraco.cms.businesslogic.web Content.UpdateDate, Content.UpdateDate, Content.ContentType.Icon, hasChildren, Content.ContentType.Alias, Content.ContentType.Thumbnail, Content.ContentType.Description, null, Content.ContentType.Id, - templateId, Content.ContentType.IsContainer, Content.ContentType.ContainerConfig); + templateId, Content.ContentType.IsContainer); var tmpReleaseDate = Content.ReleaseDate.HasValue ? Content.ReleaseDate.Value : new DateTime(); var tmpExpireDate = Content.ExpireDate.HasValue ? Content.ExpireDate.Value : new DateTime(); @@ -1493,11 +1493,10 @@ namespace umbraco.cms.businesslogic.web , dr.GetString("alias") , dr.GetString("thumbnail") , dr.GetString("description") - , null + , null , dr.GetInt("contentTypeId") - , dr.GetInt("templateId") - , dr.GetBoolean("isContainer") - , dr.GetString("containerConfig")); + , dr.GetInt("templateId") + , dr.GetBoolean("isContainer")); if (!dr.IsNull("releaseDate")) _release = dr.GetDateTime("releaseDate"); @@ -1517,7 +1516,7 @@ namespace umbraco.cms.businesslogic.web private void SetupDocumentForTree(Guid uniqueId, int level, int parentId, int creator, int writer, bool publish, string path, string text, DateTime createDate, DateTime updateDate, DateTime versionDate, string icon, bool hasChildren, string contentTypeAlias, string contentTypeThumb, - string contentTypeDesc, int? masterContentType, int contentTypeId, int templateId, bool isContainer, string containerConfig) + string contentTypeDesc, int? masterContentType, int contentTypeId, int templateId, bool isContainer) { SetupNodeForTree(uniqueId, _objectType, level, parentId, creator, path, text, createDate, hasChildren); @@ -1525,7 +1524,7 @@ namespace umbraco.cms.businesslogic.web _published = publish; _updated = updateDate; _template = templateId; - ContentType = new ContentType(contentTypeId, contentTypeAlias, icon, contentTypeThumb, null, isContainer, containerConfig); + ContentType = new ContentType(contentTypeId, contentTypeAlias, icon, contentTypeThumb, null, isContainer); ContentTypeIcon = icon; VersionDate = versionDate; }