public virtual void SerializeVersion(ContentVersion version, ContentItem item)
 {
     if (item == null)
     {
         version.Published      = null;
         version.FuturePublish  = null;
         version.Expired        = null;
         version.VersionDataXml = null;
         version.VersionIndex   = 0;
         version.Title          = null;
         version.State          = ContentState.None;
         version.ItemCount      = 0;
         version.VersionDataXml = null;
     }
     else
     {
         version.VersionIndex  = item.VersionIndex;
         version.Published     = item.Published;
         version.FuturePublish = item["FuturePublishDate"] as DateTime?;
         if (version.FuturePublish.HasValue)
         {
             item["FuturePublishDate"] = null;
         }
         version.Expired        = item.Expires;
         version.SavedBy        = item.SavedBy;
         version.Title          = item.Title;
         version.State          = item.State;
         version.VersionDataXml = ContentVersion.Serialize(exporter, item);
     }
 }
예제 #2
0
 public string Serialize(ContentItem item)
 {
     foreach (var descendant in Find.EnumerateChildren(item, true, false))
     {
         proxyFactory.OnSaving(descendant);
     }
     return(ContentVersion.Serialize(exporter, item));
 }