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 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; }
/// <summary> /// Combines resources for requests to /css/all.css. /// </summary> /// <returns>Returns combined test/css response for all.css.</returns> public ContentResult AllCss() { string cacheKey = "allcss"; MemoryCache cache = MemoryCache.Default; ResourceCombiner combiner = new ResourceCombiner(this.Config); string allCss = combiner.GetCachedOuput(cacheKey, cache); if (string.IsNullOrEmpty(allCss)) { allCss = combiner.GenerateCombinedResource(this.FileSystem.CombinedCssFiles, MemoryCache.Default, cacheKey); } return(Content(allCss, "text/css")); }
/// <summary> /// Combines resources for requests to /js/all.js. /// </summary> /// <returns>Returns combined JavaScript for all.js.</returns> public JavaScriptResult AllJs() { string cacheKey = "alljs"; MemoryCache cache = MemoryCache.Default; ResourceCombiner combiner = new ResourceCombiner(this.Config); string allScripts = combiner.GetCachedOuput(cacheKey, cache); if (string.IsNullOrEmpty(allScripts)) { allScripts = combiner.GenerateCombinedResource(this.FileSystem.CombinedJsFiles, MemoryCache.Default, cacheKey); } return(JavaScript(allScripts)); }
/// <summary> /// Combines resources for requests to /js/all.js. /// </summary> /// <returns>Returns combined JavaScript for all.js.</returns> public JavaScriptResult AllJs() { string cacheKey = "alljs"; MemoryCache cache = MemoryCache.Default; ResourceCombiner combiner = new ResourceCombiner(this.Config); string allScripts = combiner.GetCachedOuput(cacheKey, cache); if (string.IsNullOrEmpty(allScripts)) { allScripts = combiner.GenerateCombinedResource(this.FileSystem.CombinedJsFiles, MemoryCache.Default, cacheKey); } return JavaScript(allScripts); }
/// <summary> /// Combines resources for requests to /css/all.css. /// </summary> /// <returns>Returns combined test/css response for all.css.</returns> public ContentResult AllCss() { string cacheKey = "allcss"; MemoryCache cache = MemoryCache.Default; ResourceCombiner combiner = new ResourceCombiner(this.Config); string allCss = combiner.GetCachedOuput(cacheKey, cache); if (string.IsNullOrEmpty(allCss)) { allCss = combiner.GenerateCombinedResource(this.FileSystem.CombinedCssFiles, MemoryCache.Default, cacheKey); } return Content(allCss, "text/css"); }