Moved more abstractions of models
This commit is contained in:
@@ -1,118 +0,0 @@
|
||||
namespace Umbraco.Core.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// Defines audit types.
|
||||
/// </summary>
|
||||
public enum AuditType
|
||||
{
|
||||
/// <summary>
|
||||
/// New node(s) being added.
|
||||
/// </summary>
|
||||
New,
|
||||
|
||||
/// <summary>
|
||||
/// Node(s) being saved.
|
||||
/// </summary>
|
||||
Save,
|
||||
|
||||
/// <summary>
|
||||
/// Variant(s) being saved.
|
||||
/// </summary>
|
||||
SaveVariant,
|
||||
|
||||
/// <summary>
|
||||
/// Node(s) being opened.
|
||||
/// </summary>
|
||||
Open,
|
||||
|
||||
/// <summary>
|
||||
/// Node(s) being deleted.
|
||||
/// </summary>
|
||||
Delete,
|
||||
|
||||
/// <summary>
|
||||
/// Node(s) being published.
|
||||
/// </summary>
|
||||
Publish,
|
||||
|
||||
/// <summary>
|
||||
/// Variant(s) being published.
|
||||
/// </summary>
|
||||
PublishVariant,
|
||||
|
||||
/// <summary>
|
||||
/// Node(s) being sent to publishing.
|
||||
/// </summary>
|
||||
SendToPublish,
|
||||
|
||||
/// <summary>
|
||||
/// Variant(s) being sent to publishing.
|
||||
/// </summary>
|
||||
SendToPublishVariant,
|
||||
|
||||
/// <summary>
|
||||
/// Node(s) being unpublished.
|
||||
/// </summary>
|
||||
Unpublish,
|
||||
|
||||
/// <summary>
|
||||
/// Variant(s) being unpublished.
|
||||
/// </summary>
|
||||
UnpublishVariant,
|
||||
|
||||
/// <summary>
|
||||
/// Node(s) being moved.
|
||||
/// </summary>
|
||||
Move,
|
||||
|
||||
/// <summary>
|
||||
/// Node(s) being copied.
|
||||
/// </summary>
|
||||
Copy,
|
||||
|
||||
/// <summary>
|
||||
/// Node(s) being assigned domains.
|
||||
/// </summary>
|
||||
AssignDomain,
|
||||
|
||||
/// <summary>
|
||||
/// Node(s) public access changing.
|
||||
/// </summary>
|
||||
PublicAccess,
|
||||
|
||||
/// <summary>
|
||||
/// Node(s) being sorted.
|
||||
/// </summary>
|
||||
Sort,
|
||||
|
||||
/// <summary>
|
||||
/// Notification(s) being sent to user.
|
||||
/// </summary>
|
||||
Notify,
|
||||
|
||||
/// <summary>
|
||||
/// General system audit message.
|
||||
/// </summary>
|
||||
System,
|
||||
|
||||
/// <summary>
|
||||
/// Node's content being rolled back to a previous version.
|
||||
/// </summary>
|
||||
RollBack,
|
||||
|
||||
/// <summary>
|
||||
/// Package being installed.
|
||||
/// </summary>
|
||||
PackagerInstall,
|
||||
|
||||
/// <summary>
|
||||
/// Package being uninstalled.
|
||||
/// </summary>
|
||||
PackagerUninstall,
|
||||
|
||||
/// <summary>
|
||||
/// Custom audit message.
|
||||
/// </summary>
|
||||
Custom
|
||||
}
|
||||
}
|
||||
@@ -1,78 +0,0 @@
|
||||
using System;
|
||||
using Umbraco.Core.Models.Entities;
|
||||
|
||||
namespace Umbraco.Core.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents a POCO for setting sort order on a ContentType reference
|
||||
/// </summary>
|
||||
public class ContentTypeSort : IValueObject, IDeepCloneable
|
||||
{
|
||||
// this parameterless ctor should never be used BUT is required by AutoMapper in EntityMapperProfile
|
||||
internal ContentTypeSort() { }
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="T:System.Object"/> class.
|
||||
/// </summary>
|
||||
public ContentTypeSort(int id, int sortOrder)
|
||||
{
|
||||
Id = new Lazy<int>(() => id);
|
||||
SortOrder = sortOrder;
|
||||
}
|
||||
|
||||
public ContentTypeSort(Lazy<int> id, int sortOrder, string @alias)
|
||||
{
|
||||
Id = id;
|
||||
SortOrder = sortOrder;
|
||||
Alias = alias;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the Id of the ContentType
|
||||
/// </summary>
|
||||
public Lazy<int> Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the Sort Order of the ContentType
|
||||
/// </summary>
|
||||
public int SortOrder { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the Alias of the ContentType
|
||||
/// </summary>
|
||||
public string Alias { get; set; }
|
||||
|
||||
|
||||
public object DeepClone()
|
||||
{
|
||||
var clone = (ContentTypeSort)MemberwiseClone();
|
||||
var id = Id.Value;
|
||||
clone.Id = new Lazy<int>(() => id);
|
||||
return clone;
|
||||
}
|
||||
|
||||
protected bool Equals(ContentTypeSort other)
|
||||
{
|
||||
return Id.Value.Equals(other.Id.Value) && string.Equals(Alias, other.Alias);
|
||||
}
|
||||
|
||||
public override bool Equals(object obj)
|
||||
{
|
||||
if (ReferenceEquals(null, obj)) return false;
|
||||
if (ReferenceEquals(this, obj)) return true;
|
||||
if (obj.GetType() != this.GetType()) return false;
|
||||
return Equals((ContentTypeSort) obj);
|
||||
}
|
||||
|
||||
public override int GetHashCode()
|
||||
{
|
||||
unchecked
|
||||
{
|
||||
//The hash code will just be the alias if one is assigned, otherwise it will be the hash code of the Id.
|
||||
//In some cases the alias can be null of the non lazy ctor is used, in that case, the lazy Id will already have a value created.
|
||||
return Alias != null ? Alias.GetHashCode() : (Id.Value.GetHashCode() * 397);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,60 +0,0 @@
|
||||
using System;
|
||||
using Umbraco.Core.Models.Entities;
|
||||
|
||||
namespace Umbraco.Core.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents an audited event.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// <para>The free-form details properties can be used to capture relevant infos (for example,
|
||||
/// a user email and identifier) at the time of the audited event, even though they may change
|
||||
/// later on - but we want to keep a track of their value at that time.</para>
|
||||
/// <para>Depending on audit loggers, these properties can be purely free-form text, or
|
||||
/// contain json serialized objects.</para>
|
||||
/// </remarks>
|
||||
public interface IAuditEntry : IEntity, IRememberBeingDirty
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the identifier of the user triggering the audited event.
|
||||
/// </summary>
|
||||
int PerformingUserId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets free-form details about the user triggering the audited event.
|
||||
/// </summary>
|
||||
string PerformingDetails { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the IP address or the request triggering the audited event.
|
||||
/// </summary>
|
||||
string PerformingIp { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the date and time of the audited event.
|
||||
/// </summary>
|
||||
DateTime EventDateUtc { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the identifier of the user affected by the audited event.
|
||||
/// </summary>
|
||||
/// <remarks>Not used when no single user is affected by the event.</remarks>
|
||||
int AffectedUserId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets free-form details about the entity affected by the audited event.
|
||||
/// </summary>
|
||||
/// <remarks>The entity affected by the event can be another user, a member...</remarks>
|
||||
string AffectedDetails { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the type of the audited event.
|
||||
/// </summary>
|
||||
string EventType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets free-form details about the audited event.
|
||||
/// </summary>
|
||||
string EventDetails { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,35 +0,0 @@
|
||||
using Umbraco.Core.Models.Entities;
|
||||
|
||||
namespace Umbraco.Core.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents an audit item.
|
||||
/// </summary>
|
||||
public interface IAuditItem : IEntity
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets the audit type.
|
||||
/// </summary>
|
||||
AuditType AuditType { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the audited entity type.
|
||||
/// </summary>
|
||||
string EntityType { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the audit user identifier.
|
||||
/// </summary>
|
||||
int UserId { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the audit comments.
|
||||
/// </summary>
|
||||
string Comment { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets optional additional data parameters.
|
||||
/// </summary>
|
||||
string Parameters { get; }
|
||||
}
|
||||
}
|
||||
74
src/Umbraco.Core/Models/IDataEditor.cs
Normal file
74
src/Umbraco.Core/Models/IDataEditor.cs
Normal file
@@ -0,0 +1,74 @@
|
||||
using System.Collections.Generic;
|
||||
using Umbraco.Core.Composing;
|
||||
|
||||
namespace Umbraco.Core.PropertyEditors
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents a data editor.
|
||||
/// </summary>
|
||||
/// <remarks>This is the base interface for parameter and property editors.</remarks>
|
||||
public interface IDataEditor : IDiscoverable
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets the alias of the editor.
|
||||
/// </summary>
|
||||
string Alias { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the type of the editor.
|
||||
/// </summary>
|
||||
/// <remarks>An editor can be a property value editor, or a parameter editor.</remarks>
|
||||
EditorType Type { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the name of the editor.
|
||||
/// </summary>
|
||||
string Name { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the icon of the editor.
|
||||
/// </summary>
|
||||
/// <remarks>Can be used to display editors when presenting them.</remarks>
|
||||
string Icon { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the group of the editor.
|
||||
/// </summary>
|
||||
/// <remarks>Can be used to organize editors when presenting them.</remarks>
|
||||
string Group { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets a value indicating whether the editor is deprecated.
|
||||
/// </summary>
|
||||
/// <remarks>Deprecated editors are supported but not proposed in the UI.</remarks>
|
||||
bool IsDeprecated { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets a value editor.
|
||||
/// </summary>
|
||||
IDataValueEditor GetValueEditor(); // TODO: should be configured?!
|
||||
|
||||
/// <summary>
|
||||
/// Gets a configured value editor.
|
||||
/// </summary>
|
||||
IDataValueEditor GetValueEditor(object configuration);
|
||||
|
||||
/// <summary>
|
||||
/// Gets the configuration for the value editor.
|
||||
/// </summary>
|
||||
IDictionary<string, object> DefaultConfiguration { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets an editor to edit the value editor configuration.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// <para>Is expected to throw if the editor does not support being configured, e.g. for most parameter editors.</para>
|
||||
/// </remarks>
|
||||
IConfigurationEditor GetConfigurationEditor();
|
||||
|
||||
/// <summary>
|
||||
/// Gets the index value factory for the editor.
|
||||
/// </summary>
|
||||
IPropertyIndexValueFactory PropertyIndexValueFactory { get; }
|
||||
}
|
||||
}
|
||||
70
src/Umbraco.Core/Models/IDataValueEditor.cs
Normal file
70
src/Umbraco.Core/Models/IDataValueEditor.cs
Normal file
@@ -0,0 +1,70 @@
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.Xml.Linq;
|
||||
using Umbraco.Core.Models;
|
||||
using Umbraco.Core.Models.Editors;
|
||||
using Umbraco.Core.Services;
|
||||
|
||||
namespace Umbraco.Core.PropertyEditors
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents an editor for editing data values.
|
||||
/// </summary>
|
||||
/// <remarks>This is the base interface for parameter and property value editors.</remarks>
|
||||
public interface IDataValueEditor
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets the editor view.
|
||||
/// </summary>
|
||||
string View { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the type of the value.
|
||||
/// </summary>
|
||||
/// <remarks>The value has to be a valid <see cref="ValueTypes"/> value.</remarks>
|
||||
string ValueType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets a value indicating whether the edited value is read-only.
|
||||
/// </summary>
|
||||
bool IsReadOnly { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets a value indicating whether to display the associated label.
|
||||
/// </summary>
|
||||
bool HideLabel { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Validates a property value.
|
||||
/// </summary>
|
||||
/// <param name="value">The property value.</param>
|
||||
/// <param name="required">A value indicating whether the property value is required.</param>
|
||||
/// <param name="format">A specific format (regex) that the property value must respect.</param>
|
||||
IEnumerable<ValidationResult> Validate(object value, bool required, string format);
|
||||
|
||||
/// <summary>
|
||||
/// Gets the validators to use to validate the edited value.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// <para>Use this property to add validators, not to validate. Use <see cref="Validate"/> instead.</para>
|
||||
/// TODO: replace with AddValidator? WithValidator?
|
||||
/// </remarks>
|
||||
List<IValueValidator> Validators { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Converts a value posted by the editor to a property value.
|
||||
/// </summary>
|
||||
object FromEditor(ContentPropertyData editorValue, object currentValue);
|
||||
|
||||
/// <summary>
|
||||
/// Converts a property value to a value for the editor.
|
||||
/// </summary>
|
||||
object ToEditor(Property property, IDataTypeService dataTypeService, string culture = null, string segment = null);
|
||||
|
||||
// TODO: / deal with this when unplugging the xml cache
|
||||
// why property vs propertyType? services should be injected! etc...
|
||||
IEnumerable<XElement> ConvertDbToXml(Property property, IDataTypeService dataTypeService, ILocalizationService localizationService, bool published);
|
||||
XNode ConvertDbToXml(PropertyType propertyType, object value, IDataTypeService dataTypeService);
|
||||
string ConvertDbToString(PropertyType propertyType, object value, IDataTypeService dataTypeService);
|
||||
}
|
||||
}
|
||||
@@ -1,28 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Runtime.Serialization;
|
||||
using Umbraco.Core.Models.Entities;
|
||||
|
||||
namespace Umbraco.Core.Models
|
||||
{
|
||||
public interface IDictionaryItem : IEntity, IRememberBeingDirty
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or Sets the Parent Id of the Dictionary Item
|
||||
/// </summary>
|
||||
[DataMember]
|
||||
Guid? ParentId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the Key for the Dictionary Item
|
||||
/// </summary>
|
||||
[DataMember]
|
||||
string ItemKey { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a list of translations for the Dictionary Item
|
||||
/// </summary>
|
||||
[DataMember]
|
||||
IEnumerable<IDictionaryTranslation> Translations { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,23 +0,0 @@
|
||||
using System.Runtime.Serialization;
|
||||
using Umbraco.Core.Models.Entities;
|
||||
using Umbraco.Core.Persistence.Mappers;
|
||||
|
||||
namespace Umbraco.Core.Models
|
||||
{
|
||||
public interface IDictionaryTranslation : IEntity
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the <see cref="Language"/> for the translation
|
||||
/// </summary>
|
||||
[DataMember]
|
||||
ILanguage Language { get; set; }
|
||||
|
||||
int LanguageId { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the translated text
|
||||
/// </summary>
|
||||
[DataMember]
|
||||
string Value { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
using Umbraco.Core.Models.Entities;
|
||||
|
||||
namespace Umbraco.Core.Models
|
||||
{
|
||||
public interface IDomain : IEntity, IRememberBeingDirty
|
||||
{
|
||||
int? LanguageId { get; set; }
|
||||
string DomainName { get; set; }
|
||||
int? RootContentId { get; set; }
|
||||
bool IsWildcard { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Readonly value of the language ISO code for the domain
|
||||
/// </summary>
|
||||
string LanguageIsoCode { get; }
|
||||
}
|
||||
}
|
||||
@@ -1,48 +0,0 @@
|
||||
using System;
|
||||
using Umbraco.Core.Models.Entities;
|
||||
|
||||
namespace Umbraco.Core.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// Defines a File
|
||||
/// </summary>
|
||||
/// <remarks>Used for Scripts, Stylesheets and Templates</remarks>
|
||||
public interface IFile : IEntity
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets the Name of the File including extension
|
||||
/// </summary>
|
||||
string Name { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the Alias of the File, which is the name without the extension
|
||||
/// </summary>
|
||||
string Alias { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the Path to the File from the root of the file's associated IFileSystem
|
||||
/// </summary>
|
||||
string Path { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the original path of the file
|
||||
/// </summary>
|
||||
string OriginalPath { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Called to re-set the OriginalPath to the Path
|
||||
/// </summary>
|
||||
void ResetOriginalPath();
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the Content of a File
|
||||
/// </summary>
|
||||
string Content { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the file's virtual path (i.e. the file path relative to the root of the website)
|
||||
/// </summary>
|
||||
string VirtualPath { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,57 +0,0 @@
|
||||
using System.Globalization;
|
||||
using System.Runtime.Serialization;
|
||||
using Umbraco.Core.Models.Entities;
|
||||
|
||||
namespace Umbraco.Core.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents a language.
|
||||
/// </summary>
|
||||
public interface ILanguage : IEntity, IRememberBeingDirty
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the ISO code of the language.
|
||||
/// </summary>
|
||||
[DataMember]
|
||||
string IsoCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the culture name of the language.
|
||||
/// </summary>
|
||||
[DataMember]
|
||||
string CultureName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the <see cref="CultureInfo"/> object for the language.
|
||||
/// </summary>
|
||||
[IgnoreDataMember]
|
||||
CultureInfo CultureInfo { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether the language is the default language.
|
||||
/// </summary>
|
||||
[DataMember]
|
||||
bool IsDefault { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether the language is mandatory.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// <para>When a language is mandatory, a multi-lingual document cannot be published
|
||||
/// without that language being published, and unpublishing that language unpublishes
|
||||
/// the entire document.</para>
|
||||
/// </remarks>
|
||||
[DataMember]
|
||||
bool IsMandatory { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the identifier of a fallback language.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// <para>The fallback language can be used in multi-lingual scenarios, to help
|
||||
/// define fallback strategies when a value does not exist for a requested language.</para>
|
||||
/// </remarks>
|
||||
[DataMember]
|
||||
int? FallbackLanguageId { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,79 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Runtime.Serialization;
|
||||
using Umbraco.Core.Models.Entities;
|
||||
|
||||
namespace Umbraco.Core.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// Defines a Macro
|
||||
/// </summary>
|
||||
public interface IMacro : IEntity, IRememberBeingDirty
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the alias of the Macro
|
||||
/// </summary>
|
||||
[DataMember]
|
||||
string Alias { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the name of the Macro
|
||||
/// </summary>
|
||||
[DataMember]
|
||||
string Name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a boolean indicating whether the Macro can be used in an Editor
|
||||
/// </summary>
|
||||
[DataMember]
|
||||
bool UseInEditor { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the Cache Duration for the Macro
|
||||
/// </summary>
|
||||
[DataMember]
|
||||
int CacheDuration { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a boolean indicating whether the Macro should be Cached by Page
|
||||
/// </summary>
|
||||
[DataMember]
|
||||
bool CacheByPage { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a boolean indicating whether the Macro should be Cached Personally
|
||||
/// </summary>
|
||||
[DataMember]
|
||||
bool CacheByMember { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a boolean indicating whether the Macro should be rendered in an Editor
|
||||
/// </summary>
|
||||
[DataMember]
|
||||
bool DontRender { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or set the path to the macro source to render
|
||||
/// </summary>
|
||||
[DataMember]
|
||||
string MacroSource { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or set the macro type
|
||||
/// </summary>
|
||||
[DataMember]
|
||||
MacroTypes MacroType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a list of Macro Properties
|
||||
/// </summary>
|
||||
[DataMember]
|
||||
MacroPropertyCollection Properties { get; }
|
||||
|
||||
///// <summary>
|
||||
///// Returns an enum <see cref="MacroTypes"/> based on the properties on the Macro
|
||||
///// </summary>
|
||||
///// <returns><see cref="MacroTypes"/></returns>
|
||||
//MacroTypes MacroType();
|
||||
}
|
||||
}
|
||||
@@ -1,42 +0,0 @@
|
||||
using System;
|
||||
using System.Runtime.Serialization;
|
||||
using Umbraco.Core.Models.Entities;
|
||||
|
||||
namespace Umbraco.Core.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// Defines a Property for a Macro
|
||||
/// </summary>
|
||||
public interface IMacroProperty : IValueObject, IDeepCloneable, IRememberBeingDirty
|
||||
{
|
||||
[DataMember]
|
||||
int Id { get; set; }
|
||||
|
||||
[DataMember]
|
||||
Guid Key { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the Alias of the Property
|
||||
/// </summary>
|
||||
[DataMember]
|
||||
string Alias { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the Name of the Property
|
||||
/// </summary>
|
||||
[DataMember]
|
||||
string Name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the Sort Order of the Property
|
||||
/// </summary>
|
||||
[DataMember]
|
||||
int SortOrder { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the parameter editor alias
|
||||
/// </summary>
|
||||
[DataMember]
|
||||
string EditorAlias { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,21 +0,0 @@
|
||||
using System.Collections.Generic;
|
||||
using Umbraco.Core.Models.Entities;
|
||||
|
||||
namespace Umbraco.Core.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents a member type
|
||||
/// </summary>
|
||||
public interface IMemberGroup : IEntity, IRememberBeingDirty, IHaveAdditionalData
|
||||
{
|
||||
/// <summary>
|
||||
/// The name of the member group
|
||||
/// </summary>
|
||||
string Name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Profile of the user who created this Entity
|
||||
/// </summary>
|
||||
int CreatorId { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,12 +0,0 @@
|
||||
using System;
|
||||
using Semver;
|
||||
using Umbraco.Core.Models.Entities;
|
||||
|
||||
namespace Umbraco.Core.Models
|
||||
{
|
||||
public interface IMigrationEntry : IEntity, IRememberBeingDirty
|
||||
{
|
||||
string MigrationName { get; set; }
|
||||
SemVersion Version { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
namespace Umbraco.Core.Models
|
||||
{
|
||||
public interface IPartialView : IFile
|
||||
{
|
||||
PartialViewType ViewType { get; }
|
||||
}
|
||||
}
|
||||
@@ -1,44 +0,0 @@
|
||||
using System;
|
||||
using System.Runtime.Serialization;
|
||||
using Umbraco.Core.Models.Entities;
|
||||
|
||||
namespace Umbraco.Core.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents a redirect url.
|
||||
/// </summary>
|
||||
public interface IRedirectUrl : IEntity, IRememberBeingDirty
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the identifier of the content item.
|
||||
/// </summary>
|
||||
[DataMember]
|
||||
int ContentId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the unique key identifying the content item.
|
||||
/// </summary>
|
||||
[DataMember]
|
||||
Guid ContentKey { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the redirect url creation date.
|
||||
/// </summary>
|
||||
[DataMember]
|
||||
DateTime CreateDateUtc { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the culture.
|
||||
/// </summary>
|
||||
[DataMember]
|
||||
string Culture { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the redirect url route.
|
||||
/// </summary>
|
||||
/// <remarks>Is a proper Umbraco route eg /path/to/foo or 123/path/tofoo.</remarks>
|
||||
[DataMember]
|
||||
string Url { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,38 +0,0 @@
|
||||
using System.Runtime.Serialization;
|
||||
using Umbraco.Core.Models.Entities;
|
||||
|
||||
namespace Umbraco.Core.Models
|
||||
{
|
||||
public interface IRelation : IEntity, IRememberBeingDirty
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the Parent Id of the Relation (Source)
|
||||
/// </summary>
|
||||
[DataMember]
|
||||
int ParentId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the Child Id of the Relation (Destination)
|
||||
/// </summary>
|
||||
[DataMember]
|
||||
int ChildId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the <see cref="RelationType"/> for the Relation
|
||||
/// </summary>
|
||||
[DataMember]
|
||||
IRelationType RelationType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a comment for the Relation
|
||||
/// </summary>
|
||||
[DataMember]
|
||||
string Comment { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the Id of the <see cref="RelationType"/> that this Relation is based on.
|
||||
/// </summary>
|
||||
[IgnoreDataMember]
|
||||
int RelationTypeId { get; }
|
||||
}
|
||||
}
|
||||
@@ -1,41 +0,0 @@
|
||||
using System;
|
||||
using System.Runtime.Serialization;
|
||||
using Umbraco.Core.Models.Entities;
|
||||
|
||||
namespace Umbraco.Core.Models
|
||||
{
|
||||
public interface IRelationType : IEntity, IRememberBeingDirty
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the Name of the RelationType
|
||||
/// </summary>
|
||||
[DataMember]
|
||||
string Name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the Alias of the RelationType
|
||||
/// </summary>
|
||||
[DataMember]
|
||||
string Alias { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a boolean indicating whether the RelationType is Bidirectional (true) or Parent to Child (false)
|
||||
/// </summary>
|
||||
[DataMember]
|
||||
bool IsBidirectional { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the Parents object type id
|
||||
/// </summary>
|
||||
/// <remarks>Corresponds to the NodeObjectType in the umbracoNode table</remarks>
|
||||
[DataMember]
|
||||
Guid ParentObjectType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the Childs object type id
|
||||
/// </summary>
|
||||
/// <remarks>Corresponds to the NodeObjectType in the umbracoNode table</remarks>
|
||||
[DataMember]
|
||||
Guid ChildObjectType { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,36 +0,0 @@
|
||||
using System;
|
||||
using Umbraco.Core.Models.Entities;
|
||||
using Umbraco.Core.Sync;
|
||||
|
||||
namespace Umbraco.Core.Models
|
||||
{
|
||||
public interface IServerRegistration : IServerAddress, IEntity, IRememberBeingDirty
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the server unique identity.
|
||||
/// </summary>
|
||||
string ServerIdentity { get; set; }
|
||||
|
||||
new string ServerAddress { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether the server is active.
|
||||
/// </summary>
|
||||
bool IsActive { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether the server is master.
|
||||
/// </summary>
|
||||
bool IsMaster { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the date and time the registration was created.
|
||||
/// </summary>
|
||||
DateTime Registered { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the date and time the registration was last accessed.
|
||||
/// </summary>
|
||||
DateTime Accessed { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,62 +0,0 @@
|
||||
using Umbraco.Core.Models.Entities;
|
||||
|
||||
namespace Umbraco.Core.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents a simplified view of a content type.
|
||||
/// </summary>
|
||||
public interface ISimpleContentType : IUmbracoEntity
|
||||
{
|
||||
new int Id { get; }
|
||||
new string Name { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the alias of the content type.
|
||||
/// </summary>
|
||||
string Alias { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the default template of the content type.
|
||||
/// </summary>
|
||||
ITemplate DefaultTemplate { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the content variation of the content type.
|
||||
/// </summary>
|
||||
ContentVariation Variations { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the icon of the content type.
|
||||
/// </summary>
|
||||
string Icon { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets a value indicating whether the content type is a container.
|
||||
/// </summary>
|
||||
bool IsContainer { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets a value indicating whether content of that type can be created at the root of the tree.
|
||||
/// </summary>
|
||||
bool AllowedAsRoot { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets a value indicating whether the content type is an element content type.
|
||||
/// </summary>
|
||||
bool IsElement { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Validates that a combination of culture and segment is valid for the content type properties.
|
||||
/// </summary>
|
||||
/// <param name="culture">The culture.</param>
|
||||
/// <param name="segment">The segment.</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,
|
||||
/// then an invariant culture is valid, because some properties may be invariant. On the other hand, if the content type is invariant,
|
||||
/// then a variant culture is invalid, because no property could possibly vary by culture.</para>
|
||||
/// </remarks>
|
||||
bool SupportsPropertyVariation(string culture, string segment, bool wildcards = false);
|
||||
}
|
||||
}
|
||||
@@ -1,35 +0,0 @@
|
||||
using System.Runtime.Serialization;
|
||||
using Umbraco.Core.Models.Entities;
|
||||
|
||||
namespace Umbraco.Core.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents a tag entity.
|
||||
/// </summary>
|
||||
public interface ITag : IEntity, IRememberBeingDirty
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the tag group.
|
||||
/// </summary>
|
||||
[DataMember]
|
||||
string Group { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the tag text.
|
||||
/// </summary>
|
||||
[DataMember]
|
||||
string Text { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the tag language.
|
||||
/// </summary>
|
||||
[DataMember]
|
||||
int? LanguageId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the number of nodes tagged with this tag.
|
||||
/// </summary>
|
||||
/// <remarks>Only when returning from queries.</remarks>
|
||||
int NodeCount { get; }
|
||||
}
|
||||
}
|
||||
@@ -1,36 +0,0 @@
|
||||
using Umbraco.Core.Models.Entities;
|
||||
|
||||
namespace Umbraco.Core.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// Defines a Template File (Mvc View)
|
||||
/// </summary>
|
||||
public interface ITemplate : IFile, IRememberBeingDirty, ICanBeDirty
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets the Name of the File including extension
|
||||
/// </summary>
|
||||
new string Name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the Alias of the File, which is the name without the extension
|
||||
/// </summary>
|
||||
new string Alias { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if the template is used as a layout for other templates (i.e. it has 'children')
|
||||
/// </summary>
|
||||
bool IsMasterTemplate { get; }
|
||||
|
||||
/// <summary>
|
||||
/// returns the master template alias
|
||||
/// </summary>
|
||||
string MasterTemplateAlias { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Set the mastertemplate
|
||||
/// </summary>
|
||||
/// <param name="masterTemplate"></param>
|
||||
void SetMasterTemplate(ITemplate masterTemplate);
|
||||
}
|
||||
}
|
||||
@@ -1,68 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Umbraco.Core.Collections;
|
||||
|
||||
namespace Umbraco.Core.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// A macro's property collection
|
||||
/// </summary>
|
||||
public class MacroPropertyCollection : ObservableDictionary<string, IMacroProperty>, IDeepCloneable
|
||||
{
|
||||
public MacroPropertyCollection()
|
||||
: base(property => property.Alias)
|
||||
{
|
||||
}
|
||||
|
||||
public object DeepClone()
|
||||
{
|
||||
var clone = new MacroPropertyCollection();
|
||||
foreach (var item in this)
|
||||
{
|
||||
clone.Add((IMacroProperty)item.DeepClone());
|
||||
}
|
||||
return clone;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Used to update an existing macro property
|
||||
/// </summary>
|
||||
/// <param name="name"></param>
|
||||
/// <param name="sortOrder"></param>
|
||||
/// <param name="editorAlias"></param>
|
||||
/// <param name="currentAlias">
|
||||
/// The existing property alias
|
||||
/// </param>
|
||||
/// <param name="newAlias"></param>
|
||||
public void UpdateProperty(string currentAlias, string name = null, int? sortOrder = null, string editorAlias = null, string newAlias = null)
|
||||
{
|
||||
var prop = this[currentAlias];
|
||||
if (prop == null)
|
||||
{
|
||||
throw new InvalidOperationException("No property exists with alias " + currentAlias);
|
||||
}
|
||||
|
||||
if (name.IsNullOrWhiteSpace() == false)
|
||||
{
|
||||
prop.Name = name;
|
||||
}
|
||||
if (sortOrder.HasValue)
|
||||
{
|
||||
prop.SortOrder = sortOrder.Value;
|
||||
}
|
||||
if (name.IsNullOrWhiteSpace() == false)
|
||||
{
|
||||
prop.EditorAlias = editorAlias;
|
||||
}
|
||||
|
||||
if (newAlias.IsNullOrWhiteSpace() == false && currentAlias != newAlias)
|
||||
{
|
||||
prop.Alias = newAlias;
|
||||
ChangeKey(currentAlias, newAlias);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,18 +0,0 @@
|
||||
using System;
|
||||
using System.Runtime.Serialization;
|
||||
|
||||
namespace Umbraco.Core.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// Enum for the various types of Macros
|
||||
/// </summary>
|
||||
[Serializable]
|
||||
[DataContract(IsReference = true)]
|
||||
public enum MacroTypes
|
||||
{
|
||||
[EnumMember]
|
||||
Unknown = 4,
|
||||
[EnumMember]
|
||||
PartialView = 7
|
||||
}
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
namespace Umbraco.Core.Models
|
||||
{
|
||||
public enum PartialViewType : byte
|
||||
{
|
||||
Unknown = 0, // default
|
||||
PartialView = 1,
|
||||
PartialViewMacro = 2
|
||||
}
|
||||
}
|
||||
@@ -2,7 +2,6 @@
|
||||
using System.Diagnostics;
|
||||
using System.Linq;
|
||||
using System.Runtime.Serialization;
|
||||
using Umbraco.Core.Composing;
|
||||
using Umbraco.Core.Models.Entities;
|
||||
using Umbraco.Core.Strings;
|
||||
|
||||
@@ -407,7 +406,7 @@ namespace Umbraco.Core.Models
|
||||
base.PerformDeepClone(clone);
|
||||
|
||||
var clonedEntity = (PropertyType)clone;
|
||||
|
||||
|
||||
//need to manually assign the Lazy value as it will not be automatically mapped
|
||||
if (PropertyGroupId != null)
|
||||
{
|
||||
|
||||
@@ -1,47 +0,0 @@
|
||||
using System;
|
||||
using System.Runtime.Serialization;
|
||||
|
||||
namespace Umbraco.Core.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents the supported database types for storing a value.
|
||||
/// </summary>
|
||||
[Serializable]
|
||||
[DataContract]
|
||||
public enum ValueStorageType
|
||||
{
|
||||
// note: these values are written out in the database in some places,
|
||||
// and then parsed back in a case-sensitive way - think about it before
|
||||
// changing the casing of values.
|
||||
|
||||
/// <summary>
|
||||
/// Store property value as NText.
|
||||
/// </summary>
|
||||
[EnumMember]
|
||||
Ntext,
|
||||
|
||||
/// <summary>
|
||||
/// Store property value as NVarChar.
|
||||
/// </summary>
|
||||
[EnumMember]
|
||||
Nvarchar,
|
||||
|
||||
/// <summary>
|
||||
/// Store property value as Integer.
|
||||
/// </summary>
|
||||
[EnumMember]
|
||||
Integer,
|
||||
|
||||
/// <summary>
|
||||
/// Store property value as Date.
|
||||
/// </summary>
|
||||
[EnumMember]
|
||||
Date,
|
||||
|
||||
/// <summary>
|
||||
/// Store property value as Decimal.
|
||||
/// </summary>
|
||||
[EnumMember]
|
||||
Decimal
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user