public string GenerateZip() { // Writes the all.js and all.css files to disk ResourceCombiner combiner = new ResourceCombiner(this.Config); string allScripts = combiner.GenerateCombinedResource(this.FileSystem.CombinedJsFiles, MemoryCache.Default, null, this.FileSystem.JsDirectory + "\\all.js"); string allCss = combiner.GenerateCombinedResource(this.FileSystem.CombinedCssFiles, MemoryCache.Default, null, this.FileSystem.CssDirectory + "\\all.css"); parser = new LocalInstallPageParser(this.FileSystem.ProductSourcePath); appPath = Config.GetHttpContext().Request.ApplicationPath; if (!appPath.EndsWith("/")) { appPath += "/"; } rootHref = "href=\"" + appPath; rootSrc = "src=\"" + appPath; string outDir = this.GetTempDirName(); if (Directory.Exists(outDir)) { Directory.Delete(outDir, true); } string culture = this.Resources.Culture; Directory.CreateDirectory(outDir); this.DirectoryCopy(this.FileSystem.JsDirectory, Path.Combine(outDir, "js"), true); this.DirectoryCopy(this.FileSystem.CssDirectory, Path.Combine(outDir, "css"), true); //this.DirectoryCopy(this.FileSystem.IgniteUIDirectory, Path.Combine(outDir, "igniteui"), true); this.DirectoryCopy(this.FileSystem.ImagesDirectory, Path.Combine(outDir, "images"), true); this.DirectoryCopy(this.FileSystem.DataDirectory, Path.Combine(outDir, "js-data"), true, true); IndexViewModel model = ViewModelFactory.CreateIndexViewModel(this.PathHelper, this.TableOfContentsRepository, this.ApplicationSamplesRepository, this.ControlRepository, this.SampleRepository, MemoryCache.Default); string index = this.IndexLocalInstall(model).Replace(rootHref, "href=\"./").Replace(rootSrc, "src=\"./"); string indexFileName = Path.Combine(outDir, "index.html"); parser.ChangeNavLinks(index, indexFileName); string showcase = this.ShowcaseLocalInstall().Replace(rootHref, "href=\"./").Replace(rootSrc, "src=\"./"); string showcaseFileName = Path.Combine(outDir, "application-samples.html"); parser.ChangeNavLinks(showcase, showcaseFileName); string gettingStarted = this.GettingStartedLocalInstall("getting-started").Replace("href=\"~/", rootHref).Replace(rootHref, "href=\"./").Replace(rootSrc, "src=\"./").Replace("src=\"./../igniteui/", "src=\"./igniteui/"); string gettingStartedFileName = Path.Combine(outDir, "getting-started.html"); parser.ChangeNavLinks(gettingStarted, gettingStartedFileName); this.GettingStartedLocalInstallMobile(outDir, "getting-started-mobile"); this.CreateSamplePages(outDir, model); string zipFileName = this.WriteZipFile(outDir); Directory.Delete(outDir, true); return(zipFileName); }
public void GettingStartedLocalInstallMobile(string outDir, string filePath) { GettingStartedViewModel model = ViewModelFactory.CreateGettingStartedViewModel(this.PathHelper, this.TableOfContentsRepository, this.HelpContentRepository, this.ControlRepository, this.SampleRepository, filePath, MemoryCache.Default); string sample = ViewRenderer.RenderView("~/Views/Shared/GettingStarted.cshtml", model, ControllerContext); string gettingStartedMobile = sample.Replace("href=\"~/", rootHref).Replace(rootHref, "href=\"./").Replace(rootSrc, "src=\"./").Replace("src=\"./../igniteui/", "src=\"./igniteui/"); string gettingStartedMobileFileName = Path.Combine(outDir, "getting-started-mobile.html"); List <string> iframeSrcs = new List <string>(); foreach (Sample s in model.GettingStartedContent.Samples) { this.CreateMobileSamplePage(outDir, s.Control.PathID, s.PathID); iframeSrcs.Add(s.Control.PathID + "/" + s.PathID); } gettingStartedMobile = parser.AddFileExtentionToIFrames(gettingStartedMobile, iframeSrcs); parser.ChangeNavLinks(gettingStartedMobile, gettingStartedMobileFileName); }
public string GenerateZip() { // Writes the all.js and all.css files to disk ResourceCombiner combiner = new ResourceCombiner(this.Config); string allScripts = combiner.GenerateCombinedResource(this.FileSystem.CombinedJsFiles, MemoryCache.Default, null, this.FileSystem.JsDirectory + "\\all.js"); string allCss = combiner.GenerateCombinedResource(this.FileSystem.CombinedCssFiles, MemoryCache.Default, null, this.FileSystem.CssDirectory + "\\all.css"); parser = new LocalInstallPageParser(this.FileSystem.ProductSourcePath); appPath = Config.GetHttpContext().Request.ApplicationPath; if (!appPath.EndsWith("/")) appPath += "/"; rootHref = "href=\"" + appPath; rootSrc = "src=\"" + appPath; string outDir = this.GetTempDirName(); if (Directory.Exists(outDir)) Directory.Delete(outDir, true); string culture = this.Resources.Culture; Directory.CreateDirectory(outDir); this.DirectoryCopy(this.FileSystem.JsDirectory, Path.Combine(outDir, "js"), true); this.DirectoryCopy(this.FileSystem.CssDirectory, Path.Combine(outDir, "css"), true); //this.DirectoryCopy(this.FileSystem.IgniteUIDirectory, Path.Combine(outDir, "igniteui"), true); this.DirectoryCopy(this.FileSystem.ImagesDirectory, Path.Combine(outDir, "images"), true); this.DirectoryCopy(this.FileSystem.DataDirectory, Path.Combine(outDir, "js-data"), true, true); IndexViewModel model = ViewModelFactory.CreateIndexViewModel(this.PathHelper, this.TableOfContentsRepository, this.ApplicationSamplesRepository, this.ControlRepository, this.SampleRepository, MemoryCache.Default); string index = this.IndexLocalInstall(model).Replace(rootHref, "href=\"./").Replace(rootSrc, "src=\"./"); string indexFileName = Path.Combine(outDir, "index.html"); parser.ChangeNavLinks(index, indexFileName); string showcase = this.ShowcaseLocalInstall().Replace(rootHref, "href=\"./").Replace(rootSrc, "src=\"./"); string showcaseFileName = Path.Combine(outDir, "application-samples.html"); parser.ChangeNavLinks(showcase, showcaseFileName); string gettingStarted = this.GettingStartedLocalInstall("getting-started").Replace("href=\"~/", rootHref).Replace(rootHref, "href=\"./").Replace(rootSrc, "src=\"./").Replace("src=\"./../igniteui/","src=\"./igniteui/"); string gettingStartedFileName = Path.Combine(outDir, "getting-started.html"); parser.ChangeNavLinks(gettingStarted, gettingStartedFileName); this.GettingStartedLocalInstallMobile(outDir, "getting-started-mobile"); this.CreateSamplePages(outDir, model); string zipFileName = this.WriteZipFile(outDir); Directory.Delete(outDir, true); return zipFileName; }