/// <summary> /// Runs Post install actions such as clearning any necessary cache, reloading the correct tree nodes, etc... /// </summary> /// <param name="packageId"></param> /// <param name="dir"></param> private void PerformPostInstallCleanup(int packageId, string dir) { BasePage.Current.ClientTools.ReloadActionNode(true, true); _installer.InstallCleanUp(packageId, dir); //clear the tree cache ClientTools.ClearClientTreeCache().RefreshTree("packager"); TreeDefinitionCollection.Instance.ReRegisterTrees(); BizLogicAction.ReRegisterActionsAndHandlers(); }
protected void SelectStarterKitDesign(object sender, EventArgs e) { if (((Button)sender).CommandName == "apply") { Skin s = Skin.CreateFromName(((Button)sender).CommandArgument); Skinning.ActivateAsCurrentSkin(s); Page.Response.Redirect(library.NiceUrl(int.Parse(UmbracoContext.Current.PageId.ToString()))); } else if (((Button)sender).CommandName == "remove") { NodeFactory.Node n = NodeFactory.Node.GetCurrent(); Template t = new Template(n.template); Skinning.RollbackSkin(t.Id); Page.Response.Redirect(library.NiceUrl(int.Parse(UmbracoContext.Current.PageId.ToString()))); } else { Guid kitGuid = new Guid(((Button)sender).CommandArgument); cms.businesslogic.packager.Installer installer = new cms.businesslogic.packager.Installer(); if (repo.HasConnection()) { cms.businesslogic.packager.Installer p = new cms.businesslogic.packager.Installer(); string tempFile = p.Import(repo.fetch(kitGuid.ToString())); p.LoadConfig(tempFile); int pID = p.CreateManifest(tempFile, kitGuid.ToString(), repoGuid); p.InstallFiles(pID, tempFile); p.InstallBusinessLogic(pID, tempFile); p.InstallCleanUp(pID, tempFile); library.RefreshContent(); if (cms.businesslogic.skinning.Skinning.GetAllSkins().Count > 0) { cms.businesslogic.skinning.Skinning.ActivateAsCurrentSkin(cms.businesslogic.skinning.Skinning.GetAllSkins()[0]); } Page.Response.Redirect(library.NiceUrl(int.Parse(UmbracoContext.Current.PageId.ToString()))); } else { //ShowConnectionError(); } } }
/// <summary> /// Runs Post install actions such as clearning any necessary cache, reloading the correct tree nodes, etc... /// </summary> /// <param name="packageId"></param> /// <param name="dir"></param> private void PerformPostInstallCleanup(int packageId, string dir) { _installer.InstallCleanUp(packageId, dir); // Update ClientDependency version var clientDependencyConfig = new Umbraco.Core.Configuration.ClientDependencyConfiguration(LoggerResolver.Current.Logger); var clientDependencyUpdated = clientDependencyConfig.IncreaseVersionNumber(); //clear the tree cache - we'll do this here even though the browser will reload, but just in case it doesn't can't hurt. ClientTools.ClearClientTreeCache().RefreshTree("packager"); TreeDefinitionCollection.Instance.ReRegisterTrees(); BizLogicAction.ReRegisterActionsAndHandlers(); }
protected void SelectStarterKitDesign(object sender, EventArgs e) { if (((Button)sender).CommandName == "apply") { var s = Skin.CreateFromName(((Button)sender).CommandArgument); Skinning.ActivateAsCurrentSkin(s); Page.Response.Redirect(library.NiceUrl(int.Parse(UmbracoContext.Current.PageId.ToString()))); } else if (((Button)sender).CommandName == "remove") { var n = NodeFactory.Node.GetCurrent(); var t = new Template(n.template); Skinning.RollbackSkin(t.Id); Page.Response.Redirect(library.NiceUrl(int.Parse(UmbracoContext.Current.PageId.ToString()))); } else { var kitGuid = new Guid(((Button)sender).CommandArgument); if (_repo.HasConnection()) { var p = new cms.businesslogic.packager.Installer(); var tempFile = p.Import(_repo.fetch(kitGuid.ToString())); p.LoadConfig(tempFile); var pId = p.CreateManifest(tempFile, kitGuid.ToString(), RepoGuid); p.InstallFiles(pId, tempFile); p.InstallBusinessLogic(pId, tempFile); p.InstallCleanUp(pId, tempFile); //NOTE: This seems excessive to have to re-load all content from the database here!? library.RefreshContent(); if (Skinning.GetAllSkins().Count > 0) { Skinning.ActivateAsCurrentSkin(Skinning.GetAllSkins()[0]); } Page.Response.Redirect(library.NiceUrl(int.Parse(UmbracoContext.Current.PageId.ToString()))); } } }
public void installNitros(object sender, EventArgs e) { string repoGuid = "65194810-1f85-11dd-bd0b-0800200c9a66"; //Hardcoded official package repo key. var p = new cms.businesslogic.packager.Installer(Umbraco.Web.UmbracoContext.Current.Security.CurrentUser.Id); var repo = cms.businesslogic.packager.repositories.Repository.getByGuid(repoGuid); if (repo == null) { throw new InvalidOperationException("Could not find repository with id " + repoGuid); } foreach (CheckBox cb in _nitroList) { if (cb.Checked) { if (!_selectedNitros.Contains(cb.ID)) { _selectedNitros.Add(cb.ID); } } } foreach (string guid in _selectedNitros) { string tempFile = p.Import(repo.fetch(guid)); p.LoadConfig(tempFile); int pId = p.CreateManifest(tempFile, guid, repoGuid); //and then copy over the files. This will take some time if it contains .dlls that will reboot the system.. p.InstallFiles(pId, tempFile); //finally install the businesslogic p.InstallBusinessLogic(pId, tempFile); //cleanup.. p.InstallCleanUp(pId, tempFile); } ApplicationContext.Current.ApplicationCache.ClearAllCache(); library.RefreshContent(); loadNitros.Visible = false; RaiseBubbleEvent(new object(), new EventArgs()); }
protected void SelectStarterKit(object sender, EventArgs e) { Guid kitGuid = new Guid(((LinkButton)sender).CommandArgument); Helper.setProgress(10, "Connecting to skin repository", ""); cms.businesslogic.packager.Installer installer = new cms.businesslogic.packager.Installer(); if (repo.HasConnection()) { Helper.setProgress(20, "Downloading starter kit files...", ""); cms.businesslogic.packager.Installer p = new cms.businesslogic.packager.Installer(); string tempFile = p.Import(repo.fetch(kitGuid.ToString())); p.LoadConfig(tempFile); int pID = p.CreateManifest(tempFile, kitGuid.ToString(), repoGuid); Helper.setProgress(40, "Installing starter kit files", ""); p.InstallFiles(pID, tempFile); Helper.setProgress(60, "Installing starter kit system objects", ""); p.InstallBusinessLogic(pID, tempFile); Helper.setProgress(80, "Cleaning up after installation", ""); p.InstallCleanUp(pID, tempFile); library.RefreshContent(); Helper.setProgress(100, "Starter kit has been installed", ""); try { ((skinning)Parent.Parent.Parent.Parent.Parent).showStarterKitDesigns(kitGuid); } catch { OnStarterKitInstalled(); } } else { ShowConnectionError(); } }
public void installNitros(object sender, EventArgs e) { string repoGuid = "65194810-1f85-11dd-bd0b-0800200c9a66"; //Hardcoded official package repo key. cms.businesslogic.packager.Installer p = new cms.businesslogic.packager.Installer(); cms.businesslogic.packager.repositories.Repository repo = cms.businesslogic.packager.repositories.Repository.getByGuid(repoGuid); foreach (CheckBox cb in _nitroList) { if (cb.Checked) { if (!_selectedNitros.Contains(cb.ID)) { _selectedNitros.Add(cb.ID); } } } foreach (string guid in _selectedNitros) { string tempFile = p.Import(repo.fetch(guid)); p.LoadConfig(tempFile); int pId = p.CreateManifest(tempFile, guid, repoGuid); //and then copy over the files. This will take some time if it contains .dlls that will reboot the system.. p.InstallFiles(pId, tempFile); //finally install the businesslogic p.InstallBusinessLogic(pId, tempFile); //cleanup.. p.InstallCleanUp(pId, tempFile); } cms.businesslogic.cache.Cache.ClearAllCache(); library.RefreshContent(); loadNitros.Visible = false; RaiseBubbleEvent(new object(), new EventArgs()); }
public void installNitros(object sender, EventArgs e) { string repoGuid = "65194810-1f85-11dd-bd0b-0800200c9a66"; //Hardcoded official package repo key. cms.businesslogic.packager.Installer p = new cms.businesslogic.packager.Installer(); cms.businesslogic.packager.repositories.Repository repo = cms.businesslogic.packager.repositories.Repository.getByGuid(repoGuid); foreach (CheckBox cb in _nitroList) { if (cb.Checked) { if (!_selectedNitros.Contains(cb.ID)) _selectedNitros.Add(cb.ID); } } foreach (string guid in _selectedNitros) { string tempFile = p.Import(repo.fetch(guid)); p.LoadConfig(tempFile); int pId = p.CreateManifest(tempFile, guid, repoGuid); //and then copy over the files. This will take some time if it contains .dlls that will reboot the system.. p.InstallFiles(pId, tempFile); //finally install the businesslogic p.InstallBusinessLogic(pId, tempFile); //cleanup.. p.InstallCleanUp(pId, tempFile); } cms.businesslogic.cache.Cache.ClearAllCache(); library.RefreshContent(); loadNitros.Visible = false; RaiseBubbleEvent(new object(), new EventArgs()); }
protected void SelectStarterKitDesign(object sender, EventArgs e) { Helper.clearProgress(); Guid kitGuid = new Guid(((LinkButton)sender).CommandArgument); if (!cms.businesslogic.skinning.Skinning.IsSkinInstalled(kitGuid)) { Helper.setProgress(5, "Fetching starting kit from the repository", ""); cms.businesslogic.packager.Installer installer = new cms.businesslogic.packager.Installer(); if (repo.HasConnection()) { cms.businesslogic.packager.Installer p = new cms.businesslogic.packager.Installer(); Helper.setProgress(15, "Connected to repository", ""); string tempFile = p.Import(repo.fetch(kitGuid.ToString())); p.LoadConfig(tempFile); int pID = p.CreateManifest(tempFile, kitGuid.ToString(), repoGuid); Helper.setProgress(30, "Installing skin files", ""); p.InstallFiles(pID, tempFile); Helper.setProgress(50, "Installing skin system objects", ""); p.InstallBusinessLogic(pID, tempFile); Helper.setProgress(60, "Finishing skin installation", ""); p.InstallCleanUp(pID, tempFile); library.RefreshContent(); Helper.setProgress(80, "Activating skin", ""); if (cms.businesslogic.skinning.Skinning.GetAllSkins().Count > 0) { cms.businesslogic.skinning.Skinning.ActivateAsCurrentSkin(cms.businesslogic.skinning.Skinning.GetAllSkins()[0]); } Helper.setProgress(100, "Skin installation has been completed", ""); try { if (string.IsNullOrEmpty(GlobalSettings.ConfigurationStatus)) { GlobalSettings.ConfigurationStatus = GlobalSettings.CurrentVersion; Application["umbracoNeedConfiguration"] = false; } } catch { } try { Helper.RedirectToNextStep(Page); } catch { OnStarterKitDesignInstalled(); } } else { ShowConnectionError(); } } }
protected void SelectStarterKitDesign(object sender, EventArgs e) { if (((Button)sender).CommandName == "apply") { Skin s = Skin.CreateFromName(((Button)sender).CommandArgument); Skinning.ActivateAsCurrentSkin(s); Page.Response.Redirect(library.NiceUrl(int.Parse(UmbracoContext.Current.PageId.ToString()))); } else if (((Button)sender).CommandName == "remove") { NodeFactory.Node n = NodeFactory.Node.GetCurrent(); Template t = new Template(n.template); Skinning.RollbackSkin(t.Id); Page.Response.Redirect(library.NiceUrl(int.Parse(UmbracoContext.Current.PageId.ToString()))); } else { Guid kitGuid = new Guid(((Button)sender).CommandArgument); cms.businesslogic.packager.Installer installer = new cms.businesslogic.packager.Installer(); if (repo.HasConnection()) { cms.businesslogic.packager.Installer p = new cms.businesslogic.packager.Installer(); string tempFile = p.Import(repo.fetch(kitGuid.ToString())); p.LoadConfig(tempFile); int pID = p.CreateManifest(tempFile, kitGuid.ToString(), repoGuid); p.InstallFiles(pID, tempFile); p.InstallBusinessLogic(pID, tempFile); p.InstallCleanUp(pID, tempFile); library.RefreshContent(); if (cms.businesslogic.skinning.Skinning.GetAllSkins().Count > 0) { cms.businesslogic.skinning.Skinning.ActivateAsCurrentSkin(cms.businesslogic.skinning.Skinning.GetAllSkins()[0]); } Page.Response.Redirect(library.NiceUrl(int.Parse(UmbracoContext.Current.PageId.ToString()))); } else { //ShowConnectionError(); } } }
protected void SelectStarterKitDesign(object sender, EventArgs e) { if (((Button)sender).CommandName == "apply") { var s = Skin.CreateFromName(((Button)sender).CommandArgument); Skinning.ActivateAsCurrentSkin(s); Page.Response.Redirect(library.NiceUrl(int.Parse(UmbracoContext.Current.PageId.ToString()))); } else if (((Button)sender).CommandName == "remove") { var n = NodeFactory.Node.GetCurrent(); var t = new Template(n.template); Skinning.RollbackSkin(t.Id); Page.Response.Redirect(library.NiceUrl(int.Parse(UmbracoContext.Current.PageId.ToString()))); } else { var kitGuid = new Guid(((Button)sender).CommandArgument); if (_repo.HasConnection()) { var p = new cms.businesslogic.packager.Installer(); var tempFile = p.Import(_repo.fetch(kitGuid.ToString())); p.LoadConfig(tempFile); var pId = p.CreateManifest(tempFile, kitGuid.ToString(), RepoGuid); p.InstallFiles(pId, tempFile); p.InstallBusinessLogic(pId, tempFile); p.InstallCleanUp(pId, tempFile); //NOTE: This seems excessive to have to re-load all content from the database here!? library.RefreshContent(); if (Skinning.GetAllSkins().Count > 0) { Skinning.ActivateAsCurrentSkin(Skinning.GetAllSkins()[0]); } Page.Response.Redirect(library.NiceUrl(int.Parse(UmbracoContext.Current.PageId.ToString()))); } } }
protected void SelectStarterKitDesign(object sender, EventArgs e) { Helper.clearProgress(); Guid kitGuid = new Guid(((LinkButton)sender).CommandArgument); if (!cms.businesslogic.skinning.Skinning.IsSkinInstalled(kitGuid)) { Helper.setProgress(5, "Fetching starting kit from the repository", ""); cms.businesslogic.packager.Installer installer = new cms.businesslogic.packager.Installer(); if (repo.HasConnection()) { cms.businesslogic.packager.Installer p = new cms.businesslogic.packager.Installer(); Helper.setProgress(15, "Connected to repository", ""); string tempFile = p.Import(repo.fetch(kitGuid.ToString())); p.LoadConfig(tempFile); int pID = p.CreateManifest(tempFile, kitGuid.ToString(), repoGuid); Helper.setProgress(30, "Installing skin files", ""); p.InstallFiles(pID, tempFile); Helper.setProgress(50, "Installing skin system objects", ""); p.InstallBusinessLogic(pID, tempFile); Helper.setProgress(60, "Finishing skin installation", ""); p.InstallCleanUp(pID, tempFile); library.RefreshContent(); Helper.setProgress(80, "Activating skin", ""); if (cms.businesslogic.skinning.Skinning.GetAllSkins().Count > 0) { cms.businesslogic.skinning.Skinning.ActivateAsCurrentSkin(cms.businesslogic.skinning.Skinning.GetAllSkins()[0]); } Helper.setProgress(100, "Skin installation has been completed", ""); try { if (string.IsNullOrEmpty(GlobalSettings.ConfigurationStatus)) { GlobalSettings.ConfigurationStatus = UmbracoVersion.Current.ToString(3); Application["umbracoNeedConfiguration"] = false; } } catch { } try { Helper.RedirectToNextStep(Page); } catch { OnStarterKitDesignInstalled(); } } else { ShowConnectionError(); } } }
private void processInstall(string currentStep) { string dir = helper.Request("dir"); int packageId = 0; int.TryParse(helper.Request("pId"), out packageId); //first load in the config from the temporary directory //this will ensure that the installer have access to all the new files and the package manifest p.LoadConfig(dir); switch (currentStep) { case "businesslogic": p.InstallBusinessLogic(packageId, dir); //making sure that publishing actions performed from the cms layer gets pushed to the presentation library.RefreshContent(); if (p.Control != null && p.Control != "") { Response.Redirect("installer.aspx?installing=customInstaller&dir=" + dir + "&pId=" + packageId.ToString()); } else { Response.Redirect("installer.aspx?installing=finished&dir=" + dir + "&pId=" + packageId.ToString()); } break; case "customInstaller": if (p.Control != null && p.Control != "") { hideAllPanes(); configControl = new System.Web.UI.UserControl().LoadControl(SystemDirectories.Root + p.Control); configControl.ID = "packagerConfigControl"; pane_optional.Controls.Add(configControl); pane_optional.Visible = true; } else { hideAllPanes(); pane_success.Visible = true; BasePage.Current.ClientTools.ReloadActionNode(true, true); } break; case "finished": hideAllPanes(); string url = p.Url; string packageViewUrl = "installedPackage.aspx?id=" + packageId.ToString(); bt_viewInstalledPackage.OnClientClick = "document.location = '" + packageViewUrl + "'; return false;"; if (!string.IsNullOrEmpty(url)) { lit_authorUrl.Text = " <em>" + ui.Text("or") + "</em> <a href='" + url + "' target=\"_blank\">" + ui.Text("viewPackageWebsite") + "</a>"; } pane_success.Visible = true; BasePage.Current.ClientTools.ReloadActionNode(true, true); p.InstallCleanUp(packageId, dir); //clear the tree cache ClientTools.ClearClientTreeCache() .RefreshTree("packager"); TreeDefinitionCollection.Instance.ReRegisterTrees(); BizLogicAction.ReRegisterActionsAndHandlers(); break; default: break; } }