List:Commits« Previous MessageNext Message »
From:Reggie Burnett Date:February 9 2011 2:52pm
Subject:bzr commit into wex-installer-1.0 branch (reggie.burnett:321)
View as plain text  
#At file:///C:/Users/Reggie/work/wex/installer-updated/ based on revid:reggie.burnett@stripped

  321 Reggie Burnett	2011-02-09
      fixed configuration after refactor

    modified:
      StandardPlugins/Server/ConfigurationController.cs
      StandardPlugins/StandardPlugins.csproj
      WexInstaller.Core/ProductConfigurationController.cs
      WexInstaller/InstallWizard/AllConfigOverview.cs
      WexInstaller/InstallWizard/InstallProgressPanel.cs
      installer-vs2010.sln
=== modified file 'StandardPlugins/Server/ConfigurationController.cs'
=== modified file 'StandardPlugins/Server/ConfigurationController.cs'
--- a/StandardPlugins/Server/ConfigurationController.cs	2011-02-09 13:49:30 +0000
+++ b/StandardPlugins/Server/ConfigurationController.cs	2011-02-09 14:52:59 +0000
@@ -58,17 +58,17 @@
             get { return (Reconfigure) ? 1 : 2; }
         }
 
-        public override void PostAction(ConfigurationAction action)
+        public override void PostAction()
         {
             Initialize();
         }
 
         private bool ProcessTemplate()
         {
-            OnConfigured(new ConfigurationEventArgs(ConfigurationEventType.Info, "VALID_TEMPLATE"));
+            ReportConfigStatus(new ConfigurationEventArgs(ConfigurationEventType.Info, "VALID_TEMPLATE"));
             if (it.IsValid)
             {
-                OnConfigured(new ConfigurationEventArgs(ConfigurationEventType.Success, "VALID_TEMPLATE"));
+                ReportConfigStatus(new ConfigurationEventArgs(ConfigurationEventType.Success, "VALID_TEMPLATE"));
 
                 switch (ServerInstallType)
                 {
@@ -98,15 +98,15 @@
                     it.Port = Port.ToString();
                 }
 
-                OnConfigured(new ConfigurationEventArgs(ConfigurationEventType.Info, "PROCESS_TEMPLATE"));
+                ReportConfigStatus(new ConfigurationEventArgs(ConfigurationEventType.Info, "PROCESS_TEMPLATE"));
                 it.ProcessTemplate();
-                OnConfigured(new ConfigurationEventArgs(ConfigurationEventType.Success, "PROCESS_TEMPLATE"));
+                ReportConfigStatus(new ConfigurationEventArgs(ConfigurationEventType.Success, "PROCESS_TEMPLATE"));
                 processedTemplate = true;
             }
             else
             {
                 // Bad Template.  Error.
-                OnConfigured(new ConfigurationEventArgs(ConfigurationEventType.Error, "VALID_TEMPLATE"));
+                ReportConfigStatus(new ConfigurationEventArgs(ConfigurationEventType.Error, "VALID_TEMPLATE"));
 
                 processedTemplate = false;
             }
@@ -125,27 +125,27 @@
                 {
                     // Make sure the existing server uses the new configuration file, then 
                     // start it.
-                    OnConfigured(new ConfigurationEventArgs(ConfigurationEventType.Info, "CONFIGURE_SERVICE"));
+                    ReportConfigStatus(new ConfigurationEventArgs(ConfigurationEventType.Info, "CONFIGURE_SERVICE"));
                     mysql_scm.Update(thisServiceName,
                                         String.Format("\"{0}bin\\mysqld\" --defaults-file=\"{1}\" {2}",
                                         it.BaseDir, it.ConfigurationFile, thisServiceName));
-                    OnConfigured(new ConfigurationEventArgs(ConfigurationEventType.Success, "CONFIGURE_SERVICE"));
+                    ReportConfigStatus(new ConfigurationEventArgs(ConfigurationEventType.Success, "CONFIGURE_SERVICE"));
 
-                    OnConfigured(new ConfigurationEventArgs(ConfigurationEventType.Info, "START_SERVICE"));
+                    ReportConfigStatus(new ConfigurationEventArgs(ConfigurationEventType.Info, "START_SERVICE"));
                     mysql_scm.Restart(thisServiceName);
-                    OnConfigured(new ConfigurationEventArgs(ConfigurationEventType.Success, "START_SERVICE"));
+                    ReportConfigStatus(new ConfigurationEventArgs(ConfigurationEventType.Success, "START_SERVICE"));
                 }
                 else
                 {
                     // Add and Start the service. 
-                    OnConfigured(new ConfigurationEventArgs(ConfigurationEventType.Info, "CONFIGURE_SERVICE"));
+                    ReportConfigStatus(new ConfigurationEventArgs(ConfigurationEventType.Info, "CONFIGURE_SERVICE"));
                     mysql_scm.Add(ServiceName, ServiceName,
                                     String.Format("\"{0}bin\\mysqld\" --defaults-file=\"{1}\" {2}", it.BaseDir, it.ConfigurationFile, ServiceName));
-                    OnConfigured(new ConfigurationEventArgs(ConfigurationEventType.Success, "CONFIGURE_SERVICE"));
+                    ReportConfigStatus(new ConfigurationEventArgs(ConfigurationEventType.Success, "CONFIGURE_SERVICE"));
 
-                    OnConfigured(new ConfigurationEventArgs(ConfigurationEventType.Info, "START_SERVICE"));
+                    ReportConfigStatus(new ConfigurationEventArgs(ConfigurationEventType.Info, "START_SERVICE"));
                     mysql_scm.Start(ServiceName);
-                    OnConfigured(new ConfigurationEventArgs(ConfigurationEventType.Success, "START_SERVICE"));
+                    ReportConfigStatus(new ConfigurationEventArgs(ConfigurationEventType.Success, "START_SERVICE"));
 
                     processedService = false;
                 }
@@ -155,7 +155,7 @@
             catch
             {
                 // Failed to add or start the server
-                OnConfigured(new ConfigurationEventArgs(ConfigurationEventType.Error, "CONFIGURE_SERVICE"));
+                ReportConfigStatus(new ConfigurationEventArgs(ConfigurationEventType.Error, "CONFIGURE_SERVICE"));
             }
 
             return processedService;
@@ -165,7 +165,7 @@
         {
             try
             {
-                OnConfigured(new ConfigurationEventArgs(ConfigurationEventType.Info, "SECURITY_SETTING"));
+                ReportConfigStatus(new ConfigurationEventArgs(ConfigurationEventType.Info, "SECURITY_SETTING"));
 
                 // Set root password.
                 MySqlCommand cmd = new MySqlCommand();
@@ -182,14 +182,14 @@
                 cmd.CommandText = "FLUSH PRIVILEGES";
                 cmd.ExecuteNonQuery();
                 cmd.Connection.Close();
-                OnConfigured(new ConfigurationEventArgs(ConfigurationEventType.Success, "SECURITY_SETTING"));
+                ReportConfigStatus(new ConfigurationEventArgs(ConfigurationEventType.Success, "SECURITY_SETTING"));
 
                 processedSecuritySettings = true;
             }
             catch (MySqlException)
             {
                 // Failed to set root password.
-                OnConfigured(new ConfigurationEventArgs(ConfigurationEventType.Error, "SECURITY_SETTING"));
+                ReportConfigStatus(new ConfigurationEventArgs(ConfigurationEventType.Error, "SECURITY_SETTING"));
                 processedSecuritySettings = false;
             }
 
@@ -315,23 +315,7 @@
                 return "Dedicated Machine";
         }
 
-        //public string GetConfigurationAsText()
-        //{
-        //    StringBuilder s = new StringBuilder();
-        //    s.AppendLine("Configuration Type");
-        //    s.AppendLine(String.Format("     {0}", GetServerTypeAsString()));
-        //    s.AppendLine(String.Format("TCP/IP Networking {0}", EnableTCPIP ? "enabled" : "disabled"));
-        //    s.AppendLine(String.Format("     Port: {0}", EnableTCPIP ? Port.ToString() : "N/A"));
-        //    s.AppendLine("Windows Settings");
-        //    s.AppendLine(String.Format("     Windows Service Name: {0}", 
-        //                 String.IsNullOrEmpty(ServiceName) ? "<Not Set>" : ServiceName));
-        //    s.AppendLine("Security Settings");
-        //    s.AppendLine(String.Format("     Root Password {0}Set", 
-        //                 String.IsNullOrEmpty(RootPassword) ? "Not " : ""));
-        //    return s.ToString();
-        //}
-
-        protected override void OnConfigured(ConfigurationEventArgs e)
+        protected override void ReportConfigStatus(ConfigurationEventArgs e)
         {
             string message = String.Empty;
             int percent = 100 / 11;
@@ -423,7 +407,7 @@
             e.Details = message;
             e.PercentComplete = percent;
 
-            bgw.ReportProgress(percent, e);
+            ReportProgress(percent, e);
         }
 
         /// ========================================================================

=== modified file 'StandardPlugins/StandardPlugins.csproj'
--- a/StandardPlugins/StandardPlugins.csproj	2011-02-09 13:49:30 +0000
+++ b/StandardPlugins/StandardPlugins.csproj	2011-02-09 14:52:59 +0000
@@ -45,12 +45,6 @@
   </ItemGroup>
   <ItemGroup>
     <Compile Include="Examples\ConfigurationController.cs" />
-    <Compile Include="Examples\ExamplesConfigPanel1.cs">
-      <SubType>UserControl</SubType>
-    </Compile>
-    <Compile Include="Examples\ExamplesConfigPanel1.Designer.cs">
-      <DependentUpon>ExamplesConfigPanel1.cs</DependentUpon>
-    </Compile>
     <Compile Include="Properties\AssemblyInfo.cs" />
     <Compile Include="Properties\Resources.Designer.cs">
       <AutoGen>True</AutoGen>
@@ -80,9 +74,6 @@
     </Compile>
   </ItemGroup>
   <ItemGroup>
-    <EmbeddedResource Include="Examples\ExamplesConfigPanel1.resx">
-      <DependentUpon>ExamplesConfigPanel1.cs</DependentUpon>
-    </EmbeddedResource>
     <EmbeddedResource Include="Properties\Resources.resx">
       <Generator>ResXFileCodeGenerator</Generator>
       <LastGenOutput>Resources.Designer.cs</LastGenOutput>

=== modified file 'WexInstaller.Core/ProductConfigurationController.cs'
--- a/WexInstaller.Core/ProductConfigurationController.cs	2011-02-09 13:49:30 +0000
+++ b/WexInstaller.Core/ProductConfigurationController.cs	2011-02-09 14:52:59 +0000
@@ -37,6 +37,12 @@
             bgw.RunWorkerAsync();
         }
 
+        protected virtual void ReportProgress(int percent, ConfigurationEventArgs args)
+        {
+            if (bgw != null)
+                bgw.ReportProgress(percent, args);
+        }
+
         protected virtual void BackgroundConfigure(object sender, DoWorkEventArgs e) { }
 
         protected virtual void BackgroundConfigureProgressChanged(object sender, ProgressChangedEventArgs e)
@@ -58,11 +64,12 @@
         }
 
         public virtual void Initialize() { }
-        public virtual void PreAction(ConfigurationAction action) { }
-        public virtual void PostAction(ConfigurationAction action) { }
+        public virtual void PreAction() { }
+        public virtual void PostAction() { }
+        protected virtual void ReportConfigStatus(ConfigurationEventArgs args) { }
 
         public event ConfigurationEventHandler Configured;
-        protected virtual void OnConfigured(ConfigurationEventArgs args)
+        private void OnConfigured(ConfigurationEventArgs args)
         {
             if (Configured != null)
                 Configured(this, args);
@@ -81,13 +88,6 @@
         public int Version { get; set; }
     }
 
-    public enum ConfigurationAction
-    {
-        Install,
-        Configure,
-        Uninstall
-    }
-
     public enum ConfigurationEventType
     {
         Info,

=== modified file 'WexInstaller/InstallWizard/AllConfigOverview.cs'
--- a/WexInstaller/InstallWizard/AllConfigOverview.cs	2011-02-08 18:41:30 +0000
+++ b/WexInstaller/InstallWizard/AllConfigOverview.cs	2011-02-09 14:52:59 +0000
@@ -78,7 +78,7 @@
                 productList.ProgressBar.Value = 0;
 
                 configuringItemHandler = new ConfigurationEventHandler(ConfigurationChanged);
-                (configuringItem.Tag as Product).Controller.PreAction(ConfigurationAction.Configure);
+                (configuringItem.Tag as Product).Controller.PreAction();
                 (configuringItem.Tag as Product).Controller.Configured += configuringItemHandler;
                 (configuringItem.Tag as Product).Controller.Configure();
                 Application.DoEvents();
@@ -196,7 +196,7 @@
                 configuringItem = lvihti.Item;
                 configuringItem.StateImageIndex = 0;
                 SetLineColor(configuringItem, Color.Black);
-                (configuringItem.Tag as Product).Controller.PreAction(ConfigurationAction.Configure);
+                (configuringItem.Tag as Product).Controller.PreAction();
                 (ParentControl as InstallWizardControl).AddConfigPages(configuringItem.Tag as Product);
                 NextButton.PerformClick();
             }

=== modified file 'WexInstaller/InstallWizard/InstallProgressPanel.cs'
--- a/WexInstaller/InstallWizard/InstallProgressPanel.cs	2011-02-08 18:41:30 +0000
+++ b/WexInstaller/InstallWizard/InstallProgressPanel.cs	2011-02-09 14:52:59 +0000
@@ -357,7 +357,7 @@
                     if (p.Controller != null)
                     {
                         installedProductsNeedConfig = true;
-                        p.Controller.PostAction(ConfigurationAction.Install);
+                        p.Controller.PostAction();
                     }
                     InstallNextPackage();
                     break;

=== modified file 'installer-vs2010.sln'
--- a/installer-vs2010.sln	2011-02-08 21:54:02 +0000
+++ b/installer-vs2010.sln	2011-02-09 14:52:59 +0000
@@ -4,6 +4,7 @@
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WexInstaller", "WexInstaller\WexInstaller.csproj", "{07B31F5A-9F17-4ACF-B3B6-2AF9000B1414}"
 	ProjectSection(ProjectDependencies) = postProject
 		{27F00801-BEAE-417F-9CF5-5686923F7538} = {27F00801-BEAE-417F-9CF5-5686923F7538}
+		{C471DBDA-2AFA-4EA3-970A-795133F1FE1A} = {C471DBDA-2AFA-4EA3-970A-795133F1FE1A}
 	EndProjectSection
 EndProject
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UnitTestService", "UnitTestService\UnitTestService.csproj", "{27F00801-BEAE-417F-9CF5-5686923F7538}"


Attachment: [text/bzr-bundle] bzr/reggie.burnett@oracle.com-20110209145259-a2wn7kva5oo4hcyd.bundle
Thread
bzr commit into wex-installer-1.0 branch (reggie.burnett:321) Reggie Burnett9 Feb