protected void Page_Load(object sender, System.EventArgs e) { Exception ex = new Exception(); if (!cms.businesslogic.packager.Settings.HasFileAccess(ref ex)) { fb.Style.Add("margin-top", "7px"); fb.type = uicontrols.Feedback.feedbacktype.error; fb.Text = "<strong>" + ui.Text("errors", "filePermissionsError") + ":</strong><br/>" + ex.Message; } if (!IsPostBack) { ButtonInstall.Attributes.Add("onClick", "jQuery(this).hide(); jQuery('#installingMessage').show();; return true;"); ButtonLoadPackage.Attributes.Add("onClick", "jQuery(this).hide(); jQuery('#loadingbar').show();; return true;"); } //if we are actually in the middle of installing something... if (!String.IsNullOrEmpty(helper.Request("installing"))) { hideAllPanes(); pane_installing.Visible = true; processInstall(helper.Request("installing")); } else if (!String.IsNullOrEmpty(helper.Request("guid")) && !String.IsNullOrEmpty(helper.Request("repoGuid"))) { //we'll fetch the local information we have about our repo, to find out what webservice to query. repo = cms.businesslogic.packager.repositories.Repository.getByGuid(helper.Request("repoGuid")); if (repo.HasConnection()) { //from the webservice we'll fetch some info about the package. cms.businesslogic.packager.repositories.Package pack = repo.Webservice.PackageByGuid(helper.Request("guid")); //if the package is protected we will ask for the users credentials. (this happens every time they try to fetch anything) if (!pack.Protected) { //if it isn't then go straigt to the accept licens screen tempFile.Value = p.Import(repo.fetch(helper.Request("guid"))); updateSettings(); } else if (!IsPostBack) { //Authenticate against the repo hideAllPanes(); pane_authenticate.Visible = true; } } else { fb.Style.Add("margin-top", "7px"); fb.type = global::umbraco.uicontrols.Feedback.feedbacktype.error; fb.Text = "<strong>No connection to repository.</strong> Runway could not be installed as there was no connection to: '" + repo.RepositoryUrl + "'"; pane_upload.Visible = false; } } }
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()))); } } }
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(); } } }
protected void Page_Load(object sender, EventArgs e) { var ex = new Exception(); if (!cms.businesslogic.packager.Settings.HasFileAccess(ref ex)) { fb.Style.Add("margin-top", "7px"); fb.type = uicontrols.Feedback.feedbacktype.error; fb.Text = "<strong>" + ui.Text("errors", "filePermissionsError") + ":</strong><br/>" + ex.Message; } if (!IsPostBack) { ButtonInstall.Attributes.Add("onClick", "jQuery(this).hide(); jQuery('#installingMessage').show();; return true;"); ButtonLoadPackage.Attributes.Add("onClick", "jQuery(this).hide(); jQuery('#loadingbar').show();; return true;"); } //if we are actually in the middle of installing something... meaning we keep redirecting back to this page with // custom query strings // TODO: SD: This process needs to be fixed/changed/etc... to use the InstallPackageController // http://issues.umbraco.org/issue/U4-1047 if (!string.IsNullOrEmpty(Request.GetItemAsString("installing"))) { HideAllPanes(); pane_installing.Visible = true; ProcessInstall(Request.GetItemAsString("installing")); //process the current step } else if (tempFile.Value.IsNullOrWhiteSpace() && //if we haven't downloaded the .umb temp file yet (!Request.GetItemAsString("guid").IsNullOrWhiteSpace() && !Request.GetItemAsString("repoGuid").IsNullOrWhiteSpace())) { //we'll fetch the local information we have about our repo, to find out what webservice to query. _repo = cms.businesslogic.packager.repositories.Repository.getByGuid(Request.GetItemAsString("repoGuid")); if (_repo.HasConnection()) { //from the webservice we'll fetch some info about the package. cms.businesslogic.packager.repositories.Package pack = _repo.Webservice.PackageByGuid(Request.GetItemAsString("guid")); //if the package is protected we will ask for the users credentials. (this happens every time they try to fetch anything) if (!pack.Protected) { //if it isn't then go straigt to the accept licens screen tempFile.Value = _installer.Import(_repo.fetch(Request.GetItemAsString("guid"))); UpdateSettings(); } else if (!IsPostBack) { //Authenticate against the repo HideAllPanes(); pane_authenticate.Visible = true; } } else { fb.Style.Add("margin-top", "7px"); fb.type = global::umbraco.uicontrols.Feedback.feedbacktype.error; fb.Text = "<strong>No connection to repository.</strong> Runway could not be installed as there was no connection to: '" + _repo.RepositoryUrl + "'"; pane_upload.Visible = false; } } }