From: Vásáry Dániel Date: Thu, 2 Nov 2017 09:46:20 +0000 (+0000) Subject: git-tfs-id: [http://tfs.userrendszerhaz.hu:8080/tfs/DefaultCollection]$/MediaCube... X-Git-Url: http://git.useribm.hu/?a=commitdiff_plain;h=8ffa024f9b61fb3486aa775550ac6de685cb0d0b;p=mediacube.git git-tfs-id: [tfs.userrendszerhaz.hu:8080/tfs/DefaultCollection]$/MediaCube;C30681 --- diff --git a/client/AudioRecorder/FileNameForm.Designer.cs b/client/AudioRecorder/FileNameForm.Designer.cs index 77d31916..81933833 100644 --- a/client/AudioRecorder/FileNameForm.Designer.cs +++ b/client/AudioRecorder/FileNameForm.Designer.cs @@ -32,7 +32,6 @@ // octopusIDSelector1 // this.octopusIDSelector1.BackColor = System.Drawing.Color.White; - this.octopusIDSelector1.ErrorReporter = null; this.octopusIDSelector1.IDChangedEvent = null; this.octopusIDSelector1.Location = new System.Drawing.Point(7, 8); this.octopusIDSelector1.Margin = new System.Windows.Forms.Padding(10); diff --git a/client/AudioRecorder/FileNameForm.cs b/client/AudioRecorder/FileNameForm.cs index ae58bfaf..8f7169d7 100644 --- a/client/AudioRecorder/FileNameForm.cs +++ b/client/AudioRecorder/FileNameForm.cs @@ -15,7 +15,12 @@ namespace AudioRecorder { this.settings = settings; this.mainForm = mainForm; octopusIDSelector1.IDChangedEvent = IdChangedEvent; - octopusIDSelector1.Configuration = new OctopusConfiguration() { Address = settings.getAddress(), Password = settings.getPassword(), UserName = settings.getUserName(), Timeout = settings.getTimeout() }; + octopusIDSelector1.Configuration = new OctopusConfiguration() { + Address = settings.getAddress(), + Password = settings.getPassword(), + UserName = settings.getUserName(), + Timeout = settings.getTimeout() + }; } private void IdChangedEvent(string id, string name) { diff --git a/client/IntegrationTests/IntegrationTests.csproj b/client/IntegrationTests/IntegrationTests.csproj index 11bd4bf8..13d952e0 100644 --- a/client/IntegrationTests/IntegrationTests.csproj +++ b/client/IntegrationTests/IntegrationTests.csproj @@ -78,6 +78,9 @@ MinimumRecommendedRules.ruleset + + ..\packages\LinkDotNet.MessageBus.Contracts.0.1.1\lib\LinkDotNet.MessageHandling.Contracts.dll + ..\packages\MSTest.TestFramework.1.1.11\lib\net45\Microsoft.VisualStudio.TestPlatform.TestFramework.dll diff --git a/client/IntegrationTests/JobEngineIT.cs b/client/IntegrationTests/JobEngineIT.cs index 38701b1a..bb4ab0bf 100644 --- a/client/IntegrationTests/JobEngineIT.cs +++ b/client/IntegrationTests/JobEngineIT.cs @@ -1,5 +1,5 @@ using Microsoft.VisualStudio.TestTools.UnitTesting; -using JobEngineClient; +using MediaCubeClient; using System.Net; using Model; using System; @@ -16,7 +16,7 @@ namespace IntegrationTests { [TestMethod] public void TestCreate() { - MediaCubeApi client = new MediaCubeApi("http://localhost:8080/services/rest/jobengine/", null, null, 100); + MediaCubeApi client = new MediaCubeApi("http://localhost:8080/services/rest/jobengine/", null, null, 100, null); WorkflowAction item = new WorkflowAction(); item.description = "description"; @@ -32,14 +32,14 @@ namespace IntegrationTests { [TestMethod] public void TestCreateMasterId() { - MediaCubeApi client = new MediaCubeApi("http://10.10.1.28/services/rest/jobengine/", null, null, 100); + MediaCubeApi client = new MediaCubeApi("http://10.10.1.28/services/rest/jobengine/", null, null, 100, null); MasterId masterId = client.Create(new MasterId()); Assert.IsTrue(masterId.id > 0); } [TestMethod] public void TestCreateMany() { - MediaCubeApi client = new MediaCubeApi("http://localhost:8080/services/rest/jobengine/", null, null, 100); + MediaCubeApi client = new MediaCubeApi("http://localhost:8080/services/rest/jobengine/", null, null, 100, null); for (int i = 0; i < 10; i++) { WorkflowAction item = new WorkflowAction(); @@ -70,13 +70,13 @@ namespace IntegrationTests { [TestMethod] public void TestItem() { - MediaCubeApi client = new MediaCubeApi("http://localhost:8080/services/rest/jobengine/", null, null, 100); + MediaCubeApi client = new MediaCubeApi("http://localhost:8080/services/rest/jobengine/", null, null, 100, null); client.Item(); } [TestMethod] public void TestNotify() { - MediaCubeApi client = new MediaCubeApi("http://localhost:8080/services/rest/jobengine/", null, null, 100); + MediaCubeApi client = new MediaCubeApi("http://localhost:8080/services/rest/jobengine/", null, null, 100, null); client.Notify("vasay@elgekko.net", "Újravágást kérek!"); } diff --git a/client/IntegrationTests/MaestroIT.cs b/client/IntegrationTests/MaestroIT.cs index 13c6d216..580337b9 100644 --- a/client/IntegrationTests/MaestroIT.cs +++ b/client/IntegrationTests/MaestroIT.cs @@ -106,6 +106,25 @@ namespace IntegrationTests { testRegex("44444S", exp, false); } + [TestMethod] + public void TestOctopusPlaceholderRegex() { + const string exp = "^[0-9]+_[0-9]+$"; + testRegex("1111_1", exp, true); + testRegex("11112222_1222", exp, true); + testRegex("1111_1.", exp, false); + testRegex("11111", exp, false); + } + + [TestMethod] + public void TestOctopusPlaceholderVersionedRegex() { + const string exp = "^[0-9]+_[0-9]+-[0-9]{3}$"; + testRegex("1111_1-111", exp, true); + testRegex("11112222_1222-121", exp, true); + testRegex("1111_1-1111", exp, false); + testRegex("1111_1.-11", exp, false); + testRegex("11111", exp, false); + } + [TestMethod] public void TestFTPTarget() { Target configuration = new Target() { diff --git a/client/IntegrationTests/PlanAIRTests.cs b/client/IntegrationTests/PlanAIRTests.cs index dcf85df9..e78e43c6 100644 --- a/client/IntegrationTests/PlanAIRTests.cs +++ b/client/IntegrationTests/PlanAIRTests.cs @@ -24,37 +24,12 @@ namespace IntegrationTests { [TestMethod] public void GetSegmentReadyTest() { //Exercise - List actual = sut.GetBroadcastSegments(ITEM_ID); + List actual = sut.GetMaterialSegments(ITEM_ID); //Verify Assert.IsTrue(actual.Count > 0); } - [TestMethod] - public void AddSegmentToKopiaTest() { - //Fixture - Segment segment = new Segment() { Comment = "Test", Optional = true, TCIn = 1000, TCOut = 2000 }; - - //Fixture - sut.AddSegmentToCopia(ITEM_ID, segment); - } - - [TestMethod] - public void DeletesegmentsTest() { - - //Exercise - sut.DeleteSegments(ITEM_ID); - } - - [TestMethod] - public void DeleteSegmentTest() { - //Fixture - const int segmentID = 82454; - - //Exercise - sut.DeleteSegment(ITEM_ID, segmentID); - } - [TestMethod] public void SearchPromotionalsTest() { //Fixture diff --git a/client/IntegrationTests/packages.config b/client/IntegrationTests/packages.config index 6d7e4746..351b7b27 100644 --- a/client/IntegrationTests/packages.config +++ b/client/IntegrationTests/packages.config @@ -1,5 +1,6 @@  + diff --git a/client/Maestro/ArchiveMetadataForm.cs b/client/Maestro/ArchiveMetadataForm.cs index 4a174c13..d4c29590 100644 --- a/client/Maestro/ArchiveMetadataForm.cs +++ b/client/Maestro/ArchiveMetadataForm.cs @@ -27,10 +27,12 @@ namespace Maestro { model.mediaHouseId = textBox_mediaID.Text; model.mediaTitle = textBox_mediaTitle.Text; model.mediaDescription = textBox_mediaDescription.Text; + DialogResult = DialogResult.OK; Close(); } private void OnCancelClick(object sender, System.EventArgs e) { + DialogResult = DialogResult.Cancel; Close(); } } diff --git a/client/Maestro/Configuration/configuration-editor.json b/client/Maestro/Configuration/configuration-editor.json index fc3b409e..e410558d 100644 --- a/client/Maestro/Configuration/configuration-editor.json +++ b/client/Maestro/Configuration/configuration-editor.json @@ -1,7 +1,7 @@  { "title": "Szerkesztő", - "active": true, + "active": false, "startInTray": false, "enableCustomMetadataId": true, "player": { @@ -79,10 +79,11 @@ "tag": "Betöltés", "nexioServer": true, "killDateDays": 7, + "disableFileVersioning": true, "agency": "MAESTRO-EDITOR", "reference": "Hír nyersanyag betöltés", "remote": { - "address": "ftp://10.10.1.56:2098", + "address": "ftp://10.10.1.55:2098", "userName": "administrator", "password": "+QtkeQdCTiOvZOgK/kUND4pO4/D+//r7ZIyluwMMdiqMEgO8iJErAG10ooWhPfiljQeXrdeyMzo7gWEZtcWpNSomGeDIbdMyQwtpqmMo1VEM3A27ZfzigY09YD46ECRh", "timeout": 1000 diff --git a/client/Maestro/MaestroForm.Designer.cs b/client/Maestro/MaestroForm.Designer.cs index f7a220ab..0fc4654f 100644 --- a/client/Maestro/MaestroForm.Designer.cs +++ b/client/Maestro/MaestroForm.Designer.cs @@ -36,9 +36,10 @@ namespace Maestro { System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle5 = new System.Windows.Forms.DataGridViewCellStyle(); System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle6 = new System.Windows.Forms.DataGridViewCellStyle(); System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle10 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle11 = new System.Windows.Forms.DataGridViewCellStyle(); System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle12 = new System.Windows.Forms.DataGridViewCellStyle(); System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle13 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle14 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle11 = new System.Windows.Forms.DataGridViewCellStyle(); this.groupSource = new System.Windows.Forms.GroupBox(); this.dataGridSource = new System.Windows.Forms.DataGridView(); this.bindingSource = new System.Windows.Forms.BindingSource(this.components); @@ -46,9 +47,6 @@ namespace Maestro { this.textSelectedSource = new System.Windows.Forms.TextBox(); this.label1 = new System.Windows.Forms.Label(); this.buttonMetadata = new System.Windows.Forms.Button(); - this.panel2 = new System.Windows.Forms.Panel(); - this.buttonDeleteFilter = new System.Windows.Forms.Button(); - this.txtSorceFilter = new System.Windows.Forms.TextBox(); this.lbSourceTitle = new System.Windows.Forms.Label(); this.ctxmActions = new System.Windows.Forms.ContextMenuStrip(this.components); this.ctxiDefineSegments = new System.Windows.Forms.ToolStripMenuItem(); @@ -71,7 +69,7 @@ namespace Maestro { this.btnExecute = new System.Windows.Forms.Button(); this.splitContainer2 = new System.Windows.Forms.SplitContainer(); this.groupActions = new System.Windows.Forms.GroupBox(); - this.tabControl2 = new System.Windows.Forms.TabControl(); + this.tabSystem = new System.Windows.Forms.TabControl(); this.tabPage1 = new System.Windows.Forms.TabPage(); this.dataGridJobs = new System.Windows.Forms.DataGridView(); this.columnLabel = new System.Windows.Forms.DataGridViewTextBoxColumn(); @@ -86,16 +84,16 @@ namespace Maestro { this.bindingSourceJobs = new System.Windows.Forms.BindingSource(this.components); this.tabPage2 = new System.Windows.Forms.TabPage(); this.dataGridMessages = new System.Windows.Forms.DataGridView(); - this.timeDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.Level = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.messageDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.dataGridViewTextBoxColumn1 = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.dataGridViewTextBoxColumn2 = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.systemMessageBindingSource = new System.Windows.Forms.BindingSource(this.components); this.metadataInfoBindingSource = new System.Windows.Forms.BindingSource(this.components); + this.timeDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.messageDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.groupSource.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.dataGridSource)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.bindingSource)).BeginInit(); this.tableLayoutPanel2.SuspendLayout(); - this.panel2.SuspendLayout(); this.ctxmActions.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit(); this.splitContainer1.Panel1.SuspendLayout(); @@ -117,7 +115,7 @@ namespace Maestro { this.splitContainer2.Panel2.SuspendLayout(); this.splitContainer2.SuspendLayout(); this.groupActions.SuspendLayout(); - this.tabControl2.SuspendLayout(); + this.tabSystem.SuspendLayout(); this.tabPage1.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.dataGridJobs)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.bindingSourceJobs)).BeginInit(); @@ -132,13 +130,12 @@ namespace Maestro { this.groupSource.BackColor = System.Drawing.Color.Transparent; this.groupSource.Controls.Add(this.dataGridSource); this.groupSource.Controls.Add(this.tableLayoutPanel2); - this.groupSource.Controls.Add(this.panel2); this.groupSource.Controls.Add(this.lbSourceTitle); this.groupSource.Dock = System.Windows.Forms.DockStyle.Fill; this.groupSource.Location = new System.Drawing.Point(0, 0); this.groupSource.Name = "groupSource"; this.groupSource.Padding = new System.Windows.Forms.Padding(10); - this.groupSource.Size = new System.Drawing.Size(414, 471); + this.groupSource.Size = new System.Drawing.Size(367, 471); this.groupSource.TabIndex = 0; this.groupSource.TabStop = false; this.groupSource.Text = "Source file"; @@ -176,14 +173,15 @@ namespace Maestro { this.dataGridSource.DefaultCellStyle = dataGridViewCellStyle2; this.dataGridSource.Dock = System.Windows.Forms.DockStyle.Fill; this.dataGridSource.EditMode = System.Windows.Forms.DataGridViewEditMode.EditProgrammatically; - this.dataGridSource.Location = new System.Drawing.Point(10, 56); + this.dataGridSource.EnableHeadersVisualStyles = false; + this.dataGridSource.Location = new System.Drawing.Point(10, 36); this.dataGridSource.Name = "dataGridSource"; this.dataGridSource.RowHeadersVisible = false; dataGridViewCellStyle3.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); this.dataGridSource.RowsDefaultCellStyle = dataGridViewCellStyle3; this.dataGridSource.RowTemplate.DefaultCellStyle.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); this.dataGridSource.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; - this.dataGridSource.Size = new System.Drawing.Size(394, 343); + this.dataGridSource.Size = new System.Drawing.Size(347, 363); this.dataGridSource.TabIndex = 0; this.dataGridSource.CellContentClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.sourceGridView_CellContentClick); this.dataGridSource.CellEnter += new System.Windows.Forms.DataGridViewCellEventHandler(this.dataGridSource_CellEnter); @@ -208,7 +206,7 @@ namespace Maestro { this.tableLayoutPanel2.RowCount = 2; this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle()); this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle()); - this.tableLayoutPanel2.Size = new System.Drawing.Size(394, 62); + this.tableLayoutPanel2.Size = new System.Drawing.Size(347, 62); this.tableLayoutPanel2.TabIndex = 12; // // textSelectedSource @@ -220,7 +218,7 @@ namespace Maestro { this.textSelectedSource.Location = new System.Drawing.Point(3, 28); this.textSelectedSource.Name = "textSelectedSource"; this.textSelectedSource.ReadOnly = true; - this.textSelectedSource.Size = new System.Drawing.Size(292, 26); + this.textSelectedSource.Size = new System.Drawing.Size(245, 26); this.textSelectedSource.TabIndex = 10; // // label1 @@ -232,7 +230,7 @@ namespace Maestro { this.label1.Location = new System.Drawing.Point(3, 0); this.label1.Name = "label1"; this.label1.Padding = new System.Windows.Forms.Padding(0, 5, 0, 5); - this.label1.Size = new System.Drawing.Size(388, 25); + this.label1.Size = new System.Drawing.Size(341, 25); this.label1.TabIndex = 13; this.label1.Text = "Selected source"; // @@ -243,7 +241,7 @@ namespace Maestro { this.buttonMetadata.Enabled = false; this.buttonMetadata.FlatStyle = System.Windows.Forms.FlatStyle.Popup; this.buttonMetadata.Font = new System.Drawing.Font("Microsoft Sans Serif", 10F); - this.buttonMetadata.Location = new System.Drawing.Point(301, 28); + this.buttonMetadata.Location = new System.Drawing.Point(254, 28); this.buttonMetadata.Name = "buttonMetadata"; this.buttonMetadata.Size = new System.Drawing.Size(90, 26); this.buttonMetadata.TabIndex = 14; @@ -251,45 +249,12 @@ namespace Maestro { this.buttonMetadata.UseVisualStyleBackColor = false; this.buttonMetadata.Click += new System.EventHandler(this.buttonMetadata_Click); // - // panel2 - // - this.panel2.Controls.Add(this.buttonDeleteFilter); - this.panel2.Controls.Add(this.txtSorceFilter); - this.panel2.Dock = System.Windows.Forms.DockStyle.Top; - this.panel2.Location = new System.Drawing.Point(10, 36); - this.panel2.Name = "panel2"; - this.panel2.Size = new System.Drawing.Size(394, 20); - this.panel2.TabIndex = 14; - // - // buttonDeleteFilter - // - this.buttonDeleteFilter.Dock = System.Windows.Forms.DockStyle.Right; - this.buttonDeleteFilter.Location = new System.Drawing.Point(374, 0); - this.buttonDeleteFilter.Name = "buttonDeleteFilter"; - this.buttonDeleteFilter.Size = new System.Drawing.Size(20, 20); - this.buttonDeleteFilter.TabIndex = 3; - this.buttonDeleteFilter.Text = "button1"; - this.buttonDeleteFilter.UseVisualStyleBackColor = true; - this.buttonDeleteFilter.Visible = false; - this.buttonDeleteFilter.Click += new System.EventHandler(this.buttonDeleteFilter_Click); - // - // txtSorceFilter - // - this.txtSorceFilter.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; - this.txtSorceFilter.Dock = System.Windows.Forms.DockStyle.Fill; - this.txtSorceFilter.Location = new System.Drawing.Point(0, 0); - this.txtSorceFilter.Name = "txtSorceFilter"; - this.txtSorceFilter.Size = new System.Drawing.Size(394, 20); - this.txtSorceFilter.TabIndex = 13; - this.txtSorceFilter.Visible = false; - this.txtSorceFilter.KeyUp += new System.Windows.Forms.KeyEventHandler(this.textBox1_KeyUp); - // // lbSourceTitle // this.lbSourceTitle.Dock = System.Windows.Forms.DockStyle.Top; this.lbSourceTitle.Location = new System.Drawing.Point(10, 23); this.lbSourceTitle.Name = "lbSourceTitle"; - this.lbSourceTitle.Size = new System.Drawing.Size(394, 13); + this.lbSourceTitle.Size = new System.Drawing.Size(347, 13); this.lbSourceTitle.TabIndex = 15; this.lbSourceTitle.Text = "source"; // @@ -330,7 +295,7 @@ namespace Maestro { // this.splitContainer1.Panel2.Controls.Add(this.splitContainer3); this.splitContainer1.Size = new System.Drawing.Size(1022, 471); - this.splitContainer1.SplitterDistance = 414; + this.splitContainer1.SplitterDistance = 367; this.splitContainer1.TabIndex = 1; // // splitContainer3 @@ -346,8 +311,8 @@ namespace Maestro { // splitContainer3.Panel2 // this.splitContainer3.Panel2.Controls.Add(this.groupTarget); - this.splitContainer3.Size = new System.Drawing.Size(604, 471); - this.splitContainer3.SplitterDistance = 284; + this.splitContainer3.Size = new System.Drawing.Size(651, 471); + this.splitContainer3.SplitterDistance = 306; this.splitContainer3.TabIndex = 2; // // groupMetadata @@ -359,7 +324,7 @@ namespace Maestro { this.groupMetadata.Location = new System.Drawing.Point(0, 0); this.groupMetadata.Name = "groupMetadata"; this.groupMetadata.Padding = new System.Windows.Forms.Padding(10); - this.groupMetadata.Size = new System.Drawing.Size(284, 471); + this.groupMetadata.Size = new System.Drawing.Size(306, 471); this.groupMetadata.TabIndex = 1; this.groupMetadata.TabStop = false; this.groupMetadata.Text = "Metadata"; @@ -375,7 +340,7 @@ namespace Maestro { this.tabControl1.Location = new System.Drawing.Point(10, 23); this.tabControl1.Name = "tabControl1"; this.tabControl1.SelectedIndex = 0; - this.tabControl1.Size = new System.Drawing.Size(264, 376); + this.tabControl1.Size = new System.Drawing.Size(286, 376); this.tabControl1.TabIndex = 1; // // tpOctopus @@ -384,7 +349,7 @@ namespace Maestro { this.tpOctopus.Location = new System.Drawing.Point(4, 24); this.tpOctopus.Name = "tpOctopus"; this.tpOctopus.Padding = new System.Windows.Forms.Padding(3); - this.tpOctopus.Size = new System.Drawing.Size(256, 348); + this.tpOctopus.Size = new System.Drawing.Size(278, 348); this.tpOctopus.TabIndex = 0; this.tpOctopus.Text = "Octopus"; this.tpOctopus.UseVisualStyleBackColor = true; @@ -393,7 +358,6 @@ namespace Maestro { // this.octopusIDSelector.BackColor = System.Drawing.Color.White; this.octopusIDSelector.Dock = System.Windows.Forms.DockStyle.Fill; - this.octopusIDSelector.ErrorReporter = null; this.octopusIDSelector.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); this.octopusIDSelector.IDChangedEvent = null; this.octopusIDSelector.Location = new System.Drawing.Point(3, 3); @@ -401,7 +365,7 @@ namespace Maestro { this.octopusIDSelector.MinimumSize = new System.Drawing.Size(200, 300); this.octopusIDSelector.Name = "octopusIDSelector"; this.octopusIDSelector.Padding = new System.Windows.Forms.Padding(6); - this.octopusIDSelector.Size = new System.Drawing.Size(250, 342); + this.octopusIDSelector.Size = new System.Drawing.Size(272, 342); this.octopusIDSelector.TabIndex = 1; // // tpTraffic @@ -410,7 +374,7 @@ namespace Maestro { this.tpTraffic.Location = new System.Drawing.Point(4, 24); this.tpTraffic.Name = "tpTraffic"; this.tpTraffic.Padding = new System.Windows.Forms.Padding(3); - this.tpTraffic.Size = new System.Drawing.Size(256, 348); + this.tpTraffic.Size = new System.Drawing.Size(278, 348); this.tpTraffic.TabIndex = 1; this.tpTraffic.Text = "Traffic"; this.tpTraffic.UseVisualStyleBackColor = true; @@ -420,13 +384,12 @@ namespace Maestro { this.trafficIDSelector.AutoSize = true; this.trafficIDSelector.BackColor = System.Drawing.Color.White; this.trafficIDSelector.Dock = System.Windows.Forms.DockStyle.Fill; - this.trafficIDSelector.ErrorReporter = null; this.trafficIDSelector.IDChangedEvent = null; this.trafficIDSelector.Location = new System.Drawing.Point(3, 3); this.trafficIDSelector.Margin = new System.Windows.Forms.Padding(4); this.trafficIDSelector.Name = "trafficIDSelector"; this.trafficIDSelector.Padding = new System.Windows.Forms.Padding(6); - this.trafficIDSelector.Size = new System.Drawing.Size(250, 342); + this.trafficIDSelector.Size = new System.Drawing.Size(272, 342); this.trafficIDSelector.TabIndex = 0; // // tableLayoutPanel1 @@ -444,7 +407,7 @@ namespace Maestro { this.tableLayoutPanel1.RowCount = 2; this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle()); this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle()); - this.tableLayoutPanel1.Size = new System.Drawing.Size(264, 62); + this.tableLayoutPanel1.Size = new System.Drawing.Size(286, 62); this.tableLayoutPanel1.TabIndex = 4; // // labelSelectedMetadata @@ -456,7 +419,7 @@ namespace Maestro { this.labelSelectedMetadata.Location = new System.Drawing.Point(3, 0); this.labelSelectedMetadata.Name = "labelSelectedMetadata"; this.labelSelectedMetadata.Padding = new System.Windows.Forms.Padding(0, 5, 0, 5); - this.labelSelectedMetadata.Size = new System.Drawing.Size(258, 25); + this.labelSelectedMetadata.Size = new System.Drawing.Size(280, 25); this.labelSelectedMetadata.TabIndex = 13; this.labelSelectedMetadata.Text = "Selected metadata"; // @@ -468,7 +431,7 @@ namespace Maestro { this.textSelectedMetadata.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(238))); this.textSelectedMetadata.Location = new System.Drawing.Point(3, 28); this.textSelectedMetadata.Name = "textSelectedMetadata"; - this.textSelectedMetadata.Size = new System.Drawing.Size(162, 26); + this.textSelectedMetadata.Size = new System.Drawing.Size(184, 26); this.textSelectedMetadata.TabIndex = 12; this.textSelectedMetadata.TextChanged += new System.EventHandler(this.OnMetadataIDChanged); // @@ -478,7 +441,7 @@ namespace Maestro { this.menuButtonActions.Dock = System.Windows.Forms.DockStyle.Top; this.menuButtonActions.FlatStyle = System.Windows.Forms.FlatStyle.Popup; this.menuButtonActions.Font = new System.Drawing.Font("Microsoft Sans Serif", 10F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); - this.menuButtonActions.Location = new System.Drawing.Point(171, 28); + this.menuButtonActions.Location = new System.Drawing.Point(193, 28); this.menuButtonActions.Menu = this.ctxmActions; this.menuButtonActions.Name = "menuButtonActions"; this.menuButtonActions.Size = new System.Drawing.Size(90, 27); @@ -495,7 +458,7 @@ namespace Maestro { this.groupTarget.Location = new System.Drawing.Point(0, 0); this.groupTarget.Name = "groupTarget"; this.groupTarget.Padding = new System.Windows.Forms.Padding(10); - this.groupTarget.Size = new System.Drawing.Size(316, 471); + this.groupTarget.Size = new System.Drawing.Size(341, 471); this.groupTarget.TabIndex = 0; this.groupTarget.TabStop = false; this.groupTarget.Text = "Target action"; @@ -515,7 +478,7 @@ namespace Maestro { this.panelActions.Padding = new System.Windows.Forms.Padding(0, 0, 5, 0); this.panelActions.RowCount = 1; this.panelActions.RowStyles.Add(new System.Windows.Forms.RowStyle()); - this.panelActions.Size = new System.Drawing.Size(296, 376); + this.panelActions.Size = new System.Drawing.Size(321, 376); this.panelActions.TabIndex = 4; this.panelActions.MouseClick += new System.Windows.Forms.MouseEventHandler(this.OnTargetPanelsMouseClick); // @@ -526,7 +489,7 @@ namespace Maestro { this.panel1.Dock = System.Windows.Forms.DockStyle.Bottom; this.panel1.Location = new System.Drawing.Point(10, 399); this.panel1.Name = "panel1"; - this.panel1.Size = new System.Drawing.Size(296, 62); + this.panel1.Size = new System.Drawing.Size(321, 62); this.panel1.TabIndex = 5; this.panel1.MouseClick += new System.Windows.Forms.MouseEventHandler(this.OnTargetPanelsMouseClick); // @@ -535,7 +498,7 @@ namespace Maestro { this.btnExecute.BackColor = System.Drawing.SystemColors.ActiveCaption; this.btnExecute.Dock = System.Windows.Forms.DockStyle.Right; this.btnExecute.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(238))); - this.btnExecute.Location = new System.Drawing.Point(164, 0); + this.btnExecute.Location = new System.Drawing.Point(189, 0); this.btnExecute.Margin = new System.Windows.Forms.Padding(3, 20, 3, 3); this.btnExecute.Name = "btnExecute"; this.btnExecute.Size = new System.Drawing.Size(132, 62); @@ -565,7 +528,7 @@ namespace Maestro { // groupActions // this.groupActions.BackColor = System.Drawing.Color.Transparent; - this.groupActions.Controls.Add(this.tabControl2); + this.groupActions.Controls.Add(this.tabSystem); this.groupActions.Dock = System.Windows.Forms.DockStyle.Fill; this.groupActions.Location = new System.Drawing.Point(0, 0); this.groupActions.Name = "groupActions"; @@ -577,16 +540,16 @@ namespace Maestro { this.groupActions.Enter += new System.EventHandler(this.groupBox_Enter); this.groupActions.Leave += new System.EventHandler(this.groupBox_Leave); // - // tabControl2 + // tabSystem // - this.tabControl2.Controls.Add(this.tabPage1); - this.tabControl2.Controls.Add(this.tabPage2); - this.tabControl2.Dock = System.Windows.Forms.DockStyle.Fill; - this.tabControl2.Location = new System.Drawing.Point(10, 23); - this.tabControl2.Name = "tabControl2"; - this.tabControl2.SelectedIndex = 0; - this.tabControl2.Size = new System.Drawing.Size(1002, 124); - this.tabControl2.TabIndex = 1; + this.tabSystem.Controls.Add(this.tabPage1); + this.tabSystem.Controls.Add(this.tabPage2); + this.tabSystem.Dock = System.Windows.Forms.DockStyle.Fill; + this.tabSystem.Location = new System.Drawing.Point(10, 23); + this.tabSystem.Name = "tabSystem"; + this.tabSystem.SelectedIndex = 0; + this.tabSystem.Size = new System.Drawing.Size(1002, 124); + this.tabSystem.TabIndex = 1; // // tabPage1 // @@ -629,7 +592,7 @@ namespace Maestro { this.columnOutput, this.columnKillDate}); this.dataGridJobs.DataSource = this.bindingSourceJobs; - dataGridViewCellStyle7.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle7.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; dataGridViewCellStyle7.BackColor = System.Drawing.SystemColors.Window; dataGridViewCellStyle7.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); dataGridViewCellStyle7.ForeColor = System.Drawing.SystemColors.ControlText; @@ -640,6 +603,8 @@ namespace Maestro { this.dataGridJobs.DefaultCellStyle = dataGridViewCellStyle7; this.dataGridJobs.Dock = System.Windows.Forms.DockStyle.Fill; this.dataGridJobs.EditMode = System.Windows.Forms.DataGridViewEditMode.EditProgrammatically; + this.dataGridJobs.EnableHeadersVisualStyles = false; + this.dataGridJobs.GridColor = System.Drawing.Color.White; this.dataGridJobs.Location = new System.Drawing.Point(3, 3); this.dataGridJobs.Name = "dataGridJobs"; dataGridViewCellStyle8.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; @@ -750,7 +715,6 @@ namespace Maestro { // dataGridMessages // this.dataGridMessages.AllowUserToAddRows = false; - this.dataGridMessages.AllowUserToOrderColumns = true; this.dataGridMessages.AllowUserToResizeRows = false; this.dataGridMessages.AutoGenerateColumns = false; this.dataGridMessages.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.DisplayedCells; @@ -758,71 +722,70 @@ namespace Maestro { this.dataGridMessages.BackgroundColor = System.Drawing.Color.White; this.dataGridMessages.BorderStyle = System.Windows.Forms.BorderStyle.None; dataGridViewCellStyle10.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; - dataGridViewCellStyle10.BackColor = System.Drawing.SystemColors.Window; - dataGridViewCellStyle10.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F); + dataGridViewCellStyle10.BackColor = System.Drawing.SystemColors.Control; + dataGridViewCellStyle10.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); dataGridViewCellStyle10.ForeColor = System.Drawing.SystemColors.WindowText; - dataGridViewCellStyle10.SelectionBackColor = System.Drawing.Color.Transparent; - dataGridViewCellStyle10.SelectionForeColor = System.Drawing.Color.Transparent; + dataGridViewCellStyle10.SelectionBackColor = System.Drawing.SystemColors.Highlight; + dataGridViewCellStyle10.SelectionForeColor = System.Drawing.SystemColors.HighlightText; dataGridViewCellStyle10.WrapMode = System.Windows.Forms.DataGridViewTriState.True; this.dataGridMessages.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle10; this.dataGridMessages.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; this.dataGridMessages.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { + this.dataGridViewTextBoxColumn1, + this.dataGridViewTextBoxColumn2, this.timeDataGridViewTextBoxColumn, - this.Level, this.messageDataGridViewTextBoxColumn}); this.dataGridMessages.DataSource = this.systemMessageBindingSource; - dataGridViewCellStyle11.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; - dataGridViewCellStyle11.BackColor = System.Drawing.SystemColors.Window; - dataGridViewCellStyle11.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); - dataGridViewCellStyle11.ForeColor = System.Drawing.SystemColors.ControlText; - dataGridViewCellStyle11.SelectionBackColor = System.Drawing.Color.Transparent; - dataGridViewCellStyle11.SelectionForeColor = System.Drawing.SystemColors.ControlText; - dataGridViewCellStyle11.WrapMode = System.Windows.Forms.DataGridViewTriState.False; - this.dataGridMessages.DefaultCellStyle = dataGridViewCellStyle11; + dataGridViewCellStyle12.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; + dataGridViewCellStyle12.BackColor = System.Drawing.SystemColors.Window; + dataGridViewCellStyle12.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); + dataGridViewCellStyle12.ForeColor = System.Drawing.Color.Red; + dataGridViewCellStyle12.NullValue = null; + dataGridViewCellStyle12.SelectionBackColor = System.Drawing.Color.Gainsboro; + dataGridViewCellStyle12.SelectionForeColor = System.Drawing.Color.Red; + dataGridViewCellStyle12.WrapMode = System.Windows.Forms.DataGridViewTriState.False; + this.dataGridMessages.DefaultCellStyle = dataGridViewCellStyle12; this.dataGridMessages.Dock = System.Windows.Forms.DockStyle.Fill; this.dataGridMessages.EditMode = System.Windows.Forms.DataGridViewEditMode.EditProgrammatically; + this.dataGridMessages.EnableHeadersVisualStyles = false; + this.dataGridMessages.GridColor = System.Drawing.Color.White; this.dataGridMessages.Location = new System.Drawing.Point(3, 3); this.dataGridMessages.Name = "dataGridMessages"; - dataGridViewCellStyle12.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; - dataGridViewCellStyle12.BackColor = System.Drawing.SystemColors.Control; - dataGridViewCellStyle12.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F); - dataGridViewCellStyle12.ForeColor = System.Drawing.SystemColors.WindowText; - dataGridViewCellStyle12.SelectionBackColor = System.Drawing.SystemColors.Control; - dataGridViewCellStyle12.SelectionForeColor = System.Drawing.SystemColors.WindowText; - dataGridViewCellStyle12.WrapMode = System.Windows.Forms.DataGridViewTriState.True; - this.dataGridMessages.RowHeadersDefaultCellStyle = dataGridViewCellStyle12; + this.dataGridMessages.ReadOnly = true; + dataGridViewCellStyle13.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; + dataGridViewCellStyle13.BackColor = System.Drawing.SystemColors.Control; + dataGridViewCellStyle13.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); + dataGridViewCellStyle13.ForeColor = System.Drawing.SystemColors.WindowText; + dataGridViewCellStyle13.SelectionBackColor = System.Drawing.SystemColors.Highlight; + dataGridViewCellStyle13.SelectionForeColor = System.Drawing.SystemColors.HighlightText; + dataGridViewCellStyle13.WrapMode = System.Windows.Forms.DataGridViewTriState.True; + this.dataGridMessages.RowHeadersDefaultCellStyle = dataGridViewCellStyle13; this.dataGridMessages.RowHeadersVisible = false; - dataGridViewCellStyle13.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F); - this.dataGridMessages.RowsDefaultCellStyle = dataGridViewCellStyle13; - this.dataGridMessages.RowTemplate.DefaultCellStyle.BackColor = System.Drawing.Color.Transparent; - this.dataGridMessages.RowTemplate.DefaultCellStyle.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F); - this.dataGridMessages.RowTemplate.DefaultCellStyle.SelectionBackColor = System.Drawing.Color.Transparent; + dataGridViewCellStyle14.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); + this.dataGridMessages.RowsDefaultCellStyle = dataGridViewCellStyle14; + this.dataGridMessages.RowTemplate.DefaultCellStyle.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); this.dataGridMessages.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; this.dataGridMessages.Size = new System.Drawing.Size(988, 92); - this.dataGridMessages.TabIndex = 0; - this.dataGridMessages.RowsAdded += new System.Windows.Forms.DataGridViewRowsAddedEventHandler(this.dataGridMessages_RowsAdded); - // - // timeDataGridViewTextBoxColumn - // - this.timeDataGridViewTextBoxColumn.DataPropertyName = "Time"; - this.timeDataGridViewTextBoxColumn.HeaderText = "Idő"; - this.timeDataGridViewTextBoxColumn.Name = "timeDataGridViewTextBoxColumn"; - this.timeDataGridViewTextBoxColumn.Width = 49; + this.dataGridMessages.TabIndex = 1; // - // Level + // dataGridViewTextBoxColumn1 // - this.Level.DataPropertyName = "Level"; - this.Level.HeaderText = "LogLevel"; - this.Level.Name = "Level"; - this.Level.Width = 82; + this.dataGridViewTextBoxColumn1.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells; + this.dataGridViewTextBoxColumn1.DataPropertyName = "Time"; + this.dataGridViewTextBoxColumn1.HeaderText = "Időpont"; + this.dataGridViewTextBoxColumn1.Name = "dataGridViewTextBoxColumn1"; + this.dataGridViewTextBoxColumn1.ReadOnly = true; + this.dataGridViewTextBoxColumn1.Width = 73; // - // messageDataGridViewTextBoxColumn + // dataGridViewTextBoxColumn2 // - this.messageDataGridViewTextBoxColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; - this.messageDataGridViewTextBoxColumn.DataPropertyName = "message"; - this.messageDataGridViewTextBoxColumn.HeaderText = "Üzenet"; - this.messageDataGridViewTextBoxColumn.MinimumWidth = 71; - this.messageDataGridViewTextBoxColumn.Name = "messageDataGridViewTextBoxColumn"; + this.dataGridViewTextBoxColumn2.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; + this.dataGridViewTextBoxColumn2.DataPropertyName = "Message"; + dataGridViewCellStyle11.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); + this.dataGridViewTextBoxColumn2.DefaultCellStyle = dataGridViewCellStyle11; + this.dataGridViewTextBoxColumn2.HeaderText = "Üzenet"; + this.dataGridViewTextBoxColumn2.Name = "dataGridViewTextBoxColumn2"; + this.dataGridViewTextBoxColumn2.ReadOnly = true; // // systemMessageBindingSource // @@ -832,6 +795,22 @@ namespace Maestro { // this.metadataInfoBindingSource.DataSource = typeof(Maestro.Metadata.MetadataInfo); // + // timeDataGridViewTextBoxColumn + // + this.timeDataGridViewTextBoxColumn.DataPropertyName = "Time"; + this.timeDataGridViewTextBoxColumn.HeaderText = "Time"; + this.timeDataGridViewTextBoxColumn.Name = "timeDataGridViewTextBoxColumn"; + this.timeDataGridViewTextBoxColumn.ReadOnly = true; + this.timeDataGridViewTextBoxColumn.Width = 60; + // + // messageDataGridViewTextBoxColumn + // + this.messageDataGridViewTextBoxColumn.DataPropertyName = "Message"; + this.messageDataGridViewTextBoxColumn.HeaderText = "Message"; + this.messageDataGridViewTextBoxColumn.Name = "messageDataGridViewTextBoxColumn"; + this.messageDataGridViewTextBoxColumn.ReadOnly = true; + this.messageDataGridViewTextBoxColumn.Width = 83; + // // MaestroForm // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); @@ -851,8 +830,6 @@ namespace Maestro { ((System.ComponentModel.ISupportInitialize)(this.bindingSource)).EndInit(); this.tableLayoutPanel2.ResumeLayout(false); this.tableLayoutPanel2.PerformLayout(); - this.panel2.ResumeLayout(false); - this.panel2.PerformLayout(); this.ctxmActions.ResumeLayout(false); this.splitContainer1.Panel1.ResumeLayout(false); this.splitContainer1.Panel2.ResumeLayout(false); @@ -876,7 +853,7 @@ namespace Maestro { ((System.ComponentModel.ISupportInitialize)(this.splitContainer2)).EndInit(); this.splitContainer2.ResumeLayout(false); this.groupActions.ResumeLayout(false); - this.tabControl2.ResumeLayout(false); + this.tabSystem.ResumeLayout(false); this.tabPage1.ResumeLayout(false); ((System.ComponentModel.ISupportInitialize)(this.dataGridJobs)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.bindingSourceJobs)).EndInit(); @@ -921,18 +898,14 @@ namespace Maestro { private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1; private TrafficClient.TrafficIDSelector trafficIDSelector; private System.Windows.Forms.Button buttonMetadata; - private System.Windows.Forms.TabControl tabControl2; + private System.Windows.Forms.TabControl tabSystem; private System.Windows.Forms.TabPage tabPage1; private System.Windows.Forms.TabPage tabPage2; - private System.Windows.Forms.DataGridView dataGridMessages; private System.Windows.Forms.BindingSource systemMessageBindingSource; - private System.Windows.Forms.Panel panel2; - private System.Windows.Forms.Button buttonDeleteFilter; - private System.Windows.Forms.TextBox txtSorceFilter; - private System.Windows.Forms.DataGridViewTextBoxColumn timeDataGridViewTextBoxColumn; - private System.Windows.Forms.DataGridViewTextBoxColumn Level; - private System.Windows.Forms.DataGridViewTextBoxColumn messageDataGridViewTextBoxColumn; private System.Windows.Forms.Label lbSourceTitle; + private System.Windows.Forms.DataGridView dataGridMessages; + private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn1; + private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn2; private System.Windows.Forms.DataGridViewTextBoxColumn columnLabel; private System.Windows.Forms.DataGridViewTextBoxColumn columnID; private Commons.DataGridViewProgressColumn Progress; @@ -942,6 +915,8 @@ namespace Maestro { private System.Windows.Forms.DataGridViewTextBoxColumn columnInput; private System.Windows.Forms.DataGridViewTextBoxColumn columnOutput; private System.Windows.Forms.DataGridViewTextBoxColumn columnKillDate; + private System.Windows.Forms.DataGridViewTextBoxColumn timeDataGridViewTextBoxColumn; + private System.Windows.Forms.DataGridViewTextBoxColumn messageDataGridViewTextBoxColumn; } } diff --git a/client/Maestro/MaestroForm.Metadata.cs b/client/Maestro/MaestroForm.Metadata.cs index 7cd744d3..3ef28192 100644 --- a/client/Maestro/MaestroForm.Metadata.cs +++ b/client/Maestro/MaestroForm.Metadata.cs @@ -9,7 +9,7 @@ using TrafficClient; using System.Collections.Generic; using System.ComponentModel; using System.Text.RegularExpressions; -using JobEngineClient; +using MediaCubeClient; using Model; namespace Maestro { @@ -18,7 +18,9 @@ namespace Maestro { private const string REGEXP_TRAFFICMATERIALID = "^M{1}[0-9]{6}[A-Z]{1}$"; private const string REGEXP_TRAFFICADID = "^R{1}[0-9]{6}[A-Z]{1}$"; private const string REGEXP_TRAFFICPROMOID = "^P{1}[0-9]{6}[A-Z]{1}$"; - private const string REGEXP_OCTOPUSID = "^[0-9]+$"; + private const string REGEXP_OCTOPUSPLACEHOLDERID = "^[0-9]+_[0-9]+$"; + private const string REGEXP_OCTOPUSPLACEHOLDERVERSIONEDID = "^[0-9]+_[0-9]+-[0-9]{3}$"; + private MetadataInfo selectedMetadata; private List segments; private MediaCubeApi mediaCubeApi; @@ -58,7 +60,7 @@ namespace Maestro { UserName = metadata.Server.UserName, Password = metadata.Server.Password, Timeout = metadata.Server.Timeout, - ErrorReporter = ReportError + MessageBus = errorMessageBus }; trafficIDSelector.IDChangedEvent += OnTrafficIDSelected; } @@ -71,23 +73,26 @@ namespace Maestro { Address = metadata.Server.Address, UserName = metadata.Server.UserName, Password = metadata.Server.Password, - Timeout = metadata.Server.Timeout + Timeout = metadata.Server.Timeout, + MessageBus = errorMessageBus }; octopusIDSelector.IDChangedEvent += OnOctopusIDSelected; } private void InitializeMediaCubeApi() { - MediaCubeMetadata metadata = Configuration.Metadatas.Where(m => { return m is MediaCubeMetadata; }).FirstOrDefault() as MediaCubeMetadata; + MediaCubeMetadata metadata = Configuration.GetMetadataProvider(); if (metadata == null) return; - mediaCubeApi = new MediaCubeApi(metadata.Server.Address.ToString(), metadata.Server.UserName, metadata.Server.Password, metadata.Server.Timeout) { ErrorReporter = ReportError }; + mediaCubeApi = new MediaCubeApi(metadata.Server.Address.ToString(), metadata.Server.UserName, metadata.Server.Password, metadata.Server.Timeout, errorMessageBus); } private void ModifyArchiveMetadataClick(object sender, EventArgs e) { if (archiveMetadata == null) archiveMetadata = GetArchiveMetadata(); ArchiveMetadataForm form = new ArchiveMetadataForm(archiveMetadata); - form.ShowDialog(); + DialogResult result = form.ShowDialog(); + if (result == DialogResult.OK && String.IsNullOrEmpty(textSelectedMetadata.Text)) + textSelectedMetadata.Text = archiveMetadata.itemHouseId; } private MetadataType GuessMetadataType(string id) { @@ -107,7 +112,11 @@ namespace Maestro { if (match.Success) return MetadataType.TrafficAD; - match = Regex.Match(id, REGEXP_OCTOPUSID); + match = Regex.Match(id, REGEXP_OCTOPUSPLACEHOLDERID); + if (match.Success) + return MetadataType.OctopusPlaceHolder; + + match = Regex.Match(id, REGEXP_OCTOPUSPLACEHOLDERVERSIONEDID); if (match.Success) return MetadataType.OctopusPlaceHolder; @@ -140,7 +149,7 @@ namespace Maestro { private BindingList GetMovieSegmentsFromSegments() { BindingList result = new BindingList(); TrafficAPI trafficApi = trafficIDSelector.trafficAPI; - List segments = trafficApi.GetBroadcastSegments(selectedMetadata.VariantID); + List segments = trafficApi.GetMaterialSegments(selectedMetadata.VariantID); if (segments != null) foreach (Segment segment in segments) { MovieSegment movieSegment = segmentConverter.ConvertToMovieSegment(segment); @@ -154,9 +163,9 @@ namespace Maestro { Cursor.Current = Cursors.WaitCursor; MetadataType metadataType = GuessMetadataType(textSelectedMetadata.Text); switch (metadataType) { + case MetadataType.None: case MetadataType.MediaCube: result = GetMediaCubeMetadata(); - textSelectedMetadata.Text = result.itemHouseId; break; case MetadataType.OctopusPlaceHolder: result = GetOctopusMetadata(); @@ -190,10 +199,10 @@ namespace Maestro { trafficResult = api.GetMaterialMetadata(id); break; case MetadataType.TrafficPromo: - trafficResult = api.GetPromoMetadata(id); + trafficResult = api.GetPromoArchiveMetadata(id); break; case MetadataType.TrafficAD: - trafficResult = api.GetADMetadata(id); + trafficResult = api.GetADArchiveMetadata(id); break; } if (trafficResult == null) @@ -284,7 +293,7 @@ namespace Maestro { } SelectedMetadata = new MetadataInfo() { Kind = MetadataType.OctopusPlaceHolder, - ID = id, + ID = name, VariantID = int.Parse(id) }; } @@ -331,7 +340,7 @@ namespace Maestro { private void UpdateEditArchiveMetadataEnabled() { // ctxiModifyArchiveMetadata.Enabled = !String.IsNullOrEmpty(textSelectedMetadata.Text); - ctxiModifyArchiveMetadata.Enabled = SelectedSource != null && SelectedMetadata != null; + ctxiModifyArchiveMetadata.Enabled = SelectedSource != null; } private void UpdateDefineSegmentEnabled() { diff --git a/client/Maestro/MaestroForm.Source.cs b/client/Maestro/MaestroForm.Source.cs index 82455b05..75276440 100644 --- a/client/Maestro/MaestroForm.Source.cs +++ b/client/Maestro/MaestroForm.Source.cs @@ -51,7 +51,7 @@ namespace Maestro { } if (Configuration?.Source is NEXIOSource) { logger.Debug("NEXIO source initialization"); - source = new NexioRESTSource(this, MessageBus, ReportError, Configuration.Source.Filter); + source = new NexioRESTSource(this, MessageBus, Configuration.Source.Filter); logger.Debug("NEXIO source created"); } @@ -228,6 +228,9 @@ namespace Maestro { LookupOctopus(); break; } + trafficIDSelector.ClearSelection(); + octopusIDSelector.ClearSelection(); + Cursor.Current = Cursors.Default; } @@ -249,12 +252,10 @@ namespace Maestro { MessageBox.Show(this, StringResources.NINCS_TALALAT); return; } - if (result.Count == 1) { - trafficMetadataSelected?.Invoke(result[0].MediaID, result[0].VariantID); - UpdateEditArchiveMetadataEnabled(); - textSelectedMetadata.Text = result[0].MediaID; - } else { - TrafficLookupResultSelector lookupResult = new TrafficLookupResultSelector(result, trafficMetadataSelected); + if (result.Count == 1) + OnTrafficIDSelected(result[0].MediaID, result[0].VariantID); + else { + TrafficLookupResultSelector lookupResult = new TrafficLookupResultSelector(result, OnTrafficIDSelected); lookupResult.ShowDialog(); } } @@ -288,17 +289,15 @@ namespace Maestro { MessageBox.Show(this, StringResources.NINCS_TALALAT); return; } - List list = mosIDs.ToList(); - if (list == null || list.Count == 0) { + List mosObjects = mosIDs.ToList(); + if (mosObjects == null || mosObjects.Count == 0) { MessageBox.Show(this, StringResources.NINCS_TALALAT); return; } - if (list.Count == 1) { - UpdateEditArchiveMetadataEnabled(); - textSelectedMetadata.Text = list[0].ID; - octopusMetadataSelected?.Invoke(list[0].ID, null); - } else { - OctopusLookupResultSelector box = new OctopusLookupResultSelector(list, octopusMetadataSelected); + if (mosObjects.Count == 1) + OnOctopusIDSelected(mosObjects[0].ID, mosObjects[0].ObjID); + else { + OctopusLookupResultSelector box = new OctopusLookupResultSelector(mosObjects, OnOctopusIDSelected); box.ShowDialog(); } } diff --git a/client/Maestro/MaestroForm.Target.cs b/client/Maestro/MaestroForm.Target.cs index 47ce78a0..30b3a483 100644 --- a/client/Maestro/MaestroForm.Target.cs +++ b/client/Maestro/MaestroForm.Target.cs @@ -7,7 +7,7 @@ using System.Windows.Forms; using Maestro.Metadata; using System.Collections.Generic; using TrafficClient; -using JobEngineClient; +using MediaCubeClient; namespace Maestro { @@ -109,7 +109,7 @@ namespace Maestro { if (selectedMetadata?.VariantID != null && selectedMetadata?.VariantID != 0) switch (selectedMetadata.Kind) { case MetadataType.TrafficMaterial: { - segments = trafficIDSelector.trafficAPI.GetBroadcastSegments(selectedMetadata.VariantID); + segments = trafficIDSelector.trafficAPI.GetMaterialSegments(selectedMetadata.VariantID); if (segments == null) { MessageBox.Show(String.Format("A {0} folyamat nem futtatható szegmens adatok nélkül.", target.Label)); return false; @@ -129,7 +129,7 @@ namespace Maestro { break; } case MetadataType.TrafficAD: { - segments = trafficIDSelector.trafficAPI.GetAdvertisementSegments(selectedMetadata.ID); + segments = trafficIDSelector.trafficAPI.GetADSegments(selectedMetadata.ID); if (segments == null) { MessageBox.Show(String.Format("A {0} folyamat nem futtatható szegmens adatok nélkül.", target.Label)); return false; @@ -233,7 +233,7 @@ namespace Maestro { ClearSelectedProcessors(); if (processorWorker == null) CreateJobsQueueWorker(); - ActivateTabOnTabControl2(0); + ActivateTab(0); } diff --git a/client/Maestro/MaestroForm.cs b/client/Maestro/MaestroForm.cs index cb2fa09d..da25cc5e 100644 --- a/client/Maestro/MaestroForm.cs +++ b/client/Maestro/MaestroForm.cs @@ -13,10 +13,12 @@ using System.Threading; using TrafficClient; using OctopusClient; using System.IO; +using MediaCubeClient; +using LinkDotNet.MessageHandling; namespace Maestro { - public delegate void Clear(); + //public delegate void Clear(); public partial class MaestroForm : Form { private static Logger logger = LogManager.GetCurrentClassLogger(); @@ -26,6 +28,8 @@ namespace Maestro { private BlockingCollection jobsQueue = new BlockingCollection(); private BackgroundWorker processorWorker; public IMessageBus MessageBus { get; set; } + private IMessageBus errorMessageBus = new MessageBus(); + private ConfigurationInfo configuration; public ConfigurationInfo Configuration { get { return configuration; } @@ -35,11 +39,6 @@ namespace Maestro { InitializeSource(); } } - private TraficMetadataSelected trafficMetadataSelected; - private OctopusMetadataSelected octopusMetadataSelected; - private Color newMSGColor; - - public Clear clear; public bool CanExecute { get { @@ -49,12 +48,7 @@ namespace Maestro { public MaestroForm() { InitializeComponent(); - //trafficIDSelector.clearCheckBox = octopusIDSelector.ClearEveryCheckBox; - //octopusIDSelector.ClearCheckBox = trafficIDSelector.ClearSelection; - octopusIDSelector.ErrorReporter = ReportError; groups = new GroupBox[] { groupSource, groupMetadata, groupTarget, groupActions }; - trafficMetadataSelected = OnTrafficIDSelected; - octopusMetadataSelected = OnOctopusIDSelected; } private void InitializeControlTexts() { @@ -78,6 +72,11 @@ namespace Maestro { } private void InitializeComponents() { + dataGridMessages.AutoGenerateColumns = false; + errorMessageBus.Subscribe(OnMessage); + errorMessageBus.Subscribe(OnMessage); + errorMessageBus.Subscribe(OnMessage); + InitializeMetadata(); InitializeTarget(); InitializeJobs(); @@ -85,17 +84,29 @@ namespace Maestro { InitializeControlTexts(); } + private void OnMessage(IMessage message) { + var pi = message.GetType().GetProperty("Content"); + string text = pi.GetValue(message) as string; + ObjectExtensions.SafeCall(dataGridMessages, () => { + systemMessageBindingSource.Insert(0, new SystemMessage() { Time = DateTime.Now, Message = text }); + ActivateTab(1); + }); + + } + private void InitializeMessages() { - dataGridMessages.Columns.AddRange(new DataGridViewTextBoxColumn() { - AutoSizeMode = DataGridViewAutoSizeColumnMode.DisplayedCells, - DataPropertyName = "Time", - HeaderText = StringResources.IDO - }, - new DataGridViewTextBoxColumn() { - AutoSizeMode = DataGridViewAutoSizeColumnMode.DisplayedCells, - DataPropertyName = "Message", - HeaderText = StringResources.UZENET - }); + //dataGridMessages.Columns.AddRange( + // new DataGridViewTextBoxColumn() { + // AutoSizeMode = DataGridViewAutoSizeColumnMode.DisplayedCells, + // DataPropertyName = "Time", + // HeaderText = StringResources.IDO + // }, + // new DataGridViewTextBoxColumn() { + // AutoSizeMode = DataGridViewAutoSizeColumnMode.DisplayedCells, + // DataPropertyName = "Message", + // HeaderText = StringResources.UZENET + // } + //); } private void InitializeJobs() { @@ -175,50 +186,31 @@ namespace Maestro { InitializeComponents(); } - private void textBox1_KeyUp(object sender, KeyEventArgs e) { - if (e.KeyCode != Keys.Return) - return; - if (String.IsNullOrEmpty(txtSorceFilter.Text)) - bindingSource.RemoveFilter(); - else { - bindingSource.Filter = txtSorceFilter.Text; - } - } - - public void ReportError(DateTime time, String level, String message, Color color) { - ObjectExtensions.SafeCall(tabControl2, () => { - systemMessageBindingSource.Insert(0, new SystemMessage() { Time = time, message = message, Level = level }); - }); - newMSGColor = color; - ActivateTabOnTabControl2(1); - //ObjectExtensions.SafeCall(dataGridMessages, UpdateDataGridMessagesChanged); - } - - private void ActivateTabOnTabControl2(int index) { - ObjectExtensions.SafeCall(tabControl2, () => { tabControl2.SelectedIndex = index; }); - } + //private void textBox1_KeyUp(object sender, KeyEventArgs e) { + // if (e.KeyCode != Keys.Return) + // return; + // if (String.IsNullOrEmpty(txtSorceFilter.Text)) + // bindingSource.RemoveFilter(); + // else { + // bindingSource.Filter = txtSorceFilter.Text; + // } + //} - private void UpdateDataGridMessagesChanged() { - dataGridMessages.DataSource = null; - dataGridMessages.DataSource = systemMessageBindingSource; + private void ActivateTab(int index) { + tabSystem.SelectedIndex = index; } - private void dataGridMessages_RowsAdded(object sender, DataGridViewRowsAddedEventArgs e) { - SystemMessage actual = systemMessageBindingSource.Current as SystemMessage; - if (actual == null) - return; - if (actual.Level.Equals("Error")) { - dataGridMessages.Rows[e.RowIndex].DefaultCellStyle.ForeColor = newMSGColor; - dataGridMessages.Rows[e.RowIndex].DefaultCellStyle.SelectionForeColor = newMSGColor; - } - } + //private void UpdateDataGridMessagesChanged() { + // dataGridMessages.DataSource = null; + // dataGridMessages.DataSource = systemMessageBindingSource; + //} - private void buttonDeleteFilter_Click(object sender, EventArgs e) { - if (!String.IsNullOrEmpty(txtSorceFilter.Text)) { - bindingSource.RemoveFilter(); - txtSorceFilter.Text = string.Empty; - } - } + //private void buttonDeleteFilter_Click(object sender, EventArgs e) { + // if (!String.IsNullOrEmpty(txtSorceFilter.Text)) { + // bindingSource.RemoveFilter(); + // txtSorceFilter.Text = string.Empty; + // } + //} private void dataGridJobs_MouseClick(object sender, MouseEventArgs e) { if (e.Button == MouseButtons.Right && dataGridJobs.SelectedRows.Count == 1) { diff --git a/client/Maestro/MaestroForm.resx b/client/Maestro/MaestroForm.resx index 0592b932..b849583b 100644 --- a/client/Maestro/MaestroForm.resx +++ b/client/Maestro/MaestroForm.resx @@ -153,7 +153,10 @@ 154, 17 - + + True + + True diff --git a/client/Maestro/MeastroFormNotifyIcon.cs b/client/Maestro/MeastroFormNotifyIcon.cs index f5d74d5b..97f8f204 100644 --- a/client/Maestro/MeastroFormNotifyIcon.cs +++ b/client/Maestro/MeastroFormNotifyIcon.cs @@ -2,7 +2,6 @@ using Maestro.Configuration; using Maestro.Sources.Messages; using System; -using System.Threading.Tasks; using System.Windows.Forms; namespace Maestro { diff --git a/client/Maestro/Program.cs b/client/Maestro/Program.cs index 1709bf76..158b8073 100644 --- a/client/Maestro/Program.cs +++ b/client/Maestro/Program.cs @@ -89,8 +89,8 @@ namespace Maestro { CreateForm(file); } if (forms.Count == 0) { - MessageBox.Show("Hiányos konfiguráció!"); - TerminateApplication(); + MessageBox.Show(new Form() { TopMost = true }, "Nincs aktív konfiguráció!"); + //TerminateApplication(); } } @@ -195,8 +195,10 @@ namespace Maestro { foreach (MeastroFormNotifyIcon form in forms) { form.CloseForm(); } - trayIcon.Visible = false; - trayIcon.Dispose(); + if (trayIcon != null) { + trayIcon.Visible = false; + trayIcon.Dispose(); + } Application.Exit(); } } diff --git a/client/Maestro/Properties/AssemblyInfo.cs b/client/Maestro/Properties/AssemblyInfo.cs index c2622b56..f8ce90b3 100644 --- a/client/Maestro/Properties/AssemblyInfo.cs +++ b/client/Maestro/Properties/AssemblyInfo.cs @@ -32,5 +32,5 @@ using System.Runtime.InteropServices; // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.9.0.0")] -[assembly: AssemblyFileVersion("1.9.0.0")] +[assembly: AssemblyVersion("1.9.3.0")] +[assembly: AssemblyFileVersion("1.9.3.0")] diff --git a/client/Maestro/Sources/FileSourceItem.cs b/client/Maestro/Sources/FileSourceItem.cs index 6aab995a..2ade20d0 100644 --- a/client/Maestro/Sources/FileSourceItem.cs +++ b/client/Maestro/Sources/FileSourceItem.cs @@ -95,9 +95,11 @@ namespace Maestro.Sources { public bool CanHandle(List extensions) { - if (extensions == null || extensions.Count < 1) + if (extensions == null || extensions.Count < 1) return true; - if (extensions.Contains(fileInfo.Extension.Substring(1).ToLower()) || extensions.Contains(fileInfo.Extension.Substring(1).ToUpper())) + if (fileInfo == null || String.IsNullOrEmpty(fileInfo.Extension)) + return false; + if (extensions.Contains(fileInfo.Extension.Replace(".", "").ToUpper())) return true; return false; } diff --git a/client/Maestro/Sources/FileSystemSource.cs b/client/Maestro/Sources/FileSystemSource.cs index 632e17f8..1cc5abc6 100644 --- a/client/Maestro/Sources/FileSystemSource.cs +++ b/client/Maestro/Sources/FileSystemSource.cs @@ -117,7 +117,7 @@ namespace Maestro.Sources { private void SetAcceptableExtensions(string fileExtensionFilter) { if (fileExtensionFilter != null) - acceptableExtensions = fileExtensionFilter.Split(',')?.ToList(); + acceptableExtensions = fileExtensionFilter.Split(',')?.Select(i => i.ToUpper().Trim()).ToList(); } public void Startup(Uri address) { @@ -131,7 +131,8 @@ namespace Maestro.Sources { private void InnerStartUp() { createWatch(path); - Task.Run(() => initializeList(path)); + //Task.Run(() => initializeList(path)); + initializeList(path); initialized = true; } @@ -153,8 +154,9 @@ namespace Maestro.Sources { private void initializeList(string path) { string[] files = Directory.GetFiles(path); //files.Select(f => CreateItem(new FileInfo(f), false)).Where(x => x.Name.EndsWith("avi")).OrderByDescending(i => i.Created).ToList().ForEach(i => parent.SafeCall(() => Add(i))); - files.Select(f => CreateItem(new FileInfo(f), false)).Where(x => x.CanHandle(acceptableExtensions)).OrderByDescending(i => i.Created).ToList().ForEach(i => parent.SafeCall(() => Add(i))); - cache.AddRange(this); + var fileSourceItems = files.Select(f => CreateItem(new FileInfo(f), false)).OrderByDescending(i => i.Created); + fileSourceItems.Where(x => x.CanHandle(acceptableExtensions)).ToList().ForEach(i => parent.SafeCall(() => Add(i))); + //cache.AddRange(this); } private void createWatch(string path) { diff --git a/client/Maestro/Sources/NexioRESTSource.cs b/client/Maestro/Sources/NexioRESTSource.cs index 70527951..7e65d23e 100644 --- a/client/Maestro/Sources/NexioRESTSource.cs +++ b/client/Maestro/Sources/NexioRESTSource.cs @@ -11,7 +11,7 @@ using WebSocketSharp; using System; using System.Drawing; using NLog; -using JobEngineClient; +using MediaCubeClient; using System.Collections.Generic; using System.Collections.Concurrent; @@ -81,12 +81,9 @@ namespace Maestro.Sources { public bool SupportsFiltering => true; - private MediaCubeErrorReporter errorReporter; - - public NexioRESTSource(Control parent, IMessageBus messageBus, MediaCubeErrorReporter errorReporter, String agencyFilter) { + public NexioRESTSource(Control parent, IMessageBus messageBus, String agencyFilter) { this.parent = parent; this.messageBus = messageBus; - this.errorReporter = errorReporter; SetAcceptableAgencies(agencyFilter); } @@ -102,7 +99,7 @@ namespace Maestro.Sources { } private void CreateWatch(string path) { - dataClient = new NexioAPI(path) { ErrorReporter = errorReporter }; + dataClient = new NexioAPI(path, messageBus); dataClient.Open(OnResponse); } diff --git a/client/Maestro/Splash.cs b/client/Maestro/Splash.cs index 26f268da..86f5c444 100644 --- a/client/Maestro/Splash.cs +++ b/client/Maestro/Splash.cs @@ -20,7 +20,7 @@ namespace Maestro { Version version = Assembly.GetEntryAssembly().GetName().Version; labelVersion.ForeColor = Color.White; - labelVersion.Text = String.Format("v{0}.{1}.{2}", version.Major, version.Minor, version.Revision); + labelVersion.Text = String.Format("v{0}.{1}.{2}", version.Major, version.Minor, version.Build); } private void splashTimer_Tick(object sender, EventArgs e) { diff --git a/client/Maestro/SystemMessage.cs b/client/Maestro/SystemMessage.cs index 062c05f7..8c88dc05 100644 --- a/client/Maestro/SystemMessage.cs +++ b/client/Maestro/SystemMessage.cs @@ -1,14 +1,8 @@ using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace Maestro { public class SystemMessage { - public DateTime Time { get; set; } - public String message { get; set; } - public String Level { get; set; } + public String Message { get; set; } } } diff --git a/client/Maestro/Targets/FTPTargetProcessor.cs b/client/Maestro/Targets/FTPTargetProcessor.cs index b391febc..b452ddef 100644 --- a/client/Maestro/Targets/FTPTargetProcessor.cs +++ b/client/Maestro/Targets/FTPTargetProcessor.cs @@ -34,7 +34,7 @@ namespace Maestro.Targets { TerminateClient(targetFTP); } - private void DeleteFile(string currentFile) { + protected override void DeleteFile(string currentFile) { targetFTP.DeleteFile(currentFile); } diff --git a/client/Maestro/Targets/UNCTargetProcessor.cs b/client/Maestro/Targets/UNCTargetProcessor.cs index aa50f3b3..b3d4e246 100644 --- a/client/Maestro/Targets/UNCTargetProcessor.cs +++ b/client/Maestro/Targets/UNCTargetProcessor.cs @@ -56,6 +56,7 @@ namespace Maestro.Targets { OutputName = CreateOutputFileName(); OutputName = OutputName.ToUpper(); Output = "/".Equals(workingDir) ? OutputName : Path.Combine(workingDir, OutputName); + Output = Output.Replace(@"\", "/"); workFlowAction.source = Input; workFlowAction.destination = Output; Status = "Folyamatban"; @@ -82,7 +83,7 @@ namespace Maestro.Targets { return result; } - private void DeleteFile(string currentFile) { + protected virtual void DeleteFile(string currentFile) { File.Delete(currentFile); } @@ -110,7 +111,7 @@ namespace Maestro.Targets { CreateMetadata(); if (parameters.TargetConfig.SaveSegments && parameters.Segments != null) //eljuthat-e ide a felhasználó, ha a MetadataKind octopus? - parameters.TrafficApi.SetMaterialInformation(parameters.VariantID, true, (TrafficMetadataType)parameters.MetadataKind, parameters.Segments); + parameters.TrafficApi.UpdateTrafficInformation(parameters.VariantID, true, (TrafficMetadataType)parameters.MetadataKind, parameters.Segments); if (parameters.TargetConfig.SendEmailOnSuccess && !String.IsNullOrEmpty(parameters.TargetConfig.SuccessEmailRecipient) && !String.IsNullOrEmpty(parameters.TargetConfig.SuccessEmailPattern)) SendEmail(parameters.TargetConfig.SuccessEmailRecipient, parameters.TargetConfig.SuccessEmailPattern); Status = "Kész"; @@ -164,8 +165,12 @@ namespace Maestro.Targets { protected String DetermineWorkingDirectory(Connection connection) { string result = null; - if (parameters.TargetConfig.CreateSubFolder) + if (parameters.TargetConfig.CreateSubFolder) { + string subDir = ID; + if (ID.Contains("_")) + subDir = ID.Split('_')[0]; result = Path.Combine(connection.Address.LocalPath, ID); + } else result = connection.Address.LocalPath; return result; diff --git a/client/MediaCubeClient/MediaCubeApi.cs b/client/MediaCubeClient/MediaCubeApi.cs index ed3e45c9..4984faef 100644 --- a/client/MediaCubeClient/MediaCubeApi.cs +++ b/client/MediaCubeClient/MediaCubeApi.cs @@ -1,4 +1,3 @@ -using Model; using Newtonsoft.Json; using Newtonsoft.Json.Serialization; using NLog; @@ -8,11 +7,15 @@ using System; using System.Diagnostics; using System.Net; using System.Runtime.Serialization; -using System.Drawing; +using LinkDotNet.MessageHandling.Contracts; -namespace JobEngineClient { - - public delegate void MediaCubeErrorReporter(DateTime time, String level, String message, Color color); +namespace MediaCubeClient { + public class MediaCubeMessage : IMessage { + public MediaCubeMessage(string message) { + Content = message; + } + public string Content { get; set; } + } public class MediaCubeApi { private const string DATEFORMAT = "yyyy'-'MM'-'dd'T'HH':'mm':'ssK"; @@ -21,11 +24,12 @@ namespace JobEngineClient { private JsonSerializerSettings serializerSettings; private string user; private string pwd; - public MediaCubeErrorReporter ErrorReporter { get; set; } + private IMessageBus messageBus; - public MediaCubeApi(string address, string user, string pwd, int timeout) { + public MediaCubeApi(string address, string user, string pwd, int timeout, IMessageBus messageBus) { this.user = user; this.pwd = pwd; + this.messageBus = messageBus; client = new RestClient(address) { Authenticator = new HttpBasicAuthenticator(user, pwd), Timeout = timeout @@ -37,7 +41,6 @@ namespace JobEngineClient { }; } - public T Create(object data) { var request = new RestRequest("create", Method.POST); String body = JsonConvert.SerializeObject(data, serializerSettings); @@ -45,7 +48,7 @@ namespace JobEngineClient { request.AddParameter("application/json", body, ParameterType.RequestBody); var response = client.Execute(request); if (response.StatusCode != HttpStatusCode.OK && response.ErrorMessage != null) { - ErrorReporter?.Invoke(DateTime.Now, "Error", String.Format("[MediaCube] {0}", response.ErrorMessage), Color.Red); + messageBus.Send(new MediaCubeMessage("Sikertelen kapcsolódás a MediaCube rendszerhez.")); return default(T); } //Debug.WriteLine(response.Content); diff --git a/client/MediaCubeClient/MediaCubeClient.csproj b/client/MediaCubeClient/MediaCubeClient.csproj index 52b170f5..0acbde7d 100644 --- a/client/MediaCubeClient/MediaCubeClient.csproj +++ b/client/MediaCubeClient/MediaCubeClient.csproj @@ -77,6 +77,9 @@ MinimumRecommendedRules.ruleset + + ..\packages\LinkDotNet.MessageBus.Contracts.0.1.1\lib\LinkDotNet.MessageHandling.Contracts.dll + ..\packages\Newtonsoft.Json.10.0.3\lib\net45\Newtonsoft.Json.dll @@ -101,8 +104,6 @@ - - diff --git a/client/MediaCubeClient/NexioAPI.cs b/client/MediaCubeClient/NexioAPI.cs index 9d579b09..546617b7 100644 --- a/client/MediaCubeClient/NexioAPI.cs +++ b/client/MediaCubeClient/NexioAPI.cs @@ -2,7 +2,8 @@ using Newtonsoft.Json.Linq; using System; using System.Diagnostics; using WebSocketSharp; -using JobEngineClient; +using LinkDotNet.MessageHandling.Contracts; +using MediaCubeClient; namespace NexioClient { public class NexioAPI { @@ -14,9 +15,11 @@ namespace NexioClient { public const string UPDATE = "update"; private WebSocket ws = null; private string path; - public MediaCubeErrorReporter ErrorReporter { get; set; } - public NexioAPI(String path) { + private IMessageBus messageBus; + + public NexioAPI(String path, IMessageBus messageBus) { this.path = path; + this.messageBus = messageBus; } public void Close() { @@ -26,37 +29,32 @@ namespace NexioClient { } public void Open(EventHandler p) { - try - { - ws = new WebSocket(path); - - ws.SslConfiguration.ServerCertificateValidationCallback = (s, c, ch, e) => - { - return true; - }; + ws = new WebSocket(path); - ws.OnOpen += (sender, e) => - { - Debug.WriteLine("OnOpen"); - }; + ws.SslConfiguration.ServerCertificateValidationCallback = (s, c, ch, e) => { + return true; + }; - ws.OnMessage += (sender, e) => - { - Debug.WriteLine("OnMessage: " + e.Data); - }; - ws.OnMessage += p; + ws.OnOpen += (sender, e) => { + Debug.WriteLine("OnOpen"); + }; - ws.OnError += (sender, e) => - Debug.WriteLine("OnError: " + e.Message); + ws.OnMessage += (sender, e) => { + Debug.WriteLine("OnMessage: " + e.Data); + }; + ws.OnMessage += p; - ws.OnClose += (sender, e) => - Debug.WriteLine("OnClose: " + e.Reason); + ws.OnError += (sender, e) => + Debug.WriteLine("OnError: " + e.Message); + ws.OnClose += (sender, e) => + Debug.WriteLine("OnClose: " + e.Reason); + try { ws.Connect(); } catch (Exception e) { - ErrorReporter?.Invoke(DateTime.Now, "Error", String.Format("[NexioAPI] {0}", e.Message), System.Drawing.Color.Red); - } + messageBus.Send(new MediaCubeMessage("Sikertelen kapcsolódás a MediaCube NEXIO szolgáltatásához.")); + } } public void GetListAsync() { @@ -66,7 +64,7 @@ namespace NexioClient { ws.Send(data.ToString()); } catch (Exception e) { - ErrorReporter?.Invoke(DateTime.Now, "Error", String.Format("[NexioAPI] {0}", e.Message), System.Drawing.Color.Red); + messageBus.Send(new MediaCubeMessage("Sikertelen inicializálás a MediaCube NEXIO szolgáltatásában.")); } } diff --git a/client/MediaCubeClient/NotificationMessage.cs b/client/MediaCubeClient/NotificationMessage.cs deleted file mode 100644 index d0bf2373..00000000 --- a/client/MediaCubeClient/NotificationMessage.cs +++ /dev/null @@ -1,23 +0,0 @@ -using System; - -namespace NexioClient { - internal class NotificationMessage - { - public string Body { - get; set; - } - - public string Icon { - get; set; - } - - public string Summary { - get; set; - } - - public override string ToString () - { - return String.Format ("{0}: {1}", Summary, Body); - } - } -} diff --git a/client/MediaCubeClient/Notifier.cs b/client/MediaCubeClient/Notifier.cs deleted file mode 100644 index a598e53e..00000000 --- a/client/MediaCubeClient/Notifier.cs +++ /dev/null @@ -1,82 +0,0 @@ -#if UBUNTU -using Notifications; -#endif -using System; -using System.Collections; -using System.Collections.Generic; -using System.Diagnostics; -using System.Threading; - -namespace NexioClient { - internal class Notifier : IDisposable - { - private volatile bool _enabled; - private ManualResetEvent _exited; - private Queue _queue; - private object _sync; - - public Notifier () - { - _enabled = true; - _exited = new ManualResetEvent (false); - _queue = new Queue (); - _sync = ((ICollection) _queue).SyncRoot; - - ThreadPool.QueueUserWorkItem ( - state => { - while (_enabled || Count > 0) { - var msg = dequeue (); - if (msg != null) { -#if UBUNTU - var nf = new Notification (msg.Summary, msg.Body, msg.Icon); - nf.AddHint ("append", "allowed"); - nf.Show (); -#else - Debug.WriteLine (msg); - -#endif - } - else { - Thread.Sleep (500); - } - } - - _exited.Set (); - } - ); - } - - public int Count { - get { - lock (_sync) - return _queue.Count; - } - } - - private NotificationMessage dequeue () - { - lock (_sync) - return _queue.Count > 0 ? _queue.Dequeue () : null; - } - - public void Close () - { - _enabled = false; - _exited.WaitOne (); - _exited.Close (); - } - - public void Notify (NotificationMessage message) - { - lock (_sync) { - if (_enabled) - _queue.Enqueue (message); - } - } - - void IDisposable.Dispose () - { - Close (); - } - } -} diff --git a/client/MediaCubeClient/packages.config b/client/MediaCubeClient/packages.config index fa223e74..0693a580 100644 --- a/client/MediaCubeClient/packages.config +++ b/client/MediaCubeClient/packages.config @@ -1,5 +1,6 @@  + diff --git a/client/OctopusClient/OctopusAPI.cs b/client/OctopusClient/OctopusAPI.cs index 36c05557..1123ee7c 100644 --- a/client/OctopusClient/OctopusAPI.cs +++ b/client/OctopusClient/OctopusAPI.cs @@ -1,4 +1,5 @@ -using Newtonsoft.Json.Linq; +using LinkDotNet.MessageHandling.Contracts; +using Newtonsoft.Json.Linq; using NLog; using RestSharp; using RestSharp.Authenticators; @@ -61,22 +62,27 @@ namespace OctopusClient { } public class OctopusAPI { - public const string UNNAMED = ""; - private static Logger logger = LogManager.GetCurrentClassLogger(); + public const string UNNAMED = ""; private RestClient client; private string user; private string pwd; - private OctopusErrorReporterDelegate errorRiporter; + private IMessageBus messageBus; - public OctopusAPI(string address, string user, string pwd, int timeout, OctopusErrorReporterDelegate errorRiporter) { + public OctopusAPI(string address, string user, string pwd, int timeout, IMessageBus messageBus) { this.user = user; this.pwd = pwd; client = new RestClient(address) { Authenticator = new HttpBasicAuthenticator(user, pwd), Timeout = timeout }; - this.errorRiporter = errorRiporter; + this.messageBus = messageBus; + } + + private void OnError(Exception e) { + logger.Error(e); + if (messageBus != null) + messageBus.Send(new OctopusAPIMessage("Sikertelen kapcsolódás a MediaCube OCTOPUS szolgáltatásához.")); } public IEnumerable GetRundowns(DateTime scheduledDate) { @@ -104,13 +110,12 @@ namespace OctopusClient { }); } catch (Exception e) { - errorRiporter?.Invoke(DateTime.Now, "Error", e.Message, System.Drawing.Color.Red); - return result; + OnError(e); } return result; } - public IEnumerable GetStories(string rundownID) { + public IEnumerable GetRundownStories(string rundownID) { IEnumerable result = null; try { var request = new RestRequest("stories/{rundownID}", Method.GET); @@ -128,7 +133,7 @@ namespace OctopusClient { Story r = new Story { ID = d["id"].ToString(), Name = d["name"].ToString(), - MosObjects = objs.ToArray() + MosObjects = objs?.ToArray() }; if (d["script"] != null) r.Script = d["script"].ToString(); @@ -143,12 +148,12 @@ namespace OctopusClient { }); } catch (Exception e) { - errorRiporter?.Invoke(DateTime.Now, "Error", e.Message, System.Drawing.Color.Red); + OnError(e); } return result; } - public IEnumerable GetStoriesByStoryFolderID(string storyFolderID) { + public IEnumerable GetStoryFolderStories(string storyFolderID) { IEnumerable result = null; try { var request = new RestRequest("storiesByStoryFolderID/{storyFolderID}", Method.GET); @@ -166,7 +171,7 @@ namespace OctopusClient { Story r = new Story { ID = d["id"].ToString(), Name = d["name"].ToString(), - MosObjects = objs.ToArray() + MosObjects = objs?.ToArray() }; if (d["script"] != null) { r.Script = d["script"].ToString(); @@ -182,7 +187,7 @@ namespace OctopusClient { }); } catch (Exception e) { - errorRiporter?.Invoke(DateTime.Now, "Error", e.Message, System.Drawing.Color.Red); + OnError(e); } return result; } @@ -208,7 +213,10 @@ namespace OctopusClient { } private List GetMosObjectsFromStory(JToken d) { - JToken[] array = d["mosObjects"].ToArray(); + JToken mosObjects = d["mosObjects"]; + if (mosObjects == null) + return null; + JToken[] array = mosObjects.ToArray(); List objs = new List(); foreach (JToken token in array) { MosObject mosObject = new MosObject() { @@ -246,7 +254,7 @@ namespace OctopusClient { }); } catch (Exception e) { - errorRiporter?.Invoke(DateTime.Now, "Error", e.Message, System.Drawing.Color.Red); + OnError(e); } return result; } @@ -279,7 +287,7 @@ namespace OctopusClient { }); } catch (Exception e) { - errorRiporter?.Invoke(DateTime.Now, "Error", e.Message, System.Drawing.Color.Red); + OnError(e); } return result; } @@ -314,7 +322,7 @@ namespace OctopusClient { }); } catch (Exception e) { - errorRiporter?.Invoke(DateTime.Now, "Error", e.Message, System.Drawing.Color.Red); + OnError(e); } return result; } @@ -343,7 +351,7 @@ namespace OctopusClient { }); } catch (Exception e) { - errorRiporter?.Invoke(DateTime.Now, "Error", e.Message, System.Drawing.Color.Red); + OnError(e); } return result; } @@ -373,7 +381,7 @@ namespace OctopusClient { }); } catch (Exception e) { - errorRiporter?.Invoke(DateTime.Now, "Error", e.Message, System.Drawing.Color.Red); + OnError(e); } return result; } @@ -405,7 +413,7 @@ namespace OctopusClient { }); } catch (Exception e) { - errorRiporter?.Invoke(DateTime.Now, "Error", e.Message, System.Drawing.Color.Red); + OnError(e); } return result; } @@ -434,7 +442,7 @@ namespace OctopusClient { }); } catch (Exception e) { - errorRiporter?.Invoke(DateTime.Now, "Error", e.Message, System.Drawing.Color.Red); + OnError(e); } return result; } @@ -462,7 +470,7 @@ namespace OctopusClient { }); } catch (Exception e) { - errorRiporter?.Invoke(DateTime.Now, "Error", e.Message, System.Drawing.Color.Red); + OnError(e); } return result; } @@ -501,7 +509,7 @@ namespace OctopusClient { }); } catch (Exception e) { - errorRiporter?.Invoke(DateTime.Now, "Error", e.Message, System.Drawing.Color.Red); + OnError(e); } return result; } diff --git a/client/OctopusClient/OctopusClient.csproj b/client/OctopusClient/OctopusClient.csproj index 387dd87f..ae78894e 100644 --- a/client/OctopusClient/OctopusClient.csproj +++ b/client/OctopusClient/OctopusClient.csproj @@ -73,6 +73,9 @@ MinimumRecommendedRules.ruleset + + ..\packages\LinkDotNet.MessageBus.Contracts.0.1.1\lib\LinkDotNet.MessageHandling.Contracts.dll + ..\packages\Newtonsoft.Json.10.0.3\lib\net45\Newtonsoft.Json.dll diff --git a/client/OctopusClient/OctopusConfiguration.cs b/client/OctopusClient/OctopusConfiguration.cs index ada632c8..96c0b312 100644 --- a/client/OctopusClient/OctopusConfiguration.cs +++ b/client/OctopusClient/OctopusConfiguration.cs @@ -1,4 +1,5 @@ -using System; +using LinkDotNet.MessageHandling.Contracts; +using System; namespace OctopusClient { public class OctopusConfiguration { @@ -6,5 +7,6 @@ namespace OctopusClient { public string UserName { get; set; } public string Password { get; set; } public int Timeout; + public IMessageBus MessageBus { get; set; } } } diff --git a/client/OctopusClient/OctopusIDSelector.cs b/client/OctopusClient/OctopusIDSelector.cs index 425250f8..319fc497 100644 --- a/client/OctopusClient/OctopusIDSelector.cs +++ b/client/OctopusClient/OctopusIDSelector.cs @@ -4,15 +4,11 @@ using System.Linq; using System.Windows.Forms; using System.Collections.Generic; using System.ComponentModel; -using System.Drawing; using System.Runtime.InteropServices; +using LinkDotNet.MessageHandling.Contracts; namespace OctopusClient { public delegate void OnSelectedIDChanged(string id, string name); - public delegate void ClearCheckBox(); - public delegate void OctopusErrorReporterDelegate(DateTime time, String level, String message, Color color); - - public partial class OctopusIDSelector : UserControl { private static Logger logger = LogManager.GetCurrentClassLogger(); @@ -21,14 +17,12 @@ namespace OctopusClient { private int selectedRundownIndex = -1; private TreeNode selectedNode; private OctopusAPI client; - - public OctopusErrorReporterDelegate ErrorReporter { get; set; } public OnSelectedIDChanged IDChangedEvent { get; set; } public OctopusConfiguration Configuration { set { - client = new OctopusAPI(value.Address.OriginalString, value.UserName, value.Password, value.Timeout, ErrorReporter); - refreshStoryFolders(); + client = new OctopusAPI(value.Address.OriginalString, value.UserName, value.Password, value.Timeout, value.MessageBus); + //refreshStoryFolders(); refreshRundowns(); } } @@ -37,6 +31,22 @@ namespace OctopusClient { InitializeComponent(); InitializeControlTexts(); treeOctopus.AfterCheck += OnTreeAfterCheck; + + //treeOctopus.DrawMode = TreeViewDrawMode.OwnerDrawText; + //treeOctopus.DrawNode += new DrawTreeNodeEventHandler(OnDrawNode); + } + + void OnDrawNode(object sender, DrawTreeNodeEventArgs e) { + //if ((e.State & TreeNodeStates.Selected) == TreeNodeStates.Selected) { + // Graphics g = e.Graphics; + // using (SolidBrush brush = new SolidBrush(Color.Gainsboro)) { + // e.Graphics.FillRectangle(brush, e.Bounds.X, e.Bounds.Y, e.Bounds.Width, e.Bounds.Height); + // } + // TextRenderer.DrawText(e.Graphics, e.Node.Text, treeOctopus.Font, e.Bounds, treeOctopus.ForeColor, TextFormatFlags.Left | TextFormatFlags.Top); + //} else { + // e.DrawDefault = true; + //} + e.DrawDefault = true; } private void InitializeControlTexts() { @@ -60,21 +70,28 @@ namespace OctopusClient { if (rundown == null) return; logger.Info("Selected rundown {0} {1}", rundown.ID, rundown.Name); - IEnumerable stories = client.GetStories(rundown.ID); - if (stories != null) - foreach (var story in stories) { - string name = story.Name == null ? "" : story.Name; - TreeNode actualNode = treeOctopus.Nodes.Add(story.ID, String.Format($"{story.ID} {story.Name}")); - HideCheckBox(treeOctopus, actualNode); - MosObject[] mosObjects = story.MosObjects; - foreach (MosObject mosObject in mosObjects) { - TreeNode node = actualNode.Nodes.Add(mosObject.ObjID, String.Format($"{mosObject.ID} {mosObject.ObjID}")); - node.Tag = mosObject.ID; - } - } + IEnumerable stories = client.GetRundownStories(rundown.ID); + if (stories == null) + return; + AddStories(stories); selectedRundownIndex = comboRudowns.SelectedIndex; } + private void AddStories(IEnumerable stories) { + foreach (var story in stories) { + string name = story.Name == null ? "" : story.Name; + TreeNode actualNode = treeOctopus.Nodes.Add(story.ID, String.Format($"{story.ID} {story.Name}")); + HideCheckBox(treeOctopus, actualNode); + MosObject[] mosObjects = story.MosObjects; + if (mosObjects == null) + continue; + foreach (MosObject mosObject in mosObjects) { + TreeNode node = actualNode.Nodes.Add(mosObject.ObjID, String.Format($"{mosObject.ObjID}")); + node.Tag = mosObject.ID; + } + } + } + private void comboStoryFolder_SelectedValueChanged(object sender, EventArgs e) { StoryFolder storyFolder = comboStoryFolder.SelectedValue as StoryFolder; if (storyFolder == null) @@ -83,18 +100,10 @@ namespace OctopusClient { logger.Info("Selected StoryFolder {0} {1}", storyFolder.ID, storyFolder.Name); if (storyFolder.ID.Equals("0")) return; - var stories = client.GetStoriesByStoryFolderID(storyFolder.ID); + var stories = client.GetStoryFolderStories(storyFolder.ID); if (stories == null) return; - foreach (var story in stories) { - TreeNode actualNode = treeOctopus.Nodes.Add(story.ID, String.Format($"{story.ID} {story.Name}")); - HideCheckBox(treeOctopus, actualNode); - MosObject[] mosObjects = story.MosObjects; - foreach (MosObject mosObject in mosObjects) { - TreeNode node = actualNode.Nodes.Add(mosObject.ObjID, String.Format($"{mosObject.ID} {mosObject.ObjID}")); - node.Tag = mosObject.ID; - } - } + AddStories(stories); selectedStoryFolderIndex = comboStoryFolder.SelectedIndex; } @@ -103,16 +112,12 @@ namespace OctopusClient { Cursor.Current = Cursors.WaitCursor; IEnumerable rundowns = client.GetRundowns(dateScheduled.Value)?.ToArray(); if (rundowns == null) { - bindingRundown.Remove(Resources.VALASSZON_ELEMET); + bindingRundown.DataSource = null; Cursor.Current = Cursors.Default; return; } BindingList bindingRundowns = new BindingList(); bindingRundowns.Add(new Rundown() { ID = 0.ToString(), Name = Resources.VALASSZON_ELEMET }); - if (rundowns == null) { - Cursor.Current = Cursors.Default; - return; - } foreach (Rundown actualRundown in rundowns) bindingRundowns.Add(actualRundown); bindingRundown.DataSource = bindingRundowns; @@ -135,7 +140,7 @@ namespace OctopusClient { bindingStoryFolders.Add(actualStoryFolder); bindingStoryFolder.DataSource = bindingStoryFolders; comboStoryFolder.SelectedIndex = selectedStoryFolderIndex == -1 ? 0 : selectedStoryFolderIndex; - InitCheckID(treeOctopus.Nodes); + InitCheckID(treeOctopus.Nodes); } private void InitCheckID(TreeNodeCollection collection) { @@ -180,7 +185,7 @@ namespace OctopusClient { private void RefreshPlaceHolderIDS(String ID) { treeOctopus.Nodes.Clear(); - var stories = client.GetStoriesByStoryFolderID(ID); + var stories = client.GetStoryFolderStories(ID); if (stories == null) return; foreach (var story in stories) @@ -267,4 +272,11 @@ namespace OctopusClient { SendMessage(tvw.Handle, TVM_SETITEM, IntPtr.Zero, ref tvi); } } + + public class OctopusAPIMessage : IMessage { + public OctopusAPIMessage(string message) { + Content = message; + } + public string Content { get; set; } + } } diff --git a/client/OctopusClient/packages.config b/client/OctopusClient/packages.config index fa223e74..0693a580 100644 --- a/client/OctopusClient/packages.config +++ b/client/OctopusClient/packages.config @@ -1,5 +1,6 @@  + diff --git a/client/PlanAIRClient/TrafficAPI.cs b/client/PlanAIRClient/TrafficAPI.cs index ea8ea366..c327fce4 100644 --- a/client/PlanAIRClient/TrafficAPI.cs +++ b/client/PlanAIRClient/TrafficAPI.cs @@ -4,6 +4,7 @@ using System.Data; using System.Data.SqlClient; using NLog; using TrafficClient.Workers; +using LinkDotNet.MessageHandling.Contracts; namespace TrafficClient { public class TrafficAPI { @@ -17,14 +18,14 @@ namespace TrafficClient { private ADWorker adWorker; private SegmentWorker segmentWorker; - public TrafficAPI(string connString, string user, string password, int timeout, TrafficErrorReporterDelegate errorReporter) { + public TrafficAPI(string connString, string user, string password, int timeout, IMessageBus messageBus) { connectionString = String.Format("{0};User ID={1};Password={2};Connection Timeout={3}", connString, user, password, timeout/1000); connection = new SqlConnection(connectionString); cliFSPReader = new CliFSPReader(); - broadcastWorker = new MaterialWorker(connection, cliFSPReader, errorReporter); - promoWorker = new PromoWorker(connection, cliFSPReader, errorReporter); - adWorker = new ADWorker(connection, cliFSPReader, errorReporter); - segmentWorker = new SegmentWorker(connection, cliFSPReader, errorReporter); + broadcastWorker = new MaterialWorker(connection, cliFSPReader, messageBus); + promoWorker = new PromoWorker(connection, cliFSPReader, messageBus); + adWorker = new ADWorker(connection, cliFSPReader, messageBus); + segmentWorker = new SegmentWorker(connection, cliFSPReader, messageBus); } public List GetMaterials(string strParam, bool problematic, DateTime? from = null, DateTime? to = null) { @@ -35,31 +36,26 @@ namespace TrafficClient { return broadcastWorker.GetMaterialArchiveMetadata(strParam); } - public void SetMaterialInformation(int itemID, bool ready, TrafficMetadataType kind, List segments) { + public void UpdateTrafficInformation(int itemID, bool ready, TrafficMetadataType kind, List segments) { switch (kind) { case TrafficMetadataType.TrafficMaterial: { broadcastWorker.SetMaterialOK(itemID, false); segmentWorker.DeleteMaterialSegments(itemID); foreach (Segment actualSegment in segments) - AddSegmentToCopia(itemID, actualSegment); + segmentWorker.AddMaterialSegment(itemID, actualSegment); broadcastWorker.SetMaterialOK(itemID, ready); break; } case TrafficMetadataType.TrafficAD: { - adWorker.SetADOK(itemID, false); - segmentWorker.DeleteMaterialSegments(itemID); if (segments != null && segments.Count == 1) - AddSegmentToCopia(itemID, segments[0]); - broadcastWorker.SetMaterialOK(itemID, ready); + segmentWorker.AddADSegment(itemID, segments[0]); + adWorker.SetADOK(itemID, true); break; } case TrafficMetadataType.TrafficPromo: { - promoWorker.SetPromoOK(itemID, false); - segmentWorker.DeleteMaterialSegments(itemID); - //ensurevisible-be rávizsgálni + promoWorker.SetPromoOK(itemID, true); if (segments != null && segments.Count == 1) - AddSegmentToCopia(itemID, segments[0]); - broadcastWorker.SetMaterialOK(itemID, ready); + segmentWorker.AddPromoSegment(itemID, segments[0]); break; } } @@ -69,7 +65,7 @@ namespace TrafficClient { return promoWorker.GetPromos(search, problematic); } - public List GetPromoMetadata(string strParam) { + public List GetPromoArchiveMetadata(string strParam) { return promoWorker.GetPromoArchiveMetadata(strParam); } @@ -77,11 +73,11 @@ namespace TrafficClient { return adWorker.GetADs(search, problematic); } - public List GetADMetadata(string strParam) { + public List GetADArchiveMetadata(string strParam) { return adWorker.GetADArchiveMetadata(strParam); } - public List GetBroadcastSegments(int itemID) { + public List GetMaterialSegments(int itemID) { return segmentWorker.GetMaterialSegments(itemID); } @@ -89,20 +85,20 @@ namespace TrafficClient { return segmentWorker.GetPromoSegments(strParam); } - public List GetAdvertisementSegments(string strParam) { + public List GetADSegments(string strParam) { return segmentWorker.GetADSegments(strParam); } - public void DeleteSegments(int itemID) { - segmentWorker.DeleteMaterialSegments(itemID); - } + //public void DeleteMaterialSegments(int itemID) { + // segmentWorker.DeleteMaterialSegments(itemID); + //} - public void DeleteSegment(int itemID, int segmentID) { - segmentWorker.DeleteMaterialSegment(itemID, segmentID); - } + //public void DeleteMaterialSegment(int itemID, int segmentID) { + // segmentWorker.DeleteMaterialSegment(itemID, segmentID); + //} - public void AddSegmentToCopia(int itemID, Segment segment) { - segmentWorker.AddSegment(itemID, segment); - } + //public void AddMaterialSegment(int itemID, Segment segment) { + // segmentWorker.AddMaterialSegment(itemID, segment); + //} } } diff --git a/client/PlanAIRClient/TrafficClient.csproj b/client/PlanAIRClient/TrafficClient.csproj index 72711661..e0678caf 100644 --- a/client/PlanAIRClient/TrafficClient.csproj +++ b/client/PlanAIRClient/TrafficClient.csproj @@ -70,6 +70,9 @@ MinimumRecommendedRules.ruleset + + ..\packages\LinkDotNet.MessageBus.Contracts.0.1.1\lib\LinkDotNet.MessageHandling.Contracts.dll + ..\packages\NLog.4.4.11\lib\net45\NLog.dll @@ -139,6 +142,7 @@ + Always @@ -154,7 +158,7 @@ SettingsSingleFileGenerator Settings.Designer.cs - + UserControl diff --git a/client/PlanAIRClient/TrafficConfiguration.cs b/client/PlanAIRClient/TrafficConfiguration.cs index 9c5d76a0..a177a5ce 100644 --- a/client/PlanAIRClient/TrafficConfiguration.cs +++ b/client/PlanAIRClient/TrafficConfiguration.cs @@ -1,17 +1,12 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; +using LinkDotNet.MessageHandling.Contracts; +using System; -namespace TrafficClient -{ - public class TrafficConfiguration - { +namespace TrafficClient { + public class TrafficConfiguration { public Uri Address { get; set; } public string UserName { get; set; } public string Password { get; set; } public int Timeout; - public TrafficErrorReporterDelegate ErrorReporter { get; set; } + public IMessageBus MessageBus { get; set; } } } diff --git a/client/PlanAIRClient/TrafficIDSelector.Designer.cs b/client/PlanAIRClient/TrafficIDSelector.Designer.cs index c695220f..726e25e5 100644 --- a/client/PlanAIRClient/TrafficIDSelector.Designer.cs +++ b/client/PlanAIRClient/TrafficIDSelector.Designer.cs @@ -94,6 +94,7 @@ this.dgTraffic.DefaultCellStyle = dataGridViewCellStyle2; this.dgTraffic.Dock = System.Windows.Forms.DockStyle.Fill; this.dgTraffic.EditMode = System.Windows.Forms.DataGridViewEditMode.EditProgrammatically; + this.dgTraffic.EnableHeadersVisualStyles = false; this.dgTraffic.Location = new System.Drawing.Point(0, 0); this.dgTraffic.MultiSelect = false; this.dgTraffic.Name = "dgTraffic"; diff --git a/client/PlanAIRClient/TrafficIDSelector.cs b/client/PlanAIRClient/TrafficIDSelector.cs index e125561d..555549c4 100644 --- a/client/PlanAIRClient/TrafficIDSelector.cs +++ b/client/PlanAIRClient/TrafficIDSelector.cs @@ -1,18 +1,16 @@ using System.Windows.Forms; using System; -using System.Drawing; using System.Collections.Generic; using System.Diagnostics; +using LinkDotNet.MessageHandling.Contracts; namespace TrafficClient { public delegate void OnSelectedIDChanged(string ID, int variantID); - public delegate void TrafficErrorReporterDelegate(DateTime time, String level, String message, Color color); public partial class TrafficIDSelector : UserControl { public TrafficAPI trafficAPI { get; private set; } public OnSelectedIDChanged IDChangedEvent { get; set; } private DataGridViewCheckBoxCell selectedCell; - public TrafficErrorReporterDelegate ErrorReporter { get; set; } public TrafficIDSelector() { InitializeComponent(); @@ -40,7 +38,7 @@ namespace TrafficClient { public TrafficConfiguration Configuration { set { - trafficAPI = new TrafficAPI(value.Address.OriginalString, value.UserName, value.Password, value.Timeout, value.ErrorReporter); + trafficAPI = new TrafficAPI(value.Address.OriginalString, value.UserName, value.Password, value.Timeout, value.MessageBus); } } @@ -156,4 +154,11 @@ namespace TrafficClient { public string EpisodeDescription { get; set; } public string EpisodeID { get; set; } } + + public class TrafficAPIMessage : IMessage { + public TrafficAPIMessage(string message) { + Content = message; + } + public string Content { get; set; } + } } diff --git a/client/PlanAIRClient/TrafficIDSelector.Columns.cs b/client/PlanAIRClient/TrafficIDSelectorColumns.cs similarity index 100% rename from client/PlanAIRClient/TrafficIDSelector.Columns.cs rename to client/PlanAIRClient/TrafficIDSelectorColumns.cs diff --git a/client/PlanAIRClient/Workers/ADWorker.cs b/client/PlanAIRClient/Workers/ADWorker.cs index fa44b872..2e718cb2 100644 --- a/client/PlanAIRClient/Workers/ADWorker.cs +++ b/client/PlanAIRClient/Workers/ADWorker.cs @@ -3,14 +3,15 @@ using System.Collections.Generic; using System.Data; using System.Data.SqlClient; using NLog; +using LinkDotNet.MessageHandling.Contracts; namespace TrafficClient.Workers { public class ADWorker : TrafficWorker { private static Logger logger = LogManager.GetCurrentClassLogger(); - public ADWorker(SqlConnection connection, CliFSPReader cliFSPReader, TrafficErrorReporterDelegate errorReporter) : - base(connection, cliFSPReader, errorReporter) { + public ADWorker(SqlConnection connection, CliFSPReader cliFSPReader, IMessageBus messageBus) : + base(connection, cliFSPReader, messageBus) { } private TrafficItem ToTrafficItem(clIFsp_EC_MAMAdvertismentResult data) { @@ -55,8 +56,7 @@ namespace TrafficClient.Workers { } } catch (Exception e) { - logger.Error(e.Message); - errorReporter?.Invoke(DateTime.Now, "Error", String.Format("[Traffic] {0}", e.Message), System.Drawing.Color.Red); + OnError(logger, e); } finally { connection.Close(); @@ -64,6 +64,16 @@ namespace TrafficClient.Workers { return result; } + /* + -- 3100: Reklámspot adatainak módosítása + -- ItemID: Reklámspot ID (tbl_CommSpot.t_SpotID) + -- Options=Null esetén nem módosítja az Options által módosítandó adatokat + -- Options & 1: Spot adásra kész (t_OKForAir) + -- IntParam1: TcIn (frame-ben) + -- IntParam2: TcOut (frame-ben) (Duration-t nem kell megadni, majd számítjuk) + -- IntParam3 (opcionális): aspect ratio + -- StrParam1(opcionális): kulcsszavak + */ public void SetADOK(int itemID, bool ok) { try { TryConnect(); @@ -73,12 +83,13 @@ namespace TrafficClient.Workers { cmd.Parameters.AddWithValue("@Operation", 3100); cmd.Parameters.AddWithValue("@@ItemID", itemID); cmd.Parameters.AddWithValue("@@@Options", options); + cmd.Parameters.AddWithValue("@@IntParam1", DBNull.Value); + cmd.Parameters.AddWithValue("@@IntParam2", DBNull.Value); cmd.ExecuteNonQuery(); } } catch (Exception e) { - logger.Error(e.Message); - errorReporter?.Invoke(DateTime.Now, "Error", String.Format("[Traffic] {0}", e.Message), System.Drawing.Color.Red); + OnError(logger, e); } finally { connection.Close(); @@ -106,8 +117,7 @@ namespace TrafficClient.Workers { } } catch (Exception e) { - logger.Error(e.Message); - errorReporter?.Invoke(DateTime.Now, "Error", String.Format("[Traffic] {0}", e.Message), System.Drawing.Color.Red); + OnError(logger, e); } finally { connection.Close(); diff --git a/client/PlanAIRClient/Workers/MaterialWorker.cs b/client/PlanAIRClient/Workers/MaterialWorker.cs index 8f3f47f8..093c6cc0 100644 --- a/client/PlanAIRClient/Workers/MaterialWorker.cs +++ b/client/PlanAIRClient/Workers/MaterialWorker.cs @@ -4,6 +4,7 @@ using System.Data; using System.Data.SqlClient; using NLog; using System.Diagnostics; +using LinkDotNet.MessageHandling.Contracts; namespace TrafficClient.Workers { @@ -11,8 +12,8 @@ namespace TrafficClient.Workers { private static Logger logger = LogManager.GetCurrentClassLogger(); - public MaterialWorker(SqlConnection connection, CliFSPReader cliFSPReader, TrafficErrorReporterDelegate errorReporter) - : base(connection, cliFSPReader, errorReporter){ + public MaterialWorker(SqlConnection connection, CliFSPReader cliFSPReader, IMessageBus messageBus) + : base(connection, cliFSPReader, messageBus) { } private TrafficItem ToTrafficItem(clIFsp_EC_MAMBradocastResult data) { @@ -69,8 +70,7 @@ namespace TrafficClient.Workers { } } catch (Exception e) { - logger.Error(e.Message); - errorReporter?.Invoke(DateTime.Now, "Error", String.Format("[Traffic] {0}", e.Message), System.Drawing.Color.Red); + OnError(logger, e); } finally { connection.Close(); @@ -102,8 +102,7 @@ namespace TrafficClient.Workers { } } catch (Exception e) { - logger.Error(e.Message); - errorReporter?.Invoke(DateTime.Now, "Error", String.Format("[Traffic] {0}", e.Message), System.Drawing.Color.Red); + OnError(logger, e); } finally { connection.Close(); @@ -124,8 +123,7 @@ namespace TrafficClient.Workers { } } catch (Exception e) { - logger.Error(e.Message); - errorReporter?.Invoke(DateTime.Now, "Error", String.Format("[Traffic] {0}", e.Message), System.Drawing.Color.Red); + OnError(logger, e); } finally { connection.Close(); diff --git a/client/PlanAIRClient/Workers/PromoWorker.cs b/client/PlanAIRClient/Workers/PromoWorker.cs index db52dc17..0a7414ce 100644 --- a/client/PlanAIRClient/Workers/PromoWorker.cs +++ b/client/PlanAIRClient/Workers/PromoWorker.cs @@ -5,14 +5,15 @@ using System.Data.SqlClient; using NLog; using System.Drawing; using System.Diagnostics; +using LinkDotNet.MessageHandling.Contracts; namespace TrafficClient.Workers { public class PromoWorker : TrafficWorker { private static Logger logger = LogManager.GetCurrentClassLogger(); - public PromoWorker(SqlConnection connection, CliFSPReader cliFSPReader, TrafficErrorReporterDelegate errorReporter) - : base(connection, cliFSPReader, errorReporter) { + public PromoWorker(SqlConnection connection, CliFSPReader cliFSPReader, IMessageBus messageBus) + : base(connection, cliFSPReader, messageBus) { } private TrafficItem ToTrafficItem(clIFsp_EC_MAMPromotionalResult data) { @@ -62,8 +63,7 @@ namespace TrafficClient.Workers { } } catch (Exception e) { - logger.Error(e.Message); - errorReporter?.Invoke(DateTime.Now, "Error", String.Format("[Traffic] {0}", e.Message), Color.Red); + OnError(logger, e); } finally { connection.Close(); @@ -84,8 +84,7 @@ namespace TrafficClient.Workers { } } catch (Exception e) { - logger.Error(e.Message); - errorReporter?.Invoke(DateTime.Now, "Error", String.Format("[Traffic] {0}", e.Message), Color.Red); + OnError(logger, e); } finally { connection.Close(); @@ -113,8 +112,7 @@ namespace TrafficClient.Workers { } } catch (Exception e) { - logger.Error(e.Message); - errorReporter?.Invoke(DateTime.Now, "Error", String.Format("[Traffic] {0}", e.Message), Color.Red); + OnError(logger, e); } finally { connection.Close(); diff --git a/client/PlanAIRClient/Workers/SegmentWorker.cs b/client/PlanAIRClient/Workers/SegmentWorker.cs index 52363f61..ab934c4d 100644 --- a/client/PlanAIRClient/Workers/SegmentWorker.cs +++ b/client/PlanAIRClient/Workers/SegmentWorker.cs @@ -3,14 +3,15 @@ using System.Collections.Generic; using System.Data; using System.Data.SqlClient; using NLog; +using LinkDotNet.MessageHandling.Contracts; namespace TrafficClient.Workers { public class SegmentWorker : TrafficWorker { private static Logger logger = LogManager.GetCurrentClassLogger(); - public SegmentWorker(SqlConnection connection, CliFSPReader cliFSPReader, TrafficErrorReporterDelegate errorReporter) : - base(connection, cliFSPReader, errorReporter) { + public SegmentWorker(SqlConnection connection, CliFSPReader cliFSPReader, IMessageBus messageBus) : + base(connection, cliFSPReader, messageBus) { } private Segment ToSegment(clIFsp_EC_MAMPromotionalResult item) { @@ -56,8 +57,7 @@ namespace TrafficClient.Workers { } } catch (Exception e) { - logger.Error(e.Message); - errorReporter?.Invoke(DateTime.Now, "Error", String.Format("[Traffic] {0}", e.Message), System.Drawing.Color.Red); + OnError(logger, e); } finally { connection.Close(); @@ -78,8 +78,7 @@ namespace TrafficClient.Workers { } } catch (Exception e) { - logger.Error(e.Message); - errorReporter?.Invoke(DateTime.Now, "Error", String.Format("[Traffic] {0}", e.Message), System.Drawing.Color.Red); + OnError(logger, e); } finally { connection.Close(); @@ -100,15 +99,14 @@ namespace TrafficClient.Workers { } } catch (Exception e) { - logger.Error(e.Message); - errorReporter?.Invoke(DateTime.Now, "Error", String.Format("[Traffic] {0}", e.Message), System.Drawing.Color.Red); + OnError(logger, e); } finally { connection.Close(); } } - public void AddSegment(int itemID, Segment segment) { + public void AddMaterialSegment(int itemID, Segment segment) { object strparam = segment.Comment; if (String.IsNullOrEmpty(segment.Comment)) strparam = DBNull.Value; @@ -128,8 +126,59 @@ namespace TrafficClient.Workers { } } catch (Exception e) { - logger.Error(e.Message); - errorReporter?.Invoke(DateTime.Now, "Error", String.Format("[Traffic] {0}", e.Message), System.Drawing.Color.Red); + OnError(logger, e); + } + finally { + connection.Close(); + } + } + + public void AddADSegment(int itemID, Segment segment) { + object comment = segment.Comment; + if (String.IsNullOrEmpty(segment.Comment)) + comment = DBNull.Value; + try { + TryConnect(); + using (SqlCommand cmd = new SqlCommand("dbo.clIFsp_EC_MAM", connection)) { + int optionalParam = segment.Optional ? 1 : 0; + cmd.CommandType = CommandType.StoredProcedure; + cmd.Parameters.AddWithValue("@Operation", 3100); + cmd.Parameters.AddWithValue("@@ItemID", itemID); + cmd.Parameters.AddWithValue("@@@Options", DBNull.Value); + cmd.Parameters.AddWithValue("@@IntParam1", segment.TCIn); + cmd.Parameters.AddWithValue("@@IntParam2", segment.TCOut); + cmd.Parameters.AddWithValue("@@StrParam2", comment); + cmd.ExecuteNonQuery(); + } + } + catch (Exception e) { + OnError(logger, e); + } + finally { + connection.Close(); + } + } + + public void AddPromoSegment(int itemID, Segment segment) { + object comment = segment.Comment; + if (String.IsNullOrEmpty(segment.Comment)) + comment = DBNull.Value; + try { + TryConnect(); + using (SqlCommand cmd = new SqlCommand("dbo.clIFsp_EC_MAM", connection)) { + int optionalParam = segment.Optional ? 1 : 0; + cmd.CommandType = CommandType.StoredProcedure; + cmd.Parameters.AddWithValue("@Operation", 2100); + cmd.Parameters.AddWithValue("@@ItemID", itemID); + cmd.Parameters.AddWithValue("@@@Options", DBNull.Value); + cmd.Parameters.AddWithValue("@@IntParam1", segment.TCIn); + cmd.Parameters.AddWithValue("@@IntParam2", segment.TCOut); + cmd.Parameters.AddWithValue("@@StrParam2", comment); + cmd.ExecuteNonQuery(); + } + } + catch (Exception e) { + OnError(logger, e); } finally { connection.Close(); @@ -158,8 +207,7 @@ namespace TrafficClient.Workers { } } catch (Exception e) { - logger.Error(e.Message); - errorReporter?.Invoke(DateTime.Now, "Error", String.Format("[Traffic] {0}", e.Message), System.Drawing.Color.Red); + OnError(logger, e); } finally { connection.Close(); @@ -188,8 +236,7 @@ namespace TrafficClient.Workers { } } catch (Exception e) { - logger.Error(e.Message); - errorReporter?.Invoke(DateTime.Now, "Error", String.Format("[Traffic] {0}", e.Message), System.Drawing.Color.Red); + OnError(logger, e); } finally { connection.Close(); diff --git a/client/PlanAIRClient/Workers/TrafficWorker.cs b/client/PlanAIRClient/Workers/TrafficWorker.cs index 20a5ce2a..f9ecafc4 100644 --- a/client/PlanAIRClient/Workers/TrafficWorker.cs +++ b/client/PlanAIRClient/Workers/TrafficWorker.cs @@ -1,18 +1,22 @@ -using System.Data; +using LinkDotNet.MessageHandling.Contracts; +using NLog; +using System; +using System.Data; using System.Data.SqlClient; namespace TrafficClient.Workers { public class TrafficWorker { - protected TrafficErrorReporterDelegate errorReporter; + protected IMessageBus messageBus; protected CliFSPReader cliFSPReader; protected SqlConnection connection; - public TrafficWorker(SqlConnection connection, CliFSPReader cliFSPReader, TrafficErrorReporterDelegate errorReporter) { + public TrafficWorker(SqlConnection connection, CliFSPReader cliFSPReader, IMessageBus messageBus) { this.connection = connection; this.cliFSPReader = cliFSPReader; - this.errorReporter = errorReporter; + this.messageBus = messageBus; } + protected void TryConnect() { if (connection.State != ConnectionState.Open) { connection.Close(); @@ -20,5 +24,12 @@ namespace TrafficClient.Workers { } } + protected void OnError(Logger logger, Exception e) { + logger.Error(e); + if (messageBus != null) + messageBus.Send(new TrafficAPIMessage("Sikertelen kapcsolódás a TRAFFIC rendszerhez.")); + } + + } } diff --git a/client/PlanAIRClient/packages.config b/client/PlanAIRClient/packages.config new file mode 100644 index 00000000..b4bb12d1 --- /dev/null +++ b/client/PlanAIRClient/packages.config @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/server/-configuration/mediacube-dev.properties b/server/-configuration/mediacube-dev.properties index 1e91f8a1..aa2884c0 100644 --- a/server/-configuration/mediacube-dev.properties +++ b/server/-configuration/mediacube-dev.properties @@ -4,13 +4,13 @@ jobengine.loglevel=INFO jobengine.jobsteps.root=../user.jobengine.osgi.server/resources/executors jobengine.jobtemplates.root=../user.jobengine.osgi.server/resources/templates jobengine.jobsteps.alternate.root=../user.jobengine.executors/bin/user/jobengine/server/steps -jobengine.db.url=jdbc:db2://10.10.1.28:50000/mc:retrieveMessagesFromServerOnGetMessage=true; +jobengine.db.url=jdbc:db2://10.10.1.27:50000/mc:retrieveMessagesFromServerOnGetMessage=true; jobengine.db.user=db2admin jobengine.db.password=password jobengine.octopus.api.address=http://10.10.1.11/api/v1 jobengine.octopus.api.user=mam jobengine.octopus.api.password=napocska -jobengine.nosql.db.url=jdbc:db2://10.10.1.28:50000/mc:retrieveMessagesFromServerOnGetMessage=true; +jobengine.nosql.db.url=jdbc:db2://10.10.1.27:50000/mc:retrieveMessagesFromServerOnGetMessage=true; jobengine.nosql.db.user=db2admin jobengine.nosql.db.password=password jobengine.nexio.db.url=jdbc:sqlserver://10.10.1.59:1433;databaseName=NXDB; diff --git a/server/-modules/pom.xml b/server/-modules/pom.xml index 14e209a0..e8060fb4 100644 --- a/server/-modules/pom.xml +++ b/server/-modules/pom.xml @@ -25,7 +25,7 @@ UTF-8 UTF-8 - scp://root:password@10.10.1.28 + scp://root:password@10.10.1.27 ssh-ed25519 256 ea:ab:67:70:79:63:2f:6a:34:81:48:e2:b9:dd:ca:d4 diff --git a/server/-product/mediacube.product b/server/-product/mediacube.product index 6cce7cfa..5dc889b3 100644 --- a/server/-product/mediacube.product +++ b/server/-product/mediacube.product @@ -9,44 +9,44 @@ -consoleLog -console 5555 - -Dfile.encoding=UTF-8 --agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=8888 --Djavax.ws.rs.ext.RuntimeDelegate=org.jboss.resteasy.spi.ResteasyProviderFactory - -#System --Djetty.home=/opt/mediacube/configuration/jetty --Dlog4j.configurationFile=/opt/mediacube/configuration/log4j2.xml --Djobengine.jobsteps.root=/opt/mediacube/configuration/executors --Djobengine.jobtemplates.root=/opt/mediacube/configuration/jobtemplates --Djobengine.jobscheduling.config=/opt/mediacube/configuration/scheduledjobs.json - --Dorg.eclipse.equinox.http.jetty.http.port=80 --Dorg.eclipse.epp.logging.aeri.skipReports=true --Declipse.ignoreApp=true --Dosgi.noShutdown=true --Djobengine.loglevel=INFO --Djetty.etc.config.urls=etc/user-jetty.xml,etc/user-jetty-ssl.xml,etc/user-jetty-ssl-context.xml,etc/user-jetty-http.xml,etc/user-jetty-https.xml - - #Database --Djobengine.db.url=jdbc:db2://localhost:50000/mc:retrieveMessagesFromServerOnGetMessage=true; --Djobengine.db.user=db2admin --Djobengine.db.password=password --Djobengine.nosql.db.url=jdbc:db2://localhost:50000/mc:retrieveMessagesFromServerOnGetMessage=true; --Djobengine.nosql.db.user=db2admin --Djobengine.nosql.db.password=password --Djobengine.nosql.db.schema=test - -#Octopus --Djobengine.octopus.api.address=http://10.10.1.11/api/v1 --Djobengine.octopus.api.user=mam --Djobengine.octopus.api.password=napocska + -Dfile.encoding=UTF-8 +-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=8888 +-Djavax.ws.rs.ext.RuntimeDelegate=org.jboss.resteasy.spi.ResteasyProviderFactory -#Selenio --Djobengine.selenio.address=http://10.10.1.71:44000/TranscodeMgrWS?wsdl --Djobengine.selenio.projectfilepath=\\10.10.1.71\Data\Blueprints\MP4_H264_AAC_v4.zenium +#System +-Djetty.home=/opt/mediacube/configuration/jetty +-Dlog4j.configurationFile=/opt/mediacube/configuration/log4j2.xml +-Djobengine.jobsteps.root=/opt/mediacube/configuration/executors +-Djobengine.jobtemplates.root=/opt/mediacube/configuration/jobtemplates +-Djobengine.jobscheduling.config=/opt/mediacube/configuration/scheduledjobs.json -#Nexio --Dnexio.host=10.10.1.56 +-Dorg.eclipse.equinox.http.jetty.http.port=80 +-Dorg.eclipse.epp.logging.aeri.skipReports=true +-Declipse.ignoreApp=true +-Dosgi.noShutdown=true +-Djobengine.loglevel=INFO +-Djetty.etc.config.urls=etc/user-jetty.xml,etc/user-jetty-ssl.xml,etc/user-jetty-ssl-context.xml,etc/user-jetty-http.xml,etc/user-jetty-https.xml + + #Database +-Djobengine.db.url=jdbc:db2://localhost:50000/mc:retrieveMessagesFromServerOnGetMessage=true; +-Djobengine.db.user=db2admin +-Djobengine.db.password=password +-Djobengine.nosql.db.url=jdbc:db2://localhost:50000/mc:retrieveMessagesFromServerOnGetMessage=true; +-Djobengine.nosql.db.user=db2admin +-Djobengine.nosql.db.password=password +-Djobengine.nosql.db.schema=test + +#Octopus +-Djobengine.octopus.api.address=http://10.10.1.11/api/v1 +-Djobengine.octopus.api.user=mam +-Djobengine.octopus.api.password=napocska + +#Selenio +-Djobengine.selenio.address=http://10.10.1.71:44000/TranscodeMgrWS?wsdl +-Djobengine.selenio.projectfilepath=\\10.10.1.71\Data\Blueprints\MP4_H264_AAC_v4.zenium + +#Nexio +-Dnexio.host=10.10.1.55 -XstartOnFirstThread -Dorg.eclipse.swt.internal.carbon.smallFonts diff --git a/server/-product/pom.xml b/server/-product/pom.xml index 2224abe2..d8f53d84 100644 --- a/server/-product/pom.xml +++ b/server/-product/pom.xml @@ -276,11 +276,13 @@ "open ${remote.address} -hostkey=""${remote.hostkey}""" "call pcs resource disable mediacube_script" + "call sleep 5" "call rm -rf ${remote.location}" "call mkdir ${remote.location}" "lcd ${local.location}" "cd ${remote.location}" "synchronize remote" + "mkdir log" "call chmod +x mediacube" "call pcs resource enable mediacube_script" diff --git a/server/user.jobengine.osgi.commons/src/user/commons/octopus/OctopusDataMiner.java b/server/user.jobengine.osgi.commons/src/user/commons/octopus/OctopusDataMiner.java index e1183b2b..a9095921 100644 --- a/server/user.jobengine.osgi.commons/src/user/commons/octopus/OctopusDataMiner.java +++ b/server/user.jobengine.osgi.commons/src/user/commons/octopus/OctopusDataMiner.java @@ -34,6 +34,9 @@ import user.commons.remotestore.IProgressEventListener; import user.commons.remotestore.ProgressEvent; public class OctopusDataMiner implements Runnable { + private static final String MOS_ID = "mosId"; + private static final String MOS_OBJECTS = "mosObjects"; + private static final String NAME = "name"; private static final String LABEL = "label"; private static final String SIMPLE_LINEFEED = "\n"; private static final String MOSOBJECT = "Bejátszó: "; @@ -49,7 +52,7 @@ public class OctopusDataMiner implements Runnable { private static final String SCRIPT_CONTENT = "script_content"; private static final Logger logger = LogManager.getLogger(); private static final String SAVING_STORY_ID = "Saving story {}"; - private static final String SAVEING_RUNDOWN_D = "Saveing rundown : %d"; + private static final String SAVING_RUNDOWN = "Saving rundown : {} {}"; private static final String REF_RUNDOWN = "rundown"; private static final String REF_STORYFOLDER = "story_folder"; private static final String POSITION = "position"; @@ -220,8 +223,8 @@ public class OctopusDataMiner implements Runnable { BasicDBObject parent = (BasicDBObject) res.get("parent"); if (parent == null || parent.isEmpty()) return name; - String parentName = parent.getString("name"); - String actualName = actual.getString("name"); + String parentName = parent.getString(NAME); + String actualName = actual.getString(NAME); String newName = String.format("%s/%s", parentName, actualName); return concatParentsToStoryFolder(parent, newName); } @@ -317,6 +320,22 @@ public class OctopusDataMiner implements Runnable { return result; } + private BasicDBList GetRelevantMOSObjects(BasicDBObject story) { + BasicDBList result = null; + List mosObjects = NoSQLUtils.asList(asDBList(story, MOS_OBJECTS)); + for (BasicDBObject mosObject : mosObjects) { + if (!mosObject.containsKey(MOS_ID)) + continue; + String mosId = mosObject.getString(MOS_ID); + if (!"NEXIO.MOS".equals(mosId)) + continue; + if (result == null) + result = new BasicDBList(); + result.add(mosObject); + } + return result; + } + private String GetScriptContent(BasicDBObject story) { BasicDBObject script = asDBObject(story, SCRIPT); if (script == null || script.isEmpty()) @@ -405,10 +424,10 @@ public class OctopusDataMiner implements Runnable { /* teszt */ List list = NoSQLUtils.asList(result); for (BasicDBObject actual : list) { - String fullName = concatParentsToStoryFolder(actual, actual.getString("name")); + String fullName = concatParentsToStoryFolder(actual, actual.getString(NAME)); //logger.info("Checking StoryFolder {}", fullName); - actual.remove("name"); - actual.append("name", fullName); + actual.remove(NAME); + actual.append(NAME, fullName); } logger.trace(EXIT); @@ -466,24 +485,6 @@ public class OctopusDataMiner implements Runnable { collection.save(timeObject); } - private void storeRundown(BasicDBObject rundown, Date lastUpdateTime) { - logger.trace(ENTER); - long rundownID = rundown.getLong(ID); - - BasicDBObject rundownWithStories = queryRundown(rundownID); - BasicDBList stories = asDBList(rundownWithStories, SLUGS); - if (stories != null) - storeRundownStories(stories, lastUpdateTime); - rundown.put(SCHEDULED_START, toDate(rundown, SCHEDULED_START)); - rundown.put(MODIFIED, toDate(rundown, MODIFIED)); - DBCollection collection = db.getCollection(RUNDOWN_COLLECTION_NAME); - if (lastUpdateTime == null || (lastUpdateTime != null && isModified(lastUpdateTime, rundown))) { - logger.info(String.format(SAVEING_RUNDOWN_D, rundownID)); - collection.save(rundown); - } - logger.trace(EXIT); - } - // private void insertStoryFoldersToDB2() { // DBCollection collection = db.getCollection(STORY_FOLDER_COLLECTION_NAME); // Set storyKeys = storyFolders.keySet(); @@ -553,6 +554,25 @@ public class OctopusDataMiner implements Runnable { // storyFolders = converter.convertBasicDBObjectFromJson(result); // } + private void storeRundown(BasicDBObject rundown, Date lastUpdateTime) { + logger.trace(ENTER); + long rundownID = rundown.getLong(ID); + String name = rundown.containsKey(NAME) ? rundown.getString(NAME) : null; + + BasicDBObject rundownWithStories = queryRundown(rundownID); + BasicDBList stories = asDBList(rundownWithStories, SLUGS); + if (stories != null) + storeRundownStories(stories, lastUpdateTime); + rundown.put(SCHEDULED_START, toDate(rundown, SCHEDULED_START)); + rundown.put(MODIFIED, toDate(rundown, MODIFIED)); + DBCollection collection = db.getCollection(RUNDOWN_COLLECTION_NAME); + if (lastUpdateTime == null || (lastUpdateTime != null && isModified(lastUpdateTime, rundown))) { + logger.info(SAVING_RUNDOWN, rundownID, name); + collection.save(rundown); + } + logger.trace(EXIT); + } + private void storeRundowns(BasicDBList rundowns, Date lastUpdateTime) { logger.trace(ENTER); List rundownsList = NoSQLUtils.asList(rundowns); @@ -612,7 +632,8 @@ public class OctopusDataMiner implements Runnable { DBCollection collection = db.getCollection(STORY_COLLECTION_NAME); if (lastUpdateTime != null) { BasicDBObject orig = (BasicDBObject) collection.findOne(new BasicDBObject(ID, storyID), new BasicDBObject(ID, 1)); - story.put("_id", orig.getID()); + if (orig != null) + story.put("_id", orig.getID()); } if (rundownRef != null) story.put(REF_RUNDOWN, rundownRef); @@ -620,6 +641,12 @@ public class OctopusDataMiner implements Runnable { story.put(REF_STORYFOLDER, storyFolderRef); String scriptContent = GetScriptContent(story); story.put(SCRIPT_CONTENT, scriptContent); + BasicDBList modifiedMOS = GetRelevantMOSObjects(story); + if (modifiedMOS == null || modifiedMOS.isEmpty()) { + if (story.containsKey(MOS_OBJECTS)) + story.remove(MOS_OBJECTS); + } else + story.put(MOS_OBJECTS, modifiedMOS); logger.info(SAVING_STORY_ID, storyID); collection.save(story); logger.trace(EXIT); diff --git a/server/user.jobengine.osgi.server/pages/joblist.zul b/server/user.jobengine.osgi.server/pages/joblist.zul index 5349123c..5f543d8b 100644 --- a/server/user.jobengine.osgi.server/pages/joblist.zul +++ b/server/user.jobengine.osgi.server/pages/joblist.zul @@ -33,13 +33,13 @@
- - + - - + + diff --git a/server/user.jobengine.osgi.server/src/user/jobengine/server/JobRuntime.java b/server/user.jobengine.osgi.server/src/user/jobengine/server/JobRuntime.java index a5ffc301..b3286f1b 100644 --- a/server/user.jobengine.osgi.server/src/user/jobengine/server/JobRuntime.java +++ b/server/user.jobengine.osgi.server/src/user/jobengine/server/JobRuntime.java @@ -107,7 +107,7 @@ public class JobRuntime extends Job implements IJobRuntime { if (children == null) children = new ArrayList<>(); children.add(c); - Message m = logger.getMessageFactory().newMessage("Child {}. of {}", children.size(), this.getId()); + Message m = logger.getMessageFactory().newMessage("{} alfolyamata", children.size(), this.getId()); c.setName(m.getFormattedMessage()); c.setParentJobId(this.getId()); } diff --git a/server/user.jobengine.osgi.server/src/user/jobengine/server/steps/JobStep.java b/server/user.jobengine.osgi.server/src/user/jobengine/server/steps/JobStep.java index 15b8aa18..28806e12 100644 --- a/server/user.jobengine.osgi.server/src/user/jobengine/server/steps/JobStep.java +++ b/server/user.jobengine.osgi.server/src/user/jobengine/server/steps/JobStep.java @@ -55,7 +55,7 @@ public class JobStep implements IJobStep { public Object[] run(IJobEngine jobEngine, IJobRuntime jobRuntime, Object[] inputs) throws Exception { Object[] result = null; this.jobRuntime = jobRuntime; - jobRuntime.setDescription("Current step: " + getClass().getSimpleName()); + jobRuntime.setDescription("Feldolgozás: " + getClass().getSimpleName()); jobRuntime.NotifyUpdate(); for (Method method : getClass().getDeclaredMethods()) { Annotation annotation = method.getAnnotation(StepEntry.class); diff --git a/server/user.jobengine.osgi.server/src/user/jobengine/zk/model/JobSelectorModel.java b/server/user.jobengine.osgi.server/src/user/jobengine/zk/model/JobSelectorModel.java index f7a12eac..f906bf28 100644 --- a/server/user.jobengine.osgi.server/src/user/jobengine/zk/model/JobSelectorModel.java +++ b/server/user.jobengine.osgi.server/src/user/jobengine/zk/model/JobSelectorModel.java @@ -46,10 +46,13 @@ public class JobSelectorModel extends BaseModel { for (int i = 0; i < 1; i++) { try { - scheduler.register(scheduledJob); + if (!scheduledJob.isActive()) + scheduler.register(scheduledJob); scheduler.executeImmediate(scheduledJob.getTemplateName()); Thread.sleep(100); } catch (Exception e) { + //Page not found /pages/MessageBox.zul + //Messagebox.show(e.getMessage()); } } diff --git a/server/user.jobengine.osgi.server/test/user/jobengine/server/steps/JobStepTest.java b/server/user.jobengine.osgi.server/test/user/jobengine/server/steps/JobStepTest.java index 04da5191..bb970b1c 100644 --- a/server/user.jobengine.osgi.server/test/user/jobengine/server/steps/JobStepTest.java +++ b/server/user.jobengine.osgi.server/test/user/jobengine/server/steps/JobStepTest.java @@ -2,6 +2,8 @@ package user.jobengine.server.steps; import static org.junit.Assert.assertEquals; +import java.util.concurrent.Semaphore; + import org.junit.Test; import user.jobengine.server.IJobEngine; @@ -10,7 +12,36 @@ import user.jobengine.server.JobEngine; import user.jobengine.server.JobRuntime; import user.jobengine.server.Program; -public class JobStepTest { +public class JobStepTest { + + @Test + public void testBatchRun() throws Exception { + int c = 2; + Semaphore barrier = new Semaphore(c); + for (int i = 0; i < 10; i++) { + barrier.acquire(); + final int x = i; + Thread t = new Thread(new Runnable() { + + @Override + public void run() { + System.out.println("Thread start " + x); + try { + Thread.sleep(2000); + } catch (InterruptedException e) { + e.printStackTrace(); + } + barrier.release(); + //System.out.println("Thread completed " + x); + } + + }); + t.start(); + + } + + barrier.acquire(c); + } @Test public void testRun() throws Exception { @@ -26,7 +57,7 @@ public class JobStepTest { // Exercise Object[] outputs = sut.run(jobEngine, jobRuntime, inputs); - + // Verify assertEquals(2, sut.getParameters().size()); assertEquals(stringValue, sut.getParameters().get(0));