1
/* Copyright (C) 2004 MySQL AB
3
This program is free software; you can redistribute it and/or modify
4
it under the terms of the GNU General Public License as published by
5
the Free Software Foundation; version 2 of the License.
7
This program is distributed in the hope that it will be useful,
8
but WITHOUT ANY WARRANTY; without even the implied warranty of
9
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10
GNU General Public License for more details.
12
You should have received a copy of the GNU General Public License
13
along with this program; if not, write to the Free Software
14
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
21
using System.Collections;
22
using System.ComponentModel;
23
using System.Windows.Forms;
28
/// Summary description for MDXQueryBuilderWizard.
30
public class PanelWizard : System.Windows.Forms.Form
32
private System.Windows.Forms.Button btnCancel;
33
private System.Windows.Forms.Button btnback;
34
private System.Windows.Forms.Button btnNext;
35
private System.Windows.Forms.Button btnFinish;
37
//---enabling and disabling the buttons
38
private bool cancelEnabled;
39
private bool backEnabled;
40
private bool nextEnabled;
41
private bool finishEnabled;
43
//--set the next and back panel
44
private Panel nextPanel;
45
private Panel backPanel;
46
private Panel presentPanel;
48
private Panel[] arrayPanel;
49
private System.Windows.Forms.Panel panel1;
50
private System.Windows.Forms.Panel panel2;
51
private System.Windows.Forms.Panel panel3;
52
private System.Windows.Forms.RadioButton radioBtnYes;
53
private System.Windows.Forms.RadioButton radioBtnNo;
54
private System.Windows.Forms.ListBox listBoxComputers;
55
private System.Windows.Forms.Label label5;
56
private System.Windows.Forms.Label label1;
57
private System.ComponentModel.IContainer components;
58
private System.Windows.Forms.Button buttonComputerAdd;
59
private System.Windows.Forms.Label label2;
60
private System.Windows.Forms.Label label6;
61
private System.Windows.Forms.Label label7;
62
private System.Windows.Forms.ComboBox comboNDB;
63
private System.Windows.Forms.ComboBox comboAPI;
64
private System.Windows.Forms.Label label8;
65
private System.Windows.Forms.ComboBox comboMGM;
66
private System.Windows.Forms.Button btnTransferNodeToComp;
67
private System.Windows.Forms.TreeView tvComputer;
68
private System.Windows.Forms.ListView lvNode;
69
private System.Windows.Forms.Button btnTransferCompToNode;
70
private System.Windows.Forms.Label label3;
71
private System.Windows.Forms.Label label9;
72
private System.Windows.Forms.Label label10;
74
private ComputerMgmt mgmt;
77
private Database m_db;
78
private System.Windows.Forms.Label label11;
79
private System.Windows.Forms.TextBox textDbName;
80
private System.Windows.Forms.Label label31;
81
private System.Windows.Forms.Label label32;
82
private System.Windows.Forms.Label label33;
83
private System.Windows.Forms.Label label18;
84
private System.Windows.Forms.Label labelTitle;
85
private System.Windows.Forms.Label labelCwd;
86
private System.Windows.Forms.Label labelArgs;
87
private System.Windows.Forms.Label labelOther;
88
private System.Windows.Forms.Label labelPath;
89
private int m_noOfConfiguredNodes;
90
private int m_noOfConfiguredMgmt;
91
private int m_noOfConfiguredNdb;
92
private string m_mgmHost;
93
private string m_mgmPort;
94
private System.Windows.Forms.TextBox textCwd;
95
private System.Windows.Forms.TextBox textArgs;
96
private System.Windows.Forms.TextBox textOther;
97
private System.Windows.Forms.TextBox textPath;
98
private System.Windows.Forms.TextBox textComputer;
99
private System.Windows.Forms.TextBox textDatabase;
100
private System.Windows.Forms.TextBox textName;
101
private int m_noOfConfiguredApi;
102
private bool m_bMgmt;
103
private System.Windows.Forms.Button buttonSave;
104
private System.Windows.Forms.CheckBox checkBoxReuse;
105
private System.Windows.Forms.Label label4;
106
private System.Windows.Forms.Panel panel4;
107
private System.Windows.Forms.CheckBox checkBoxLater;
108
private System.Windows.Forms.RadioButton radioYes;
109
private System.Windows.Forms.RadioButton radioNo;
110
private System.Windows.Forms.Panel panel6;
111
private System.Windows.Forms.Panel panel5;
112
private System.Windows.Forms.RadioButton radioStartNo;
113
private System.Windows.Forms.RadioButton radioStartYes;
114
private System.Windows.Forms.ImageList imageListComp;
115
private System.Windows.Forms.Label label12;
116
private System.Windows.Forms.TextBox textOwner;
117
private System.Windows.Forms.Label label13;
118
private System.Windows.Forms.TextBox textEnv;
120
public PanelWizard(ComputerMgmt comp)
123
m_noOfConfiguredNodes=0;
124
m_noOfConfiguredMgmt=0;
125
m_noOfConfiguredNdb=0;
126
m_noOfConfiguredApi=0;
127
Size panelSize= new Size(350,300);
128
Size s= new Size(355,360);
129
Point cancel= new Point(8,310);
130
Point back= new Point(96,310);
131
Point next = new Point(184,310);
132
Point finish= new Point(272,310);
133
InitializeComponent();
135
this.btnCancel.Location=cancel;
137
this.btnback.Location=back;
138
this.btnNext.Location=next;
139
this.btnFinish.Location=finish;
141
arrayPanel=new Panel[]{panel1,panel2,panel3,panel4,panel5,panel6};//,panel5, panel6};
142
panel1.Size=panelSize;
144
comboNDB.SelectedIndex=0;
145
comboAPI.SelectedIndex=0;
146
comboMGM.SelectedIndex=0;
150
m_db = new Database();
151
if(listBoxComputers.Items.Count.Equals(0))
152
btnNext.Enabled=false;
156
/// Clean up any resources being used.
158
protected override void Dispose( bool disposing )
162
if(components != null)
164
components.Dispose();
167
base.Dispose( disposing );
170
#region Windows Form Designer generated code
172
/// Required method for Designer support - do not modify
173
/// the contents of this method with the code editor.
175
private void InitializeComponent()
177
this.components = new System.ComponentModel.Container();
178
System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(PanelWizard));
179
this.panel1 = new System.Windows.Forms.Panel();
180
this.buttonComputerAdd = new System.Windows.Forms.Button();
181
this.label1 = new System.Windows.Forms.Label();
182
this.label5 = new System.Windows.Forms.Label();
183
this.listBoxComputers = new System.Windows.Forms.ListBox();
184
this.radioBtnNo = new System.Windows.Forms.RadioButton();
185
this.radioBtnYes = new System.Windows.Forms.RadioButton();
186
this.panel2 = new System.Windows.Forms.Panel();
187
this.label12 = new System.Windows.Forms.Label();
188
this.textOwner = new System.Windows.Forms.TextBox();
189
this.label11 = new System.Windows.Forms.Label();
190
this.textDbName = new System.Windows.Forms.TextBox();
191
this.label8 = new System.Windows.Forms.Label();
192
this.label7 = new System.Windows.Forms.Label();
193
this.label6 = new System.Windows.Forms.Label();
194
this.comboMGM = new System.Windows.Forms.ComboBox();
195
this.comboAPI = new System.Windows.Forms.ComboBox();
196
this.comboNDB = new System.Windows.Forms.ComboBox();
197
this.label2 = new System.Windows.Forms.Label();
198
this.panel3 = new System.Windows.Forms.Panel();
199
this.checkBoxLater = new System.Windows.Forms.CheckBox();
200
this.label10 = new System.Windows.Forms.Label();
201
this.label9 = new System.Windows.Forms.Label();
202
this.label3 = new System.Windows.Forms.Label();
203
this.btnTransferCompToNode = new System.Windows.Forms.Button();
204
this.btnTransferNodeToComp = new System.Windows.Forms.Button();
205
this.lvNode = new System.Windows.Forms.ListView();
206
this.tvComputer = new System.Windows.Forms.TreeView();
207
this.imageListComp = new System.Windows.Forms.ImageList(this.components);
208
this.panel6 = new System.Windows.Forms.Panel();
209
this.radioStartNo = new System.Windows.Forms.RadioButton();
210
this.radioStartYes = new System.Windows.Forms.RadioButton();
211
this.label18 = new System.Windows.Forms.Label();
212
this.btnCancel = new System.Windows.Forms.Button();
213
this.btnback = new System.Windows.Forms.Button();
214
this.btnNext = new System.Windows.Forms.Button();
215
this.btnFinish = new System.Windows.Forms.Button();
216
this.panel4 = new System.Windows.Forms.Panel();
217
this.textEnv = new System.Windows.Forms.TextBox();
218
this.label13 = new System.Windows.Forms.Label();
219
this.checkBoxReuse = new System.Windows.Forms.CheckBox();
220
this.buttonSave = new System.Windows.Forms.Button();
221
this.labelTitle = new System.Windows.Forms.Label();
222
this.textComputer = new System.Windows.Forms.TextBox();
223
this.textCwd = new System.Windows.Forms.TextBox();
224
this.textArgs = new System.Windows.Forms.TextBox();
225
this.textOther = new System.Windows.Forms.TextBox();
226
this.textPath = new System.Windows.Forms.TextBox();
227
this.textDatabase = new System.Windows.Forms.TextBox();
228
this.textName = new System.Windows.Forms.TextBox();
229
this.labelCwd = new System.Windows.Forms.Label();
230
this.labelArgs = new System.Windows.Forms.Label();
231
this.labelOther = new System.Windows.Forms.Label();
232
this.labelPath = new System.Windows.Forms.Label();
233
this.label31 = new System.Windows.Forms.Label();
234
this.label32 = new System.Windows.Forms.Label();
235
this.label33 = new System.Windows.Forms.Label();
236
this.panel5 = new System.Windows.Forms.Panel();
237
this.radioNo = new System.Windows.Forms.RadioButton();
238
this.radioYes = new System.Windows.Forms.RadioButton();
239
this.label4 = new System.Windows.Forms.Label();
240
this.panel1.SuspendLayout();
241
this.panel2.SuspendLayout();
242
this.panel3.SuspendLayout();
243
this.panel6.SuspendLayout();
244
this.panel4.SuspendLayout();
245
this.panel5.SuspendLayout();
246
this.SuspendLayout();
250
this.panel1.Controls.AddRange(new System.Windows.Forms.Control[] {
251
this.buttonComputerAdd,
254
this.listBoxComputers,
257
this.panel1.Name = "panel1";
258
this.panel1.Size = new System.Drawing.Size(344, 312);
259
this.panel1.TabIndex = 0;
260
this.panel1.Paint += new System.Windows.Forms.PaintEventHandler(this.panel1_Paint);
264
this.buttonComputerAdd.Enabled = false;
265
this.buttonComputerAdd.Location = new System.Drawing.Point(192, 232);
266
this.buttonComputerAdd.Name = "buttonComputerAdd";
267
this.buttonComputerAdd.Size = new System.Drawing.Size(96, 24);
268
this.buttonComputerAdd.TabIndex = 3;
269
this.buttonComputerAdd.Text = "Add computer...";
270
this.buttonComputerAdd.Click += new System.EventHandler(this.buttonComputerAdd_Click);
274
this.label1.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
275
this.label1.Location = new System.Drawing.Point(80, 8);
276
this.label1.Name = "label1";
277
this.label1.Size = new System.Drawing.Size(200, 23);
278
this.label1.TabIndex = 5;
279
this.label1.Text = "Configure computers";
280
this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
284
this.label5.Location = new System.Drawing.Point(24, 40);
285
this.label5.Name = "label5";
286
this.label5.Size = new System.Drawing.Size(128, 23);
287
this.label5.TabIndex = 4;
288
this.label5.Text = "Available computers:";
289
this.label5.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
293
this.listBoxComputers.Location = new System.Drawing.Point(24, 64);
294
this.listBoxComputers.Name = "listBoxComputers";
295
this.listBoxComputers.Size = new System.Drawing.Size(128, 212);
296
this.listBoxComputers.TabIndex = 3;
297
this.listBoxComputers.SelectedIndexChanged += new System.EventHandler(this.listBoxComputers_SelectedIndexChanged);
301
this.radioBtnNo.AutoCheck = false;
302
this.radioBtnNo.Location = new System.Drawing.Point(168, 168);
303
this.radioBtnNo.Name = "radioBtnNo";
304
this.radioBtnNo.Size = new System.Drawing.Size(152, 64);
305
this.radioBtnNo.TabIndex = 2;
306
this.radioBtnNo.Text = "No, I have to add more computers in order to deploy NDB Cluster. ";
307
this.radioBtnNo.Click += new System.EventHandler(this.radioBtnNo_Click);
311
this.radioBtnYes.AutoCheck = false;
312
this.radioBtnYes.Location = new System.Drawing.Point(168, 72);
313
this.radioBtnYes.Name = "radioBtnYes";
314
this.radioBtnYes.Size = new System.Drawing.Size(152, 80);
315
this.radioBtnYes.TabIndex = 1;
316
this.radioBtnYes.Text = "Yes, all the computers that I need to deploy NDB Cluster exists in the list \"Avai" +
318
this.radioBtnYes.Click += new System.EventHandler(this.radioBtnYes_Click);
322
this.panel2.Controls.AddRange(new System.Windows.Forms.Control[] {
334
this.panel2.Location = new System.Drawing.Point(0, 320);
335
this.panel2.Name = "panel2";
336
this.panel2.Size = new System.Drawing.Size(344, 312);
337
this.panel2.TabIndex = 1;
338
this.panel2.Validating += new System.ComponentModel.CancelEventHandler(this.panel2_Validating);
339
this.panel2.Paint += new System.Windows.Forms.PaintEventHandler(this.panel2_Paint);
343
this.label12.Location = new System.Drawing.Point(72, 216);
344
this.label12.Name = "label12";
345
this.label12.Size = new System.Drawing.Size(112, 24);
346
this.label12.TabIndex = 16;
347
this.label12.Text = "Database owner:";
348
this.label12.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
352
this.textOwner.Location = new System.Drawing.Point(192, 216);
353
this.textOwner.Name = "textOwner";
354
this.textOwner.TabIndex = 5;
355
this.textOwner.Text = "";
356
this.textOwner.TextChanged += new System.EventHandler(this.textOwner_TextChanged);
360
this.label11.Location = new System.Drawing.Point(72, 184);
361
this.label11.Name = "label11";
362
this.label11.Size = new System.Drawing.Size(112, 24);
363
this.label11.TabIndex = 14;
364
this.label11.Text = "Database name:";
365
this.label11.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
366
this.label11.Click += new System.EventHandler(this.label11_Click);
370
this.textDbName.Location = new System.Drawing.Point(192, 184);
371
this.textDbName.Name = "textDbName";
372
this.textDbName.TabIndex = 4;
373
this.textDbName.Text = "";
375
this.textDbName.TextChanged += new System.EventHandler(this.textDbName_TextChanged);
379
this.label8.Location = new System.Drawing.Point(16, 120);
380
this.label8.Name = "label8";
381
this.label8.Size = new System.Drawing.Size(176, 24);
382
this.label8.TabIndex = 12;
383
this.label8.Text = "Number of management servers:";
384
this.label8.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
388
this.label7.Location = new System.Drawing.Point(16, 88);
389
this.label7.Name = "label7";
390
this.label7.Size = new System.Drawing.Size(120, 24);
391
this.label7.TabIndex = 11;
392
this.label7.Text = "Number of API nodes:";
393
this.label7.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
397
this.label6.Location = new System.Drawing.Point(16, 56);
398
this.label6.Name = "label6";
399
this.label6.Size = new System.Drawing.Size(144, 24);
400
this.label6.TabIndex = 10;
401
this.label6.Text = "Number of database nodes:";
402
this.label6.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
406
this.comboMGM.DisplayMember = "0";
407
this.comboMGM.Items.AddRange(new object[] {
409
this.comboMGM.Location = new System.Drawing.Point(192, 120);
410
this.comboMGM.Name = "comboMGM";
411
this.comboMGM.Size = new System.Drawing.Size(104, 21);
412
this.comboMGM.TabIndex = 3;
413
this.comboMGM.Text = "comboBox3";
417
this.comboAPI.DisplayMember = "0";
418
this.comboAPI.Items.AddRange(new object[] {
429
this.comboAPI.Location = new System.Drawing.Point(192, 88);
430
this.comboAPI.Name = "comboAPI";
431
this.comboAPI.Size = new System.Drawing.Size(104, 21);
432
this.comboAPI.TabIndex = 2;
433
this.comboAPI.Text = "comboBox2";
437
this.comboNDB.DisplayMember = "0";
438
this.comboNDB.Items.AddRange(new object[] {
443
this.comboNDB.Location = new System.Drawing.Point(192, 56);
444
this.comboNDB.Name = "comboNDB";
445
this.comboNDB.Size = new System.Drawing.Size(104, 21);
446
this.comboNDB.TabIndex = 1;
447
this.comboNDB.Text = "comboBox1";
451
this.label2.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
452
this.label2.Location = new System.Drawing.Point(80, 8);
453
this.label2.Name = "label2";
454
this.label2.Size = new System.Drawing.Size(208, 23);
455
this.label2.TabIndex = 6;
456
this.label2.Text = "Setup NDB Cluster nodes";
457
this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
461
this.panel3.Controls.AddRange(new System.Windows.Forms.Control[] {
466
this.btnTransferCompToNode,
467
this.btnTransferNodeToComp,
470
this.panel3.Location = new System.Drawing.Point(360, 8);
471
this.panel3.Name = "panel3";
472
this.panel3.Size = new System.Drawing.Size(320, 312);
473
this.panel3.TabIndex = 2;
477
this.checkBoxLater.Location = new System.Drawing.Point(40, 256);
478
this.checkBoxLater.Name = "checkBoxLater";
479
this.checkBoxLater.Size = new System.Drawing.Size(240, 16);
480
this.checkBoxLater.TabIndex = 9;
481
this.checkBoxLater.Text = "I will configure these nodes manually, later.";
485
this.label10.Location = new System.Drawing.Point(16, 40);
486
this.label10.Name = "label10";
487
this.label10.Size = new System.Drawing.Size(104, 16);
488
this.label10.TabIndex = 8;
489
this.label10.Text = "NDB Cluster nodes:";
490
this.label10.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
494
this.label9.Location = new System.Drawing.Point(192, 40);
495
this.label9.Name = "label9";
496
this.label9.Size = new System.Drawing.Size(100, 16);
497
this.label9.TabIndex = 7;
498
this.label9.Text = "Computers:";
499
this.label9.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
503
this.label3.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
504
this.label3.Location = new System.Drawing.Point(40, 8);
505
this.label3.Name = "label3";
506
this.label3.Size = new System.Drawing.Size(280, 23);
507
this.label3.TabIndex = 6;
508
this.label3.Text = "Assign NDB nodes to computers";
509
this.label3.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
511
// btnTransferCompToNode
513
this.btnTransferCompToNode.Location = new System.Drawing.Point(144, 160);
514
this.btnTransferCompToNode.Name = "btnTransferCompToNode";
515
this.btnTransferCompToNode.Size = new System.Drawing.Size(40, 24);
516
this.btnTransferCompToNode.TabIndex = 4;
517
this.btnTransferCompToNode.Text = "<---";
519
// btnTransferNodeToComp
521
this.btnTransferNodeToComp.Location = new System.Drawing.Point(144, 128);
522
this.btnTransferNodeToComp.Name = "btnTransferNodeToComp";
523
this.btnTransferNodeToComp.Size = new System.Drawing.Size(40, 24);
524
this.btnTransferNodeToComp.TabIndex = 3;
525
this.btnTransferNodeToComp.Text = "--->";
526
this.btnTransferNodeToComp.Click += new System.EventHandler(this.btnTransferNodeToComp_Click);
530
this.lvNode.HideSelection = false;
531
this.lvNode.Location = new System.Drawing.Point(16, 56);
532
this.lvNode.Name = "lvNode";
533
this.lvNode.Size = new System.Drawing.Size(112, 192);
534
this.lvNode.TabIndex = 2;
535
this.lvNode.View = System.Windows.Forms.View.List;
536
this.lvNode.SelectedIndexChanged += new System.EventHandler(this.lvNode_SelectedIndexChanged);
540
this.tvComputer.HideSelection = false;
541
this.tvComputer.ImageList = this.imageListComp;
542
this.tvComputer.Location = new System.Drawing.Point(192, 56);
543
this.tvComputer.Name = "tvComputer";
544
this.tvComputer.Size = new System.Drawing.Size(120, 192);
545
this.tvComputer.TabIndex = 1;
546
this.tvComputer.MouseDown += new System.Windows.Forms.MouseEventHandler(this.tvComputer_MouseDown);
547
this.tvComputer.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.tvComputer_AfterSelect);
548
this.tvComputer.MouseLeave += new System.EventHandler(this.tvComputer_MouseLeave);
549
this.tvComputer.DragDrop += new System.Windows.Forms.DragEventHandler(this.tvComputer_DragDrop);
553
this.imageListComp.ColorDepth = System.Windows.Forms.ColorDepth.Depth8Bit;
554
this.imageListComp.ImageSize = new System.Drawing.Size(16, 16);
555
this.imageListComp.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("imageListComp.ImageStream")));
556
this.imageListComp.TransparentColor = System.Drawing.Color.Transparent;
560
this.panel6.Controls.AddRange(new System.Windows.Forms.Control[] {
564
this.panel6.Location = new System.Drawing.Point(344, 336);
565
this.panel6.Name = "panel6";
566
this.panel6.Size = new System.Drawing.Size(344, 312);
567
this.panel6.TabIndex = 3;
568
this.panel6.Paint += new System.Windows.Forms.PaintEventHandler(this.panel4_Paint);
572
this.radioStartNo.Location = new System.Drawing.Point(40, 144);
573
this.radioStartNo.Name = "radioStartNo";
574
this.radioStartNo.Size = new System.Drawing.Size(272, 48);
575
this.radioStartNo.TabIndex = 81;
576
this.radioStartNo.Text = "Manually start NDB Cluster. The Magician will exit and you must start NDB Cluster" +
578
this.radioStartNo.CheckedChanged += new System.EventHandler(this.radioStartNo_CheckedChanged);
582
this.radioStartYes.Location = new System.Drawing.Point(40, 40);
583
this.radioStartYes.Name = "radioStartYes";
584
this.radioStartYes.Size = new System.Drawing.Size(272, 88);
585
this.radioStartYes.TabIndex = 80;
586
this.radioStartYes.Text = "Start NDB Cluster now. The Magician will start NDB Cluster and exit. MAKE SURE YO" +
587
"U HAVE STARTED THE MGMTSRVR WITH THE CORRECT CONFIGURATION FILE!!!";
588
this.radioStartYes.CheckedChanged += new System.EventHandler(this.radioStartYes_CheckedChanged);
592
this.label18.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
593
this.label18.Location = new System.Drawing.Point(56, 8);
594
this.label18.Name = "label18";
595
this.label18.Size = new System.Drawing.Size(224, 24);
596
this.label18.TabIndex = 79;
597
this.label18.Text = "Start NDB Cluster and finish";
601
this.btnCancel.Location = new System.Drawing.Point(8, 656);
602
this.btnCancel.Name = "btnCancel";
603
this.btnCancel.Size = new System.Drawing.Size(70, 23);
604
this.btnCancel.TabIndex = 10;
605
this.btnCancel.Text = "Cancel";
606
this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click);
610
this.btnback.Location = new System.Drawing.Point(96, 656);
611
this.btnback.Name = "btnback";
612
this.btnback.Size = new System.Drawing.Size(70, 23);
613
this.btnback.TabIndex = 11;
614
this.btnback.Text = "< Back";
615
this.btnback.Click += new System.EventHandler(this.btnback_Click);
619
this.btnNext.Location = new System.Drawing.Point(184, 656);
620
this.btnNext.Name = "btnNext";
621
this.btnNext.Size = new System.Drawing.Size(70, 23);
622
this.btnNext.TabIndex = 12;
623
this.btnNext.Text = "Next >";
624
this.btnNext.Click += new System.EventHandler(this.btnNext_Click);
628
this.btnFinish.Location = new System.Drawing.Point(272, 656);
629
this.btnFinish.Name = "btnFinish";
630
this.btnFinish.Size = new System.Drawing.Size(70, 23);
631
this.btnFinish.TabIndex = 13;
632
this.btnFinish.Text = "Finish";
633
this.btnFinish.Click += new System.EventHandler(this.btnFinish_Click);
637
this.panel4.Controls.AddRange(new System.Windows.Forms.Control[] {
657
this.panel4.Location = new System.Drawing.Point(672, 8);
658
this.panel4.Name = "panel4";
659
this.panel4.Size = new System.Drawing.Size(344, 312);
660
this.panel4.TabIndex = 62;
661
this.panel4.Paint += new System.Windows.Forms.PaintEventHandler(this.panel5_Paint);
665
this.textEnv.Location = new System.Drawing.Point(136, 136);
666
this.textEnv.Name = "textEnv";
667
this.textEnv.Size = new System.Drawing.Size(184, 20);
668
this.textEnv.TabIndex = 2;
669
this.textEnv.TabStop = false;
670
this.textEnv.Text = "";
674
this.label13.Location = new System.Drawing.Point(8, 136);
675
this.label13.Name = "label13";
676
this.label13.Size = new System.Drawing.Size(136, 24);
677
this.label13.TabIndex = 81;
678
this.label13.Text = "Environment variables:";
682
this.checkBoxReuse.Location = new System.Drawing.Point(88, 232);
683
this.checkBoxReuse.Name = "checkBoxReuse";
684
this.checkBoxReuse.Size = new System.Drawing.Size(240, 32);
685
this.checkBoxReuse.TabIndex = 5;
686
this.checkBoxReuse.TabStop = false;
687
this.checkBoxReuse.Text = "Use the same configuration for ALL NDB nodes?";
691
this.buttonSave.Location = new System.Drawing.Point(184, 264);
692
this.buttonSave.Name = "buttonSave";
693
this.buttonSave.Size = new System.Drawing.Size(88, 24);
694
this.buttonSave.TabIndex = 6;
695
this.buttonSave.Text = "Save";
696
this.buttonSave.Click += new System.EventHandler(this.buttonSave_Click);
700
this.labelTitle.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
701
this.labelTitle.Location = new System.Drawing.Point(80, 16);
702
this.labelTitle.Name = "labelTitle";
703
this.labelTitle.Size = new System.Drawing.Size(192, 23);
704
this.labelTitle.TabIndex = 79;
705
this.labelTitle.Text = "Mgmtsrvr configuration";
709
this.textComputer.Location = new System.Drawing.Point(136, 40);
710
this.textComputer.Name = "textComputer";
711
this.textComputer.ReadOnly = true;
712
this.textComputer.Size = new System.Drawing.Size(184, 20);
713
this.textComputer.TabIndex = 77;
714
this.textComputer.TabStop = false;
715
this.textComputer.Text = "";
719
this.textCwd.Location = new System.Drawing.Point(136, 208);
720
this.textCwd.Name = "textCwd";
721
this.textCwd.Size = new System.Drawing.Size(184, 20);
722
this.textCwd.TabIndex = 5;
723
this.textCwd.TabStop = false;
724
this.textCwd.Text = "";
728
this.textArgs.Location = new System.Drawing.Point(136, 184);
729
this.textArgs.Name = "textArgs";
730
this.textArgs.Size = new System.Drawing.Size(184, 20);
731
this.textArgs.TabIndex = 4;
732
this.textArgs.TabStop = false;
733
this.textArgs.Text = "";
737
this.textOther.Location = new System.Drawing.Point(136, 160);
738
this.textOther.Name = "textOther";
739
this.textOther.Size = new System.Drawing.Size(184, 20);
740
this.textOther.TabIndex = 3;
741
this.textOther.TabStop = false;
742
this.textOther.Text = "";
746
this.textPath.Location = new System.Drawing.Point(136, 112);
747
this.textPath.Name = "textPath";
748
this.textPath.Size = new System.Drawing.Size(184, 20);
749
this.textPath.TabIndex = 1;
750
this.textPath.TabStop = false;
751
this.textPath.Text = "";
752
this.textPath.TextChanged += new System.EventHandler(this.textPath_TextChanged);
756
this.textDatabase.Location = new System.Drawing.Point(136, 88);
757
this.textDatabase.Name = "textDatabase";
758
this.textDatabase.ReadOnly = true;
759
this.textDatabase.Size = new System.Drawing.Size(184, 20);
760
this.textDatabase.TabIndex = 62;
761
this.textDatabase.TabStop = false;
762
this.textDatabase.Text = "";
766
this.textName.Location = new System.Drawing.Point(136, 64);
767
this.textName.Name = "textName";
768
this.textName.ReadOnly = true;
769
this.textName.Size = new System.Drawing.Size(184, 20);
770
this.textName.TabIndex = 60;
771
this.textName.TabStop = false;
772
this.textName.Text = "";
776
this.labelCwd.Location = new System.Drawing.Point(8, 208);
777
this.labelCwd.Name = "labelCwd";
778
this.labelCwd.Size = new System.Drawing.Size(112, 24);
779
this.labelCwd.TabIndex = 72;
780
this.labelCwd.Text = "Current working dir.:";
784
this.labelArgs.Location = new System.Drawing.Point(8, 184);
785
this.labelArgs.Name = "labelArgs";
786
this.labelArgs.Size = new System.Drawing.Size(128, 24);
787
this.labelArgs.TabIndex = 70;
788
this.labelArgs.Text = "Arguments to mgmtsrvr:";
792
this.labelOther.Location = new System.Drawing.Point(8, 160);
793
this.labelOther.Name = "labelOther";
794
this.labelOther.Size = new System.Drawing.Size(136, 24);
795
this.labelOther.TabIndex = 69;
796
this.labelOther.Text = "Mgmtsrvr port:";
800
this.labelPath.Location = new System.Drawing.Point(8, 112);
801
this.labelPath.Name = "labelPath";
802
this.labelPath.Size = new System.Drawing.Size(128, 24);
803
this.labelPath.TabIndex = 67;
804
this.labelPath.Text = "Path to mgmtsrvr binary:";
808
this.label31.Location = new System.Drawing.Point(8, 88);
809
this.label31.Name = "label31";
810
this.label31.Size = new System.Drawing.Size(88, 24);
811
this.label31.TabIndex = 65;
812
this.label31.Text = "Database:";
816
this.label32.Location = new System.Drawing.Point(8, 64);
817
this.label32.Name = "label32";
818
this.label32.Size = new System.Drawing.Size(88, 24);
819
this.label32.TabIndex = 63;
820
this.label32.Text = "Process name:";
824
this.label33.Location = new System.Drawing.Point(8, 40);
825
this.label33.Name = "label33";
826
this.label33.Size = new System.Drawing.Size(64, 24);
827
this.label33.TabIndex = 61;
828
this.label33.Text = "Computer:";
832
this.panel5.Controls.AddRange(new System.Windows.Forms.Control[] {
836
this.panel5.Location = new System.Drawing.Point(672, 328);
837
this.panel5.Name = "panel5";
838
this.panel5.Size = new System.Drawing.Size(344, 312);
839
this.panel5.TabIndex = 63;
843
this.radioNo.Location = new System.Drawing.Point(72, 160);
844
this.radioNo.Name = "radioNo";
845
this.radioNo.Size = new System.Drawing.Size(240, 48);
846
this.radioNo.TabIndex = 1;
847
this.radioNo.Text = "I already have a configuration file that I want to use for this configuration.";
848
this.radioNo.CheckedChanged += new System.EventHandler(this.radioNo_CheckedChanged);
852
this.radioYes.Checked = true;
853
this.radioYes.Location = new System.Drawing.Point(72, 56);
854
this.radioYes.Name = "radioYes";
855
this.radioYes.Size = new System.Drawing.Size(240, 88);
856
this.radioYes.TabIndex = 0;
857
this.radioYes.TabStop = true;
858
this.radioYes.Text = "Generate a configuration file template (initconfig.txt) for the mgmtsrvr based on" +
859
" the specified configuration? Notepad will be started with a template that you m" +
860
"ust complete and save in the cwd of the mgmtsrvr.";
861
this.radioYes.CheckedChanged += new System.EventHandler(this.radioYes_CheckedChanged);
865
this.label4.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
866
this.label4.Location = new System.Drawing.Point(88, 8);
867
this.label4.Name = "label4";
868
this.label4.Size = new System.Drawing.Size(192, 40);
869
this.label4.TabIndex = 79;
870
this.label4.Text = "Tying up the configuration";
871
this.label4.TextAlign = System.Drawing.ContentAlignment.TopCenter;
875
this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
876
this.ClientSize = new System.Drawing.Size(1030, 755);
877
this.Controls.AddRange(new System.Windows.Forms.Control[] {
888
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
889
this.MaximizeBox = false;
890
this.MinimizeBox = false;
891
this.Name = "PanelWizard";
892
this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide;
893
this.Text = "Create Database Magician";
894
this.Load += new System.EventHandler(this.MDXQueryBuilderWizard_Load);
895
this.Activated += new System.EventHandler(this.PanelWizard_Activated);
896
this.panel1.ResumeLayout(false);
897
this.panel2.ResumeLayout(false);
898
this.panel3.ResumeLayout(false);
899
this.panel6.ResumeLayout(false);
900
this.panel4.ResumeLayout(false);
901
this.panel5.ResumeLayout(false);
902
this.ResumeLayout(false);
907
private void MDXQueryBuilderWizard_Load(object sender, System.EventArgs e)
910
foreach(Control ct in this.Controls)
912
if(ct.GetType().Name=="Panel")
920
presentPanel=arrayPanel[0];
921
//--set the properties
922
setBtnPanProperty(getPosition(presentPanel));
927
//-set the buttons and panel
928
private void refreshLook()
931
btnCancel.Enabled=true;
933
btnCancel.Enabled=false;
936
btnback.Enabled=true;
938
btnback.Enabled=false;
941
btnNext.Enabled=true;
943
btnNext.Enabled=false;
946
btnFinish.Enabled=true;
948
btnFinish.Enabled=false;
950
if(presentPanel!=null)
953
presentPanel.BringToFront();
957
private int getPosition(Panel p)
960
for(int i=0;i<arrayPanel.Length;i++)
972
private void setBtnPanProperty(int presentPanelPosition )
974
int panelLength=arrayPanel.Length-1;
975
if(presentPanelPosition==0)
977
//first panel...no back ,no finish
982
presentPanel=arrayPanel[presentPanelPosition];
983
nextPanel=arrayPanel[presentPanelPosition+1];
987
else if(presentPanelPosition==1)
993
presentPanel=arrayPanel[presentPanelPosition];
994
nextPanel=arrayPanel[presentPanelPosition+1];
995
backPanel=arrayPanel[presentPanelPosition-1];
998
else if(presentPanelPosition==2)
1003
finishEnabled=false;
1004
presentPanel=arrayPanel[presentPanelPosition];
1005
nextPanel=arrayPanel[presentPanelPosition+1];
1006
backPanel=arrayPanel[presentPanelPosition-1];
1009
else if(presentPanelPosition==3)
1011
//last panel...no next,finish
1015
finishEnabled=false;
1016
presentPanel=arrayPanel[presentPanelPosition];
1017
nextPanel=arrayPanel[presentPanelPosition+1];
1018
backPanel=arrayPanel[presentPanelPosition-1];
1020
else if(presentPanelPosition==4)
1022
//last panel...no next,finish
1026
finishEnabled=false;
1027
presentPanel=arrayPanel[presentPanelPosition];
1028
nextPanel=presentPanel;
1029
backPanel=arrayPanel[presentPanelPosition-1];
1032
else if(presentPanelPosition==5)
1034
//last panel...no next,finish yes
1038
finishEnabled=false;
1039
presentPanel=arrayPanel[presentPanelPosition];
1041
backPanel=arrayPanel[presentPanelPosition-1];
1046
//no finish,next and back
1051
presentPanel=arrayPanel[presentPanelPosition];
1053
backPanel=arrayPanel[presentPanelPosition-1];
1057
private void btnNext_Click(object sender, System.EventArgs e)
1060
if(arrayPanel[getPosition(presentPanel)].Equals(panel1))
1062
presentPanel=arrayPanel[getPosition(presentPanel)+1];
1063
setBtnPanProperty(getPosition(presentPanel));
1067
if(arrayPanel[getPosition(presentPanel)].Equals(panel2))
1069
m_db.setName(textDbName.Text.ToString());
1070
m_db.setOwner(textOwner.Text.ToString());
1071
presentPanel=arrayPanel[getPosition(presentPanel)+1];
1073
setBtnPanProperty(getPosition(presentPanel));
1074
prepareNodeAssignmentPanel();
1079
if(arrayPanel[getPosition(presentPanel)].Equals(panel3))
1081
prepareNodeConfigurationPanel();
1082
presentPanel=arrayPanel[getPosition(presentPanel)+1];
1083
setBtnPanProperty(getPosition(presentPanel));
1087
if(arrayPanel[getPosition(presentPanel)].Equals(panel4))
1093
presentPanel=arrayPanel[getPosition(presentPanel)+1];
1094
setBtnPanProperty(getPosition(presentPanel));
1098
if(arrayPanel[getPosition(presentPanel)].Equals(panel5))
1100
generateInitConfig();
1101
presentPanel=arrayPanel[getPosition(presentPanel)+1];
1102
setBtnPanProperty(getPosition(presentPanel));
1107
if(arrayPanel[getPosition(presentPanel)].Equals(panel6))
1109
// presentPanel=arrayPanel[getPosition(presentPanel)+1];
1110
setBtnPanProperty(getPosition(presentPanel));
1116
presentPanel=arrayPanel[getPosition(presentPanel)+1];
1117
setBtnPanProperty(getPosition(presentPanel));
1124
private void btnback_Click(object sender, System.EventArgs e)
1126
presentPanel=arrayPanel[getPosition(presentPanel)-1];
1127
setBtnPanProperty(getPosition(presentPanel));
1128
m_noOfConfiguredNodes=0;
1129
m_noOfConfiguredNodes=0;
1130
m_noOfConfiguredMgmt=0;
1131
m_noOfConfiguredNdb=0;
1132
m_noOfConfiguredApi=0;
1139
private void btnCancel_Click(object sender, System.EventArgs e)
1141
m_db.removeAllProcesses();
1148
private void radioBtnYes_Click(object sender, System.EventArgs e)
1150
if(radioBtnNo.Checked.Equals(false))
1152
if(radioBtnYes.Checked.Equals(true))
1153
radioBtnYes.Checked=false;
1156
radioBtnYes.Checked=true;
1157
this.btnNext.Enabled=true;
1161
if(radioBtnNo.Checked.Equals(true))
1163
radioBtnNo.Checked=false;
1164
radioBtnYes.Checked=true;
1165
buttonComputerAdd.Enabled=false;
1166
this.btnNext.Enabled=true;
1171
private void radioBtnNo_Click(object sender, System.EventArgs e)
1173
if(radioBtnYes.Checked.Equals(false))
1175
if(radioBtnNo.Checked.Equals(true))
1177
radioBtnNo.Checked=false;
1178
buttonComputerAdd.Enabled=false;
1182
radioBtnNo.Checked=true;
1183
buttonComputerAdd.Enabled=true;
1184
this.btnNext.Enabled=false;
1188
if(radioBtnYes.Checked.Equals(true))
1190
radioBtnYes.Checked=false;
1191
radioBtnNo.Checked=true;
1192
buttonComputerAdd.Enabled=true;
1193
this.btnNext.Enabled=false;
1197
private void buttonComputerAdd_Click(object sender, System.EventArgs e)
1199
if(getPosition(presentPanel)==0)
1201
if(radioBtnNo.Checked.Equals(true))
1203
ComputerAddDialog cad = new ComputerAddDialog(mgmt);
1209
private void PanelWizard_Activated(object sender, System.EventArgs e)
1214
private void updateComputers()
1216
ArrayList list = mgmt.getComputerCollection();
1217
this.listBoxComputers.BeginUpdate();
1218
this.listBoxComputers.Items.Clear();
1219
foreach(Computer c in list)
1221
this.listBoxComputers.Items.Add(c.getName());
1223
if(listBoxComputers.Items.Count > 0)
1225
btnNext.Enabled=true;
1227
this.listBoxComputers.EndUpdate();
1228
this.listBoxComputers.Refresh();
1232
private void tvComputer_AfterSelect(object sender, System.Windows.Forms.TreeViewEventArgs e)
1234
tvComputer.SelectedNode.Expand();
1238
private void tvComputer_DragDrop(object sender, System.Windows.Forms.DragEventArgs e)
1243
private void tvComputer_MouseLeave(object sender, System.EventArgs e)
1248
private void tvComputer_MouseDown(object sender, System.Windows.Forms.MouseEventArgs e)
1250
TreeNode prevNode = tvComputer.SelectedNode;
1253
prevNode.BackColor=Color.White;
1255
TreeNode node = tvComputer.GetNodeAt(e.X,e.Y);
1261
tvComputer.SelectedNode=node;
1262
tvComputer.SelectedNode.BackColor=Color.LightGray;
1266
private void btnTransferNodeToComp_Click(object sender, System.EventArgs e)
1269
if(tvComputer.SelectedNode==null)
1271
if(lvNode.SelectedItems.Equals(null))
1273
int itemCount=lvNode.SelectedItems.Count;
1274
lvNode.BeginUpdate();
1275
tvComputer.BeginUpdate();
1276
for(int i=0;i < itemCount;i++)
1278
tvComputer.SelectedNode.Nodes.Add(lvNode.SelectedItems[i].Text.ToString());
1281
for(int i=0;i < itemCount;i++)
1283
lvNode.Items.RemoveAt(lvNode.SelectedIndices[0]);
1286
if(lvNode.Items.Count.Equals(0))
1287
btnNext.Enabled=true;
1289
btnNext.Enabled=false;
1290
tvComputer.SelectedNode.Expand();
1292
tvComputer.EndUpdate();
1295
private void lvNode_SelectedIndexChanged(object sender, System.EventArgs e)
1299
private void prepareNodeAssignmentPanel()
1301
ArrayList computers = mgmt.getComputerCollection();
1302
m_nNDB=Convert.ToInt32(comboNDB.SelectedItem.ToString());
1303
m_nAPI=Convert.ToInt32(comboAPI.SelectedItem.ToString());
1304
m_nMGM=Convert.ToInt32(comboMGM.SelectedItem.ToString());
1306
lvNode.Items.Clear();
1307
tvComputer.Nodes.Clear();
1308
for (int i=1;i<=m_nMGM;i++)
1309
lvNode.Items.Add("mgm."+i);
1311
for (int i=m_nMGM+1;i<=(m_nNDB+m_nMGM);i++)
1312
lvNode.Items.Add("ndb."+i);
1314
for (int i=m_nMGM+m_nNDB+1;i<=(m_nNDB+m_nMGM+m_nAPI);i++)
1315
lvNode.Items.Add("api."+i);
1317
foreach(Computer c in computers)
1319
if(c.getStatus() == Computer.Status.Connected)
1320
tvComputer.Nodes.Add(c.getName());
1324
private void prepareNodeConfigurationPanel()
1327
for(int i=0;i<tvComputer.Nodes.Count;i++)
1329
c=mgmt.getComputer(tvComputer.Nodes[i].Text.ToString());
1330
for(int j=0; j < tvComputer.Nodes[i].Nodes.Count;j++)
1332
m_db.addProcess(new Process(tvComputer.Nodes[i].Nodes[j].Text.ToString(),m_db.getOwner(),m_db.getName(),c));
1333
c.addProcess(m_db.getProcessByName(tvComputer.Nodes[i].Nodes[j].Text.ToString()));
1338
private void updateListViews()
1340
lvConfig.Items.Clear();
1341
ArrayList processes = m_db.getProcesses();
1342
string [] processcols= new string[5];
1343
foreach (Process process in processes)
1345
processcols[0]=process.getName();
1346
processcols[1]=process.getComputer().getName();
1347
processcols[2]=process.getPath();
1351
ListViewItem lvc= new ListViewItem(processcols);
1354
lvConfig.Items.Add(lvc);
1356
lvConfig.EndUpdate();
1360
private void btnConfigure_Click(object sender, System.EventArgs e)
1365
private void textDbName_TextChanged(object sender, System.EventArgs e)
1367
if(textOwner.TextLength>0 && textDbName.TextLength > 0)
1376
private void checkBoxLater_CheckedChanged(object sender, System.EventArgs e)
1378
if(checkBoxLater.Checked.Equals(true))
1380
this.finishEnabled=true;
1381
this.nextEnabled=false;
1385
this.finishEnabled=false;
1386
this.nextEnabled=true;
1391
private void btnFinish_Click(object sender, System.EventArgs e)
1393
mgmt.AddDatabase(this.m_db);
1395
if(radioStartYes.Checked==true)
1400
private void panel4_Paint(object sender, System.Windows.Forms.PaintEventArgs e)
1403
// Point location= new Point(8,40);
1404
// Size s= new Size(panel4.Size.Width-8,panel4.Size.Height-120);
1405
// lvConfig.Location=location;
1411
private void configureMgmt()
1425
textPath.ClearUndo();
1426
textEnv.ClearUndo();
1427
textOther.ClearUndo();
1428
textCwd.ClearUndo();
1429
textArgs.ClearUndo();
1432
textOther.Enabled=true;
1433
textArgs.Enabled=true;
1434
textCwd.Enabled=true;
1435
textPath.Enabled=true;
1437
textPath.TabStop=true;
1438
textOther.TabStop=true;
1439
textArgs.TabStop=true;
1440
textCwd.TabStop=true;
1441
textEnv.TabStop=true;
1443
labelTitle.Text="Mgmtsrvr configuration";
1444
labelPath.Text="Path to mgmtsrvr binary:";
1445
labelArgs.Text="Arguments to mgmtsrvr:";
1446
labelOther.Text="Mgmtsrvr port (-p X):";
1449
String process="mgm." + Convert.ToString(m_noOfConfiguredMgmt+1);
1450
Process mgmt=m_db.getProcessByName(process);
1451
textComputer.Text=mgmt.getComputer().getName();
1452
textName.Text=mgmt.getName().ToString();
1453
textDatabase.Text=mgmt.getDatabase().ToString();
1454
m_mgmHost=mgmt.getComputer().getName();
1457
private void configureApi()
1459
checkBoxReuse.Text="Use the same configuration for ALL API nodes?";
1462
checkBoxReuse.Visible=true;
1463
checkBoxReuse.Enabled=true;
1468
checkBoxReuse.Enabled=false;
1469
checkBoxReuse.Visible=true;
1472
// clear previous and get a new api
1479
textOther.Enabled=false;
1480
textArgs.Enabled=true;
1481
labelTitle.Text="API node configuration";
1482
labelPath.Text="Path to api binary:";
1483
labelArgs.Text="Arguments to api:";
1484
labelOther.Text="NDB_CONNECTSTRING";
1485
String process="api." + Convert.ToString(m_noOfConfiguredApi+m_nMGM+m_nNDB+1);
1486
Process api=m_db.getProcessByName(process);
1487
textComputer.Text=api.getComputer().getName();
1488
textName.Text=api.getName().ToString();
1489
textOther.Text="nodeid=" + Convert.ToString(m_noOfConfiguredApi+m_nMGM+m_nNDB+1) + ";host="+this.m_mgmHost + ":" + this.m_mgmPort;
1490
textDatabase.Text=api.getDatabase().ToString();
1494
private void configureNdb()
1498
checkBoxReuse.Text="Use the same configuration for ALL NDB nodes?";
1503
checkBoxReuse.Visible=true;
1504
checkBoxReuse.Enabled=true;
1509
checkBoxReuse.Enabled=false;
1510
checkBoxReuse.Visible=true;
1515
labelPath.Text="Path to ndb binary:";
1516
labelArgs.Text="Arguments to ndb:";
1518
// clear previous and get a new ndb
1520
labelOther.Text="NDB_CONNECTSTRING";
1522
textOther.Enabled=false;
1523
textArgs.Enabled=false;
1525
textPath.TabStop=true;
1526
textEnv.TabStop=true;
1527
textOther.TabStop=false;
1528
textArgs.TabStop=false;
1529
textCwd.TabStop=true;
1535
String process="ndb." + Convert.ToString(m_noOfConfiguredNdb+m_nMGM+1);
1536
textOther.Text="nodeid=" + Convert.ToString(m_noOfConfiguredNdb+m_nMGM+1) + ";host="+this.m_mgmHost + ":" + this.m_mgmPort;
1537
Process ndb=m_db.getProcessByName(process);
1538
textComputer.Text=ndb.getComputer().getName();
1539
textName.Text=ndb.getName().ToString();
1540
textDatabase.Text=ndb.getDatabase().ToString();
1545
public void saveMgm()
1547
String process="mgm." + Convert.ToString(m_noOfConfiguredMgmt+1);
1548
Process mgmt=m_db.getProcessByName(process);
1549
mgmt.setOther(textOther.Text.ToString());
1550
mgmt.setEnv(textEnv.Text.ToString());
1551
m_mgmPort = textOther.Text.ToString();
1554
m_db.setMgmtPort(Convert.ToInt32(m_mgmPort));
1558
MessageBox.Show("Port number must be numeric!!!", "Error",MessageBoxButtons.OK);
1559
this.configureMgmt();
1562
mgmt.setPath(textPath.Text.ToString());
1563
mgmt.setCwd(textCwd.Text.ToString());
1564
mgmt.setProcessType("permanent");
1565
mgmt.setArgs("-i initconfig.txt");
1566
mgmt.setConnectString("nodeid=" + Convert.ToString(m_noOfConfiguredMgmt+1)+";host="+m_mgmHost+":" + m_mgmPort);
1567
this.m_noOfConfiguredMgmt++;
1570
public void saveApi()
1572
if(checkBoxReuse.Checked)
1574
for(;m_noOfConfiguredApi<m_nAPI;m_noOfConfiguredApi++)
1576
String process="api." + Convert.ToString(m_noOfConfiguredApi+m_nMGM+m_nNDB+1);
1577
Process api=m_db.getProcessByName(process);
1578
textName.Text=process;
1579
api.setPath(textPath.Text.ToString());
1580
api.setArgs(textArgs.Text.ToString());
1581
api.setCwd(textCwd.Text.ToString());
1582
api.setEnv(textEnv.Text.ToString());
1583
api.setConnectString("nodeid=" + Convert.ToString(m_noOfConfiguredApi+m_nNDB+m_nMGM+1)+";host="+m_mgmHost+":" + m_mgmPort);
1584
api.setProcessType("permanent");
1590
String process="api." + Convert.ToString(m_noOfConfiguredApi+m_nMGM+m_nNDB+1);
1591
Process api=m_db.getProcessByName(process);
1592
api.setPath(textPath.Text.ToString());
1593
api.setCwd(textCwd.Text.ToString());
1594
api.setEnv(textEnv.Text.ToString());
1595
api.setConnectString("nodeid=" + Convert.ToString(m_noOfConfiguredApi+m_nNDB+m_nMGM+1)+";host="+m_mgmHost+":" + m_mgmPort);
1596
api.setArgs(textArgs.Text.ToString());
1597
api.setProcessType("permanent");
1598
this.m_noOfConfiguredApi++;
1602
public void saveNdb()
1605
if(checkBoxReuse.Checked)
1607
for(;m_noOfConfiguredNdb<m_nNDB;m_noOfConfiguredNdb++)
1609
String process="ndb." + Convert.ToString(m_noOfConfiguredNdb+m_nMGM+1);
1610
Process ndb=m_db.getProcessByName(process);
1611
ndb.setConnectString("nodeid=" + Convert.ToString(m_noOfConfiguredNdb+m_nMGM+1)+";host="+m_mgmHost+":" + m_mgmPort);
1612
ndb.setPath(textPath.Text.ToString());
1613
ndb.setArgs(textArgs.Text.ToString());
1614
ndb.setEnv(textEnv.Text.ToString());
1615
ndb.setCwd(textCwd.Text.ToString());
1616
ndb.setProcessType("permanent");
1618
checkBoxReuse.Checked=false;
1623
String process="ndb." + Convert.ToString(m_noOfConfiguredNdb+m_nMGM+1);
1624
Process ndb=m_db.getProcessByName(process);
1625
ndb.setConnectString("nodeid=" + Convert.ToString(m_noOfConfiguredNdb+m_nMGM+1)+";host="+m_mgmHost+":" + m_mgmPort);
1626
ndb.setPath(textPath.Text.ToString());
1627
ndb.setCwd(textCwd.Text.ToString());
1628
ndb.setArgs(textArgs.Text.ToString());
1629
ndb.setEnv(textEnv.Text.ToString());
1630
ndb.setProcessType("permanent");
1631
m_noOfConfiguredNdb++;
1637
private void panel5_Paint(object sender, System.Windows.Forms.PaintEventArgs e)
1640
buttonSave.Enabled=true;
1641
checkBoxReuse.Visible=false;
1646
private void buttonSave_Click(object sender, System.EventArgs e)
1648
Process p = m_db.getProcessByName(textName.Text.ToString());
1650
if(textOther.Text.ToString().Equals(""))
1652
if(textName.Text.StartsWith("mgm"))
1654
MessageBox.Show("You have to specify a port.","Warning",MessageBoxButtons.OK);
1657
if(textName.Text.StartsWith("ndb"))
1659
MessageBox.Show("You have to specify a filesystem path.","Warning",MessageBoxButtons.OK);
1665
if(textPath.Text.ToString().Equals(""))
1667
if(textName.Text.StartsWith("mgm"))
1669
MessageBox.Show("You have to specify the path to the mgmtsrvr.","Warning",MessageBoxButtons.OK);
1672
if(textName.Text.StartsWith("ndb"))
1674
MessageBox.Show("You have to specify the path to ndb.","Warning",MessageBoxButtons.OK);
1679
if(textArgs.Text.ToString().Equals(""))
1681
if(textName.Text.StartsWith("mgm"))
1683
MessageBox.Show("You have to specify the arguments to the mgmtsrvr.","Warning",MessageBoxButtons.OK);
1688
if(textCwd.Text.ToString().Equals(""))
1690
if(textCwd.Text.StartsWith("mgm"))
1692
MessageBox.Show("You have to specify the current working directory for the mgmtsrvr.","Warning",MessageBoxButtons.OK);
1699
* INPUT IS FINE AT THIS POINT
1700
* Everything needed for respective process is ok
1703
if(textName.Text.StartsWith("mgm"))
1705
//MessageBox.Show(textOther.Text.ToString());
1710
if(textName.Text.StartsWith("ndb"))
1716
if(textName.Text.StartsWith("api"))
1722
if(m_noOfConfiguredMgmt < m_nMGM)
1725
labelTitle.Text="Mgmtsrvr configuration";
1735
labelTitle.Text="NDB node configuration";
1736
if(m_noOfConfiguredNdb < m_nNDB)
1744
if(m_bNdb && m_bMgmt)
1746
labelTitle.Text="API node configuration";
1747
if(m_noOfConfiguredApi < m_nAPI)
1752
buttonSave.Enabled=false;
1759
private void listBoxComputers_SelectedIndexChanged(object sender, System.EventArgs e)
1764
private void panel1_Paint(object sender, System.Windows.Forms.PaintEventArgs e)
1769
private void radioYes_CheckedChanged(object sender, System.EventArgs e)
1771
if(radioYes.Checked==true)
1773
radioNo.Checked=false;
1775
if(radioYes.Checked==false)
1777
radioNo.Checked=true;
1782
private void radioNo_CheckedChanged(object sender, System.EventArgs e)
1784
if(radioNo.Checked==true)
1786
radioYes.Checked=false;
1788
if(radioNo.Checked==false)
1790
radioYes.Checked=true;
1794
private void radioStartYes_CheckedChanged(object sender, System.EventArgs e)
1797
if(radioStartYes.Checked==true)
1799
radioStartNo.Checked=false;
1801
if(radioStartYes.Checked==false)
1803
radioStartNo.Checked=true;
1809
private void radioStartNo_CheckedChanged(object sender, System.EventArgs e)
1811
if(radioStartNo.Checked==true)
1813
radioStartYes.Checked=false;
1815
if(radioStartNo.Checked==false)
1817
radioStartYes.Checked=true;
1826
public void startDatabase()
1828
startDatabaseDlg x = new startDatabaseDlg(this.m_db);
1837
public void generateInitConfig()
1839
MessageBox.Show("Generate initconfig.txt");
1842
private void label11_Click(object sender, System.EventArgs e)
1847
private void textOwner_TextChanged(object sender, System.EventArgs e)
1849
if(textDbName.TextLength > 0 && textOwner.TextLength > 0)
1857
private void panel2_Paint(object sender, System.Windows.Forms.PaintEventArgs e)
1859
textOwner.Text=System.Environment.UserName;
1861
if(textDbName.TextLength > 0 && textOwner.TextLength>0)
1872
private void textPath_TextChanged(object sender, System.EventArgs e)
1878
catch (Exception exc)
1880
MessageBox.Show(exc.ToString());
1884
private void panel2_Validating(object sender, System.ComponentModel.CancelEventArgs e)
1886
if(textOwner.TextLength>0 && textDbName.TextLength > 0)