Move constants
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
|
||||
namespace Umbraco.Core
|
||||
{
|
||||
public static partial class ConstantsCore
|
||||
public static partial class Constants
|
||||
{
|
||||
/// <summary>
|
||||
/// Specific web.config AppSetting keys for Umbraco.Core application
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
namespace Umbraco.Core
|
||||
{
|
||||
public static partial class ConstantsCore
|
||||
public static partial class Constants
|
||||
{
|
||||
/// <summary>
|
||||
/// Defines the alias identifiers for Umbraco's core application sections.
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
/// <summary>
|
||||
/// Defines constants.
|
||||
/// </summary>
|
||||
public static partial class ConstantsCore
|
||||
public static partial class Constants
|
||||
{
|
||||
/// <summary>
|
||||
/// Defines constants for composition.
|
||||
|
||||
+2
-72
@@ -11,7 +11,7 @@ namespace Umbraco.Core
|
||||
/// </summary>
|
||||
public static class Conventions
|
||||
{
|
||||
internal static class PermissionCategories
|
||||
public static class PermissionCategories
|
||||
{
|
||||
public const string ContentCategory = "content";
|
||||
public const string AdministrationCategory = "administration";
|
||||
@@ -204,77 +204,7 @@ namespace Umbraco.Core
|
||||
/// <summary>
|
||||
/// Group name to put the membership properties on
|
||||
/// </summary>
|
||||
internal const string StandardPropertiesGroupName = "Membership";
|
||||
|
||||
public static Dictionary<string, PropertyType> GetStandardPropertyTypeStubs()
|
||||
{
|
||||
return new Dictionary<string, PropertyType>
|
||||
{
|
||||
{
|
||||
Comments,
|
||||
new PropertyType(PropertyEditors.Aliases.TextArea, ValueStorageType.Ntext, true, Comments)
|
||||
{
|
||||
Name = CommentsLabel
|
||||
}
|
||||
},
|
||||
{
|
||||
FailedPasswordAttempts,
|
||||
new PropertyType(PropertyEditors.Aliases.Label, ValueStorageType.Integer, true, FailedPasswordAttempts)
|
||||
{
|
||||
Name = FailedPasswordAttemptsLabel
|
||||
}
|
||||
},
|
||||
{
|
||||
IsApproved,
|
||||
new PropertyType(PropertyEditors.Aliases.Boolean, ValueStorageType.Integer, true, IsApproved)
|
||||
{
|
||||
Name = IsApprovedLabel
|
||||
}
|
||||
},
|
||||
{
|
||||
IsLockedOut,
|
||||
new PropertyType(PropertyEditors.Aliases.Boolean, ValueStorageType.Integer, true, IsLockedOut)
|
||||
{
|
||||
Name = IsLockedOutLabel
|
||||
}
|
||||
},
|
||||
{
|
||||
LastLockoutDate,
|
||||
new PropertyType(PropertyEditors.Aliases.Label, ValueStorageType.Date, true, LastLockoutDate)
|
||||
{
|
||||
Name = LastLockoutDateLabel
|
||||
}
|
||||
},
|
||||
{
|
||||
LastLoginDate,
|
||||
new PropertyType(PropertyEditors.Aliases.Label, ValueStorageType.Date, true, LastLoginDate)
|
||||
{
|
||||
Name = LastLoginDateLabel
|
||||
}
|
||||
},
|
||||
{
|
||||
LastPasswordChangeDate,
|
||||
new PropertyType(PropertyEditors.Aliases.Label, ValueStorageType.Date, true, LastPasswordChangeDate)
|
||||
{
|
||||
Name = LastPasswordChangeDateLabel
|
||||
}
|
||||
},
|
||||
{
|
||||
PasswordAnswer,
|
||||
new PropertyType(PropertyEditors.Aliases.Label, ValueStorageType.Nvarchar, true, PasswordAnswer)
|
||||
{
|
||||
Name = PasswordAnswerLabel
|
||||
}
|
||||
},
|
||||
{
|
||||
PasswordQuestion,
|
||||
new PropertyType(PropertyEditors.Aliases.Label, ValueStorageType.Nvarchar, true, PasswordQuestion)
|
||||
{
|
||||
Name = PasswordQuestionLabel
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
public const string StandardPropertiesGroupName = "Membership";
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -2,7 +2,7 @@ using System;
|
||||
|
||||
namespace Umbraco.Core
|
||||
{
|
||||
public static partial class ConstantsCore
|
||||
public static partial class Constants
|
||||
{
|
||||
public static class DataTypes
|
||||
{
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
namespace Umbraco.Core
|
||||
{
|
||||
public static partial class ConstantsCore
|
||||
public static partial class Constants
|
||||
{
|
||||
public static class DatabaseProviders
|
||||
{
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
namespace Umbraco.Core
|
||||
{
|
||||
public static partial class ConstantsCore
|
||||
public static partial class Constants
|
||||
{
|
||||
/// <summary>
|
||||
/// Contains the valid selector values.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
namespace Umbraco.Core
|
||||
{
|
||||
public static partial class ConstantsCore
|
||||
public static partial class Constants
|
||||
{
|
||||
public static class Icons
|
||||
{
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
namespace Umbraco.Core
|
||||
{
|
||||
public static partial class ConstantsCore
|
||||
public static partial class Constants
|
||||
{
|
||||
public static class UmbracoIndexes
|
||||
{
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
namespace Umbraco.Core
|
||||
{
|
||||
public static partial class ConstantsCore
|
||||
public static partial class Constants
|
||||
{
|
||||
/// <summary>
|
||||
/// Defines the Umbraco object type unique identifiers.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
namespace Umbraco.Core
|
||||
{
|
||||
public static partial class ConstantsCore
|
||||
public static partial class Constants
|
||||
{
|
||||
/// <summary>
|
||||
/// Defines the constants used for the Umbraco package repository
|
||||
|
||||
+1
-1
@@ -85,7 +85,7 @@ namespace Umbraco.Core
|
||||
/// ListView.
|
||||
/// </summary>
|
||||
public const string ListView = "Umbraco.ListView";
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Media Picker.
|
||||
/// </summary>
|
||||
@@ -1,6 +1,6 @@
|
||||
namespace Umbraco.Core
|
||||
{
|
||||
public static partial class ConstantsCore
|
||||
public static partial class Constants
|
||||
{
|
||||
/// <summary>
|
||||
/// Defines the identifiers for property-type groups conventions that are used within the Umbraco core.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
namespace Umbraco.Core
|
||||
{
|
||||
public static partial class ConstantsCore
|
||||
public static partial class Constants
|
||||
{
|
||||
public static class Security
|
||||
{
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
namespace Umbraco.Core
|
||||
{
|
||||
public static partial class ConstantsCore
|
||||
public static partial class Constants
|
||||
{
|
||||
/// <summary>
|
||||
/// Defines the identifiers for Umbraco system nodes.
|
||||
|
||||
@@ -0,0 +1,73 @@
|
||||
namespace Umbraco.Core
|
||||
{
|
||||
public static partial class Constants
|
||||
{
|
||||
/// <summary>
|
||||
/// Defines well-known entity types.
|
||||
/// </summary>
|
||||
/// <remarks>Well-known entity types are those that Deploy already knows about,
|
||||
/// but entity types are strings and so can be extended beyond what is defined here.</remarks>
|
||||
public static class UdiEntityType
|
||||
{
|
||||
// note: const fields in this class MUST be consistent with what GetTypes returns
|
||||
// this is validated by UdiTests.ValidateUdiEntityType
|
||||
// also, this is used exclusively in Udi static ctor, only once, so there is no
|
||||
// need to keep it around in a field nor to make it readonly
|
||||
|
||||
|
||||
public const string Unknown = "unknown";
|
||||
|
||||
// guid entity types
|
||||
|
||||
public const string AnyGuid = "any-guid"; // that one is for tests
|
||||
|
||||
public const string Document = "document";
|
||||
|
||||
public const string DocumentBlueprint = "document-blueprint";
|
||||
|
||||
public const string Media = "media";
|
||||
public const string Member = "member";
|
||||
|
||||
public const string DictionaryItem = "dictionary-item";
|
||||
public const string Macro = "macro";
|
||||
public const string Template = "template";
|
||||
|
||||
public const string DocumentType = "document-type";
|
||||
public const string DocumentTypeContainer = "document-type-container";
|
||||
|
||||
// TODO: What is this? This alias is only used for the blue print tree to render the blueprint's document type, it's not a real udi type
|
||||
public const string DocumentTypeBluePrints = "document-type-blueprints";
|
||||
public const string MediaType = "media-type";
|
||||
public const string MediaTypeContainer = "media-type-container";
|
||||
public const string DataType = "data-type";
|
||||
public const string DataTypeContainer = "data-type-container";
|
||||
public const string MemberType = "member-type";
|
||||
public const string MemberGroup = "member-group";
|
||||
|
||||
public const string RelationType = "relation-type";
|
||||
|
||||
// forms
|
||||
|
||||
public const string FormsForm = "forms-form";
|
||||
public const string FormsPreValue = "forms-prevalue";
|
||||
public const string FormsDataSource = "forms-datasource";
|
||||
|
||||
// string entity types
|
||||
|
||||
public const string AnyString = "any-string"; // that one is for tests
|
||||
|
||||
public const string Language = "language";
|
||||
public const string MacroScript = "macroscript";
|
||||
public const string MediaFile = "media-file";
|
||||
public const string TemplateFile = "template-file";
|
||||
public const string Script = "script";
|
||||
public const string Stylesheet = "stylesheet";
|
||||
public const string PartialView = "partial-view";
|
||||
public const string PartialViewMacro = "partial-view-macro";
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
namespace Umbraco.Core
|
||||
{
|
||||
public static partial class ConstantsCore
|
||||
public static partial class Constants
|
||||
{
|
||||
/// <summary>
|
||||
/// Defines the identifiers for Umbraco system nodes.
|
||||
|
||||
@@ -44,7 +44,7 @@ namespace Umbraco.Core.Compose
|
||||
public void Terminate()
|
||||
{ }
|
||||
|
||||
internal static IUser UnknownUser => new User { Id = ConstantsCore.Security.UnknownUserId, Name = ConstantsCore.Security.UnknownUserName, Email = "" };
|
||||
internal static IUser UnknownUser => new User { Id = Constants.Security.UnknownUserId, Name = Constants.Security.UnknownUserName, Email = "" };
|
||||
|
||||
private IUser CurrentPerformingUser
|
||||
{
|
||||
|
||||
@@ -26,8 +26,8 @@ namespace Umbraco.Core.Compose
|
||||
|
||||
if (relationType == null)
|
||||
{
|
||||
relationType = new RelationType(ConstantsCore.ObjectTypes.Document,
|
||||
ConstantsCore.ObjectTypes.Document,
|
||||
relationType = new RelationType(Constants.ObjectTypes.Document,
|
||||
Constants.ObjectTypes.Document,
|
||||
Constants.Conventions.RelationTypes.RelateDocumentOnCopyAlias,
|
||||
Constants.Conventions.RelationTypes.RelateDocumentOnCopyName) { IsBidirectional = true };
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ namespace Umbraco.Core.Compose
|
||||
|
||||
private static void ContentService_Moved(IContentService sender, MoveEventArgs<IContent> e)
|
||||
{
|
||||
foreach (var item in e.MoveInfoCollection.Where(x => x.OriginalPath.Contains(ConstantsCore.System.RecycleBinContentString)))
|
||||
foreach (var item in e.MoveInfoCollection.Where(x => x.OriginalPath.Contains(Constants.System.RecycleBinContentString)))
|
||||
{
|
||||
var relationService = Current.Services.RelationService;
|
||||
const string relationTypeAlias = Constants.Conventions.RelationTypes.RelateParentDocumentOnDeleteAlias;
|
||||
@@ -37,7 +37,7 @@ namespace Umbraco.Core.Compose
|
||||
|
||||
private static void MediaService_Moved(IMediaService sender, MoveEventArgs<IMedia> e)
|
||||
{
|
||||
foreach (var item in e.MoveInfoCollection.Where(x => x.OriginalPath.Contains(ConstantsCore.System.RecycleBinMediaString)))
|
||||
foreach (var item in e.MoveInfoCollection.Where(x => x.OriginalPath.Contains(Constants.System.RecycleBinMediaString)))
|
||||
{
|
||||
var relationService = Current.Services.RelationService;
|
||||
const string relationTypeAlias = Constants.Conventions.RelationTypes.RelateParentMediaFolderOnDeleteAlias;
|
||||
@@ -60,7 +60,7 @@ namespace Umbraco.Core.Compose
|
||||
// check that the relation-type exists, if not, then recreate it
|
||||
if (relationType == null)
|
||||
{
|
||||
var documentObjectType = ConstantsCore.ObjectTypes.Document;
|
||||
var documentObjectType = Constants.ObjectTypes.Document;
|
||||
const string relationTypeName = Constants.Conventions.RelationTypes.RelateParentDocumentOnDeleteName;
|
||||
|
||||
relationType = new RelationType(documentObjectType, documentObjectType, relationTypeAlias, relationTypeName);
|
||||
@@ -72,7 +72,7 @@ namespace Umbraco.Core.Compose
|
||||
var originalPath = item.OriginalPath.ToDelimitedList();
|
||||
var originalParentId = originalPath.Count > 2
|
||||
? int.Parse(originalPath[originalPath.Count - 2])
|
||||
: ConstantsCore.System.Root;
|
||||
: Constants.System.Root;
|
||||
|
||||
//before we can create this relation, we need to ensure that the original parent still exists which
|
||||
//may not be the case if the encompassing transaction also deleted it when this item was moved to the bin
|
||||
@@ -104,7 +104,7 @@ namespace Umbraco.Core.Compose
|
||||
// check that the relation-type exists, if not, then recreate it
|
||||
if (relationType == null)
|
||||
{
|
||||
var documentObjectType = ConstantsCore.ObjectTypes.Document;
|
||||
var documentObjectType = Constants.ObjectTypes.Document;
|
||||
const string relationTypeName = Constants.Conventions.RelationTypes.RelateParentMediaFolderOnDeleteName;
|
||||
relationType = new RelationType(documentObjectType, documentObjectType, relationTypeAlias, relationTypeName);
|
||||
relationService.Save(relationType);
|
||||
@@ -114,7 +114,7 @@ namespace Umbraco.Core.Compose
|
||||
var originalPath = item.OriginalPath.ToDelimitedList();
|
||||
var originalParentId = originalPath.Count > 2
|
||||
? int.Parse(originalPath[originalPath.Count - 2])
|
||||
: ConstantsCore.System.Root;
|
||||
: Constants.System.Root;
|
||||
//before we can create this relation, we need to ensure that the original parent still exists which
|
||||
//may not be the case if the encompassing transaction also deleted it when this item was moved to the bin
|
||||
if (entityService.Exists(originalParentId))
|
||||
|
||||
@@ -25,7 +25,7 @@ namespace Umbraco.Core.Composing
|
||||
{
|
||||
Type type;
|
||||
|
||||
var configuredTypeName = ConfigurationManager.AppSettings[ConstantsCore.AppSettings.RegisterType];
|
||||
var configuredTypeName = ConfigurationManager.AppSettings[Constants.AppSettings.RegisterType];
|
||||
if (configuredTypeName.IsNullOrWhiteSpace())
|
||||
{
|
||||
// try to get the web LightInject container type,
|
||||
|
||||
@@ -32,7 +32,7 @@ namespace Umbraco.Core.Composing
|
||||
if (_assembliesAcceptingLoadExceptions != null)
|
||||
return _assembliesAcceptingLoadExceptions;
|
||||
|
||||
var s = ConfigurationManager.AppSettings[ConstantsCore.AppSettings.AssembliesAcceptingLoadExceptions];
|
||||
var s = ConfigurationManager.AppSettings[Constants.AppSettings.AssembliesAcceptingLoadExceptions];
|
||||
return _assembliesAcceptingLoadExceptions = string.IsNullOrWhiteSpace(s)
|
||||
? Array.Empty<string>()
|
||||
: s.Split(',').Select(x => x.Trim()).ToArray();
|
||||
|
||||
@@ -7,8 +7,8 @@ namespace Umbraco.Core.Configuration
|
||||
public CoreDebug()
|
||||
{
|
||||
var appSettings = System.Configuration.ConfigurationManager.AppSettings;
|
||||
LogUncompletedScopes = string.Equals("true", appSettings[ConstantsCore.AppSettings.Debug.LogUncompletedScopes], StringComparison.OrdinalIgnoreCase);
|
||||
DumpOnTimeoutThreadAbort = string.Equals("true", appSettings[ConstantsCore.AppSettings.Debug.DumpOnTimeoutThreadAbort], StringComparison.OrdinalIgnoreCase);
|
||||
LogUncompletedScopes = string.Equals("true", appSettings[Constants.AppSettings.Debug.LogUncompletedScopes], StringComparison.OrdinalIgnoreCase);
|
||||
DumpOnTimeoutThreadAbort = string.Equals("true", appSettings[Constants.AppSettings.Debug.DumpOnTimeoutThreadAbort], StringComparison.OrdinalIgnoreCase);
|
||||
}
|
||||
|
||||
// when true, Scope logs the stack trace for any scope that gets disposed without being completed.
|
||||
|
||||
@@ -77,8 +77,8 @@ namespace Umbraco.Core.Configuration
|
||||
{
|
||||
if (_reservedUrls != null) return _reservedUrls;
|
||||
|
||||
var urls = ConfigurationManager.AppSettings.ContainsKey(ConstantsCore.AppSettings.ReservedUrls)
|
||||
? ConfigurationManager.AppSettings[ConstantsCore.AppSettings.ReservedUrls]
|
||||
var urls = ConfigurationManager.AppSettings.ContainsKey(Constants.AppSettings.ReservedUrls)
|
||||
? ConfigurationManager.AppSettings[Constants.AppSettings.ReservedUrls]
|
||||
: string.Empty;
|
||||
|
||||
//ensure the built on (non-changeable) reserved paths are there at all times
|
||||
@@ -99,14 +99,14 @@ namespace Umbraco.Core.Configuration
|
||||
if (_reservedPaths != null) return _reservedPaths;
|
||||
|
||||
var reservedPaths = StaticReservedPaths;
|
||||
var umbPath = ConfigurationManager.AppSettings.ContainsKey(ConstantsCore.AppSettings.Path) && !ConfigurationManager.AppSettings[ConstantsCore.AppSettings.Path].IsNullOrWhiteSpace()
|
||||
? ConfigurationManager.AppSettings[ConstantsCore.AppSettings.Path]
|
||||
var umbPath = ConfigurationManager.AppSettings.ContainsKey(Constants.AppSettings.Path) && !ConfigurationManager.AppSettings[Constants.AppSettings.Path].IsNullOrWhiteSpace()
|
||||
? ConfigurationManager.AppSettings[Constants.AppSettings.Path]
|
||||
: "~/umbraco";
|
||||
//always add the umbraco path to the list
|
||||
reservedPaths += umbPath.EnsureEndsWith(',');
|
||||
|
||||
var allPaths = ConfigurationManager.AppSettings.ContainsKey(ConstantsCore.AppSettings.ReservedPaths)
|
||||
? ConfigurationManager.AppSettings[ConstantsCore.AppSettings.ReservedPaths]
|
||||
var allPaths = ConfigurationManager.AppSettings.ContainsKey(Constants.AppSettings.ReservedPaths)
|
||||
? ConfigurationManager.AppSettings[Constants.AppSettings.ReservedPaths]
|
||||
: string.Empty;
|
||||
|
||||
_reservedPaths = reservedPaths + allPaths;
|
||||
@@ -125,8 +125,8 @@ namespace Umbraco.Core.Configuration
|
||||
{
|
||||
get
|
||||
{
|
||||
return ConfigurationManager.AppSettings.ContainsKey(ConstantsCore.AppSettings.ContentXML)
|
||||
? ConfigurationManager.AppSettings[ConstantsCore.AppSettings.ContentXML]
|
||||
return ConfigurationManager.AppSettings.ContainsKey(Constants.AppSettings.ContentXML)
|
||||
? ConfigurationManager.AppSettings[Constants.AppSettings.ContentXML]
|
||||
: "~/App_Data/umbraco.config";
|
||||
}
|
||||
}
|
||||
@@ -139,8 +139,8 @@ namespace Umbraco.Core.Configuration
|
||||
{
|
||||
get
|
||||
{
|
||||
return ConfigurationManager.AppSettings.ContainsKey(ConstantsCore.AppSettings.Path)
|
||||
? IOHelper.ResolveUrl(ConfigurationManager.AppSettings[ConstantsCore.AppSettings.Path])
|
||||
return ConfigurationManager.AppSettings.ContainsKey(Constants.AppSettings.Path)
|
||||
? IOHelper.ResolveUrl(ConfigurationManager.AppSettings[Constants.AppSettings.Path])
|
||||
: string.Empty;
|
||||
}
|
||||
}
|
||||
@@ -153,13 +153,13 @@ namespace Umbraco.Core.Configuration
|
||||
{
|
||||
get
|
||||
{
|
||||
return ConfigurationManager.AppSettings.ContainsKey(ConstantsCore.AppSettings.ConfigurationStatus)
|
||||
? ConfigurationManager.AppSettings[ConstantsCore.AppSettings.ConfigurationStatus]
|
||||
return ConfigurationManager.AppSettings.ContainsKey(Constants.AppSettings.ConfigurationStatus)
|
||||
? ConfigurationManager.AppSettings[Constants.AppSettings.ConfigurationStatus]
|
||||
: string.Empty;
|
||||
}
|
||||
set
|
||||
{
|
||||
SaveSetting(ConstantsCore.AppSettings.ConfigurationStatus, value);
|
||||
SaveSetting(Constants.AppSettings.ConfigurationStatus, value);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -241,7 +241,7 @@ namespace Umbraco.Core.Configuration
|
||||
{
|
||||
try
|
||||
{
|
||||
return int.Parse(ConfigurationManager.AppSettings[ConstantsCore.AppSettings.TimeOutInMinutes]);
|
||||
return int.Parse(ConfigurationManager.AppSettings[Constants.AppSettings.TimeOutInMinutes]);
|
||||
}
|
||||
catch
|
||||
{
|
||||
@@ -260,7 +260,7 @@ namespace Umbraco.Core.Configuration
|
||||
{
|
||||
try
|
||||
{
|
||||
return int.Parse(ConfigurationManager.AppSettings[ConstantsCore.AppSettings.VersionCheckPeriod]);
|
||||
return int.Parse(ConfigurationManager.AppSettings[Constants.AppSettings.VersionCheckPeriod]);
|
||||
}
|
||||
catch
|
||||
{
|
||||
@@ -274,7 +274,7 @@ namespace Umbraco.Core.Configuration
|
||||
{
|
||||
get
|
||||
{
|
||||
var setting = ConfigurationManager.AppSettings[ConstantsCore.AppSettings.LocalTempStorage];
|
||||
var setting = ConfigurationManager.AppSettings[Constants.AppSettings.LocalTempStorage];
|
||||
if (!string.IsNullOrWhiteSpace(setting))
|
||||
return Enum<LocalTempStorage>.Parse(setting);
|
||||
|
||||
@@ -333,8 +333,8 @@ namespace Umbraco.Core.Configuration
|
||||
{
|
||||
get
|
||||
{
|
||||
return ConfigurationManager.AppSettings.ContainsKey(ConstantsCore.AppSettings.DefaultUILanguage)
|
||||
? ConfigurationManager.AppSettings[ConstantsCore.AppSettings.DefaultUILanguage]
|
||||
return ConfigurationManager.AppSettings.ContainsKey(Constants.AppSettings.DefaultUILanguage)
|
||||
? ConfigurationManager.AppSettings[Constants.AppSettings.DefaultUILanguage]
|
||||
: string.Empty;
|
||||
}
|
||||
}
|
||||
@@ -351,7 +351,7 @@ namespace Umbraco.Core.Configuration
|
||||
{
|
||||
try
|
||||
{
|
||||
return bool.Parse(ConfigurationManager.AppSettings[ConstantsCore.AppSettings.HideTopLevelNodeFromPath]);
|
||||
return bool.Parse(ConfigurationManager.AppSettings[Constants.AppSettings.HideTopLevelNodeFromPath]);
|
||||
}
|
||||
catch
|
||||
{
|
||||
@@ -369,7 +369,7 @@ namespace Umbraco.Core.Configuration
|
||||
{
|
||||
try
|
||||
{
|
||||
return bool.Parse(ConfigurationManager.AppSettings[ConstantsCore.AppSettings.UseHttps]);
|
||||
return bool.Parse(ConfigurationManager.AppSettings[Constants.AppSettings.UseHttps]);
|
||||
}
|
||||
catch
|
||||
{
|
||||
|
||||
@@ -82,7 +82,7 @@ namespace Umbraco.Core.Configuration
|
||||
try
|
||||
{
|
||||
// TODO: https://github.com/umbraco/Umbraco-CMS/issues/4238 - stop having version in web.config appSettings
|
||||
var value = ConfigurationManager.AppSettings[ConstantsCore.AppSettings.ConfigurationStatus];
|
||||
var value = ConfigurationManager.AppSettings[Constants.AppSettings.ConfigurationStatus];
|
||||
return value.IsNullOrWhiteSpace() ? null : SemVersion.TryParse(value, out var semver) ? semver : null;
|
||||
}
|
||||
catch
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
namespace Umbraco.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// Constants all the identifiers within the Umbraco core.
|
||||
/// </summary>
|
||||
public static partial class Constants
|
||||
{
|
||||
// generic constants can go here
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,85 @@
|
||||
using System.Collections.Generic;
|
||||
using Umbraco.Core.Models;
|
||||
|
||||
namespace Umbraco.Core
|
||||
{
|
||||
public static class ConventionsHelper
|
||||
{
|
||||
public static Dictionary<string, PropertyType> GetStandardPropertyTypeStubs() =>
|
||||
new Dictionary<string, PropertyType>
|
||||
{
|
||||
{
|
||||
Constants.Conventions.Member.Comments,
|
||||
new PropertyType(Constants.PropertyEditors.Aliases.TextArea, ValueStorageType.Ntext, true,
|
||||
Constants.Conventions.Member.Comments)
|
||||
{
|
||||
Name = Constants.Conventions.Member.CommentsLabel
|
||||
}
|
||||
},
|
||||
{
|
||||
Constants.Conventions.Member.FailedPasswordAttempts,
|
||||
new PropertyType(Constants.PropertyEditors.Aliases.Label, ValueStorageType.Integer, true,
|
||||
Constants.Conventions.Member.FailedPasswordAttempts)
|
||||
{
|
||||
Name = Constants.Conventions.Member.FailedPasswordAttemptsLabel
|
||||
}
|
||||
},
|
||||
{
|
||||
Constants.Conventions.Member.IsApproved,
|
||||
new PropertyType(Constants.PropertyEditors.Aliases.Boolean, ValueStorageType.Integer, true,
|
||||
Constants.Conventions.Member.IsApproved)
|
||||
{
|
||||
Name = Constants.Conventions.Member.IsApprovedLabel
|
||||
}
|
||||
},
|
||||
{
|
||||
Constants.Conventions.Member.IsLockedOut,
|
||||
new PropertyType(Constants.PropertyEditors.Aliases.Boolean, ValueStorageType.Integer, true,
|
||||
Constants.Conventions.Member.IsLockedOut)
|
||||
{
|
||||
Name = Constants.Conventions.Member.IsLockedOutLabel
|
||||
}
|
||||
},
|
||||
{
|
||||
Constants.Conventions.Member.LastLockoutDate,
|
||||
new PropertyType(Constants.PropertyEditors.Aliases.Label, ValueStorageType.Date, true,
|
||||
Constants.Conventions.Member.LastLockoutDate)
|
||||
{
|
||||
Name = Constants.Conventions.Member.LastLockoutDateLabel
|
||||
}
|
||||
},
|
||||
{
|
||||
Constants.Conventions.Member.LastLoginDate,
|
||||
new PropertyType(Constants.PropertyEditors.Aliases.Label, ValueStorageType.Date, true,
|
||||
Constants.Conventions.Member.LastLoginDate)
|
||||
{
|
||||
Name = Constants.Conventions.Member.LastLoginDateLabel
|
||||
}
|
||||
},
|
||||
{
|
||||
Constants.Conventions.Member.LastPasswordChangeDate,
|
||||
new PropertyType(Constants.PropertyEditors.Aliases.Label, ValueStorageType.Date, true,
|
||||
Constants.Conventions.Member.LastPasswordChangeDate)
|
||||
{
|
||||
Name = Constants.Conventions.Member.LastPasswordChangeDateLabel
|
||||
}
|
||||
},
|
||||
{
|
||||
Constants.Conventions.Member.PasswordAnswer,
|
||||
new PropertyType(Constants.PropertyEditors.Aliases.Label, ValueStorageType.Nvarchar, true,
|
||||
Constants.Conventions.Member.PasswordAnswer)
|
||||
{
|
||||
Name = Constants.Conventions.Member.PasswordAnswerLabel
|
||||
}
|
||||
},
|
||||
{
|
||||
Constants.Conventions.Member.PasswordQuestion,
|
||||
new PropertyType(Constants.PropertyEditors.Aliases.Label, ValueStorageType.Nvarchar, true,
|
||||
Constants.Conventions.Member.PasswordQuestion)
|
||||
{
|
||||
Name = Constants.Conventions.Member.PasswordQuestionLabel
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -35,12 +35,12 @@ namespace Umbraco.Core.Events
|
||||
/// <summary>
|
||||
/// Boolean indicating whether this event was fired for the Content's Recycle Bin.
|
||||
/// </summary>
|
||||
public bool IsContentRecycleBin => NodeObjectType == ConstantsCore.ObjectTypes.Document;
|
||||
public bool IsContentRecycleBin => NodeObjectType == Constants.ObjectTypes.Document;
|
||||
|
||||
/// <summary>
|
||||
/// Boolean indicating whether this event was fired for the Media's Recycle Bin.
|
||||
/// </summary>
|
||||
public bool IsMediaRecycleBin => NodeObjectType == ConstantsCore.ObjectTypes.Media;
|
||||
public bool IsMediaRecycleBin => NodeObjectType == Constants.ObjectTypes.Media;
|
||||
|
||||
public bool Equals(RecycleBinEventArgs other)
|
||||
{
|
||||
|
||||
@@ -98,7 +98,7 @@ namespace Umbraco.Core.Migrations.Install
|
||||
var sql = scope.Database.SqlContext.Sql()
|
||||
.SelectCount()
|
||||
.From<UserDto>()
|
||||
.Where<UserDto>(x => x.Id == ConstantsCore.Security.SuperUserId && x.Password == "default");
|
||||
.Where<UserDto>(x => x.Id == Constants.Security.SuperUserId && x.Password == "default");
|
||||
var result = scope.Database.ExecuteScalar<int>(sql);
|
||||
var has = result != 1;
|
||||
if (has == false)
|
||||
@@ -308,11 +308,11 @@ namespace Umbraco.Core.Migrations.Install
|
||||
}
|
||||
|
||||
// create or update connection string
|
||||
var setting = connectionStrings.Descendants("add").FirstOrDefault(s => s.Attribute("name")?.Value == ConstantsCore.System.UmbracoConnectionName);
|
||||
var setting = connectionStrings.Descendants("add").FirstOrDefault(s => s.Attribute("name")?.Value == Constants.System.UmbracoConnectionName);
|
||||
if (setting == null)
|
||||
{
|
||||
connectionStrings.Add(new XElement("add",
|
||||
new XAttribute("name", ConstantsCore.System.UmbracoConnectionName),
|
||||
new XAttribute("name", Constants.System.UmbracoConnectionName),
|
||||
new XAttribute("connectionString", connectionString),
|
||||
new XAttribute("providerName", providerName)));
|
||||
}
|
||||
|
||||
@@ -91,51 +91,51 @@ namespace Umbraco.Core.Migrations.Install
|
||||
SortOrder = sortOrder,
|
||||
UniqueId = new Guid(uniqueId),
|
||||
Text = text,
|
||||
NodeObjectType = ConstantsCore.ObjectTypes.DataType,
|
||||
NodeObjectType = Constants.ObjectTypes.DataType,
|
||||
CreateDate = DateTime.Now
|
||||
};
|
||||
|
||||
_database.Insert(Constants.DatabaseSchema.Tables.Node, "id", false, nodeDto);
|
||||
}
|
||||
|
||||
_database.Insert(Constants.DatabaseSchema.Tables.Node, "id", false, new NodeDto { NodeId = -1, Trashed = false, ParentId = -1, UserId = -1, Level = 0, Path = "-1", SortOrder = 0, UniqueId = new Guid("916724a5-173d-4619-b97e-b9de133dd6f5"), Text = "SYSTEM DATA: umbraco master root", NodeObjectType = ConstantsCore.ObjectTypes.SystemRoot, CreateDate = DateTime.Now });
|
||||
_database.Insert(Constants.DatabaseSchema.Tables.Node, "id", false, new NodeDto { NodeId = -20, Trashed = false, ParentId = -1, UserId = -1, Level = 0, Path = "-1,-20", SortOrder = 0, UniqueId = new Guid("0F582A79-1E41-4CF0-BFA0-76340651891A"), Text = "Recycle Bin", NodeObjectType = ConstantsCore.ObjectTypes.ContentRecycleBin, CreateDate = DateTime.Now });
|
||||
_database.Insert(Constants.DatabaseSchema.Tables.Node, "id", false, new NodeDto { NodeId = -21, Trashed = false, ParentId = -1, UserId = -1, Level = 0, Path = "-1,-21", SortOrder = 0, UniqueId = new Guid("BF7C7CBC-952F-4518-97A2-69E9C7B33842"), Text = "Recycle Bin", NodeObjectType = ConstantsCore.ObjectTypes.MediaRecycleBin, CreateDate = DateTime.Now });
|
||||
InsertDataTypeNodeDto(ConstantsCore.DataTypes.LabelString, 35, ConstantsCore.DataTypes.Guids.LabelString, "Label (string)");
|
||||
InsertDataTypeNodeDto(ConstantsCore.DataTypes.LabelInt, 36, ConstantsCore.DataTypes.Guids.LabelInt, "Label (integer)");
|
||||
InsertDataTypeNodeDto(ConstantsCore.DataTypes.LabelBigint, 36, ConstantsCore.DataTypes.Guids.LabelBigInt, "Label (bigint)");
|
||||
InsertDataTypeNodeDto(ConstantsCore.DataTypes.LabelDateTime, 37, ConstantsCore.DataTypes.Guids.LabelDateTime, "Label (datetime)");
|
||||
InsertDataTypeNodeDto(ConstantsCore.DataTypes.LabelTime, 38, ConstantsCore.DataTypes.Guids.LabelTime, "Label (time)");
|
||||
InsertDataTypeNodeDto(ConstantsCore.DataTypes.LabelDecimal, 39, ConstantsCore.DataTypes.Guids.LabelDecimal, "Label (decimal)");
|
||||
_database.Insert(Constants.DatabaseSchema.Tables.Node, "id", false, new NodeDto { NodeId = ConstantsCore.DataTypes.Upload, Trashed = false, ParentId = -1, UserId = -1, Level = 1, Path = $"-1,{ConstantsCore.DataTypes.Upload}", SortOrder = 34, UniqueId = ConstantsCore.DataTypes.Guids.UploadGuid, Text = "Upload", NodeObjectType = ConstantsCore.ObjectTypes.DataType, CreateDate = DateTime.Now });
|
||||
_database.Insert(Constants.DatabaseSchema.Tables.Node, "id", false, new NodeDto { NodeId = ConstantsCore.DataTypes.Textarea, Trashed = false, ParentId = -1, UserId = -1, Level = 1, Path = $"-1,{ConstantsCore.DataTypes.Textarea}", SortOrder = 33, UniqueId = ConstantsCore.DataTypes.Guids.TextareaGuid, Text = "Textarea", NodeObjectType = ConstantsCore.ObjectTypes.DataType, CreateDate = DateTime.Now });
|
||||
_database.Insert(Constants.DatabaseSchema.Tables.Node, "id", false, new NodeDto { NodeId = ConstantsCore.DataTypes.Textbox, Trashed = false, ParentId = -1, UserId = -1, Level = 1, Path = $"-1,{ConstantsCore.DataTypes.Textbox}", SortOrder = 32, UniqueId = ConstantsCore.DataTypes.Guids.TextstringGuid, Text = "Textstring", NodeObjectType = ConstantsCore.ObjectTypes.DataType, CreateDate = DateTime.Now });
|
||||
_database.Insert(Constants.DatabaseSchema.Tables.Node, "id", false, new NodeDto { NodeId = ConstantsCore.DataTypes.RichtextEditor, Trashed = false, ParentId = -1, UserId = -1, Level = 1, Path = $"-1,{ConstantsCore.DataTypes.RichtextEditor}", SortOrder = 4, UniqueId = ConstantsCore.DataTypes.Guids.RichtextEditorGuid, Text = "Richtext editor", NodeObjectType = ConstantsCore.ObjectTypes.DataType, CreateDate = DateTime.Now });
|
||||
_database.Insert(Constants.DatabaseSchema.Tables.Node, "id", false, new NodeDto { NodeId = -51, Trashed = false, ParentId = -1, UserId = -1, Level = 1, Path = "-1,-51", SortOrder = 2, UniqueId = ConstantsCore.DataTypes.Guids.NumericGuid, Text = "Numeric", NodeObjectType = ConstantsCore.ObjectTypes.DataType, CreateDate = DateTime.Now });
|
||||
_database.Insert(Constants.DatabaseSchema.Tables.Node, "id", false, new NodeDto { NodeId = ConstantsCore.DataTypes.Boolean, Trashed = false, ParentId = -1, UserId = -1, Level = 1, Path = $"-1,{ConstantsCore.DataTypes.Boolean}", SortOrder = 2, UniqueId = ConstantsCore.DataTypes.Guids.CheckboxGuid, Text = "True/false", NodeObjectType = ConstantsCore.ObjectTypes.DataType, CreateDate = DateTime.Now });
|
||||
_database.Insert(Constants.DatabaseSchema.Tables.Node, "id", false, new NodeDto { NodeId = -43, Trashed = false, ParentId = -1, UserId = -1, Level = 1, Path = "-1,-43", SortOrder = 2, UniqueId = ConstantsCore.DataTypes.Guids.CheckboxListGuid, Text = "Checkbox list", NodeObjectType = ConstantsCore.ObjectTypes.DataType, CreateDate = DateTime.Now });
|
||||
_database.Insert(Constants.DatabaseSchema.Tables.Node, "id", false, new NodeDto { NodeId = ConstantsCore.DataTypes.DropDownSingle, Trashed = false, ParentId = -1, UserId = -1, Level = 1, Path = $"-1,{ConstantsCore.DataTypes.DropDownSingle}", SortOrder = 2, UniqueId = ConstantsCore.DataTypes.Guids.DropdownGuid, Text = "Dropdown", NodeObjectType = ConstantsCore.ObjectTypes.DataType, CreateDate = DateTime.Now });
|
||||
_database.Insert(Constants.DatabaseSchema.Tables.Node, "id", false, new NodeDto { NodeId = -41, Trashed = false, ParentId = -1, UserId = -1, Level = 1, Path = "-1,-41", SortOrder = 2, UniqueId = ConstantsCore.DataTypes.Guids.DatePickerGuid, Text = "Date Picker", NodeObjectType = ConstantsCore.ObjectTypes.DataType, CreateDate = DateTime.Now });
|
||||
_database.Insert(Constants.DatabaseSchema.Tables.Node, "id", false, new NodeDto { NodeId = -40, Trashed = false, ParentId = -1, UserId = -1, Level = 1, Path = "-1,-40", SortOrder = 2, UniqueId = ConstantsCore.DataTypes.Guids.RadioboxGuid, Text = "Radiobox", NodeObjectType = ConstantsCore.ObjectTypes.DataType, CreateDate = DateTime.Now });
|
||||
_database.Insert(Constants.DatabaseSchema.Tables.Node, "id", false, new NodeDto { NodeId = ConstantsCore.DataTypes.DropDownMultiple, Trashed = false, ParentId = -1, UserId = -1, Level = 1, Path = $"-1,{ConstantsCore.DataTypes.DropDownMultiple}", SortOrder = 2, UniqueId = ConstantsCore.DataTypes.Guids.DropdownMultipleGuid, Text = "Dropdown multiple", NodeObjectType = ConstantsCore.ObjectTypes.DataType, CreateDate = DateTime.Now });
|
||||
_database.Insert(Constants.DatabaseSchema.Tables.Node, "id", false, new NodeDto { NodeId = -37, Trashed = false, ParentId = -1, UserId = -1, Level = 1, Path = "-1,-37", SortOrder = 2, UniqueId = ConstantsCore.DataTypes.Guids.ApprovedColorGuid, Text = "Approved Color", NodeObjectType = ConstantsCore.ObjectTypes.DataType, CreateDate = DateTime.Now });
|
||||
_database.Insert(Constants.DatabaseSchema.Tables.Node, "id", false, new NodeDto { NodeId = ConstantsCore.DataTypes.DateTime, Trashed = false, ParentId = -1, UserId = -1, Level = 1, Path = $"-1,{ConstantsCore.DataTypes.DateTime}", SortOrder = 2, UniqueId = ConstantsCore.DataTypes.Guids.DatePickerWithTimeGuid, Text = "Date Picker with time", NodeObjectType = ConstantsCore.ObjectTypes.DataType, CreateDate = DateTime.Now });
|
||||
_database.Insert(Constants.DatabaseSchema.Tables.Node, "id", false, new NodeDto { NodeId = ConstantsCore.DataTypes.DefaultContentListView, Trashed = false, ParentId = -1, UserId = -1, Level = 1, Path = $"-1,{ConstantsCore.DataTypes.DefaultContentListView}", SortOrder = 2, UniqueId = ConstantsCore.DataTypes.Guids.ListViewContentGuid, Text = Constants.Conventions.DataTypes.ListViewPrefix + "Content", NodeObjectType = ConstantsCore.ObjectTypes.DataType, CreateDate = DateTime.Now });
|
||||
_database.Insert(Constants.DatabaseSchema.Tables.Node, "id", false, new NodeDto { NodeId = ConstantsCore.DataTypes.DefaultMediaListView, Trashed = false, ParentId = -1, UserId = -1, Level = 1, Path = $"-1,{ConstantsCore.DataTypes.DefaultMediaListView}", SortOrder = 2, UniqueId = ConstantsCore.DataTypes.Guids.ListViewMediaGuid, Text = Constants.Conventions.DataTypes.ListViewPrefix + "Media", NodeObjectType = ConstantsCore.ObjectTypes.DataType, CreateDate = DateTime.Now });
|
||||
_database.Insert(Constants.DatabaseSchema.Tables.Node, "id", false, new NodeDto { NodeId = ConstantsCore.DataTypes.DefaultMembersListView, Trashed = false, ParentId = -1, UserId = -1, Level = 1, Path = $"-1,{ConstantsCore.DataTypes.DefaultMembersListView}", SortOrder = 2, UniqueId = ConstantsCore.DataTypes.Guids.ListViewMembersGuid, Text = Constants.Conventions.DataTypes.ListViewPrefix + "Members", NodeObjectType = ConstantsCore.ObjectTypes.DataType, CreateDate = DateTime.Now });
|
||||
_database.Insert(Constants.DatabaseSchema.Tables.Node, "id", false, new NodeDto { NodeId = 1031, Trashed = false, ParentId = -1, UserId = -1, Level = 1, Path = "-1,1031", SortOrder = 2, UniqueId = new Guid("f38bd2d7-65d0-48e6-95dc-87ce06ec2d3d"), Text = Constants.Conventions.MediaTypes.Folder, NodeObjectType = ConstantsCore.ObjectTypes.MediaType, CreateDate = DateTime.Now });
|
||||
_database.Insert(Constants.DatabaseSchema.Tables.Node, "id", false, new NodeDto { NodeId = 1032, Trashed = false, ParentId = -1, UserId = -1, Level = 1, Path = "-1,1032", SortOrder = 2, UniqueId = new Guid("cc07b313-0843-4aa8-bbda-871c8da728c8"), Text = Constants.Conventions.MediaTypes.Image, NodeObjectType = ConstantsCore.ObjectTypes.MediaType, CreateDate = DateTime.Now });
|
||||
_database.Insert(Constants.DatabaseSchema.Tables.Node, "id", false, new NodeDto { NodeId = 1033, Trashed = false, ParentId = -1, UserId = -1, Level = 1, Path = "-1,1033", SortOrder = 2, UniqueId = new Guid("4c52d8ab-54e6-40cd-999c-7a5f24903e4d"), Text = Constants.Conventions.MediaTypes.File, NodeObjectType = ConstantsCore.ObjectTypes.MediaType, CreateDate = DateTime.Now });
|
||||
_database.Insert(Constants.DatabaseSchema.Tables.Node, "id", false, new NodeDto { NodeId = ConstantsCore.DataTypes.Tags, Trashed = false, ParentId = -1, UserId = -1, Level = 1, Path = $"-1,{ConstantsCore.DataTypes.Tags}", SortOrder = 2, UniqueId = new Guid("b6b73142-b9c1-4bf8-a16d-e1c23320b549"), Text = "Tags", NodeObjectType = ConstantsCore.ObjectTypes.DataType, CreateDate = DateTime.Now });
|
||||
_database.Insert(Constants.DatabaseSchema.Tables.Node, "id", false, new NodeDto { NodeId = ConstantsCore.DataTypes.ImageCropper, Trashed = false, ParentId = -1, UserId = -1, Level = 1, Path = $"-1,{ConstantsCore.DataTypes.ImageCropper}", SortOrder = 2, UniqueId = new Guid("1df9f033-e6d4-451f-b8d2-e0cbc50a836f"), Text = "Image Cropper", NodeObjectType = ConstantsCore.ObjectTypes.DataType, CreateDate = DateTime.Now });
|
||||
_database.Insert(Constants.DatabaseSchema.Tables.Node, "id", false, new NodeDto { NodeId = 1044, Trashed = false, ParentId = -1, UserId = -1, Level = 1, Path = "-1,1044", SortOrder = 0, UniqueId = new Guid("d59be02f-1df9-4228-aa1e-01917d806cda"), Text = Constants.Conventions.MemberTypes.DefaultAlias, NodeObjectType = ConstantsCore.ObjectTypes.MemberType, CreateDate = DateTime.Now });
|
||||
_database.Insert(Constants.DatabaseSchema.Tables.Node, "id", false, new NodeDto { NodeId = -1, Trashed = false, ParentId = -1, UserId = -1, Level = 0, Path = "-1", SortOrder = 0, UniqueId = new Guid("916724a5-173d-4619-b97e-b9de133dd6f5"), Text = "SYSTEM DATA: umbraco master root", NodeObjectType = Constants.ObjectTypes.SystemRoot, CreateDate = DateTime.Now });
|
||||
_database.Insert(Constants.DatabaseSchema.Tables.Node, "id", false, new NodeDto { NodeId = -20, Trashed = false, ParentId = -1, UserId = -1, Level = 0, Path = "-1,-20", SortOrder = 0, UniqueId = new Guid("0F582A79-1E41-4CF0-BFA0-76340651891A"), Text = "Recycle Bin", NodeObjectType = Constants.ObjectTypes.ContentRecycleBin, CreateDate = DateTime.Now });
|
||||
_database.Insert(Constants.DatabaseSchema.Tables.Node, "id", false, new NodeDto { NodeId = -21, Trashed = false, ParentId = -1, UserId = -1, Level = 0, Path = "-1,-21", SortOrder = 0, UniqueId = new Guid("BF7C7CBC-952F-4518-97A2-69E9C7B33842"), Text = "Recycle Bin", NodeObjectType = Constants.ObjectTypes.MediaRecycleBin, CreateDate = DateTime.Now });
|
||||
InsertDataTypeNodeDto(Constants.DataTypes.LabelString, 35, Constants.DataTypes.Guids.LabelString, "Label (string)");
|
||||
InsertDataTypeNodeDto(Constants.DataTypes.LabelInt, 36, Constants.DataTypes.Guids.LabelInt, "Label (integer)");
|
||||
InsertDataTypeNodeDto(Constants.DataTypes.LabelBigint, 36, Constants.DataTypes.Guids.LabelBigInt, "Label (bigint)");
|
||||
InsertDataTypeNodeDto(Constants.DataTypes.LabelDateTime, 37, Constants.DataTypes.Guids.LabelDateTime, "Label (datetime)");
|
||||
InsertDataTypeNodeDto(Constants.DataTypes.LabelTime, 38, Constants.DataTypes.Guids.LabelTime, "Label (time)");
|
||||
InsertDataTypeNodeDto(Constants.DataTypes.LabelDecimal, 39, Constants.DataTypes.Guids.LabelDecimal, "Label (decimal)");
|
||||
_database.Insert(Constants.DatabaseSchema.Tables.Node, "id", false, new NodeDto { NodeId = Constants.DataTypes.Upload, Trashed = false, ParentId = -1, UserId = -1, Level = 1, Path = $"-1,{Constants.DataTypes.Upload}", SortOrder = 34, UniqueId = Constants.DataTypes.Guids.UploadGuid, Text = "Upload", NodeObjectType = Constants.ObjectTypes.DataType, CreateDate = DateTime.Now });
|
||||
_database.Insert(Constants.DatabaseSchema.Tables.Node, "id", false, new NodeDto { NodeId = Constants.DataTypes.Textarea, Trashed = false, ParentId = -1, UserId = -1, Level = 1, Path = $"-1,{Constants.DataTypes.Textarea}", SortOrder = 33, UniqueId = Constants.DataTypes.Guids.TextareaGuid, Text = "Textarea", NodeObjectType = Constants.ObjectTypes.DataType, CreateDate = DateTime.Now });
|
||||
_database.Insert(Constants.DatabaseSchema.Tables.Node, "id", false, new NodeDto { NodeId = Constants.DataTypes.Textbox, Trashed = false, ParentId = -1, UserId = -1, Level = 1, Path = $"-1,{Constants.DataTypes.Textbox}", SortOrder = 32, UniqueId = Constants.DataTypes.Guids.TextstringGuid, Text = "Textstring", NodeObjectType = Constants.ObjectTypes.DataType, CreateDate = DateTime.Now });
|
||||
_database.Insert(Constants.DatabaseSchema.Tables.Node, "id", false, new NodeDto { NodeId = Constants.DataTypes.RichtextEditor, Trashed = false, ParentId = -1, UserId = -1, Level = 1, Path = $"-1,{Constants.DataTypes.RichtextEditor}", SortOrder = 4, UniqueId = Constants.DataTypes.Guids.RichtextEditorGuid, Text = "Richtext editor", NodeObjectType = Constants.ObjectTypes.DataType, CreateDate = DateTime.Now });
|
||||
_database.Insert(Constants.DatabaseSchema.Tables.Node, "id", false, new NodeDto { NodeId = -51, Trashed = false, ParentId = -1, UserId = -1, Level = 1, Path = "-1,-51", SortOrder = 2, UniqueId = Constants.DataTypes.Guids.NumericGuid, Text = "Numeric", NodeObjectType = Constants.ObjectTypes.DataType, CreateDate = DateTime.Now });
|
||||
_database.Insert(Constants.DatabaseSchema.Tables.Node, "id", false, new NodeDto { NodeId = Constants.DataTypes.Boolean, Trashed = false, ParentId = -1, UserId = -1, Level = 1, Path = $"-1,{Constants.DataTypes.Boolean}", SortOrder = 2, UniqueId = Constants.DataTypes.Guids.CheckboxGuid, Text = "True/false", NodeObjectType = Constants.ObjectTypes.DataType, CreateDate = DateTime.Now });
|
||||
_database.Insert(Constants.DatabaseSchema.Tables.Node, "id", false, new NodeDto { NodeId = -43, Trashed = false, ParentId = -1, UserId = -1, Level = 1, Path = "-1,-43", SortOrder = 2, UniqueId = Constants.DataTypes.Guids.CheckboxListGuid, Text = "Checkbox list", NodeObjectType = Constants.ObjectTypes.DataType, CreateDate = DateTime.Now });
|
||||
_database.Insert(Constants.DatabaseSchema.Tables.Node, "id", false, new NodeDto { NodeId = Constants.DataTypes.DropDownSingle, Trashed = false, ParentId = -1, UserId = -1, Level = 1, Path = $"-1,{Constants.DataTypes.DropDownSingle}", SortOrder = 2, UniqueId = Constants.DataTypes.Guids.DropdownGuid, Text = "Dropdown", NodeObjectType = Constants.ObjectTypes.DataType, CreateDate = DateTime.Now });
|
||||
_database.Insert(Constants.DatabaseSchema.Tables.Node, "id", false, new NodeDto { NodeId = -41, Trashed = false, ParentId = -1, UserId = -1, Level = 1, Path = "-1,-41", SortOrder = 2, UniqueId = Constants.DataTypes.Guids.DatePickerGuid, Text = "Date Picker", NodeObjectType = Constants.ObjectTypes.DataType, CreateDate = DateTime.Now });
|
||||
_database.Insert(Constants.DatabaseSchema.Tables.Node, "id", false, new NodeDto { NodeId = -40, Trashed = false, ParentId = -1, UserId = -1, Level = 1, Path = "-1,-40", SortOrder = 2, UniqueId = Constants.DataTypes.Guids.RadioboxGuid, Text = "Radiobox", NodeObjectType = Constants.ObjectTypes.DataType, CreateDate = DateTime.Now });
|
||||
_database.Insert(Constants.DatabaseSchema.Tables.Node, "id", false, new NodeDto { NodeId = Constants.DataTypes.DropDownMultiple, Trashed = false, ParentId = -1, UserId = -1, Level = 1, Path = $"-1,{Constants.DataTypes.DropDownMultiple}", SortOrder = 2, UniqueId = Constants.DataTypes.Guids.DropdownMultipleGuid, Text = "Dropdown multiple", NodeObjectType = Constants.ObjectTypes.DataType, CreateDate = DateTime.Now });
|
||||
_database.Insert(Constants.DatabaseSchema.Tables.Node, "id", false, new NodeDto { NodeId = -37, Trashed = false, ParentId = -1, UserId = -1, Level = 1, Path = "-1,-37", SortOrder = 2, UniqueId = Constants.DataTypes.Guids.ApprovedColorGuid, Text = "Approved Color", NodeObjectType = Constants.ObjectTypes.DataType, CreateDate = DateTime.Now });
|
||||
_database.Insert(Constants.DatabaseSchema.Tables.Node, "id", false, new NodeDto { NodeId = Constants.DataTypes.DateTime, Trashed = false, ParentId = -1, UserId = -1, Level = 1, Path = $"-1,{Constants.DataTypes.DateTime}", SortOrder = 2, UniqueId = Constants.DataTypes.Guids.DatePickerWithTimeGuid, Text = "Date Picker with time", NodeObjectType = Constants.ObjectTypes.DataType, CreateDate = DateTime.Now });
|
||||
_database.Insert(Constants.DatabaseSchema.Tables.Node, "id", false, new NodeDto { NodeId = Constants.DataTypes.DefaultContentListView, Trashed = false, ParentId = -1, UserId = -1, Level = 1, Path = $"-1,{Constants.DataTypes.DefaultContentListView}", SortOrder = 2, UniqueId = Constants.DataTypes.Guids.ListViewContentGuid, Text = Constants.Conventions.DataTypes.ListViewPrefix + "Content", NodeObjectType = Constants.ObjectTypes.DataType, CreateDate = DateTime.Now });
|
||||
_database.Insert(Constants.DatabaseSchema.Tables.Node, "id", false, new NodeDto { NodeId = Constants.DataTypes.DefaultMediaListView, Trashed = false, ParentId = -1, UserId = -1, Level = 1, Path = $"-1,{Constants.DataTypes.DefaultMediaListView}", SortOrder = 2, UniqueId = Constants.DataTypes.Guids.ListViewMediaGuid, Text = Constants.Conventions.DataTypes.ListViewPrefix + "Media", NodeObjectType = Constants.ObjectTypes.DataType, CreateDate = DateTime.Now });
|
||||
_database.Insert(Constants.DatabaseSchema.Tables.Node, "id", false, new NodeDto { NodeId = Constants.DataTypes.DefaultMembersListView, Trashed = false, ParentId = -1, UserId = -1, Level = 1, Path = $"-1,{Constants.DataTypes.DefaultMembersListView}", SortOrder = 2, UniqueId = Constants.DataTypes.Guids.ListViewMembersGuid, Text = Constants.Conventions.DataTypes.ListViewPrefix + "Members", NodeObjectType = Constants.ObjectTypes.DataType, CreateDate = DateTime.Now });
|
||||
_database.Insert(Constants.DatabaseSchema.Tables.Node, "id", false, new NodeDto { NodeId = 1031, Trashed = false, ParentId = -1, UserId = -1, Level = 1, Path = "-1,1031", SortOrder = 2, UniqueId = new Guid("f38bd2d7-65d0-48e6-95dc-87ce06ec2d3d"), Text = Constants.Conventions.MediaTypes.Folder, NodeObjectType = Constants.ObjectTypes.MediaType, CreateDate = DateTime.Now });
|
||||
_database.Insert(Constants.DatabaseSchema.Tables.Node, "id", false, new NodeDto { NodeId = 1032, Trashed = false, ParentId = -1, UserId = -1, Level = 1, Path = "-1,1032", SortOrder = 2, UniqueId = new Guid("cc07b313-0843-4aa8-bbda-871c8da728c8"), Text = Constants.Conventions.MediaTypes.Image, NodeObjectType = Constants.ObjectTypes.MediaType, CreateDate = DateTime.Now });
|
||||
_database.Insert(Constants.DatabaseSchema.Tables.Node, "id", false, new NodeDto { NodeId = 1033, Trashed = false, ParentId = -1, UserId = -1, Level = 1, Path = "-1,1033", SortOrder = 2, UniqueId = new Guid("4c52d8ab-54e6-40cd-999c-7a5f24903e4d"), Text = Constants.Conventions.MediaTypes.File, NodeObjectType = Constants.ObjectTypes.MediaType, CreateDate = DateTime.Now });
|
||||
_database.Insert(Constants.DatabaseSchema.Tables.Node, "id", false, new NodeDto { NodeId = Constants.DataTypes.Tags, Trashed = false, ParentId = -1, UserId = -1, Level = 1, Path = $"-1,{Constants.DataTypes.Tags}", SortOrder = 2, UniqueId = new Guid("b6b73142-b9c1-4bf8-a16d-e1c23320b549"), Text = "Tags", NodeObjectType = Constants.ObjectTypes.DataType, CreateDate = DateTime.Now });
|
||||
_database.Insert(Constants.DatabaseSchema.Tables.Node, "id", false, new NodeDto { NodeId = Constants.DataTypes.ImageCropper, Trashed = false, ParentId = -1, UserId = -1, Level = 1, Path = $"-1,{Constants.DataTypes.ImageCropper}", SortOrder = 2, UniqueId = new Guid("1df9f033-e6d4-451f-b8d2-e0cbc50a836f"), Text = "Image Cropper", NodeObjectType = Constants.ObjectTypes.DataType, CreateDate = DateTime.Now });
|
||||
_database.Insert(Constants.DatabaseSchema.Tables.Node, "id", false, new NodeDto { NodeId = 1044, Trashed = false, ParentId = -1, UserId = -1, Level = 1, Path = "-1,1044", SortOrder = 0, UniqueId = new Guid("d59be02f-1df9-4228-aa1e-01917d806cda"), Text = Constants.Conventions.MemberTypes.DefaultAlias, NodeObjectType = Constants.ObjectTypes.MemberType, CreateDate = DateTime.Now });
|
||||
|
||||
//New UDI pickers with newer Ids
|
||||
_database.Insert(Constants.DatabaseSchema.Tables.Node, "id", false, new NodeDto { NodeId = 1046, Trashed = false, ParentId = -1, UserId = -1, Level = 1, Path = "-1,1046", SortOrder = 2, UniqueId = new Guid("FD1E0DA5-5606-4862-B679-5D0CF3A52A59"), Text = "Content Picker", NodeObjectType = ConstantsCore.ObjectTypes.DataType, CreateDate = DateTime.Now });
|
||||
_database.Insert(Constants.DatabaseSchema.Tables.Node, "id", false, new NodeDto { NodeId = 1047, Trashed = false, ParentId = -1, UserId = -1, Level = 1, Path = "-1,1047", SortOrder = 2, UniqueId = new Guid("1EA2E01F-EBD8-4CE1-8D71-6B1149E63548"), Text = "Member Picker", NodeObjectType = ConstantsCore.ObjectTypes.DataType, CreateDate = DateTime.Now });
|
||||
_database.Insert(Constants.DatabaseSchema.Tables.Node, "id", false, new NodeDto { NodeId = 1048, Trashed = false, ParentId = -1, UserId = -1, Level = 1, Path = "-1,1048", SortOrder = 2, UniqueId = new Guid("135D60E0-64D9-49ED-AB08-893C9BA44AE5"), Text = "Media Picker", NodeObjectType = ConstantsCore.ObjectTypes.DataType, CreateDate = DateTime.Now });
|
||||
_database.Insert(Constants.DatabaseSchema.Tables.Node, "id", false, new NodeDto { NodeId = 1049, Trashed = false, ParentId = -1, UserId = -1, Level = 1, Path = "-1,1049", SortOrder = 2, UniqueId = new Guid("9DBBCBBB-2327-434A-B355-AF1B84E5010A"), Text = "Multiple Media Picker", NodeObjectType = ConstantsCore.ObjectTypes.DataType, CreateDate = DateTime.Now });
|
||||
_database.Insert(Constants.DatabaseSchema.Tables.Node, "id", false, new NodeDto { NodeId = 1050, Trashed = false, ParentId = -1, UserId = -1, Level = 1, Path = "-1,1050", SortOrder = 2, UniqueId = new Guid("B4E3535A-1753-47E2-8568-602CF8CFEE6F"), Text = "Multi URL Picker", NodeObjectType = ConstantsCore.ObjectTypes.DataType, CreateDate = DateTime.Now });
|
||||
_database.Insert(Constants.DatabaseSchema.Tables.Node, "id", false, new NodeDto { NodeId = 1046, Trashed = false, ParentId = -1, UserId = -1, Level = 1, Path = "-1,1046", SortOrder = 2, UniqueId = new Guid("FD1E0DA5-5606-4862-B679-5D0CF3A52A59"), Text = "Content Picker", NodeObjectType = Constants.ObjectTypes.DataType, CreateDate = DateTime.Now });
|
||||
_database.Insert(Constants.DatabaseSchema.Tables.Node, "id", false, new NodeDto { NodeId = 1047, Trashed = false, ParentId = -1, UserId = -1, Level = 1, Path = "-1,1047", SortOrder = 2, UniqueId = new Guid("1EA2E01F-EBD8-4CE1-8D71-6B1149E63548"), Text = "Member Picker", NodeObjectType = Constants.ObjectTypes.DataType, CreateDate = DateTime.Now });
|
||||
_database.Insert(Constants.DatabaseSchema.Tables.Node, "id", false, new NodeDto { NodeId = 1048, Trashed = false, ParentId = -1, UserId = -1, Level = 1, Path = "-1,1048", SortOrder = 2, UniqueId = new Guid("135D60E0-64D9-49ED-AB08-893C9BA44AE5"), Text = "Media Picker", NodeObjectType = Constants.ObjectTypes.DataType, CreateDate = DateTime.Now });
|
||||
_database.Insert(Constants.DatabaseSchema.Tables.Node, "id", false, new NodeDto { NodeId = 1049, Trashed = false, ParentId = -1, UserId = -1, Level = 1, Path = "-1,1049", SortOrder = 2, UniqueId = new Guid("9DBBCBBB-2327-434A-B355-AF1B84E5010A"), Text = "Multiple Media Picker", NodeObjectType = Constants.ObjectTypes.DataType, CreateDate = DateTime.Now });
|
||||
_database.Insert(Constants.DatabaseSchema.Tables.Node, "id", false, new NodeDto { NodeId = 1050, Trashed = false, ParentId = -1, UserId = -1, Level = 1, Path = "-1,1050", SortOrder = 2, UniqueId = new Guid("B4E3535A-1753-47E2-8568-602CF8CFEE6F"), Text = "Multi URL Picker", NodeObjectType = Constants.ObjectTypes.DataType, CreateDate = DateTime.Now });
|
||||
}
|
||||
|
||||
private void CreateLockData()
|
||||
@@ -155,80 +155,80 @@ namespace Umbraco.Core.Migrations.Install
|
||||
|
||||
private void CreateContentTypeData()
|
||||
{
|
||||
_database.Insert(Constants.DatabaseSchema.Tables.ContentType, "pk", false, new ContentTypeDto { PrimaryKey = 532, NodeId = 1031, Alias = Constants.Conventions.MediaTypes.Folder, Icon = ConstantsCore.Icons.MediaFolder, Thumbnail = ConstantsCore.Icons.MediaFolder, IsContainer = false, AllowAtRoot = true, Variations = (byte) ContentVariation.Nothing });
|
||||
_database.Insert(Constants.DatabaseSchema.Tables.ContentType, "pk", false, new ContentTypeDto { PrimaryKey = 533, NodeId = 1032, Alias = Constants.Conventions.MediaTypes.Image, Icon = ConstantsCore.Icons.MediaImage, Thumbnail = ConstantsCore.Icons.MediaImage, AllowAtRoot = true, Variations = (byte) ContentVariation.Nothing });
|
||||
_database.Insert(Constants.DatabaseSchema.Tables.ContentType, "pk", false, new ContentTypeDto { PrimaryKey = 534, NodeId = 1033, Alias = Constants.Conventions.MediaTypes.File, Icon = ConstantsCore.Icons.MediaFile, Thumbnail = ConstantsCore.Icons.MediaFile, AllowAtRoot = true, Variations = (byte) ContentVariation.Nothing });
|
||||
_database.Insert(Constants.DatabaseSchema.Tables.ContentType, "pk", false, new ContentTypeDto { PrimaryKey = 531, NodeId = 1044, Alias = Constants.Conventions.MemberTypes.DefaultAlias, Icon = ConstantsCore.Icons.Member, Thumbnail = ConstantsCore.Icons.Member, Variations = (byte) ContentVariation.Nothing });
|
||||
_database.Insert(Constants.DatabaseSchema.Tables.ContentType, "pk", false, new ContentTypeDto { PrimaryKey = 532, NodeId = 1031, Alias = Constants.Conventions.MediaTypes.Folder, Icon = Constants.Icons.MediaFolder, Thumbnail = Constants.Icons.MediaFolder, IsContainer = false, AllowAtRoot = true, Variations = (byte) ContentVariation.Nothing });
|
||||
_database.Insert(Constants.DatabaseSchema.Tables.ContentType, "pk", false, new ContentTypeDto { PrimaryKey = 533, NodeId = 1032, Alias = Constants.Conventions.MediaTypes.Image, Icon = Constants.Icons.MediaImage, Thumbnail = Constants.Icons.MediaImage, AllowAtRoot = true, Variations = (byte) ContentVariation.Nothing });
|
||||
_database.Insert(Constants.DatabaseSchema.Tables.ContentType, "pk", false, new ContentTypeDto { PrimaryKey = 534, NodeId = 1033, Alias = Constants.Conventions.MediaTypes.File, Icon = Constants.Icons.MediaFile, Thumbnail = Constants.Icons.MediaFile, AllowAtRoot = true, Variations = (byte) ContentVariation.Nothing });
|
||||
_database.Insert(Constants.DatabaseSchema.Tables.ContentType, "pk", false, new ContentTypeDto { PrimaryKey = 531, NodeId = 1044, Alias = Constants.Conventions.MemberTypes.DefaultAlias, Icon = Constants.Icons.Member, Thumbnail = Constants.Icons.Member, Variations = (byte) ContentVariation.Nothing });
|
||||
}
|
||||
|
||||
private void CreateUserData()
|
||||
{
|
||||
_database.Insert(Constants.DatabaseSchema.Tables.User, "id", false, new UserDto { Id = ConstantsCore.Security.SuperUserId, Disabled = false, NoConsole = false, UserName = "Administrator", Login = "admin", Password = "default", Email = "", UserLanguage = "en-US", CreateDate = DateTime.Now, UpdateDate = DateTime.Now });
|
||||
_database.Insert(Constants.DatabaseSchema.Tables.User, "id", false, new UserDto { Id = Constants.Security.SuperUserId, Disabled = false, NoConsole = false, UserName = "Administrator", Login = "admin", Password = "default", Email = "", UserLanguage = "en-US", CreateDate = DateTime.Now, UpdateDate = DateTime.Now });
|
||||
}
|
||||
|
||||
private void CreateUserGroupData()
|
||||
{
|
||||
_database.Insert(Constants.DatabaseSchema.Tables.UserGroup, "id", false, new UserGroupDto { Id = 1, StartMediaId = -1, StartContentId = -1, Alias = ConstantsCore.Security.AdminGroupAlias, Name = "Administrators", DefaultPermissions = "CADMOSKTPIURZ:5F7ï", CreateDate = DateTime.Now, UpdateDate = DateTime.Now, Icon = "icon-medal" });
|
||||
_database.Insert(Constants.DatabaseSchema.Tables.UserGroup, "id", false, new UserGroupDto { Id = 1, StartMediaId = -1, StartContentId = -1, Alias = Constants.Security.AdminGroupAlias, Name = "Administrators", DefaultPermissions = "CADMOSKTPIURZ:5F7ï", CreateDate = DateTime.Now, UpdateDate = DateTime.Now, Icon = "icon-medal" });
|
||||
_database.Insert(Constants.DatabaseSchema.Tables.UserGroup, "id", false, new UserGroupDto { Id = 2, StartMediaId = -1, StartContentId = -1, Alias = "writer", Name = "Writers", DefaultPermissions = "CAH:F", CreateDate = DateTime.Now, UpdateDate = DateTime.Now, Icon = "icon-edit" });
|
||||
_database.Insert(Constants.DatabaseSchema.Tables.UserGroup, "id", false, new UserGroupDto { Id = 3, StartMediaId = -1, StartContentId = -1, Alias = "editor", Name = "Editors", DefaultPermissions = "CADMOSKTPUZ:5Fï", CreateDate = DateTime.Now, UpdateDate = DateTime.Now, Icon = "icon-tools" });
|
||||
_database.Insert(Constants.DatabaseSchema.Tables.UserGroup, "id", false, new UserGroupDto { Id = 4, StartMediaId = -1, StartContentId = -1, Alias = ConstantsCore.Security.TranslatorGroupAlias, Name = "Translators", DefaultPermissions = "AF", CreateDate = DateTime.Now, UpdateDate = DateTime.Now, Icon = "icon-globe" });
|
||||
_database.Insert(Constants.DatabaseSchema.Tables.UserGroup, "id", false, new UserGroupDto { Id = 5, StartMediaId = -1, StartContentId = -1, Alias = ConstantsCore.Security.SensitiveDataGroupAlias, Name = "Sensitive data", DefaultPermissions = "", CreateDate = DateTime.Now, UpdateDate = DateTime.Now, Icon = "icon-lock" });
|
||||
_database.Insert(Constants.DatabaseSchema.Tables.UserGroup, "id", false, new UserGroupDto { Id = 4, StartMediaId = -1, StartContentId = -1, Alias = Constants.Security.TranslatorGroupAlias, Name = "Translators", DefaultPermissions = "AF", CreateDate = DateTime.Now, UpdateDate = DateTime.Now, Icon = "icon-globe" });
|
||||
_database.Insert(Constants.DatabaseSchema.Tables.UserGroup, "id", false, new UserGroupDto { Id = 5, StartMediaId = -1, StartContentId = -1, Alias = Constants.Security.SensitiveDataGroupAlias, Name = "Sensitive data", DefaultPermissions = "", CreateDate = DateTime.Now, UpdateDate = DateTime.Now, Icon = "icon-lock" });
|
||||
}
|
||||
|
||||
private void CreateUser2UserGroupData()
|
||||
{
|
||||
_database.Insert(new User2UserGroupDto { UserGroupId = 1, UserId = ConstantsCore.Security.SuperUserId }); // add super to admins
|
||||
_database.Insert(new User2UserGroupDto { UserGroupId = 5, UserId = ConstantsCore.Security.SuperUserId }); // add super to sensitive data
|
||||
_database.Insert(new User2UserGroupDto { UserGroupId = 1, UserId = Constants.Security.SuperUserId }); // add super to admins
|
||||
_database.Insert(new User2UserGroupDto { UserGroupId = 5, UserId = Constants.Security.SuperUserId }); // add super to sensitive data
|
||||
}
|
||||
|
||||
private void CreateUserGroup2AppData()
|
||||
{
|
||||
_database.Insert(new UserGroup2AppDto { UserGroupId = 1, AppAlias = ConstantsCore.Applications.Content });
|
||||
_database.Insert(new UserGroup2AppDto { UserGroupId = 1, AppAlias = ConstantsCore.Applications.Packages });
|
||||
_database.Insert(new UserGroup2AppDto { UserGroupId = 1, AppAlias = ConstantsCore.Applications.Media });
|
||||
_database.Insert(new UserGroup2AppDto { UserGroupId = 1, AppAlias = ConstantsCore.Applications.Members });
|
||||
_database.Insert(new UserGroup2AppDto { UserGroupId = 1, AppAlias = ConstantsCore.Applications.Settings });
|
||||
_database.Insert(new UserGroup2AppDto { UserGroupId = 1, AppAlias = ConstantsCore.Applications.Users });
|
||||
_database.Insert(new UserGroup2AppDto { UserGroupId = 1, AppAlias = ConstantsCore.Applications.Forms });
|
||||
_database.Insert(new UserGroup2AppDto { UserGroupId = 1, AppAlias = ConstantsCore.Applications.Translation });
|
||||
_database.Insert(new UserGroup2AppDto { UserGroupId = 1, AppAlias = Constants.Applications.Content });
|
||||
_database.Insert(new UserGroup2AppDto { UserGroupId = 1, AppAlias = Constants.Applications.Packages });
|
||||
_database.Insert(new UserGroup2AppDto { UserGroupId = 1, AppAlias = Constants.Applications.Media });
|
||||
_database.Insert(new UserGroup2AppDto { UserGroupId = 1, AppAlias = Constants.Applications.Members });
|
||||
_database.Insert(new UserGroup2AppDto { UserGroupId = 1, AppAlias = Constants.Applications.Settings });
|
||||
_database.Insert(new UserGroup2AppDto { UserGroupId = 1, AppAlias = Constants.Applications.Users });
|
||||
_database.Insert(new UserGroup2AppDto { UserGroupId = 1, AppAlias = Constants.Applications.Forms });
|
||||
_database.Insert(new UserGroup2AppDto { UserGroupId = 1, AppAlias = Constants.Applications.Translation });
|
||||
|
||||
_database.Insert(new UserGroup2AppDto { UserGroupId = 2, AppAlias = ConstantsCore.Applications.Content });
|
||||
_database.Insert(new UserGroup2AppDto { UserGroupId = 2, AppAlias = Constants.Applications.Content });
|
||||
|
||||
_database.Insert(new UserGroup2AppDto { UserGroupId = 3, AppAlias = ConstantsCore.Applications.Content });
|
||||
_database.Insert(new UserGroup2AppDto { UserGroupId = 3, AppAlias = ConstantsCore.Applications.Media });
|
||||
_database.Insert(new UserGroup2AppDto { UserGroupId = 3, AppAlias = ConstantsCore.Applications.Forms });
|
||||
_database.Insert(new UserGroup2AppDto { UserGroupId = 3, AppAlias = Constants.Applications.Content });
|
||||
_database.Insert(new UserGroup2AppDto { UserGroupId = 3, AppAlias = Constants.Applications.Media });
|
||||
_database.Insert(new UserGroup2AppDto { UserGroupId = 3, AppAlias = Constants.Applications.Forms });
|
||||
|
||||
_database.Insert(new UserGroup2AppDto { UserGroupId = 4, AppAlias = ConstantsCore.Applications.Translation });
|
||||
_database.Insert(new UserGroup2AppDto { UserGroupId = 4, AppAlias = Constants.Applications.Translation });
|
||||
}
|
||||
|
||||
private void CreatePropertyTypeGroupData()
|
||||
{
|
||||
_database.Insert(Constants.DatabaseSchema.Tables.PropertyTypeGroup, "id", false, new PropertyTypeGroupDto { Id = 3, ContentTypeNodeId = 1032, Text = "Image", SortOrder = 1, UniqueId = new Guid(ConstantsCore.PropertyTypeGroups.Image) });
|
||||
_database.Insert(Constants.DatabaseSchema.Tables.PropertyTypeGroup, "id", false, new PropertyTypeGroupDto { Id = 4, ContentTypeNodeId = 1033, Text = "File", SortOrder = 1, UniqueId = new Guid(ConstantsCore.PropertyTypeGroups.File) });
|
||||
_database.Insert(Constants.DatabaseSchema.Tables.PropertyTypeGroup, "id", false, new PropertyTypeGroupDto { Id = 3, ContentTypeNodeId = 1032, Text = "Image", SortOrder = 1, UniqueId = new Guid(Constants.PropertyTypeGroups.Image) });
|
||||
_database.Insert(Constants.DatabaseSchema.Tables.PropertyTypeGroup, "id", false, new PropertyTypeGroupDto { Id = 4, ContentTypeNodeId = 1033, Text = "File", SortOrder = 1, UniqueId = new Guid(Constants.PropertyTypeGroups.File) });
|
||||
//membership property group
|
||||
_database.Insert(Constants.DatabaseSchema.Tables.PropertyTypeGroup, "id", false, new PropertyTypeGroupDto { Id = 11, ContentTypeNodeId = 1044, Text = "Membership", SortOrder = 1, UniqueId = new Guid(ConstantsCore.PropertyTypeGroups.Membership) });
|
||||
_database.Insert(Constants.DatabaseSchema.Tables.PropertyTypeGroup, "id", false, new PropertyTypeGroupDto { Id = 11, ContentTypeNodeId = 1044, Text = "Membership", SortOrder = 1, UniqueId = new Guid(Constants.PropertyTypeGroups.Membership) });
|
||||
}
|
||||
|
||||
private void CreatePropertyTypeData()
|
||||
{
|
||||
_database.Insert(Constants.DatabaseSchema.Tables.PropertyType, "id", false, new PropertyTypeDto { Id = 6, UniqueId = 6.ToGuid(), DataTypeId = ConstantsCore.DataTypes.ImageCropper, ContentTypeId = 1032, PropertyTypeGroupId = 3, Alias = Constants.Conventions.Media.File, Name = "Upload image", SortOrder = 0, Mandatory = true, ValidationRegExp = null, Description = null, Variations = (byte) ContentVariation.Nothing });
|
||||
_database.Insert(Constants.DatabaseSchema.Tables.PropertyType, "id", false, new PropertyTypeDto { Id = 7, UniqueId = 7.ToGuid(), DataTypeId = ConstantsCore.DataTypes.LabelInt, ContentTypeId = 1032, PropertyTypeGroupId = 3, Alias = Constants.Conventions.Media.Width, Name = "Width", SortOrder = 0, Mandatory = false, ValidationRegExp = null, Description = "in pixels", Variations = (byte) ContentVariation.Nothing });
|
||||
_database.Insert(Constants.DatabaseSchema.Tables.PropertyType, "id", false, new PropertyTypeDto { Id = 8, UniqueId = 8.ToGuid(), DataTypeId = ConstantsCore.DataTypes.LabelInt, ContentTypeId = 1032, PropertyTypeGroupId = 3, Alias = Constants.Conventions.Media.Height, Name = "Height", SortOrder = 0, Mandatory = false, ValidationRegExp = null, Description = "in pixels", Variations = (byte) ContentVariation.Nothing });
|
||||
_database.Insert(Constants.DatabaseSchema.Tables.PropertyType, "id", false, new PropertyTypeDto { Id = 9, UniqueId = 9.ToGuid(), DataTypeId = ConstantsCore.DataTypes.LabelBigint, ContentTypeId = 1032, PropertyTypeGroupId = 3, Alias = Constants.Conventions.Media.Bytes, Name = "Size", SortOrder = 0, Mandatory = false, ValidationRegExp = null, Description = "in bytes", Variations = (byte) ContentVariation.Nothing });
|
||||
_database.Insert(Constants.DatabaseSchema.Tables.PropertyType, "id", false, new PropertyTypeDto { Id = 6, UniqueId = 6.ToGuid(), DataTypeId = Constants.DataTypes.ImageCropper, ContentTypeId = 1032, PropertyTypeGroupId = 3, Alias = Constants.Conventions.Media.File, Name = "Upload image", SortOrder = 0, Mandatory = true, ValidationRegExp = null, Description = null, Variations = (byte) ContentVariation.Nothing });
|
||||
_database.Insert(Constants.DatabaseSchema.Tables.PropertyType, "id", false, new PropertyTypeDto { Id = 7, UniqueId = 7.ToGuid(), DataTypeId = Constants.DataTypes.LabelInt, ContentTypeId = 1032, PropertyTypeGroupId = 3, Alias = Constants.Conventions.Media.Width, Name = "Width", SortOrder = 0, Mandatory = false, ValidationRegExp = null, Description = "in pixels", Variations = (byte) ContentVariation.Nothing });
|
||||
_database.Insert(Constants.DatabaseSchema.Tables.PropertyType, "id", false, new PropertyTypeDto { Id = 8, UniqueId = 8.ToGuid(), DataTypeId = Constants.DataTypes.LabelInt, ContentTypeId = 1032, PropertyTypeGroupId = 3, Alias = Constants.Conventions.Media.Height, Name = "Height", SortOrder = 0, Mandatory = false, ValidationRegExp = null, Description = "in pixels", Variations = (byte) ContentVariation.Nothing });
|
||||
_database.Insert(Constants.DatabaseSchema.Tables.PropertyType, "id", false, new PropertyTypeDto { Id = 9, UniqueId = 9.ToGuid(), DataTypeId = Constants.DataTypes.LabelBigint, ContentTypeId = 1032, PropertyTypeGroupId = 3, Alias = Constants.Conventions.Media.Bytes, Name = "Size", SortOrder = 0, Mandatory = false, ValidationRegExp = null, Description = "in bytes", Variations = (byte) ContentVariation.Nothing });
|
||||
_database.Insert(Constants.DatabaseSchema.Tables.PropertyType, "id", false, new PropertyTypeDto { Id = 10, UniqueId = 10.ToGuid(), DataTypeId = -92, ContentTypeId = 1032, PropertyTypeGroupId = 3, Alias = Constants.Conventions.Media.Extension, Name = "Type", SortOrder = 0, Mandatory = false, ValidationRegExp = null, Description = null, Variations = (byte) ContentVariation.Nothing });
|
||||
_database.Insert(Constants.DatabaseSchema.Tables.PropertyType, "id", false, new PropertyTypeDto { Id = 24, UniqueId = 24.ToGuid(), DataTypeId = ConstantsCore.DataTypes.Upload, ContentTypeId = 1033, PropertyTypeGroupId = 4, Alias = Constants.Conventions.Media.File, Name = "Upload file", SortOrder = 0, Mandatory = true, ValidationRegExp = null, Description = null, Variations = (byte) ContentVariation.Nothing });
|
||||
_database.Insert(Constants.DatabaseSchema.Tables.PropertyType, "id", false, new PropertyTypeDto { Id = 24, UniqueId = 24.ToGuid(), DataTypeId = Constants.DataTypes.Upload, ContentTypeId = 1033, PropertyTypeGroupId = 4, Alias = Constants.Conventions.Media.File, Name = "Upload file", SortOrder = 0, Mandatory = true, ValidationRegExp = null, Description = null, Variations = (byte) ContentVariation.Nothing });
|
||||
_database.Insert(Constants.DatabaseSchema.Tables.PropertyType, "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, Variations = (byte) ContentVariation.Nothing });
|
||||
_database.Insert(Constants.DatabaseSchema.Tables.PropertyType, "id", false, new PropertyTypeDto { Id = 26, UniqueId = 26.ToGuid(), DataTypeId = ConstantsCore.DataTypes.LabelBigint, ContentTypeId = 1033, PropertyTypeGroupId = 4, Alias = Constants.Conventions.Media.Bytes, Name = "Size", SortOrder = 0, Mandatory = false, ValidationRegExp = null, Description = "in bytes", Variations = (byte) ContentVariation.Nothing });
|
||||
_database.Insert(Constants.DatabaseSchema.Tables.PropertyType, "id", false, new PropertyTypeDto { Id = 26, UniqueId = 26.ToGuid(), DataTypeId = Constants.DataTypes.LabelBigint, ContentTypeId = 1033, PropertyTypeGroupId = 4, Alias = Constants.Conventions.Media.Bytes, Name = "Size", SortOrder = 0, Mandatory = false, ValidationRegExp = null, Description = "in bytes", Variations = (byte) ContentVariation.Nothing });
|
||||
//membership property types
|
||||
_database.Insert(Constants.DatabaseSchema.Tables.PropertyType, "id", false, new PropertyTypeDto { Id = 28, UniqueId = 28.ToGuid(), DataTypeId = ConstantsCore.DataTypes.Textarea, ContentTypeId = 1044, PropertyTypeGroupId = 11, Alias = Constants.Conventions.Member.Comments, Name = Constants.Conventions.Member.CommentsLabel, SortOrder = 0, Mandatory = false, ValidationRegExp = null, Description = null, Variations = (byte) ContentVariation.Nothing });
|
||||
_database.Insert(Constants.DatabaseSchema.Tables.PropertyType, "id", false, new PropertyTypeDto { Id = 29, UniqueId = 29.ToGuid(), DataTypeId = ConstantsCore.DataTypes.LabelInt, ContentTypeId = 1044, PropertyTypeGroupId = 11, Alias = Constants.Conventions.Member.FailedPasswordAttempts, Name = Constants.Conventions.Member.FailedPasswordAttemptsLabel, SortOrder = 1, Mandatory = false, ValidationRegExp = null, Description = null, Variations = (byte) ContentVariation.Nothing });
|
||||
_database.Insert(Constants.DatabaseSchema.Tables.PropertyType, "id", false, new PropertyTypeDto { Id = 30, UniqueId = 30.ToGuid(), DataTypeId = ConstantsCore.DataTypes.Boolean, ContentTypeId = 1044, PropertyTypeGroupId = 11, Alias = Constants.Conventions.Member.IsApproved, Name = Constants.Conventions.Member.IsApprovedLabel, SortOrder = 2, Mandatory = false, ValidationRegExp = null, Description = null, Variations = (byte) ContentVariation.Nothing });
|
||||
_database.Insert(Constants.DatabaseSchema.Tables.PropertyType, "id", false, new PropertyTypeDto { Id = 31, UniqueId = 31.ToGuid(), DataTypeId = ConstantsCore.DataTypes.Boolean, ContentTypeId = 1044, PropertyTypeGroupId = 11, Alias = Constants.Conventions.Member.IsLockedOut, Name = Constants.Conventions.Member.IsLockedOutLabel, SortOrder = 3, Mandatory = false, ValidationRegExp = null, Description = null, Variations = (byte) ContentVariation.Nothing });
|
||||
_database.Insert(Constants.DatabaseSchema.Tables.PropertyType, "id", false, new PropertyTypeDto { Id = 32, UniqueId = 32.ToGuid(), DataTypeId = ConstantsCore.DataTypes.LabelDateTime, ContentTypeId = 1044, PropertyTypeGroupId = 11, Alias = Constants.Conventions.Member.LastLockoutDate, Name = Constants.Conventions.Member.LastLockoutDateLabel, SortOrder = 4, Mandatory = false, ValidationRegExp = null, Description = null, Variations = (byte) ContentVariation.Nothing });
|
||||
_database.Insert(Constants.DatabaseSchema.Tables.PropertyType, "id", false, new PropertyTypeDto { Id = 33, UniqueId = 33.ToGuid(), DataTypeId = ConstantsCore.DataTypes.LabelDateTime, ContentTypeId = 1044, PropertyTypeGroupId = 11, Alias = Constants.Conventions.Member.LastLoginDate, Name = Constants.Conventions.Member.LastLoginDateLabel, SortOrder = 5, Mandatory = false, ValidationRegExp = null, Description = null, Variations = (byte) ContentVariation.Nothing });
|
||||
_database.Insert(Constants.DatabaseSchema.Tables.PropertyType, "id", false, new PropertyTypeDto { Id = 34, UniqueId = 34.ToGuid(), DataTypeId = ConstantsCore.DataTypes.LabelDateTime, ContentTypeId = 1044, PropertyTypeGroupId = 11, Alias = Constants.Conventions.Member.LastPasswordChangeDate, Name = Constants.Conventions.Member.LastPasswordChangeDateLabel, SortOrder = 6, Mandatory = false, ValidationRegExp = null, Description = null, Variations = (byte) ContentVariation.Nothing });
|
||||
_database.Insert(Constants.DatabaseSchema.Tables.PropertyType, "id", false, new PropertyTypeDto { Id = 35, UniqueId = 35.ToGuid(), DataTypeId = ConstantsCore.DataTypes.LabelDateTime, ContentTypeId = 1044, PropertyTypeGroupId = 11, Alias = Constants.Conventions.Member.PasswordQuestion, Name = Constants.Conventions.Member.PasswordQuestionLabel, SortOrder = 7, Mandatory = false, ValidationRegExp = null, Description = null, Variations = (byte)ContentVariation.Nothing });
|
||||
_database.Insert(Constants.DatabaseSchema.Tables.PropertyType, "id", false, new PropertyTypeDto { Id = 36, UniqueId = 36.ToGuid(), DataTypeId = ConstantsCore.DataTypes.LabelDateTime, ContentTypeId = 1044, PropertyTypeGroupId = 11, Alias = Constants.Conventions.Member.PasswordAnswer, Name = Constants.Conventions.Member.PasswordAnswerLabel, SortOrder = 8, Mandatory = false, ValidationRegExp = null, Description = null, Variations = (byte)ContentVariation.Nothing });
|
||||
_database.Insert(Constants.DatabaseSchema.Tables.PropertyType, "id", false, new PropertyTypeDto { Id = 28, UniqueId = 28.ToGuid(), DataTypeId = Constants.DataTypes.Textarea, ContentTypeId = 1044, PropertyTypeGroupId = 11, Alias = Constants.Conventions.Member.Comments, Name = Constants.Conventions.Member.CommentsLabel, SortOrder = 0, Mandatory = false, ValidationRegExp = null, Description = null, Variations = (byte) ContentVariation.Nothing });
|
||||
_database.Insert(Constants.DatabaseSchema.Tables.PropertyType, "id", false, new PropertyTypeDto { Id = 29, UniqueId = 29.ToGuid(), DataTypeId = Constants.DataTypes.LabelInt, ContentTypeId = 1044, PropertyTypeGroupId = 11, Alias = Constants.Conventions.Member.FailedPasswordAttempts, Name = Constants.Conventions.Member.FailedPasswordAttemptsLabel, SortOrder = 1, Mandatory = false, ValidationRegExp = null, Description = null, Variations = (byte) ContentVariation.Nothing });
|
||||
_database.Insert(Constants.DatabaseSchema.Tables.PropertyType, "id", false, new PropertyTypeDto { Id = 30, UniqueId = 30.ToGuid(), DataTypeId = Constants.DataTypes.Boolean, ContentTypeId = 1044, PropertyTypeGroupId = 11, Alias = Constants.Conventions.Member.IsApproved, Name = Constants.Conventions.Member.IsApprovedLabel, SortOrder = 2, Mandatory = false, ValidationRegExp = null, Description = null, Variations = (byte) ContentVariation.Nothing });
|
||||
_database.Insert(Constants.DatabaseSchema.Tables.PropertyType, "id", false, new PropertyTypeDto { Id = 31, UniqueId = 31.ToGuid(), DataTypeId = Constants.DataTypes.Boolean, ContentTypeId = 1044, PropertyTypeGroupId = 11, Alias = Constants.Conventions.Member.IsLockedOut, Name = Constants.Conventions.Member.IsLockedOutLabel, SortOrder = 3, Mandatory = false, ValidationRegExp = null, Description = null, Variations = (byte) ContentVariation.Nothing });
|
||||
_database.Insert(Constants.DatabaseSchema.Tables.PropertyType, "id", false, new PropertyTypeDto { Id = 32, UniqueId = 32.ToGuid(), DataTypeId = Constants.DataTypes.LabelDateTime, ContentTypeId = 1044, PropertyTypeGroupId = 11, Alias = Constants.Conventions.Member.LastLockoutDate, Name = Constants.Conventions.Member.LastLockoutDateLabel, SortOrder = 4, Mandatory = false, ValidationRegExp = null, Description = null, Variations = (byte) ContentVariation.Nothing });
|
||||
_database.Insert(Constants.DatabaseSchema.Tables.PropertyType, "id", false, new PropertyTypeDto { Id = 33, UniqueId = 33.ToGuid(), DataTypeId = Constants.DataTypes.LabelDateTime, ContentTypeId = 1044, PropertyTypeGroupId = 11, Alias = Constants.Conventions.Member.LastLoginDate, Name = Constants.Conventions.Member.LastLoginDateLabel, SortOrder = 5, Mandatory = false, ValidationRegExp = null, Description = null, Variations = (byte) ContentVariation.Nothing });
|
||||
_database.Insert(Constants.DatabaseSchema.Tables.PropertyType, "id", false, new PropertyTypeDto { Id = 34, UniqueId = 34.ToGuid(), DataTypeId = Constants.DataTypes.LabelDateTime, ContentTypeId = 1044, PropertyTypeGroupId = 11, Alias = Constants.Conventions.Member.LastPasswordChangeDate, Name = Constants.Conventions.Member.LastPasswordChangeDateLabel, SortOrder = 6, Mandatory = false, ValidationRegExp = null, Description = null, Variations = (byte) ContentVariation.Nothing });
|
||||
_database.Insert(Constants.DatabaseSchema.Tables.PropertyType, "id", false, new PropertyTypeDto { Id = 35, UniqueId = 35.ToGuid(), DataTypeId = Constants.DataTypes.LabelDateTime, ContentTypeId = 1044, PropertyTypeGroupId = 11, Alias = Constants.Conventions.Member.PasswordQuestion, Name = Constants.Conventions.Member.PasswordQuestionLabel, SortOrder = 7, Mandatory = false, ValidationRegExp = null, Description = null, Variations = (byte)ContentVariation.Nothing });
|
||||
_database.Insert(Constants.DatabaseSchema.Tables.PropertyType, "id", false, new PropertyTypeDto { Id = 36, UniqueId = 36.ToGuid(), DataTypeId = Constants.DataTypes.LabelDateTime, ContentTypeId = 1044, PropertyTypeGroupId = 11, Alias = Constants.Conventions.Member.PasswordAnswer, Name = Constants.Conventions.Member.PasswordAnswerLabel, SortOrder = 8, Mandatory = false, ValidationRegExp = null, Description = null, Variations = (byte)ContentVariation.Nothing });
|
||||
|
||||
}
|
||||
|
||||
@@ -267,35 +267,35 @@ namespace Umbraco.Core.Migrations.Install
|
||||
const string layouts = "[" + cardLayout + "," + listLayout + "]";
|
||||
|
||||
// TODO: Check which of the DataTypeIds below doesn't exist in umbracoNode, which results in a foreign key constraint errors.
|
||||
_database.Insert(Constants.DatabaseSchema.Tables.DataType, "pk", false, new DataTypeDto { NodeId = ConstantsCore.DataTypes.Boolean, EditorAlias = Constants.PropertyEditors.Aliases.Boolean, DbType = "Integer" });
|
||||
_database.Insert(Constants.DatabaseSchema.Tables.DataType, "pk", false, new DataTypeDto { NodeId = Constants.DataTypes.Boolean, EditorAlias = Constants.PropertyEditors.Aliases.Boolean, DbType = "Integer" });
|
||||
_database.Insert(Constants.DatabaseSchema.Tables.DataType, "pk", false, new DataTypeDto { NodeId = -51, EditorAlias = Constants.PropertyEditors.Aliases.Integer, DbType = "Integer" });
|
||||
_database.Insert(Constants.DatabaseSchema.Tables.DataType, "pk", false, new DataTypeDto { NodeId = -87, EditorAlias = Constants.PropertyEditors.Aliases.TinyMce, DbType = "Ntext",
|
||||
Configuration = "{\"value\":\",code,undo,redo,cut,copy,mcepasteword,stylepicker,bold,italic,bullist,numlist,outdent,indent,mcelink,unlink,mceinsertanchor,mceimage,umbracomacro,mceinserttable,umbracoembed,mcecharmap,|1|1,2,3,|0|500,400|1049,|true|\"}" });
|
||||
_database.Insert(Constants.DatabaseSchema.Tables.DataType, "pk", false, new DataTypeDto { NodeId = ConstantsCore.DataTypes.Textbox, EditorAlias = Constants.PropertyEditors.Aliases.TextBox, DbType = "Nvarchar" });
|
||||
_database.Insert(Constants.DatabaseSchema.Tables.DataType, "pk", false, new DataTypeDto { NodeId = ConstantsCore.DataTypes.Textarea, EditorAlias = Constants.PropertyEditors.Aliases.TextArea, DbType = "Ntext" });
|
||||
_database.Insert(Constants.DatabaseSchema.Tables.DataType, "pk", false, new DataTypeDto { NodeId = ConstantsCore.DataTypes.Upload, EditorAlias = Constants.PropertyEditors.Aliases.UploadField, DbType = "Nvarchar" });
|
||||
InsertDataTypeDto(ConstantsCore.DataTypes.LabelString, Constants.PropertyEditors.Aliases.Label, "Nvarchar", "{\"umbracoDataValueType\":\"STRING\"}");
|
||||
InsertDataTypeDto(ConstantsCore.DataTypes.LabelInt, Constants.PropertyEditors.Aliases.Label, "Integer", "{\"umbracoDataValueType\":\"INT\"}");
|
||||
InsertDataTypeDto(ConstantsCore.DataTypes.LabelBigint, Constants.PropertyEditors.Aliases.Label, "Nvarchar", "{\"umbracoDataValueType\":\"BIGINT\"}");
|
||||
InsertDataTypeDto(ConstantsCore.DataTypes.LabelDateTime, Constants.PropertyEditors.Aliases.Label, "Date", "{\"umbracoDataValueType\":\"DATETIME\"}");
|
||||
InsertDataTypeDto(ConstantsCore.DataTypes.LabelDecimal, Constants.PropertyEditors.Aliases.Label, "Decimal", "{\"umbracoDataValueType\":\"DECIMAL\"}");
|
||||
InsertDataTypeDto(ConstantsCore.DataTypes.LabelTime, Constants.PropertyEditors.Aliases.Label, "Date", "{\"umbracoDataValueType\":\"TIME\"}");
|
||||
_database.Insert(Constants.DatabaseSchema.Tables.DataType, "pk", false, new DataTypeDto { NodeId = ConstantsCore.DataTypes.DateTime, EditorAlias = Constants.PropertyEditors.Aliases.DateTime, DbType = "Date" });
|
||||
_database.Insert(Constants.DatabaseSchema.Tables.DataType, "pk", false, new DataTypeDto { NodeId = Constants.DataTypes.Textbox, EditorAlias = Constants.PropertyEditors.Aliases.TextBox, DbType = "Nvarchar" });
|
||||
_database.Insert(Constants.DatabaseSchema.Tables.DataType, "pk", false, new DataTypeDto { NodeId = Constants.DataTypes.Textarea, EditorAlias = Constants.PropertyEditors.Aliases.TextArea, DbType = "Ntext" });
|
||||
_database.Insert(Constants.DatabaseSchema.Tables.DataType, "pk", false, new DataTypeDto { NodeId = Constants.DataTypes.Upload, EditorAlias = Constants.PropertyEditors.Aliases.UploadField, DbType = "Nvarchar" });
|
||||
InsertDataTypeDto(Constants.DataTypes.LabelString, Constants.PropertyEditors.Aliases.Label, "Nvarchar", "{\"umbracoDataValueType\":\"STRING\"}");
|
||||
InsertDataTypeDto(Constants.DataTypes.LabelInt, Constants.PropertyEditors.Aliases.Label, "Integer", "{\"umbracoDataValueType\":\"INT\"}");
|
||||
InsertDataTypeDto(Constants.DataTypes.LabelBigint, Constants.PropertyEditors.Aliases.Label, "Nvarchar", "{\"umbracoDataValueType\":\"BIGINT\"}");
|
||||
InsertDataTypeDto(Constants.DataTypes.LabelDateTime, Constants.PropertyEditors.Aliases.Label, "Date", "{\"umbracoDataValueType\":\"DATETIME\"}");
|
||||
InsertDataTypeDto(Constants.DataTypes.LabelDecimal, Constants.PropertyEditors.Aliases.Label, "Decimal", "{\"umbracoDataValueType\":\"DECIMAL\"}");
|
||||
InsertDataTypeDto(Constants.DataTypes.LabelTime, Constants.PropertyEditors.Aliases.Label, "Date", "{\"umbracoDataValueType\":\"TIME\"}");
|
||||
_database.Insert(Constants.DatabaseSchema.Tables.DataType, "pk", false, new DataTypeDto { NodeId = Constants.DataTypes.DateTime, EditorAlias = Constants.PropertyEditors.Aliases.DateTime, DbType = "Date" });
|
||||
_database.Insert(Constants.DatabaseSchema.Tables.DataType, "pk", false, new DataTypeDto { NodeId = -37, EditorAlias = Constants.PropertyEditors.Aliases.ColorPicker, DbType = "Nvarchar" });
|
||||
InsertDataTypeDto(ConstantsCore.DataTypes.DropDownSingle, Constants.PropertyEditors.Aliases.DropDownListFlexible, "Nvarchar", "{\"multiple\":false}");
|
||||
InsertDataTypeDto(Constants.DataTypes.DropDownSingle, Constants.PropertyEditors.Aliases.DropDownListFlexible, "Nvarchar", "{\"multiple\":false}");
|
||||
_database.Insert(Constants.DatabaseSchema.Tables.DataType, "pk", false, new DataTypeDto { NodeId = -40, EditorAlias = Constants.PropertyEditors.Aliases.RadioButtonList, DbType = "Nvarchar" });
|
||||
_database.Insert(Constants.DatabaseSchema.Tables.DataType, "pk", false, new DataTypeDto { NodeId = -41, EditorAlias = "Umbraco.DateTime", DbType = "Date", Configuration = "{\"format\":\"YYYY-MM-DD\"}" });
|
||||
InsertDataTypeDto(ConstantsCore.DataTypes.DropDownMultiple, Constants.PropertyEditors.Aliases.DropDownListFlexible, "Nvarchar", "{\"multiple\":true}");
|
||||
InsertDataTypeDto(Constants.DataTypes.DropDownMultiple, Constants.PropertyEditors.Aliases.DropDownListFlexible, "Nvarchar", "{\"multiple\":true}");
|
||||
_database.Insert(Constants.DatabaseSchema.Tables.DataType, "pk", false, new DataTypeDto { NodeId = -43, EditorAlias = Constants.PropertyEditors.Aliases.CheckBoxList, DbType = "Nvarchar" });
|
||||
_database.Insert(Constants.DatabaseSchema.Tables.DataType, "pk", false, new DataTypeDto { NodeId = ConstantsCore.DataTypes.Tags, EditorAlias = Constants.PropertyEditors.Aliases.Tags, DbType = "Ntext",
|
||||
_database.Insert(Constants.DatabaseSchema.Tables.DataType, "pk", false, new DataTypeDto { NodeId = Constants.DataTypes.Tags, EditorAlias = Constants.PropertyEditors.Aliases.Tags, DbType = "Ntext",
|
||||
Configuration = "{\"group\":\"default\", \"storageType\":\"Json\"}"
|
||||
});
|
||||
_database.Insert(Constants.DatabaseSchema.Tables.DataType, "pk", false, new DataTypeDto { NodeId = ConstantsCore.DataTypes.ImageCropper, EditorAlias = Constants.PropertyEditors.Aliases.ImageCropper, DbType = "Ntext" });
|
||||
_database.Insert(Constants.DatabaseSchema.Tables.DataType, "pk", false, new DataTypeDto { NodeId = ConstantsCore.DataTypes.DefaultContentListView, EditorAlias = Constants.PropertyEditors.Aliases.ListView, DbType = "Nvarchar",
|
||||
_database.Insert(Constants.DatabaseSchema.Tables.DataType, "pk", false, new DataTypeDto { NodeId = Constants.DataTypes.ImageCropper, EditorAlias = Constants.PropertyEditors.Aliases.ImageCropper, DbType = "Ntext" });
|
||||
_database.Insert(Constants.DatabaseSchema.Tables.DataType, "pk", false, new DataTypeDto { NodeId = Constants.DataTypes.DefaultContentListView, EditorAlias = Constants.PropertyEditors.Aliases.ListView, DbType = "Nvarchar",
|
||||
Configuration = "{\"pageSize\":100, \"orderBy\":\"updateDate\", \"orderDirection\":\"desc\", \"layouts\":" + layouts + ", \"includeProperties\":[{\"alias\":\"updateDate\",\"header\":\"Last edited\",\"isSystem\":1},{\"alias\":\"owner\",\"header\":\"Updated by\",\"isSystem\":1}]}" });
|
||||
_database.Insert(Constants.DatabaseSchema.Tables.DataType, "pk", false, new DataTypeDto { NodeId = ConstantsCore.DataTypes.DefaultMediaListView, EditorAlias = Constants.PropertyEditors.Aliases.ListView, DbType = "Nvarchar",
|
||||
_database.Insert(Constants.DatabaseSchema.Tables.DataType, "pk", false, new DataTypeDto { NodeId = Constants.DataTypes.DefaultMediaListView, EditorAlias = Constants.PropertyEditors.Aliases.ListView, DbType = "Nvarchar",
|
||||
Configuration = "{\"pageSize\":100, \"orderBy\":\"updateDate\", \"orderDirection\":\"desc\", \"layouts\":" + layouts + ", \"includeProperties\":[{\"alias\":\"updateDate\",\"header\":\"Last edited\",\"isSystem\":1},{\"alias\":\"owner\",\"header\":\"Updated by\",\"isSystem\":1}]}" });
|
||||
_database.Insert(Constants.DatabaseSchema.Tables.DataType, "pk", false, new DataTypeDto { NodeId = ConstantsCore.DataTypes.DefaultMembersListView, EditorAlias = Constants.PropertyEditors.Aliases.ListView, DbType = "Nvarchar",
|
||||
_database.Insert(Constants.DatabaseSchema.Tables.DataType, "pk", false, new DataTypeDto { NodeId = Constants.DataTypes.DefaultMembersListView, EditorAlias = Constants.PropertyEditors.Aliases.ListView, DbType = "Nvarchar",
|
||||
Configuration = "{\"pageSize\":10, \"orderBy\":\"username\", \"orderDirection\":\"asc\", \"includeProperties\":[{\"alias\":\"username\",\"isSystem\":1},{\"alias\":\"email\",\"isSystem\":1},{\"alias\":\"updateDate\",\"header\":\"Last edited\",\"isSystem\":1}]}" });
|
||||
|
||||
//New UDI pickers with newer Ids
|
||||
@@ -309,13 +309,13 @@ namespace Umbraco.Core.Migrations.Install
|
||||
|
||||
private void CreateRelationTypeData()
|
||||
{
|
||||
var relationType = new RelationTypeDto { Id = 1, Alias = Constants.Conventions.RelationTypes.RelateDocumentOnCopyAlias, ChildObjectType = ConstantsCore.ObjectTypes.Document, ParentObjectType = ConstantsCore.ObjectTypes.Document, Dual = true, Name = Constants.Conventions.RelationTypes.RelateDocumentOnCopyName };
|
||||
var relationType = new RelationTypeDto { Id = 1, Alias = Constants.Conventions.RelationTypes.RelateDocumentOnCopyAlias, ChildObjectType = Constants.ObjectTypes.Document, ParentObjectType = Constants.ObjectTypes.Document, Dual = true, Name = Constants.Conventions.RelationTypes.RelateDocumentOnCopyName };
|
||||
relationType.UniqueId = (relationType.Alias + "____" + relationType.Name).ToGuid();
|
||||
_database.Insert(Constants.DatabaseSchema.Tables.RelationType, "id", false, relationType);
|
||||
relationType = new RelationTypeDto { Id = 2, Alias = Constants.Conventions.RelationTypes.RelateParentDocumentOnDeleteAlias, ChildObjectType = ConstantsCore.ObjectTypes.Document, ParentObjectType = ConstantsCore.ObjectTypes.Document, Dual = false, Name = Constants.Conventions.RelationTypes.RelateParentDocumentOnDeleteName };
|
||||
relationType = new RelationTypeDto { Id = 2, Alias = Constants.Conventions.RelationTypes.RelateParentDocumentOnDeleteAlias, ChildObjectType = Constants.ObjectTypes.Document, ParentObjectType = Constants.ObjectTypes.Document, Dual = false, Name = Constants.Conventions.RelationTypes.RelateParentDocumentOnDeleteName };
|
||||
relationType.UniqueId = (relationType.Alias + "____" + relationType.Name).ToGuid();
|
||||
_database.Insert(Constants.DatabaseSchema.Tables.RelationType, "id", false, relationType);
|
||||
relationType = new RelationTypeDto { Id = 3, Alias = Constants.Conventions.RelationTypes.RelateParentMediaFolderOnDeleteAlias, ChildObjectType = ConstantsCore.ObjectTypes.Media, ParentObjectType = ConstantsCore.ObjectTypes.Media, Dual = false, Name = Constants.Conventions.RelationTypes.RelateParentMediaFolderOnDeleteName };
|
||||
relationType = new RelationTypeDto { Id = 3, Alias = Constants.Conventions.RelationTypes.RelateParentMediaFolderOnDeleteAlias, ChildObjectType = Constants.ObjectTypes.Media, ParentObjectType = Constants.ObjectTypes.Media, Dual = false, Name = Constants.Conventions.RelationTypes.RelateParentMediaFolderOnDeleteName };
|
||||
relationType.UniqueId = (relationType.Alias + "____" + relationType.Name).ToGuid();
|
||||
_database.Insert(Constants.DatabaseSchema.Tables.RelationType, "id", false, relationType);
|
||||
}
|
||||
|
||||
@@ -21,7 +21,7 @@ namespace Umbraco.Core.Migrations.Upgrade
|
||||
/// Initializes a new instance of the <see cref="UmbracoPlan"/> class.
|
||||
/// </summary>
|
||||
public UmbracoPlan()
|
||||
: base(ConstantsCore.System.UmbracoUpgradePlanName)
|
||||
: base(Constants.System.UmbracoUpgradePlanName)
|
||||
{
|
||||
DefinePlan();
|
||||
}
|
||||
@@ -61,8 +61,8 @@ namespace Umbraco.Core.Migrations.Upgrade
|
||||
get
|
||||
{
|
||||
// no state in database yet - assume we have something in web.config that makes some sense
|
||||
if (!SemVersion.TryParse(ConfigurationManager.AppSettings[ConstantsCore.AppSettings.ConfigurationStatus], out var currentVersion))
|
||||
throw new InvalidOperationException($"Could not get current version from web.config {ConstantsCore.AppSettings.ConfigurationStatus} appSetting.");
|
||||
if (!SemVersion.TryParse(ConfigurationManager.AppSettings[Constants.AppSettings.ConfigurationStatus], out var currentVersion))
|
||||
throw new InvalidOperationException($"Could not get current version from web.config {Constants.AppSettings.ConfigurationStatus} appSetting.");
|
||||
|
||||
// cannot go back in time
|
||||
if (currentVersion > UmbracoVersion.SemanticVersion)
|
||||
|
||||
@@ -30,7 +30,7 @@ namespace Umbraco.Core.Migrations.Upgrade.V_8_0_0
|
||||
SortOrder = sortOrder,
|
||||
UniqueId = new Guid(uniqueId),
|
||||
Text = text,
|
||||
NodeObjectType = ConstantsCore.ObjectTypes.DataType,
|
||||
NodeObjectType = Constants.ObjectTypes.DataType,
|
||||
CreateDate = DateTime.Now
|
||||
};
|
||||
|
||||
@@ -40,11 +40,11 @@ namespace Umbraco.Core.Migrations.Upgrade.V_8_0_0
|
||||
if (SqlSyntax.SupportsIdentityInsert())
|
||||
Database.Execute(new Sql($"SET IDENTITY_INSERT {SqlSyntax.GetQuotedTableName(Constants.DatabaseSchema.Tables.Node)} ON "));
|
||||
|
||||
InsertNodeDto(ConstantsCore.DataTypes.LabelInt, 36, "8e7f995c-bd81-4627-9932-c40e568ec788", "Label (integer)");
|
||||
InsertNodeDto(ConstantsCore.DataTypes.LabelBigint, 36, "930861bf-e262-4ead-a704-f99453565708", "Label (bigint)");
|
||||
InsertNodeDto(ConstantsCore.DataTypes.LabelDateTime, 37, "0e9794eb-f9b5-4f20-a788-93acd233a7e4", "Label (datetime)");
|
||||
InsertNodeDto(ConstantsCore.DataTypes.LabelTime, 38, "a97cec69-9b71-4c30-8b12-ec398860d7e8", "Label (time)");
|
||||
InsertNodeDto(ConstantsCore.DataTypes.LabelDecimal, 39, "8f1ef1e1-9de4-40d3-a072-6673f631ca64", "Label (decimal)");
|
||||
InsertNodeDto(Constants.DataTypes.LabelInt, 36, "8e7f995c-bd81-4627-9932-c40e568ec788", "Label (integer)");
|
||||
InsertNodeDto(Constants.DataTypes.LabelBigint, 36, "930861bf-e262-4ead-a704-f99453565708", "Label (bigint)");
|
||||
InsertNodeDto(Constants.DataTypes.LabelDateTime, 37, "0e9794eb-f9b5-4f20-a788-93acd233a7e4", "Label (datetime)");
|
||||
InsertNodeDto(Constants.DataTypes.LabelTime, 38, "a97cec69-9b71-4c30-8b12-ec398860d7e8", "Label (time)");
|
||||
InsertNodeDto(Constants.DataTypes.LabelDecimal, 39, "8f1ef1e1-9de4-40d3-a072-6673f631ca64", "Label (decimal)");
|
||||
|
||||
if (SqlSyntax.SupportsIdentityInsert())
|
||||
Database.Execute(new Sql($"SET IDENTITY_INSERT {SqlSyntax.GetQuotedTableName(Constants.DatabaseSchema.Tables.Node)} OFF "));
|
||||
@@ -64,18 +64,18 @@ namespace Umbraco.Core.Migrations.Upgrade.V_8_0_0
|
||||
Database.Insert(Constants.DatabaseSchema.Tables.DataType, "pk", false, dataTypeDto);
|
||||
}
|
||||
|
||||
InsertDataTypeDto(ConstantsCore.DataTypes.LabelInt, "Integer", "{\"umbracoDataValueType\":\"INT\"}");
|
||||
InsertDataTypeDto(ConstantsCore.DataTypes.LabelBigint, "Nvarchar", "{\"umbracoDataValueType\":\"BIGINT\"}");
|
||||
InsertDataTypeDto(ConstantsCore.DataTypes.LabelDateTime, "Date", "{\"umbracoDataValueType\":\"DATETIME\"}");
|
||||
InsertDataTypeDto(ConstantsCore.DataTypes.LabelDecimal, "Decimal", "{\"umbracoDataValueType\":\"DECIMAL\"}");
|
||||
InsertDataTypeDto(ConstantsCore.DataTypes.LabelTime, "Date", "{\"umbracoDataValueType\":\"TIME\"}");
|
||||
InsertDataTypeDto(Constants.DataTypes.LabelInt, "Integer", "{\"umbracoDataValueType\":\"INT\"}");
|
||||
InsertDataTypeDto(Constants.DataTypes.LabelBigint, "Nvarchar", "{\"umbracoDataValueType\":\"BIGINT\"}");
|
||||
InsertDataTypeDto(Constants.DataTypes.LabelDateTime, "Date", "{\"umbracoDataValueType\":\"DATETIME\"}");
|
||||
InsertDataTypeDto(Constants.DataTypes.LabelDecimal, "Decimal", "{\"umbracoDataValueType\":\"DECIMAL\"}");
|
||||
InsertDataTypeDto(Constants.DataTypes.LabelTime, "Date", "{\"umbracoDataValueType\":\"TIME\"}");
|
||||
|
||||
// flip known property types
|
||||
|
||||
var labelPropertyTypes = Database.Fetch<PropertyTypeDto>(Sql()
|
||||
.Select<PropertyTypeDto>(x => x.Id, x => x.Alias)
|
||||
.From<PropertyTypeDto>()
|
||||
.Where<PropertyTypeDto>(x => x.DataTypeId == ConstantsCore.DataTypes.LabelString)
|
||||
.Where<PropertyTypeDto>(x => x.DataTypeId == Constants.DataTypes.LabelString)
|
||||
);
|
||||
|
||||
var intPropertyAliases = new[] { Constants.Conventions.Media.Width, Constants.Conventions.Media.Height, Constants.Conventions.Member.FailedPasswordAttempts };
|
||||
@@ -86,10 +86,10 @@ namespace Umbraco.Core.Migrations.Upgrade.V_8_0_0
|
||||
var bigintPropertyTypes = labelPropertyTypes.Where(pt => bigintPropertyAliases.Contains(pt.Alias)).Select(pt => pt.Id).ToArray();
|
||||
var dtPropertyTypes = labelPropertyTypes.Where(pt => dtPropertyAliases.Contains(pt.Alias)).Select(pt => pt.Id).ToArray();
|
||||
|
||||
Database.Execute(Sql().Update<PropertyTypeDto>(u => u.Set(x => x.DataTypeId, ConstantsCore.DataTypes.LabelInt)).WhereIn<PropertyTypeDto>(x => x.Id, intPropertyTypes));
|
||||
Database.Execute(Sql().Update<PropertyTypeDto>(u => u.Set(x => x.DataTypeId, ConstantsCore.DataTypes.LabelInt)).WhereIn<PropertyTypeDto>(x => x.Id, intPropertyTypes));
|
||||
Database.Execute(Sql().Update<PropertyTypeDto>(u => u.Set(x => x.DataTypeId, ConstantsCore.DataTypes.LabelBigint)).WhereIn<PropertyTypeDto>(x => x.Id, bigintPropertyTypes));
|
||||
Database.Execute(Sql().Update<PropertyTypeDto>(u => u.Set(x => x.DataTypeId, ConstantsCore.DataTypes.LabelDateTime)).WhereIn<PropertyTypeDto>(x => x.Id, dtPropertyTypes));
|
||||
Database.Execute(Sql().Update<PropertyTypeDto>(u => u.Set(x => x.DataTypeId, Constants.DataTypes.LabelInt)).WhereIn<PropertyTypeDto>(x => x.Id, intPropertyTypes));
|
||||
Database.Execute(Sql().Update<PropertyTypeDto>(u => u.Set(x => x.DataTypeId, Constants.DataTypes.LabelInt)).WhereIn<PropertyTypeDto>(x => x.Id, intPropertyTypes));
|
||||
Database.Execute(Sql().Update<PropertyTypeDto>(u => u.Set(x => x.DataTypeId, Constants.DataTypes.LabelBigint)).WhereIn<PropertyTypeDto>(x => x.Id, bigintPropertyTypes));
|
||||
Database.Execute(Sql().Update<PropertyTypeDto>(u => u.Set(x => x.DataTypeId, Constants.DataTypes.LabelDateTime)).WhereIn<PropertyTypeDto>(x => x.Id, dtPropertyTypes));
|
||||
|
||||
// update values for known property types
|
||||
// depending on the size of the site, that *may* take time
|
||||
|
||||
@@ -37,7 +37,7 @@ namespace Umbraco.Core.Migrations.Upgrade.V_8_0_0
|
||||
|
||||
// name, languageId are now non-nullable
|
||||
AlterColumn<ContentVersionCultureVariationDto>(Constants.DatabaseSchema.Tables.ContentVersionCultureVariation, "name");
|
||||
AlterColumn<ContentVersionCultureVariationDto>(Constants.DatabaseSchema.Tables.ContentVersionCultureVariation, "languageId");
|
||||
AlterColumn<ContentVersionCultureVariationDto>(Constants.DatabaseSchema.Tables.ContentVersionCultureVariation, "languageId");
|
||||
|
||||
Create.Table<DocumentCultureVariationDto>().Do();
|
||||
}
|
||||
|
||||
+1
-1
@@ -7,7 +7,7 @@ namespace Umbraco.Core.Migrations.Upgrade.V_8_0_0.DataTypes
|
||||
{
|
||||
public override bool CanMigrate(string editorAlias)
|
||||
=> editorAlias == Constants.PropertyEditors.Aliases.MarkdownEditor;
|
||||
|
||||
|
||||
protected override object GetPreValueValue(PreValueDto preValue)
|
||||
{
|
||||
if (preValue.Alias == "preview")
|
||||
|
||||
@@ -18,4 +18,4 @@ namespace Umbraco.Core.Migrations.Upgrade.V_8_0_0.DataTypes
|
||||
return preValue.Value.DetectIsJson() ? JsonConvert.DeserializeObject(preValue.Value) : preValue.Value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@ namespace Umbraco.Core.Migrations.Upgrade.V_8_0_0
|
||||
Rename.Table("cmsMedia").To(Constants.DatabaseSchema.Tables.MediaVersion).Do();
|
||||
|
||||
// that is not supported on SqlCE
|
||||
//Rename.Column("versionId").OnTable(Constants.DatabaseSchema.Tables.MediaVersion).To("id").Do();
|
||||
//Rename.Column("versionId").OnTable(ConstantsCore.DatabaseSchema.Tables.MediaVersion).To("id").Do();
|
||||
|
||||
AddColumn<MediaVersionDto>("id", out var sqls);
|
||||
|
||||
@@ -21,7 +21,7 @@ namespace Umbraco.Core.Migrations.Upgrade.V_8_0_0
|
||||
var temp2 = Database.Fetch<dynamic>($@"SELECT v.versionId, v.id
|
||||
FROM cmsContentVersion v
|
||||
JOIN umbracoNode n on v.contentId=n.id
|
||||
WHERE n.nodeObjectType='{ConstantsCore.ObjectTypes.Media}'");
|
||||
WHERE n.nodeObjectType='{Constants.ObjectTypes.Media}'");
|
||||
foreach (var t in temp2)
|
||||
Execute.Sql($"UPDATE {Constants.DatabaseSchema.Tables.MediaVersion} SET id={t.id} WHERE versionId='{t.versionId}'").Do();
|
||||
|
||||
|
||||
@@ -18,13 +18,13 @@
|
||||
insert into umbracoUser (id,
|
||||
userDisabled, userNoConsole, userName, userLogin, userPassword, passwordConfig,
|
||||
userEmail, userLanguage, securityStampToken, failedLoginAttempts, lastLockoutDate,
|
||||
lastPasswordChangeDate, lastLoginDate, emailConfirmedDate, invitedDate,
|
||||
lastPasswordChangeDate, lastLoginDate, emailConfirmedDate, invitedDate,
|
||||
createDate, updateDate, avatar, tourData)
|
||||
select
|
||||
-1 id,
|
||||
userDisabled, userNoConsole, userName, substring(userLogin, 1, len(userLogin) - 2) userLogin, userPassword, passwordConfig,
|
||||
userEmail, userLanguage, securityStampToken, failedLoginAttempts, lastLockoutDate,
|
||||
lastPasswordChangeDate, lastLoginDate, emailConfirmedDate, invitedDate,
|
||||
lastPasswordChangeDate, lastLoginDate, emailConfirmedDate, invitedDate,
|
||||
createDate, updateDate, avatar, tourData
|
||||
from umbracoUser where id=0;");
|
||||
Database.Execute("set identity_insert umbracoUser off;");
|
||||
|
||||
@@ -13,4 +13,4 @@
|
||||
Delete.Column("ParentId").FromTable(Constants.DatabaseSchema.Tables.Tag).Do();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -38,36 +38,36 @@ namespace Umbraco.Core.Models
|
||||
|
||||
private static readonly ISet<Guid> IdsOfBuildInDataTypes = new HashSet<Guid>()
|
||||
{
|
||||
ConstantsCore.DataTypes.Guids.ContentPickerGuid,
|
||||
ConstantsCore.DataTypes.Guids.MemberPickerGuid,
|
||||
ConstantsCore.DataTypes.Guids.MediaPickerGuid,
|
||||
ConstantsCore.DataTypes.Guids.MultipleMediaPickerGuid,
|
||||
ConstantsCore.DataTypes.Guids.RelatedLinksGuid,
|
||||
ConstantsCore.DataTypes.Guids.MemberGuid,
|
||||
ConstantsCore.DataTypes.Guids.ImageCropperGuid,
|
||||
ConstantsCore.DataTypes.Guids.TagsGuid,
|
||||
ConstantsCore.DataTypes.Guids.ListViewContentGuid,
|
||||
ConstantsCore.DataTypes.Guids.ListViewMediaGuid,
|
||||
ConstantsCore.DataTypes.Guids.ListViewMembersGuid,
|
||||
ConstantsCore.DataTypes.Guids.DatePickerWithTimeGuid,
|
||||
ConstantsCore.DataTypes.Guids.ApprovedColorGuid,
|
||||
ConstantsCore.DataTypes.Guids.DropdownMultipleGuid,
|
||||
ConstantsCore.DataTypes.Guids.RadioboxGuid,
|
||||
ConstantsCore.DataTypes.Guids.DatePickerGuid,
|
||||
ConstantsCore.DataTypes.Guids.DropdownGuid,
|
||||
ConstantsCore.DataTypes.Guids.CheckboxListGuid,
|
||||
ConstantsCore.DataTypes.Guids.CheckboxGuid,
|
||||
ConstantsCore.DataTypes.Guids.NumericGuid,
|
||||
ConstantsCore.DataTypes.Guids.RichtextEditorGuid,
|
||||
ConstantsCore.DataTypes.Guids.TextstringGuid,
|
||||
ConstantsCore.DataTypes.Guids.TextareaGuid,
|
||||
ConstantsCore.DataTypes.Guids.UploadGuid,
|
||||
ConstantsCore.DataTypes.Guids.LabelStringGuid,
|
||||
ConstantsCore.DataTypes.Guids.LabelDecimalGuid,
|
||||
ConstantsCore.DataTypes.Guids.LabelDateTimeGuid,
|
||||
ConstantsCore.DataTypes.Guids.LabelBigIntGuid,
|
||||
ConstantsCore.DataTypes.Guids.LabelTimeGuid,
|
||||
ConstantsCore.DataTypes.Guids.LabelDateTimeGuid,
|
||||
Constants.DataTypes.Guids.ContentPickerGuid,
|
||||
Constants.DataTypes.Guids.MemberPickerGuid,
|
||||
Constants.DataTypes.Guids.MediaPickerGuid,
|
||||
Constants.DataTypes.Guids.MultipleMediaPickerGuid,
|
||||
Constants.DataTypes.Guids.RelatedLinksGuid,
|
||||
Constants.DataTypes.Guids.MemberGuid,
|
||||
Constants.DataTypes.Guids.ImageCropperGuid,
|
||||
Constants.DataTypes.Guids.TagsGuid,
|
||||
Constants.DataTypes.Guids.ListViewContentGuid,
|
||||
Constants.DataTypes.Guids.ListViewMediaGuid,
|
||||
Constants.DataTypes.Guids.ListViewMembersGuid,
|
||||
Constants.DataTypes.Guids.DatePickerWithTimeGuid,
|
||||
Constants.DataTypes.Guids.ApprovedColorGuid,
|
||||
Constants.DataTypes.Guids.DropdownMultipleGuid,
|
||||
Constants.DataTypes.Guids.RadioboxGuid,
|
||||
Constants.DataTypes.Guids.DatePickerGuid,
|
||||
Constants.DataTypes.Guids.DropdownGuid,
|
||||
Constants.DataTypes.Guids.CheckboxListGuid,
|
||||
Constants.DataTypes.Guids.CheckboxGuid,
|
||||
Constants.DataTypes.Guids.NumericGuid,
|
||||
Constants.DataTypes.Guids.RichtextEditorGuid,
|
||||
Constants.DataTypes.Guids.TextstringGuid,
|
||||
Constants.DataTypes.Guids.TextareaGuid,
|
||||
Constants.DataTypes.Guids.UploadGuid,
|
||||
Constants.DataTypes.Guids.LabelStringGuid,
|
||||
Constants.DataTypes.Guids.LabelDecimalGuid,
|
||||
Constants.DataTypes.Guids.LabelDateTimeGuid,
|
||||
Constants.DataTypes.Guids.LabelBigIntGuid,
|
||||
Constants.DataTypes.Guids.LabelTimeGuid,
|
||||
Constants.DataTypes.Guids.LabelDateTimeGuid,
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -16,9 +16,9 @@ namespace Umbraco.Core.Models
|
||||
|
||||
private static readonly Dictionary<Guid, Guid> ObjectTypeMap = new Dictionary<Guid, Guid>
|
||||
{
|
||||
{ ConstantsCore.ObjectTypes.DataType, ConstantsCore.ObjectTypes.DataTypeContainer },
|
||||
{ ConstantsCore.ObjectTypes.DocumentType, ConstantsCore.ObjectTypes.DocumentTypeContainer },
|
||||
{ ConstantsCore.ObjectTypes.MediaType, ConstantsCore.ObjectTypes.MediaTypeContainer }
|
||||
{ Constants.ObjectTypes.DataType, Constants.ObjectTypes.DataTypeContainer },
|
||||
{ Constants.ObjectTypes.DocumentType, Constants.ObjectTypes.DocumentTypeContainer },
|
||||
{ Constants.ObjectTypes.MediaType, Constants.ObjectTypes.MediaTypeContainer }
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -74,7 +74,7 @@ namespace Umbraco.Core.Models.Identity
|
||||
|
||||
private static string GetPasswordHash(string storedPass)
|
||||
{
|
||||
return storedPass.StartsWith(ConstantsCore.Security.EmptyPasswordPrefix) ? null : storedPass;
|
||||
return storedPass.StartsWith(Constants.Security.EmptyPasswordPrefix) ? null : storedPass;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -31,9 +31,9 @@ namespace Umbraco.Core.Models.Membership
|
||||
|
||||
private static bool IsSystemUserGroup(this string groupAlias)
|
||||
{
|
||||
return groupAlias == ConstantsCore.Security.AdminGroupAlias
|
||||
|| groupAlias == ConstantsCore.Security.SensitiveDataGroupAlias
|
||||
|| groupAlias == ConstantsCore.Security.TranslatorGroupAlias;
|
||||
return groupAlias == Constants.Security.AdminGroupAlias
|
||||
|| groupAlias == Constants.Security.SensitiveDataGroupAlias
|
||||
|| groupAlias == Constants.Security.TranslatorGroupAlias;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -381,7 +381,7 @@ namespace Umbraco.Core.Models
|
||||
private static string SanitizeAlias(string value)
|
||||
{
|
||||
//NOTE: WE are doing this because we don't want to do a ToSafeAlias when the alias is the special case of
|
||||
// being prefixed with Constants.PropertyEditors.InternalGenericPropertiesPrefix
|
||||
// being prefixed with ConstantsCore.PropertyEditors.InternalGenericPropertiesPrefix
|
||||
// which is used internally
|
||||
|
||||
return value.StartsWith(Constants.PropertyEditors.InternalGenericPropertiesPrefix)
|
||||
|
||||
@@ -102,16 +102,16 @@ namespace Umbraco.Core.Models.PublishedContent
|
||||
// TODO: this list somehow also exists in constants, see memberTypeRepository => remove duplicate!
|
||||
private static readonly Dictionary<string, int> BuiltinMemberProperties = new Dictionary<string, int>
|
||||
{
|
||||
{ "Email", ConstantsCore.DataTypes.Textbox },
|
||||
{ "Username", ConstantsCore.DataTypes.Textbox },
|
||||
{ "PasswordQuestion", ConstantsCore.DataTypes.Textbox },
|
||||
{ "Comments", ConstantsCore.DataTypes.Textbox },
|
||||
{ "IsApproved", ConstantsCore.DataTypes.Boolean },
|
||||
{ "IsLockedOut", ConstantsCore.DataTypes.Boolean },
|
||||
{ "LastLockoutDate", ConstantsCore.DataTypes.DateTime },
|
||||
{ "CreateDate", ConstantsCore.DataTypes.DateTime },
|
||||
{ "LastLoginDate", ConstantsCore.DataTypes.DateTime },
|
||||
{ "LastPasswordChangeDate", ConstantsCore.DataTypes.DateTime },
|
||||
{ "Email", Constants.DataTypes.Textbox },
|
||||
{ "Username", Constants.DataTypes.Textbox },
|
||||
{ "PasswordQuestion", Constants.DataTypes.Textbox },
|
||||
{ "Comments", Constants.DataTypes.Textbox },
|
||||
{ "IsApproved", Constants.DataTypes.Boolean },
|
||||
{ "IsLockedOut", Constants.DataTypes.Boolean },
|
||||
{ "LastLockoutDate", Constants.DataTypes.DateTime },
|
||||
{ "CreateDate", Constants.DataTypes.DateTime },
|
||||
{ "LastLoginDate", Constants.DataTypes.DateTime },
|
||||
{ "LastPasswordChangeDate", Constants.DataTypes.DateTime },
|
||||
};
|
||||
|
||||
#region Content type
|
||||
|
||||
@@ -18,14 +18,14 @@ namespace Umbraco.Core.Models
|
||||
/// <summary>
|
||||
/// Root
|
||||
/// </summary>
|
||||
[UmbracoObjectType(ConstantsCore.ObjectTypes.Strings.SystemRoot)]
|
||||
[UmbracoObjectType(Constants.ObjectTypes.Strings.SystemRoot)]
|
||||
[FriendlyName("Root")]
|
||||
ROOT,
|
||||
|
||||
/// <summary>
|
||||
/// Document
|
||||
/// </summary>
|
||||
[UmbracoObjectType(ConstantsCore.ObjectTypes.Strings.Document, typeof(IContent))]
|
||||
[UmbracoObjectType(Constants.ObjectTypes.Strings.Document, typeof(IContent))]
|
||||
[FriendlyName("Document")]
|
||||
[UmbracoUdiType(Constants.UdiEntityType.Document)]
|
||||
Document,
|
||||
@@ -33,7 +33,7 @@ namespace Umbraco.Core.Models
|
||||
/// <summary>
|
||||
/// Media
|
||||
/// </summary>
|
||||
[UmbracoObjectType(ConstantsCore.ObjectTypes.Strings.Media, typeof(IMedia))]
|
||||
[UmbracoObjectType(Constants.ObjectTypes.Strings.Media, typeof(IMedia))]
|
||||
[FriendlyName("Media")]
|
||||
[UmbracoUdiType(Constants.UdiEntityType.Media)]
|
||||
Media,
|
||||
@@ -41,7 +41,7 @@ namespace Umbraco.Core.Models
|
||||
/// <summary>
|
||||
/// Member Type
|
||||
/// </summary>
|
||||
[UmbracoObjectType(ConstantsCore.ObjectTypes.Strings.MemberType, typeof(IMemberType))]
|
||||
[UmbracoObjectType(Constants.ObjectTypes.Strings.MemberType, typeof(IMemberType))]
|
||||
[FriendlyName("Member Type")]
|
||||
[UmbracoUdiType(Constants.UdiEntityType.MemberType)]
|
||||
MemberType,
|
||||
@@ -49,7 +49,7 @@ namespace Umbraco.Core.Models
|
||||
/// <summary>
|
||||
/// Template
|
||||
/// </summary>
|
||||
[UmbracoObjectType(ConstantsCore.ObjectTypes.Strings.Template, typeof(ITemplate))]
|
||||
[UmbracoObjectType(Constants.ObjectTypes.Strings.Template, typeof(ITemplate))]
|
||||
[FriendlyName("Template")]
|
||||
[UmbracoUdiType(Constants.UdiEntityType.Template)]
|
||||
Template,
|
||||
@@ -57,7 +57,7 @@ namespace Umbraco.Core.Models
|
||||
/// <summary>
|
||||
/// Member Group
|
||||
/// </summary>
|
||||
[UmbracoObjectType(ConstantsCore.ObjectTypes.Strings.MemberGroup)]
|
||||
[UmbracoObjectType(Constants.ObjectTypes.Strings.MemberGroup)]
|
||||
[FriendlyName("Member Group")]
|
||||
[UmbracoUdiType(Constants.UdiEntityType.MemberGroup)]
|
||||
MemberGroup,
|
||||
@@ -65,7 +65,7 @@ namespace Umbraco.Core.Models
|
||||
/// <summary>
|
||||
/// "Media Type
|
||||
/// </summary>
|
||||
[UmbracoObjectType(ConstantsCore.ObjectTypes.Strings.MediaType, typeof(IMediaType))]
|
||||
[UmbracoObjectType(Constants.ObjectTypes.Strings.MediaType, typeof(IMediaType))]
|
||||
[FriendlyName("Media Type")]
|
||||
[UmbracoUdiType(Constants.UdiEntityType.MediaType)]
|
||||
MediaType,
|
||||
@@ -73,7 +73,7 @@ namespace Umbraco.Core.Models
|
||||
/// <summary>
|
||||
/// Document Type
|
||||
/// </summary>
|
||||
[UmbracoObjectType(ConstantsCore.ObjectTypes.Strings.DocumentType, typeof(IContentType))]
|
||||
[UmbracoObjectType(Constants.ObjectTypes.Strings.DocumentType, typeof(IContentType))]
|
||||
[FriendlyName("Document Type")]
|
||||
[UmbracoUdiType(Constants.UdiEntityType.DocumentType)]
|
||||
DocumentType,
|
||||
@@ -81,14 +81,14 @@ namespace Umbraco.Core.Models
|
||||
/// <summary>
|
||||
/// Recycle Bin
|
||||
/// </summary>
|
||||
[UmbracoObjectType(ConstantsCore.ObjectTypes.Strings.ContentRecycleBin)]
|
||||
[UmbracoObjectType(Constants.ObjectTypes.Strings.ContentRecycleBin)]
|
||||
[FriendlyName("Recycle Bin")]
|
||||
RecycleBin,
|
||||
|
||||
/// <summary>
|
||||
/// Stylesheet
|
||||
/// </summary>
|
||||
[UmbracoObjectType(ConstantsCore.ObjectTypes.Strings.Stylesheet)]
|
||||
[UmbracoObjectType(Constants.ObjectTypes.Strings.Stylesheet)]
|
||||
[FriendlyName("Stylesheet")]
|
||||
[UmbracoUdiType(Constants.UdiEntityType.Stylesheet)]
|
||||
Stylesheet,
|
||||
@@ -96,7 +96,7 @@ namespace Umbraco.Core.Models
|
||||
/// <summary>
|
||||
/// Member
|
||||
/// </summary>
|
||||
[UmbracoObjectType(ConstantsCore.ObjectTypes.Strings.Member, typeof(IMember))]
|
||||
[UmbracoObjectType(Constants.ObjectTypes.Strings.Member, typeof(IMember))]
|
||||
[FriendlyName("Member")]
|
||||
[UmbracoUdiType(Constants.UdiEntityType.Member)]
|
||||
Member,
|
||||
@@ -104,7 +104,7 @@ namespace Umbraco.Core.Models
|
||||
/// <summary>
|
||||
/// Data Type
|
||||
/// </summary>
|
||||
[UmbracoObjectType(ConstantsCore.ObjectTypes.Strings.DataType, typeof(IDataType))]
|
||||
[UmbracoObjectType(Constants.ObjectTypes.Strings.DataType, typeof(IDataType))]
|
||||
[FriendlyName("Data Type")]
|
||||
[UmbracoUdiType(Constants.UdiEntityType.DataType)]
|
||||
DataType,
|
||||
@@ -112,7 +112,7 @@ namespace Umbraco.Core.Models
|
||||
/// <summary>
|
||||
/// Document type container
|
||||
/// </summary>
|
||||
[UmbracoObjectType(ConstantsCore.ObjectTypes.Strings.DocumentTypeContainer)]
|
||||
[UmbracoObjectType(Constants.ObjectTypes.Strings.DocumentTypeContainer)]
|
||||
[FriendlyName("Document Type Container")]
|
||||
[UmbracoUdiType(Constants.UdiEntityType.DocumentTypeContainer)]
|
||||
DocumentTypeContainer,
|
||||
@@ -120,7 +120,7 @@ namespace Umbraco.Core.Models
|
||||
/// <summary>
|
||||
/// Media type container
|
||||
/// </summary>
|
||||
[UmbracoObjectType(ConstantsCore.ObjectTypes.Strings.MediaTypeContainer)]
|
||||
[UmbracoObjectType(Constants.ObjectTypes.Strings.MediaTypeContainer)]
|
||||
[FriendlyName("Media Type Container")]
|
||||
[UmbracoUdiType(Constants.UdiEntityType.MediaTypeContainer)]
|
||||
MediaTypeContainer,
|
||||
@@ -128,7 +128,7 @@ namespace Umbraco.Core.Models
|
||||
/// <summary>
|
||||
/// Media type container
|
||||
/// </summary>
|
||||
[UmbracoObjectType(ConstantsCore.ObjectTypes.Strings.DataTypeContainer)]
|
||||
[UmbracoObjectType(Constants.ObjectTypes.Strings.DataTypeContainer)]
|
||||
[FriendlyName("Data Type Container")]
|
||||
[UmbracoUdiType(Constants.UdiEntityType.DataTypeContainer)]
|
||||
DataTypeContainer,
|
||||
@@ -136,7 +136,7 @@ namespace Umbraco.Core.Models
|
||||
/// <summary>
|
||||
/// Relation type
|
||||
/// </summary>
|
||||
[UmbracoObjectType(ConstantsCore.ObjectTypes.Strings.RelationType)]
|
||||
[UmbracoObjectType(Constants.ObjectTypes.Strings.RelationType)]
|
||||
[FriendlyName("Relation Type")]
|
||||
[UmbracoUdiType(Constants.UdiEntityType.RelationType)]
|
||||
RelationType,
|
||||
@@ -144,35 +144,35 @@ namespace Umbraco.Core.Models
|
||||
/// <summary>
|
||||
/// Forms Form
|
||||
/// </summary>
|
||||
[UmbracoObjectType(ConstantsCore.ObjectTypes.Strings.FormsForm)]
|
||||
[UmbracoObjectType(Constants.ObjectTypes.Strings.FormsForm)]
|
||||
[FriendlyName("Form")]
|
||||
FormsForm,
|
||||
|
||||
/// <summary>
|
||||
/// Forms PreValue
|
||||
/// </summary>
|
||||
[UmbracoObjectType(ConstantsCore.ObjectTypes.Strings.FormsPreValue)]
|
||||
[UmbracoObjectType(Constants.ObjectTypes.Strings.FormsPreValue)]
|
||||
[FriendlyName("PreValue")]
|
||||
FormsPreValue,
|
||||
|
||||
/// <summary>
|
||||
/// Forms DataSource
|
||||
/// </summary>
|
||||
[UmbracoObjectType(ConstantsCore.ObjectTypes.Strings.FormsDataSource)]
|
||||
[UmbracoObjectType(Constants.ObjectTypes.Strings.FormsDataSource)]
|
||||
[FriendlyName("DataSource")]
|
||||
FormsDataSource,
|
||||
|
||||
/// <summary>
|
||||
/// Language
|
||||
/// </summary>
|
||||
[UmbracoObjectType(ConstantsCore.ObjectTypes.Strings.Language)]
|
||||
[UmbracoObjectType(Constants.ObjectTypes.Strings.Language)]
|
||||
[FriendlyName("Language")]
|
||||
Language,
|
||||
|
||||
/// <summary>
|
||||
/// Document Blueprint
|
||||
/// </summary>
|
||||
[UmbracoObjectType(ConstantsCore.ObjectTypes.Strings.DocumentBlueprint, typeof(IContent))]
|
||||
[UmbracoObjectType(Constants.ObjectTypes.Strings.DocumentBlueprint, typeof(IContent))]
|
||||
[FriendlyName("DocumentBlueprint")]
|
||||
[UmbracoUdiType(Constants.UdiEntityType.DocumentBlueprint)]
|
||||
DocumentBlueprint,
|
||||
@@ -180,7 +180,7 @@ namespace Umbraco.Core.Models
|
||||
/// <summary>
|
||||
/// Reserved Identifier
|
||||
/// </summary>
|
||||
[UmbracoObjectType(ConstantsCore.ObjectTypes.Strings.IdReservation)]
|
||||
[UmbracoObjectType(Constants.ObjectTypes.Strings.IdReservation)]
|
||||
[FriendlyName("Identifier Reservation")]
|
||||
IdReservation
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ namespace Umbraco.Core.Models
|
||||
public static bool IsSuper(this IUser user)
|
||||
{
|
||||
if (user == null) throw new ArgumentNullException(nameof(user));
|
||||
return user.Id == ConstantsCore.Security.SuperUserId;
|
||||
return user.Id == Constants.Security.SuperUserId;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -43,7 +43,7 @@ namespace Umbraco.Core.Models
|
||||
public static bool IsAdmin(this IUser user)
|
||||
{
|
||||
if (user == null) throw new ArgumentNullException(nameof(user));
|
||||
return user.Groups != null && user.Groups.Any(x => x.Alias == ConstantsCore.Security.AdminGroupAlias);
|
||||
return user.Groups != null && user.Groups.Any(x => x.Alias == Constants.Security.AdminGroupAlias);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -151,46 +151,46 @@ namespace Umbraco.Core.Models
|
||||
|
||||
internal static bool HasContentRootAccess(this IUser user, IEntityService entityService)
|
||||
{
|
||||
return ContentPermissionsHelper.HasPathAccess(ConstantsCore.System.RootString, user.CalculateContentStartNodeIds(entityService), ConstantsCore.System.RecycleBinContent);
|
||||
return ContentPermissionsHelper.HasPathAccess(Constants.System.RootString, user.CalculateContentStartNodeIds(entityService), Constants.System.RecycleBinContent);
|
||||
}
|
||||
|
||||
internal static bool HasContentBinAccess(this IUser user, IEntityService entityService)
|
||||
{
|
||||
return ContentPermissionsHelper.HasPathAccess(ConstantsCore.System.RecycleBinContentString, user.CalculateContentStartNodeIds(entityService), ConstantsCore.System.RecycleBinContent);
|
||||
return ContentPermissionsHelper.HasPathAccess(Constants.System.RecycleBinContentString, user.CalculateContentStartNodeIds(entityService), Constants.System.RecycleBinContent);
|
||||
}
|
||||
|
||||
internal static bool HasMediaRootAccess(this IUser user, IEntityService entityService)
|
||||
{
|
||||
return ContentPermissionsHelper.HasPathAccess(ConstantsCore.System.RootString, user.CalculateMediaStartNodeIds(entityService), ConstantsCore.System.RecycleBinMedia);
|
||||
return ContentPermissionsHelper.HasPathAccess(Constants.System.RootString, user.CalculateMediaStartNodeIds(entityService), Constants.System.RecycleBinMedia);
|
||||
}
|
||||
|
||||
internal static bool HasMediaBinAccess(this IUser user, IEntityService entityService)
|
||||
{
|
||||
return ContentPermissionsHelper.HasPathAccess(ConstantsCore.System.RecycleBinMediaString, user.CalculateMediaStartNodeIds(entityService), ConstantsCore.System.RecycleBinMedia);
|
||||
return ContentPermissionsHelper.HasPathAccess(Constants.System.RecycleBinMediaString, user.CalculateMediaStartNodeIds(entityService), Constants.System.RecycleBinMedia);
|
||||
}
|
||||
|
||||
internal static bool HasPathAccess(this IUser user, IContent content, IEntityService entityService)
|
||||
{
|
||||
if (content == null) throw new ArgumentNullException(nameof(content));
|
||||
return ContentPermissionsHelper.HasPathAccess(content.Path, user.CalculateContentStartNodeIds(entityService), ConstantsCore.System.RecycleBinContent);
|
||||
return ContentPermissionsHelper.HasPathAccess(content.Path, user.CalculateContentStartNodeIds(entityService), Constants.System.RecycleBinContent);
|
||||
}
|
||||
|
||||
internal static bool HasPathAccess(this IUser user, IMedia media, IEntityService entityService)
|
||||
{
|
||||
if (media == null) throw new ArgumentNullException(nameof(media));
|
||||
return ContentPermissionsHelper.HasPathAccess(media.Path, user.CalculateMediaStartNodeIds(entityService), ConstantsCore.System.RecycleBinMedia);
|
||||
return ContentPermissionsHelper.HasPathAccess(media.Path, user.CalculateMediaStartNodeIds(entityService), Constants.System.RecycleBinMedia);
|
||||
}
|
||||
|
||||
internal static bool HasContentPathAccess(this IUser user, IUmbracoEntity entity, IEntityService entityService)
|
||||
{
|
||||
if (entity == null) throw new ArgumentNullException(nameof(entity));
|
||||
return ContentPermissionsHelper.HasPathAccess(entity.Path, user.CalculateContentStartNodeIds(entityService), ConstantsCore.System.RecycleBinContent);
|
||||
return ContentPermissionsHelper.HasPathAccess(entity.Path, user.CalculateContentStartNodeIds(entityService), Constants.System.RecycleBinContent);
|
||||
}
|
||||
|
||||
internal static bool HasMediaPathAccess(this IUser user, IUmbracoEntity entity, IEntityService entityService)
|
||||
{
|
||||
if (entity == null) throw new ArgumentNullException(nameof(entity));
|
||||
return ContentPermissionsHelper.HasPathAccess(entity.Path, user.CalculateMediaStartNodeIds(entityService), ConstantsCore.System.RecycleBinMedia);
|
||||
return ContentPermissionsHelper.HasPathAccess(entity.Path, user.CalculateMediaStartNodeIds(entityService), Constants.System.RecycleBinMedia);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -200,7 +200,7 @@ namespace Umbraco.Core.Models
|
||||
public static bool HasAccessToSensitiveData(this IUser user)
|
||||
{
|
||||
if (user == null) throw new ArgumentNullException("user");
|
||||
return user.Groups != null && user.Groups.Any(x => x.Alias == ConstantsCore.Security.SensitiveDataGroupAlias);
|
||||
return user.Groups != null && user.Groups.Any(x => x.Alias == Constants.Security.SensitiveDataGroupAlias);
|
||||
}
|
||||
|
||||
// calc. start nodes, combining groups' and user's, and excluding what's in the bin
|
||||
@@ -290,14 +290,14 @@ namespace Umbraco.Core.Models
|
||||
|
||||
private static string GetBinPath(UmbracoObjectTypes objectType)
|
||||
{
|
||||
var binPath = ConstantsCore.System.Root + ",";
|
||||
var binPath = Constants.System.Root + ",";
|
||||
switch (objectType)
|
||||
{
|
||||
case UmbracoObjectTypes.Document:
|
||||
binPath += ConstantsCore.System.RecycleBinContent;
|
||||
binPath += Constants.System.RecycleBinContent;
|
||||
break;
|
||||
case UmbracoObjectTypes.Media:
|
||||
binPath += ConstantsCore.System.RecycleBinMedia;
|
||||
binPath += Constants.System.RecycleBinMedia;
|
||||
break;
|
||||
default:
|
||||
throw new ArgumentOutOfRangeException(nameof(objectType));
|
||||
@@ -314,7 +314,7 @@ namespace Umbraco.Core.Models
|
||||
? entityService.GetAllPaths(objectType, asn).ToDictionary(x => x.Id, x => x.Path)
|
||||
: new Dictionary<int, string>();
|
||||
|
||||
paths[ConstantsCore.System.Root] = ConstantsCore.System.RootString; // entityService does not get that one
|
||||
paths[Constants.System.Root] = Constants.System.RootString; // entityService does not get that one
|
||||
|
||||
var binPath = GetBinPath(objectType);
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
/// </summary>
|
||||
/// <param name="udi">A <see cref="Udi"/>.</param>
|
||||
/// <param name="selector">An optional selector.</param>
|
||||
public NamedUdiRange(Udi udi, string selector = ConstantsCore.DeploySelector.This)
|
||||
public NamedUdiRange(Udi udi, string selector = Constants.DeploySelector.This)
|
||||
: base(udi, selector)
|
||||
{ }
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
/// <param name="udi">A <see cref="Udi"/>.</param>
|
||||
/// <param name="name">A name.</param>
|
||||
/// <param name="selector">An optional selector.</param>
|
||||
public NamedUdiRange(Udi udi, string name, string selector = ConstantsCore.DeploySelector.This)
|
||||
public NamedUdiRange(Udi udi, string name, string selector = Constants.DeploySelector.This)
|
||||
: base(udi, selector)
|
||||
{
|
||||
Name = name;
|
||||
|
||||
@@ -41,8 +41,8 @@ namespace Umbraco.Core.Persistence.Factories
|
||||
content.SortOrder = nodeDto.SortOrder;
|
||||
content.Trashed = nodeDto.Trashed;
|
||||
|
||||
content.CreatorId = nodeDto.UserId ?? ConstantsCore.Security.UnknownUserId;
|
||||
content.WriterId = contentVersionDto.UserId ?? ConstantsCore.Security.UnknownUserId;
|
||||
content.CreatorId = nodeDto.UserId ?? Constants.Security.UnknownUserId;
|
||||
content.WriterId = contentVersionDto.UserId ?? Constants.Security.UnknownUserId;
|
||||
content.CreateDate = nodeDto.CreateDate;
|
||||
content.UpdateDate = contentVersionDto.VersionDate;
|
||||
|
||||
@@ -97,8 +97,8 @@ namespace Umbraco.Core.Persistence.Factories
|
||||
content.SortOrder = nodeDto.SortOrder;
|
||||
content.Trashed = nodeDto.Trashed;
|
||||
|
||||
content.CreatorId = nodeDto.UserId ?? ConstantsCore.Security.UnknownUserId;
|
||||
content.WriterId = contentVersionDto.UserId ?? ConstantsCore.Security.UnknownUserId;
|
||||
content.CreatorId = nodeDto.UserId ?? Constants.Security.UnknownUserId;
|
||||
content.WriterId = contentVersionDto.UserId ?? Constants.Security.UnknownUserId;
|
||||
content.CreateDate = nodeDto.CreateDate;
|
||||
content.UpdateDate = contentVersionDto.VersionDate;
|
||||
|
||||
@@ -138,8 +138,8 @@ namespace Umbraco.Core.Persistence.Factories
|
||||
content.SortOrder = nodeDto.SortOrder;
|
||||
content.Trashed = nodeDto.Trashed;
|
||||
|
||||
content.CreatorId = nodeDto.UserId ?? ConstantsCore.Security.UnknownUserId;
|
||||
content.WriterId = contentVersionDto.UserId ?? ConstantsCore.Security.UnknownUserId;
|
||||
content.CreatorId = nodeDto.UserId ?? Constants.Security.UnknownUserId;
|
||||
content.WriterId = contentVersionDto.UserId ?? Constants.Security.UnknownUserId;
|
||||
content.CreateDate = nodeDto.CreateDate;
|
||||
content.UpdateDate = contentVersionDto.VersionDate;
|
||||
|
||||
@@ -191,7 +191,7 @@ namespace Umbraco.Core.Persistence.Factories
|
||||
/// </summary>
|
||||
public static MediaDto BuildDto(IMedia entity)
|
||||
{
|
||||
var contentDto = BuildContentDto(entity, ConstantsCore.ObjectTypes.Media);
|
||||
var contentDto = BuildContentDto(entity, Constants.ObjectTypes.Media);
|
||||
|
||||
var dto = new MediaDto
|
||||
{
|
||||
@@ -208,7 +208,7 @@ namespace Umbraco.Core.Persistence.Factories
|
||||
/// </summary>
|
||||
public static MemberDto BuildDto(IMember entity)
|
||||
{
|
||||
var contentDto = BuildContentDto(entity, ConstantsCore.ObjectTypes.Member);
|
||||
var contentDto = BuildContentDto(entity, Constants.ObjectTypes.Member);
|
||||
|
||||
var dto = new MemberDto
|
||||
{
|
||||
|
||||
@@ -117,7 +117,7 @@ namespace Umbraco.Core.Persistence.Factories
|
||||
entity.UpdateDate = dto.NodeDto.CreateDate;
|
||||
entity.Path = dto.NodeDto.Path;
|
||||
entity.Level = dto.NodeDto.Level;
|
||||
entity.CreatorId = dto.NodeDto.UserId ?? ConstantsCore.Security.UnknownUserId;
|
||||
entity.CreatorId = dto.NodeDto.UserId ?? Constants.Security.UnknownUserId;
|
||||
entity.AllowedAsRoot = dto.AllowAtRoot;
|
||||
entity.IsContainer = dto.IsContainer;
|
||||
entity.IsElement = dto.IsElement;
|
||||
@@ -131,11 +131,11 @@ namespace Umbraco.Core.Persistence.Factories
|
||||
{
|
||||
Guid nodeObjectType;
|
||||
if (entity is IContentType)
|
||||
nodeObjectType = ConstantsCore.ObjectTypes.DocumentType;
|
||||
nodeObjectType = Constants.ObjectTypes.DocumentType;
|
||||
else if (entity is IMediaType)
|
||||
nodeObjectType = ConstantsCore.ObjectTypes.MediaType;
|
||||
nodeObjectType = Constants.ObjectTypes.MediaType;
|
||||
else if (entity is IMemberType)
|
||||
nodeObjectType = ConstantsCore.ObjectTypes.MemberType;
|
||||
nodeObjectType = Constants.ObjectTypes.MemberType;
|
||||
else
|
||||
throw new Exception("Invalid entity.");
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@ namespace Umbraco.Core.Persistence.Factories
|
||||
dataType.Path = dto.NodeDto.Path;
|
||||
dataType.SortOrder = dto.NodeDto.SortOrder;
|
||||
dataType.Trashed = dto.NodeDto.Trashed;
|
||||
dataType.CreatorId = dto.NodeDto.UserId ?? ConstantsCore.Security.UnknownUserId;
|
||||
dataType.CreatorId = dto.NodeDto.UserId ?? Constants.Security.UnknownUserId;
|
||||
|
||||
dataType.SetLazyConfiguration(dto.Configuration);
|
||||
|
||||
@@ -73,7 +73,7 @@ namespace Umbraco.Core.Persistence.Factories
|
||||
CreateDate = entity.CreateDate,
|
||||
NodeId = entity.Id,
|
||||
Level = Convert.ToInt16(entity.Level),
|
||||
NodeObjectType = ConstantsCore.ObjectTypes.DataType,
|
||||
NodeObjectType = Constants.ObjectTypes.DataType,
|
||||
ParentId = entity.ParentId,
|
||||
Path = entity.Path,
|
||||
SortOrder = entity.SortOrder,
|
||||
|
||||
@@ -11,7 +11,7 @@ namespace Umbraco.Core.Persistence.Factories
|
||||
|
||||
static MemberGroupFactory()
|
||||
{
|
||||
_nodeObjectTypeId = ConstantsCore.ObjectTypes.MemberGroup;
|
||||
_nodeObjectTypeId = Constants.ObjectTypes.MemberGroup;
|
||||
}
|
||||
|
||||
#region Implementation of IEntityFactory<ITemplate,TemplateDto>
|
||||
|
||||
@@ -163,7 +163,7 @@ namespace Umbraco.Core.Persistence.Factories
|
||||
|
||||
if (entityVariesByCulture && !sameValues)
|
||||
{
|
||||
if (isCultureValue)
|
||||
if (isCultureValue)
|
||||
{
|
||||
editedCultures.Add(propertyValue.Culture); // report culture as edited
|
||||
}
|
||||
|
||||
@@ -55,7 +55,7 @@ namespace Umbraco.Core.Persistence.Repositories.Implement
|
||||
var dto = Database.First<LogDto>(sql);
|
||||
return dto == null
|
||||
? null
|
||||
: new AuditItem(dto.NodeId, Enum<AuditType>.Parse(dto.Header), dto.UserId ?? ConstantsCore.Security.UnknownUserId, dto.EntityType, dto.Comment, dto.Parameters);
|
||||
: new AuditItem(dto.NodeId, Enum<AuditType>.Parse(dto.Header), dto.UserId ?? Constants.Security.UnknownUserId, dto.EntityType, dto.Comment, dto.Parameters);
|
||||
}
|
||||
|
||||
protected override IEnumerable<IAuditItem> PerformGetAll(params int[] ids)
|
||||
@@ -71,7 +71,7 @@ namespace Umbraco.Core.Persistence.Repositories.Implement
|
||||
|
||||
var dtos = Database.Fetch<LogDto>(sql);
|
||||
|
||||
return dtos.Select(x => new AuditItem(x.NodeId, Enum<AuditType>.Parse(x.Header), x.UserId ?? ConstantsCore.Security.UnknownUserId, x.EntityType, x.Comment, x.Parameters)).ToList();
|
||||
return dtos.Select(x => new AuditItem(x.NodeId, Enum<AuditType>.Parse(x.Header), x.UserId ?? Constants.Security.UnknownUserId, x.EntityType, x.Comment, x.Parameters)).ToList();
|
||||
}
|
||||
|
||||
public IEnumerable<IAuditItem> Get(AuditType type, IQuery<IAuditItem> query)
|
||||
@@ -83,7 +83,7 @@ namespace Umbraco.Core.Persistence.Repositories.Implement
|
||||
|
||||
var dtos = Database.Fetch<LogDto>(sql);
|
||||
|
||||
return dtos.Select(x => new AuditItem(x.NodeId, Enum<AuditType>.Parse(x.Header), x.UserId ?? ConstantsCore.Security.UnknownUserId, x.EntityType, x.Comment, x.Parameters)).ToList();
|
||||
return dtos.Select(x => new AuditItem(x.NodeId, Enum<AuditType>.Parse(x.Header), x.UserId ?? Constants.Security.UnknownUserId, x.EntityType, x.Comment, x.Parameters)).ToList();
|
||||
}
|
||||
|
||||
protected override Sql<ISqlContext> GetBaseQuery(bool isCount)
|
||||
@@ -174,7 +174,7 @@ namespace Umbraco.Core.Persistence.Repositories.Implement
|
||||
totalRecords = page.TotalItems;
|
||||
|
||||
var items = page.Items.Select(
|
||||
dto => new AuditItem(dto.NodeId, Enum<AuditType>.ParseOrNull(dto.Header) ?? AuditType.Custom, dto.UserId ?? ConstantsCore.Security.UnknownUserId, dto.EntityType, dto.Comment, dto.Parameters)).ToList();
|
||||
dto => new AuditItem(dto.NodeId, Enum<AuditType>.ParseOrNull(dto.Header) ?? AuditType.Custom, dto.UserId ?? Constants.Security.UnknownUserId, dto.EntityType, dto.Comment, dto.Parameters)).ToList();
|
||||
|
||||
// map the DateStamp
|
||||
for (var i = 0; i < items.Count; i++)
|
||||
|
||||
@@ -778,7 +778,7 @@ namespace Umbraco.Core.Persistence.Repositories.Implement
|
||||
protected virtual int GetReservedId(Guid uniqueId)
|
||||
{
|
||||
var template = SqlContext.Templates.Get("Umbraco.Core.VersionableRepository.GetReservedId", tsql =>
|
||||
tsql.Select<NodeDto>(x => x.NodeId).From<NodeDto>().Where<NodeDto>(x => x.UniqueId == SqlTemplate.Arg<Guid>("uniqueId") && x.NodeObjectType == ConstantsCore.ObjectTypes.IdReservation)
|
||||
tsql.Select<NodeDto>(x => x.NodeId).From<NodeDto>().Where<NodeDto>(x => x.UniqueId == SqlTemplate.Arg<Guid>("uniqueId") && x.NodeObjectType == Constants.ObjectTypes.IdReservation)
|
||||
);
|
||||
var id = Database.ExecuteScalar<int?>(template.Sql(new { uniqueId = uniqueId }));
|
||||
return id ?? 0;
|
||||
|
||||
@@ -84,11 +84,11 @@ namespace Umbraco.Core.Persistence.Repositories.Implement
|
||||
{
|
||||
// create content type
|
||||
IContentTypeComposition contentType;
|
||||
if (contentTypeDto.NodeDto.NodeObjectType == ConstantsCore.ObjectTypes.MediaType)
|
||||
if (contentTypeDto.NodeDto.NodeObjectType == Constants.ObjectTypes.MediaType)
|
||||
contentType = ContentTypeFactory.BuildMediaTypeEntity(contentTypeDto);
|
||||
else if (contentTypeDto.NodeDto.NodeObjectType == ConstantsCore.ObjectTypes.DocumentType)
|
||||
else if (contentTypeDto.NodeDto.NodeObjectType == Constants.ObjectTypes.DocumentType)
|
||||
contentType = ContentTypeFactory.BuildContentTypeEntity(contentTypeDto);
|
||||
else if (contentTypeDto.NodeDto.NodeObjectType == ConstantsCore.ObjectTypes.MemberType)
|
||||
else if (contentTypeDto.NodeDto.NodeObjectType == Constants.ObjectTypes.MemberType)
|
||||
contentType = ContentTypeFactory.BuildMemberTypeEntity(contentTypeDto);
|
||||
else throw new PanicException($"The node object type {contentTypeDto.NodeDto.NodeObjectType} is not supported");
|
||||
contentTypes.Add(contentType.Id, contentType);
|
||||
@@ -202,7 +202,7 @@ namespace Umbraco.Core.Persistence.Repositories.Implement
|
||||
.AndBy<PropertyTypeDto>(x => x.SortOrder, x => x.Id);
|
||||
|
||||
var propertyDtos = Database.Fetch<PropertyTypeCommonDto>(sql2);
|
||||
var builtinProperties = Constants.Conventions.Member.GetStandardPropertyTypeStubs();
|
||||
var builtinProperties = ConventionsHelper.GetStandardPropertyTypeStubs();
|
||||
|
||||
var groupIx = 0;
|
||||
var propertyIx = 0;
|
||||
|
||||
@@ -185,7 +185,7 @@ namespace Umbraco.Core.Persistence.Repositories.Implement
|
||||
return l;
|
||||
}
|
||||
|
||||
protected override Guid NodeObjectTypeId => ConstantsCore.ObjectTypes.DocumentType;
|
||||
protected override Guid NodeObjectTypeId => Constants.ObjectTypes.DocumentType;
|
||||
|
||||
/// <summary>
|
||||
/// Deletes a content type
|
||||
|
||||
@@ -39,7 +39,7 @@ namespace Umbraco.Core.Persistence.Repositories.Implement
|
||||
|
||||
public IEnumerable<MoveEventInfo<TEntity>> Move(TEntity moving, EntityContainer container)
|
||||
{
|
||||
var parentId = ConstantsCore.System.Root;
|
||||
var parentId = Constants.System.Root;
|
||||
if (container != null)
|
||||
{
|
||||
// check path
|
||||
@@ -64,7 +64,7 @@ namespace Umbraco.Core.Persistence.Repositories.Implement
|
||||
// move to parent (or -1), update path, save
|
||||
moving.ParentId = parentId;
|
||||
var movingPath = moving.Path + ","; // save before changing
|
||||
moving.Path = (container == null ? ConstantsCore.System.RootString : container.Path) + "," + moving.Id;
|
||||
moving.Path = (container == null ? Constants.System.RootString : container.Path) + "," + moving.Id;
|
||||
moving.Level = container == null ? 1 : container.Level + 1;
|
||||
Save(moving);
|
||||
|
||||
@@ -266,7 +266,7 @@ AND umbracoNode.id <> @id",
|
||||
.SelectAll()
|
||||
.From<ContentDto>()
|
||||
.InnerJoin<NodeDto>().On<ContentDto, NodeDto>(left => left.NodeId, right => right.NodeId)
|
||||
.Where<NodeDto>(x => x.NodeObjectType == ConstantsCore.ObjectTypes.Document)
|
||||
.Where<NodeDto>(x => x.NodeObjectType == Constants.ObjectTypes.Document)
|
||||
.Where<ContentDto>(x => x.ContentTypeId == entity.Id);
|
||||
var contentDtos = Database.Fetch<ContentDto>(sql);
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ namespace Umbraco.Core.Persistence.Repositories.Implement
|
||||
class DataTypeContainerRepository : EntityContainerRepository, IDataTypeContainerRepository
|
||||
{
|
||||
public DataTypeContainerRepository(IScopeAccessor scopeAccessor, AppCaches cache, ILogger logger)
|
||||
: base(scopeAccessor, cache, logger, ConstantsCore.ObjectTypes.DataTypeContainer)
|
||||
: base(scopeAccessor, cache, logger, Constants.ObjectTypes.DataTypeContainer)
|
||||
{ }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -99,7 +99,7 @@ namespace Umbraco.Core.Persistence.Repositories.Implement
|
||||
return Array.Empty<string>();
|
||||
}
|
||||
|
||||
protected override Guid NodeObjectTypeId => ConstantsCore.ObjectTypes.DataType;
|
||||
protected override Guid NodeObjectTypeId => Constants.ObjectTypes.DataType;
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
@@ -24,6 +24,6 @@ namespace Umbraco.Core.Persistence.Repositories.Implement
|
||||
|
||||
protected override bool EnsureUniqueNaming => false; // duplicates are allowed
|
||||
|
||||
protected override Guid NodeObjectTypeId => ConstantsCore.ObjectTypes.DocumentBlueprint;
|
||||
protected override Guid NodeObjectTypeId => Constants.ObjectTypes.DocumentBlueprint;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -54,7 +54,7 @@ namespace Umbraco.Core.Persistence.Repositories.Implement
|
||||
|
||||
#region Repository Base
|
||||
|
||||
protected override Guid NodeObjectTypeId => ConstantsCore.ObjectTypes.Document;
|
||||
protected override Guid NodeObjectTypeId => Constants.ObjectTypes.Document;
|
||||
|
||||
protected override IContent PerformGet(int id)
|
||||
{
|
||||
@@ -471,12 +471,12 @@ namespace Umbraco.Core.Persistence.Repositories.Implement
|
||||
entity.ResetDirtyProperties();
|
||||
|
||||
// troubleshooting
|
||||
//if (Database.ExecuteScalar<int>($"SELECT COUNT(*) FROM {Constants.DatabaseSchema.Tables.DocumentVersion} JOIN {Constants.DatabaseSchema.Tables.ContentVersion} ON {Constants.DatabaseSchema.Tables.DocumentVersion}.id={Constants.DatabaseSchema.Tables.ContentVersion}.id WHERE published=1 AND nodeId=" + content.Id) > 1)
|
||||
//if (Database.ExecuteScalar<int>($"SELECT COUNT(*) FROM {ConstantsCore.DatabaseSchema.Tables.DocumentVersion} JOIN {ConstantsCore.DatabaseSchema.Tables.ContentVersion} ON {ConstantsCore.DatabaseSchema.Tables.DocumentVersion}.id={ConstantsCore.DatabaseSchema.Tables.ContentVersion}.id WHERE published=1 AND nodeId=" + content.Id) > 1)
|
||||
//{
|
||||
// Debugger.Break();
|
||||
// throw new Exception("oops");
|
||||
//}
|
||||
//if (Database.ExecuteScalar<int>($"SELECT COUNT(*) FROM {Constants.DatabaseSchema.Tables.DocumentVersion} JOIN {Constants.DatabaseSchema.Tables.ContentVersion} ON {Constants.DatabaseSchema.Tables.DocumentVersion}.id={Constants.DatabaseSchema.Tables.ContentVersion}.id WHERE [current]=1 AND nodeId=" + content.Id) > 1)
|
||||
//if (Database.ExecuteScalar<int>($"SELECT COUNT(*) FROM {ConstantsCore.DatabaseSchema.Tables.DocumentVersion} JOIN {ConstantsCore.DatabaseSchema.Tables.ContentVersion} ON {ConstantsCore.DatabaseSchema.Tables.DocumentVersion}.id={ConstantsCore.DatabaseSchema.Tables.ContentVersion}.id WHERE [current]=1 AND nodeId=" + content.Id) > 1)
|
||||
//{
|
||||
// Debugger.Break();
|
||||
// throw new Exception("oops");
|
||||
@@ -676,12 +676,12 @@ namespace Umbraco.Core.Persistence.Repositories.Implement
|
||||
entity.ResetDirtyProperties();
|
||||
|
||||
// troubleshooting
|
||||
//if (Database.ExecuteScalar<int>($"SELECT COUNT(*) FROM {Constants.DatabaseSchema.Tables.DocumentVersion} JOIN {Constants.DatabaseSchema.Tables.ContentVersion} ON {Constants.DatabaseSchema.Tables.DocumentVersion}.id={Constants.DatabaseSchema.Tables.ContentVersion}.id WHERE published=1 AND nodeId=" + content.Id) > 1)
|
||||
//if (Database.ExecuteScalar<int>($"SELECT COUNT(*) FROM {ConstantsCore.DatabaseSchema.Tables.DocumentVersion} JOIN {ConstantsCore.DatabaseSchema.Tables.ContentVersion} ON {ConstantsCore.DatabaseSchema.Tables.DocumentVersion}.id={ConstantsCore.DatabaseSchema.Tables.ContentVersion}.id WHERE published=1 AND nodeId=" + content.Id) > 1)
|
||||
//{
|
||||
// Debugger.Break();
|
||||
// throw new Exception("oops");
|
||||
//}
|
||||
//if (Database.ExecuteScalar<int>($"SELECT COUNT(*) FROM {Constants.DatabaseSchema.Tables.DocumentVersion} JOIN {Constants.DatabaseSchema.Tables.ContentVersion} ON {Constants.DatabaseSchema.Tables.DocumentVersion}.id={Constants.DatabaseSchema.Tables.ContentVersion}.id WHERE [current]=1 AND nodeId=" + content.Id) > 1)
|
||||
//if (Database.ExecuteScalar<int>($"SELECT COUNT(*) FROM {ConstantsCore.DatabaseSchema.Tables.DocumentVersion} JOIN {ConstantsCore.DatabaseSchema.Tables.ContentVersion} ON {ConstantsCore.DatabaseSchema.Tables.DocumentVersion}.id={ConstantsCore.DatabaseSchema.Tables.ContentVersion}.id WHERE [current]=1 AND nodeId=" + content.Id) > 1)
|
||||
//{
|
||||
// Debugger.Break();
|
||||
// throw new Exception("oops");
|
||||
@@ -863,7 +863,7 @@ namespace Umbraco.Core.Persistence.Repositories.Implement
|
||||
|
||||
#region Recycle Bin
|
||||
|
||||
public override int RecycleBinId => ConstantsCore.System.RecycleBinContent;
|
||||
public override int RecycleBinId => Constants.System.RecycleBinContent;
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
+1
-1
@@ -7,7 +7,7 @@ namespace Umbraco.Core.Persistence.Repositories.Implement
|
||||
class DocumentTypeContainerRepository : EntityContainerRepository, IDocumentTypeContainerRepository
|
||||
{
|
||||
public DocumentTypeContainerRepository(IScopeAccessor scopeAccessor, AppCaches cache, ILogger logger)
|
||||
: base(scopeAccessor, cache, logger, ConstantsCore.ObjectTypes.DocumentTypeContainer)
|
||||
: base(scopeAccessor, cache, logger, Constants.ObjectTypes.DocumentTypeContainer)
|
||||
{ }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@ namespace Umbraco.Core.Persistence.Repositories.Implement
|
||||
public EntityContainerRepository(IScopeAccessor scopeAccessor, AppCaches cache, ILogger logger, Guid containerObjectType)
|
||||
: base(scopeAccessor, cache, logger)
|
||||
{
|
||||
var allowedContainers = new[] { ConstantsCore.ObjectTypes.DocumentTypeContainer, ConstantsCore.ObjectTypes.MediaTypeContainer, ConstantsCore.ObjectTypes.DataTypeContainer };
|
||||
var allowedContainers = new[] { Constants.ObjectTypes.DocumentTypeContainer, Constants.ObjectTypes.MediaTypeContainer, Constants.ObjectTypes.DataTypeContainer };
|
||||
_containerObjectType = containerObjectType;
|
||||
if (allowedContainers.Contains(_containerObjectType) == false)
|
||||
throw new InvalidOperationException("No container type exists with ID: " + _containerObjectType);
|
||||
@@ -93,7 +93,7 @@ namespace Umbraco.Core.Persistence.Repositories.Implement
|
||||
var entity = new EntityContainer(nodeDto.NodeId, nodeDto.UniqueId,
|
||||
nodeDto.ParentId, nodeDto.Path, nodeDto.Level, nodeDto.SortOrder,
|
||||
containedObjectType,
|
||||
nodeDto.Text, nodeDto.UserId ?? ConstantsCore.Security.UnknownUserId);
|
||||
nodeDto.Text, nodeDto.UserId ?? Constants.Security.UnknownUserId);
|
||||
|
||||
// reset dirty initial properties (U4-1946)
|
||||
entity.ResetDirtyProperties(false);
|
||||
|
||||
@@ -39,9 +39,9 @@ namespace Umbraco.Core.Persistence.Repositories.Implement
|
||||
public IEnumerable<IEntitySlim> GetPagedResultsByQuery(IQuery<IUmbracoEntity> query, Guid objectType, long pageIndex, int pageSize, out long totalRecords,
|
||||
IQuery<IUmbracoEntity> filter, Ordering ordering)
|
||||
{
|
||||
var isContent = objectType == ConstantsCore.ObjectTypes.Document || objectType == ConstantsCore.ObjectTypes.DocumentBlueprint;
|
||||
var isMedia = objectType == ConstantsCore.ObjectTypes.Media;
|
||||
var isMember = objectType == ConstantsCore.ObjectTypes.Member;
|
||||
var isContent = objectType == Constants.ObjectTypes.Document || objectType == Constants.ObjectTypes.DocumentBlueprint;
|
||||
var isMedia = objectType == Constants.ObjectTypes.Media;
|
||||
var isMember = objectType == Constants.ObjectTypes.Member;
|
||||
|
||||
var sql = GetBaseWhere(isContent, isMedia, isMember, false, x =>
|
||||
{
|
||||
@@ -133,9 +133,9 @@ namespace Umbraco.Core.Persistence.Repositories.Implement
|
||||
|
||||
public IEntitySlim Get(Guid key, Guid objectTypeId)
|
||||
{
|
||||
var isContent = objectTypeId == ConstantsCore.ObjectTypes.Document || objectTypeId == ConstantsCore.ObjectTypes.DocumentBlueprint;
|
||||
var isMedia = objectTypeId == ConstantsCore.ObjectTypes.Media;
|
||||
var isMember = objectTypeId == ConstantsCore.ObjectTypes.Member;
|
||||
var isContent = objectTypeId == Constants.ObjectTypes.Document || objectTypeId == Constants.ObjectTypes.DocumentBlueprint;
|
||||
var isMedia = objectTypeId == Constants.ObjectTypes.Media;
|
||||
var isMember = objectTypeId == Constants.ObjectTypes.Member;
|
||||
|
||||
var sql = GetFullSqlForEntityType(isContent, isMedia, isMember, objectTypeId, key);
|
||||
return GetEntity(sql, isContent, isMedia, isMember);
|
||||
@@ -150,9 +150,9 @@ namespace Umbraco.Core.Persistence.Repositories.Implement
|
||||
|
||||
public IEntitySlim Get(int id, Guid objectTypeId)
|
||||
{
|
||||
var isContent = objectTypeId == ConstantsCore.ObjectTypes.Document || objectTypeId == ConstantsCore.ObjectTypes.DocumentBlueprint;
|
||||
var isMedia = objectTypeId == ConstantsCore.ObjectTypes.Media;
|
||||
var isMember = objectTypeId == ConstantsCore.ObjectTypes.Member;
|
||||
var isContent = objectTypeId == Constants.ObjectTypes.Document || objectTypeId == Constants.ObjectTypes.DocumentBlueprint;
|
||||
var isMedia = objectTypeId == Constants.ObjectTypes.Media;
|
||||
var isMember = objectTypeId == Constants.ObjectTypes.Member;
|
||||
|
||||
var sql = GetFullSqlForEntityType(isContent, isMedia, isMember, objectTypeId, id);
|
||||
return GetEntity(sql, isContent, isMedia, isMember);
|
||||
@@ -195,9 +195,9 @@ namespace Umbraco.Core.Persistence.Repositories.Implement
|
||||
|
||||
private IEnumerable<IEntitySlim> PerformGetAll(Guid objectType, Action<Sql<ISqlContext>> filter = null)
|
||||
{
|
||||
var isContent = objectType == ConstantsCore.ObjectTypes.Document || objectType == ConstantsCore.ObjectTypes.DocumentBlueprint;
|
||||
var isMedia = objectType == ConstantsCore.ObjectTypes.Media;
|
||||
var isMember = objectType == ConstantsCore.ObjectTypes.Member;
|
||||
var isContent = objectType == Constants.ObjectTypes.Document || objectType == Constants.ObjectTypes.DocumentBlueprint;
|
||||
var isMedia = objectType == Constants.ObjectTypes.Media;
|
||||
var isMember = objectType == Constants.ObjectTypes.Member;
|
||||
|
||||
var sql = GetFullSqlForEntityType(isContent, isMedia, isMember, objectType, filter);
|
||||
return GetEntities(sql, isContent, isMedia, isMember);
|
||||
@@ -237,9 +237,9 @@ namespace Umbraco.Core.Persistence.Repositories.Implement
|
||||
|
||||
public IEnumerable<IEntitySlim> GetByQuery(IQuery<IUmbracoEntity> query, Guid objectType)
|
||||
{
|
||||
var isContent = objectType == ConstantsCore.ObjectTypes.Document || objectType == ConstantsCore.ObjectTypes.DocumentBlueprint;
|
||||
var isMedia = objectType == ConstantsCore.ObjectTypes.Media;
|
||||
var isMember = objectType == ConstantsCore.ObjectTypes.Member;
|
||||
var isContent = objectType == Constants.ObjectTypes.Document || objectType == Constants.ObjectTypes.DocumentBlueprint;
|
||||
var isMedia = objectType == Constants.ObjectTypes.Media;
|
||||
var isMember = objectType == Constants.ObjectTypes.Member;
|
||||
|
||||
var sql = GetBaseWhere(isContent, isMedia, isMember, false, null, objectType);
|
||||
|
||||
@@ -607,7 +607,7 @@ namespace Umbraco.Core.Persistence.Repositories.Implement
|
||||
{
|
||||
entity.Trashed = dto.Trashed;
|
||||
entity.CreateDate = dto.CreateDate;
|
||||
entity.CreatorId = dto.UserId ?? ConstantsCore.Security.UnknownUserId;
|
||||
entity.CreatorId = dto.UserId ?? Constants.Security.UnknownUserId;
|
||||
entity.Id = dto.NodeId;
|
||||
entity.Key = dto.UniqueId;
|
||||
entity.Level = dto.Level;
|
||||
|
||||
@@ -186,7 +186,7 @@ namespace Umbraco.Core.Persistence.Repositories.Implement
|
||||
{
|
||||
//if the iso code is changing, ensure there's not another lang with the same code already assigned
|
||||
var sameCode = Sql()
|
||||
.SelectCount()
|
||||
.SelectCount()
|
||||
.From<LanguageDto>()
|
||||
.Where<LanguageDto>(x => x.IsoCode == entity.IsoCode && x.Id != entity.Id);
|
||||
|
||||
@@ -269,7 +269,7 @@ namespace Umbraco.Core.Persistence.Repositories.Implement
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
// fast way of getting an isoCode for an id - avoiding cloning
|
||||
// _idCodeMap is rebuilt whenever PerformGetAll runs
|
||||
public string GetIsoCodeById(int? id, bool throwOnNotFound = true)
|
||||
|
||||
@@ -39,7 +39,7 @@ namespace Umbraco.Core.Persistence.Repositories.Implement
|
||||
|
||||
#region Repository Base
|
||||
|
||||
protected override Guid NodeObjectTypeId => ConstantsCore.ObjectTypes.Media;
|
||||
protected override Guid NodeObjectTypeId => Constants.ObjectTypes.Media;
|
||||
|
||||
protected override IMedia PerformGet(int id)
|
||||
{
|
||||
@@ -358,7 +358,7 @@ namespace Umbraco.Core.Persistence.Repositories.Implement
|
||||
|
||||
#region Recycle Bin
|
||||
|
||||
public override int RecycleBinId => ConstantsCore.System.RecycleBinMedia;
|
||||
public override int RecycleBinId => Constants.System.RecycleBinMedia;
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ namespace Umbraco.Core.Persistence.Repositories.Implement
|
||||
class MediaTypeContainerRepository : EntityContainerRepository, IMediaTypeContainerRepository
|
||||
{
|
||||
public MediaTypeContainerRepository(IScopeAccessor scopeAccessor, AppCaches cache, ILogger logger)
|
||||
: base(scopeAccessor, cache, logger, ConstantsCore.ObjectTypes.MediaTypeContainer)
|
||||
: base(scopeAccessor, cache, logger, Constants.ObjectTypes.MediaTypeContainer)
|
||||
{ }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -100,7 +100,7 @@ namespace Umbraco.Core.Persistence.Repositories.Implement
|
||||
return l;
|
||||
}
|
||||
|
||||
protected override Guid NodeObjectTypeId => ConstantsCore.ObjectTypes.MediaType;
|
||||
protected override Guid NodeObjectTypeId => Constants.ObjectTypes.MediaType;
|
||||
|
||||
protected override void PersistNewItem(IMediaType entity)
|
||||
{
|
||||
|
||||
@@ -87,7 +87,7 @@ namespace Umbraco.Core.Persistence.Repositories.Implement
|
||||
return list;
|
||||
}
|
||||
|
||||
protected override Guid NodeObjectTypeId => ConstantsCore.ObjectTypes.MemberGroup;
|
||||
protected override Guid NodeObjectTypeId => Constants.ObjectTypes.MemberGroup;
|
||||
|
||||
protected override void PersistNewItem(IMemberGroup entity)
|
||||
{
|
||||
@@ -185,7 +185,7 @@ namespace Umbraco.Core.Persistence.Repositories.Implement
|
||||
|
||||
public int[] GetMemberIds(string[] usernames)
|
||||
{
|
||||
var memberObjectType = ConstantsCore.ObjectTypes.Member;
|
||||
var memberObjectType = Constants.ObjectTypes.Member;
|
||||
|
||||
var memberSql = Sql()
|
||||
.Select("umbracoNode.id")
|
||||
|
||||
@@ -39,7 +39,7 @@ namespace Umbraco.Core.Persistence.Repositories.Implement
|
||||
|
||||
#region Repository Base
|
||||
|
||||
protected override Guid NodeObjectTypeId => ConstantsCore.ObjectTypes.Member;
|
||||
protected override Guid NodeObjectTypeId => Constants.ObjectTypes.Member;
|
||||
|
||||
protected override IMember PerformGet(int id)
|
||||
{
|
||||
@@ -308,7 +308,7 @@ namespace Umbraco.Core.Persistence.Repositories.Implement
|
||||
if (entity.RawPasswordValue.IsNullOrWhiteSpace())
|
||||
{
|
||||
var aspHasher = new PasswordHasher();
|
||||
dto.Password = ConstantsCore.Security.EmptyPasswordPrefix + aspHasher.HashPassword(Guid.NewGuid().ToString("N"));
|
||||
dto.Password = Constants.Security.EmptyPasswordPrefix + aspHasher.HashPassword(Guid.NewGuid().ToString("N"));
|
||||
entity.RawPasswordValue = dto.Password;
|
||||
}
|
||||
|
||||
|
||||
@@ -127,7 +127,7 @@ namespace Umbraco.Core.Persistence.Repositories.Implement
|
||||
return l;
|
||||
}
|
||||
|
||||
protected override Guid NodeObjectTypeId => ConstantsCore.ObjectTypes.MemberType;
|
||||
protected override Guid NodeObjectTypeId => Constants.ObjectTypes.MemberType;
|
||||
|
||||
protected override void PersistNewItem(IMemberType entity)
|
||||
{
|
||||
@@ -138,12 +138,12 @@ namespace Umbraco.Core.Persistence.Repositories.Implement
|
||||
//set a default icon if one is not specified
|
||||
if (entity.Icon.IsNullOrWhiteSpace())
|
||||
{
|
||||
entity.Icon = ConstantsCore.Icons.Member;
|
||||
entity.Icon = Constants.Icons.Member;
|
||||
}
|
||||
|
||||
//By Convention we add 9 standard PropertyTypes to an Umbraco MemberType
|
||||
entity.AddPropertyGroup(Constants.Conventions.Member.StandardPropertiesGroupName);
|
||||
var standardPropertyTypes = Constants.Conventions.Member.GetStandardPropertyTypeStubs();
|
||||
var standardPropertyTypes = ConventionsHelper.GetStandardPropertyTypeStubs();
|
||||
foreach (var standardPropertyType in standardPropertyTypes)
|
||||
{
|
||||
entity.AddPropertyType(standardPropertyType.Value, Constants.Conventions.Member.StandardPropertiesGroupName);
|
||||
@@ -206,7 +206,7 @@ namespace Umbraco.Core.Persistence.Repositories.Implement
|
||||
protected override PropertyType CreatePropertyType(string propertyEditorAlias, ValueStorageType storageType, string propertyTypeAlias)
|
||||
{
|
||||
//custom property type constructor logic to set explicit dbtype's for built in properties
|
||||
var builtinProperties = Constants.Conventions.Member.GetStandardPropertyTypeStubs();
|
||||
var builtinProperties = ConventionsHelper.GetStandardPropertyTypeStubs();
|
||||
var readonlyStorageType = builtinProperties.TryGetValue(propertyTypeAlias, out var propertyType);
|
||||
storageType = readonlyStorageType ? propertyType.ValueStorageType : storageType;
|
||||
return new PropertyType(propertyEditorAlias, storageType, readonlyStorageType, propertyTypeAlias);
|
||||
@@ -219,7 +219,7 @@ namespace Umbraco.Core.Persistence.Repositories.Implement
|
||||
/// <param name="memberType"></param>
|
||||
private static void EnsureExplicitDataTypeForBuiltInProperties(IContentTypeBase memberType)
|
||||
{
|
||||
var builtinProperties = Constants.Conventions.Member.GetStandardPropertyTypeStubs();
|
||||
var builtinProperties = ConventionsHelper.GetStandardPropertyTypeStubs();
|
||||
foreach (var propertyType in memberType.PropertyTypes)
|
||||
{
|
||||
if (builtinProperties.ContainsKey(propertyType.Alias))
|
||||
|
||||
@@ -517,11 +517,11 @@ WHERE r.tagId IS NULL";
|
||||
switch (type)
|
||||
{
|
||||
case TaggableObjectTypes.Content:
|
||||
return ConstantsCore.ObjectTypes.Document;
|
||||
return Constants.ObjectTypes.Document;
|
||||
case TaggableObjectTypes.Media:
|
||||
return ConstantsCore.ObjectTypes.Media;
|
||||
return Constants.ObjectTypes.Media;
|
||||
case TaggableObjectTypes.Member:
|
||||
return ConstantsCore.ObjectTypes.Member;
|
||||
return Constants.ObjectTypes.Member;
|
||||
default:
|
||||
throw new ArgumentOutOfRangeException(nameof(type));
|
||||
}
|
||||
|
||||
@@ -133,7 +133,7 @@ namespace Umbraco.Core.Persistence.Repositories.Implement
|
||||
return list;
|
||||
}
|
||||
|
||||
protected override Guid NodeObjectTypeId => ConstantsCore.ObjectTypes.Template;
|
||||
protected override Guid NodeObjectTypeId => Constants.ObjectTypes.Template;
|
||||
|
||||
protected override void PersistNewItem(ITemplate entity)
|
||||
{
|
||||
|
||||
@@ -52,7 +52,7 @@ namespace Umbraco.Core.Persistence
|
||||
/// </summary>
|
||||
/// <remarks>Used by core runtime.</remarks>
|
||||
public UmbracoDatabaseFactory(ILogger logger, Lazy<IMapperCollection> mappers)
|
||||
: this(ConstantsCore.System.UmbracoConnectionName, logger, mappers)
|
||||
: this(Constants.System.UmbracoConnectionName, logger, mappers)
|
||||
{ }
|
||||
|
||||
/// <summary>
|
||||
@@ -135,7 +135,7 @@ namespace Umbraco.Core.Persistence
|
||||
{
|
||||
// replace NPoco database type by a more efficient one
|
||||
|
||||
var setting = ConfigurationManager.AppSettings[ConstantsCore.AppSettings.Debug.DatabaseFactoryServerVersion];
|
||||
var setting = ConfigurationManager.AppSettings[Constants.AppSettings.Debug.DatabaseFactoryServerVersion];
|
||||
var fromSettings = false;
|
||||
|
||||
if (setting.IsNullOrWhiteSpace() || !setting.StartsWith("SqlServer.")
|
||||
|
||||
@@ -29,7 +29,7 @@ namespace Umbraco.Core.PropertyEditors
|
||||
|
||||
// defaults
|
||||
Type = type;
|
||||
Icon = ConstantsCore.Icons.PropertyEditor;
|
||||
Icon = Constants.Icons.PropertyEditor;
|
||||
Group = Constants.PropertyEditors.Groups.Common;
|
||||
|
||||
// assign properties based on the attribute, if it is found
|
||||
|
||||
@@ -115,7 +115,7 @@ namespace Umbraco.Core.PropertyEditors
|
||||
/// Gets or sets an optional icon.
|
||||
/// </summary>
|
||||
/// <remarks>The icon can be used for example when presenting datatypes based upon the editor.</remarks>
|
||||
public string Icon { get; set; } = ConstantsCore.Icons.PropertyEditor;
|
||||
public string Icon { get; set; } = Constants.Icons.PropertyEditor;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets an optional group.
|
||||
|
||||
@@ -25,4 +25,4 @@ namespace Umbraco.Core.PropertyEditors
|
||||
return newConfiguration;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -81,7 +81,7 @@ namespace Umbraco.Core.Runtime
|
||||
// TODO: this is a hack, use proper configuration!
|
||||
// also: we still register the full IServerMessenger because
|
||||
// even on 1 single server we can have 2 concurrent app domains
|
||||
var singleServer = "true".InvariantEquals(ConfigurationManager.AppSettings[ConstantsCore.AppSettings.DisableElectionForSingleServer]);
|
||||
var singleServer = "true".InvariantEquals(ConfigurationManager.AppSettings[Constants.AppSettings.DisableElectionForSingleServer]);
|
||||
return singleServer
|
||||
? (IServerRegistrar) new SingleServerRegistrar(f.GetInstance<IRuntimeState>())
|
||||
: new DatabaseServerRegistrar(
|
||||
|
||||
@@ -28,7 +28,7 @@ namespace Umbraco.Core.Security
|
||||
}
|
||||
|
||||
//Otherwise convert to a UmbracoBackOfficeIdentity if it's auth'd and has the back office session
|
||||
if (user.Identity is ClaimsIdentity claimsIdentity && claimsIdentity.IsAuthenticated && claimsIdentity.HasClaim(x => x.Type == ConstantsCore.Security.SessionIdClaimType))
|
||||
if (user.Identity is ClaimsIdentity claimsIdentity && claimsIdentity.IsAuthenticated && claimsIdentity.HasClaim(x => x.Type == Constants.Security.SessionIdClaimType))
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
@@ -85,7 +85,7 @@ namespace Umbraco.Core.Security
|
||||
// prefix will help us determine if the password hasn't actually been specified yet.
|
||||
//this will hash the guid with a salt so should be nicely random
|
||||
var aspHasher = new PasswordHasher();
|
||||
var emptyPasswordValue = ConstantsCore.Security.EmptyPasswordPrefix +
|
||||
var emptyPasswordValue = Constants.Security.EmptyPasswordPrefix +
|
||||
aspHasher.HashPassword(Guid.NewGuid().ToString("N"));
|
||||
|
||||
var userEntity = new User(user.Name, user.Email, user.UserName, emptyPasswordValue)
|
||||
|
||||
@@ -99,9 +99,9 @@ namespace Umbraco.Core.Security
|
||||
bool? hasPathAccess = null;
|
||||
entity = null;
|
||||
|
||||
if (nodeId == ConstantsCore.System.Root)
|
||||
if (nodeId == Constants.System.Root)
|
||||
hasPathAccess = user.HasContentRootAccess(entityService);
|
||||
else if (nodeId == ConstantsCore.System.RecycleBinContent)
|
||||
else if (nodeId == Constants.System.RecycleBinContent)
|
||||
hasPathAccess = user.HasContentBinAccess(entityService);
|
||||
|
||||
if (hasPathAccess.HasValue)
|
||||
@@ -151,9 +151,9 @@ namespace Umbraco.Core.Security
|
||||
bool? hasPathAccess = null;
|
||||
contentItem = null;
|
||||
|
||||
if (nodeId == ConstantsCore.System.Root)
|
||||
if (nodeId == Constants.System.Root)
|
||||
hasPathAccess = user.HasContentRootAccess(entityService);
|
||||
else if (nodeId == ConstantsCore.System.RecycleBinContent)
|
||||
else if (nodeId == Constants.System.RecycleBinContent)
|
||||
hasPathAccess = user.HasContentBinAccess(entityService);
|
||||
|
||||
if (hasPathAccess.HasValue)
|
||||
@@ -202,7 +202,7 @@ namespace Umbraco.Core.Security
|
||||
return false;
|
||||
|
||||
// check for root access
|
||||
if (startNodeIds.Contains(ConstantsCore.System.Root))
|
||||
if (startNodeIds.Contains(Constants.System.Root))
|
||||
return true;
|
||||
|
||||
var formattedPath = string.Concat(",", path, ",");
|
||||
@@ -227,7 +227,7 @@ namespace Umbraco.Core.Security
|
||||
return false;
|
||||
|
||||
// check for root access
|
||||
if (startNodeIds.Contains(ConstantsCore.System.Root))
|
||||
if (startNodeIds.Contains(Constants.System.Root))
|
||||
{
|
||||
hasPathAccess = true;
|
||||
return true;
|
||||
|
||||
@@ -332,7 +332,7 @@ namespace Umbraco.Core.Security
|
||||
//we need to lookup the member since this could be a brand new member without a password set
|
||||
var rawPassword = GetRawPassword(username);
|
||||
rawPasswordValue = rawPassword.Success ? rawPassword.Result : string.Empty;
|
||||
if (rawPassword.Success == false || rawPasswordValue.StartsWith(ConstantsCore.Security.EmptyPasswordPrefix) == false)
|
||||
if (rawPassword.Success == false || rawPasswordValue.StartsWith(Constants.Security.EmptyPasswordPrefix) == false)
|
||||
{
|
||||
//If the old password is empty and AllowManuallyChangingPassword is false, than this provider cannot just arbitrarily change the password
|
||||
throw new NotSupportedException("This provider does not support manually changing the password");
|
||||
@@ -354,7 +354,7 @@ namespace Umbraco.Core.Security
|
||||
// * during installation to set the admin password
|
||||
var installing = Current.RuntimeState.Level == RuntimeLevel.Install;
|
||||
if (AllowManuallyChangingPassword == false
|
||||
&& (rawPasswordValue.StartsWith(ConstantsCore.Security.EmptyPasswordPrefix)
|
||||
&& (rawPasswordValue.StartsWith(Constants.Security.EmptyPasswordPrefix)
|
||||
|| (installing && oldPassword == "default")))
|
||||
{
|
||||
return PerformChangePassword(username, oldPassword, newPassword);
|
||||
|
||||
@@ -88,11 +88,11 @@ namespace Umbraco.Core.Security
|
||||
/// <returns></returns>
|
||||
public static MembershipProvider GetUsersMembershipProvider()
|
||||
{
|
||||
if (Membership.Providers[ConstantsCore.Security.UserMembershipProviderName] == null)
|
||||
if (Membership.Providers[Constants.Security.UserMembershipProviderName] == null)
|
||||
{
|
||||
throw new InvalidOperationException("No membership provider found with name " + ConstantsCore.Security.UserMembershipProviderName);
|
||||
throw new InvalidOperationException("No membership provider found with name " + Constants.Security.UserMembershipProviderName);
|
||||
}
|
||||
return Membership.Providers[ConstantsCore.Security.UserMembershipProviderName];
|
||||
return Membership.Providers[Constants.Security.UserMembershipProviderName];
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -45,7 +45,7 @@ namespace Umbraco.Core.Security
|
||||
public UmbracoBackOfficeIdentity(int userId, string username, string realName,
|
||||
IEnumerable<int> startContentNodes, IEnumerable<int> startMediaNodes, string culture,
|
||||
string sessionId, string securityStamp, IEnumerable<string> allowedApps, IEnumerable<string> roles)
|
||||
: base(Enumerable.Empty<Claim>(), ConstantsCore.Security.BackOfficeAuthenticationType) //this ctor is used to ensure the IsAuthenticated property is true
|
||||
: base(Enumerable.Empty<Claim>(), Constants.Security.BackOfficeAuthenticationType) //this ctor is used to ensure the IsAuthenticated property is true
|
||||
{
|
||||
if (allowedApps == null) throw new ArgumentNullException(nameof(allowedApps));
|
||||
if (string.IsNullOrWhiteSpace(username)) throw new ArgumentException("Value cannot be null or whitespace.", nameof(username));
|
||||
@@ -76,7 +76,7 @@ namespace Umbraco.Core.Security
|
||||
int userId, string username, string realName,
|
||||
IEnumerable<int> startContentNodes, IEnumerable<int> startMediaNodes, string culture,
|
||||
string sessionId, string securityStamp, IEnumerable<string> allowedApps, IEnumerable<string> roles)
|
||||
: base(childIdentity.Claims, ConstantsCore.Security.BackOfficeAuthenticationType)
|
||||
: base(childIdentity.Claims, Constants.Security.BackOfficeAuthenticationType)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(username)) throw new ArgumentException("Value cannot be null or whitespace.", nameof(username));
|
||||
if (string.IsNullOrWhiteSpace(realName)) throw new ArgumentException("Value cannot be null or whitespace.", nameof(realName));
|
||||
@@ -92,7 +92,7 @@ namespace Umbraco.Core.Security
|
||||
/// </summary>
|
||||
/// <param name="identity"></param>
|
||||
private UmbracoBackOfficeIdentity(ClaimsIdentity identity)
|
||||
: base(identity.Claims, ConstantsCore.Security.BackOfficeAuthenticationType)
|
||||
: base(identity.Claims, Constants.Security.BackOfficeAuthenticationType)
|
||||
{
|
||||
Actor = identity;
|
||||
|
||||
@@ -107,7 +107,7 @@ namespace Umbraco.Core.Security
|
||||
}
|
||||
}
|
||||
|
||||
public const string Issuer = ConstantsCore.Security.BackOfficeAuthenticationType;
|
||||
public const string Issuer = Constants.Security.BackOfficeAuthenticationType;
|
||||
|
||||
/// <summary>
|
||||
/// Returns the required claim types for a back office identity
|
||||
@@ -120,10 +120,10 @@ namespace Umbraco.Core.Security
|
||||
ClaimTypes.NameIdentifier, //id
|
||||
ClaimTypes.Name, //username
|
||||
ClaimTypes.GivenName,
|
||||
ConstantsCore.Security.StartContentNodeIdClaimType,
|
||||
ConstantsCore.Security.StartMediaNodeIdClaimType,
|
||||
Constants.Security.StartContentNodeIdClaimType,
|
||||
Constants.Security.StartMediaNodeIdClaimType,
|
||||
ClaimTypes.Locality,
|
||||
ConstantsCore.Security.SessionIdClaimType,
|
||||
Constants.Security.SessionIdClaimType,
|
||||
Microsoft.AspNet.Identity.Constants.DefaultSecurityStampClaimType
|
||||
};
|
||||
|
||||
@@ -144,27 +144,27 @@ namespace Umbraco.Core.Security
|
||||
if (HasClaim(x => x.Type == ClaimTypes.GivenName) == false)
|
||||
AddClaim(new Claim(ClaimTypes.GivenName, realName, ClaimValueTypes.String, Issuer, Issuer, this));
|
||||
|
||||
if (HasClaim(x => x.Type == ConstantsCore.Security.StartContentNodeIdClaimType) == false && startContentNodes != null)
|
||||
if (HasClaim(x => x.Type == Constants.Security.StartContentNodeIdClaimType) == false && startContentNodes != null)
|
||||
{
|
||||
foreach (var startContentNode in startContentNodes)
|
||||
{
|
||||
AddClaim(new Claim(ConstantsCore.Security.StartContentNodeIdClaimType, startContentNode.ToInvariantString(), ClaimValueTypes.Integer32, Issuer, Issuer, this));
|
||||
AddClaim(new Claim(Constants.Security.StartContentNodeIdClaimType, startContentNode.ToInvariantString(), ClaimValueTypes.Integer32, Issuer, Issuer, this));
|
||||
}
|
||||
}
|
||||
|
||||
if (HasClaim(x => x.Type == ConstantsCore.Security.StartMediaNodeIdClaimType) == false && startMediaNodes != null)
|
||||
if (HasClaim(x => x.Type == Constants.Security.StartMediaNodeIdClaimType) == false && startMediaNodes != null)
|
||||
{
|
||||
foreach (var startMediaNode in startMediaNodes)
|
||||
{
|
||||
AddClaim(new Claim(ConstantsCore.Security.StartMediaNodeIdClaimType, startMediaNode.ToInvariantString(), ClaimValueTypes.Integer32, Issuer, Issuer, this));
|
||||
AddClaim(new Claim(Constants.Security.StartMediaNodeIdClaimType, startMediaNode.ToInvariantString(), ClaimValueTypes.Integer32, Issuer, Issuer, this));
|
||||
}
|
||||
}
|
||||
|
||||
if (HasClaim(x => x.Type == ClaimTypes.Locality) == false)
|
||||
AddClaim(new Claim(ClaimTypes.Locality, culture, ClaimValueTypes.String, Issuer, Issuer, this));
|
||||
|
||||
if (HasClaim(x => x.Type == ConstantsCore.Security.SessionIdClaimType) == false && SessionId.IsNullOrWhiteSpace() == false)
|
||||
AddClaim(new Claim(ConstantsCore.Security.SessionIdClaimType, sessionId, ClaimValueTypes.String, Issuer, Issuer, this));
|
||||
if (HasClaim(x => x.Type == Constants.Security.SessionIdClaimType) == false && SessionId.IsNullOrWhiteSpace() == false)
|
||||
AddClaim(new Claim(Constants.Security.SessionIdClaimType, sessionId, ClaimValueTypes.String, Issuer, Issuer, this));
|
||||
|
||||
//The security stamp claim is also required... this is because this claim type is hard coded
|
||||
// by the SecurityStampValidator, see: https://katanaproject.codeplex.com/workitem/444
|
||||
@@ -172,11 +172,11 @@ namespace Umbraco.Core.Security
|
||||
AddClaim(new Claim(Microsoft.AspNet.Identity.Constants.DefaultSecurityStampClaimType, securityStamp, ClaimValueTypes.String, Issuer, Issuer, this));
|
||||
|
||||
//Add each app as a separate claim
|
||||
if (HasClaim(x => x.Type == ConstantsCore.Security.AllowedApplicationsClaimType) == false && allowedApps != null)
|
||||
if (HasClaim(x => x.Type == Constants.Security.AllowedApplicationsClaimType) == false && allowedApps != null)
|
||||
{
|
||||
foreach (var application in allowedApps)
|
||||
{
|
||||
AddClaim(new Claim(ConstantsCore.Security.AllowedApplicationsClaimType, application, ClaimValueTypes.String, Issuer, Issuer, this));
|
||||
AddClaim(new Claim(Constants.Security.AllowedApplicationsClaimType, application, ClaimValueTypes.String, Issuer, Issuer, this));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -203,13 +203,13 @@ namespace Umbraco.Core.Security
|
||||
public override string AuthenticationType => Issuer;
|
||||
|
||||
private int[] _startContentNodes;
|
||||
public int[] StartContentNodes => _startContentNodes ?? (_startContentNodes = FindAll(x => x.Type == ConstantsCore.Security.StartContentNodeIdClaimType).Select(app => int.TryParse(app.Value, out var i) ? i : default).Where(x => x != default).ToArray());
|
||||
public int[] StartContentNodes => _startContentNodes ?? (_startContentNodes = FindAll(x => x.Type == Constants.Security.StartContentNodeIdClaimType).Select(app => int.TryParse(app.Value, out var i) ? i : default).Where(x => x != default).ToArray());
|
||||
|
||||
private int[] _startMediaNodes;
|
||||
public int[] StartMediaNodes => _startMediaNodes ?? (_startMediaNodes = FindAll(x => x.Type == ConstantsCore.Security.StartMediaNodeIdClaimType).Select(app => int.TryParse(app.Value, out var i) ? i : default).Where(x => x != default).ToArray());
|
||||
public int[] StartMediaNodes => _startMediaNodes ?? (_startMediaNodes = FindAll(x => x.Type == Constants.Security.StartMediaNodeIdClaimType).Select(app => int.TryParse(app.Value, out var i) ? i : default).Where(x => x != default).ToArray());
|
||||
|
||||
private string[] _allowedApplications;
|
||||
public string[] AllowedApplications => _allowedApplications ?? (_allowedApplications = FindAll(x => x.Type == ConstantsCore.Security.AllowedApplicationsClaimType).Select(app => app.Value).ToArray());
|
||||
public string[] AllowedApplications => _allowedApplications ?? (_allowedApplications = FindAll(x => x.Type == Constants.Security.AllowedApplicationsClaimType).Select(app => app.Value).ToArray());
|
||||
|
||||
public int Id => int.Parse(this.FindFirstValue(ClaimTypes.NameIdentifier));
|
||||
|
||||
@@ -221,13 +221,13 @@ namespace Umbraco.Core.Security
|
||||
|
||||
public string SessionId
|
||||
{
|
||||
get => this.FindFirstValue(ConstantsCore.Security.SessionIdClaimType);
|
||||
get => this.FindFirstValue(Constants.Security.SessionIdClaimType);
|
||||
set
|
||||
{
|
||||
var existing = FindFirst(ConstantsCore.Security.SessionIdClaimType);
|
||||
var existing = FindFirst(Constants.Security.SessionIdClaimType);
|
||||
if (existing != null)
|
||||
TryRemoveClaim(existing);
|
||||
AddClaim(new Claim(ConstantsCore.Security.SessionIdClaimType, value, ClaimValueTypes.String, Issuer, Issuer, this));
|
||||
AddClaim(new Claim(Constants.Security.SessionIdClaimType, value, ClaimValueTypes.String, Issuer, Issuer, this));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -71,7 +71,7 @@ namespace Umbraco.Core.Services
|
||||
/// <param name="contentTypeAlias"></param>
|
||||
/// <param name="userId"></param>
|
||||
/// <returns></returns>
|
||||
public static IContent CreateContent(this IContentService contentService, string name, Udi parentId, string contentTypeAlias, int userId = ConstantsCore.Security.SuperUserId)
|
||||
public static IContent CreateContent(this IContentService contentService, string name, Udi parentId, string contentTypeAlias, int userId = Constants.Security.SuperUserId)
|
||||
{
|
||||
var guidUdi = parentId as GuidUdi;
|
||||
if (guidUdi == null)
|
||||
@@ -97,7 +97,7 @@ namespace Umbraco.Core.Services
|
||||
/// <returns></returns>
|
||||
public static bool RecycleBinSmells(this IContentService contentService)
|
||||
{
|
||||
return contentService.CountChildren(ConstantsCore.System.RecycleBinContent) > 0;
|
||||
return contentService.CountChildren(Constants.System.RecycleBinContent) > 0;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -107,7 +107,7 @@ namespace Umbraco.Core.Services
|
||||
/// <returns></returns>
|
||||
public static bool RecycleBinSmells(this IMediaService mediaService)
|
||||
{
|
||||
return mediaService.CountChildren(ConstantsCore.System.RecycleBinMedia) > 0;
|
||||
return mediaService.CountChildren(Constants.System.RecycleBinMedia) > 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,27 +33,27 @@ namespace Umbraco.Core.Services
|
||||
/// <summary>
|
||||
/// Saves a blueprint.
|
||||
/// </summary>
|
||||
void SaveBlueprint(IContent content, int userId = ConstantsCore.Security.SuperUserId);
|
||||
void SaveBlueprint(IContent content, int userId = Constants.Security.SuperUserId);
|
||||
|
||||
/// <summary>
|
||||
/// Deletes a blueprint.
|
||||
/// </summary>
|
||||
void DeleteBlueprint(IContent content, int userId = ConstantsCore.Security.SuperUserId);
|
||||
void DeleteBlueprint(IContent content, int userId = Constants.Security.SuperUserId);
|
||||
|
||||
/// <summary>
|
||||
/// Creates a new content item from a blueprint.
|
||||
/// </summary>
|
||||
IContent CreateContentFromBlueprint(IContent blueprint, string name, int userId = ConstantsCore.Security.SuperUserId);
|
||||
IContent CreateContentFromBlueprint(IContent blueprint, string name, int userId = Constants.Security.SuperUserId);
|
||||
|
||||
/// <summary>
|
||||
/// Deletes blueprints for a content type.
|
||||
/// </summary>
|
||||
void DeleteBlueprintsOfType(int contentTypeId, int userId = ConstantsCore.Security.SuperUserId);
|
||||
void DeleteBlueprintsOfType(int contentTypeId, int userId = Constants.Security.SuperUserId);
|
||||
|
||||
/// <summary>
|
||||
/// Deletes blueprints for content types.
|
||||
/// </summary>
|
||||
void DeleteBlueprintsOfTypes(IEnumerable<int> contentTypeIds, int userId = ConstantsCore.Security.SuperUserId);
|
||||
void DeleteBlueprintsOfTypes(IEnumerable<int> contentTypeIds, int userId = Constants.Security.SuperUserId);
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -238,13 +238,13 @@ namespace Umbraco.Core.Services
|
||||
/// <summary>
|
||||
/// Saves a document.
|
||||
/// </summary>
|
||||
OperationResult Save(IContent content, int userId = ConstantsCore.Security.SuperUserId, bool raiseEvents = true);
|
||||
OperationResult Save(IContent content, int userId = Constants.Security.SuperUserId, bool raiseEvents = true);
|
||||
|
||||
/// <summary>
|
||||
/// Saves documents.
|
||||
/// </summary>
|
||||
// TODO: why only 1 result not 1 per content?!
|
||||
OperationResult Save(IEnumerable<IContent> contents, int userId = ConstantsCore.Security.SuperUserId, bool raiseEvents = true);
|
||||
OperationResult Save(IEnumerable<IContent> contents, int userId = Constants.Security.SuperUserId, bool raiseEvents = true);
|
||||
|
||||
/// <summary>
|
||||
/// Deletes a document.
|
||||
@@ -253,7 +253,7 @@ namespace Umbraco.Core.Services
|
||||
/// <para>This method will also delete associated media files, child content and possibly associated domains.</para>
|
||||
/// <para>This method entirely clears the content from the database.</para>
|
||||
/// </remarks>
|
||||
OperationResult Delete(IContent content, int userId = ConstantsCore.Security.SuperUserId);
|
||||
OperationResult Delete(IContent content, int userId = Constants.Security.SuperUserId);
|
||||
|
||||
/// <summary>
|
||||
/// Deletes all documents of a given document type.
|
||||
@@ -262,7 +262,7 @@ namespace Umbraco.Core.Services
|
||||
/// <para>All non-deleted descendants of the deleted documents are moved to the recycle bin.</para>
|
||||
/// <para>This operation is potentially dangerous and expensive.</para>
|
||||
/// </remarks>
|
||||
void DeleteOfType(int documentTypeId, int userId = ConstantsCore.Security.SuperUserId);
|
||||
void DeleteOfType(int documentTypeId, int userId = Constants.Security.SuperUserId);
|
||||
|
||||
/// <summary>
|
||||
/// Deletes all documents of given document types.
|
||||
@@ -271,17 +271,17 @@ namespace Umbraco.Core.Services
|
||||
/// <para>All non-deleted descendants of the deleted documents are moved to the recycle bin.</para>
|
||||
/// <para>This operation is potentially dangerous and expensive.</para>
|
||||
/// </remarks>
|
||||
void DeleteOfTypes(IEnumerable<int> contentTypeIds, int userId = ConstantsCore.Security.SuperUserId);
|
||||
void DeleteOfTypes(IEnumerable<int> contentTypeIds, int userId = Constants.Security.SuperUserId);
|
||||
|
||||
/// <summary>
|
||||
/// Deletes versions of a document prior to a given date.
|
||||
/// </summary>
|
||||
void DeleteVersions(int id, DateTime date, int userId = ConstantsCore.Security.SuperUserId);
|
||||
void DeleteVersions(int id, DateTime date, int userId = Constants.Security.SuperUserId);
|
||||
|
||||
/// <summary>
|
||||
/// Deletes a version of a document.
|
||||
/// </summary>
|
||||
void DeleteVersion(int id, int versionId, bool deletePriorVersions, int userId = ConstantsCore.Security.SuperUserId);
|
||||
void DeleteVersion(int id, int versionId, bool deletePriorVersions, int userId = Constants.Security.SuperUserId);
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -290,7 +290,7 @@ namespace Umbraco.Core.Services
|
||||
/// <summary>
|
||||
/// Moves a document under a new parent.
|
||||
/// </summary>
|
||||
void Move(IContent content, int parentId, int userId = ConstantsCore.Security.SuperUserId);
|
||||
void Move(IContent content, int parentId, int userId = Constants.Security.SuperUserId);
|
||||
|
||||
/// <summary>
|
||||
/// Copies a document.
|
||||
@@ -298,7 +298,7 @@ namespace Umbraco.Core.Services
|
||||
/// <remarks>
|
||||
/// <para>Recursively copies all children.</para>
|
||||
/// </remarks>
|
||||
IContent Copy(IContent content, int parentId, bool relateToOriginal, int userId = ConstantsCore.Security.SuperUserId);
|
||||
IContent Copy(IContent content, int parentId, bool relateToOriginal, int userId = Constants.Security.SuperUserId);
|
||||
|
||||
/// <summary>
|
||||
/// Copies a document.
|
||||
@@ -306,12 +306,12 @@ namespace Umbraco.Core.Services
|
||||
/// <remarks>
|
||||
/// <para>Optionally recursively copies all children.</para>
|
||||
/// </remarks>
|
||||
IContent Copy(IContent content, int parentId, bool relateToOriginal, bool recursive, int userId = ConstantsCore.Security.SuperUserId);
|
||||
IContent Copy(IContent content, int parentId, bool relateToOriginal, bool recursive, int userId = Constants.Security.SuperUserId);
|
||||
|
||||
/// <summary>
|
||||
/// Moves a document to the recycle bin.
|
||||
/// </summary>
|
||||
OperationResult MoveToRecycleBin(IContent content, int userId = ConstantsCore.Security.SuperUserId);
|
||||
OperationResult MoveToRecycleBin(IContent content, int userId = Constants.Security.SuperUserId);
|
||||
|
||||
/// <summary>
|
||||
/// Empties the recycle bin.
|
||||
@@ -324,17 +324,17 @@ namespace Umbraco.Core.Services
|
||||
/// Empties the Recycle Bin by deleting all <see cref="IContent"/> that resides in the bin
|
||||
/// </summary>
|
||||
/// <param name="userId">Optional Id of the User emptying the Recycle Bin</param>
|
||||
OperationResult EmptyRecycleBin(int userId = ConstantsCore.Security.SuperUserId);
|
||||
OperationResult EmptyRecycleBin(int userId = Constants.Security.SuperUserId);
|
||||
|
||||
/// <summary>
|
||||
/// Sorts documents.
|
||||
/// </summary>
|
||||
OperationResult Sort(IEnumerable<IContent> items, int userId = ConstantsCore.Security.SuperUserId, bool raiseEvents = true);
|
||||
OperationResult Sort(IEnumerable<IContent> items, int userId = Constants.Security.SuperUserId, bool raiseEvents = true);
|
||||
|
||||
/// <summary>
|
||||
/// Sorts documents.
|
||||
/// </summary>
|
||||
OperationResult Sort(IEnumerable<int> ids, int userId = ConstantsCore.Security.SuperUserId, bool raiseEvents = true);
|
||||
OperationResult Sort(IEnumerable<int> ids, int userId = Constants.Security.SuperUserId, bool raiseEvents = true);
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -354,7 +354,7 @@ namespace Umbraco.Core.Services
|
||||
/// <param name="culture">The culture to publish.</param>
|
||||
/// <param name="userId">The identifier of the user performing the action.</param>
|
||||
/// <param name="raiseEvents">A value indicating whether to raise events.</param>
|
||||
PublishResult SaveAndPublish(IContent content, string culture = "*", int userId = ConstantsCore.Security.SuperUserId, bool raiseEvents = true);
|
||||
PublishResult SaveAndPublish(IContent content, string culture = "*", int userId = Constants.Security.SuperUserId, bool raiseEvents = true);
|
||||
|
||||
/// <summary>
|
||||
/// Saves and publishes a document.
|
||||
@@ -368,7 +368,7 @@ namespace Umbraco.Core.Services
|
||||
/// <param name="cultures">The cultures to publish.</param>
|
||||
/// <param name="userId">The identifier of the user performing the action.</param>
|
||||
/// <param name="raiseEvents">A value indicating whether to raise events.</param>
|
||||
PublishResult SaveAndPublish(IContent content, string[] cultures, int userId = ConstantsCore.Security.SuperUserId, bool raiseEvents = true);
|
||||
PublishResult SaveAndPublish(IContent content, string[] cultures, int userId = Constants.Security.SuperUserId, bool raiseEvents = true);
|
||||
|
||||
/// <summary>
|
||||
/// Saves and publishes a document branch.
|
||||
@@ -384,7 +384,7 @@ namespace Umbraco.Core.Services
|
||||
/// only those documents that are already published, are republished. When <c>true</c>, all documents are
|
||||
/// published. The root of the branch is always published, regardless of <paramref name="force"/>.</para>
|
||||
/// </remarks>
|
||||
IEnumerable<PublishResult> SaveAndPublishBranch(IContent content, bool force, string culture = "*", int userId = ConstantsCore.Security.SuperUserId);
|
||||
IEnumerable<PublishResult> SaveAndPublishBranch(IContent content, bool force, string culture = "*", int userId = Constants.Security.SuperUserId);
|
||||
|
||||
/// <summary>
|
||||
/// Saves and publishes a document branch.
|
||||
@@ -398,7 +398,7 @@ namespace Umbraco.Core.Services
|
||||
/// only those documents that are already published, are republished. When <c>true</c>, all documents are
|
||||
/// published. The root of the branch is always published, regardless of <paramref name="force"/>.</para>
|
||||
/// </remarks>
|
||||
IEnumerable<PublishResult> SaveAndPublishBranch(IContent content, bool force, string[] cultures, int userId = ConstantsCore.Security.SuperUserId);
|
||||
IEnumerable<PublishResult> SaveAndPublishBranch(IContent content, bool force, string[] cultures, int userId = Constants.Security.SuperUserId);
|
||||
|
||||
///// <summary>
|
||||
///// Saves and publishes a document branch.
|
||||
@@ -435,7 +435,7 @@ namespace Umbraco.Core.Services
|
||||
/// <para>If the content type is variant, then culture can be either '*' or an actual culture, but neither null nor
|
||||
/// empty. If the content type is invariant, then culture can be either '*' or null or empty.</para>
|
||||
/// </remarks>
|
||||
PublishResult Unpublish(IContent content, string culture = "*", int userId = ConstantsCore.Security.SuperUserId);
|
||||
PublishResult Unpublish(IContent content, string culture = "*", int userId = Constants.Security.SuperUserId);
|
||||
|
||||
/// <summary>
|
||||
/// Gets a value indicating whether a document is path-publishable.
|
||||
@@ -452,7 +452,7 @@ namespace Umbraco.Core.Services
|
||||
/// <summary>
|
||||
/// Saves a document and raises the "sent to publication" events.
|
||||
/// </summary>
|
||||
bool SendToPublication(IContent content, int userId = ConstantsCore.Security.SuperUserId);
|
||||
bool SendToPublication(IContent content, int userId = Constants.Security.SuperUserId);
|
||||
|
||||
/// <summary>
|
||||
/// Publishes and unpublishes scheduled documents.
|
||||
@@ -487,27 +487,27 @@ namespace Umbraco.Core.Services
|
||||
/// <summary>
|
||||
/// Creates a document.
|
||||
/// </summary>
|
||||
IContent Create(string name, Guid parentId, string documentTypeAlias, int userId = ConstantsCore.Security.SuperUserId);
|
||||
IContent Create(string name, Guid parentId, string documentTypeAlias, int userId = Constants.Security.SuperUserId);
|
||||
|
||||
/// <summary>
|
||||
/// Creates a document.
|
||||
/// </summary>
|
||||
IContent Create(string name, int parentId, string documentTypeAlias, int userId = ConstantsCore.Security.SuperUserId);
|
||||
IContent Create(string name, int parentId, string documentTypeAlias, int userId = Constants.Security.SuperUserId);
|
||||
|
||||
/// <summary>
|
||||
/// Creates a document.
|
||||
/// </summary>
|
||||
IContent Create(string name, IContent parent, string documentTypeAlias, int userId = ConstantsCore.Security.SuperUserId);
|
||||
IContent Create(string name, IContent parent, string documentTypeAlias, int userId = Constants.Security.SuperUserId);
|
||||
|
||||
/// <summary>
|
||||
/// Creates and saves a document.
|
||||
/// </summary>
|
||||
IContent CreateAndSave(string name, int parentId, string contentTypeAlias, int userId = ConstantsCore.Security.SuperUserId);
|
||||
IContent CreateAndSave(string name, int parentId, string contentTypeAlias, int userId = Constants.Security.SuperUserId);
|
||||
|
||||
/// <summary>
|
||||
/// Creates and saves a document.
|
||||
/// </summary>
|
||||
IContent CreateAndSave(string name, IContent parent, string contentTypeAlias, int userId = ConstantsCore.Security.SuperUserId);
|
||||
IContent CreateAndSave(string name, IContent parent, string contentTypeAlias, int userId = Constants.Security.SuperUserId);
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -523,7 +523,7 @@ namespace Umbraco.Core.Services
|
||||
/// <remarks>
|
||||
/// <para>When no culture is specified, all cultures are rolled back.</para>
|
||||
/// </remarks>
|
||||
OperationResult Rollback(int id, int versionId, string culture = "*", int userId = ConstantsCore.Security.SuperUserId);
|
||||
OperationResult Rollback(int id, int versionId, string culture = "*", int userId = Constants.Security.SuperUserId);
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
@@ -48,11 +48,11 @@ namespace Umbraco.Core.Services
|
||||
IEnumerable<TItem> GetChildren(int id);
|
||||
bool HasChildren(int id);
|
||||
|
||||
void Save(TItem item, int userId = ConstantsCore.Security.SuperUserId);
|
||||
void Save(IEnumerable<TItem> items, int userId = ConstantsCore.Security.SuperUserId);
|
||||
void Save(TItem item, int userId = Constants.Security.SuperUserId);
|
||||
void Save(IEnumerable<TItem> items, int userId = Constants.Security.SuperUserId);
|
||||
|
||||
void Delete(TItem item, int userId = ConstantsCore.Security.SuperUserId);
|
||||
void Delete(IEnumerable<TItem> item, int userId = ConstantsCore.Security.SuperUserId);
|
||||
void Delete(TItem item, int userId = Constants.Security.SuperUserId);
|
||||
void Delete(IEnumerable<TItem> item, int userId = Constants.Security.SuperUserId);
|
||||
|
||||
|
||||
Attempt<string[]> ValidateComposition(TItem compo);
|
||||
@@ -64,15 +64,15 @@ namespace Umbraco.Core.Services
|
||||
/// <returns></returns>
|
||||
bool HasContainerInPath(string contentPath);
|
||||
|
||||
Attempt<OperationResult<OperationResultType, EntityContainer>> CreateContainer(int parentContainerId, string name, int userId = ConstantsCore.Security.SuperUserId);
|
||||
Attempt<OperationResult> SaveContainer(EntityContainer container, int userId = ConstantsCore.Security.SuperUserId);
|
||||
Attempt<OperationResult<OperationResultType, EntityContainer>> CreateContainer(int parentContainerId, string name, int userId = Constants.Security.SuperUserId);
|
||||
Attempt<OperationResult> SaveContainer(EntityContainer container, int userId = Constants.Security.SuperUserId);
|
||||
EntityContainer GetContainer(int containerId);
|
||||
EntityContainer GetContainer(Guid containerId);
|
||||
IEnumerable<EntityContainer> GetContainers(int[] containerIds);
|
||||
IEnumerable<EntityContainer> GetContainers(TItem contentType);
|
||||
IEnumerable<EntityContainer> GetContainers(string folderName, int level);
|
||||
Attempt<OperationResult> DeleteContainer(int containerId, int userId = ConstantsCore.Security.SuperUserId);
|
||||
Attempt<OperationResult<OperationResultType, EntityContainer>> RenameContainer(int id, string name, int userId = ConstantsCore.Security.SuperUserId);
|
||||
Attempt<OperationResult> DeleteContainer(int containerId, int userId = Constants.Security.SuperUserId);
|
||||
Attempt<OperationResult<OperationResultType, EntityContainer>> RenameContainer(int id, string name, int userId = Constants.Security.SuperUserId);
|
||||
|
||||
Attempt<OperationResult<MoveOperationStatusType>> Move(TItem moving, int containerId);
|
||||
Attempt<OperationResult<MoveOperationStatusType, TItem>> Copy(TItem copying, int containerId);
|
||||
|
||||
@@ -17,15 +17,15 @@ namespace Umbraco.Core.Services
|
||||
/// <returns></returns>
|
||||
IReadOnlyDictionary<Udi, IEnumerable<string>> GetReferences(int id);
|
||||
|
||||
Attempt<OperationResult<OperationResultType, EntityContainer>> CreateContainer(int parentId, string name, int userId = ConstantsCore.Security.SuperUserId);
|
||||
Attempt<OperationResult> SaveContainer(EntityContainer container, int userId = ConstantsCore.Security.SuperUserId);
|
||||
Attempt<OperationResult<OperationResultType, EntityContainer>> CreateContainer(int parentId, string name, int userId = Constants.Security.SuperUserId);
|
||||
Attempt<OperationResult> SaveContainer(EntityContainer container, int userId = Constants.Security.SuperUserId);
|
||||
EntityContainer GetContainer(int containerId);
|
||||
EntityContainer GetContainer(Guid containerId);
|
||||
IEnumerable<EntityContainer> GetContainers(string folderName, int level);
|
||||
IEnumerable<EntityContainer> GetContainers(IDataType dataType);
|
||||
IEnumerable<EntityContainer> GetContainers(int[] containerIds);
|
||||
Attempt<OperationResult> DeleteContainer(int containerId, int userId = ConstantsCore.Security.SuperUserId);
|
||||
Attempt<OperationResult<OperationResultType, EntityContainer>> RenameContainer(int id, string name, int userId = ConstantsCore.Security.SuperUserId);
|
||||
Attempt<OperationResult> DeleteContainer(int containerId, int userId = Constants.Security.SuperUserId);
|
||||
Attempt<OperationResult<OperationResultType, EntityContainer>> RenameContainer(int id, string name, int userId = Constants.Security.SuperUserId);
|
||||
|
||||
/// <summary>
|
||||
/// Gets a <see cref="IDataType"/> by its Name
|
||||
@@ -60,14 +60,14 @@ namespace Umbraco.Core.Services
|
||||
/// </summary>
|
||||
/// <param name="dataType"><see cref="IDataType"/> to save</param>
|
||||
/// <param name="userId">Id of the user issuing the save</param>
|
||||
void Save(IDataType dataType, int userId = ConstantsCore.Security.SuperUserId);
|
||||
void Save(IDataType dataType, int userId = Constants.Security.SuperUserId);
|
||||
|
||||
/// <summary>
|
||||
/// Saves a collection of <see cref="IDataType"/>
|
||||
/// </summary>
|
||||
/// <param name="dataTypeDefinitions"><see cref="IDataType"/> to save</param>
|
||||
/// <param name="userId">Id of the user issuing the save</param>
|
||||
void Save(IEnumerable<IDataType> dataTypeDefinitions, int userId = ConstantsCore.Security.SuperUserId);
|
||||
void Save(IEnumerable<IDataType> dataTypeDefinitions, int userId = Constants.Security.SuperUserId);
|
||||
|
||||
/// <summary>
|
||||
/// Saves a collection of <see cref="IDataType"/>
|
||||
@@ -86,7 +86,7 @@ namespace Umbraco.Core.Services
|
||||
/// </remarks>
|
||||
/// <param name="dataType"><see cref="IDataType"/> to delete</param>
|
||||
/// <param name="userId">Id of the user issuing the deletion</param>
|
||||
void Delete(IDataType dataType, int userId = ConstantsCore.Security.SuperUserId);
|
||||
void Delete(IDataType dataType, int userId = Constants.Security.SuperUserId);
|
||||
|
||||
/// <summary>
|
||||
/// Gets a <see cref="IDataType"/> by its control Id
|
||||
|
||||
@@ -18,12 +18,12 @@ namespace Umbraco.Core.Services
|
||||
IPartialView GetPartialView(string path);
|
||||
IPartialView GetPartialViewMacro(string path);
|
||||
IEnumerable<IPartialView> GetPartialViewMacros(params string[] names);
|
||||
Attempt<IPartialView> CreatePartialView(IPartialView partialView, string snippetName = null, int userId = ConstantsCore.Security.SuperUserId);
|
||||
Attempt<IPartialView> CreatePartialViewMacro(IPartialView partialView, string snippetName = null, int userId = ConstantsCore.Security.SuperUserId);
|
||||
bool DeletePartialView(string path, int userId = ConstantsCore.Security.SuperUserId);
|
||||
bool DeletePartialViewMacro(string path, int userId = ConstantsCore.Security.SuperUserId);
|
||||
Attempt<IPartialView> SavePartialView(IPartialView partialView, int userId = ConstantsCore.Security.SuperUserId);
|
||||
Attempt<IPartialView> SavePartialViewMacro(IPartialView partialView, int userId = ConstantsCore.Security.SuperUserId);
|
||||
Attempt<IPartialView> CreatePartialView(IPartialView partialView, string snippetName = null, int userId = Constants.Security.SuperUserId);
|
||||
Attempt<IPartialView> CreatePartialViewMacro(IPartialView partialView, string snippetName = null, int userId = Constants.Security.SuperUserId);
|
||||
bool DeletePartialView(string path, int userId = Constants.Security.SuperUserId);
|
||||
bool DeletePartialViewMacro(string path, int userId = Constants.Security.SuperUserId);
|
||||
Attempt<IPartialView> SavePartialView(IPartialView partialView, int userId = Constants.Security.SuperUserId);
|
||||
Attempt<IPartialView> SavePartialViewMacro(IPartialView partialView, int userId = Constants.Security.SuperUserId);
|
||||
bool ValidatePartialView(PartialView partialView);
|
||||
bool ValidatePartialViewMacro(PartialView partialView);
|
||||
|
||||
@@ -45,14 +45,14 @@ namespace Umbraco.Core.Services
|
||||
/// </summary>
|
||||
/// <param name="stylesheet"><see cref="Stylesheet"/> to save</param>
|
||||
/// <param name="userId">Optional id of the user saving the stylesheet</param>
|
||||
void SaveStylesheet(Stylesheet stylesheet, int userId = ConstantsCore.Security.SuperUserId);
|
||||
void SaveStylesheet(Stylesheet stylesheet, int userId = Constants.Security.SuperUserId);
|
||||
|
||||
/// <summary>
|
||||
/// Deletes a stylesheet by its name
|
||||
/// </summary>
|
||||
/// <param name="path">Name incl. extension of the Stylesheet to delete</param>
|
||||
/// <param name="userId">Optional id of the user deleting the stylesheet</param>
|
||||
void DeleteStylesheet(string path, int userId = ConstantsCore.Security.SuperUserId);
|
||||
void DeleteStylesheet(string path, int userId = Constants.Security.SuperUserId);
|
||||
|
||||
/// <summary>
|
||||
/// Validates a <see cref="Stylesheet"/>
|
||||
@@ -79,14 +79,14 @@ namespace Umbraco.Core.Services
|
||||
/// </summary>
|
||||
/// <param name="script"><see cref="Script"/> to save</param>
|
||||
/// <param name="userId">Optional id of the user saving the script</param>
|
||||
void SaveScript(Script script, int userId = ConstantsCore.Security.SuperUserId);
|
||||
void SaveScript(Script script, int userId = Constants.Security.SuperUserId);
|
||||
|
||||
/// <summary>
|
||||
/// Deletes a script by its name
|
||||
/// </summary>
|
||||
/// <param name="path">Name incl. extension of the Script to delete</param>
|
||||
/// <param name="userId">Optional id of the user deleting the script</param>
|
||||
void DeleteScript(string path, int userId = ConstantsCore.Security.SuperUserId);
|
||||
void DeleteScript(string path, int userId = Constants.Security.SuperUserId);
|
||||
|
||||
/// <summary>
|
||||
/// Validates a <see cref="Script"/>
|
||||
@@ -187,7 +187,7 @@ namespace Umbraco.Core.Services
|
||||
/// </summary>
|
||||
/// <param name="template"><see cref="ITemplate"/> to save</param>
|
||||
/// <param name="userId">Optional id of the user saving the template</param>
|
||||
void SaveTemplate(ITemplate template, int userId = ConstantsCore.Security.SuperUserId);
|
||||
void SaveTemplate(ITemplate template, int userId = Constants.Security.SuperUserId);
|
||||
|
||||
/// <summary>
|
||||
/// Creates a template for a content type
|
||||
@@ -198,16 +198,16 @@ namespace Umbraco.Core.Services
|
||||
/// <returns>
|
||||
/// The template created
|
||||
/// </returns>
|
||||
Attempt<OperationResult<OperationResultType, ITemplate>> CreateTemplateForContentType(string contentTypeAlias, string contentTypeName, int userId = ConstantsCore.Security.SuperUserId);
|
||||
Attempt<OperationResult<OperationResultType, ITemplate>> CreateTemplateForContentType(string contentTypeAlias, string contentTypeName, int userId = Constants.Security.SuperUserId);
|
||||
|
||||
ITemplate CreateTemplateWithIdentity(string name, string alias, string content, ITemplate masterTemplate = null, int userId = ConstantsCore.Security.SuperUserId);
|
||||
ITemplate CreateTemplateWithIdentity(string name, string alias, string content, ITemplate masterTemplate = null, int userId = Constants.Security.SuperUserId);
|
||||
|
||||
/// <summary>
|
||||
/// Deletes a template by its alias
|
||||
/// </summary>
|
||||
/// <param name="alias">Alias of the <see cref="ITemplate"/> to delete</param>
|
||||
/// <param name="userId">Optional id of the user deleting the template</param>
|
||||
void DeleteTemplate(string alias, int userId = ConstantsCore.Security.SuperUserId);
|
||||
void DeleteTemplate(string alias, int userId = Constants.Security.SuperUserId);
|
||||
|
||||
/// <summary>
|
||||
/// Validates a <see cref="ITemplate"/>
|
||||
@@ -221,7 +221,7 @@ namespace Umbraco.Core.Services
|
||||
/// </summary>
|
||||
/// <param name="templates">List of <see cref="Template"/> to save</param>
|
||||
/// <param name="userId">Optional id of the user</param>
|
||||
void SaveTemplate(IEnumerable<ITemplate> templates, int userId = ConstantsCore.Security.SuperUserId);
|
||||
void SaveTemplate(IEnumerable<ITemplate> templates, int userId = Constants.Security.SuperUserId);
|
||||
|
||||
/// <summary>
|
||||
/// Gets the content of a template as a stream.
|
||||
|
||||
@@ -86,7 +86,7 @@ namespace Umbraco.Core.Services
|
||||
/// </summary>
|
||||
/// <param name="dictionaryItem"><see cref="IDictionaryItem"/> to save</param>
|
||||
/// <param name="userId">Optional id of the user saving the dictionary item</param>
|
||||
void Save(IDictionaryItem dictionaryItem, int userId = ConstantsCore.Security.SuperUserId);
|
||||
void Save(IDictionaryItem dictionaryItem, int userId = Constants.Security.SuperUserId);
|
||||
|
||||
/// <summary>
|
||||
/// Deletes a <see cref="IDictionaryItem"/> object and its related translations
|
||||
@@ -94,7 +94,7 @@ namespace Umbraco.Core.Services
|
||||
/// </summary>
|
||||
/// <param name="dictionaryItem"><see cref="IDictionaryItem"/> to delete</param>
|
||||
/// <param name="userId">Optional id of the user deleting the dictionary item</param>
|
||||
void Delete(IDictionaryItem dictionaryItem, int userId = ConstantsCore.Security.SuperUserId);
|
||||
void Delete(IDictionaryItem dictionaryItem, int userId = Constants.Security.SuperUserId);
|
||||
|
||||
/// <summary>
|
||||
/// Gets a <see cref="ILanguage"/> by its id
|
||||
@@ -153,14 +153,14 @@ namespace Umbraco.Core.Services
|
||||
/// </summary>
|
||||
/// <param name="language"><see cref="ILanguage"/> to save</param>
|
||||
/// <param name="userId">Optional id of the user saving the language</param>
|
||||
void Save(ILanguage language, int userId = ConstantsCore.Security.SuperUserId);
|
||||
void Save(ILanguage language, int userId = Constants.Security.SuperUserId);
|
||||
|
||||
/// <summary>
|
||||
/// Deletes a <see cref="ILanguage"/> by removing it and its usages from the db
|
||||
/// </summary>
|
||||
/// <param name="language"><see cref="ILanguage"/> to delete</param>
|
||||
/// <param name="userId">Optional id of the user deleting the language</param>
|
||||
void Delete(ILanguage language, int userId = ConstantsCore.Security.SuperUserId);
|
||||
void Delete(ILanguage language, int userId = Constants.Security.SuperUserId);
|
||||
|
||||
/// <summary>
|
||||
/// Gets the full dictionary key map.
|
||||
|
||||
@@ -39,14 +39,14 @@ namespace Umbraco.Core.Services
|
||||
/// </summary>
|
||||
/// <param name="macro"><see cref="IMacro"/> to delete</param>
|
||||
/// <param name="userId">Optional id of the user deleting the macro</param>
|
||||
void Delete(IMacro macro, int userId = ConstantsCore.Security.SuperUserId);
|
||||
void Delete(IMacro macro, int userId = Constants.Security.SuperUserId);
|
||||
|
||||
/// <summary>
|
||||
/// Saves an <see cref="IMacro"/>
|
||||
/// </summary>
|
||||
/// <param name="macro"><see cref="IMacro"/> to save</param>
|
||||
/// <param name="userId">Optional id of the user saving the macro</param>
|
||||
void Save(IMacro macro, int userId = ConstantsCore.Security.SuperUserId);
|
||||
void Save(IMacro macro, int userId = Constants.Security.SuperUserId);
|
||||
|
||||
///// <summary>
|
||||
///// Gets a list all available <see cref="IMacroPropertyType"/> plugins
|
||||
|
||||
@@ -37,7 +37,7 @@ namespace Umbraco.Core.Services
|
||||
/// <param name="mediaTypeAlias">Alias of the <see cref="IMediaType"/></param>
|
||||
/// <param name="userId">Optional id of the user creating the media item</param>
|
||||
/// <returns><see cref="IMedia"/></returns>
|
||||
IMedia CreateMedia(string name, Guid parentId, string mediaTypeAlias, int userId = ConstantsCore.Security.SuperUserId);
|
||||
IMedia CreateMedia(string name, Guid parentId, string mediaTypeAlias, int userId = Constants.Security.SuperUserId);
|
||||
|
||||
/// <summary>
|
||||
/// Creates an <see cref="IMedia"/> object using the alias of the <see cref="IMediaType"/>
|
||||
@@ -53,7 +53,7 @@ namespace Umbraco.Core.Services
|
||||
/// <param name="mediaTypeAlias">Alias of the <see cref="IMediaType"/></param>
|
||||
/// <param name="userId">Optional id of the user creating the media item</param>
|
||||
/// <returns><see cref="IMedia"/></returns>
|
||||
IMedia CreateMedia(string name, int parentId, string mediaTypeAlias, int userId = ConstantsCore.Security.SuperUserId);
|
||||
IMedia CreateMedia(string name, int parentId, string mediaTypeAlias, int userId = Constants.Security.SuperUserId);
|
||||
|
||||
/// <summary>
|
||||
/// Creates an <see cref="IMedia"/> object using the alias of the <see cref="IMediaType"/>
|
||||
@@ -69,7 +69,7 @@ namespace Umbraco.Core.Services
|
||||
/// <param name="mediaTypeAlias">Alias of the <see cref="IMediaType"/></param>
|
||||
/// <param name="userId">Optional id of the user creating the media item</param>
|
||||
/// <returns><see cref="IMedia"/></returns>
|
||||
IMedia CreateMedia(string name, IMedia parent, string mediaTypeAlias, int userId = ConstantsCore.Security.SuperUserId);
|
||||
IMedia CreateMedia(string name, IMedia parent, string mediaTypeAlias, int userId = Constants.Security.SuperUserId);
|
||||
|
||||
/// <summary>
|
||||
/// Gets an <see cref="IMedia"/> object by Id
|
||||
@@ -150,14 +150,14 @@ namespace Umbraco.Core.Services
|
||||
/// <param name="parentId">Id of the Media's new Parent</param>
|
||||
/// <param name="userId">Id of the User moving the Media</param>
|
||||
/// <returns>True if moving succeeded, otherwise False</returns>
|
||||
Attempt<OperationResult> Move(IMedia media, int parentId, int userId = ConstantsCore.Security.SuperUserId);
|
||||
Attempt<OperationResult> Move(IMedia media, int parentId, int userId = Constants.Security.SuperUserId);
|
||||
|
||||
/// <summary>
|
||||
/// Deletes an <see cref="IMedia"/> object by moving it to the Recycle Bin
|
||||
/// </summary>
|
||||
/// <param name="media">The <see cref="IMedia"/> to delete</param>
|
||||
/// <param name="userId">Id of the User deleting the Media</param>
|
||||
Attempt<OperationResult> MoveToRecycleBin(IMedia media, int userId = ConstantsCore.Security.SuperUserId);
|
||||
Attempt<OperationResult> MoveToRecycleBin(IMedia media, int userId = Constants.Security.SuperUserId);
|
||||
|
||||
/// <summary>
|
||||
/// Empties the Recycle Bin by deleting all <see cref="IMedia"/> that resides in the bin
|
||||
@@ -170,7 +170,7 @@ namespace Umbraco.Core.Services
|
||||
/// Empties the Recycle Bin by deleting all <see cref="IMedia"/> that resides in the bin
|
||||
/// </summary>
|
||||
/// <param name="userId">Optional Id of the User emptying the Recycle Bin</param>
|
||||
OperationResult EmptyRecycleBin(int userId = ConstantsCore.Security.SuperUserId);
|
||||
OperationResult EmptyRecycleBin(int userId = Constants.Security.SuperUserId);
|
||||
|
||||
/// <summary>
|
||||
/// Deletes all media of specified type. All children of deleted media is moved to Recycle Bin.
|
||||
@@ -178,7 +178,7 @@ namespace Umbraco.Core.Services
|
||||
/// <remarks>This needs extra care and attention as its potentially a dangerous and extensive operation</remarks>
|
||||
/// <param name="mediaTypeId">Id of the <see cref="IMediaType"/></param>
|
||||
/// <param name="userId">Optional Id of the user deleting Media</param>
|
||||
void DeleteMediaOfType(int mediaTypeId, int userId = ConstantsCore.Security.SuperUserId);
|
||||
void DeleteMediaOfType(int mediaTypeId, int userId = Constants.Security.SuperUserId);
|
||||
|
||||
/// <summary>
|
||||
/// Deletes all media of the specified types. All Descendants of deleted media that is not of these types is moved to Recycle Bin.
|
||||
@@ -186,7 +186,7 @@ namespace Umbraco.Core.Services
|
||||
/// <remarks>This needs extra care and attention as its potentially a dangerous and extensive operation</remarks>
|
||||
/// <param name="mediaTypeIds">Ids of the <see cref="IMediaType"/>s</param>
|
||||
/// <param name="userId">Optional Id of the user issuing the delete operation</param>
|
||||
void DeleteMediaOfTypes(IEnumerable<int> mediaTypeIds, int userId = ConstantsCore.Security.SuperUserId);
|
||||
void DeleteMediaOfTypes(IEnumerable<int> mediaTypeIds, int userId = Constants.Security.SuperUserId);
|
||||
|
||||
/// <summary>
|
||||
/// Permanently deletes an <see cref="IMedia"/> object
|
||||
@@ -197,7 +197,7 @@ namespace Umbraco.Core.Services
|
||||
/// </remarks>
|
||||
/// <param name="media">The <see cref="IMedia"/> to delete</param>
|
||||
/// <param name="userId">Id of the User deleting the Media</param>
|
||||
Attempt<OperationResult> Delete(IMedia media, int userId = ConstantsCore.Security.SuperUserId);
|
||||
Attempt<OperationResult> Delete(IMedia media, int userId = Constants.Security.SuperUserId);
|
||||
|
||||
/// <summary>
|
||||
/// Saves a single <see cref="IMedia"/> object
|
||||
@@ -205,7 +205,7 @@ namespace Umbraco.Core.Services
|
||||
/// <param name="media">The <see cref="IMedia"/> to save</param>
|
||||
/// <param name="userId">Id of the User saving the Media</param>
|
||||
/// <param name="raiseEvents">Optional boolean indicating whether or not to raise events.</param>
|
||||
Attempt<OperationResult> Save(IMedia media, int userId = ConstantsCore.Security.SuperUserId, bool raiseEvents = true);
|
||||
Attempt<OperationResult> Save(IMedia media, int userId = Constants.Security.SuperUserId, bool raiseEvents = true);
|
||||
|
||||
/// <summary>
|
||||
/// Saves a collection of <see cref="IMedia"/> objects
|
||||
@@ -213,7 +213,7 @@ namespace Umbraco.Core.Services
|
||||
/// <param name="medias">Collection of <see cref="IMedia"/> to save</param>
|
||||
/// <param name="userId">Id of the User saving the Media</param>
|
||||
/// <param name="raiseEvents">Optional boolean indicating whether or not to raise events.</param>
|
||||
Attempt<OperationResult> Save(IEnumerable<IMedia> medias, int userId = ConstantsCore.Security.SuperUserId, bool raiseEvents = true);
|
||||
Attempt<OperationResult> Save(IEnumerable<IMedia> medias, int userId = Constants.Security.SuperUserId, bool raiseEvents = true);
|
||||
|
||||
/// <summary>
|
||||
/// Gets an <see cref="IMedia"/> object by its 'UniqueId'
|
||||
@@ -256,7 +256,7 @@ namespace Umbraco.Core.Services
|
||||
/// <param name="id">Id of the <see cref="IMedia"/> object to delete versions from</param>
|
||||
/// <param name="versionDate">Latest version date</param>
|
||||
/// <param name="userId">Optional Id of the User deleting versions of a Content object</param>
|
||||
void DeleteVersions(int id, DateTime versionDate, int userId = ConstantsCore.Security.SuperUserId);
|
||||
void DeleteVersions(int id, DateTime versionDate, int userId = Constants.Security.SuperUserId);
|
||||
|
||||
/// <summary>
|
||||
/// Permanently deletes specific version(s) from an <see cref="IMedia"/> object.
|
||||
@@ -265,7 +265,7 @@ namespace Umbraco.Core.Services
|
||||
/// <param name="versionId">Id of the version to delete</param>
|
||||
/// <param name="deletePriorVersions">Boolean indicating whether to delete versions prior to the versionId</param>
|
||||
/// <param name="userId">Optional Id of the User deleting versions of a Content object</param>
|
||||
void DeleteVersion(int id, int versionId, bool deletePriorVersions, int userId = ConstantsCore.Security.SuperUserId);
|
||||
void DeleteVersion(int id, int versionId, bool deletePriorVersions, int userId = Constants.Security.SuperUserId);
|
||||
|
||||
/// <summary>
|
||||
/// Gets an <see cref="IMedia"/> object from the path stored in the 'umbracoFile' property.
|
||||
@@ -310,7 +310,7 @@ namespace Umbraco.Core.Services
|
||||
/// <param name="userId"></param>
|
||||
/// <param name="raiseEvents"></param>
|
||||
/// <returns>True if sorting succeeded, otherwise False</returns>
|
||||
bool Sort(IEnumerable<IMedia> items, int userId = ConstantsCore.Security.SuperUserId, bool raiseEvents = true);
|
||||
bool Sort(IEnumerable<IMedia> items, int userId = Constants.Security.SuperUserId, bool raiseEvents = true);
|
||||
|
||||
/// <summary>
|
||||
/// Creates an <see cref="IMedia"/> object using the alias of the <see cref="IMediaType"/>
|
||||
@@ -325,7 +325,7 @@ namespace Umbraco.Core.Services
|
||||
/// <param name="mediaTypeAlias">Alias of the <see cref="IMediaType"/></param>
|
||||
/// <param name="userId">Optional id of the user creating the media item</param>
|
||||
/// <returns><see cref="IMedia"/></returns>
|
||||
IMedia CreateMediaWithIdentity(string name, IMedia parent, string mediaTypeAlias, int userId = ConstantsCore.Security.SuperUserId);
|
||||
IMedia CreateMediaWithIdentity(string name, IMedia parent, string mediaTypeAlias, int userId = Constants.Security.SuperUserId);
|
||||
|
||||
/// <summary>
|
||||
/// Creates an <see cref="IMedia"/> object using the alias of the <see cref="IMediaType"/>
|
||||
@@ -340,7 +340,7 @@ namespace Umbraco.Core.Services
|
||||
/// <param name="mediaTypeAlias">Alias of the <see cref="IMediaType"/></param>
|
||||
/// <param name="userId">Optional id of the user creating the media item</param>
|
||||
/// <returns><see cref="IMedia"/></returns>
|
||||
IMedia CreateMediaWithIdentity(string name, int parentId, string mediaTypeAlias, int userId = ConstantsCore.Security.SuperUserId);
|
||||
IMedia CreateMediaWithIdentity(string name, int parentId, string mediaTypeAlias, int userId = Constants.Security.SuperUserId);
|
||||
|
||||
/// <summary>
|
||||
/// Gets the content of a media as a stream.
|
||||
|
||||
@@ -27,7 +27,7 @@ namespace Umbraco.Core.Services
|
||||
/// <param name="packageDefinition"></param>
|
||||
/// <param name="packageFile"></param>
|
||||
/// <param name="userId"></param>
|
||||
IEnumerable<string> InstallCompiledPackageFiles(PackageDefinition packageDefinition, FileInfo packageFile, int userId = ConstantsCore.Security.SuperUserId);
|
||||
IEnumerable<string> InstallCompiledPackageFiles(PackageDefinition packageDefinition, FileInfo packageFile, int userId = Constants.Security.SuperUserId);
|
||||
|
||||
/// <summary>
|
||||
/// Installs the data, entities, objects contained in an umbraco package file (zip)
|
||||
@@ -35,7 +35,7 @@ namespace Umbraco.Core.Services
|
||||
/// <param name="packageDefinition"></param>
|
||||
/// <param name="packageFile"></param>
|
||||
/// <param name="userId"></param>
|
||||
InstallationSummary InstallCompiledPackageData(PackageDefinition packageDefinition, FileInfo packageFile, int userId = ConstantsCore.Security.SuperUserId);
|
||||
InstallationSummary InstallCompiledPackageData(PackageDefinition packageDefinition, FileInfo packageFile, int userId = Constants.Security.SuperUserId);
|
||||
|
||||
/// <summary>
|
||||
/// Uninstalls all versions of the package by name
|
||||
@@ -43,7 +43,7 @@ namespace Umbraco.Core.Services
|
||||
/// <param name="packageName"></param>
|
||||
/// <param name="userId"></param>
|
||||
/// <returns></returns>
|
||||
UninstallationSummary UninstallPackage(string packageName, int userId = ConstantsCore.Security.SuperUserId);
|
||||
UninstallationSummary UninstallPackage(string packageName, int userId = Constants.Security.SuperUserId);
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -75,7 +75,7 @@ namespace Umbraco.Core.Services
|
||||
/// <param name="alreadyInstalled">If the package is an upgrade, the original/current PackageDefinition is returned</param>
|
||||
/// <returns></returns>
|
||||
PackageInstallType GetPackageInstallType(string packageName, SemVersion packageVersion, out PackageDefinition alreadyInstalled);
|
||||
void DeleteInstalledPackage(int packageId, int userId = ConstantsCore.Security.SuperUserId);
|
||||
void DeleteInstalledPackage(int packageId, int userId = Constants.Security.SuperUserId);
|
||||
|
||||
/// <summary>
|
||||
/// Persists a package definition to storage
|
||||
@@ -89,7 +89,7 @@ namespace Umbraco.Core.Services
|
||||
|
||||
IEnumerable<PackageDefinition> GetAllCreatedPackages();
|
||||
PackageDefinition GetCreatedPackageById(int id);
|
||||
void DeleteCreatedPackage(int id, int userId = ConstantsCore.Security.SuperUserId);
|
||||
void DeleteCreatedPackage(int id, int userId = Constants.Security.SuperUserId);
|
||||
|
||||
/// <summary>
|
||||
/// Persists a package definition to storage
|
||||
|
||||
@@ -174,7 +174,7 @@ namespace Umbraco.Core.Services
|
||||
else
|
||||
{
|
||||
val = scope.Database.ExecuteScalar<int?>("SELECT id FROM umbracoNode WHERE uniqueId=@id AND (nodeObjectType=@type OR nodeObjectType=@reservation)",
|
||||
new { id = key, type = GetNodeObjectTypeGuid(umbracoObjectType), reservation = ConstantsCore.ObjectTypes.IdReservation });
|
||||
new { id = key, type = GetNodeObjectTypeGuid(umbracoObjectType), reservation = Constants.ObjectTypes.IdReservation });
|
||||
}
|
||||
scope.Complete();
|
||||
}
|
||||
@@ -207,7 +207,7 @@ namespace Umbraco.Core.Services
|
||||
if (guidUdi == null)
|
||||
return Attempt<int>.Fail();
|
||||
|
||||
var umbracoType = Constants.UdiEntityType.ToUmbracoObjectType(guidUdi.EntityType);
|
||||
var umbracoType = UdiEntityTypeHelper.ToUmbracoObjectType(guidUdi.EntityType);
|
||||
return GetIdForKey(guidUdi.Guid, umbracoType);
|
||||
}
|
||||
|
||||
@@ -215,7 +215,7 @@ namespace Umbraco.Core.Services
|
||||
{
|
||||
var keyAttempt = GetKeyForId(id, umbracoObjectType);
|
||||
return keyAttempt
|
||||
? Attempt.Succeed<Udi>(new GuidUdi(Constants.UdiEntityType.FromUmbracoObjectType(umbracoObjectType), keyAttempt.Result))
|
||||
? Attempt.Succeed<Udi>(new GuidUdi(UdiEntityTypeHelper.FromUmbracoObjectType(umbracoObjectType), keyAttempt.Result))
|
||||
: Attempt<Udi>.Fail();
|
||||
}
|
||||
|
||||
@@ -262,7 +262,7 @@ namespace Umbraco.Core.Services
|
||||
else
|
||||
{
|
||||
val = scope.Database.ExecuteScalar<Guid?>("SELECT uniqueId FROM umbracoNode WHERE id=@id AND (nodeObjectType=@type OR nodeObjectType=@reservation)",
|
||||
new { id, type = GetNodeObjectTypeGuid(umbracoObjectType), reservation = ConstantsCore.ObjectTypes.IdReservation });
|
||||
new { id, type = GetNodeObjectTypeGuid(umbracoObjectType), reservation = Constants.ObjectTypes.IdReservation });
|
||||
}
|
||||
scope.Complete();
|
||||
}
|
||||
|
||||
@@ -105,7 +105,7 @@ namespace Umbraco.Core.Services.Implement
|
||||
if (pageIndex < 0) throw new ArgumentOutOfRangeException(nameof(pageIndex));
|
||||
if (pageSize <= 0) throw new ArgumentOutOfRangeException(nameof(pageSize));
|
||||
|
||||
if (entityId == ConstantsCore.System.Root || entityId <= 0)
|
||||
if (entityId == Constants.System.Root || entityId <= 0)
|
||||
{
|
||||
totalRecords = 0;
|
||||
return Enumerable.Empty<IAuditItem>();
|
||||
@@ -159,7 +159,7 @@ namespace Umbraco.Core.Services.Implement
|
||||
/// <inheritdoc />
|
||||
public IAuditEntry Write(int performingUserId, string perfomingDetails, string performingIp, DateTime eventDateUtc, int affectedUserId, string affectedDetails, string eventType, string eventDetails)
|
||||
{
|
||||
if (performingUserId < 0 && performingUserId != ConstantsCore.Security.SuperUserId) throw new ArgumentOutOfRangeException(nameof(performingUserId));
|
||||
if (performingUserId < 0 && performingUserId != Constants.Security.SuperUserId) throw new ArgumentOutOfRangeException(nameof(performingUserId));
|
||||
if (string.IsNullOrWhiteSpace(perfomingDetails)) throw new ArgumentException("Value cannot be null or whitespace.", nameof(perfomingDetails));
|
||||
if (string.IsNullOrWhiteSpace(eventType)) throw new ArgumentException("Value cannot be null or whitespace.", nameof(eventType));
|
||||
if (string.IsNullOrWhiteSpace(eventDetails)) throw new ArgumentException("Value cannot be null or whitespace.", nameof(eventDetails));
|
||||
|
||||
@@ -163,7 +163,7 @@ namespace Umbraco.Core.Services.Implement
|
||||
/// <param name="contentTypeAlias">Alias of the <see cref="IContentType"/></param>
|
||||
/// <param name="userId">Optional id of the user creating the content</param>
|
||||
/// <returns><see cref="IContent"/></returns>
|
||||
public IContent Create(string name, Guid parentId, string contentTypeAlias, int userId = ConstantsCore.Security.SuperUserId)
|
||||
public IContent Create(string name, Guid parentId, string contentTypeAlias, int userId = Constants.Security.SuperUserId)
|
||||
{
|
||||
// TODO: what about culture?
|
||||
|
||||
@@ -183,7 +183,7 @@ namespace Umbraco.Core.Services.Implement
|
||||
/// <param name="contentTypeAlias">The alias of the content type.</param>
|
||||
/// <param name="userId">The optional id of the user creating the content.</param>
|
||||
/// <returns>The content object.</returns>
|
||||
public IContent Create(string name, int parentId, string contentTypeAlias, int userId = ConstantsCore.Security.SuperUserId)
|
||||
public IContent Create(string name, int parentId, string contentTypeAlias, int userId = Constants.Security.SuperUserId)
|
||||
{
|
||||
// TODO: what about culture?
|
||||
|
||||
@@ -216,7 +216,7 @@ namespace Umbraco.Core.Services.Implement
|
||||
/// <param name="contentTypeAlias">The alias of the content type.</param>
|
||||
/// <param name="userId">The optional id of the user creating the content.</param>
|
||||
/// <returns>The content object.</returns>
|
||||
public IContent Create(string name, IContent parent, string contentTypeAlias, int userId = ConstantsCore.Security.SuperUserId)
|
||||
public IContent Create(string name, IContent parent, string contentTypeAlias, int userId = Constants.Security.SuperUserId)
|
||||
{
|
||||
// TODO: what about culture?
|
||||
|
||||
@@ -247,7 +247,7 @@ namespace Umbraco.Core.Services.Implement
|
||||
/// <param name="contentTypeAlias">The alias of the content type.</param>
|
||||
/// <param name="userId">The optional id of the user creating the content.</param>
|
||||
/// <returns>The content object.</returns>
|
||||
public IContent CreateAndSave(string name, int parentId, string contentTypeAlias, int userId = ConstantsCore.Security.SuperUserId)
|
||||
public IContent CreateAndSave(string name, int parentId, string contentTypeAlias, int userId = Constants.Security.SuperUserId)
|
||||
{
|
||||
// TODO: what about culture?
|
||||
|
||||
@@ -281,7 +281,7 @@ namespace Umbraco.Core.Services.Implement
|
||||
/// <param name="contentTypeAlias">The alias of the content type.</param>
|
||||
/// <param name="userId">The optional id of the user creating the content.</param>
|
||||
/// <returns>The content object.</returns>
|
||||
public IContent CreateAndSave(string name, IContent parent, string contentTypeAlias, int userId = ConstantsCore.Security.SuperUserId)
|
||||
public IContent CreateAndSave(string name, IContent parent, string contentTypeAlias, int userId = Constants.Security.SuperUserId)
|
||||
{
|
||||
// TODO: what about culture?
|
||||
|
||||
@@ -534,7 +534,7 @@ namespace Umbraco.Core.Services.Implement
|
||||
//null check otherwise we get exceptions
|
||||
if (content.Path.IsNullOrWhiteSpace()) return Enumerable.Empty<IContent>();
|
||||
|
||||
var rootId = ConstantsCore.System.RootString;
|
||||
var rootId = Constants.System.RootString;
|
||||
var ids = content.Path.Split(',')
|
||||
.Where(x => x != rootId && x != content.Id.ToString(CultureInfo.InvariantCulture)).Select(int.Parse).ToArray();
|
||||
if (ids.Any() == false)
|
||||
@@ -593,9 +593,9 @@ namespace Umbraco.Core.Services.Implement
|
||||
scope.ReadLock(Constants.Locks.ContentTree);
|
||||
|
||||
//if the id is System Root, then just get all
|
||||
if (id != ConstantsCore.System.Root)
|
||||
if (id != Constants.System.Root)
|
||||
{
|
||||
var contentPath = _entityRepository.GetAllPaths(ConstantsCore.ObjectTypes.Document, id).ToArray();
|
||||
var contentPath = _entityRepository.GetAllPaths(Constants.ObjectTypes.Document, id).ToArray();
|
||||
if (contentPath.Length == 0)
|
||||
{
|
||||
totalChildren = 0;
|
||||
@@ -640,7 +640,7 @@ namespace Umbraco.Core.Services.Implement
|
||||
/// <returns>Parent <see cref="IContent"/> object</returns>
|
||||
public IContent GetParent(IContent content)
|
||||
{
|
||||
if (content.ParentId == ConstantsCore.System.Root || content.ParentId == ConstantsCore.System.RecycleBinContent)
|
||||
if (content.ParentId == Constants.System.Root || content.ParentId == Constants.System.RecycleBinContent)
|
||||
return null;
|
||||
|
||||
return GetById(content.ParentId);
|
||||
@@ -655,7 +655,7 @@ namespace Umbraco.Core.Services.Implement
|
||||
using (var scope = ScopeProvider.CreateScope(autoComplete: true))
|
||||
{
|
||||
scope.ReadLock(Constants.Locks.ContentTree);
|
||||
var query = Query<IContent>().Where(x => x.ParentId == ConstantsCore.System.Root);
|
||||
var query = Query<IContent>().Where(x => x.ParentId == Constants.System.Root);
|
||||
return _documentRepository.Get(query);
|
||||
}
|
||||
}
|
||||
@@ -706,7 +706,7 @@ namespace Umbraco.Core.Services.Implement
|
||||
ordering = Ordering.By("Path");
|
||||
|
||||
scope.ReadLock(Constants.Locks.ContentTree);
|
||||
var query = Query<IContent>().Where(x => x.Path.StartsWith(ConstantsCore.System.RecycleBinContentPathPrefix));
|
||||
var query = Query<IContent>().Where(x => x.Path.StartsWith(Constants.System.RecycleBinContentPathPrefix));
|
||||
return _documentRepository.GetPage(query, pageIndex, pageSize, out totalRecords, filter, ordering);
|
||||
}
|
||||
}
|
||||
@@ -729,7 +729,7 @@ namespace Umbraco.Core.Services.Implement
|
||||
public bool IsPathPublishable(IContent content)
|
||||
{
|
||||
// fast
|
||||
if (content.ParentId == ConstantsCore.System.Root) return true; // root content is always publishable
|
||||
if (content.ParentId == Constants.System.Root) return true; // root content is always publishable
|
||||
if (content.Trashed) return false; // trashed content is never publishable
|
||||
|
||||
// not trashed and has a parent: publishable if the parent is path-published
|
||||
@@ -751,7 +751,7 @@ namespace Umbraco.Core.Services.Implement
|
||||
#region Save, Publish, Unpublish
|
||||
|
||||
/// <inheritdoc />
|
||||
public OperationResult Save(IContent content, int userId = ConstantsCore.Security.SuperUserId, bool raiseEvents = true)
|
||||
public OperationResult Save(IContent content, int userId = Constants.Security.SuperUserId, bool raiseEvents = true)
|
||||
{
|
||||
var publishedState = content.PublishedState;
|
||||
if (publishedState != PublishedState.Published && publishedState != PublishedState.Unpublished)
|
||||
@@ -814,7 +814,7 @@ namespace Umbraco.Core.Services.Implement
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public OperationResult Save(IEnumerable<IContent> contents, int userId = ConstantsCore.Security.SuperUserId, bool raiseEvents = true)
|
||||
public OperationResult Save(IEnumerable<IContent> contents, int userId = Constants.Security.SuperUserId, bool raiseEvents = true)
|
||||
{
|
||||
var evtMsgs = EventMessagesFactory.Get();
|
||||
var contentsA = contents.ToArray();
|
||||
@@ -845,7 +845,7 @@ namespace Umbraco.Core.Services.Implement
|
||||
scope.Events.Dispatch(Saved, this, saveEventArgs.ToContentSavedEventArgs(), nameof(Saved));
|
||||
}
|
||||
scope.Events.Dispatch(TreeChanged, this, treeChanges.ToEventArgs());
|
||||
Audit(AuditType.Save, userId == -1 ? 0 : userId, ConstantsCore.System.Root, "Saved multiple content");
|
||||
Audit(AuditType.Save, userId == -1 ? 0 : userId, Constants.System.Root, "Saved multiple content");
|
||||
|
||||
scope.Complete();
|
||||
}
|
||||
@@ -854,7 +854,7 @@ namespace Umbraco.Core.Services.Implement
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public PublishResult SaveAndPublish(IContent content, string culture = "*", int userId = ConstantsCore.Security.SuperUserId, bool raiseEvents = true)
|
||||
public PublishResult SaveAndPublish(IContent content, string culture = "*", int userId = Constants.Security.SuperUserId, bool raiseEvents = true)
|
||||
{
|
||||
var evtMsgs = EventMessagesFactory.Get();
|
||||
|
||||
@@ -953,7 +953,7 @@ namespace Umbraco.Core.Services.Implement
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public PublishResult Unpublish(IContent content, string culture = "*", int userId = ConstantsCore.Security.SuperUserId)
|
||||
public PublishResult Unpublish(IContent content, string culture = "*", int userId = Constants.Security.SuperUserId)
|
||||
{
|
||||
if (content == null) throw new ArgumentNullException(nameof(content));
|
||||
|
||||
@@ -1050,7 +1050,7 @@ namespace Umbraco.Core.Services.Implement
|
||||
/// <para>The document is *always* saved, even when publishing fails.</para>
|
||||
/// </remarks>
|
||||
internal PublishResult CommitDocumentChanges(IContent content,
|
||||
int userId = ConstantsCore.Security.SuperUserId, bool raiseEvents = true)
|
||||
int userId = Constants.Security.SuperUserId, bool raiseEvents = true)
|
||||
{
|
||||
using (var scope = ScopeProvider.CreateScope())
|
||||
{
|
||||
@@ -1089,7 +1089,7 @@ namespace Umbraco.Core.Services.Implement
|
||||
/// </remarks>
|
||||
private PublishResult CommitDocumentChangesInternal(IScope scope, IContent content,
|
||||
ContentSavingEventArgs saveEventArgs, IReadOnlyCollection<ILanguage> allLangs,
|
||||
int userId = ConstantsCore.Security.SuperUserId,
|
||||
int userId = Constants.Security.SuperUserId,
|
||||
bool raiseEvents = true, bool branchOne = false, bool branchRoot = false)
|
||||
{
|
||||
if (scope == null) throw new ArgumentNullException(nameof(scope));
|
||||
@@ -1533,7 +1533,7 @@ namespace Umbraco.Core.Services.Implement
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public IEnumerable<PublishResult> SaveAndPublishBranch(IContent content, bool force, string culture = "*", int userId = ConstantsCore.Security.SuperUserId)
|
||||
public IEnumerable<PublishResult> SaveAndPublishBranch(IContent content, bool force, string culture = "*", int userId = Constants.Security.SuperUserId)
|
||||
{
|
||||
// note: EditedValue and PublishedValue are objects here, so it is important to .Equals()
|
||||
// and not to == them, else we would be comparing references, and that is a bad thing
|
||||
@@ -1575,7 +1575,7 @@ namespace Umbraco.Core.Services.Implement
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public IEnumerable<PublishResult> SaveAndPublishBranch(IContent content, bool force, string[] cultures, int userId = ConstantsCore.Security.SuperUserId)
|
||||
public IEnumerable<PublishResult> SaveAndPublishBranch(IContent content, bool force, string[] cultures, int userId = Constants.Security.SuperUserId)
|
||||
{
|
||||
// note: EditedValue and PublishedValue are objects here, so it is important to .Equals()
|
||||
// and not to == them, else we would be comparing references, and that is a bad thing
|
||||
@@ -1614,7 +1614,7 @@ namespace Umbraco.Core.Services.Implement
|
||||
internal IEnumerable<PublishResult> SaveAndPublishBranch(IContent document, bool force,
|
||||
Func<IContent, HashSet<string>> shouldPublish,
|
||||
Func<IContent, HashSet<string>, IReadOnlyCollection<ILanguage>, bool> publishCultures,
|
||||
int userId = ConstantsCore.Security.SuperUserId)
|
||||
int userId = Constants.Security.SuperUserId)
|
||||
{
|
||||
if (shouldPublish == null) throw new ArgumentNullException(nameof(shouldPublish));
|
||||
if (publishCultures == null) throw new ArgumentNullException(nameof(publishCultures));
|
||||
@@ -1800,7 +1800,7 @@ namespace Umbraco.Core.Services.Implement
|
||||
/// <param name="id">Id of the <see cref="IContent"/> object to delete versions from</param>
|
||||
/// <param name="versionDate">Latest version date</param>
|
||||
/// <param name="userId">Optional Id of the User deleting versions of a Content object</param>
|
||||
public void DeleteVersions(int id, DateTime versionDate, int userId = ConstantsCore.Security.SuperUserId)
|
||||
public void DeleteVersions(int id, DateTime versionDate, int userId = Constants.Security.SuperUserId)
|
||||
{
|
||||
using (var scope = ScopeProvider.CreateScope())
|
||||
{
|
||||
@@ -1816,7 +1816,7 @@ namespace Umbraco.Core.Services.Implement
|
||||
|
||||
deleteRevisionsEventArgs.CanCancel = false;
|
||||
scope.Events.Dispatch(DeletedVersions, this, deleteRevisionsEventArgs);
|
||||
Audit(AuditType.Delete, userId, ConstantsCore.System.Root, "Delete (by version date)");
|
||||
Audit(AuditType.Delete, userId, Constants.System.Root, "Delete (by version date)");
|
||||
|
||||
scope.Complete();
|
||||
}
|
||||
@@ -1830,7 +1830,7 @@ namespace Umbraco.Core.Services.Implement
|
||||
/// <param name="versionId">Id of the version to delete</param>
|
||||
/// <param name="deletePriorVersions">Boolean indicating whether to delete versions prior to the versionId</param>
|
||||
/// <param name="userId">Optional Id of the User deleting versions of a Content object</param>
|
||||
public void DeleteVersion(int id, int versionId, bool deletePriorVersions, int userId = ConstantsCore.Security.SuperUserId)
|
||||
public void DeleteVersion(int id, int versionId, bool deletePriorVersions, int userId = Constants.Security.SuperUserId)
|
||||
{
|
||||
using (var scope = ScopeProvider.CreateScope())
|
||||
{
|
||||
@@ -1852,7 +1852,7 @@ namespace Umbraco.Core.Services.Implement
|
||||
_documentRepository.DeleteVersion(versionId);
|
||||
|
||||
scope.Events.Dispatch(DeletedVersions, this, new DeleteRevisionsEventArgs(id, false,/* specificVersion:*/ versionId));
|
||||
Audit(AuditType.Delete, userId, ConstantsCore.System.Root, "Delete (by version)");
|
||||
Audit(AuditType.Delete, userId, Constants.System.Root, "Delete (by version)");
|
||||
|
||||
scope.Complete();
|
||||
}
|
||||
@@ -1873,7 +1873,7 @@ namespace Umbraco.Core.Services.Implement
|
||||
scope.WriteLock(Constants.Locks.ContentTree);
|
||||
|
||||
var originalPath = content.Path;
|
||||
var moveEventInfo = new MoveEventInfo<IContent>(content, originalPath, ConstantsCore.System.RecycleBinContent);
|
||||
var moveEventInfo = new MoveEventInfo<IContent>(content, originalPath, Constants.System.RecycleBinContent);
|
||||
var moveEventArgs = new MoveEventArgs<IContent>(evtMsgs, moveEventInfo);
|
||||
if (scope.Events.DispatchCancelable(Trashing, this, moveEventArgs, nameof(Trashing)))
|
||||
{
|
||||
@@ -1887,7 +1887,7 @@ namespace Umbraco.Core.Services.Implement
|
||||
//if (content.HasPublishedVersion)
|
||||
//{ }
|
||||
|
||||
PerformMoveLocked(content, ConstantsCore.System.RecycleBinContent, null, userId, moves, true);
|
||||
PerformMoveLocked(content, Constants.System.RecycleBinContent, null, userId, moves, true);
|
||||
scope.Events.Dispatch(TreeChanged, this, new TreeChange<IContent>(content, TreeChangeTypes.RefreshBranch).ToEventArgs());
|
||||
|
||||
var moveInfo = moves
|
||||
@@ -1916,10 +1916,10 @@ namespace Umbraco.Core.Services.Implement
|
||||
/// <param name="content">The <see cref="IContent"/> to move</param>
|
||||
/// <param name="parentId">Id of the Content's new Parent</param>
|
||||
/// <param name="userId">Optional Id of the User moving the Content</param>
|
||||
public void Move(IContent content, int parentId, int userId = ConstantsCore.Security.SuperUserId)
|
||||
public void Move(IContent content, int parentId, int userId = Constants.Security.SuperUserId)
|
||||
{
|
||||
// if moving to the recycle bin then use the proper method
|
||||
if (parentId == ConstantsCore.System.RecycleBinContent)
|
||||
if (parentId == Constants.System.RecycleBinContent)
|
||||
{
|
||||
MoveToRecycleBin(content, userId);
|
||||
return;
|
||||
@@ -1931,8 +1931,8 @@ namespace Umbraco.Core.Services.Implement
|
||||
{
|
||||
scope.WriteLock(Constants.Locks.ContentTree);
|
||||
|
||||
var parent = parentId == ConstantsCore.System.Root ? null : GetById(parentId);
|
||||
if (parentId != ConstantsCore.System.Root && (parent == null || parent.Trashed))
|
||||
var parent = parentId == Constants.System.Root ? null : GetById(parentId);
|
||||
if (parentId != Constants.System.Root && (parent == null || parent.Trashed))
|
||||
throw new InvalidOperationException("Parent does not exist or is trashed."); // causes rollback
|
||||
|
||||
var moveEventInfo = new MoveEventInfo<IContent>(content, content.Path, parentId);
|
||||
@@ -2004,7 +2004,7 @@ namespace Umbraco.Core.Services.Implement
|
||||
// if uow is not immediate, content.Path will be updated only when the UOW commits,
|
||||
// and because we want it now, we have to calculate it by ourselves
|
||||
//paths[content.Id] = content.Path;
|
||||
paths[content.Id] = (parent == null ? (parentId == ConstantsCore.System.RecycleBinContent ? "-1,-20" : ConstantsCore.System.RootString) : parent.Path) + "," + content.Id;
|
||||
paths[content.Id] = (parent == null ? (parentId == Constants.System.RecycleBinContent ? "-1,-20" : Constants.System.RootString) : parent.Path) + "," + content.Id;
|
||||
|
||||
const int pageSize = 500;
|
||||
var total = long.MaxValue;
|
||||
@@ -2036,14 +2036,14 @@ namespace Umbraco.Core.Services.Implement
|
||||
/// </summary>
|
||||
[EditorBrowsable(EditorBrowsableState.Never)]
|
||||
[Obsolete("Use EmptyRecycleBin with explicit indication of user ID instead")]
|
||||
public OperationResult EmptyRecycleBin() => EmptyRecycleBin(ConstantsCore.Security.SuperUserId);
|
||||
public OperationResult EmptyRecycleBin() => EmptyRecycleBin(Constants.Security.SuperUserId);
|
||||
|
||||
/// <summary>
|
||||
/// Empties the Recycle Bin by deleting all <see cref="IContent"/> that resides in the bin
|
||||
/// </summary>
|
||||
public OperationResult EmptyRecycleBin(int userId = ConstantsCore.Security.SuperUserId)
|
||||
public OperationResult EmptyRecycleBin(int userId = Constants.Security.SuperUserId)
|
||||
{
|
||||
var nodeObjectType = ConstantsCore.ObjectTypes.Document;
|
||||
var nodeObjectType = Constants.ObjectTypes.Document;
|
||||
var deleted = new List<IContent>();
|
||||
var evtMsgs = EventMessagesFactory.Get();
|
||||
|
||||
@@ -2064,7 +2064,7 @@ namespace Umbraco.Core.Services.Implement
|
||||
}
|
||||
|
||||
// emptying the recycle bin means deleting whatever is in there - do it properly!
|
||||
var query = Query<IContent>().Where(x => x.ParentId == ConstantsCore.System.RecycleBinContent);
|
||||
var query = Query<IContent>().Where(x => x.ParentId == Constants.System.RecycleBinContent);
|
||||
var contents = _documentRepository.Get(query).ToArray();
|
||||
foreach (var content in contents)
|
||||
{
|
||||
@@ -2076,7 +2076,7 @@ namespace Umbraco.Core.Services.Implement
|
||||
recycleBinEventArgs.RecycleBinEmptiedSuccessfully = true; // oh my?!
|
||||
scope.Events.Dispatch(EmptiedRecycleBin, this, recycleBinEventArgs);
|
||||
scope.Events.Dispatch(TreeChanged, this, deleted.Select(x => new TreeChange<IContent>(x, TreeChangeTypes.Remove)).ToEventArgs());
|
||||
Audit(AuditType.Delete, userId, ConstantsCore.System.RecycleBinContent, "Recycle bin emptied");
|
||||
Audit(AuditType.Delete, userId, Constants.System.RecycleBinContent, "Recycle bin emptied");
|
||||
|
||||
scope.Complete();
|
||||
}
|
||||
@@ -2097,7 +2097,7 @@ namespace Umbraco.Core.Services.Implement
|
||||
/// <param name="relateToOriginal">Boolean indicating whether the copy should be related to the original</param>
|
||||
/// <param name="userId">Optional Id of the User copying the Content</param>
|
||||
/// <returns>The newly created <see cref="IContent"/> object</returns>
|
||||
public IContent Copy(IContent content, int parentId, bool relateToOriginal, int userId = ConstantsCore.Security.SuperUserId)
|
||||
public IContent Copy(IContent content, int parentId, bool relateToOriginal, int userId = Constants.Security.SuperUserId)
|
||||
{
|
||||
return Copy(content, parentId, relateToOriginal, true, userId);
|
||||
}
|
||||
@@ -2112,7 +2112,7 @@ namespace Umbraco.Core.Services.Implement
|
||||
/// <param name="recursive">A value indicating whether to recursively copy children.</param>
|
||||
/// <param name="userId">Optional Id of the User copying the Content</param>
|
||||
/// <returns>The newly created <see cref="IContent"/> object</returns>
|
||||
public IContent Copy(IContent content, int parentId, bool relateToOriginal, bool recursive, int userId = ConstantsCore.Security.SuperUserId)
|
||||
public IContent Copy(IContent content, int parentId, bool relateToOriginal, bool recursive, int userId = Constants.Security.SuperUserId)
|
||||
{
|
||||
var copy = content.DeepCloneWithResetIdentities();
|
||||
copy.ParentId = parentId;
|
||||
@@ -2215,7 +2215,7 @@ namespace Umbraco.Core.Services.Implement
|
||||
/// <param name="content">The <see cref="IContent"/> to send to publication</param>
|
||||
/// <param name="userId">Optional Id of the User issuing the send to publication</param>
|
||||
/// <returns>True if sending publication was successful otherwise false</returns>
|
||||
public bool SendToPublication(IContent content, int userId = ConstantsCore.Security.SuperUserId)
|
||||
public bool SendToPublication(IContent content, int userId = Constants.Security.SuperUserId)
|
||||
{
|
||||
using (var scope = ScopeProvider.CreateScope())
|
||||
{
|
||||
@@ -2269,7 +2269,7 @@ namespace Umbraco.Core.Services.Implement
|
||||
/// <param name="userId"></param>
|
||||
/// <param name="raiseEvents"></param>
|
||||
/// <returns>Result indicating what action was taken when handling the command.</returns>
|
||||
public OperationResult Sort(IEnumerable<IContent> items, int userId = ConstantsCore.Security.SuperUserId, bool raiseEvents = true)
|
||||
public OperationResult Sort(IEnumerable<IContent> items, int userId = Constants.Security.SuperUserId, bool raiseEvents = true)
|
||||
{
|
||||
var evtMsgs = EventMessagesFactory.Get();
|
||||
|
||||
@@ -2298,7 +2298,7 @@ namespace Umbraco.Core.Services.Implement
|
||||
/// <param name="userId"></param>
|
||||
/// <param name="raiseEvents"></param>
|
||||
/// <returns>Result indicating what action was taken when handling the command.</returns>
|
||||
public OperationResult Sort(IEnumerable<int> ids, int userId = ConstantsCore.Security.SuperUserId, bool raiseEvents = true)
|
||||
public OperationResult Sort(IEnumerable<int> ids, int userId = Constants.Security.SuperUserId, bool raiseEvents = true)
|
||||
{
|
||||
var evtMsgs = EventMessagesFactory.Get();
|
||||
|
||||
@@ -2675,7 +2675,7 @@ namespace Umbraco.Core.Services.Implement
|
||||
// check if the content can be path-published
|
||||
// root content can be published
|
||||
// else check ancestors - we know we are not trashed
|
||||
var pathIsOk = content.ParentId == ConstantsCore.System.Root || IsPathPublished(GetParent(content));
|
||||
var pathIsOk = content.ParentId == Constants.System.Root || IsPathPublished(GetParent(content));
|
||||
if (!pathIsOk)
|
||||
{
|
||||
Logger.Info<ContentService>("Document {ContentName} (id={ContentId}) cannot be published: {Reason}", content.Name, content.Id, "parent is not published");
|
||||
@@ -2802,7 +2802,7 @@ namespace Umbraco.Core.Services.Implement
|
||||
/// </remarks>
|
||||
/// <param name="contentTypeIds">Id of the <see cref="IContentType"/></param>
|
||||
/// <param name="userId">Optional Id of the user issuing the delete operation</param>
|
||||
public void DeleteOfTypes(IEnumerable<int> contentTypeIds, int userId = ConstantsCore.Security.SuperUserId)
|
||||
public void DeleteOfTypes(IEnumerable<int> contentTypeIds, int userId = Constants.Security.SuperUserId)
|
||||
{
|
||||
// TODO: This currently this is called from the ContentTypeService but that needs to change,
|
||||
// if we are deleting a content type, we should just delete the data and do this operation slightly differently.
|
||||
@@ -2849,7 +2849,7 @@ namespace Umbraco.Core.Services.Implement
|
||||
foreach (var child in children)
|
||||
{
|
||||
// see MoveToRecycleBin
|
||||
PerformMoveLocked(child, ConstantsCore.System.RecycleBinContent, null, userId, moves, true);
|
||||
PerformMoveLocked(child, Constants.System.RecycleBinContent, null, userId, moves, true);
|
||||
changes.Add(new TreeChange<IContent>(content, TreeChangeTypes.RefreshBranch));
|
||||
}
|
||||
|
||||
@@ -2866,7 +2866,7 @@ namespace Umbraco.Core.Services.Implement
|
||||
scope.Events.Dispatch(Trashed, this, new MoveEventArgs<IContent>(false, moveInfos), nameof(Trashed));
|
||||
scope.Events.Dispatch(TreeChanged, this, changes.ToEventArgs());
|
||||
|
||||
Audit(AuditType.Delete, userId, ConstantsCore.System.Root, $"Delete content of type {string.Join(",", contentTypeIdsA)}");
|
||||
Audit(AuditType.Delete, userId, Constants.System.Root, $"Delete content of type {string.Join(",", contentTypeIdsA)}");
|
||||
|
||||
scope.Complete();
|
||||
}
|
||||
@@ -2878,7 +2878,7 @@ namespace Umbraco.Core.Services.Implement
|
||||
/// <remarks>This needs extra care and attention as its potentially a dangerous and extensive operation</remarks>
|
||||
/// <param name="contentTypeId">Id of the <see cref="IContentType"/></param>
|
||||
/// <param name="userId">Optional id of the user deleting the media</param>
|
||||
public void DeleteOfType(int contentTypeId, int userId = ConstantsCore.Security.SuperUserId)
|
||||
public void DeleteOfType(int contentTypeId, int userId = Constants.Security.SuperUserId)
|
||||
{
|
||||
DeleteOfTypes(new[] { contentTypeId }, userId);
|
||||
}
|
||||
@@ -2936,7 +2936,7 @@ namespace Umbraco.Core.Services.Implement
|
||||
}
|
||||
}
|
||||
|
||||
public void SaveBlueprint(IContent content, int userId = ConstantsCore.Security.SuperUserId)
|
||||
public void SaveBlueprint(IContent content, int userId = Constants.Security.SuperUserId)
|
||||
{
|
||||
//always ensure the blueprint is at the root
|
||||
if (content.ParentId != -1)
|
||||
@@ -2962,7 +2962,7 @@ namespace Umbraco.Core.Services.Implement
|
||||
}
|
||||
}
|
||||
|
||||
public void DeleteBlueprint(IContent content, int userId = ConstantsCore.Security.SuperUserId)
|
||||
public void DeleteBlueprint(IContent content, int userId = Constants.Security.SuperUserId)
|
||||
{
|
||||
using (var scope = ScopeProvider.CreateScope())
|
||||
{
|
||||
@@ -2975,7 +2975,7 @@ namespace Umbraco.Core.Services.Implement
|
||||
|
||||
private static readonly string[] ArrayOfOneNullString = { null };
|
||||
|
||||
public IContent CreateContentFromBlueprint(IContent blueprint, string name, int userId = ConstantsCore.Security.SuperUserId)
|
||||
public IContent CreateContentFromBlueprint(IContent blueprint, string name, int userId = Constants.Security.SuperUserId)
|
||||
{
|
||||
if (blueprint == null) throw new ArgumentNullException(nameof(blueprint));
|
||||
|
||||
@@ -3036,7 +3036,7 @@ namespace Umbraco.Core.Services.Implement
|
||||
}
|
||||
}
|
||||
|
||||
public void DeleteBlueprintsOfTypes(IEnumerable<int> contentTypeIds, int userId = ConstantsCore.Security.SuperUserId)
|
||||
public void DeleteBlueprintsOfTypes(IEnumerable<int> contentTypeIds, int userId = Constants.Security.SuperUserId)
|
||||
{
|
||||
using (var scope = ScopeProvider.CreateScope())
|
||||
{
|
||||
@@ -3063,7 +3063,7 @@ namespace Umbraco.Core.Services.Implement
|
||||
}
|
||||
}
|
||||
|
||||
public void DeleteBlueprintsOfType(int contentTypeId, int userId = ConstantsCore.Security.SuperUserId)
|
||||
public void DeleteBlueprintsOfType(int contentTypeId, int userId = Constants.Security.SuperUserId)
|
||||
{
|
||||
DeleteBlueprintsOfTypes(new[] { contentTypeId }, userId);
|
||||
}
|
||||
@@ -3072,7 +3072,7 @@ namespace Umbraco.Core.Services.Implement
|
||||
|
||||
#region Rollback
|
||||
|
||||
public OperationResult Rollback(int id, int versionId, string culture = "*", int userId = ConstantsCore.Security.SuperUserId)
|
||||
public OperationResult Rollback(int id, int versionId, string culture = "*", int userId = Constants.Security.SuperUserId)
|
||||
{
|
||||
var evtMsgs = EventMessagesFactory.Get();
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ namespace Umbraco.Core.Services.Implement
|
||||
|
||||
private IContentService ContentService { get; }
|
||||
|
||||
protected override Guid ContainedObjectType => ConstantsCore.ObjectTypes.DocumentType;
|
||||
protected override Guid ContainedObjectType => Constants.ObjectTypes.DocumentType;
|
||||
|
||||
protected override void DeleteItemsOfTypes(IEnumerable<int> typeIds)
|
||||
{
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user