Merge remote-tracking branch 'origin/temp8' into temp8-dashboards-collection
This commit is contained in:
@@ -8,7 +8,7 @@ namespace Umbraco.Core
|
||||
public static class Attempt
|
||||
{
|
||||
// note:
|
||||
// cannot rely on overloads only to differenciate between with/without status
|
||||
// cannot rely on overloads only to differentiate between with/without status
|
||||
// in some cases it will always be ambiguous, so be explicit w/ 'WithStatus' methods
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -121,7 +121,7 @@ namespace Umbraco.Core
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Implicity operator to check if the attempt was successful without having to access the 'success' property
|
||||
/// Implicitly operator to check if the attempt was successful without having to access the 'success' property
|
||||
/// </summary>
|
||||
/// <param name="a"></param>
|
||||
/// <returns></returns>
|
||||
|
||||
@@ -130,7 +130,7 @@ namespace Umbraco.Core
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Implicity operator to check if the attempt was successful without having to access the 'success' property
|
||||
/// Implicitly operator to check if the attempt was successful without having to access the 'success' property
|
||||
/// </summary>
|
||||
/// <param name="a"></param>
|
||||
/// <returns></returns>
|
||||
|
||||
@@ -83,7 +83,7 @@ namespace Umbraco.Core.Cache
|
||||
}
|
||||
return entries
|
||||
.Select(x => GetSafeLazyValue((Lazy<object>)x.Value)) // return exceptions as null
|
||||
.Where(x => x != null); // backward compat, don't store null values in the cache
|
||||
.Where(x => x != null); // backward compatible, don't store null values in the cache
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
|
||||
@@ -4,7 +4,7 @@ using Umbraco.Core.Composing;
|
||||
namespace Umbraco.Core.Cache
|
||||
{
|
||||
/// <summary>
|
||||
/// The IcacheRefresher Interface is used for loadbalancing.
|
||||
/// The IcacheRefresher Interface is used for load balancing.
|
||||
///
|
||||
/// </summary>
|
||||
public interface ICacheRefresher : IDiscoverable
|
||||
|
||||
@@ -48,7 +48,7 @@ namespace Umbraco.Core.Cache
|
||||
/// Updates an entity.
|
||||
/// </summary>
|
||||
/// <param name="entity">The entity.</param>
|
||||
/// <param name="persistUpdated">The reopsitory PersistUpdatedItem method.</param>
|
||||
/// <param name="persistUpdated">The repository PersistUpdatedItem method.</param>
|
||||
/// <remarks>Updates the entity in the repository, and updates the cache accordingly.</remarks>
|
||||
void Update(TEntity entity, Action<TEntity> persistUpdated);
|
||||
|
||||
|
||||
@@ -203,7 +203,7 @@ namespace Umbraco.Core.Components
|
||||
/// Sets the server registrar.
|
||||
/// </summary>
|
||||
/// <param name="composition">The composition.</param>
|
||||
/// <param name="factory">A function creating a server registar.</param>
|
||||
/// <param name="factory">A function creating a server registrar.</param>
|
||||
public static void SetServerRegistrar(this Composition composition, Func<IFactory, IServerRegistrar> factory)
|
||||
{
|
||||
composition.RegisterUnique(factory);
|
||||
|
||||
@@ -163,8 +163,8 @@ namespace Umbraco.Core.Composing
|
||||
|
||||
/// <summary>
|
||||
/// Return a list of found local Assemblies excluding the known assemblies we don't want to scan
|
||||
/// and exluding the ones passed in and excluding the exclusion list filter, the results of this are
|
||||
/// cached for perforance reasons.
|
||||
/// and excluding the ones passed in and excluding the exclusion list filter, the results of this are
|
||||
/// cached for performance reasons.
|
||||
/// </summary>
|
||||
/// <param name="excludeFromResults"></param>
|
||||
/// <returns></returns>
|
||||
@@ -183,7 +183,7 @@ namespace Umbraco.Core.Composing
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Return a distinct list of found local Assemblies and exluding the ones passed in and excluding the exclusion list filter
|
||||
/// Return a distinct list of found local Assemblies and excluding the ones passed in and excluding the exclusion list filter
|
||||
/// </summary>
|
||||
/// <param name="excludeFromResults"></param>
|
||||
/// <param name="exclusionFilter"></param>
|
||||
@@ -204,7 +204,7 @@ namespace Umbraco.Core.Composing
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// this is our assembly filter to filter out known types that def dont contain types we'd like to find or plugins
|
||||
/// this is our assembly filter to filter out known types that def don't contain types we'd like to find or plugins
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// NOTE the comma vs period... comma delimits the name in an Assembly FullName property so if it ends with comma then its an exact name match
|
||||
|
||||
@@ -153,7 +153,7 @@ namespace Umbraco.Core.Composing
|
||||
{
|
||||
var others = types.Except(new[] {curr});
|
||||
|
||||
//is the curr type a common denominator for all others ?
|
||||
//is the current type a common denominator for all others ?
|
||||
var isBase = others.All(curr.IsAssignableFrom);
|
||||
|
||||
//if this type is the base for all others
|
||||
|
||||
@@ -109,7 +109,7 @@ namespace Umbraco.Core.Composing
|
||||
/// Gets or sets the set of assemblies to scan.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// <para>If not explicitely set, defaults to all assemblies except those that are know to not have any of the
|
||||
/// <para>If not explicitly set, defaults to all assemblies except those that are know to not have any of the
|
||||
/// types we might scan. Because we only scan for application types, this means we can safely exclude GAC assemblies
|
||||
/// for example.</para>
|
||||
/// <para>This is for unit tests.</para>
|
||||
|
||||
@@ -15,7 +15,7 @@ namespace Umbraco.Core.Configuration
|
||||
// this helps troubleshooting rogue scopes that we forget to complete
|
||||
public bool LogUncompletedScopes { get; }
|
||||
|
||||
// when true, the Logger creates a minidump of w3wp in ~/App_Data/MiniDump whenever it logs
|
||||
// when true, the Logger creates a mini dump of w3wp in ~/App_Data/MiniDump whenever it logs
|
||||
// an error due to a ThreadAbortException that is due to a timeout.
|
||||
public bool DumpOnTimeoutThreadAbort { get; }
|
||||
}
|
||||
|
||||
@@ -44,7 +44,7 @@ namespace Umbraco.Core.Configuration
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// <para>The assembly version is the value of the <see cref="AssemblyVersionAttribute"/>.</para>
|
||||
/// <para>Is is the one that the CLR checks for compatibility. Therefore, it changes only on
|
||||
/// <para>Is the one that the CLR checks for compatibility. Therefore, it changes only on
|
||||
/// hard-breaking changes (for instance, on new major versions).</para>
|
||||
/// </remarks>
|
||||
public static Version AssemblyVersion {get; }
|
||||
|
||||
@@ -195,7 +195,7 @@ namespace Umbraco.Core
|
||||
public const string LastLockoutDateLabel = "Last Lockout Date";
|
||||
|
||||
/// <summary>
|
||||
/// Property alias for the number of failed login attemps
|
||||
/// Property alias for the number of failed login attempts
|
||||
/// </summary>
|
||||
public const string FailedPasswordAttempts = "umbracoMemberFailedPasswordAttempts";
|
||||
|
||||
|
||||
@@ -118,12 +118,7 @@ namespace Umbraco.Core
|
||||
/// RadioButton list.
|
||||
/// </summary>
|
||||
public const string RadioButtonList = "Umbraco.RadioButtonList";
|
||||
|
||||
/// <summary>
|
||||
/// Related Links.
|
||||
/// </summary>
|
||||
public const string RelatedLinks = "Umbraco.RelatedLinks";
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Slider.
|
||||
/// </summary>
|
||||
@@ -178,6 +173,11 @@ namespace Umbraco.Core
|
||||
/// Nested Content.
|
||||
/// </summary>
|
||||
public const string NestedContent = "Umbraco.NestedContent";
|
||||
|
||||
/// <summary>
|
||||
/// Alias for the multi url picker editor.
|
||||
/// </summary>
|
||||
public const string MultiUrlPicker = "Umbraco.MultiUrlPicker";
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -85,7 +85,7 @@ namespace Umbraco.Core
|
||||
#endregion
|
||||
|
||||
/// <summary>
|
||||
/// Removes characters that are not valide XML characters from all entity properties
|
||||
/// Removes characters that are not valid XML characters from all entity properties
|
||||
/// of type string. See: http://stackoverflow.com/a/961504/5018
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
/// </summary>
|
||||
/// <param name="value">The value to normalize.</param>
|
||||
/// <returns>The normalized value.</returns>
|
||||
/// <remarks>Normalizing changes the scaling factor and removes trailing zeroes,
|
||||
/// <remarks>Normalizing changes the scaling factor and removes trailing zeros,
|
||||
/// so 1.2500m comes out as 1.25m.</remarks>
|
||||
public static decimal Normalize(this decimal value)
|
||||
{
|
||||
|
||||
@@ -10,7 +10,7 @@ using System.Web;
|
||||
namespace Umbraco.Core
|
||||
{
|
||||
///<summary>
|
||||
/// Extension methods for dictionary & concurrentdictionary
|
||||
/// Extension methods for Dictionary & ConcurrentDictionary
|
||||
///</summary>
|
||||
internal static class DictionaryExtensions
|
||||
{
|
||||
@@ -72,7 +72,7 @@ namespace Umbraco.Core
|
||||
/// <remarks>
|
||||
/// Taken from: http://stackoverflow.com/questions/12240219/is-there-a-way-to-use-concurrentdictionary-tryupdate-with-a-lambda-expression
|
||||
///
|
||||
/// WARNING: If the value changes after we've retreived it, then the item will not be updated
|
||||
/// WARNING: If the value changes after we've retrieved it, then the item will not be updated
|
||||
/// </remarks>
|
||||
public static bool TryUpdateOptimisitic<TKey, TValue>(this ConcurrentDictionary<TKey, TValue> dict, TKey key, Func<TValue, TValue> updateFactory)
|
||||
{
|
||||
|
||||
@@ -265,7 +265,7 @@ namespace Umbraco.Core
|
||||
return -1;
|
||||
}
|
||||
|
||||
///<summary>Finds the index of the first occurence of an item in an enumerable.</summary>
|
||||
///<summary>Finds the index of the first occurrence of an item in an enumerable.</summary>
|
||||
///<param name="items">The enumerable to search.</param>
|
||||
///<param name="item">The item to find.</param>
|
||||
///<returns>The index of the first matching item, or -1 if the item was not found.</returns>
|
||||
|
||||
@@ -61,7 +61,7 @@ namespace Umbraco.Core.Events
|
||||
{
|
||||
if (CanCancel == false)
|
||||
{
|
||||
throw new InvalidOperationException("This event argument class does not support cancelling.");
|
||||
throw new InvalidOperationException("This event argument class does not support canceling.");
|
||||
}
|
||||
return _cancel;
|
||||
}
|
||||
@@ -69,7 +69,7 @@ namespace Umbraco.Core.Events
|
||||
{
|
||||
if (CanCancel == false)
|
||||
{
|
||||
throw new InvalidOperationException("This event argument class does not support cancelling.");
|
||||
throw new InvalidOperationException("This event argument class does not support canceling.");
|
||||
}
|
||||
_cancel = value;
|
||||
}
|
||||
|
||||
@@ -35,7 +35,7 @@ namespace Umbraco.Core.Events
|
||||
public MacroErrorBehaviour Behaviour { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The html code to display when Behavior is Content.
|
||||
/// The HTML code to display when Behavior is Content.
|
||||
/// </summary>
|
||||
public string Html { get; set; }
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@ namespace Umbraco.Core.Events
|
||||
/// <param name="canCancel"></param>
|
||||
/// <param name="eventMessages"></param>
|
||||
/// <param name="moveInfo">
|
||||
/// A colleciton of MoveEventInfo objects that exposes all entities that have been moved during a single move operation
|
||||
/// A collection of MoveEventInfo objects that exposes all entities that have been moved during a single move operation
|
||||
/// </param>
|
||||
public MoveEventArgs(bool canCancel, EventMessages eventMessages, params MoveEventInfo<TEntity>[] moveInfo)
|
||||
: base(default, canCancel, eventMessages)
|
||||
@@ -34,7 +34,7 @@ namespace Umbraco.Core.Events
|
||||
/// </summary>
|
||||
/// <param name="eventMessages"></param>
|
||||
/// <param name="moveInfo">
|
||||
/// A colleciton of MoveEventInfo objects that exposes all entities that have been moved during a single move operation
|
||||
/// A collection of MoveEventInfo objects that exposes all entities that have been moved during a single move operation
|
||||
/// </param>
|
||||
public MoveEventArgs(EventMessages eventMessages, params MoveEventInfo<TEntity>[] moveInfo)
|
||||
: base(default, eventMessages)
|
||||
@@ -54,7 +54,7 @@ namespace Umbraco.Core.Events
|
||||
/// </summary>
|
||||
/// <param name="canCancel"></param>
|
||||
/// <param name="moveInfo">
|
||||
/// A colleciton of MoveEventInfo objects that exposes all entities that have been moved during a single move operation
|
||||
/// A collection of MoveEventInfo objects that exposes all entities that have been moved during a single move operation
|
||||
/// </param>
|
||||
public MoveEventArgs(bool canCancel, params MoveEventInfo<TEntity>[] moveInfo)
|
||||
: base(default, canCancel)
|
||||
@@ -73,7 +73,7 @@ namespace Umbraco.Core.Events
|
||||
/// Constructor accepting a collection of MoveEventInfo objects
|
||||
/// </summary>
|
||||
/// <param name="moveInfo">
|
||||
/// A colleciton of MoveEventInfo objects that exposes all entities that have been moved during a single move operation
|
||||
/// A collection of MoveEventInfo objects that exposes all entities that have been moved during a single move operation
|
||||
/// </param>
|
||||
public MoveEventArgs(params MoveEventInfo<TEntity>[] moveInfo)
|
||||
: base(default)
|
||||
|
||||
@@ -109,9 +109,9 @@ namespace Umbraco.Core.Events
|
||||
public Type[] SupersedeTypes { get; set; }
|
||||
}
|
||||
|
||||
// this is way too convoluted, the superceede attribute is used only on DeleteEventargs to specify
|
||||
// that it superceeds save, publish, move and copy - BUT - publish event args is also used for
|
||||
// unpublishing and should NOT be superceeded - so really it should not be managed at event args
|
||||
// this is way too convoluted, the supersede attribute is used only on DeleteEventargs to specify
|
||||
// that it supersedes save, publish, move and copy - BUT - publish event args is also used for
|
||||
// unpublishing and should NOT be superseded - so really it should not be managed at event args
|
||||
// level but at event level
|
||||
//
|
||||
// what we want is:
|
||||
@@ -136,7 +136,7 @@ namespace Umbraco.Core.Events
|
||||
var result = new List<IEventDefinition>();
|
||||
var resultArgs = new List<CancellableObjectEventArgs>();
|
||||
|
||||
// eagerly fetch superceeded arg types for each arg type
|
||||
// eagerly fetch superseded arg types for each arg type
|
||||
var argTypeSuperceeding = events.Select(x => x.Args.GetType())
|
||||
.Distinct()
|
||||
.ToDictionary(x => x, x => x.GetCustomAttributes<SupersedeEventAttribute>(false).Select(y => y.SupersededEventArgsType).ToArray());
|
||||
@@ -178,7 +178,7 @@ namespace Umbraco.Core.Events
|
||||
continue;
|
||||
}
|
||||
|
||||
// look for this entity in superceding event args
|
||||
// look for this entity in superseding event args
|
||||
// found = must be removed (ie not added), else track
|
||||
if (IsSuperceeded(eventEntity, infos, entities) == false)
|
||||
{
|
||||
@@ -203,7 +203,7 @@ namespace Umbraco.Core.Events
|
||||
if (eventEntity == null)
|
||||
continue;
|
||||
|
||||
// look for this entity in superceding event args
|
||||
// look for this entity in superseding event args
|
||||
// found = must be removed, else track
|
||||
if (IsSuperceeded(eventEntity, infos, entities))
|
||||
toRemove.Add(eventEntity);
|
||||
@@ -211,7 +211,7 @@ namespace Umbraco.Core.Events
|
||||
entities.Add(Tuple.Create(eventEntity, infos));
|
||||
}
|
||||
|
||||
// remove superceded entities
|
||||
// remove superseded entities
|
||||
foreach (var entity in toRemove)
|
||||
eventObjects.Remove(entity);
|
||||
|
||||
@@ -286,13 +286,13 @@ namespace Umbraco.Core.Events
|
||||
|
||||
// determines if a given entity, appearing in a given event definition, should be filtered out,
|
||||
// considering the entities that have already been visited - an entity is filtered out if it
|
||||
// appears in another even definition, which superceedes this event definition.
|
||||
// appears in another even definition, which supersedes this event definition.
|
||||
private static bool IsSuperceeded(IEntity entity, EventDefinitionInfos infos, List<Tuple<IEntity, EventDefinitionInfos>> entities)
|
||||
{
|
||||
//var argType = meta.EventArgsType;
|
||||
var argType = infos.EventDefinition.Args.GetType();
|
||||
|
||||
// look for other instances of the same entity, coming from an event args that supercedes other event args,
|
||||
// look for other instances of the same entity, coming from an event args that supersedes other event args,
|
||||
// ie is marked with the attribute, and is not this event args (cannot supersede itself)
|
||||
var superceeding = entities
|
||||
.Where(x => x.Item2.SupersedeTypes.Length > 0 // has the attribute
|
||||
@@ -304,20 +304,20 @@ namespace Umbraco.Core.Events
|
||||
if (superceeding.Length == 0)
|
||||
return false;
|
||||
|
||||
// delete event args does NOT superceedes 'unpublished' event
|
||||
// delete event args does NOT supersedes 'unpublished' event
|
||||
if (argType.IsGenericType && argType.GetGenericTypeDefinition() == typeof(PublishEventArgs<>) && infos.EventDefinition.EventName == "Unpublished")
|
||||
return false;
|
||||
|
||||
// found occurences, need to determine if this event args is superceded
|
||||
// found occurrences, need to determine if this event args is superseded
|
||||
if (argType.IsGenericType)
|
||||
{
|
||||
// generic, must compare type arguments
|
||||
var supercededBy = superceeding.FirstOrDefault(x =>
|
||||
x.Item2.SupersedeTypes.Any(y =>
|
||||
// superceeding a generic type which has the same generic type definition
|
||||
// superseding a generic type which has the same generic type definition
|
||||
// (but ... no matter the generic type parameters? could be different?)
|
||||
y.IsGenericTypeDefinition && y == argType.GetGenericTypeDefinition()
|
||||
// or superceeding a non-generic type which is ... (but... how is this ever possible? argType *is* generic?)
|
||||
// or superceeding a non-generic type which is ... (but... how is this ever possible? argType *is* generic?
|
||||
|| y.IsGenericTypeDefinition == false && y == argType));
|
||||
return supercededBy != null;
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@ namespace Umbraco.Core.Events
|
||||
{
|
||||
/// <summary>
|
||||
/// This is used to know if the event arg attributed should supersede another event arg type when
|
||||
/// tracking events for the same entity. If one event args supercedes another then the event args that have been superseded
|
||||
/// tracking events for the same entity. If one event args supersedes another then the event args that have been superseded
|
||||
/// will mean that the event will not be dispatched or the args will be filtered to exclude the entity.
|
||||
/// </summary>
|
||||
[AttributeUsage(AttributeTargets.Class, AllowMultiple = true)]
|
||||
|
||||
@@ -58,7 +58,7 @@ namespace Umbraco.Core
|
||||
{
|
||||
var boxedMember = unary.Operand as MemberExpression;
|
||||
if (boxedMember == null)
|
||||
throw new ArgumentException("The type of property could not be infered, try specifying the type parameters explicitly. This can happen if you have tried to access PropertyInfo where the property's return type is a value type, but the expression is trying to convert it to an object");
|
||||
throw new ArgumentException("The type of property could not be inferred, try specifying the type parameters explicitly. This can happen if you have tried to access PropertyInfo where the property's return type is a value type, but the expression is trying to convert it to an object");
|
||||
else member = boxedMember;
|
||||
}
|
||||
}
|
||||
@@ -75,7 +75,7 @@ namespace Umbraco.Core
|
||||
if (type != propInfo.ReflectedType &&
|
||||
!type.IsSubclassOf(propInfo.ReflectedType))
|
||||
throw new ArgumentException(string.Format(
|
||||
"Expresion '{0}' refers to a property that is not from type {1}.",
|
||||
"Expression '{0}' refers to a property that is not from type {1}.",
|
||||
propertyLambda,
|
||||
type));
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
ResXResourceReader how to stop persisting the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
@@ -121,4 +121,4 @@
|
||||
<data name="BlockingWebConfig" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>blockingweb.config;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;Windows-1252</value>
|
||||
</data>
|
||||
</root>
|
||||
</root>
|
||||
|
||||
@@ -54,7 +54,7 @@ namespace Umbraco.Core
|
||||
{
|
||||
//I've tried to no allocate a new string with this which can be done if we use the CompareInfo.GetSortKey method which will create a new
|
||||
//byte array that we can use to write to the output, however this also allocates new objects so i really don't think the performance
|
||||
//would be much different. In any case, i'll leave this here for reference. We could write the bytes out based on the sort key,
|
||||
//would be much different. In any case, I'll leave this here for reference. We could write the bytes out based on the sort key,
|
||||
//this is how we could deal with case insensitivity without allocating another string
|
||||
//for reference see: https://stackoverflow.com/a/10452967/694494
|
||||
//we could go a step further and s.Normalize() but we're not really dealing with crazy unicode with this class so far.
|
||||
@@ -131,7 +131,7 @@ namespace Umbraco.Core
|
||||
//create a StringBuilder object
|
||||
var stringBuilder = new StringBuilder();
|
||||
|
||||
//loop to each each byte
|
||||
//loop to each byte
|
||||
foreach (var b in hashedByteArray)
|
||||
{
|
||||
//append it to our StringBuilder
|
||||
|
||||
@@ -4,11 +4,11 @@ using System.Runtime.CompilerServices;
|
||||
namespace Umbraco.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// Provides methods for encoding byte arrays into hexidecimal strings.
|
||||
/// Provides methods for encoding byte arrays into hexadecimal strings.
|
||||
/// </summary>
|
||||
internal static class HexEncoder
|
||||
{
|
||||
// LUT's that provide the hexidecimal representation of each possible byte value.
|
||||
// LUT's that provide the hexadecimal representation of each possible byte value.
|
||||
private static readonly char[] HexLutBase = new char[] { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F' };
|
||||
|
||||
// The base LUT arranged in 16x each item order. 0 * 16, 1 * 16, .... F * 16
|
||||
@@ -18,7 +18,7 @@ namespace Umbraco.Core
|
||||
private static readonly char[] HexLutLo = Enumerable.Range(0, 256).Select(x => HexLutBase[x % 0x10]).ToArray();
|
||||
|
||||
/// <summary>
|
||||
/// Converts a <see cref="T:byte[]"/> to a hexidecimal formatted <see cref="string"/> padded to 2 digits.
|
||||
/// Converts a <see cref="T:byte[]"/> to a hexadecimal formatted <see cref="string"/> padded to 2 digits.
|
||||
/// </summary>
|
||||
/// <param name="bytes">The bytes.</param>
|
||||
/// <returns>The <see cref="string"/>.</returns>
|
||||
@@ -40,7 +40,7 @@ namespace Umbraco.Core
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Converts a <see cref="T:byte[]"/> to a hexidecimal formatted <see cref="string"/> padded to 2 digits
|
||||
/// Converts a <see cref="T:byte[]"/> to a hexadecimal formatted <see cref="string"/> padded to 2 digits
|
||||
/// and split into blocks with the given char separator.
|
||||
/// </summary>
|
||||
/// <param name="bytes">The bytes.</param>
|
||||
|
||||
@@ -76,7 +76,7 @@ namespace Umbraco.Core.IO
|
||||
IEnumerable<string> GetFiles(string path, string filter);
|
||||
|
||||
/// <summary>
|
||||
/// Gets a <see cref="Stream"/> representing the file at the gieven path.
|
||||
/// Gets a <see cref="Stream"/> representing the file at the given path.
|
||||
/// </summary>
|
||||
/// <param name="path">The path to the file.</param>
|
||||
/// <returns>
|
||||
|
||||
@@ -11,7 +11,7 @@ namespace Umbraco.Core.Logging
|
||||
/// Renders the profiling results.
|
||||
/// </summary>
|
||||
/// <returns>The profiling results.</returns>
|
||||
/// <remarks>Generally used for Html rendering.</remarks>
|
||||
/// <remarks>Generally used for HTML rendering.</remarks>
|
||||
string Render();
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -92,7 +92,7 @@ namespace Umbraco.Core.Logging.Serilog
|
||||
|
||||
/// <summary>
|
||||
/// Reads settings from /config/serilog.user.config
|
||||
/// That allows a separate logging pipeline to be configured that wil not affect the main Umbraco log
|
||||
/// That allows a separate logging pipeline to be configured that will not affect the main Umbraco log
|
||||
/// </summary>
|
||||
/// <param name="logConfig">A Serilog LoggerConfiguration</param>
|
||||
public static LoggerConfiguration ReadFromUserConfigFile(this LoggerConfiguration logConfig)
|
||||
|
||||
@@ -165,7 +165,7 @@ namespace Umbraco.Core
|
||||
// which may timeout, and this is accepted - see comments below
|
||||
|
||||
// signal, then wait for the lock, then make sure the event is
|
||||
// resetted (maybe there was noone listening..)
|
||||
// reset (maybe there was noone listening..)
|
||||
_signal.Set();
|
||||
|
||||
// if more than 1 instance reach that point, one will get the lock
|
||||
@@ -175,7 +175,7 @@ namespace Umbraco.Core
|
||||
_isMainDom = true;
|
||||
|
||||
// we need to reset the event, because otherwise we would end up
|
||||
// signaling ourselves and commiting suicide immediately.
|
||||
// signaling ourselves and committing suicide immediately.
|
||||
// only 1 instance can reach that point, but other instances may
|
||||
// have started and be trying to get the lock - they will timeout,
|
||||
// which is accepted
|
||||
|
||||
@@ -71,7 +71,7 @@ namespace Umbraco.Core.Manifest
|
||||
if (jobject["editor"] == null)
|
||||
throw new InvalidOperationException("Missing 'editor' value.");
|
||||
|
||||
// explicitely assign a value editor of type ValueEditor
|
||||
// explicitly assign a value editor of type ValueEditor
|
||||
// (else the deserializer will try to read it before setting it)
|
||||
// (and besides it's an interface)
|
||||
target.ExplicitValueEditor = new DataValueEditor();
|
||||
@@ -88,7 +88,7 @@ namespace Umbraco.Core.Manifest
|
||||
|
||||
if (jobject["prevalues"] is JObject config)
|
||||
{
|
||||
// explicitely assign a configuration editor of type ConfigurationEditor
|
||||
// explicitly assign a configuration editor of type ConfigurationEditor
|
||||
// (else the deserializer will try to read it before setting it)
|
||||
// (and besides it's an interface)
|
||||
target.ExplicitConfigurationEditor = new ConfigurationEditor();
|
||||
@@ -129,12 +129,12 @@ namespace Umbraco.Core.Manifest
|
||||
// "config": { "key1": "value1", "key2": "value2" ... }
|
||||
// }
|
||||
//
|
||||
// the view is at top level, but should be down one level to be propertly
|
||||
// the view is at top level, but should be down one level to be properly
|
||||
// deserialized as a ParameterValueEditor property -> need to move it
|
||||
|
||||
if (jobject.Property("view") != null)
|
||||
{
|
||||
// explicitely assign a value editor of type ParameterValueEditor
|
||||
// explicitly assign a value editor of type ParameterValueEditor
|
||||
target.ExplicitValueEditor = new DataValueEditor();
|
||||
|
||||
// move the 'view' property
|
||||
|
||||
@@ -14,17 +14,17 @@ namespace Umbraco.Core.Migrations.Expressions.Create
|
||||
public interface ICreateBuilder : IFluentBuilder
|
||||
{
|
||||
/// <summary>
|
||||
/// Builds a Create Table expresion, and executes.
|
||||
/// Builds a Create Table expression, and executes.
|
||||
/// </summary>
|
||||
IExecutableBuilder Table<TDto>(bool withoutKeysAndIndexes = false);
|
||||
|
||||
/// <summary>
|
||||
/// Builds a Create Keys and Indexes expresion, and executes.
|
||||
/// Builds a Create Keys and Indexes expression, and executes.
|
||||
/// </summary>
|
||||
IExecutableBuilder KeysAndIndexes<TDto>();
|
||||
|
||||
/// <summary>
|
||||
/// Builds a Create Keys and Indexes expresion, and executes.
|
||||
/// Builds a Create Keys and Indexes expression, and executes.
|
||||
/// </summary>
|
||||
IExecutableBuilder KeysAndIndexes(Type typeOfDto);
|
||||
|
||||
|
||||
@@ -135,7 +135,7 @@ namespace Umbraco.Core.Migrations.Install
|
||||
_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 = "Related Links", 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()
|
||||
@@ -301,7 +301,7 @@ namespace Umbraco.Core.Migrations.Install
|
||||
_database.Insert(Constants.DatabaseSchema.Tables.DataType, "pk", false, new DataTypeDto { NodeId = 1048, EditorAlias = Constants.PropertyEditors.Aliases.MediaPicker, DbType = "Ntext" });
|
||||
_database.Insert(Constants.DatabaseSchema.Tables.DataType, "pk", false, new DataTypeDto { NodeId = 1049, EditorAlias = Constants.PropertyEditors.Aliases.MediaPicker, DbType = "Ntext",
|
||||
Configuration = "{\"multiPicker\":1}" });
|
||||
_database.Insert(Constants.DatabaseSchema.Tables.DataType, "pk", false, new DataTypeDto { NodeId = 1050, EditorAlias = Constants.PropertyEditors.Aliases.RelatedLinks, DbType = "Ntext" });
|
||||
_database.Insert(Constants.DatabaseSchema.Tables.DataType, "pk", false, new DataTypeDto { NodeId = 1050, EditorAlias = Constants.PropertyEditors.Aliases.MultiUrlPicker, DbType = "Ntext" });
|
||||
}
|
||||
|
||||
private void CreateRelationTypeData()
|
||||
|
||||
@@ -161,7 +161,7 @@ namespace Umbraco.Core.Migrations.Install
|
||||
/// </summary>
|
||||
/// <param name="result"></param>
|
||||
/// <remarks>
|
||||
/// This does not validate any database constraints that are not PKs or FKs because Umbraco does not create a database with non PK/FK contraints.
|
||||
/// This does not validate any database constraints that are not PKs or FKs because Umbraco does not create a database with non PK/FK constraints.
|
||||
/// Any unique "constraints" in the database are done with unique indexes.
|
||||
/// </remarks>
|
||||
private void ValidateDbConstraints(DatabaseSchemaResult result)
|
||||
@@ -399,7 +399,7 @@ namespace Umbraco.Core.Migrations.Install
|
||||
/// Creates a new table in the database for the specified <paramref name="modelType"/>.
|
||||
/// </summary>
|
||||
/// <param name="overwrite">Whether the table should be overwritten if it already exists.</param>
|
||||
/// <param name="modelType">The the representing the table.</param>
|
||||
/// <param name="modelType">The representing the table.</param>
|
||||
/// <param name="dataCreation"></param>
|
||||
/// <remarks>
|
||||
/// If <paramref name="modelType"/> has been decorated with an <see cref="TableNameAttribute"/>, the name from
|
||||
|
||||
@@ -61,7 +61,7 @@ namespace Umbraco.Core.Migrations
|
||||
// register the target state if we don't know it already
|
||||
// this is how we keep track of the final state - because
|
||||
// transitions could be defined in any order, that might
|
||||
// be overriden afterwards.
|
||||
// be overridden afterwards.
|
||||
if (!_transitions.ContainsKey(targetState))
|
||||
_transitions.Add(targetState, null);
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ using File = System.IO.File;
|
||||
namespace Umbraco.Core.Migrations.Upgrade.V_7_10_0
|
||||
{
|
||||
/// <summary>
|
||||
/// Renames the preview folder containing static html files to ensure it does not interfere with the MVC route
|
||||
/// Renames the preview folder containing static HTML files to ensure it does not interfere with the MVC route
|
||||
/// that is now supposed to render these views dynamically. We don't want to delete as people may have made
|
||||
/// customizations to these files that would need to be migrated to the new .cshtml view files.
|
||||
/// </summary>
|
||||
@@ -25,7 +25,7 @@ namespace Umbraco.Core.Migrations.Upgrade.V_7_10_0
|
||||
{
|
||||
Directory.Move(previewFolderPath, newPath);
|
||||
var readmeText =
|
||||
$"Static html files used for preview and canvas editing functionality no longer live in this directory.\r\n" +
|
||||
$"Static HTML files used for preview and canvas editing functionality no longer live in this directory.\r\n" +
|
||||
$"Instead they have been recreated as MVC views and can now be found in '~/Umbraco/Views/Preview'.\r\n" +
|
||||
$"See issue: http://issues.umbraco.org/issue/U4-11090";
|
||||
File.WriteAllText(Path.Combine(newPath, "readme.txt"), readmeText);
|
||||
|
||||
@@ -18,7 +18,7 @@ namespace Umbraco.Core.Migrations.Upgrade.V_7_6_0
|
||||
if (dbIndexes.Any(x => x.IndexName.InvariantEquals("IX_umbracoRelation_parentChildType")) == false)
|
||||
{
|
||||
//This will remove any corrupt/duplicate data in the relation table before the index is applied
|
||||
//Ensure this executes in a defered block which will be done inside of the migration transaction
|
||||
//Ensure this executes in a deferred block which will be done inside of the migration transaction
|
||||
var database = Database;
|
||||
|
||||
//We need to check if this index has corrupted data and then clear that data
|
||||
|
||||
@@ -27,7 +27,7 @@ namespace Umbraco.Core.Migrations.Upgrade.V_7_7_0
|
||||
var constraints = SqlSyntax.GetConstraintsPerColumn(Context.Database).Distinct().ToArray();
|
||||
var columns = SqlSyntax.GetColumnsInSchema(Context.Database).ToArray();
|
||||
|
||||
//In some very rare cases, there might alraedy be user group tables that we'll need to remove first
|
||||
//In some very rare cases, there might already be user group tables that we'll need to remove first
|
||||
//but of course we don't want to remove the tables we will be creating below if they already exist so
|
||||
//need to do some checks first since these old rare tables have a different schema
|
||||
RemoveOldTablesIfExist(tables, columns);
|
||||
@@ -83,7 +83,7 @@ namespace Umbraco.Core.Migrations.Upgrade.V_7_7_0
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// In some very rare cases, there might alraedy be user group tables that we'll need to remove first
|
||||
/// In some very rare cases, there might already be user group tables that we'll need to remove first
|
||||
/// but of course we don't want to remove the tables we will be creating below if they already exist so
|
||||
/// need to do some checks first since these old rare tables have a different schema
|
||||
/// </summary>
|
||||
|
||||
@@ -14,7 +14,7 @@ namespace Umbraco.Core.Migrations.Upgrade.V_7_7_0
|
||||
|
||||
public override void Migrate()
|
||||
{
|
||||
//Don't exeucte if the column is already there
|
||||
//Don't execute if the column is already there
|
||||
var columns = SqlSyntax.GetColumnsInSchema(Context.Database).ToArray();
|
||||
|
||||
if (columns.Any(x => x.TableName.InvariantEquals("umbracoUser") && x.ColumnName.InvariantEquals("createDate")) == false)
|
||||
|
||||
@@ -16,7 +16,6 @@ namespace Umbraco.Core.Migrations.Upgrade.V_8_0_0
|
||||
RenameDataType(Constants.PropertyEditors.Aliases.MediaPicker + "2", Constants.PropertyEditors.Aliases.MediaPicker);
|
||||
RenameDataType(Constants.PropertyEditors.Aliases.MemberPicker + "2", Constants.PropertyEditors.Aliases.MemberPicker);
|
||||
RenameDataType(Constants.PropertyEditors.Aliases.MultiNodeTreePicker + "2", Constants.PropertyEditors.Aliases.MultiNodeTreePicker);
|
||||
RenameDataType(Constants.PropertyEditors.Aliases.RelatedLinks + "2", Constants.PropertyEditors.Aliases.RelatedLinks);
|
||||
RenameDataType("Umbraco.TextboxMultiple", Constants.PropertyEditors.Aliases.TextArea, false);
|
||||
RenameDataType("Umbraco.Textbox", Constants.PropertyEditors.Aliases.TextBox, false);
|
||||
}
|
||||
|
||||
@@ -391,7 +391,7 @@ namespace Umbraco.Core.Models
|
||||
#region Dirty
|
||||
|
||||
/// <inheritdoc />
|
||||
/// <remarks>Overriden to include user properties.</remarks>
|
||||
/// <remarks>Overridden to include user properties.</remarks>
|
||||
public override void ResetDirtyProperties(bool rememberDirty)
|
||||
{
|
||||
base.ResetDirtyProperties(rememberDirty);
|
||||
@@ -408,14 +408,14 @@ namespace Umbraco.Core.Models
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
/// <remarks>Overriden to include user properties.</remarks>
|
||||
/// <remarks>Overridden to include user properties.</remarks>
|
||||
public override bool IsDirty()
|
||||
{
|
||||
return IsEntityDirty() || this.IsAnyUserPropertyDirty();
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
/// <remarks>Overriden to include user properties.</remarks>
|
||||
/// <remarks>Overridden to include user properties.</remarks>
|
||||
public override bool WasDirty()
|
||||
{
|
||||
return WasEntityDirty() || this.WasAnyUserPropertyDirty();
|
||||
@@ -438,7 +438,7 @@ namespace Umbraco.Core.Models
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
/// <remarks>Overriden to include user properties.</remarks>
|
||||
/// <remarks>Overridden to include user properties.</remarks>
|
||||
public override bool IsPropertyDirty(string propertyName)
|
||||
{
|
||||
if (base.IsPropertyDirty(propertyName))
|
||||
@@ -448,7 +448,7 @@ namespace Umbraco.Core.Models
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
/// <remarks>Overriden to include user properties.</remarks>
|
||||
/// <remarks>Overridden to include user properties.</remarks>
|
||||
public override bool WasPropertyDirty(string propertyName)
|
||||
{
|
||||
if (base.WasPropertyDirty(propertyName))
|
||||
@@ -458,7 +458,7 @@ namespace Umbraco.Core.Models
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
/// <remarks>Overriden to include user properties.</remarks>
|
||||
/// <remarks>Overridden to include user properties.</remarks>
|
||||
public override IEnumerable<string> GetDirtyProperties()
|
||||
{
|
||||
var instanceProperties = base.GetDirtyProperties();
|
||||
@@ -467,7 +467,7 @@ namespace Umbraco.Core.Models
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
/// <remarks>Overriden to include user properties.</remarks>
|
||||
/// <remarks>Overridden to include user properties.</remarks>
|
||||
public override IEnumerable<string> GetWereDirtyProperties()
|
||||
{
|
||||
var instanceProperties = base.GetWereDirtyProperties();
|
||||
@@ -479,7 +479,7 @@ namespace Umbraco.Core.Models
|
||||
|
||||
/// <inheritdoc />
|
||||
/// <remarks>
|
||||
/// Overriden to deal with specific object instances
|
||||
/// Overridden to deal with specific object instances
|
||||
/// </remarks>
|
||||
protected override void PerformDeepClone(object clone)
|
||||
{
|
||||
|
||||
@@ -91,7 +91,7 @@ namespace Umbraco.Core.Models
|
||||
|| (propertyInfo.PropertyType.IsInterface && propertyInfo.PropertyType.IsGenericType == false))
|
||||
{
|
||||
//if its an array, we'll create a list to work with first and then convert to array later
|
||||
//otherwise if its just a regular derivitave of IEnumerable, we can use a list too
|
||||
//otherwise if its just a regular derivative of IEnumerable, we can use a list too
|
||||
return new ClonePropertyInfo(propertyInfo) { GenericListType = typeof(List<object>) };
|
||||
}
|
||||
//skip instead of trying to create instance of abstract or interface
|
||||
|
||||
@@ -140,7 +140,7 @@ namespace Umbraco.Core.Models.Entities
|
||||
|
||||
// same identity if
|
||||
// - same object (reference equals)
|
||||
// - or same Clr type, both have identities, and they are identical
|
||||
// - or same CLR type, both have identities, and they are identical
|
||||
|
||||
if (ReferenceEquals(this, other))
|
||||
return true;
|
||||
|
||||
@@ -18,7 +18,7 @@ namespace Umbraco.Core.Models.Entities
|
||||
/// Gets additional data for this entity.
|
||||
/// </summary>
|
||||
/// <remarks>Can be empty, but never null. To avoid allocating, do not
|
||||
/// test for emptyness, but use <see cref="HasAdditionalData"/> instead.</remarks>
|
||||
/// test for emptiness, but use <see cref="HasAdditionalData"/> instead.</remarks>
|
||||
IDictionary<string, object> AdditionalData { get; }
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -68,7 +68,7 @@ namespace Umbraco.Core.Models
|
||||
/// </summary>
|
||||
/// <param name="culture">The culture.</param>
|
||||
/// <param name="segment">The segment.</param>
|
||||
/// <param name="wildcards">A value indicating whether wilcards are supported.</param>
|
||||
/// <param name="wildcards">A value indicating whether wildcard are supported.</param>
|
||||
/// <returns>True if the combination is valid; otherwise false.</returns>
|
||||
/// <remarks>
|
||||
/// <para>The combination must match the content type variation exactly. For instance, if the content type varies by culture,
|
||||
@@ -81,7 +81,7 @@ namespace Umbraco.Core.Models
|
||||
/// </summary>
|
||||
/// <param name="culture">The culture.</param>
|
||||
/// <param name="segment">The segment.</param>
|
||||
/// <param name="wildcards">A value indicating whether wilcards are supported.</param>
|
||||
/// <param name="wildcards">A value indicating whether wildcard are supported.</param>
|
||||
/// <returns>True if the combination is valid; otherwise false.</returns>
|
||||
/// <remarks>
|
||||
/// <para>The combination must be valid for properties of the content type. For instance, if the content type varies by culture,
|
||||
|
||||
@@ -31,7 +31,7 @@ namespace Umbraco.Core.Models
|
||||
bool AddContentType(IContentTypeComposition contentType);
|
||||
|
||||
/// <summary>
|
||||
/// Removes a ContentType with the supplied alias from the the list of composite ContentTypes
|
||||
/// Removes a ContentType with the supplied alias from the list of composite ContentTypes
|
||||
/// </summary>
|
||||
/// <param name="alias">Alias of a <see cref="IContentType"/></param>
|
||||
/// <returns>True if ContentType was removed, otherwise returns False</returns>
|
||||
|
||||
@@ -95,7 +95,7 @@ namespace Umbraco.Core.Models.Identity
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if an Id has been set on this object this will be false if the object is new and not peristed to the database
|
||||
/// Returns true if an Id has been set on this object this will be false if the object is new and not persisted to the database
|
||||
/// </summary>
|
||||
public bool HasIdentity => _hasIdentity;
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ namespace Umbraco.Core.Models.Identity
|
||||
public interface IIdentityUserLogin : IEntity, IRememberBeingDirty
|
||||
{
|
||||
/// <summary>
|
||||
/// The login provider for the login (i.e. facebook, google)
|
||||
/// The login provider for the login (i.e. Facebook, Google)
|
||||
///
|
||||
/// </summary>
|
||||
string LoginProvider { get; set; }
|
||||
|
||||
@@ -4,7 +4,7 @@ using Umbraco.Core.Models.Entities;
|
||||
namespace Umbraco.Core.Models.Identity
|
||||
{
|
||||
/// <summary>
|
||||
/// Entity type for a user's login (i.e. facebook, google)
|
||||
/// Entity type for a user's login (i.e. Facebook, Google)
|
||||
///
|
||||
/// </summary>
|
||||
public class IdentityUserLogin : EntityBase, IIdentityUserLogin
|
||||
@@ -26,7 +26,7 @@ namespace Umbraco.Core.Models.Identity
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The login provider for the login (i.e. facebook, google)
|
||||
/// The login provider for the login (i.e. Facebook, Google)
|
||||
///
|
||||
/// </summary>
|
||||
public string LoginProvider { get; set; }
|
||||
|
||||
@@ -15,7 +15,7 @@ namespace Umbraco.Core.Models
|
||||
/// <summary>
|
||||
/// Constructor for creating a Media object
|
||||
/// </summary>
|
||||
/// <param name="name">ame of the Media object</param>
|
||||
/// <param name="name">name of the Media object</param>
|
||||
/// <param name="parent">Parent <see cref="IMedia"/> object</param>
|
||||
/// <param name="contentType">MediaType for the current Media object</param>
|
||||
public Media(string name, IMedia parent, IMediaType contentType)
|
||||
@@ -25,7 +25,7 @@ namespace Umbraco.Core.Models
|
||||
/// <summary>
|
||||
/// Constructor for creating a Media object
|
||||
/// </summary>
|
||||
/// <param name="name">ame of the Media object</param>
|
||||
/// <param name="name">name of the Media object</param>
|
||||
/// <param name="parent">Parent <see cref="IMedia"/> object</param>
|
||||
/// <param name="contentType">MediaType for the current Media object</param>
|
||||
/// <param name="properties">Collection of properties</param>
|
||||
@@ -38,7 +38,7 @@ namespace Umbraco.Core.Models
|
||||
/// <summary>
|
||||
/// Constructor for creating a Media object
|
||||
/// </summary>
|
||||
/// <param name="name">ame of the Media object</param>
|
||||
/// <param name="name">name of the Media object</param>
|
||||
/// <param name="parentId">Id of the Parent IMedia</param>
|
||||
/// <param name="contentType">MediaType for the current Media object</param>
|
||||
public Media(string name, int parentId, IMediaType contentType)
|
||||
|
||||
@@ -46,7 +46,7 @@ namespace Umbraco.Core.Models
|
||||
}
|
||||
}
|
||||
|
||||
// hrm, without knowing what it is, just adding a string here might not be very nice
|
||||
// Without knowing what it is, just adding a string here might not be very nice
|
||||
return string.Empty;
|
||||
}
|
||||
|
||||
|
||||
@@ -226,7 +226,7 @@ namespace Umbraco.Core.Models
|
||||
/// Gets or sets the raw password answer value
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// For security reasons this value should be encrypted, the encryption process is handled by the memberhip provider
|
||||
/// For security reasons this value should be encrypted, the encryption process is handled by the membership provider
|
||||
/// Alias: umbracoMemberPasswordRetrievalAnswer
|
||||
///
|
||||
/// Part of the standard properties collection.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
namespace Umbraco.Core.Models.Membership
|
||||
{
|
||||
/// <summary>
|
||||
/// Defines the the User Profile interface
|
||||
/// Defines the User Profile interface
|
||||
/// </summary>
|
||||
public interface IProfile
|
||||
{
|
||||
|
||||
@@ -24,7 +24,7 @@ namespace Umbraco.Core.Models.Membership
|
||||
|
||||
private static readonly Lazy<PropertySelectors> Ps = new Lazy<PropertySelectors>();
|
||||
|
||||
// ReSharper disable once ClassNeverInstantiated.Local // lazy-instanciated in Ps
|
||||
// ReSharper disable once ClassNeverInstantiated.Local // lazy-instantiated in Ps
|
||||
private class PropertySelectors
|
||||
{
|
||||
public readonly PropertyInfo NameSelector = ExpressionHelper.GetPropertyInfo<UserGroup, string>(x => x.Name);
|
||||
|
||||
@@ -76,7 +76,7 @@ namespace Umbraco.Core.Models
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the Clr type corresponding to an object type Guid.
|
||||
/// Gets the CLR type corresponding to an object type Guid.
|
||||
/// </summary>
|
||||
public static Type GetClrType(Guid objectType)
|
||||
{
|
||||
@@ -145,7 +145,7 @@ namespace Umbraco.Core.Models
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the Clr type corresponding to this Umbraco object type.
|
||||
/// Gets the CLR type corresponding to this Umbraco object type.
|
||||
/// </summary>
|
||||
public static Type GetClrType(this UmbracoObjectTypes objectType)
|
||||
{
|
||||
|
||||
@@ -74,7 +74,7 @@ namespace Umbraco.Core.Models
|
||||
{
|
||||
_addLocker.EnterWriteLock();
|
||||
|
||||
//Note this is done to ensure existig groups can be renamed
|
||||
//Note this is done to ensure existing groups can be renamed
|
||||
if (item.HasIdentity && item.Id > 0)
|
||||
{
|
||||
var exists = Contains(item.Id);
|
||||
|
||||
@@ -287,7 +287,7 @@ namespace Umbraco.Core.Models
|
||||
/// Converts a value assigned to a property.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// <para>The input value can be pretty much anything, and is converted to the actual Clr type
|
||||
/// <para>The input value can be pretty much anything, and is converted to the actual CLR type
|
||||
/// expected by the property (eg an integer if the property values are integers).</para>
|
||||
/// <para>Throws if the value cannot be converted.</para>
|
||||
/// </remarks>
|
||||
@@ -345,7 +345,7 @@ namespace Umbraco.Core.Models
|
||||
var convDecimal = value.TryConvertTo<decimal>();
|
||||
if (convDecimal)
|
||||
{
|
||||
// need to normalize the value (change the scaling factor and remove trailing zeroes)
|
||||
// need to normalize the value (change the scaling factor and remove trailing zeros)
|
||||
// because the underlying database is going to mess with the scaling factor anyways.
|
||||
converted = convDecimal.Result.Normalize();
|
||||
return true;
|
||||
|
||||
@@ -24,10 +24,10 @@ namespace Umbraco.Core.Models.PublishedContent
|
||||
IList CreateModelList(string alias);
|
||||
|
||||
/// <summary>
|
||||
/// Maps a Clr type that may contain model types, to an actual Clr type.
|
||||
/// Maps a CLR type that may contain model types, to an actual CLR type.
|
||||
/// </summary>
|
||||
/// <param name="type">The Clr type.</param>
|
||||
/// <returns>The actual Clr type.</returns>
|
||||
/// <param name="type">The CLR type.</param>
|
||||
/// <returns>The actual CLR type.</returns>
|
||||
/// <remarks>See <seealso cref="ModelType"/> for more details.</remarks>
|
||||
Type MapModelType(Type type);
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
/// Gets the source value of the property.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// <para>The source value is whatever was passed to the property when it was instanciated, and it is
|
||||
/// <para>The source value is whatever was passed to the property when it was instantiated, and it is
|
||||
/// somewhat implementation-dependent -- depending on how the IPublishedCache is implemented.</para>
|
||||
/// <para>The XmlPublishedCache source values are strings exclusively since they come from the Xml cache.</para>
|
||||
/// <para>For other caches that get their source value from the database, it would be either a string,
|
||||
|
||||
@@ -9,7 +9,7 @@ namespace Umbraco.Core.Models.PublishedContent
|
||||
{
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Represents the Clr type of a model.
|
||||
/// Represents the CLR type of a model.
|
||||
/// </summary>
|
||||
/// <example>
|
||||
/// ModelType.For("alias")
|
||||
@@ -43,11 +43,11 @@ namespace Umbraco.Core.Models.PublishedContent
|
||||
=> new ModelType(alias);
|
||||
|
||||
/// <summary>
|
||||
/// Gets the actual Clr type by replacing model types, if any.
|
||||
/// Gets the actual CLR type by replacing model types, if any.
|
||||
/// </summary>
|
||||
/// <param name="type">The type.</param>
|
||||
/// <param name="modelTypes">The model types map.</param>
|
||||
/// <returns>The actual Clr type.</returns>
|
||||
/// <returns>The actual CLR type.</returns>
|
||||
public static Type Map(Type type, Dictionary<string, Type> modelTypes)
|
||||
=> Map(type, modelTypes, false);
|
||||
|
||||
@@ -82,11 +82,11 @@ namespace Umbraco.Core.Models.PublishedContent
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the actual Clr type name by replacing model types, if any.
|
||||
/// Gets the actual CLR type name by replacing model types, if any.
|
||||
/// </summary>
|
||||
/// <param name="type">The type.</param>
|
||||
/// <param name="map">The model types map.</param>
|
||||
/// <returns>The actual Clr type name.</returns>
|
||||
/// <returns>The actual CLR type name.</returns>
|
||||
public static string MapToName(Type type, Dictionary<string, string> map)
|
||||
=> MapToName(type, map, false);
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ namespace Umbraco.Core.Models.PublishedContent
|
||||
/// Initializes a new instance of the <see cref="PublishedContentType"/> class with a content type.
|
||||
/// </summary>
|
||||
public PublishedContentType(IContentTypeComposition contentType, IPublishedContentTypeFactory factory)
|
||||
: this(contentType.Id, contentType.Alias, contentType.GetItemType(), contentType.CompositionAliases(), contentType.Variations)
|
||||
: this(contentType.Id, contentType.Alias, contentType.GetItemType(), contentType.CompositionAliases(), contentType.Variations, contentType.IsElement)
|
||||
{
|
||||
var propertyTypes = contentType.CompositionPropertyTypes
|
||||
.Select(x => factory.CreatePropertyType(this, x))
|
||||
@@ -31,8 +31,6 @@ namespace Umbraco.Core.Models.PublishedContent
|
||||
|
||||
_propertyTypes = propertyTypes.ToArray();
|
||||
|
||||
IsElement = contentType.IsElement;
|
||||
|
||||
InitializeIndexes();
|
||||
}
|
||||
|
||||
@@ -43,8 +41,8 @@ namespace Umbraco.Core.Models.PublishedContent
|
||||
/// <para>This constructor is for tests and is not intended to be used directly from application code.</para>
|
||||
/// <para>Values are assumed to be consisted and are not checked.</para>
|
||||
/// </remarks>
|
||||
public PublishedContentType(int id, string alias, PublishedItemType itemType, IEnumerable<string> compositionAliases, IEnumerable<PublishedPropertyType> propertyTypes, ContentVariation variations)
|
||||
: this (id, alias, itemType, compositionAliases, variations)
|
||||
public PublishedContentType(int id, string alias, PublishedItemType itemType, IEnumerable<string> compositionAliases, IEnumerable<PublishedPropertyType> propertyTypes, ContentVariation variations, bool isElement = false)
|
||||
: this (id, alias, itemType, compositionAliases, variations, isElement)
|
||||
{
|
||||
var propertyTypesA = propertyTypes.ToArray();
|
||||
foreach (var propertyType in propertyTypesA)
|
||||
@@ -54,13 +52,14 @@ namespace Umbraco.Core.Models.PublishedContent
|
||||
InitializeIndexes();
|
||||
}
|
||||
|
||||
private PublishedContentType(int id, string alias, PublishedItemType itemType, IEnumerable<string> compositionAliases, ContentVariation variations)
|
||||
private PublishedContentType(int id, string alias, PublishedItemType itemType, IEnumerable<string> compositionAliases, ContentVariation variations, bool isElement)
|
||||
{
|
||||
Id = id;
|
||||
Alias = alias;
|
||||
ItemType = itemType;
|
||||
CompositionAliases = new HashSet<string>(compositionAliases, StringComparer.InvariantCultureIgnoreCase);
|
||||
Variations = variations;
|
||||
IsElement = isElement;
|
||||
}
|
||||
|
||||
private void InitializeIndexes()
|
||||
|
||||
@@ -32,15 +32,15 @@ namespace Umbraco.Core.Models.PublishedContent
|
||||
}
|
||||
|
||||
// for tests
|
||||
internal PublishedContentType CreateContentType(int id, string alias, IEnumerable<PublishedPropertyType> propertyTypes, ContentVariation variations = ContentVariation.Nothing)
|
||||
internal PublishedContentType CreateContentType(int id, string alias, IEnumerable<PublishedPropertyType> propertyTypes, ContentVariation variations = ContentVariation.Nothing, bool isElement = false)
|
||||
{
|
||||
return new PublishedContentType(id, alias, PublishedItemType.Content, Enumerable.Empty<string>(), propertyTypes, variations);
|
||||
return new PublishedContentType(id, alias, PublishedItemType.Content, Enumerable.Empty<string>(), propertyTypes, variations, isElement);
|
||||
}
|
||||
|
||||
// for tests
|
||||
internal PublishedContentType CreateContentType(int id, string alias, IEnumerable<string> compositionAliases, IEnumerable<PublishedPropertyType> propertyTypes, ContentVariation variations = ContentVariation.Nothing)
|
||||
internal PublishedContentType CreateContentType(int id, string alias, IEnumerable<string> compositionAliases, IEnumerable<PublishedPropertyType> propertyTypes, ContentVariation variations = ContentVariation.Nothing, bool isElement = false)
|
||||
{
|
||||
return new PublishedContentType(id, alias, PublishedItemType.Content, compositionAliases, propertyTypes, variations);
|
||||
return new PublishedContentType(id, alias, PublishedItemType.Content, compositionAliases, propertyTypes, variations, isElement);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
|
||||
@@ -31,7 +31,7 @@ namespace Umbraco.Core.Models.PublishedContent
|
||||
public int Id { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the dat type editor alias.
|
||||
/// Gets the data type editor alias.
|
||||
/// </summary>
|
||||
public string EditorAlias { get; }
|
||||
|
||||
|
||||
@@ -283,11 +283,11 @@ namespace Umbraco.Core.Models.PublishedContent
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the property model Clr type.
|
||||
/// Gets the property model CLR type.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// <para>The model Clr type may be a <see cref="ModelType"/> type, or may contain <see cref="ModelType"/> types.</para>
|
||||
/// <para>For the actual Clr type, see <see cref="ClrType"/>.</para>
|
||||
/// <para>The model CLR type may be a <see cref="ModelType"/> type, or may contain <see cref="ModelType"/> types.</para>
|
||||
/// <para>For the actual CLR type, see <see cref="ClrType"/>.</para>
|
||||
/// </remarks>
|
||||
public Type ModelClrType
|
||||
{
|
||||
@@ -299,12 +299,12 @@ namespace Umbraco.Core.Models.PublishedContent
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the property Clr type.
|
||||
/// Gets the property CLR type.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// <para>Returns the actual Clr type which does not contain <see cref="ModelType"/> types.</para>
|
||||
/// <para>Returns the actual CLR type which does not contain <see cref="ModelType"/> types.</para>
|
||||
/// <para>Mapping from <see cref="ModelClrType"/> may throw if some <see cref="ModelType"/> instances
|
||||
/// could not be mapped to actual Clr types.</para>
|
||||
/// could not be mapped to actual CLR types.</para>
|
||||
/// </remarks>
|
||||
public Type ClrType
|
||||
{
|
||||
|
||||
@@ -26,13 +26,13 @@ namespace Umbraco.Core.Models
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initialiazes a new instance of the <see cref="ServerRegistration"/> class.
|
||||
/// Initializes a new instance of the <see cref="ServerRegistration"/> class.
|
||||
/// </summary>
|
||||
public ServerRegistration()
|
||||
{ }
|
||||
|
||||
/// <summary>
|
||||
/// Initialiazes a new instance of the <see cref="ServerRegistration"/> class.
|
||||
/// Initializes a new instance of the <see cref="ServerRegistration"/> class.
|
||||
/// </summary>
|
||||
/// <param name="id">The unique id of the server registration.</param>
|
||||
/// <param name="serverAddress">The server url.</param>
|
||||
@@ -54,7 +54,7 @@ namespace Umbraco.Core.Models
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initialiazes a new instance of the <see cref="ServerRegistration"/> class.
|
||||
/// Initializes a new instance of the <see cref="ServerRegistration"/> class.
|
||||
/// </summary>
|
||||
/// <param name="serverAddress">The server url.</param>
|
||||
/// <param name="serverIdentity">The unique server identity.</param>
|
||||
|
||||
@@ -5,7 +5,7 @@ using Umbraco.Core.CodeAnnotations;
|
||||
namespace Umbraco.Core.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// Enum used to represent the Umbraco Object Types and thier associated GUIDs
|
||||
/// Enum used to represent the Umbraco Object Types and their associated GUIDs
|
||||
/// </summary>
|
||||
public enum UmbracoObjectTypes
|
||||
{
|
||||
|
||||
@@ -47,7 +47,7 @@ namespace Umbraco.Core.Models
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Tries to lookup the user's gravatar to see if the endpoint can be reached, if so it returns the valid URL
|
||||
/// Tries to lookup the user's Gravatar to see if the endpoint can be reached, if so it returns the valid URL
|
||||
/// </summary>
|
||||
/// <param name="user"></param>
|
||||
/// <param name="cache"></param>
|
||||
@@ -59,7 +59,7 @@ namespace Umbraco.Core.Models
|
||||
// If FIPS is required, never check the Gravatar service as it only supports MD5 hashing.
|
||||
// Unfortunately, if the FIPS setting is enabled on Windows, using MD5 will throw an exception
|
||||
// and the website will not run.
|
||||
// Also, check if the user has explicitly removed all avatars including a gravatar, this will be possible and the value will be "none"
|
||||
// Also, check if the user has explicitly removed all avatars including a Gravatar, this will be possible and the value will be "none"
|
||||
if (user.Avatar == "none" || CryptoConfig.AllowOnlyFipsAlgorithms)
|
||||
{
|
||||
return new string[0];
|
||||
@@ -70,7 +70,7 @@ namespace Umbraco.Core.Models
|
||||
var gravatarHash = user.Email.ToMd5();
|
||||
var gravatarUrl = "https://www.gravatar.com/avatar/" + gravatarHash + "?d=404";
|
||||
|
||||
//try gravatar
|
||||
//try Gravatar
|
||||
var gravatarAccess = cache.GetCacheItem<bool>("UserAvatar" + user.Id, () =>
|
||||
{
|
||||
// Test if we can reach this URL, will fail when there's network or firewall errors
|
||||
|
||||
@@ -38,7 +38,7 @@ namespace Umbraco.Core
|
||||
catch
|
||||
{
|
||||
//if we get here it means we cannot access the machine name
|
||||
throw new ApplicationException("Cannot resolve the current machine name eithe by Environment.MachineName or by Dns.GetHostname()");
|
||||
throw new ApplicationException("Cannot resolve the current machine name either by Environment.MachineName or by Dns.GetHostname()");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -153,7 +153,7 @@ namespace Umbraco.Core
|
||||
// Recursively call into this method with the inner (not-nullable) type and handle the outcome
|
||||
var inner = input.TryConvertTo(underlying);
|
||||
|
||||
// And if sucessful, fall on through to rewrap in a nullable; if failed, pass on the exception
|
||||
// And if successful, fall on through to rewrap in a nullable; if failed, pass on the exception
|
||||
if (inner.Success)
|
||||
{
|
||||
input = inner.Result; // Now fall on through...
|
||||
@@ -216,7 +216,7 @@ namespace Umbraco.Core
|
||||
return Attempt.Succeed(input);
|
||||
}
|
||||
|
||||
// Re-check convertables since we altered the input through recursion
|
||||
// Re-check convertibles since we altered the input through recursion
|
||||
if (input is IConvertible convertible2)
|
||||
{
|
||||
return Attempt.Succeed(Convert.ChangeType(convertible2, target));
|
||||
@@ -391,7 +391,7 @@ namespace Umbraco.Core
|
||||
}
|
||||
internal static void CheckThrowObjectDisposed(this IDisposable disposable, bool isDisposed, string objectname)
|
||||
{
|
||||
//TODO: Localise this exception
|
||||
//TODO: Localize this exception
|
||||
if (isDisposed)
|
||||
throw new ObjectDisposedException(objectname);
|
||||
}
|
||||
|
||||
@@ -153,7 +153,7 @@ namespace Umbraco.Core.Packaging
|
||||
{
|
||||
if (actionsElement == null) return Enumerable.Empty<PackageAction>();
|
||||
|
||||
//invariant check ... because people can realy enter anything :/
|
||||
//invariant check ... because people can really enter anything :/
|
||||
if (!string.Equals("actions", actionsElement.Name.LocalName, StringComparison.InvariantCultureIgnoreCase))
|
||||
throw new FormatException("Must be \"<actions>\" as root");
|
||||
|
||||
@@ -161,7 +161,7 @@ namespace Umbraco.Core.Packaging
|
||||
|
||||
var actionElementName = actionsElement.Elements().First().Name.LocalName;
|
||||
|
||||
//invariant check ... because people can realy enter anything :/
|
||||
//invariant check ... because people can really enter anything :/
|
||||
if (!string.Equals("action", actionElementName, StringComparison.InvariantCultureIgnoreCase))
|
||||
throw new FormatException("Must be \"<action\" as element");
|
||||
|
||||
@@ -170,7 +170,7 @@ namespace Umbraco.Core.Packaging
|
||||
{
|
||||
var aliasAttr = e.Attribute("alias") ?? e.Attribute("Alias"); //allow both ... because people can really enter anything :/
|
||||
if (aliasAttr == null)
|
||||
throw new ArgumentException("missing \"alias\" atribute in alias element", nameof(actionsElement));
|
||||
throw new ArgumentException("missing \"alias\" attribute in alias element", nameof(actionsElement));
|
||||
|
||||
var packageAction = new PackageAction
|
||||
{
|
||||
|
||||
@@ -8,7 +8,7 @@ namespace Umbraco.Core.Packaging
|
||||
public interface IPackageInstallation
|
||||
{
|
||||
/// <summary>
|
||||
/// This will run the uninstallation sequence for this <see cref="PackageDefinition"/>
|
||||
/// This will run the uninstall sequence for this <see cref="PackageDefinition"/>
|
||||
/// </summary>
|
||||
/// <param name="packageDefinition"></param>
|
||||
/// <param name="userId"></param>
|
||||
|
||||
@@ -7,7 +7,7 @@ using Umbraco.Core._Legacy.PackageActions;
|
||||
namespace Umbraco.Core.Packaging
|
||||
{
|
||||
/// <summary>
|
||||
/// Package actions are executed on packge install / uninstall.
|
||||
/// Package actions are executed on package install / uninstall.
|
||||
/// </summary>
|
||||
internal class PackageActionRunner : IPackageActionRunner
|
||||
{
|
||||
|
||||
@@ -182,7 +182,7 @@ namespace Umbraco.Core.Packaging
|
||||
/// <param name="parentId">Optional parent Id for the content being imported</param>
|
||||
/// <param name="importedDocumentTypes">A dictionary of already imported document types (basically used as a cache)</param>
|
||||
/// <param name="userId">Optional Id of the user performing the import</param>
|
||||
/// <returns>An enumrable list of generated content</returns>
|
||||
/// <returns>An enumerable list of generated content</returns>
|
||||
public IEnumerable<IContent> ImportContent(CompiledPackageDocument packageDocument, int parentId, IDictionary<string, IContentType> importedDocumentTypes, int userId)
|
||||
{
|
||||
var element = packageDocument.XmlData;
|
||||
@@ -343,7 +343,7 @@ namespace Umbraco.Core.Packaging
|
||||
/// </summary>
|
||||
/// <param name="docTypeElements">Xml to import</param>
|
||||
/// <param name="userId">Optional id of the User performing the operation. Default is zero (admin).</param>
|
||||
/// <returns>An enumrable list of generated ContentTypes</returns>
|
||||
/// <returns>An enumerable list of generated ContentTypes</returns>
|
||||
public IEnumerable<IContentType> ImportDocumentTypes(IEnumerable<XElement> docTypeElements, int userId)
|
||||
{
|
||||
return ImportDocumentTypes(docTypeElements.ToList(), true, userId);
|
||||
@@ -355,12 +355,12 @@ namespace Umbraco.Core.Packaging
|
||||
/// <param name="unsortedDocumentTypes">Xml to import</param>
|
||||
/// <param name="importStructure">Boolean indicating whether or not to import the </param>
|
||||
/// <param name="userId">Optional id of the User performing the operation. Default is zero (admin).</param>
|
||||
/// <returns>An enumrable list of generated ContentTypes</returns>
|
||||
/// <returns>An enumerable list of generated ContentTypes</returns>
|
||||
public IEnumerable<IContentType> ImportDocumentTypes(IReadOnlyCollection<XElement> unsortedDocumentTypes, bool importStructure, int userId)
|
||||
{
|
||||
var importedContentTypes = new Dictionary<string, IContentType>();
|
||||
|
||||
//When you are importing a single doc type we have to assume that the depedencies are already there.
|
||||
//When you are importing a single doc type we have to assume that the dependencies are already there.
|
||||
//Otherwise something like uSync won't work.
|
||||
var graph = new TopoGraph<string, TopoGraph.Node<string, XElement>>(x => x.Key, x => x.Dependencies);
|
||||
var isSingleDocTypeImport = unsortedDocumentTypes.Count == 1;
|
||||
@@ -437,7 +437,7 @@ namespace Umbraco.Core.Packaging
|
||||
if (importStructure)
|
||||
{
|
||||
var updatedContentTypes = new List<IContentType>();
|
||||
//Update the structure here - we can't do it untill all DocTypes have been created
|
||||
//Update the structure here - we can't do it until all DocTypes have been created
|
||||
foreach (var documentType in documentTypes)
|
||||
{
|
||||
var alias = documentType.Element("Info").Element("Alias").Value;
|
||||
@@ -796,7 +796,7 @@ namespace Umbraco.Core.Packaging
|
||||
/// </summary>
|
||||
/// <param name="dataTypeElements">Xml to import</param>
|
||||
/// <param name="userId">Optional id of the user</param>
|
||||
/// <returns>An enumrable list of generated DataTypeDefinitions</returns>
|
||||
/// <returns>An enumerable list of generated DataTypeDefinitions</returns>
|
||||
public IEnumerable<IDataType> ImportDataTypes(IReadOnlyCollection<XElement> dataTypeElements, int userId)
|
||||
{
|
||||
var dataTypes = new List<IDataType>();
|
||||
@@ -815,7 +815,7 @@ namespace Umbraco.Core.Packaging
|
||||
parentId = importedFolders[dataTypeDefinitionName];
|
||||
|
||||
var definition = _dataTypeService.GetDataType(dataTypeDefinitionId);
|
||||
//If the datatypedefinition doesn't already exist we create a new new according to the one in the package xml
|
||||
//If the datatype definition doesn't already exist we create a new according to the one in the package xml
|
||||
if (definition == null)
|
||||
{
|
||||
var databaseType = databaseTypeAttribute?.Value.EnumParse<ValueStorageType>(true) ?? ValueStorageType.Ntext;
|
||||
@@ -1195,7 +1195,7 @@ namespace Umbraco.Core.Packaging
|
||||
/// </summary>
|
||||
/// <param name="templateElements">Xml to import</param>
|
||||
/// <param name="userId">Optional user id</param>
|
||||
/// <returns>An enumrable list of generated Templates</returns>
|
||||
/// <returns>An enumerable list of generated Templates</returns>
|
||||
public IEnumerable<ITemplate> ImportTemplates(IReadOnlyCollection<XElement> templateElements, int userId)
|
||||
{
|
||||
var templates = new List<ITemplate>();
|
||||
|
||||
@@ -56,7 +56,7 @@ namespace Umbraco.Core.Packaging
|
||||
// Check if the file is a valid package
|
||||
if (alowedExtension.All(ae => ae.InvariantEquals(extension) == false))
|
||||
{
|
||||
throw new ArgumentException("Error - file isn't a package. only extentions: \"{string.Join(", ", alowedExtension)}\" is allowed");
|
||||
throw new ArgumentException("Error - file isn't a package. only extensions: \"{string.Join(", ", alowedExtension)}\" is allowed");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -505,7 +505,7 @@ namespace Umbraco.Core.Packaging
|
||||
/// Converts a umbraco stylesheet to a package xml node
|
||||
/// </summary>
|
||||
/// <param name="name">The name of the stylesheet.</param>
|
||||
/// <param name="includeProperties">if set to <c>true</c> [incluce properties].</param>
|
||||
/// <param name="includeProperties">if set to <c>true</c> [include properties].</param>
|
||||
/// <returns></returns>
|
||||
private XElement GetStylesheetXml(string name, bool includeProperties)
|
||||
{
|
||||
|
||||
@@ -160,7 +160,7 @@ namespace Umbraco.Core.Persistence
|
||||
/// A helper method to support <see cref="AddSchemaTableRows"/>.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// This methds does extensive argument checks. These errors will cause hard to diagnose exceptions in latter
|
||||
/// This methods does extensive argument checks. These errors will cause hard to diagnose exceptions in latter
|
||||
/// processing so it is important to detect them when they can be easily associated with the code defect.
|
||||
/// </remarks>
|
||||
/// <exception cref="ArgumentException">
|
||||
|
||||
@@ -16,7 +16,7 @@ namespace Umbraco.Core.Persistence.DatabaseAnnotations
|
||||
internal string OnUpdate { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the name of the foreign key refence
|
||||
/// Gets or sets the name of the foreign key reference
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Overrides the default naming of a foreign key reference:
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
namespace Umbraco.Core.Persistence.DatabaseModelDefinitions
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents a database index definition retreived by querying the database
|
||||
/// Represents a database index definition retrieved by querying the database
|
||||
/// </summary>
|
||||
internal class DbIndexDefinition
|
||||
{
|
||||
|
||||
@@ -187,7 +187,7 @@ namespace Umbraco.Core.Persistence.Factories
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Buils a dto from an IMedia item.
|
||||
/// Builds a dto from an IMedia item.
|
||||
/// </summary>
|
||||
public static MediaDto BuildDto(IMedia entity)
|
||||
{
|
||||
@@ -204,7 +204,7 @@ namespace Umbraco.Core.Persistence.Factories
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Buils a dto from an IMember item.
|
||||
/// Builds a dto from an IMember item.
|
||||
/// </summary>
|
||||
public static MemberDto BuildDto(IMember entity)
|
||||
{
|
||||
|
||||
@@ -43,7 +43,7 @@ namespace Umbraco.Core.Persistence.Factories
|
||||
|
||||
var propertyTypes = GetPropertyTypes(dto, memberType, standardPropertyTypes);
|
||||
|
||||
//By Convention we add 9 stnd PropertyTypes - This is only here to support loading of types that didn't have these conventions before.
|
||||
//By Convention we add 9 standard PropertyTypes - This is only here to support loading of types that didn't have these conventions before.
|
||||
foreach (var standardPropertyType in standardPropertyTypes)
|
||||
{
|
||||
if (dto.PropertyTypes.Any(x => x.Alias.Equals(standardPropertyType.Key))) continue;
|
||||
|
||||
@@ -104,7 +104,7 @@ namespace Umbraco.Core.Persistence.Factories
|
||||
/// <param name="properties">The properties to map</param>
|
||||
/// <param name="languageRepository"></param>
|
||||
/// <param name="edited">out parameter indicating that one or more properties have been edited</param>
|
||||
/// <param name="editedCultures">out parameter containing a collection of of edited cultures when the contentVariation varies by culture</param>
|
||||
/// <param name="editedCultures">out parameter containing a collection of edited cultures when the contentVariation varies by culture</param>
|
||||
/// <returns></returns>
|
||||
public static IEnumerable<PropertyDataDto> BuildDtos(ContentVariation contentVariation, int currentVersionId, int publishedVersionId, IEnumerable<Property> properties,
|
||||
ILanguageRepository languageRepository, out bool edited, out HashSet<string> editedCultures)
|
||||
|
||||
@@ -275,7 +275,7 @@ namespace Umbraco.Core.Persistence
|
||||
/// <remarks>
|
||||
/// The database should not exist in the LocalDb instance.
|
||||
/// It will be attached with its name being its MDF filename (full path), uppercased, when
|
||||
/// the first connection is opened, and remain attached until explicitely detached.
|
||||
/// the first connection is opened, and remain attached until explicitly detached.
|
||||
/// </remarks>
|
||||
public string GetAttachedConnectionString(string databaseName, string filesPath)
|
||||
{
|
||||
|
||||
@@ -816,7 +816,7 @@ namespace Umbraco.Core.Persistence
|
||||
/// </summary>
|
||||
/// <typeparam name="TDto">The type of the Dto to select.</typeparam>
|
||||
/// <param name="sql">The origin Sql.</param>
|
||||
/// <param name="reference">An expression speficying the reference.</param>
|
||||
/// <param name="reference">An expression specifying the reference.</param>
|
||||
/// <param name="sqlexpr">An expression to apply to the Sql statement before adding the reference selection.</param>
|
||||
/// <returns>The Sql statement.</returns>
|
||||
/// <remarks>The <paramref name="sqlexpr"/> expression applies to the Sql statement before the reference selection
|
||||
|
||||
@@ -90,7 +90,7 @@ namespace Umbraco.Core.Persistence
|
||||
}
|
||||
else
|
||||
{
|
||||
//get the SqlDbType from the clr type
|
||||
//get the SqlDbType from the CLR type
|
||||
sqlDbType = _sqlSyntaxProvider.GetSqlDbType(col.PropertyType);
|
||||
}
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ namespace Umbraco.Core.Persistence.Repositories
|
||||
/// </summary>
|
||||
/// <param name="alias">The original alias.</param>
|
||||
/// <returns>The original alias with a number appended to it, so that it is unique.</returns>
|
||||
/// <remarks>Unique accross all content, media and member types.</remarks>
|
||||
/// <remarks>Unique across all content, media and member types.</remarks>
|
||||
string GetUniqueAlias(string alias);
|
||||
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
namespace Umbraco.Core.Persistence.Repositories
|
||||
{
|
||||
// this only exists to differenciate with IPartialViewRepository in IoC
|
||||
// this only exists to differentiate with IPartialViewRepository in IoC
|
||||
// without resorting to constants, names, whatever - and IPartialViewRepository
|
||||
// is implemented by PartialViewRepository and IPartialViewMacroRepository by
|
||||
// PartialViewMacroRepository - just to inject the proper filesystem.
|
||||
|
||||
@@ -26,14 +26,14 @@ namespace Umbraco.Core.Persistence.Repositories
|
||||
void AddOrUpdateGroupWithUsers(IUserGroup userGroup, int[] userIds);
|
||||
|
||||
/// <summary>
|
||||
/// Gets explicilty defined permissions for the group for specified entities
|
||||
/// Gets explicitly defined permissions for the group for specified entities
|
||||
/// </summary>
|
||||
/// <param name="groupIds"></param>
|
||||
/// <param name="entityIds">Array of entity Ids, if empty will return permissions for the group for all entities</param>
|
||||
EntityPermissionCollection GetPermissions(int[] groupIds, params int[] entityIds);
|
||||
|
||||
/// <summary>
|
||||
/// Gets explicilt and default permissions (if requested) permissions for the group for specified entities
|
||||
/// Gets explicit and default permissions (if requested) permissions for the group for specified entities
|
||||
/// </summary>
|
||||
/// <param name="groups"></param>
|
||||
/// <param name="fallbackToDefaultPermissions">If true will include the group's default permissions if no permissions are explicitly assigned</param>
|
||||
|
||||
@@ -51,7 +51,7 @@ namespace Umbraco.Core.Persistence.Repositories
|
||||
/// <param name="excludeUserGroups">
|
||||
/// A filter to only include users that do not belong to these user groups
|
||||
/// </param>
|
||||
/// <param name="userState">Optional parameter to filter by specfied user state</param>
|
||||
/// <param name="userState">Optional parameter to filter by specified user state</param>
|
||||
/// <returns></returns>
|
||||
IEnumerable<IUser> GetPagedResultsByQuery(IQuery<IUser> query, long pageIndex, int pageSize, out long totalRecords,
|
||||
Expression<Func<IUser, object>> orderBy, Direction orderDirection = Direction.Ascending,
|
||||
|
||||
@@ -515,7 +515,7 @@ namespace Umbraco.Core.Persistence.Repositories.Implement
|
||||
}
|
||||
|
||||
// now we have
|
||||
// - the definitinos
|
||||
// - the definitions
|
||||
// - all property data dtos
|
||||
// - tag editors
|
||||
// and we need to build the proper property collections
|
||||
|
||||
@@ -82,7 +82,7 @@ namespace Umbraco.Core.Persistence.Repositories.Implement
|
||||
var dtos = Database.Fetch<ContentTypeTemplateDto>(sql);
|
||||
|
||||
return
|
||||
//This returns a lookup from the GetAll cached looup
|
||||
//This returns a lookup from the GetAll cached lookup
|
||||
(dtos.Any()
|
||||
? GetMany(dtos.DistinctBy(x => x.ContentTypeDto.NodeId).Select(x => x.ContentTypeDto.NodeId).ToArray())
|
||||
: Enumerable.Empty<IContentType>())
|
||||
|
||||
@@ -103,7 +103,6 @@ namespace Umbraco.Core.Persistence.Repositories.Implement
|
||||
.On<PropertyTypeDto, DataTypeDto>(left => left.DataTypeId, right => right.NodeId);
|
||||
|
||||
var translator = new SqlTranslator<PropertyType>(sqlClause, query);
|
||||
|
||||
var sql = translator.Translate()
|
||||
.OrderBy<PropertyTypeDto>(x => x.PropertyTypeGroupId);
|
||||
|
||||
@@ -121,7 +120,7 @@ namespace Umbraco.Core.Persistence.Repositories.Implement
|
||||
{
|
||||
var dto = ContentTypeFactory.BuildContentTypeDto(entity);
|
||||
|
||||
//Cannot add a duplicate content type type
|
||||
//Cannot add a duplicate content type
|
||||
var exists = Database.ExecuteScalar<int>(@"SELECT COUNT(*) FROM cmsContentType
|
||||
INNER JOIN umbracoNode ON cmsContentType.nodeId = umbracoNode.id
|
||||
WHERE cmsContentType." + SqlSyntax.GetQuotedColumnName("alias") + @"= @alias
|
||||
@@ -1318,7 +1317,7 @@ AND umbracoNode.id <> @id",
|
||||
parentMediaTypeIds = new Dictionary<int, List<int>>();
|
||||
var mappedMediaTypes = new List<IMediaType>();
|
||||
|
||||
//loop through each result and fill in our required values, each row will contain different requried data than the rest.
|
||||
//loop through each result and fill in our required values, each row will contain different required data than the rest.
|
||||
// it is much quicker to iterate each result and populate instead of looking up the values over and over in the result like
|
||||
// we used to do.
|
||||
var queue = new Queue<dynamic>(result);
|
||||
@@ -1725,7 +1724,7 @@ ORDER BY contentTypeId, groupId, id";
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets all entities of the spefified type
|
||||
/// Gets all entities of the specified type
|
||||
/// </summary>
|
||||
/// <param name="ids"></param>
|
||||
/// <returns></returns>
|
||||
@@ -1749,7 +1748,7 @@ ORDER BY contentTypeId, groupId, id";
|
||||
|
||||
public string GetUniqueAlias(string alias)
|
||||
{
|
||||
// alias is unique accross ALL content types!
|
||||
// alias is unique across ALL content types!
|
||||
var aliasColumn = SqlSyntax.GetQuotedColumnName("alias");
|
||||
var aliases = Database.Fetch<string>(@"SELECT cmsContentType." + aliasColumn + @" FROM cmsContentType
|
||||
INNER JOIN umbracoNode ON cmsContentType.nodeId = umbracoNode.id
|
||||
|
||||
@@ -11,7 +11,7 @@ namespace Umbraco.Core.Persistence.Repositories.Implement
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// It would be nicer if we could separate most of this down into a smaller version of the ContentRepository class, however to do that
|
||||
/// requires quite a lot of work since we'd need to re-organize the interhitance quite a lot or create a helper class to perform a lot of the underlying logic.
|
||||
/// requires quite a lot of work since we'd need to re-organize the inheritance quite a lot or create a helper class to perform a lot of the underlying logic.
|
||||
///
|
||||
/// TODO: Create a helper method to contain most of the underlying logic for the ContentRepository
|
||||
/// </remarks>
|
||||
|
||||
@@ -562,7 +562,7 @@ namespace Umbraco.Core.Persistence.Repositories.Implement
|
||||
Database.Execute(deleteDocumentVariations);
|
||||
|
||||
// todo NPoco InsertBulk issue?
|
||||
// we should use the native NPoco InsertBulk here but it causes problems (not sure exaclty all scenarios)
|
||||
// we should use the native NPoco InsertBulk here but it causes problems (not sure exactly all scenarios)
|
||||
// but by using SQL Server and updating a variants name will cause: Unable to cast object of type
|
||||
// 'Umbraco.Core.Persistence.FaultHandling.RetryDbConnection' to type 'System.Data.SqlClient.SqlConnection'.
|
||||
// (same in PersistNewItem above)
|
||||
@@ -1333,7 +1333,7 @@ namespace Umbraco.Core.Persistence.Repositories.Implement
|
||||
// variant content = update with default culture or anything really
|
||||
EnsureInvariantNameExists(content);
|
||||
|
||||
// ensure that that invariant name is unique
|
||||
// ensure that invariant name is unique
|
||||
EnsureInvariantNameIsUnique(content);
|
||||
|
||||
// and finally,
|
||||
@@ -1352,7 +1352,7 @@ namespace Umbraco.Core.Persistence.Repositories.Implement
|
||||
if (content.CultureInfos.Count == 0)
|
||||
throw new InvalidOperationException("Cannot save content with an empty name.");
|
||||
|
||||
// and then, we need to set the invariant name implicitely,
|
||||
// and then, we need to set the invariant name implicitly,
|
||||
// using the default culture if it has a name, otherwise anything we can
|
||||
var defaultCulture = LanguageRepository.GetDefaultIsoCode();
|
||||
content.Name = defaultCulture != null && content.CultureInfos.TryGetValue(defaultCulture, out var cultureName)
|
||||
|
||||
@@ -85,7 +85,7 @@ namespace Umbraco.Core.Persistence.Repositories.Implement
|
||||
var dtos = Database.Fetch<ContentTypeDto>(sql);
|
||||
|
||||
return
|
||||
//This returns a lookup from the GetAll cached looup
|
||||
//This returns a lookup from the GetAll cached lookup
|
||||
(dtos.Any()
|
||||
? GetMany(dtos.DistinctBy(x => x.NodeId).Select(x => x.NodeId).ToArray())
|
||||
: Enumerable.Empty<IMediaType>())
|
||||
|
||||
@@ -70,7 +70,7 @@ namespace Umbraco.Core.Persistence.Repositories.Implement
|
||||
// check if the query is based on properties or not
|
||||
|
||||
var wheres = query.GetWhereClauses();
|
||||
//this is a pretty rudimentary check but wil work, we just need to know if this query requires property
|
||||
//this is a pretty rudimentary check but will work, we just need to know if this query requires property
|
||||
// level queries
|
||||
if (wheres.Any(x => x.Item1.Contains("cmsPropertyType")))
|
||||
{
|
||||
@@ -583,7 +583,7 @@ namespace Umbraco.Core.Persistence.Repositories.Implement
|
||||
// load all properties for all documents from database in 1 query - indexed by version id
|
||||
var properties = GetPropertyCollections(temps);
|
||||
|
||||
// assign properites
|
||||
// assign properties
|
||||
foreach (var temp in temps)
|
||||
{
|
||||
temp.Content.Properties = properties[temp.VersionId];
|
||||
|
||||
@@ -205,7 +205,7 @@ namespace Umbraco.Core.Persistence.Repositories.Implement
|
||||
entity.Icon = "icon-user";
|
||||
}
|
||||
|
||||
//By Convention we add 9 stnd PropertyTypes to an Umbraco MemberType
|
||||
//By Convention we add 9 standard PropertyTypes to an Umbraco MemberType
|
||||
entity.AddPropertyGroup(Constants.Conventions.Member.StandardPropertiesGroupName);
|
||||
var standardPropertyTypes = Constants.Conventions.Member.GetStandardPropertyTypeStubs();
|
||||
foreach (var standardPropertyType in standardPropertyTypes)
|
||||
|
||||
@@ -480,7 +480,7 @@ namespace Umbraco.Core.Persistence.Repositories.Implement
|
||||
public IEnumerable<ITemplate> GetAll(params string[] aliases)
|
||||
{
|
||||
//We must call the base (normal) GetAll method
|
||||
// which is cached. This is a specialized method and unfortunatley with the params[] it
|
||||
// which is cached. This is a specialized method and unfortunately with the params[] it
|
||||
// overlaps with the normal GetAll method.
|
||||
if (aliases.Any() == false) return base.GetMany();
|
||||
|
||||
|
||||
@@ -89,7 +89,7 @@ namespace Umbraco.Core.Persistence.Repositories.Implement
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Gets explicilty defined permissions for the group for specified entities
|
||||
/// Gets explicitly defined permissions for the group for specified entities
|
||||
/// </summary>
|
||||
/// <param name="groupIds"></param>
|
||||
/// <param name="entityIds">Array of entity Ids, if empty will return permissions for the group for all entities</param>
|
||||
@@ -99,7 +99,7 @@ namespace Umbraco.Core.Persistence.Repositories.Implement
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets explicilt and default permissions (if requested) permissions for the group for specified entities
|
||||
/// Gets explicit and default permissions (if requested) permissions for the group for specified entities
|
||||
/// </summary>
|
||||
/// <param name="groups"></param>
|
||||
/// <param name="fallbackToDefaultPermissions">If true will include the group's default permissions if no permissions are explicitly assigned</param>
|
||||
|
||||
@@ -169,7 +169,7 @@ ORDER BY colName";
|
||||
|
||||
public Guid CreateLoginSession(int userId, string requestingIpAddress, bool cleanStaleSessions = true)
|
||||
{
|
||||
//TODO: I know this doesn't follow the normal repository conventions which would require us to crete a UserSessionRepository
|
||||
//TODO: I know this doesn't follow the normal repository conventions which would require us to create a UserSessionRepository
|
||||
//and also business logic models for these objects but that's just so overkill for what we are doing
|
||||
//and now that everything is properly in a transaction (Scope) there doesn't seem to be much reason for using that anymore
|
||||
var now = DateTime.UtcNow;
|
||||
@@ -690,7 +690,7 @@ ORDER BY colName";
|
||||
/// <param name="excludeUserGroups">
|
||||
/// A filter to only include users that do not belong to these user groups
|
||||
/// </param>
|
||||
/// <param name="userState">Optional parameter to filter by specfied user state</param>
|
||||
/// <param name="userState">Optional parameter to filter by specified user state</param>
|
||||
/// <param name="filter"></param>
|
||||
/// <returns></returns>
|
||||
/// <remarks>
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user