wip for IDocumentEntitySlim changes

This commit is contained in:
Shannon
2018-09-20 14:58:15 +10:00
parent 4ac188f564
commit feeb1c56cf
4 changed files with 44 additions and 13 deletions

View File

@@ -1,4 +1,5 @@
using System.Collections.Generic;
using System.Linq;
namespace Umbraco.Core.Models.Entities
{
@@ -8,13 +9,32 @@ namespace Umbraco.Core.Models.Entities
public class DocumentEntitySlim : ContentEntitySlim, IDocumentEntitySlim
{
private static readonly IReadOnlyDictionary<string, string> Empty = new Dictionary<string, string>();
private IReadOnlyDictionary<string, string> _cultureNames;
private IEnumerable<string> _publishedCultures;
private IEnumerable<string> _editedCultures;
/// <inheritdoc />
public IReadOnlyDictionary<string, string> CultureNames
{
get => _cultureNames ?? Empty;
set => _cultureNames = value;
}
/// <inheritdoc />
public IEnumerable<string> PublishedCultures
{
get => _publishedCultures ?? Enumerable.Empty<string>();
set => _publishedCultures = value;
}
/// <inheritdoc />
public IEnumerable<string> EditedCultures
{
get => _editedCultures ?? Enumerable.Empty<string>();
set => _editedCultures = value;
}
public ContentVariation Variations { get; set; }
/// <inheritdoc />
@@ -22,5 +42,6 @@ namespace Umbraco.Core.Models.Entities
/// <inheritdoc />
public bool Edited { get; set; }
}
}

View File

@@ -20,4 +20,4 @@
/// </summary>
string ContentTypeThumbnail { get; }
}
}
}

View File

@@ -7,26 +7,35 @@ namespace Umbraco.Core.Models.Entities
/// </summary>
public interface IDocumentEntitySlim : IContentEntitySlim
{
//fixme we need to supply more information than this and change this property name. This will need to include Published/Editor per variation since we need this information for the tree
/// <summary>
/// Gets the variant name for each culture
/// </summary>
IReadOnlyDictionary<string, string> CultureNames { get; }
/// <summary>
/// Gets the published cultures.
/// </summary>
IEnumerable<string> PublishedCultures { get; }
/// <summary>
/// Gets the edited cultures.
/// </summary>
IEnumerable<string> EditedCultures { get; }
/// <summary>
/// Gets the content variation of the content type.
/// </summary>
ContentVariation Variations { get; }
/// <summary>
/// At least one variation is published
/// Gets a value indicating whether the content is published.
/// </summary>
/// <remarks>
/// If the document is invariant, this simply means there is a published version
/// </remarks>
bool Published { get; set; }
bool Published { get; }
/// <summary>
/// At least one variation has pending changes
/// Gets a value indicating whether the content has been edited.
/// </summary>
/// <remarks>
/// If the document is invariant, this simply means there is pending changes
/// </remarks>
bool Edited { get; set; }
bool Edited { get; }
}
}