diff --git a/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj b/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj index ca6128a99b..aa0fcb0968 100644 --- a/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj +++ b/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj @@ -269,6 +269,13 @@ default.aspx + + loadStarterKitDesigns.ascx + ASPXCodeBehind + + + loadStarterKitDesigns.ascx + ASPXCodeBehind diff --git a/src/Umbraco.Web.UI/install/steps/Skinning/loadStarterKitDesigns.ascx b/src/Umbraco.Web.UI/install/steps/Skinning/loadStarterKitDesigns.ascx index c475c273e3..864aeb5082 100644 --- a/src/Umbraco.Web.UI/install/steps/Skinning/loadStarterKitDesigns.ascx +++ b/src/Umbraco.Web.UI/install/steps/Skinning/loadStarterKitDesigns.ascx @@ -1,4 +1,4 @@ -<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="loadStarterKitDesigns.ascx.cs" Inherits="umbraco.presentation.install.steps.Skinning.loadStarterKitDesigns" %> +<%@ Control Language="C#" AutoEventWireup="True" CodeBehind="LoadStarterKitDesigns.ascx.cs" Inherits="Umbraco.Web.UI.Install.Steps.Skinning.LoadStarterKitDesigns" %> <%@ Import Namespace="umbraco.cms.businesslogic.packager.repositories" %> diff --git a/src/Umbraco.Web.UI/install/steps/Skinning/loadStarterKitDesigns.ascx.cs b/src/Umbraco.Web.UI/install/steps/Skinning/loadStarterKitDesigns.ascx.cs new file mode 100644 index 0000000000..dc992a5393 --- /dev/null +++ b/src/Umbraco.Web.UI/install/steps/Skinning/loadStarterKitDesigns.ascx.cs @@ -0,0 +1,12 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; +using umbraco.presentation.install.steps.Skinning; + +namespace Umbraco.Web.UI.Install.Steps.Skinning +{ + public partial class LoadStarterKitDesigns : loadStarterKitDesigns + { + } +} \ No newline at end of file diff --git a/src/Umbraco.Web.UI/install/steps/Skinning/loadStarterKitDesigns.ascx.designer.cs b/src/Umbraco.Web.UI/install/steps/Skinning/loadStarterKitDesigns.ascx.designer.cs new file mode 100644 index 0000000000..308600663c --- /dev/null +++ b/src/Umbraco.Web.UI/install/steps/Skinning/loadStarterKitDesigns.ascx.designer.cs @@ -0,0 +1,15 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Umbraco.Web.UI.Install.Steps.Skinning { + + + public partial class LoadStarterKitDesigns { + } +} diff --git a/src/Umbraco.Web/Umbraco.Web.csproj b/src/Umbraco.Web/Umbraco.Web.csproj index 02156551bc..0de8cb2b22 100644 --- a/src/Umbraco.Web/Umbraco.Web.csproj +++ b/src/Umbraco.Web/Umbraco.Web.csproj @@ -319,6 +319,9 @@ ASPXCodeBehind + + ASPXCodeBehind + ASPXCodeBehind @@ -430,13 +433,6 @@ skinning.ascx - - loadStarterKitDesigns.ascx - ASPXCodeBehind - - - loadStarterKitDesigns.ascx - @@ -1841,7 +1837,6 @@ - ASPXCodeBehind diff --git a/src/Umbraco.Web/umbraco.presentation/install/steps/Skinning/loadStarterKitDesigns.ascx b/src/Umbraco.Web/umbraco.presentation/install/steps/Skinning/loadStarterKitDesigns.ascx deleted file mode 100644 index 10957ef2f7..0000000000 --- a/src/Umbraco.Web/umbraco.presentation/install/steps/Skinning/loadStarterKitDesigns.ascx +++ /dev/null @@ -1,69 +0,0 @@ -<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="loadStarterKitDesigns.ascx.cs" Inherits="umbraco.presentation.install.steps.Skinning.loadStarterKitDesigns" %> -<%@ Import Namespace="umbraco.cms.businesslogic.packager.repositories" %> - - - -

Starter kit and skin have been installed

- -
- -
- - - - - - -
- -
\ No newline at end of file diff --git a/src/Umbraco.Web/umbraco.presentation/install/steps/Skinning/loadStarterKitDesigns.ascx.cs b/src/Umbraco.Web/umbraco.presentation/install/steps/Skinning/loadStarterKitDesigns.ascx.cs index ec3c221457..f927950843 100644 --- a/src/Umbraco.Web/umbraco.presentation/install/steps/Skinning/loadStarterKitDesigns.ascx.cs +++ b/src/Umbraco.Web/umbraco.presentation/install/steps/Skinning/loadStarterKitDesigns.ascx.cs @@ -8,152 +8,179 @@ using umbraco.BusinessLogic; namespace umbraco.presentation.install.steps.Skinning { - public delegate void StarterKitDesignInstalledEventHandler(); + public delegate void StarterKitDesignInstalledEventHandler(); - public partial class loadStarterKitDesigns : System.Web.UI.UserControl - { + public partial class loadStarterKitDesigns : System.Web.UI.UserControl + { - public event StarterKitDesignInstalledEventHandler StarterKitDesignInstalled; + public event StarterKitDesignInstalledEventHandler StarterKitDesignInstalled; - protected virtual void OnStarterKitDesignInstalled() - { - if (StarterKitDesignInstalled != null) - StarterKitDesignInstalled(); - } + protected virtual void OnStarterKitDesignInstalled() + { + if (StarterKitDesignInstalled != null) + StarterKitDesignInstalled(); + } - public Guid StarterKitGuid { get; set; } + public Guid StarterKitGuid { get; set; } - private cms.businesslogic.packager.repositories.Repository repo; - private string repoGuid = "65194810-1f85-11dd-bd0b-0800200c9a66"; + private cms.businesslogic.packager.repositories.Repository repo; + private string repoGuid = "65194810-1f85-11dd-bd0b-0800200c9a66"; - public loadStarterKitDesigns() - { - repo = cms.businesslogic.packager.repositories.Repository.getByGuid(repoGuid); - } + public loadStarterKitDesigns() + { + repo = cms.businesslogic.packager.repositories.Repository.getByGuid(repoGuid); + } - protected void Page_Load(object sender, EventArgs e) - { + protected void Page_Load(object sender, EventArgs e) + { - } - - - - protected override void OnInit(EventArgs e) - { - base.OnInit(e); - - if (repo.HasConnection()) - { - try - { - //clear progress bar cache - Helper.clearProgress(); - - var skinsCollection = repo.Webservice.Skins(StarterKitGuid.ToString()); - - var numberOfSkins = skinsCollection.Length; - this.Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "skinCounter", "var numberOfSkins = " + numberOfSkins, true); - - rep_starterKitDesigns.DataSource = skinsCollection; - rep_starterKitDesigns.DataBind(); - } - catch (Exception ex) - { - Log.Add(LogTypes.Debug, -1, ex.ToString()); - - ShowConnectionError(); - } - } - else - { - ShowConnectionError(); - } - } - - private void ShowConnectionError() - { - - uicontrols.Feedback fb = new global::umbraco.uicontrols.Feedback(); - fb.type = global::umbraco.uicontrols.Feedback.feedbacktype.error; - fb.Text = "No connection to repository. Starter Kits Designs could not be fetched from the repository as there was no connection to: '" + repo.RepositoryUrl + "'"; - - pl_loadStarterKitDesigns.Controls.Clear(); - pl_loadStarterKitDesigns.Controls.Add(fb); - } - - 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 - { + protected override void OnInit(EventArgs e) + { + base.OnInit(e); + + if (repo.HasConnection()) + { + try + { + //clear progress bar cache + Helper.clearProgress(); + + var skinsCollection = repo.Webservice.Skins(StarterKitGuid.ToString()); + + var numberOfSkins = skinsCollection.Length; + this.Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "skinCounter", "var numberOfSkins = " + numberOfSkins, true); + + rep_starterKitDesigns.DataSource = skinsCollection; + rep_starterKitDesigns.DataBind(); + } + catch (Exception ex) + { + Log.Add(LogTypes.Debug, -1, ex.ToString()); + + ShowConnectionError(); + } + } + else + { + ShowConnectionError(); + } + } + + private void ShowConnectionError() + { + + uicontrols.Feedback fb = new global::umbraco.uicontrols.Feedback(); + fb.type = global::umbraco.uicontrols.Feedback.feedbacktype.error; + fb.Text = "No connection to repository. Starter Kits Designs could not be fetched from the repository as there was no connection to: '" + repo.RepositoryUrl + "'"; + + pl_loadStarterKitDesigns.Controls.Clear(); + pl_loadStarterKitDesigns.Controls.Add(fb); + } + + 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]); + } - if (string.IsNullOrEmpty(GlobalSettings.ConfigurationStatus)) - { - GlobalSettings.ConfigurationStatus = GlobalSettings.CurrentVersion; - Application["umbracoNeedConfiguration"] = false; - } - } - catch - { - - } + Helper.setProgress(100, "Skin installation has been completed", ""); - try - { - Helper.RedirectToNextStep(Page); - } - catch - { - OnStarterKitDesignInstalled(); - } - } - else - { - ShowConnectionError(); - } + try + { - } - } - } + + if (string.IsNullOrEmpty(GlobalSettings.ConfigurationStatus)) + { + GlobalSettings.ConfigurationStatus = GlobalSettings.CurrentVersion; + Application["umbracoNeedConfiguration"] = false; + } + } + catch + { + + } + + try + { + Helper.RedirectToNextStep(Page); + } + catch + { + OnStarterKitDesignInstalled(); + } + } + else + { + ShowConnectionError(); + } + + } + } + + /// + /// pl_loadStarterKitDesigns control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.PlaceHolder pl_loadStarterKitDesigns; + + /// + /// pl_CustomizeSkin control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Panel pl_CustomizeSkin; + + /// + /// rep_starterKitDesigns control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Repeater rep_starterKitDesigns; + } } \ No newline at end of file diff --git a/src/Umbraco.Web/umbraco.presentation/install/steps/Skinning/loadStarterKitDesigns.ascx.designer.cs b/src/Umbraco.Web/umbraco.presentation/install/steps/Skinning/loadStarterKitDesigns.ascx.designer.cs deleted file mode 100644 index 173e8b04f7..0000000000 --- a/src/Umbraco.Web/umbraco.presentation/install/steps/Skinning/loadStarterKitDesigns.ascx.designer.cs +++ /dev/null @@ -1,42 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace umbraco.presentation.install.steps.Skinning { - - - public partial class loadStarterKitDesigns { - - /// - /// pl_loadStarterKitDesigns control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.PlaceHolder pl_loadStarterKitDesigns; - - /// - /// pl_CustomizeSkin control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.Panel pl_CustomizeSkin; - - /// - /// rep_starterKitDesigns control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.Repeater rep_starterKitDesigns; - } -}