Example #1
0
        /// <summary>
        ///  our save routine, checks to see if the item has been renamed, or if it's been moved
        ///  then saves. 
        /// </summary>
        void SaveContentItemsToDisk(IContentService sender, IEnumerable<IContent> items)
        {
            SourceInfo.Load(); 

            ContentExporter w = new ContentExporter();
            foreach (var item in items)
            {
                LogHelper.Info<ContentExporter>("Saving {0} [{1}]", () => item.Name, () => item.Name.ToSafeAlias());
                string sourceName = SourceInfo.GetName(item.Key);
                if ( (sourceName!= null) && (item.Name != sourceName ) )
                {
                    LogHelper.Info<ContentExporter>("Rename {0}", () => item.Name);
                    w.RenameContent(item, SourceInfo.GetName(item.Key));
                }
                
                int? parent = SourceInfo.GetParent(item.Key) ; 
                if ( (parent != null) && (item.ParentId != parent.Value))
                {
                    LogHelper.Info<ContentExporter>("Move {0}", () => item.Name);
                    w.MoveContent(item, parent.Value);
                }

                w.SaveContent(item); 

            }
            SourceInfo.Save(); 
        }
Example #2
0
        protected void fullExport_Click(object sender, EventArgs e)
        {

            Stopwatch sw = Stopwatch.StartNew();

            ContentExporter cw = new ContentExporter(); 
            int contentCount = cw.ExportSite(false);

            MediaExporter me = new MediaExporter();
            int mediaCount = me.Export(); 

            sw.Stop(); 

            lblStatus.Text = String.Format("Exported {0} content nodes and {1} media items [{2} seconds]", 
                contentCount, mediaCount, sw.Elapsed.TotalSeconds); 
        }
Example #3
0
 void ArchiveContentItem(IContent item)
 {
     SourceInfo.Load();
     ContentExporter w = new ContentExporter();
     w.ArchiveContent(item);
     SourceInfo.Save();
 }
Example #4
0
 void ArchiveContentItems(IEnumerable<IContent> items)
 {
     SourceInfo.Load();
     ContentExporter w = new ContentExporter();
     foreach (var item in items)
     {
         w.ArchiveContent(item);
     }
     SourceInfo.Save(); 
 }
Example #5
0
 public int ExportContent(bool pairs)
 {
     // do the content exoort
     ContentExporter cw = new ContentExporter();
     return cw.ExportSite(pairs);    
 }