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
        //this accepts the package, creates the manifest and then installs the files.
        protected void startInstall(object sender, System.EventArgs e)
        {
            //we will now create the installer manifest, which means that umbraco can register everything that gets added to the system
            //this returns an id of the manifest.

            p.LoadConfig(tempFile.Value);

            int pId = p.CreateManifest(tempFile.Value, helper.Request("guid"), helper.Request("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.Value);

            Response.Redirect("installer.aspx?installing=businesslogic&dir=" + tempFile.Value + "&pId=" + pId.ToString());
        }
Exemplo n.º 3
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.º 4
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.º 5
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.º 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());
        }
Exemplo n.º 7
0
        //this accepts the package, creates the manifest and then installs the files.
        protected void startInstall(object sender, System.EventArgs e)
        {
            //we will now create the installer manifest, which means that umbraco can register everything that gets added to the system
            //this returns an id of the manifest.

            _installer.LoadConfig(tempFile.Value);

            int pId = _installer.CreateManifest(tempFile.Value, helper.Request("guid"), helper.Request("repoGuid"));

            //and then copy over the files. This will take some time if it contains .dlls that will reboot the system..
            _installer.InstallFiles(pId, tempFile.Value);

            //TODO: This is a total hack, we need to refactor the installer to be just like the package installer during the
            // install process and use AJAX to ensure that app pool restarts and restarts PROPERLY before installing the business
            // logic. Until then, we are going to put a thread sleep here for 2 seconds in hopes that we always fluke out and the app
            // pool will be restarted after redirect.
            Thread.Sleep(2000);

            Response.Redirect("installer.aspx?installing=businesslogic&dir=" + tempFile.Value + "&pId=" + pId.ToString());
        }
Exemplo n.º 8
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.º 10
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();
				}

			}
		}