diff --git a/src/Umbraco.Core/Constants-DataTypes.cs b/src/Umbraco.Core/Constants-DataTypes.cs
new file mode 100644
index 0000000000..931a231b4c
--- /dev/null
+++ b/src/Umbraco.Core/Constants-DataTypes.cs
@@ -0,0 +1,16 @@
+namespace Umbraco.Core
+{
+ public static partial class Constants
+ {
+ public static class DataTypes
+ {
+ public const int Textbox = -88;
+ public const int Boolean = -49;
+ public const int Datetime = -36;
+
+ public const int DefaultContentListView = -95;
+ public const int DefaultMediaListView = -96;
+ public const int DefaultMembersListView = -97;
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/Umbraco.Core/Constants-PropertyEditors.cs b/src/Umbraco.Core/Constants-PropertyEditors.cs
index 80f118b58e..9ac8d7a4be 100644
--- a/src/Umbraco.Core/Constants-PropertyEditors.cs
+++ b/src/Umbraco.Core/Constants-PropertyEditors.cs
@@ -346,6 +346,7 @@ namespace Umbraco.Core
/// Alias for the True/False (Ja/Nej) datatype.
///
public const string TrueFalseAlias = "Umbraco.TrueFalse";
+ public const string BooleanAlias = TrueFalseAlias;
///
/// Guid for the Ultimate Picker datatype.
diff --git a/src/Umbraco.Core/Constants-System.cs b/src/Umbraco.Core/Constants-System.cs
index 4ac1ff9a70..b173cb17f3 100644
--- a/src/Umbraco.Core/Constants-System.cs
+++ b/src/Umbraco.Core/Constants-System.cs
@@ -21,10 +21,6 @@
/// The integer identifier for media's recycle bin.
///
public const int RecycleBinMedia = -21;
-
- public const int DefaultContentListViewDataTypeId = -95;
- public const int DefaultMediaListViewDataTypeId = -96;
- public const int DefaultMembersListViewDataTypeId = -97;
- }
+ }
}
}
\ No newline at end of file
diff --git a/src/Umbraco.Core/Models/PublishedContent/PublishedContentType.cs b/src/Umbraco.Core/Models/PublishedContent/PublishedContentType.cs
index 5e83c99c90..9a9d524da6 100644
--- a/src/Umbraco.Core/Models/PublishedContent/PublishedContentType.cs
+++ b/src/Umbraco.Core/Models/PublishedContent/PublishedContentType.cs
@@ -12,7 +12,6 @@ namespace Umbraco.Core.Models.PublishedContent
public class PublishedContentType
{
private readonly PublishedPropertyType[] _propertyTypes;
- private readonly HashSet _compositionAliases;
// fast alias-to-index xref containing both the raw alias and its lowercase version
private readonly Dictionary _indexes = new Dictionary();
@@ -37,7 +36,7 @@ namespace Umbraco.Core.Models.PublishedContent
Id = contentType.Id;
Alias = contentType.Alias;
ItemType = itemType;
- _compositionAliases = new HashSet(contentType.CompositionAliases(), StringComparer.InvariantCultureIgnoreCase);
+ CompositionAliases = new HashSet(contentType.CompositionAliases(), StringComparer.InvariantCultureIgnoreCase);
var propertyTypes = contentType.CompositionPropertyTypes
.Select(x => new PublishedPropertyType(this, x));
if (itemType == PublishedItemType.Member)
@@ -62,7 +61,7 @@ namespace Umbraco.Core.Models.PublishedContent
Id = id;
Alias = alias;
ItemType = itemType;
- _compositionAliases = new HashSet(compositionAliases, StringComparer.InvariantCultureIgnoreCase);
+ CompositionAliases = new HashSet(compositionAliases, StringComparer.InvariantCultureIgnoreCase);
if (itemType == PublishedItemType.Member)
propertyTypes = WithMemberProperties(propertyTypes);
_propertyTypes = propertyTypes.ToArray();
@@ -88,25 +87,20 @@ namespace Umbraco.Core.Models.PublishedContent
// NOTE: code below defines and add custom, built-in, Umbraco properties for members
// unless they are already user-defined in the content type, then they are skipped
-
- // fixme should have constants for these
- private const int TextboxDataTypeDefinitionId = -88;
- //private const int BooleanDataTypeDefinitionId = -49;
- //private const int DatetimeDataTypeDefinitionId = -36;
-
- static readonly Dictionary> BuiltinProperties = new Dictionary>
+ // not sure it's needed really - this is here for safety purposes
+ static readonly Dictionary> BuiltinMemberProperties = new Dictionary>
{
- // fixme is this ok?
- { "Email", Tuple.Create(TextboxDataTypeDefinitionId, Constants.PropertyEditors.TextboxAlias) },
- { "Username", Tuple.Create(TextboxDataTypeDefinitionId, Constants.PropertyEditors.TextboxAlias) },
- //{ "PasswordQuestion", Tuple.Create(TextboxDataTypeDefinitionId, Constants.PropertyEditors.TextboxAlias) },
- //{ "Comments", Tuple.Create(TextboxDataTypeDefinitionId, Constants.PropertyEditors.TextboxAlias) },
- //{ "IsApproved", Tuple.Create(BooleanDataTypeDefinitionId, Constants.PropertyEditors.BooleanEditorAlias) },
- //{ "IsLockedOut", Tuple.Create(BooleanDataTypeDefinitionId, Constants.PropertyEditors.BooleanEditorAlias) },
- //{ "LastLockoutDate", Tuple.Create(DatetimeDataTypeDefinitionId, Constants.PropertyEditors.DatetimeEditorAlias) },
- //{ "CreateDate", Tuple.Create(DatetimeDataTypeDefinitionId, Constants.PropertyEditors.DatetimeEditorAlias) },
- //{ "LastLoginDate", Tuple.Create(DatetimeDataTypeDefinitionId, Constants.PropertyEditors.DatetimeEditorAlias) },
- //{ "LastPasswordChangeDate", Tuple.Create(DatetimeDataTypeDefinitionId, Constants.PropertyEditors.DatetimeEditorAlias) },
+ // see also PublishedMember class - exposing special properties as properties
+ { "Email", Tuple.Create(Constants.DataTypes.Textbox, Constants.PropertyEditors.TextboxAlias) },
+ { "Username", Tuple.Create(Constants.DataTypes.Textbox, Constants.PropertyEditors.TextboxAlias) },
+ { "PasswordQuestion", Tuple.Create(Constants.DataTypes.Textbox, Constants.PropertyEditors.TextboxAlias) },
+ { "Comments", Tuple.Create(Constants.DataTypes.Textbox, Constants.PropertyEditors.TextboxAlias) },
+ { "IsApproved", Tuple.Create(Constants.DataTypes.Boolean, Constants.PropertyEditors.BooleanAlias) },
+ { "IsLockedOut", Tuple.Create(Constants.DataTypes.Boolean, Constants.PropertyEditors.BooleanAlias) },
+ { "LastLockoutDate", Tuple.Create(Constants.DataTypes.Datetime, Constants.PropertyEditors.DateTimeAlias) },
+ { "CreateDate", Tuple.Create(Constants.DataTypes.Datetime, Constants.PropertyEditors.DateTimeAlias) },
+ { "LastLoginDate", Tuple.Create(Constants.DataTypes.Datetime, Constants.PropertyEditors.DateTimeAlias) },
+ { "LastPasswordChangeDate", Tuple.Create(Constants.DataTypes.Datetime, Constants.PropertyEditors.DateTimeAlias) },
};
private static IEnumerable WithMemberProperties(IEnumerable propertyTypes,
@@ -119,9 +113,10 @@ namespace Umbraco.Core.Models.PublishedContent
yield return propertyType;
}
- foreach (var kvp in BuiltinProperties.Where(kvp => aliases.Contains(kvp.Key) == false))
+ foreach (var propertyType in BuiltinMemberProperties
+ .Where(kvp => aliases.Contains(kvp.Key) == false)
+ .Select(kvp => new PublishedPropertyType(kvp.Key, kvp.Value.Item1, kvp.Value.Item2, true)))
{
- var propertyType = new PublishedPropertyType(kvp.Key, kvp.Value.Item1, kvp.Value.Item2, true);
if (contentType != null) propertyType.ContentType = contentType;
yield return propertyType;
}
@@ -129,13 +124,13 @@ namespace Umbraco.Core.Models.PublishedContent
#region Content type
- public int Id { get; private set; }
+ public int Id { get; }
- public string Alias { get; private set; }
+ public string Alias { get; }
- public PublishedItemType ItemType { get; private set; }
+ public PublishedItemType ItemType { get; }
- public HashSet CompositionAliases => _compositionAliases;
+ public HashSet CompositionAliases { get; }
#endregion
diff --git a/src/Umbraco.Core/Persistence/Migrations/Initial/BaseDataCreation.cs b/src/Umbraco.Core/Persistence/Migrations/Initial/BaseDataCreation.cs
index dcf191e0dd..6a22749f15 100644
--- a/src/Umbraco.Core/Persistence/Migrations/Initial/BaseDataCreation.cs
+++ b/src/Umbraco.Core/Persistence/Migrations/Initial/BaseDataCreation.cs
@@ -126,9 +126,9 @@ namespace Umbraco.Core.Persistence.Migrations.Initial
_database.Insert("umbracoNode", "id", false, new NodeDto { NodeId = -39, Trashed = false, ParentId = -1, UserId = 0, Level = 1, Path = "-1,-39", SortOrder = 2, UniqueId = new Guid("f38f0ac7-1d27-439c-9f3f-089cd8825a53"), Text = "Dropdown multiple", NodeObjectType = new Guid(Constants.ObjectTypes.DataType), CreateDate = DateTime.Now });
_database.Insert("umbracoNode", "id", false, new NodeDto { NodeId = -37, Trashed = false, ParentId = -1, UserId = 0, Level = 1, Path = "-1,-37", SortOrder = 2, UniqueId = new Guid("0225af17-b302-49cb-9176-b9f35cab9c17"), Text = "Approved Color", NodeObjectType = new Guid(Constants.ObjectTypes.DataType), CreateDate = DateTime.Now });
_database.Insert("umbracoNode", "id", false, new NodeDto { NodeId = -36, Trashed = false, ParentId = -1, UserId = 0, Level = 1, Path = "-1,-36", SortOrder = 2, UniqueId = new Guid("e4d66c0f-b935-4200-81f0-025f7256b89a"), Text = "Date Picker with time", NodeObjectType = new Guid(Constants.ObjectTypes.DataType), CreateDate = DateTime.Now });
- _database.Insert("umbracoNode", "id", false, new NodeDto { NodeId = Constants.System.DefaultContentListViewDataTypeId, Trashed = false, ParentId = -1, UserId = 0, Level = 1, Path = "-1,-95", SortOrder = 2, UniqueId = new Guid("C0808DD3-8133-4E4B-8CE8-E2BEA84A96A4"), Text = Constants.Conventions.DataTypes.ListViewPrefix + "Content", NodeObjectType = new Guid(Constants.ObjectTypes.DataType), CreateDate = DateTime.Now });
- _database.Insert("umbracoNode", "id", false, new NodeDto { NodeId = Constants.System.DefaultMediaListViewDataTypeId, Trashed = false, ParentId = -1, UserId = 0, Level = 1, Path = "-1,-96", SortOrder = 2, UniqueId = new Guid("3A0156C4-3B8C-4803-BDC1-6871FAA83FFF"), Text = Constants.Conventions.DataTypes.ListViewPrefix + "Media", NodeObjectType = new Guid(Constants.ObjectTypes.DataType), CreateDate = DateTime.Now });
- _database.Insert("umbracoNode", "id", false, new NodeDto { NodeId = Constants.System.DefaultMembersListViewDataTypeId, Trashed = false, ParentId = -1, UserId = 0, Level = 1, Path = "-1,-97", SortOrder = 2, UniqueId = new Guid("AA2C52A0-CE87-4E65-A47C-7DF09358585D"), Text = Constants.Conventions.DataTypes.ListViewPrefix + "Members", NodeObjectType = new Guid(Constants.ObjectTypes.DataType), CreateDate = DateTime.Now });
+ _database.Insert("umbracoNode", "id", false, new NodeDto { NodeId = Constants.DataTypes.DefaultContentListView, Trashed = false, ParentId = -1, UserId = 0, Level = 1, Path = "-1,-95", SortOrder = 2, UniqueId = new Guid("C0808DD3-8133-4E4B-8CE8-E2BEA84A96A4"), Text = Constants.Conventions.DataTypes.ListViewPrefix + "Content", NodeObjectType = new Guid(Constants.ObjectTypes.DataType), CreateDate = DateTime.Now });
+ _database.Insert("umbracoNode", "id", false, new NodeDto { NodeId = Constants.DataTypes.DefaultMediaListView, Trashed = false, ParentId = -1, UserId = 0, Level = 1, Path = "-1,-96", SortOrder = 2, UniqueId = new Guid("3A0156C4-3B8C-4803-BDC1-6871FAA83FFF"), Text = Constants.Conventions.DataTypes.ListViewPrefix + "Media", NodeObjectType = new Guid(Constants.ObjectTypes.DataType), CreateDate = DateTime.Now });
+ _database.Insert("umbracoNode", "id", false, new NodeDto { NodeId = Constants.DataTypes.DefaultMembersListView, Trashed = false, ParentId = -1, UserId = 0, Level = 1, Path = "-1,-97", SortOrder = 2, UniqueId = new Guid("AA2C52A0-CE87-4E65-A47C-7DF09358585D"), Text = Constants.Conventions.DataTypes.ListViewPrefix + "Members", NodeObjectType = new Guid(Constants.ObjectTypes.DataType), CreateDate = DateTime.Now });
_database.Insert("umbracoNode", "id", false, new NodeDto { NodeId = 1031, Trashed = false, ParentId = -1, UserId = 0, Level = 1, Path = "-1,1031", SortOrder = 2, UniqueId = new Guid("f38bd2d7-65d0-48e6-95dc-87ce06ec2d3d"), Text = Constants.Conventions.MediaTypes.Folder, NodeObjectType = new Guid(Constants.ObjectTypes.MediaType), CreateDate = DateTime.Now });
_database.Insert("umbracoNode", "id", false, new NodeDto { NodeId = 1032, Trashed = false, ParentId = -1, UserId = 0, Level = 1, Path = "-1,1032", SortOrder = 2, UniqueId = new Guid("cc07b313-0843-4aa8-bbda-871c8da728c8"), Text = Constants.Conventions.MediaTypes.Image, NodeObjectType = new Guid(Constants.ObjectTypes.MediaType), CreateDate = DateTime.Now });
_database.Insert("umbracoNode", "id", false, new NodeDto { NodeId = 1033, Trashed = false, ParentId = -1, UserId = 0, Level = 1, Path = "-1,1033", SortOrder = 2, UniqueId = new Guid("4c52d8ab-54e6-40cd-999c-7a5f24903e4d"), Text = Constants.Conventions.MediaTypes.File, NodeObjectType = new Guid(Constants.ObjectTypes.MediaType), CreateDate = DateTime.Now });
@@ -215,7 +215,7 @@ namespace Umbraco.Core.Persistence.Migrations.Initial
_database.Insert("cmsPropertyType", "id", false, new PropertyTypeDto { Id = 24, UniqueId = 24.ToGuid(), DataTypeId = -90, ContentTypeId = 1033, PropertyTypeGroupId = 4, Alias = Constants.Conventions.Media.File, Name = "Upload file", SortOrder = 0, Mandatory = false, ValidationRegExp = null, Description = null });
_database.Insert("cmsPropertyType", "id", false, new PropertyTypeDto { Id = 25, UniqueId = 25.ToGuid(), DataTypeId = -92, ContentTypeId = 1033, PropertyTypeGroupId = 4, Alias = Constants.Conventions.Media.Extension, Name = "Type", SortOrder = 0, Mandatory = false, ValidationRegExp = null, Description = null });
_database.Insert("cmsPropertyType", "id", false, new PropertyTypeDto { Id = 26, UniqueId = 26.ToGuid(), DataTypeId = -92, ContentTypeId = 1033, PropertyTypeGroupId = 4, Alias = Constants.Conventions.Media.Bytes, Name = "Size", SortOrder = 0, Mandatory = false, ValidationRegExp = null, Description = null });
- _database.Insert("cmsPropertyType", "id", false, new PropertyTypeDto { Id = 27, UniqueId = 27.ToGuid(), DataTypeId = Constants.System.DefaultMediaListViewDataTypeId, ContentTypeId = 1031, PropertyTypeGroupId = 5, Alias = "contents", Name = "Contents:", SortOrder = 0, Mandatory = false, ValidationRegExp = null, Description = null });
+ _database.Insert("cmsPropertyType", "id", false, new PropertyTypeDto { Id = 27, UniqueId = 27.ToGuid(), DataTypeId = Constants.DataTypes.DefaultMediaListView, ContentTypeId = 1031, PropertyTypeGroupId = 5, Alias = "contents", Name = "Contents:", SortOrder = 0, Mandatory = false, ValidationRegExp = null, Description = null });
//membership property types
_database.Insert("cmsPropertyType", "id", false, new PropertyTypeDto { Id = 28, UniqueId = 28.ToGuid(), DataTypeId = -89, ContentTypeId = 1044, PropertyTypeGroupId = 11, Alias = Constants.Conventions.Member.Comments, Name = Constants.Conventions.Member.CommentsLabel, SortOrder = 0, Mandatory = false, ValidationRegExp = null, Description = null });
_database.Insert("cmsPropertyType", "id", false, new PropertyTypeDto { Id = 29, UniqueId = 29.ToGuid(), DataTypeId = -92, ContentTypeId = 1044, PropertyTypeGroupId = 11, Alias = Constants.Conventions.Member.FailedPasswordAttempts, Name = Constants.Conventions.Member.FailedPasswordAttemptsLabel, SortOrder = 1, Mandatory = false, ValidationRegExp = null, Description = null });
@@ -263,9 +263,9 @@ namespace Umbraco.Core.Persistence.Migrations.Initial
_database.Insert("cmsDataType", "pk", false, new DataTypeDto { PrimaryKey = 22, DataTypeId = 1041, PropertyEditorAlias = Constants.PropertyEditors.TagsAlias, DbType = "Ntext" });
_database.Insert("cmsDataType", "pk", false, new DataTypeDto { PrimaryKey = 24, DataTypeId = 1043, PropertyEditorAlias = Constants.PropertyEditors.ImageCropperAlias, DbType = "Ntext" });
_database.Insert("cmsDataType", "pk", false, new DataTypeDto { PrimaryKey = 25, DataTypeId = 1045, PropertyEditorAlias = Constants.PropertyEditors.MultipleMediaPickerAlias, DbType = "Nvarchar" });
- _database.Insert("cmsDataType", "pk", false, new DataTypeDto { PrimaryKey = -26, DataTypeId = Constants.System.DefaultContentListViewDataTypeId, PropertyEditorAlias = Constants.PropertyEditors.ListViewAlias, DbType = "Nvarchar" });
- _database.Insert("cmsDataType", "pk", false, new DataTypeDto { PrimaryKey = -27, DataTypeId = Constants.System.DefaultMediaListViewDataTypeId, PropertyEditorAlias = Constants.PropertyEditors.ListViewAlias, DbType = "Nvarchar" });
- _database.Insert("cmsDataType", "pk", false, new DataTypeDto { PrimaryKey = -28, DataTypeId = Constants.System.DefaultMembersListViewDataTypeId, PropertyEditorAlias = Constants.PropertyEditors.ListViewAlias, DbType = "Nvarchar" });
+ _database.Insert("cmsDataType", "pk", false, new DataTypeDto { PrimaryKey = -26, DataTypeId = Constants.DataTypes.DefaultContentListView, PropertyEditorAlias = Constants.PropertyEditors.ListViewAlias, DbType = "Nvarchar" });
+ _database.Insert("cmsDataType", "pk", false, new DataTypeDto { PrimaryKey = -27, DataTypeId = Constants.DataTypes.DefaultMediaListView, PropertyEditorAlias = Constants.PropertyEditors.ListViewAlias, DbType = "Nvarchar" });
+ _database.Insert("cmsDataType", "pk", false, new DataTypeDto { PrimaryKey = -28, DataTypeId = Constants.DataTypes.DefaultMembersListView, PropertyEditorAlias = Constants.PropertyEditors.ListViewAlias, DbType = "Nvarchar" });
//TODO: We're not creating these for 7.0
//_database.Insert("cmsDataType", "pk", false, new DataTypeDto { PrimaryKey = 19, DataTypeId = 1038, PropertyEditorAlias = Constants.PropertyEditors.MarkdownEditorAlias, DbType = "Ntext" });
@@ -282,21 +282,21 @@ namespace Umbraco.Core.Persistence.Migrations.Initial
_database.Insert("cmsDataTypePreValues", "id", false, new DataTypePreValueDto { Id = 5, Alias = "multiPicker", SortOrder = 0, DataTypeNodeId = 1045, Value = "1" });
//defaults for the member list
- _database.Insert("cmsDataTypePreValues", "id", false, new DataTypePreValueDto { Id = -1, Alias = "pageSize", SortOrder = 1, DataTypeNodeId = Constants.System.DefaultMembersListViewDataTypeId, Value = "10" });
- _database.Insert("cmsDataTypePreValues", "id", false, new DataTypePreValueDto { Id = -2, Alias = "orderBy", SortOrder = 2, DataTypeNodeId = Constants.System.DefaultMembersListViewDataTypeId, Value = "Name" });
- _database.Insert("cmsDataTypePreValues", "id", false, new DataTypePreValueDto { Id = -3, Alias = "orderDirection", SortOrder = 3, DataTypeNodeId = Constants.System.DefaultMembersListViewDataTypeId, Value = "asc" });
- _database.Insert("cmsDataTypePreValues", "id", false, new DataTypePreValueDto { Id = -4, Alias = "includeProperties", SortOrder = 4, DataTypeNodeId = Constants.System.DefaultMembersListViewDataTypeId, Value = "[{\"alias\":\"email\",\"isSystem\":1},{\"alias\":\"username\",\"isSystem\":1},{\"alias\":\"updateDate\",\"header\":\"Last edited\",\"isSystem\":1}]" });
+ _database.Insert("cmsDataTypePreValues", "id", false, new DataTypePreValueDto { Id = -1, Alias = "pageSize", SortOrder = 1, DataTypeNodeId = Constants.DataTypes.DefaultMembersListView, Value = "10" });
+ _database.Insert("cmsDataTypePreValues", "id", false, new DataTypePreValueDto { Id = -2, Alias = "orderBy", SortOrder = 2, DataTypeNodeId = Constants.DataTypes.DefaultMembersListView, Value = "Name" });
+ _database.Insert("cmsDataTypePreValues", "id", false, new DataTypePreValueDto { Id = -3, Alias = "orderDirection", SortOrder = 3, DataTypeNodeId = Constants.DataTypes.DefaultMembersListView, Value = "asc" });
+ _database.Insert("cmsDataTypePreValues", "id", false, new DataTypePreValueDto { Id = -4, Alias = "includeProperties", SortOrder = 4, DataTypeNodeId = Constants.DataTypes.DefaultMembersListView, Value = "[{\"alias\":\"email\",\"isSystem\":1},{\"alias\":\"username\",\"isSystem\":1},{\"alias\":\"updateDate\",\"header\":\"Last edited\",\"isSystem\":1}]" });
//layouts for the list view
var cardLayout = "{\"name\": \"Grid\",\"path\": \"views/propertyeditors/listview/layouts/grid/grid.html\", \"icon\": \"icon-thumbnails-small\", \"isSystem\": 1, \"selected\": true}";
var listLayout = "{\"name\": \"List\",\"path\": \"views/propertyeditors/listview/layouts/list/list.html\",\"icon\": \"icon-list\", \"isSystem\": 1,\"selected\": true}";
//defaults for the media list
- _database.Insert("cmsDataTypePreValues", "id", false, new DataTypePreValueDto { Id = -5, Alias = "pageSize", SortOrder = 1, DataTypeNodeId = Constants.System.DefaultMediaListViewDataTypeId, Value = "100" });
- _database.Insert("cmsDataTypePreValues", "id", false, new DataTypePreValueDto { Id = -6, Alias = "orderBy", SortOrder = 2, DataTypeNodeId = Constants.System.DefaultMediaListViewDataTypeId, Value = "VersionDate" });
- _database.Insert("cmsDataTypePreValues", "id", false, new DataTypePreValueDto { Id = -7, Alias = "orderDirection", SortOrder = 3, DataTypeNodeId = Constants.System.DefaultMediaListViewDataTypeId, Value = "desc" });
- _database.Insert("cmsDataTypePreValues", "id", false, new DataTypePreValueDto { Id = -8, Alias = "layouts", SortOrder = 4, DataTypeNodeId = Constants.System.DefaultMediaListViewDataTypeId, Value = "[" + cardLayout + "," + listLayout + "]" });
- _database.Insert("cmsDataTypePreValues", "id", false, new DataTypePreValueDto { Id = -9, Alias = "includeProperties", SortOrder = 5, DataTypeNodeId = Constants.System.DefaultMediaListViewDataTypeId, Value = "[{\"alias\":\"sortOrder\",\"isSystem\":1, \"header\": \"Sort order\"},{\"alias\":\"updateDate\",\"header\":\"Last edited\",\"isSystem\":1},{\"alias\":\"owner\",\"header\":\"Updated by\",\"isSystem\":1}]" });
+ _database.Insert("cmsDataTypePreValues", "id", false, new DataTypePreValueDto { Id = -5, Alias = "pageSize", SortOrder = 1, DataTypeNodeId = Constants.DataTypes.DefaultMediaListView, Value = "100" });
+ _database.Insert("cmsDataTypePreValues", "id", false, new DataTypePreValueDto { Id = -6, Alias = "orderBy", SortOrder = 2, DataTypeNodeId = Constants.DataTypes.DefaultMediaListView, Value = "VersionDate" });
+ _database.Insert("cmsDataTypePreValues", "id", false, new DataTypePreValueDto { Id = -7, Alias = "orderDirection", SortOrder = 3, DataTypeNodeId = Constants.DataTypes.DefaultMediaListView, Value = "desc" });
+ _database.Insert("cmsDataTypePreValues", "id", false, new DataTypePreValueDto { Id = -8, Alias = "layouts", SortOrder = 4, DataTypeNodeId = Constants.DataTypes.DefaultMediaListView, Value = "[" + cardLayout + "," + listLayout + "]" });
+ _database.Insert("cmsDataTypePreValues", "id", false, new DataTypePreValueDto { Id = -9, Alias = "includeProperties", SortOrder = 5, DataTypeNodeId = Constants.DataTypes.DefaultMediaListView, Value = "[{\"alias\":\"sortOrder\",\"isSystem\":1, \"header\": \"Sort order\"},{\"alias\":\"updateDate\",\"header\":\"Last edited\",\"isSystem\":1},{\"alias\":\"owner\",\"header\":\"Updated by\",\"isSystem\":1}]" });
}
private void CreateUmbracoRelationTypeData()
diff --git a/src/Umbraco.Core/Umbraco.Core.csproj b/src/Umbraco.Core/Umbraco.Core.csproj
index d2d239d580..33fb268ef8 100644
--- a/src/Umbraco.Core/Umbraco.Core.csproj
+++ b/src/Umbraco.Core/Umbraco.Core.csproj
@@ -202,6 +202,7 @@
+
diff --git a/src/Umbraco.Web/Models/Mapping/DataTypeModelMapper.cs b/src/Umbraco.Web/Models/Mapping/DataTypeModelMapper.cs
index 515db330b5..aa17043db8 100644
--- a/src/Umbraco.Web/Models/Mapping/DataTypeModelMapper.cs
+++ b/src/Umbraco.Web/Models/Mapping/DataTypeModelMapper.cs
@@ -28,9 +28,9 @@ namespace Umbraco.Web.Models.Mapping
var systemIds = new[]
{
- Constants.System.DefaultContentListViewDataTypeId,
- Constants.System.DefaultMediaListViewDataTypeId,
- Constants.System.DefaultMembersListViewDataTypeId
+ Constants.DataTypes.DefaultContentListView,
+ Constants.DataTypes.DefaultMediaListView,
+ Constants.DataTypes.DefaultMembersListView
};
config.CreateMap()
diff --git a/src/Umbraco.Web/Models/Mapping/TabsAndPropertiesResolver.cs b/src/Umbraco.Web/Models/Mapping/TabsAndPropertiesResolver.cs
index ff4176a944..3273c6b396 100644
--- a/src/Umbraco.Web/Models/Mapping/TabsAndPropertiesResolver.cs
+++ b/src/Umbraco.Web/Models/Mapping/TabsAndPropertiesResolver.cs
@@ -132,14 +132,14 @@ namespace Umbraco.Web.Models.Mapping
switch (entityType)
{
case "content":
- dtdId = Constants.System.DefaultContentListViewDataTypeId;
+ dtdId = Constants.DataTypes.DefaultContentListView;
break;
case "media":
- dtdId = Constants.System.DefaultMediaListViewDataTypeId;
+ dtdId = Constants.DataTypes.DefaultMediaListView;
break;
case "member":
- dtdId = Constants.System.DefaultMembersListViewDataTypeId;
+ dtdId = Constants.DataTypes.DefaultMembersListView;
break;
default:
throw new ArgumentOutOfRangeException("entityType does not match a required value");
diff --git a/src/Umbraco.Web/PublishedCache/NuCache/PublishedMember.cs b/src/Umbraco.Web/PublishedCache/NuCache/PublishedMember.cs
index 77b50213a7..10575d5ffa 100644
--- a/src/Umbraco.Web/PublishedCache/NuCache/PublishedMember.cs
+++ b/src/Umbraco.Web/PublishedCache/NuCache/PublishedMember.cs
@@ -63,16 +63,17 @@ namespace Umbraco.Web.PublishedCache.NuCache
//.ToDictionary(x => x.Key, x => x.Value);
.ToDictionary(x => x.Alias, x => x.Value, StringComparer.OrdinalIgnoreCase);
+ // see also PublishedContentType
AddIf(contentType, properties, "Email", member.Email);
AddIf(contentType, properties, "Username", member.Username);
- //AddIf(contentType, properties, "PasswordQuestion", member.PasswordQuestion);
- //AddIf(contentType, properties, "Comments", member.Comments);
- //AddIf(contentType, properties, "IsApproved", member.IsApproved);
- //AddIf(contentType, properties, "IsLockedOut", member.IsLockedOut);
- //AddIf(contentType, properties, "LastLockoutDate", member.LastLockoutDate);
- //AddIf(contentType, properties, "CreateDate", member.CreateDate);
- //AddIf(contentType, properties, "LastLoginDate", member.LastLoginDate);
- //AddIf(contentType, properties, "LastPasswordChangeDate", member.LastPasswordChangeDate);
+ AddIf(contentType, properties, "PasswordQuestion", member.PasswordQuestion);
+ AddIf(contentType, properties, "Comments", member.Comments);
+ AddIf(contentType, properties, "IsApproved", member.IsApproved);
+ AddIf(contentType, properties, "IsLockedOut", member.IsLockedOut);
+ AddIf(contentType, properties, "LastLockoutDate", member.LastLockoutDate);
+ AddIf(contentType, properties, "CreateDate", member.CreateDate);
+ AddIf(contentType, properties, "LastLoginDate", member.LastLoginDate);
+ AddIf(contentType, properties, "LastPasswordChangeDate", member.LastPasswordChangeDate);
return properties;
}
diff --git a/src/Umbraco.Web/PublishedCache/PublishedMember.cs b/src/Umbraco.Web/PublishedCache/PublishedMember.cs
index cda7291769..110adea9c6 100644
--- a/src/Umbraco.Web/PublishedCache/PublishedMember.cs
+++ b/src/Umbraco.Web/PublishedCache/PublishedMember.cs
@@ -34,79 +34,43 @@ namespace Umbraco.Web.PublishedCache
.ToArray();
}
-
#region Membership provider member properties
- public string Email
- {
- get { return _membershipUser.Email; }
- }
- public string UserName
- {
- get { return _membershipUser.Username; }
- }
- public string PasswordQuestion
- {
- get { return _membershipUser.PasswordQuestion; }
- }
- public string Comments
- {
- get { return _membershipUser.Comments; }
- }
- public bool IsApproved
- {
- get { return _membershipUser.IsApproved; }
- }
- public bool IsLockedOut
- {
- get { return _membershipUser.IsLockedOut; }
- }
- public DateTime LastLockoutDate
- {
- get { return _membershipUser.LastLockoutDate; }
- }
- public DateTime CreationDate
- {
- get { return _membershipUser.CreateDate; }
- }
- public DateTime LastLoginDate
- {
- get { return _membershipUser.LastLoginDate; }
- }
- public DateTime LastActivityDate
- {
- get { return _membershipUser.LastLoginDate; }
- }
- public DateTime LastPasswordChangedDate
- {
- get { return _membershipUser.LastPasswordChangeDate; }
- }
+
+ public string Email => _membershipUser.Email;
+
+ public string UserName => _membershipUser.Username;
+
+ public string PasswordQuestion => _membershipUser.PasswordQuestion;
+
+ public string Comments => _membershipUser.Comments;
+
+ public bool IsApproved => _membershipUser.IsApproved;
+
+ public bool IsLockedOut => _membershipUser.IsLockedOut;
+
+ public DateTime LastLockoutDate => _membershipUser.LastLockoutDate;
+
+ public DateTime CreationDate => _membershipUser.CreateDate;
+
+ public DateTime LastLoginDate => _membershipUser.LastLoginDate;
+
+ public DateTime LastActivityDate => _membershipUser.LastLoginDate;
+
+ public DateTime LastPasswordChangeDate => _membershipUser.LastPasswordChangeDate;
+
#endregion
#region IPublishedContent
- public override PublishedItemType ItemType
- {
- get { return PublishedItemType.Member; }
- }
- public override bool IsDraft
- {
- get { return false; }
- }
+ public override PublishedItemType ItemType => PublishedItemType.Member;
- public override IPublishedContent Parent
- {
- get { return null; }
- }
+ public override bool IsDraft => false;
- public override IEnumerable Children
- {
- get { return Enumerable.Empty(); }
- }
+ public override IPublishedContent Parent => null;
- public override ICollection Properties
- {
- get { return _properties; }
- }
+ public override IEnumerable Children => Enumerable.Empty();
+
+ public override ICollection Properties => _properties;
public override IPublishedProperty GetProperty(string alias, bool recurse)
{
@@ -119,114 +83,77 @@ namespace Umbraco.Web.PublishedCache
public override IPublishedProperty GetProperty(string alias)
{
- switch (alias)
+ switch (alias.ToLowerInvariant())
{
case "Email":
return new PropertyResult("Email", Email, PropertyResultType.CustomProperty);
case "UserName":
return new PropertyResult("UserName", UserName, PropertyResultType.CustomProperty);
+ case "PasswordQuestion":
+ return new PropertyResult("PasswordQuestion", PasswordQuestion, PropertyResultType.CustomProperty);
+ case "Comments":
+ return new PropertyResult("Comments", Email, PropertyResultType.CustomProperty);
+ case "IsApproved":
+ return new PropertyResult("IsApproved", IsApproved, PropertyResultType.CustomProperty);
+ case "IsLockedOut":
+ return new PropertyResult("IsLockedOut", IsLockedOut, PropertyResultType.CustomProperty);
+ case "LastLockoutDate":
+ return new PropertyResult("LastLockoutDate", LastLockoutDate, PropertyResultType.CustomProperty);
+ case "CreateDate":
+ return new PropertyResult("CreateDate", CreateDate, PropertyResultType.CustomProperty);
+ case "LastLoginDate":
+ return new PropertyResult("LastLoginDate", LastLoginDate, PropertyResultType.CustomProperty);
+ case "LastPasswordChangeDate":
+ return new PropertyResult("LastPasswordChangeDate", LastPasswordChangeDate, PropertyResultType.CustomProperty);
}
return _properties.FirstOrDefault(x => x.PropertyTypeAlias.InvariantEquals(alias));
}
- public override PublishedContentType ContentType
- {
- get { return _publishedMemberType; }
- }
+ public override PublishedContentType ContentType => _publishedMemberType;
- public override int Id
- {
- get { return _member.Id; }
- }
+ public override int Id => _member.Id;
- public override Guid Key
- {
- get { return _member.Key; }
- }
+ public override Guid Key => _member.Key;
public override int TemplateId
{
get { throw new NotSupportedException(); }
}
- public override int SortOrder
- {
- get { return 0; }
- }
+ public override int SortOrder => 0;
- public override string Name
- {
- get { return _member.Name; }
- }
+ public override string Name => _member.Name;
public override string UrlName
{
get { throw new NotSupportedException(); }
}
- public override string DocumentTypeAlias
- {
- get { return _member.ContentTypeAlias; }
- }
+ public override string DocumentTypeAlias => _member.ContentTypeAlias;
- public override int DocumentTypeId
- {
- get { return _member.ContentType.Id; }
- }
+ public override int DocumentTypeId => _member.ContentType.Id;
- public override string WriterName
- {
- get
- {
- //TODO: ARGH! need to fix this - this is not good because it uses ApplicationContext.Current
- return _member.GetCreatorProfile().Name;
- }
- }
+ //TODO: ARGH! need to fix this - this is not good because it uses ApplicationContext.Current
+ public override string WriterName => _member.GetCreatorProfile().Name;
- public override string CreatorName
- {
- get
- {
- //TODO: ARGH! need to fix this - this is not good because it uses ApplicationContext.Current
- return _member.GetCreatorProfile().Name;
- }
- }
+ //TODO: ARGH! need to fix this - this is not good because it uses ApplicationContext.Current
+ public override string CreatorName => _member.GetCreatorProfile().Name;
- public override int WriterId
- {
- get { return _member.CreatorId; }
- }
+ public override int WriterId => _member.CreatorId;
- public override int CreatorId
- {
- get { return _member.CreatorId; }
- }
+ public override int CreatorId => _member.CreatorId;
- public override string Path
- {
- get { return _member.Path; }
- }
+ public override string Path => _member.Path;
- public override DateTime CreateDate
- {
- get { return _member.CreateDate; }
- }
+ public override DateTime CreateDate => _member.CreateDate;
- public override DateTime UpdateDate
- {
- get { return _member.UpdateDate; }
- }
+ public override DateTime UpdateDate => _member.UpdateDate;
- public override Guid Version
- {
- get { return _member.Version; }
- }
+ public override Guid Version => _member.Version;
+
+ public override int Level => _member.Level;
- public override int Level
- {
- get { return _member.Level; }
- }
#endregion
}
}
diff --git a/src/Umbraco.Web/Strategies/Migrations/EnsureListViewDataTypeIsCreated.cs b/src/Umbraco.Web/Strategies/Migrations/EnsureListViewDataTypeIsCreated.cs
index 92377d0a2f..65f8abf7a0 100644
--- a/src/Umbraco.Web/Strategies/Migrations/EnsureListViewDataTypeIsCreated.cs
+++ b/src/Umbraco.Web/Strategies/Migrations/EnsureListViewDataTypeIsCreated.cs
@@ -44,15 +44,15 @@ namespace Umbraco.Web.Strategies.Migrations
if (syntax.SupportsIdentityInsert())
e.MigrationContext.Database.Execute(new Sql(string.Format("SET IDENTITY_INSERT {0} ON ", syntax.GetQuotedTableName("umbracoNode"))));
- if (e.MigrationContext.Database.Exists(Constants.System.DefaultContentListViewDataTypeId))
+ if (e.MigrationContext.Database.Exists(Constants.DataTypes.DefaultContentListView))
{
//If this already exists then just exit
return;
}
- e.MigrationContext.Database.Insert("umbracoNode", "id", false, new NodeDto { NodeId = Constants.System.DefaultContentListViewDataTypeId, Trashed = false, ParentId = -1, UserId = 0, Level = 1, Path = "-1,-95", SortOrder = 2, UniqueId = new Guid("C0808DD3-8133-4E4B-8CE8-E2BEA84A96A4"), Text = Constants.Conventions.DataTypes.ListViewPrefix + "Content", NodeObjectType = new Guid(Constants.ObjectTypes.DataType), CreateDate = DateTime.Now });
- e.MigrationContext.Database.Insert("umbracoNode", "id", false, new NodeDto { NodeId = Constants.System.DefaultMediaListViewDataTypeId, Trashed = false, ParentId = -1, UserId = 0, Level = 1, Path = "-1,-96", SortOrder = 2, UniqueId = new Guid("3A0156C4-3B8C-4803-BDC1-6871FAA83FFF"), Text = Constants.Conventions.DataTypes.ListViewPrefix + "Media", NodeObjectType = new Guid(Constants.ObjectTypes.DataType), CreateDate = DateTime.Now });
- e.MigrationContext.Database.Insert("umbracoNode", "id", false, new NodeDto { NodeId = Constants.System.DefaultMembersListViewDataTypeId, Trashed = false, ParentId = -1, UserId = 0, Level = 1, Path = "-1,-97", SortOrder = 2, UniqueId = new Guid("AA2C52A0-CE87-4E65-A47C-7DF09358585D"), Text = Constants.Conventions.DataTypes.ListViewPrefix + "Members", NodeObjectType = new Guid(Constants.ObjectTypes.DataType), CreateDate = DateTime.Now });
+ e.MigrationContext.Database.Insert("umbracoNode", "id", false, new NodeDto { NodeId = Constants.DataTypes.DefaultContentListView, Trashed = false, ParentId = -1, UserId = 0, Level = 1, Path = "-1,-95", SortOrder = 2, UniqueId = new Guid("C0808DD3-8133-4E4B-8CE8-E2BEA84A96A4"), Text = Constants.Conventions.DataTypes.ListViewPrefix + "Content", NodeObjectType = new Guid(Constants.ObjectTypes.DataType), CreateDate = DateTime.Now });
+ e.MigrationContext.Database.Insert("umbracoNode", "id", false, new NodeDto { NodeId = Constants.DataTypes.DefaultMediaListView, Trashed = false, ParentId = -1, UserId = 0, Level = 1, Path = "-1,-96", SortOrder = 2, UniqueId = new Guid("3A0156C4-3B8C-4803-BDC1-6871FAA83FFF"), Text = Constants.Conventions.DataTypes.ListViewPrefix + "Media", NodeObjectType = new Guid(Constants.ObjectTypes.DataType), CreateDate = DateTime.Now });
+ e.MigrationContext.Database.Insert("umbracoNode", "id", false, new NodeDto { NodeId = Constants.DataTypes.DefaultMembersListView, Trashed = false, ParentId = -1, UserId = 0, Level = 1, Path = "-1,-97", SortOrder = 2, UniqueId = new Guid("AA2C52A0-CE87-4E65-A47C-7DF09358585D"), Text = Constants.Conventions.DataTypes.ListViewPrefix + "Members", NodeObjectType = new Guid(Constants.ObjectTypes.DataType), CreateDate = DateTime.Now });
}
finally
{
@@ -68,9 +68,9 @@ namespace Umbraco.Web.Strategies.Migrations
if (syntax.SupportsIdentityInsert())
e.MigrationContext.Database.Execute(new Sql(string.Format("SET IDENTITY_INSERT {0} ON ", syntax.GetQuotedTableName("cmsDataType"))));
- e.MigrationContext.Database.Insert("cmsDataType", "pk", false, new DataTypeDto { PrimaryKey = -26, DataTypeId = Constants.System.DefaultContentListViewDataTypeId, PropertyEditorAlias = Constants.PropertyEditors.ListViewAlias, DbType = "Nvarchar" });
- e.MigrationContext.Database.Insert("cmsDataType", "pk", false, new DataTypeDto { PrimaryKey = -27, DataTypeId = Constants.System.DefaultMediaListViewDataTypeId, PropertyEditorAlias = Constants.PropertyEditors.ListViewAlias, DbType = "Nvarchar" });
- e.MigrationContext.Database.Insert("cmsDataType", "pk", false, new DataTypeDto { PrimaryKey = -28, DataTypeId = Constants.System.DefaultMembersListViewDataTypeId, PropertyEditorAlias = Constants.PropertyEditors.ListViewAlias, DbType = "Nvarchar" });
+ e.MigrationContext.Database.Insert("cmsDataType", "pk", false, new DataTypeDto { PrimaryKey = -26, DataTypeId = Constants.DataTypes.DefaultContentListView, PropertyEditorAlias = Constants.PropertyEditors.ListViewAlias, DbType = "Nvarchar" });
+ e.MigrationContext.Database.Insert("cmsDataType", "pk", false, new DataTypeDto { PrimaryKey = -27, DataTypeId = Constants.DataTypes.DefaultMediaListView, PropertyEditorAlias = Constants.PropertyEditors.ListViewAlias, DbType = "Nvarchar" });
+ e.MigrationContext.Database.Insert("cmsDataType", "pk", false, new DataTypeDto { PrimaryKey = -28, DataTypeId = Constants.DataTypes.DefaultMembersListView, PropertyEditorAlias = Constants.PropertyEditors.ListViewAlias, DbType = "Nvarchar" });
}
finally
{
@@ -88,10 +88,10 @@ namespace Umbraco.Web.Strategies.Migrations
e.MigrationContext.Database.Execute(new Sql(string.Format("SET IDENTITY_INSERT {0} ON ", syntax.GetQuotedTableName("cmsDataTypePreValues"))));
//defaults for the member list
- e.MigrationContext.Database.Insert("cmsDataTypePreValues", "id", false, new DataTypePreValueDto { Id = -1, Alias = "pageSize", SortOrder = 1, DataTypeNodeId = Constants.System.DefaultMembersListViewDataTypeId, Value = "10" });
- e.MigrationContext.Database.Insert("cmsDataTypePreValues", "id", false, new DataTypePreValueDto { Id = -2, Alias = "orderBy", SortOrder = 2, DataTypeNodeId = Constants.System.DefaultMembersListViewDataTypeId, Value = "Name" });
- e.MigrationContext.Database.Insert("cmsDataTypePreValues", "id", false, new DataTypePreValueDto { Id = -3, Alias = "orderDirection", SortOrder = 3, DataTypeNodeId = Constants.System.DefaultMembersListViewDataTypeId, Value = "asc" });
- e.MigrationContext.Database.Insert("cmsDataTypePreValues", "id", false, new DataTypePreValueDto { Id = -4, Alias = "includeProperties", SortOrder = 4, DataTypeNodeId = Constants.System.DefaultMembersListViewDataTypeId, Value = "[{\"alias\":\"email\",\"isSystem\":1},{\"alias\":\"username\",\"isSystem\":1},{\"alias\":\"updateDate\",\"header\":\"Last edited\",\"isSystem\":1}]" });
+ e.MigrationContext.Database.Insert("cmsDataTypePreValues", "id", false, new DataTypePreValueDto { Id = -1, Alias = "pageSize", SortOrder = 1, DataTypeNodeId = Constants.DataTypes.DefaultMembersListView, Value = "10" });
+ e.MigrationContext.Database.Insert("cmsDataTypePreValues", "id", false, new DataTypePreValueDto { Id = -2, Alias = "orderBy", SortOrder = 2, DataTypeNodeId = Constants.DataTypes.DefaultMembersListView, Value = "Name" });
+ e.MigrationContext.Database.Insert("cmsDataTypePreValues", "id", false, new DataTypePreValueDto { Id = -3, Alias = "orderDirection", SortOrder = 3, DataTypeNodeId = Constants.DataTypes.DefaultMembersListView, Value = "asc" });
+ e.MigrationContext.Database.Insert("cmsDataTypePreValues", "id", false, new DataTypePreValueDto { Id = -4, Alias = "includeProperties", SortOrder = 4, DataTypeNodeId = Constants.DataTypes.DefaultMembersListView, Value = "[{\"alias\":\"email\",\"isSystem\":1},{\"alias\":\"username\",\"isSystem\":1},{\"alias\":\"updateDate\",\"header\":\"Last edited\",\"isSystem\":1}]" });
}
finally
{
diff --git a/src/Umbraco.Web/Trees/DataTypeTreeController.cs b/src/Umbraco.Web/Trees/DataTypeTreeController.cs
index 8901fa8134..8da83604c5 100644
--- a/src/Umbraco.Web/Trees/DataTypeTreeController.cs
+++ b/src/Umbraco.Web/Trees/DataTypeTreeController.cs
@@ -72,9 +72,9 @@ namespace Umbraco.Web.Trees
{
var systemIds = new[]
{
- Constants.System.DefaultContentListViewDataTypeId,
- Constants.System.DefaultMediaListViewDataTypeId,
- Constants.System.DefaultMembersListViewDataTypeId
+ Constants.DataTypes.DefaultContentListView,
+ Constants.DataTypes.DefaultMediaListView,
+ Constants.DataTypes.DefaultMembersListView
};
return systemIds;
}