Exemplo n.º 1
0
        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();
                }
            }
        }
Exemplo n.º 2
0
        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())));
                }
            }
        }
Exemplo n.º 3
0
        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());
        }
Exemplo n.º 4
0
        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();
            }
        }
Exemplo n.º 5
0
        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());
        }
Exemplo n.º 6
0
        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();
                }
            }
        }
Exemplo n.º 8
0
        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();
				}

			}
		}
Exemplo n.º 11
0
        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;
            }
        }
Exemplo n.º 12
0
        private void ProcessInstall(string currentStep)
        {
            var dir       = Request.GetItemAsString("dir");
            var packageId = 0;

            int.TryParse(Request.GetItemAsString("pId"), out packageId);

            switch (currentStep)
            {
            case "businesslogic":
                //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
                _installer.LoadConfig(dir);
                _installer.InstallBusinessLogic(packageId, dir);


                //making sure that publishing actions performed from the cms layer gets pushed to the presentation
                library.RefreshContent();

                if (!string.IsNullOrEmpty(_installer.Control))
                {
                    Response.Redirect("installer.aspx?installing=customInstaller&dir=" + dir + "&pId=" + packageId.ToString() + "&customControl=" + Server.UrlEncode(_installer.Control) + "&customUrl=" + Server.UrlEncode(_installer.Url));
                }
                else
                {
                    Response.Redirect("installer.aspx?installing=finished&dir=" + dir + "&pId=" + packageId.ToString() + "&customUrl=" + Server.UrlEncode(_installer.Url));
                }
                break;

            case "customInstaller":
                var customControl = Request.GetItemAsString("customControl");

                if (!customControl.IsNullOrWhiteSpace())
                {
                    HideAllPanes();

                    _configControl    = new System.Web.UI.UserControl().LoadControl(SystemDirectories.Root + customControl);
                    _configControl.ID = "packagerConfigControl";

                    pane_optional.Controls.Add(_configControl);
                    pane_optional.Visible = true;

                    if (!IsPostBack)
                    {
                        //We still need to clean everything up which is normally done in the Finished Action
                        PerformPostInstallCleanup(packageId, dir);
                    }
                }
                else
                {
                    //if the custom installer control is empty here (though it should never be because we've already checked for it previously)
                    //then we should run the normal FinishedAction
                    PerformFinishedAction(packageId, dir, Request.GetItemAsString("customUrl"));
                }
                break;

            case "finished":
                PerformFinishedAction(packageId, dir, Request.GetItemAsString("customUrl"));
                break;

            default:
                break;
            }
        }