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

This commit is contained in:
Shannon
2014-09-12 11:50:56 +10:00
parent 1844b048be
commit 9bb5869cde
20 changed files with 27 additions and 290 deletions

View File

@@ -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<ContentTypeBase, int>(x => x.CreatorId);
private static readonly PropertyInfo AllowedAsRootSelector = ExpressionHelper.GetPropertyInfo<ContentTypeBase, bool>(x => x.AllowedAsRoot);
private static readonly PropertyInfo IsContainerSelector = ExpressionHelper.GetPropertyInfo<ContentTypeBase, bool>(x => x.IsContainer);
private static readonly PropertyInfo ContainerConfigSelector = ExpressionHelper.GetPropertyInfo<ContentTypeBase, string>(x => x.ContainerConfig);
private static readonly PropertyInfo TrashedSelector = ExpressionHelper.GetPropertyInfo<ContentTypeBase, bool>(x => x.Trashed);
private static readonly PropertyInfo AllowedContentTypesSelector = ExpressionHelper.GetPropertyInfo<ContentTypeBase, IEnumerable<ContentTypeSort>>(x => x.AllowedContentTypes);
private static readonly PropertyInfo PropertyGroupCollectionSelector = ExpressionHelper.GetPropertyInfo<ContentTypeBase, PropertyGroupCollection>(x => x.PropertyGroups);
@@ -305,23 +303,6 @@ namespace Umbraco.Core.Models
}
}
/// <summary>
/// Gets or Sets a JSON string defining the configuration for this ContentType if set as a container
/// </summary>
[DataMember]
public virtual string ContainerConfig
{
get { return _containerConfig; }
set
{
SetPropertyValueAndDetectChanges(o =>
{
_containerConfig = value;
return _containerConfig;
}, _containerConfig, ContainerConfigSelector);
}
}
/// <summary>
/// Boolean indicating whether this ContentType is Trashed or not.
/// If ContentType is Trashed it will be located in the Recyclebin.

View File

@@ -43,11 +43,6 @@ namespace Umbraco.Core.Models
/// </remarks>
bool IsContainer { get; set; }
/// <summary>
/// Gets or Sets a JSON string defining the configuration for this ContentType if set as a container
/// </summary>
string ContainerConfig { get; set; }
/// <summary>
/// Gets or Sets a list of integer Ids of the ContentTypes allowed under the ContentType
/// </summary>

View File

@@ -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; }

View File

@@ -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; }

View File

@@ -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;

View File

@@ -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;

View File

@@ -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;

View File

@@ -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,

View File

@@ -47,7 +47,6 @@ namespace Umbraco.Core.Persistence.Mappers
CacheMap<ContentType, ContentTypeDto>(src => src.Description, dto => dto.Description);
CacheMap<ContentType, ContentTypeDto>(src => src.Icon, dto => dto.Icon);
CacheMap<ContentType, ContentTypeDto>(src => src.IsContainer, dto => dto.IsContainer);
CacheMap<ContentType, ContentTypeDto>(src => src.ContainerConfig, dto => dto.ContainerConfig);
CacheMap<ContentType, ContentTypeDto>(src => src.Thumbnail, dto => dto.Thumbnail);
}
}

View File

@@ -47,7 +47,6 @@ namespace Umbraco.Core.Persistence.Mappers
CacheMap<MediaType, ContentTypeDto>(src => src.Description, dto => dto.Description);
CacheMap<MediaType, ContentTypeDto>(src => src.Icon, dto => dto.Icon);
CacheMap<MediaType, ContentTypeDto>(src => src.IsContainer, dto => dto.IsContainer);
CacheMap<MediaType, ContentTypeDto>(src => src.ContainerConfig, dto => dto.ContainerConfig);
CacheMap<MediaType, ContentTypeDto>(src => src.Thumbnail, dto => dto.Thumbnail);
}
}

View File

@@ -48,7 +48,6 @@ namespace Umbraco.Core.Persistence.Mappers
CacheMap<MemberType, ContentTypeDto>(src => src.Description, dto => dto.Description);
CacheMap<MemberType, ContentTypeDto>(src => src.Icon, dto => dto.Icon);
CacheMap<MemberType, ContentTypeDto>(src => src.IsContainer, dto => dto.IsContainer);
CacheMap<MemberType, ContentTypeDto>(src => src.ContainerConfig, dto => dto.ContainerConfig);
CacheMap<MemberType, ContentTypeDto>(src => src.Thumbnail, dto => dto.Thumbnail);
}
}

View File

@@ -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)

View File

@@ -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"));

View File

@@ -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
* <pre>
* mediaTypeResource.getContainerConfig(1234)
* .then(function(config) {
* $scope.options = {
* pageSize: config.pageSize,
* };
* });
* </pre>
* @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);
}
};

View File

@@ -84,7 +84,6 @@
<key alias="macroInsert">Insert macro</key>
<key alias="pictureInsert">Insert picture</key>
<key alias="relations">Edit relations</key>
<key alias="returnToList">Return to list</key>
<key alias="save">Save</key>
<key alias="saveAndPublish">Save and publish</key>
<key alias="saveToPublish">Save and send for approval</key>
@@ -255,13 +254,6 @@
<key alias="tab">Tab</key>
<key alias="thumbnail">Thumbnail</key>
<key alias="hasListView">Enable list view</key>
<key alias="containerConfigPageSize"><![CDATA[Page size<br/><small>Number of entries per page when selected for display in list view.</small>]]></key>
<key alias="containerConfigAdditionalColumns"><![CDATA[Additional columns<br/><small>Select the additional columns displayed after the node name.</small>]]></key>
<key alias="containerConfigOrderBy"><![CDATA[Order by<br/><small>The default order for the list.</small>]]></key>
<key alias="containerConfigOrderDirection"><![CDATA[Order direction<br/><small>The direction of the default order for the list.</small>]]></key>
<key alias="allowBulkPublish"><![CDATA[Allow bulk publish<br/><small>Indicates if bulk publishing is allowed when defined as a list view</small>]]></key>
<key alias="allowBulkUnpublish"><![CDATA[Allow bulk unpublish<br/><small>Indicates if bulk unpublishing is allowed when defined as a list view</small>]]></key>
<key alias="allowBulkDelete"><![CDATA[Allow bulk delete<br/><small>Indicates if bulk deletion is allowed when defined as a list view</small>]]></key>
</area>
<area alias="editdatatype">
<key alias="addPrevalue">Add prevalue</key>
@@ -996,4 +988,4 @@ To manage your website, simply open the Umbraco back office and start adding con
<key alias="yourHistory" version="7.0">Your recent history</key>
<key alias="sessionExpires" version="7.0">Session expires in</key>
</area>
</language>
</language>

View File

@@ -87,7 +87,6 @@
<key alias="macroInsert">Insert macro</key>
<key alias="pictureInsert">Insert picture</key>
<key alias="relations">Edit relations</key>
<key alias="returnToList">Return to list</key>
<key alias="save">Save</key>
<key alias="saveAndPublish">Save and publish</key>
<key alias="saveToPublish">Save and send for approval</key>
@@ -260,13 +259,6 @@
<key alias="tab">Tab</key>
<key alias="thumbnail">Thumbnail</key>
<key alias="hasListView">Enable list view</key>
<key alias="containerConfigPageSize"><![CDATA[Page size<br/><small>Number of entries per page when selected for display in list view.</small>]]></key>
<key alias="containerConfigAdditionalColumns"><![CDATA[Additional columns<br/><small>Select the additional columns displayed after the node name.</small>]]></key>
<key alias="containerConfigOrderBy"><![CDATA[Order by<br/><small>The default order for the list.</small>]]></key>
<key alias="containerConfigOrderDirection"><![CDATA[Order direction<br/><small>The direction of the default order for the list.</small>]]></key>
<key alias="allowBulkPublish"><![CDATA[Allow bulk publish<br/><small>Indicates if bulk publishing is allowed when defined as a list view</small>]]></key>
<key alias="allowBulkUnpublish"><![CDATA[Allow bulk unpublish<br/><small>Indicates if bulk unpublishing is allowed when defined as a list view</small>]]></key>
<key alias="allowBulkDelete"><![CDATA[Allow bulk delete<br/><small>Indicates if bulk deletion is allowed when defined as a list view</small>]]></key>
</area>
<area alias="editdatatype">
<key alias="addPrevalue">Add prevalue</key>

View File

@@ -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<int>(() => x), SortOrder = i++});
@@ -412,49 +403,6 @@ namespace umbraco.controls
Page.ExecuteRegisteredAsyncTasks();
}
/// <summary>
/// Helper to retrive the strongly typed container configuration from the persisted JSON string
/// </summary>
/// <returns>Container configuration as JSON string</returns>
private ContentTypeContainerConfiguration GetContentTypeContainerConfigurationFromJsonString(string config)
{
return JsonConvert.DeserializeObject<ContentTypeContainerConfiguration>(config);
}
/// <summary>
/// Helper to parse the container configuration provided by the form fields into a JSON string for persistance
/// </summary>
/// <returns>Container configuration as JSON string</returns>
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
});
}
/// <summary>
/// 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;
/// <summary>
/// txtNewTab control.

View File

@@ -60,13 +60,12 @@ namespace umbraco.cms.businesslogic
/// <param name="thumbnail"></param>
/// <param name="masterContentType"></param>
/// <param name="isContainer"></param>
/// <param name="containerConfig">containerConfig</param>
/// <remarks>
/// 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.
/// </remarks>
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<int> m_masterContentTypes;
private bool _isContainerContentType;
private string _containerConfig;
private List<int> _allowedChildContentTypeIDs;
private List<TabI> _virtualTabs;
@@ -434,32 +430,6 @@ namespace umbraco.cms.businesslogic
}
}
/// <summary>
/// Get or Sets the container configuration of the Content Type for types defined as containers
/// </summary>
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;
}
}
}
/// <summary>
/// Gets or sets the 'allow at root' boolean
/// </summary>
@@ -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())

View File

@@ -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;
}

View File

@@ -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;
}