Refactor content culture & variations
This commit is contained in:
@@ -18,7 +18,7 @@ namespace Umbraco.Web.PublishedCache.NuCache.DataSource
|
||||
for (var i = 0; i < pcount; i++)
|
||||
{
|
||||
var languageId = PrimitiveSerializer.String.ReadFrom(stream);
|
||||
var cultureVariation = new CultureVariation { Name = ReadStringObject(stream) };
|
||||
var cultureVariation = new CultureVariation { Name = ReadStringObject(stream), Date = ReadDateTime(stream) };
|
||||
dict[languageId] = cultureVariation;
|
||||
}
|
||||
return dict;
|
||||
@@ -40,6 +40,7 @@ namespace Umbraco.Web.PublishedCache.NuCache.DataSource
|
||||
|
||||
PrimitiveSerializer.String.WriteTo(culture, stream); // should never be null
|
||||
WriteObject(variation.Name, stream); // write an object in case it's null (though... should not happen)
|
||||
PrimitiveSerializer.DateTime.WriteTo(variation.Date, stream);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,20 +6,18 @@ namespace Umbraco.Web.PublishedCache.NuCache.DataSource
|
||||
// represents everything that is specific to edited or published version
|
||||
internal class ContentData
|
||||
{
|
||||
public string Name { get; set; }
|
||||
public int VersionId { get; set; }
|
||||
public DateTime VersionDate { get; set; }
|
||||
public int WriterId { get; set; }
|
||||
public int TemplateId { get; set; }
|
||||
public bool Published { get; set; }
|
||||
|
||||
public IDictionary<string, PropertyData[]> Properties { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The collection of language Id to name for the content item
|
||||
/// </summary>
|
||||
public IReadOnlyDictionary<string, CultureVariation> CultureInfos { get; set; }
|
||||
|
||||
public string Name { get; set; }
|
||||
public int VersionId { get; set; }
|
||||
//TODO: This will not make a lot of sense since we'll have dates for each variant publishing, need to wait on Stephane
|
||||
public DateTime VersionDate { get; set; }
|
||||
public int WriterId { get; set; }
|
||||
public int TemplateId { get; set; }
|
||||
|
||||
public IDictionary<string, PropertyData[]> Properties { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Umbraco.Web.PublishedCache.NuCache.DataSource
|
||||
{
|
||||
@@ -10,6 +11,7 @@ namespace Umbraco.Web.PublishedCache.NuCache.DataSource
|
||||
[JsonProperty("name")]
|
||||
public string Name { get; set; }
|
||||
|
||||
//TODO: We may want some date stamps here
|
||||
[JsonProperty("date")]
|
||||
public DateTime Date { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user