Beispiel #1
0
        public void Import(Models.Site site, Page parent, System.IO.Stream zipStream, bool @override)
        {
            List <string> pages = new List <string>();

            using (ZipFile zipFile = ZipFile.Read(zipStream))
            {
                foreach (ZipEntry item in zipFile)
                {
                    if (item.IsDirectory)
                    {
                        pages.Add(item.FileName);
                    }
                    else
                    {
                    }
                }
            }
            zipStream.Position = 0;

            IPageProvider filePageProvider = new Kooboo.CMS.Sites.Persistence.FileSystem.PageProvider();

            filePageProvider.Import(site, parent, zipStream, @override);


            foreach (var item in pages)
            {
                var page = filePageProvider.Get(GetPage(site, parent, item));
                this.Add(page);
            }
        }
Beispiel #2
0
        public void Export(IEnumerable <Models.Page> sources, System.IO.Stream outputStream)
        {
            IPageProvider filePageProvider = new Kooboo.CMS.Sites.Persistence.FileSystem.PageProvider();

            foreach (var item in sources)
            {
                ExportAsFileCascading(filePageProvider, item);
            }
            filePageProvider.Export(sources, outputStream);
        }
Beispiel #3
0
        public void InitializePages(Site site)
        {
            IPageProvider filePageProvider = new Kooboo.CMS.Sites.Persistence.FileSystem.PageProvider();

            foreach (var item in filePageProvider.All(site))
            {
                if (item.Site == site)
                {
                    InitializePageCascading(filePageProvider, item);
                }
            }
        }
Beispiel #4
0
        public void ExportPagesToDisk(Site site)
        {
            IPageProvider filePageProvider = new Kooboo.CMS.Sites.Persistence.FileSystem.PageProvider();

            //remove the pages folder to clear all old pages.
            var dummy = new Page(site, "Dummy");

            Kooboo.IO.IOUtility.DeleteDirectory(dummy.BasePhysicalPath, true);

            foreach (var item in QueryBySite(site))
            {
                ExportPageCascading(filePageProvider, item);
            }
        }
 public void InitializeToDB(Site site)
 {
     IPageProvider filePageProvider = new Kooboo.CMS.Sites.Persistence.FileSystem.PageProvider();
     foreach (var item in filePageProvider.All(site))
     {
         if (item.Site == site)
         {
             InitializePageCascading(filePageProvider, item);
         }
     }
 }
        public void Import(Models.Site site, Page parent, System.IO.Stream zipStream, bool @override)
        {
            List<string> pages = new List<string>();
            using (ZipFile zipFile = ZipFile.Read(zipStream))
            {
                foreach (ZipEntry item in zipFile)
                {
                    if (item.IsDirectory)
                    {
                        pages.Add(item.FileName);
                    }
                    else
                    {
                    }
                }
            }
            zipStream.Position = 0;

            IPageProvider filePageProvider = new Kooboo.CMS.Sites.Persistence.FileSystem.PageProvider();

            filePageProvider.Import(site, parent, zipStream, @override);

            foreach (var item in pages)
            {
                var page = filePageProvider.Get(GetPage(site, parent, item));
                this.Add(page);
            }
        }
        public void ExportToDisk(Site site)
        {
            IPageProvider filePageProvider = new Kooboo.CMS.Sites.Persistence.FileSystem.PageProvider();

            //remove the GetCachedPageList() folder to clear all old GetCachedPageList().
            var dummy = new Page(site, "Dummy");
            Kooboo.IO.IOUtility.DeleteDirectory(dummy.BasePhysicalPath, true);

            foreach (var item in QueryBySite(site))
            {
                ExportPageCascading(filePageProvider, item);
            }
        }
 public void Export(Site site, IEnumerable<Models.Page> sources, System.IO.Stream outputStream)
 {
     IPageProvider filePageProvider = new Kooboo.CMS.Sites.Persistence.FileSystem.PageProvider();
     foreach (var item in sources)
     {
         ExportAsFileCascading(filePageProvider, item);
     }
     filePageProvider.Export(site, sources, outputStream);
 }