git-tfs-id: [http://tfs.userrendszerhaz.hu:8080/tfs/DefaultCollection]$/MediaCube...
authorVásáry Dániel <daniel.vasary@userrendszerhaz.hu>
Thu, 2 Nov 2017 09:46:20 +0000 (09:46 +0000)
committerVásáry Dániel <daniel.vasary@userrendszerhaz.hu>
Thu, 2 Nov 2017 09:46:20 +0000 (09:46 +0000)
58 files changed:
client/AudioRecorder/FileNameForm.Designer.cs
client/AudioRecorder/FileNameForm.cs
client/IntegrationTests/IntegrationTests.csproj
client/IntegrationTests/JobEngineIT.cs
client/IntegrationTests/MaestroIT.cs
client/IntegrationTests/PlanAIRTests.cs
client/IntegrationTests/packages.config
client/Maestro/ArchiveMetadataForm.cs
client/Maestro/Configuration/configuration-editor.json
client/Maestro/MaestroForm.Designer.cs
client/Maestro/MaestroForm.Metadata.cs
client/Maestro/MaestroForm.Source.cs
client/Maestro/MaestroForm.Target.cs
client/Maestro/MaestroForm.cs
client/Maestro/MaestroForm.resx
client/Maestro/MeastroFormNotifyIcon.cs
client/Maestro/Program.cs
client/Maestro/Properties/AssemblyInfo.cs
client/Maestro/Sources/FileSourceItem.cs
client/Maestro/Sources/FileSystemSource.cs
client/Maestro/Sources/NexioRESTSource.cs
client/Maestro/Splash.cs
client/Maestro/SystemMessage.cs
client/Maestro/Targets/FTPTargetProcessor.cs
client/Maestro/Targets/UNCTargetProcessor.cs
client/MediaCubeClient/MediaCubeApi.cs
client/MediaCubeClient/MediaCubeClient.csproj
client/MediaCubeClient/NexioAPI.cs
client/MediaCubeClient/NotificationMessage.cs [deleted file]
client/MediaCubeClient/Notifier.cs [deleted file]
client/MediaCubeClient/packages.config
client/OctopusClient/OctopusAPI.cs
client/OctopusClient/OctopusClient.csproj
client/OctopusClient/OctopusConfiguration.cs
client/OctopusClient/OctopusIDSelector.cs
client/OctopusClient/packages.config
client/PlanAIRClient/TrafficAPI.cs
client/PlanAIRClient/TrafficClient.csproj
client/PlanAIRClient/TrafficConfiguration.cs
client/PlanAIRClient/TrafficIDSelector.Designer.cs
client/PlanAIRClient/TrafficIDSelector.cs
client/PlanAIRClient/TrafficIDSelectorColumns.cs [moved from client/PlanAIRClient/TrafficIDSelector.Columns.cs with 100% similarity]
client/PlanAIRClient/Workers/ADWorker.cs
client/PlanAIRClient/Workers/MaterialWorker.cs
client/PlanAIRClient/Workers/PromoWorker.cs
client/PlanAIRClient/Workers/SegmentWorker.cs
client/PlanAIRClient/Workers/TrafficWorker.cs
client/PlanAIRClient/packages.config [new file with mode: 0644]
server/-configuration/mediacube-dev.properties
server/-modules/pom.xml
server/-product/mediacube.product
server/-product/pom.xml
server/user.jobengine.osgi.commons/src/user/commons/octopus/OctopusDataMiner.java
server/user.jobengine.osgi.server/pages/joblist.zul
server/user.jobengine.osgi.server/src/user/jobengine/server/JobRuntime.java
server/user.jobengine.osgi.server/src/user/jobengine/server/steps/JobStep.java
server/user.jobengine.osgi.server/src/user/jobengine/zk/model/JobSelectorModel.java
server/user.jobengine.osgi.server/test/user/jobengine/server/steps/JobStepTest.java

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