using System;
using System.Collections.Generic;
using System.Diagnostics;
using Umbraco.Core;
using Umbraco.Core.Models.PublishedContent;
namespace Umbraco.Web.Models
{
///
/// Provide an abstract base class for IPublishedContent implementations.
///
/// This base class does which (a) consistently resolves and caches the Url, (b) provides an implementation
/// for this[alias], and (c) provides basic content set management.
[DebuggerDisplay("Content Id: {Id}")]
public abstract class PublishedContentBase : IPublishedContent
{
#region ContentType
public abstract IPublishedContentType ContentType { get; }
#endregion
#region PublishedElement
///
public abstract Guid Key { get; }
#endregion
#region PublishedContent
///
public abstract int Id { get; }
///
public virtual string Name => this.Name();
///
public virtual string UrlSegment => this.UrlSegment();
///
public abstract int SortOrder { get; }
///
public abstract int Level { get; }
///
public abstract string Path { get; }
///
public abstract int? TemplateId { get; }
///
public abstract int CreatorId { get; }
///
public abstract string CreatorName { get; }
///
public abstract DateTime CreateDate { get; }
///
public abstract int WriterId { get; }
///
public abstract string WriterName { get; }
///
public abstract DateTime UpdateDate { get; }
///
public virtual string Url => this.Url();
///
public abstract IReadOnlyDictionary Cultures { get; }
///
public abstract PublishedItemType ItemType { get; }
///
public abstract bool IsDraft(string culture = null);
///
public abstract bool IsPublished(string culture = null);
#endregion
#region Tree
///
public abstract IPublishedContent Parent { get; }
///
public virtual IEnumerable Children => this.Children();
///
public abstract IEnumerable ChildrenForAllCultures { get; }
#endregion
#region Properties
///
public abstract IEnumerable Properties { get; }
///
public abstract IPublishedProperty GetProperty(string alias);
#endregion
}
}