git-tfs-id: [http://tfs.userrendszerhaz.hu:8080/tfs/DefaultCollection]$/MediaCube...
authorBellai Ádám <USER\adam.bellai>
Thu, 28 Sep 2017 12:36:56 +0000 (12:36 +0000)
committerBellai Ádám <USER\adam.bellai>
Thu, 28 Sep 2017 12:36:56 +0000 (12:36 +0000)
26 files changed:
client/IntegrationTests/JobEngineIT.cs
client/Maestro/ArchiveMetadata.Designer.cs
client/Maestro/ArchiveMetadata.cs
client/Maestro/MaestroForm.Metadata.cs
client/Maestro/MaestroForm.Target.cs
client/Maestro/Resources/configuration-nexio.json
client/Maestro/Resources/configuration-unc.json
client/Maestro/Sources/NexioRESTSource.cs
client/Maestro/Targets/FTPTargetProcessor.cs
client/Maestro/Targets/FXPTargetProcessor.cs
client/Maestro/Targets/TargetProcessor.cs
client/MediaCubeClient/MediaCubeApi.cs [moved from client/MediaCubeClient/JobEngineAPI.cs with 93% similarity]
client/MediaCubeClient/MediaCubeClient.csproj
client/OctopusClient/OctopusAPI.cs
client/PlanAIRClient/CustomDataGridView.Designer.cs [new file with mode: 0644]
client/PlanAIRClient/CustomDataGridView.cs [new file with mode: 0644]
client/PlanAIRClient/Resources.Designer.cs
client/PlanAIRClient/Resources.resx
client/PlanAIRClient/TrafficAPI.cs
client/PlanAIRClient/TrafficClient.csproj
client/PlanAIRClient/TrafficIDSelector.Designer.cs
client/PlanAIRClient/TrafficIDSelector.cs
server/user.jobengine.osgi.commons/src/user/commons/octopus/IOctopusAPI.java
server/user.jobengine.osgi.commons/src/user/commons/octopus/OctopusAPI.java
server/user.jobengine.osgi.commons/test/user/common/octopus/test/OctopusAPITest.java
server/user.jobengine.osgi.services/src/user/jobengine/osgi/rest/octopus/OctopusRESTService.java

index 384d81c299ff85f7b0fb649e885f63ecd9a2823e..b7ea6d5c3a4bbd913e8927294eef33e101d379df 100644 (file)
@@ -16,7 +16,7 @@ namespace IntegrationTests {
 \r
         [TestMethod]\r
         public void TestCreate() {\r
-            JobEngineAPI client = new JobEngineAPI("http://localhost:8080/services/rest/jobengine/", null, null, 100);\r
+            MediaCubeApi client = new MediaCubeApi("http://localhost:8080/services/rest/jobengine/", null, null, 100);\r
 \r
             WorkflowAction item = new WorkflowAction();\r
             item.description = "description";\r
@@ -32,7 +32,7 @@ namespace IntegrationTests {
 \r
         [TestMethod]\r
         public void TestCreateMany() {\r
-            JobEngineAPI client = new JobEngineAPI("http://localhost:8080/services/rest/jobengine/", null, null, 100);\r
+            MediaCubeApi client = new MediaCubeApi("http://localhost:8080/services/rest/jobengine/", null, null, 100);\r
 \r
             for (int i = 0; i < 10; i++) {\r
                 WorkflowAction item = new WorkflowAction();\r
@@ -63,7 +63,7 @@ namespace IntegrationTests {
 \r
         [TestMethod]\r
         public void TestItem() {\r
-            JobEngineAPI client = new JobEngineAPI("http://localhost:8080/services/rest/jobengine/", null, null, 100);\r
+            MediaCubeApi client = new MediaCubeApi("http://localhost:8080/services/rest/jobengine/", null, null, 100);\r
             client.Item();\r
         }\r
     }\r
index 16e2fda1deb84c02cdc4b4e5cad2910f15ca151a..737d7eb2e14cd035f98c072606937844a43f7f64 100644 (file)
@@ -26,7 +26,6 @@
             this.backgroundWorker1 = new System.ComponentModel.BackgroundWorker();\r
             this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();\r
             this.label_stuffID = new System.Windows.Forms.Label();\r
-            this.label_stuffTitle = new System.Windows.Forms.Label();\r
             this.label_stuffDescription = new System.Windows.Forms.Label();\r
             this.label_mediaID = new System.Windows.Forms.Label();\r
             this.label_mediaTitle = new System.Windows.Forms.Label();\r
             this.textBox_mediaID = new System.Windows.Forms.TextBox();\r
             this.textBox_mediaTitle = new System.Windows.Forms.TextBox();\r
             this.textBox_mediaDescription = new System.Windows.Forms.TextBox();\r
+            this.label_stuffTitle = new System.Windows.Forms.Label();\r
+            this.groupBox1 = new System.Windows.Forms.GroupBox();\r
+            this.button_cancel = new System.Windows.Forms.Button();\r
+            this.button_ok = new System.Windows.Forms.Button();\r
             this.tableLayoutPanel1.SuspendLayout();\r
+            this.groupBox1.SuspendLayout();\r
             this.SuspendLayout();\r
             // \r
             // tableLayoutPanel1\r
@@ -57,7 +61,7 @@
             this.tableLayoutPanel1.Controls.Add(this.textBox_mediaTitle, 1, 4);\r
             this.tableLayoutPanel1.Controls.Add(this.textBox_mediaDescription, 1, 5);\r
             this.tableLayoutPanel1.Controls.Add(this.label_stuffTitle, 0, 1);\r
-            this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;\r
+            this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Top;\r
             this.tableLayoutPanel1.Location = new System.Drawing.Point(0, 0);\r
             this.tableLayoutPanel1.Name = "tableLayoutPanel1";\r
             this.tableLayoutPanel1.RowCount = 6;\r
@@ -67,7 +71,7 @@
             this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 16.66667F));\r
             this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 16.66667F));\r
             this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 16.66667F));\r
-            this.tableLayoutPanel1.Size = new System.Drawing.Size(318, 330);\r
+            this.tableLayoutPanel1.Size = new System.Drawing.Size(324, 330);\r
             this.tableLayoutPanel1.TabIndex = 0;\r
             // \r
             // label_stuffID\r
             this.label_stuffID.Dock = System.Windows.Forms.DockStyle.Top;\r
             this.label_stuffID.Location = new System.Drawing.Point(3, 0);\r
             this.label_stuffID.Name = "label_stuffID";\r
-            this.label_stuffID.Size = new System.Drawing.Size(87, 13);\r
+            this.label_stuffID.Size = new System.Drawing.Size(89, 13);\r
             this.label_stuffID.TabIndex = 0;\r
             this.label_stuffID.Text = "Anyag azonosító";\r
             // \r
-            // label_stuffTitle\r
-            // \r
-            this.label_stuffTitle.AutoSize = true;\r
-            this.label_stuffTitle.Location = new System.Drawing.Point(3, 55);\r
-            this.label_stuffTitle.Name = "label_stuffTitle";\r
-            this.label_stuffTitle.Size = new System.Drawing.Size(58, 13);\r
-            this.label_stuffTitle.TabIndex = 1;\r
-            this.label_stuffTitle.Text = "Anyag cím";\r
-            // \r
             // label_stuffDescription\r
             // \r
             this.label_stuffDescription.AutoSize = true;\r
-            this.label_stuffDescription.Location = new System.Drawing.Point(3, 110);\r
+            this.label_stuffDescription.Location = new System.Drawing.Point(3, 108);\r
             this.label_stuffDescription.Name = "label_stuffDescription";\r
             this.label_stuffDescription.Size = new System.Drawing.Size(66, 13);\r
             this.label_stuffDescription.TabIndex = 2;\r
             // label_mediaID\r
             // \r
             this.label_mediaID.AutoSize = true;\r
-            this.label_mediaID.Location = new System.Drawing.Point(3, 165);\r
+            this.label_mediaID.Location = new System.Drawing.Point(3, 162);\r
             this.label_mediaID.Name = "label_mediaID";\r
             this.label_mediaID.Size = new System.Drawing.Size(86, 13);\r
             this.label_mediaID.TabIndex = 3;\r
             // label_mediaTitle\r
             // \r
             this.label_mediaTitle.AutoSize = true;\r
-            this.label_mediaTitle.Location = new System.Drawing.Point(3, 220);\r
+            this.label_mediaTitle.Location = new System.Drawing.Point(3, 216);\r
             this.label_mediaTitle.Name = "label_mediaTitle";\r
             this.label_mediaTitle.Size = new System.Drawing.Size(57, 13);\r
             this.label_mediaTitle.TabIndex = 4;\r
             // label_mediaDescription\r
             // \r
             this.label_mediaDescription.AutoSize = true;\r
-            this.label_mediaDescription.Location = new System.Drawing.Point(3, 275);\r
+            this.label_mediaDescription.Location = new System.Drawing.Point(3, 270);\r
             this.label_mediaDescription.Name = "label_mediaDescription";\r
             this.label_mediaDescription.Size = new System.Drawing.Size(65, 13);\r
             this.label_mediaDescription.TabIndex = 5;\r
             // textBox_stuffID\r
             // \r
             this.textBox_stuffID.Dock = System.Windows.Forms.DockStyle.Top;\r
-            this.textBox_stuffID.Location = new System.Drawing.Point(96, 3);\r
+            this.textBox_stuffID.Location = new System.Drawing.Point(98, 3);\r
             this.textBox_stuffID.Name = "textBox_stuffID";\r
-            this.textBox_stuffID.Size = new System.Drawing.Size(219, 20);\r
+            this.textBox_stuffID.Size = new System.Drawing.Size(223, 20);\r
             this.textBox_stuffID.TabIndex = 6;\r
             // \r
             // textBox_stuffTitle\r
             // \r
             this.textBox_stuffTitle.Dock = System.Windows.Forms.DockStyle.Top;\r
-            this.textBox_stuffTitle.Location = new System.Drawing.Point(96, 58);\r
+            this.textBox_stuffTitle.Location = new System.Drawing.Point(98, 57);\r
             this.textBox_stuffTitle.Name = "textBox_stuffTitle";\r
-            this.textBox_stuffTitle.Size = new System.Drawing.Size(219, 20);\r
+            this.textBox_stuffTitle.Size = new System.Drawing.Size(223, 20);\r
             this.textBox_stuffTitle.TabIndex = 7;\r
             // \r
             // textBox_stuffDescription\r
             // \r
-            this.textBox_stuffDescription.Dock = System.Windows.Forms.DockStyle.Top;\r
-            this.textBox_stuffDescription.Location = new System.Drawing.Point(96, 113);\r
+            this.textBox_stuffDescription.Dock = System.Windows.Forms.DockStyle.Fill;\r
+            this.textBox_stuffDescription.Location = new System.Drawing.Point(98, 111);\r
+            this.textBox_stuffDescription.Multiline = true;\r
             this.textBox_stuffDescription.Name = "textBox_stuffDescription";\r
-            this.textBox_stuffDescription.Size = new System.Drawing.Size(219, 20);\r
+            this.textBox_stuffDescription.ScrollBars = System.Windows.Forms.ScrollBars.Both;\r
+            this.textBox_stuffDescription.Size = new System.Drawing.Size(223, 48);\r
             this.textBox_stuffDescription.TabIndex = 8;\r
             // \r
             // textBox_mediaID\r
             // \r
             this.textBox_mediaID.Dock = System.Windows.Forms.DockStyle.Top;\r
-            this.textBox_mediaID.Location = new System.Drawing.Point(96, 168);\r
+            this.textBox_mediaID.Location = new System.Drawing.Point(98, 165);\r
             this.textBox_mediaID.Name = "textBox_mediaID";\r
-            this.textBox_mediaID.Size = new System.Drawing.Size(219, 20);\r
+            this.textBox_mediaID.Size = new System.Drawing.Size(223, 20);\r
             this.textBox_mediaID.TabIndex = 9;\r
             // \r
             // textBox_mediaTitle\r
             // \r
             this.textBox_mediaTitle.Dock = System.Windows.Forms.DockStyle.Top;\r
-            this.textBox_mediaTitle.Location = new System.Drawing.Point(96, 223);\r
+            this.textBox_mediaTitle.Location = new System.Drawing.Point(98, 219);\r
             this.textBox_mediaTitle.Name = "textBox_mediaTitle";\r
-            this.textBox_mediaTitle.Size = new System.Drawing.Size(219, 20);\r
+            this.textBox_mediaTitle.Size = new System.Drawing.Size(223, 20);\r
             this.textBox_mediaTitle.TabIndex = 10;\r
             // \r
             // textBox_mediaDescription\r
             // \r
-            this.textBox_mediaDescription.Dock = System.Windows.Forms.DockStyle.Top;\r
-            this.textBox_mediaDescription.Location = new System.Drawing.Point(96, 278);\r
+            this.textBox_mediaDescription.Dock = System.Windows.Forms.DockStyle.Fill;\r
+            this.textBox_mediaDescription.Location = new System.Drawing.Point(98, 273);\r
+            this.textBox_mediaDescription.Multiline = true;\r
             this.textBox_mediaDescription.Name = "textBox_mediaDescription";\r
-            this.textBox_mediaDescription.Size = new System.Drawing.Size(219, 20);\r
+            this.textBox_mediaDescription.ScrollBars = System.Windows.Forms.ScrollBars.Both;\r
+            this.textBox_mediaDescription.Size = new System.Drawing.Size(223, 54);\r
             this.textBox_mediaDescription.TabIndex = 11;\r
             // \r
+            // label_stuffTitle\r
+            // \r
+            this.label_stuffTitle.AutoSize = true;\r
+            this.label_stuffTitle.Location = new System.Drawing.Point(3, 54);\r
+            this.label_stuffTitle.Name = "label_stuffTitle";\r
+            this.label_stuffTitle.Size = new System.Drawing.Size(58, 13);\r
+            this.label_stuffTitle.TabIndex = 1;\r
+            this.label_stuffTitle.Text = "Anyag cím";\r
+            // \r
+            // groupBox1\r
+            // \r
+            this.groupBox1.Controls.Add(this.button_cancel);\r
+            this.groupBox1.Controls.Add(this.button_ok);\r
+            this.groupBox1.Dock = System.Windows.Forms.DockStyle.Fill;\r
+            this.groupBox1.Location = new System.Drawing.Point(0, 330);\r
+            this.groupBox1.Name = "groupBox1";\r
+            this.groupBox1.Size = new System.Drawing.Size(324, 58);\r
+            this.groupBox1.TabIndex = 1;\r
+            this.groupBox1.TabStop = false;\r
+            // \r
+            // button_cancel\r
+            // \r
+            this.button_cancel.Dock = System.Windows.Forms.DockStyle.Right;\r
+            this.button_cancel.ForeColor = System.Drawing.SystemColors.ControlText;\r
+            this.button_cancel.Location = new System.Drawing.Point(171, 16);\r
+            this.button_cancel.Name = "button_cancel";\r
+            this.button_cancel.Size = new System.Drawing.Size(75, 39);\r
+            this.button_cancel.TabIndex = 0;\r
+            this.button_cancel.Text = "Cancel";\r
+            this.button_cancel.UseVisualStyleBackColor = true;\r
+            // \r
+            // button_ok\r
+            // \r
+            this.button_ok.Dock = System.Windows.Forms.DockStyle.Right;\r
+            this.button_ok.Location = new System.Drawing.Point(246, 16);\r
+            this.button_ok.Name = "button_ok";\r
+            this.button_ok.Size = new System.Drawing.Size(75, 39);\r
+            this.button_ok.TabIndex = 1;\r
+            this.button_ok.Text = "OK";\r
+            this.button_ok.UseVisualStyleBackColor = true;\r
+            this.button_ok.Click += new System.EventHandler(this.button_ok_Click);\r
+            // \r
             // ArchiveMetadata\r
             // \r
             this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);\r
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;\r
-            this.ClientSize = new System.Drawing.Size(318, 330);\r
+            this.ClientSize = new System.Drawing.Size(324, 388);\r
+            this.Controls.Add(this.groupBox1);\r
             this.Controls.Add(this.tableLayoutPanel1);\r
             this.Name = "ArchiveMetadata";\r
             this.Text = "ArchiveMetadata";\r
             this.tableLayoutPanel1.ResumeLayout(false);\r
             this.tableLayoutPanel1.PerformLayout();\r
+            this.groupBox1.ResumeLayout(false);\r
             this.ResumeLayout(false);\r
 \r
         }\r
         private System.Windows.Forms.TextBox textBox_mediaID;\r
         private System.Windows.Forms.TextBox textBox_mediaTitle;\r
         private System.Windows.Forms.TextBox textBox_mediaDescription;\r
+        private System.Windows.Forms.GroupBox groupBox1;\r
+        private System.Windows.Forms.Button button_cancel;\r
+        private System.Windows.Forms.Button button_ok;\r
     }\r
 }
\ No newline at end of file
index cdf02682aab8b8e351f1234f164cfe62c3027019..0217f905421ef4b20eee25cc3506eef3a681a25f 100644 (file)
@@ -8,11 +8,11 @@ namespace Maestro {
 \r
         public ArchiveMetadata(ArchiveMetadataModel model) : this() {\r
             this.model = model;\r
+            FillTheTextBoxes();\r
         }\r
 \r
         public ArchiveMetadata() {\r
             InitializeComponent();\r
-            FillTheTextBoxes();\r
         }\r
 \r
         private void FillTheTextBoxes() {\r
@@ -23,5 +23,9 @@ namespace Maestro {
             textBox_mediaTitle.Text = model.MediaTitle;\r
             textBox_mediaDescription.Text = model.MediaDescription;\r
         }\r
+\r
+        private void button_ok_Click(object sender, System.EventArgs e) {\r
+            //todo\r
+        }\r
     }\r
 }\r
index 33a4b0aac7dbef3a7a6998b5b354bcb6c1fee800..8c663d81b69e46c7395cc59bc5c552c7fba5c915 100644 (file)
@@ -9,11 +9,12 @@ using TrafficClient;
 using System.Collections.Generic;\r
 using System.ComponentModel;\r
 using System.Text.RegularExpressions;\r
-\r
+using JobEngineClient;\r
 namespace Maestro {\r
     public partial class MaestroForm {\r
         private MetadataInfo selectedMetadata;\r
         private List<Segment> segments = new List<Segment>();\r
+        private MediaCubeApi mediaCubeApi;\r
 \r
         public MetadataInfo SelectedMetadata {\r
             get {\r
@@ -28,6 +29,7 @@ namespace Maestro {
         private void InitializeMetadata() {\r
             InitializeOctopusSelector();\r
             InitializeTrafficSelector();\r
+            InitializeMediaCubeApi();\r
         }\r
 \r
         private void InitializeTrafficSelector() {\r
@@ -56,6 +58,13 @@ namespace Maestro {
             octopusIDSelector.IDChangedEvent += OnOctopusIDSelected;\r
         }\r
 \r
+        private void InitializeMediaCubeApi() {\r
+            MediaCubeMetadata metadata = Configuration.Metadatas.Where(m => { return m is MediaCubeMetadata; }).FirstOrDefault() as MediaCubeMetadata;\r
+            if (metadata == null)\r
+                return;\r
+            mediaCubeApi = new MediaCubeApi(metadata.Server.Address.ToString(), metadata.Server.UserName, metadata.Server.Password, metadata.Server.Timeout);\r
+        }\r
+\r
         private void OnOctopusIDSelected(string selectedID) {\r
             SelectedMetadata = new MetadataInfo() {\r
                 Kind = MetadataType.OctopusStory,\r
@@ -68,31 +77,53 @@ namespace Maestro {
             ArchiveMetadata form = null;\r
             IDTypes idType = GetTypeOfSelectedMetadata();\r
             ArchiveMetadataModel model = new ArchiveMetadataModel();\r
+            Cursor.Current = Cursors.WaitCursor;\r
             if (idType == IDTypes.OctopusID)\r
                 FillTheModelFromOctopus(model);\r
             else if (idType == IDTypes.TrafficID)\r
                 FillTheModelFromTraffic(model);\r
-            //form = new ArchiveMetadata(model);\r
-            //form.ShowDialog();\r
+            form = new ArchiveMetadata(model);\r
+            form.ShowDialog();\r
         }\r
 \r
         private void FillTheModelFromTraffic(ArchiveMetadataModel model) {\r
-            throw new NotImplementedException();\r
+            string id = selectedMetadata.ID;\r
+            TrafficAPI api = trafficIDSelector.trafficAPI;\r
+            List<ArchiveMatadataWrapper> result = api.SearchArchiveMetadata(id); ;\r
+            ArchiveMatadataWrapper actualResult = result[0];\r
+            model.StuffID = actualResult.ProgID;\r
+            model.StuffTitle = actualResult.ProgTitle;\r
+            model.StuffDescription = actualResult.ProgDescription;\r
+            model.MediaID = actualResult.EpisodeID;\r
+            model.MediaTitle = String.IsNullOrEmpty(actualResult.EpisodeTitle) ? actualResult.EpisodeTitle : actualResult.ProgTitle;\r
+            model.MediaDescription = actualResult.EpisodeDescription;\r
         }\r
 \r
         private void FillTheModelFromOctopus(ArchiveMetadataModel model) {\r
             string id = selectedMetadata.ID;\r
             OctopusAPI api = octopusIDSelector.GetClient();\r
-            List<Story> stories = api.GetStoriesById(id).ToList();\r
+            IEnumerable<Story> storyEnum = api.GetStoriesById(id);\r
+            if (storyEnum != null) {\r
+                FillModelFromStories(model, storyEnum.ToList(), api);\r
+            } else {\r
+                //List<MosObject> mosObjectsEnum = api.GetMosObjectsByID(id).ToList();\r
+                //MosObject mosObject = mosObjectsEnum[0];\r
+                List<Story> stories = api.GetStoriesByPlaceHolderId(id).ToList();\r
+                FillModelFromStories(model, stories, api);\r
+                //todo ha mosObject, mivel töltsem fel a model-t?\r
+            }\r
+        }\r
+\r
+        private void FillModelFromStories(ArchiveMetadataModel model, List<Story> stories, OctopusAPI api) {\r
             Story story = stories[0];\r
             if (story.StoryFolders != null) {\r
-                List<StoryFolder> storyFolders = api.GetStoryFoldersByStoryID(id).ToList();\r
-                //lehet több mappában is a story?\r
+                List<StoryFolder> storyFolders = api.GetStoryFoldersByStoryID(story.ID).ToList();\r
                 StoryFolder folder = storyFolders[0];\r
                 model.StuffID = folder.ID;\r
                 model.StuffTitle = folder.Name;\r
+                //leírás a story body a jsonos\r
             } else if (story.Rundowns != null) {\r
-                List<Rundown> rundowns = api.GetRundownsByStoryID(id).ToList();\r
+                List<Rundown> rundowns = api.GetRundownsByStoryID(story.ID).ToList();\r
                 Rundown rundown = rundowns[0];\r
                 model.StuffID = rundown.ID;\r
                 model.StuffTitle = rundown.Name;\r
@@ -101,7 +132,6 @@ namespace Maestro {
             model.MediaID = story.ID;\r
             model.MediaTitle = story.Name;\r
             model.MediaDescription = story.Script;\r
-\r
         }\r
 \r
         private IDTypes GetTypeOfSelectedMetadata() {\r
index 85b168e750392e63d6bddee92f3c8442153e653f..40143ba12333bf6701553290881dbdacde6e7c90 100644 (file)
@@ -46,7 +46,7 @@ namespace Maestro {
                             //ISourceItem actualFile =  new FileSourceItem() { FileInfo = new System.IO.FileInfo(actual), };\r
                             ISourceItem selectedFile = GetSourceItemFromBindingSource(actual);//bindingSource.Current as ISourceItem;\r
                             string id = selectedMetadata.ID;\r
-                            object[] parameters = new object[] { this, Configuration.Source, target, selectedFile.Name, id, segments };\r
+                            object[] parameters = new object[] { this, Configuration.Source, target, selectedFile.Name, id, segments, mediaCubeApi };\r
                             ITargetProcessor processor = (ITargetProcessor)Activator.CreateInstance(type, parameters);\r
                             processors.Add(processor);\r
                         }\r
index 17eef4eb2dc33a1375b3d542d13e1d33a67381c7..1aa547719bffd24137ffbcb3f45fb89c8c89cd36 100644 (file)
@@ -41,7 +41,7 @@
     {\r
       "$type": "MediaCubeMetadata",\r
       "server": {\r
-        "address": "ftp://localhost:21/out",\r
+        "address": "http://localhost:8080/services/rest/jobengine/",\r
         "userName": "dani",\r
         "password": "dani"\r
       }\r
index 149865203579863431f61d7e97b8b64d6189b3f4..127416c51b832d25313deece2673a7ff780c4ffe 100644 (file)
@@ -41,7 +41,7 @@
     {\r
       "$type": "MediaCubeMetadata",\r
       "server": {\r
-        "address": "ftp://localhost:21/out",\r
+        "address": "http://localhost:8080/services/rest/jobengine/",\r
         "userName": "dani",\r
         "password": "dani"\r
       }\r
index 4fac1aa3bc7e6b1383c7be2310e7d661604fab38..92298b063ae10adf78bc5b779588971fd22a988c 100644 (file)
@@ -28,7 +28,6 @@ namespace Maestro.Sources {
         public DataGridViewColumn[] Columns {\r
             get {\r
                 DataGridViewColumn[] result = new DataGridViewColumn[] {\r
-                    //todo DataPropertyName-et is át kell írni?\r
                     new DataGridViewTextBoxColumn(){\r
                         DataPropertyName = "Name",\r
                         HeaderText = StringResources.NEV,\r
index d881d91f5f0b5fa8173f89454e353aba65dc3eae..bebdde15c6599b46cd9cb947da822f23399e1174 100644 (file)
@@ -8,6 +8,7 @@ using System.Windows.Forms;
 using System.Collections.Generic;\r
 using TrafficClient;\r
 using Model;\r
+using JobEngineClient;\r
 \r
 namespace Maestro.Targets {\r
 \r
@@ -24,10 +25,13 @@ namespace Maestro.Targets {
         protected FtpClient targetFTP;\r
         protected FileInfo inputFile;\r
         private string workingDir;\r
+        private MediaCubeApi mediaCubeApi;\r
+\r
         public WorkflowAction workFlowAction { get; set; }\r
 \r
-        public FTPTargetProcessor(Control parent, Source sourceConfig, Target targetConfig, string inputFileName, string id, List<Segment> segments) : base(parent, targetConfig, segments) {\r
+        public FTPTargetProcessor(Control parent, Source sourceConfig, Target targetConfig, string inputFileName, string id, List<Segment> segments, MediaCubeApi mediaCubeApi) : base(parent, targetConfig, segments) {\r
             FtpTrace.LogFunctions = false;\r
+            this.mediaCubeApi = mediaCubeApi;\r
             this.targetConfig = targetConfig;\r
             Uri inputUri = new Uri(String.Format("{0}/{1}", sourceConfig.Local.Address.LocalPath, inputFileName));\r
             inputFile = new FileInfo(inputUri.LocalPath); \r
@@ -67,11 +71,20 @@ namespace Maestro.Targets {
                 TerminateClient(targetFTP);\r
                 Finished = DateTime.Now;\r
                 workFlowAction.finished = Finished;\r
+                SendWorkFlowAction();\r
             }\r
             logger.Info(PROCESSING_COMPLETED, inputFile.Name);\r
             return result;\r
         }\r
 \r
+        private void SendWorkFlowAction() {\r
+            try {\r
+                mediaCubeApi.Create(workFlowAction);\r
+            } catch (Exception e) {\r
+                MessageBox.Show(parent , e.Message);\r
+            }\r
+        }\r
+\r
         private void SetSubFolder(Connection connection) {\r
             Uri address = connection.Address;\r
             if (targetConfig.CreateSubFolder)\r
index 8702450c4656f989d088a56604c742059034cccb..5d405dca9bbe58b628431b28220273cbe0058a11 100644 (file)
@@ -8,6 +8,7 @@ using System.Threading;
 using System.Windows.Forms;\r
 using System.Collections.Generic;\r
 using TrafficClient;\r
+using JobEngineClient;\r
 \r
 namespace Maestro.Targets {\r
 \r
@@ -15,8 +16,8 @@ namespace Maestro.Targets {
         private Logger logger = LogManager.GetCurrentClassLogger();\r
         private Source sourceConfig;\r
 \r
-        public FXPTargetProcessor(Control parent, Source sourceConfig, Target targetConfig, string inputFileName, string id, List<Segment> segments) :\r
-            base(parent, sourceConfig, targetConfig, inputFileName, id, segments) {\r
+        public FXPTargetProcessor(Control parent, Source sourceConfig, Target targetConfig, string inputFileName, string id, List<Segment> segments, MediaCubeApi mediaCubeApi ) :\r
+            base(parent, sourceConfig, targetConfig, inputFileName, id, segments, mediaCubeApi) {\r
             this.sourceConfig = sourceConfig;\r
         }\r
 \r
index 14a0890405177dff5f4b8a02c5f040d904f56a2c..1488d3c1554d32a1eaffcad3a9713bad19b63810 100644 (file)
@@ -18,8 +18,8 @@ namespace Maestro.Targets {
         private DateTime finished;\r
         private string input;\r
         private string output;\r
-        private Control parent;\r
         private int progress;\r
+        protected Control parent;\r
         protected Target targetConfig;\r
         protected TrafficAPI client;\r
         protected List<Segment> segments;\r
similarity index 93%
rename from client/MediaCubeClient/JobEngineAPI.cs
rename to client/MediaCubeClient/MediaCubeApi.cs
index 05cfea47c1e3aa06864f50add9082cfd576882fa..646e4385d5febb6a48fb7720ac155bb85e6fe476 100644 (file)
@@ -10,7 +10,7 @@ using System.Net;
 using System.Runtime.Serialization;\r
 \r
 namespace JobEngineClient {\r
-    public class JobEngineAPI {\r
+    public class MediaCubeApi {\r
         private const string DATEFORMAT = "yyyy'-'MM'-'dd'T'HH':'mm':'ssK";\r
         private static Logger logger = LogManager.GetCurrentClassLogger();\r
         private RestClient client;\r
@@ -18,7 +18,7 @@ namespace JobEngineClient {
         private string user;\r
         private string pwd;\r
 \r
-        public JobEngineAPI(string address, string user, string pwd, int timeout) {\r
+        public MediaCubeApi(string address, string user, string pwd, int timeout) {\r
             this.user = user;\r
             this.pwd = pwd;\r
             client = new RestClient(address) {\r
index e85df700137785b68d5b5dc0eb03f1d3ddf15678..3579d9c7bd94b13f46af5f08e995f3fb2857175b 100644 (file)
@@ -62,7 +62,7 @@
     </Reference>\r
   </ItemGroup>\r
   <ItemGroup>\r
-    <Compile Include="JobEngineAPI.cs" />\r
+    <Compile Include="MediaCubeApi.cs" />\r
     <Compile Include="NexioAPI.cs" />\r
     <Compile Include="NotificationMessage.cs" />\r
     <Compile Include="Notifier.cs" />\r
index d4a50db04d48d22441f79a382202309c87532d02..f23fda47e13fbc2a53a25de8b463506dc8ed925b 100644 (file)
@@ -336,7 +336,6 @@ namespace OctopusClient {
             return result;\r
         }\r
 \r
-\r
         public IEnumerable<MosObject> GetMosObjectsByID(String id) {\r
             IEnumerable<MosObject> result = null;\r
             try {\r
@@ -363,5 +362,90 @@ namespace OctopusClient {
             catch (Exception e) { }\r
             return result;\r
         }\r
+\r
+        public IEnumerable<Rundown> GetRundownsByPlaceHolderId(string placeHolderID) {\r
+            IEnumerable<Rundown> result = null;\r
+            try {\r
+                var request = new RestRequest("getRundownsByPlaceHolderId/{id}", Method.GET);\r
+                request.AddParameter("id", placeHolderID, ParameterType.UrlSegment);\r
+                var response = client.Execute<JsonArray>(request);\r
+                if (response.ContentLength == 0)\r
+                    return null;\r
+                JArray resultObject = JArray.Parse(response.Content);\r
+\r
+                result = resultObject.Children().Select(d => {\r
+                    Rundown r = new Rundown {\r
+                        ID = d["id"].ToString(),\r
+                        Name = d["name"].ToString(),\r
+                        Start = d["scheduledStart"].ToString()\r
+                    };\r
+                    logger.Debug($"{r}");\r
+                    return r;\r
+                });\r
+            }\r
+            catch (Exception e) {\r
+                //log e.Message ??\r
+            }\r
+            return result;\r
+        }\r
+\r
+        public IEnumerable<StoryFolder> GetStoryFoldersByPlaceHolderId(string placeHolderID) {\r
+            IEnumerable<StoryFolder> result = null;\r
+            try {\r
+                var request = new RestRequest("getStoryFoldersByPlaceHolderId/{id}", Method.GET);\r
+                request.AddParameter("id", placeHolderID, ParameterType.UrlSegment);\r
+                var response = client.Execute<JsonArray>(request);\r
+                if (response.ContentLength == 0)\r
+                    return null;\r
+                JArray resultObject = JArray.Parse(response.Content);\r
+\r
+                result = resultObject.Children().Select(d => {\r
+                    StoryFolder r = new StoryFolder {\r
+                        ID = d["id"].ToString(),\r
+                        Name = d["name"].ToString()\r
+                    };\r
+                    logger.Debug($"{r}");\r
+                    return r;\r
+                });\r
+            }\r
+            catch (Exception e) {\r
+                //log e.Message ??\r
+            }\r
+            return result;\r
+        }\r
+\r
+        public IEnumerable<Story> GetStoriesByPlaceHolderId(string placeHolderID) {\r
+            IEnumerable<Story> result = null;\r
+            try {\r
+                var request = new RestRequest("getStoriesByPlaceHolderId/{id}", Method.GET);\r
+                request.AddParameter("id", placeHolderID, ParameterType.UrlSegment);\r
+                var response = client.Execute<JsonArray>(request);\r
+                if (response.ContentLength == 0)\r
+                    return null;\r
+                JArray resultObject = JArray.Parse(response.Content);\r
+\r
+                result = resultObject.Children().Select(d => {\r
+                    List<MosObject> objs = GetMosObjectsFromStory(d);\r
+                    Story r = new Story {\r
+                        ID = d["id"].ToString(),\r
+                        Name = d["name"].ToString(),\r
+                        MosObjects = objs.ToArray()\r
+                    };\r
+                    if (d["script"] != null) {\r
+                        r.Script = d["script"].ToString();\r
+                    }\r
+                    if (d["story_folder"] != null)\r
+                        r.StoryFolders = GetStoryFolderFromStory(d).ToArray();\r
+                    if (d["rundown"] != null)\r
+                        r.Rundowns = GetRundownFromStory(d).ToArray();\r
+                    logger.Debug($"{r}");\r
+                    return r;\r
+                }).OrderBy(r => {\r
+                    return r.ID;\r
+                });\r
+            }\r
+            catch (Exception e) { }\r
+            return result;\r
+        }\r
     }\r
 }\r
diff --git a/client/PlanAIRClient/CustomDataGridView.Designer.cs b/client/PlanAIRClient/CustomDataGridView.Designer.cs
new file mode 100644 (file)
index 0000000..02f57b1
--- /dev/null
@@ -0,0 +1,33 @@
+namespace TrafficClient {\r
+    partial class CustomDataGridView {\r
+        /// <summary> \r
+        /// Required designer variable.\r
+        /// </summary>\r
+        private System.ComponentModel.IContainer components = null;\r
+\r
+        /// <summary> \r
+        /// Clean up any resources being used.\r
+        /// </summary>\r
+        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>\r
+        protected override void Dispose(bool disposing) {\r
+            if (disposing && (components != null)) {\r
+                components.Dispose();\r
+            }\r
+            base.Dispose(disposing);\r
+        }\r
+\r
+        #region Component Designer generated code\r
+\r
+        /// <summary> \r
+        /// Required method for Designer support - do not modify \r
+        /// the contents of this method with the code editor.\r
+        /// </summary>\r
+        private void InitializeComponent() {\r
+            components = new System.ComponentModel.Container();\r
+            //this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;\r
+            \r
+        }\r
+\r
+        #endregion\r
+    }\r
+}\r
diff --git a/client/PlanAIRClient/CustomDataGridView.cs b/client/PlanAIRClient/CustomDataGridView.cs
new file mode 100644 (file)
index 0000000..271d56b
--- /dev/null
@@ -0,0 +1,24 @@
+using System;\r
+using System.Collections.Generic;\r
+using System.ComponentModel;\r
+using System.Drawing;\r
+using System.Data;\r
+using System.Linq;\r
+using System.Text;\r
+using System.Threading.Tasks;\r
+using System.Windows.Forms;\r
+\r
+namespace TrafficClient {\r
+    public partial class CustomDataGridView : DataGridView {\r
+        public CustomDataGridView() {\r
+            InitializeComponent();\r
+            this.HorizontalScrollBar.Visible = true;\r
+            this.HorizontalScrollBar.VisibleChanged += new EventHandler(HorizontalScrollBar_VisibleChanged);\r
+            //this.HorizontalScrollBar.SetBounds(this.HorizontalScrollBar.Location.X, this.HorizontalScrollBar.Location.Y, this.VerticalScrollBar.Width, this.Height);\r
+        }\r
+\r
+        void HorizontalScrollBar_VisibleChanged(object sender, EventArgs e) {\r
+            this.VerticalScrollBar.Visible = true;\r
+        }\r
+    }\r
+}\r
index cdd7dcd8a41d1e8533f044a9d3fae8a39b92d2b8..f35d04143b1ad1a49d9b94b98166714d93ffec4b 100644 (file)
@@ -123,6 +123,15 @@ namespace TrafficClient {
             }\r
         }\r
         \r
+        /// <summary>\r
+        ///   Looks up a localized string similar to Következő adás időpontja.\r
+        /// </summary>\r
+        internal static string KOVETKEZO_ADASNAP {\r
+            get {\r
+                return ResourceManager.GetString("KOVETKEZO_ADASNAP", resourceCulture);\r
+            }\r
+        }\r
+        \r
         /// <summary>\r
         ///   Looks up a localized string similar to Mégse.\r
         /// </summary>\r
index ca7578ac568001cdbb6f287a5101a4012dd8eebc..97497eeef9dc0815657d5c94a5ce8a9efbb97414 100644 (file)
   <data name="KERESES_EREDMENYE" xml:space="preserve">\r
     <value>Keresés eredménye</value>\r
   </data>\r
+  <data name="KOVETKEZO_ADASNAP" xml:space="preserve">\r
+    <value>Következő adás időpontja</value>\r
+  </data>\r
   <data name="MEGSE" xml:space="preserve">\r
     <value>Mégse</value>\r
   </data>\r
index ecb0c3ff9c98f2fd73e340005eee6a064556635c..038f2b622ee094714e1ca8e6bfe1af8a168a1b07 100644 (file)
@@ -18,53 +18,6 @@ namespace TrafficClient {
             cliFSPReader = new CliFSPReader();\r
         }\r
 \r
-        //public List<MamResultWrapper> DateSearch(DateTime from, DateTime to)\r
-        //{\r
-        //    List<clIFsp_EC_MAMResult> sqlResult = null;\r
-        //    List<MamResultWrapper> result = null;\r
-        //    SqlConnection connection = new SqlConnection(connectionString);\r
-\r
-        //    try\r
-        //    {\r
-        //        //ez kell?\r
-        //        if (connection.State != ConnectionState.Open)\r
-        //        {\r
-        //            connection.Close();\r
-        //            connection.Open();\r
-        //        }\r
-\r
-        //        using (SqlCommand cmd = new SqlCommand("dbo.clIFsp_EC_MAM", connection))\r
-        //        {\r
-        //            cmd.CommandType = CommandType.StoredProcedure;\r
-        //            cmd.Parameters.AddWithValue("@Operation", 1001);\r
-        //            cmd.Parameters.AddWithValue("@@@Options", 0);\r
-        //            cmd.Parameters.AddWithValue("@@ItemID", DBNull.Value);\r
-        //            cmd.Parameters.AddWithValue("@@DateParam1", from.Date);\r
-        //            cmd.Parameters.AddWithValue("@@DateParam2", to.Date);\r
-        //            using (SqlDataReader reader = cmd.ExecuteReader())\r
-        //            {\r
-        //                while (reader.Read())\r
-        //                {\r
-        //                    if (sqlResult == null)\r
-        //                        sqlResult = new List<clIFsp_EC_MAMResult>();\r
-        //                    clIFsp_EC_MAMResult item = ToclIFsp_MAMResult(reader);\r
-        //                    sqlResult.Add(item);\r
-        //                }\r
-        //            }\r
-        //        }\r
-        //        result = resultProcess(sqlResult);\r
-        //    }\r
-        //    catch (Exception e)\r
-        //    {\r
-        //        Debug.WriteLine(e.Message);\r
-        //    }\r
-        //    finally\r
-        //    {\r
-        //        connection.Close();\r
-        //    }\r
-        //    return result;\r
-        //}\r
-\r
         public List<MamResultWrapper> Search(string strParam, DateTime? from, DateTime? to, bool missingCopia) {\r
             List<clIFsp_EC_MAMResult> sqlResult = null;\r
             List<MamResultWrapper> result = null;\r
@@ -118,7 +71,9 @@ namespace TrafficClient {
                     EpisodeTitle = actual.v_EpTitle,\r
                     Title = actual.v_ProgTitle,\r
                     EpisodeNumber = actual.v_EpisodeID,\r
-                    VariantID = actual.v_VariantID.HasValue ? actual.v_VariantID.Value : -1\r
+                    VariantID = actual.v_VariantID.HasValue ? actual.v_VariantID.Value : -1,\r
+                    Episode = actual.v_Episode.HasValue ? actual.v_Episode.Value : (short)-1,\r
+                    NextBroadcastDate = actual.v_NextBroadcastDate\r
                 };\r
                 result.Add(actualObject);\r
             }\r
@@ -268,5 +223,46 @@ namespace TrafficClient {
             }\r
             return result;\r
         }\r
+\r
+        public List<ArchiveMatadataWrapper> SearchArchiveMetadata(string strParam) {\r
+            List<clIFsp_EC_MAMResult> sqlResult = null;\r
+            List<ArchiveMatadataWrapper> result = null;\r
+            try {\r
+                TryConnect();\r
+                using (SqlCommand cmd = new SqlCommand("dbo.clIFsp_EC_MAM", connection)) {\r
+                    cmd.CommandType = CommandType.StoredProcedure;\r
+                    cmd.Parameters.AddWithValue("@Operation", 1001);\r
+                    cmd.Parameters.AddWithValue("@@@Options", 40);\r
+                    cmd.Parameters.AddWithValue("@@ItemID", DBNull.Value);\r
+                    cmd.Parameters.AddWithValue("@@StrParam1", strParam);\r
+                    sqlResult = ExecuteAndRead(cmd);\r
+                    result = ProcessArchiveResult(sqlResult);\r
+                }\r
+            }\r
+            catch (Exception e) {\r
+                logger.Error(e.Message);\r
+                throw e;\r
+            }\r
+            finally {\r
+                connection.Close();\r
+            }\r
+            return result;\r
+        }\r
+\r
+        private List<ArchiveMatadataWrapper> ProcessArchiveResult(List<clIFsp_EC_MAMResult> sqlResult) {\r
+            if (sqlResult == null)\r
+                return null;\r
+            List<ArchiveMatadataWrapper> result = new List<ArchiveMatadataWrapper>();\r
+            foreach (clIFsp_EC_MAMResult actual in sqlResult) {\r
+                ArchiveMatadataWrapper actualObject = new ArchiveMatadataWrapper() {\r
+                    EpisodeID = actual.v_EpisodeID,\r
+                    EpisodeTitle = actual.v_EpTitle,\r
+                    ProgID = actual.v_ProgrammeID.ToString(),\r
+                    ProgTitle = actual.v_ProgTitle,\r
+                };\r
+                result.Add(actualObject);\r
+            }\r
+            return result;\r
+        }\r
     }\r
 }\r
index ad10b1f9a66360612fed76328bebef18f1fd461e..50e66513f2925991638379132f4b37cd4cafa95d 100644 (file)
   </ItemGroup>\r
   <ItemGroup>\r
     <Compile Include="clIFsp_EC_SegmentResult.cs" />\r
+    <Compile Include="CustomDataGridView.cs">\r
+      <SubType>Component</SubType>\r
+    </Compile>\r
+    <Compile Include="CustomDataGridView.Designer.cs">\r
+      <DependentUpon>CustomDataGridView.cs</DependentUpon>\r
+    </Compile>\r
     <Compile Include="Reader.cs" />\r
     <Compile Include="Resources.Designer.cs">\r
       <AutoGen>True</AutoGen>\r
index 59c06c81b664facd2a865e41d90fdb3771bf06e8..9b3c8441a382dc58537a4b37dd3e08f267451ef7 100644 (file)
         private void InitializeComponent()\r
         {\r
             this.components = new System.ComponentModel.Container();\r
-            System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle();\r
             this.trafficAPIBindingSource = new System.Windows.Forms.BindingSource(this.components);\r
             this.backgroundWorker1 = new System.ComponentModel.BackgroundWorker();\r
             this.backgroundWorker2 = new System.ComponentModel.BackgroundWorker();\r
             this.backgroundWorker3 = new System.ComponentModel.BackgroundWorker();\r
             this.backgroundWorker4 = new System.ComponentModel.BackgroundWorker();\r
-            this.dataGridView1 = new System.Windows.Forms.DataGridView();\r
             this.panel1 = new System.Windows.Forms.Panel();\r
+            this.dataGridView1 = new TrafficClient.CustomDataGridView();\r
             this.scheduledDate = new System.Windows.Forms.DateTimePicker();\r
             this.textBox1 = new System.Windows.Forms.TextBox();\r
             this.searchButton = new System.Windows.Forms.Button();\r
             this.tableLayoutPanelSearch = new System.Windows.Forms.TableLayoutPanel();\r
             this.panel2 = new System.Windows.Forms.Panel();\r
             ((System.ComponentModel.ISupportInitialize)(this.trafficAPIBindingSource)).BeginInit();\r
-            ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).BeginInit();\r
             this.panel1.SuspendLayout();\r
+            ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).BeginInit();\r
             this.flowLayoutPanel1.SuspendLayout();\r
             this.tableLayoutPanelSearch.SuspendLayout();\r
             this.panel2.SuspendLayout();\r
             this.SuspendLayout();\r
             // \r
+            // panel1\r
+            // \r
+            this.panel1.Controls.Add(this.dataGridView1);\r
+            this.panel1.Dock = System.Windows.Forms.DockStyle.Fill;\r
+            this.panel1.Location = new System.Drawing.Point(0, 62);\r
+            this.panel1.Name = "panel1";\r
+            this.panel1.Size = new System.Drawing.Size(263, 217);\r
+            this.panel1.TabIndex = 11;\r
+            // \r
             // dataGridView1\r
             // \r
             this.dataGridView1.AllowUserToAddRows = false;\r
             this.dataGridView1.AllowUserToDeleteRows = false;\r
             this.dataGridView1.AllowUserToResizeRows = false;\r
             this.dataGridView1.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.DisplayedCells;\r
-            this.dataGridView1.AutoSizeRowsMode = System.Windows.Forms.DataGridViewAutoSizeRowsMode.DisplayedCells;\r
             this.dataGridView1.BackgroundColor = System.Drawing.Color.White;\r
             this.dataGridView1.BorderStyle = System.Windows.Forms.BorderStyle.None;\r
             this.dataGridView1.CellBorderStyle = System.Windows.Forms.DataGridViewCellBorderStyle.Raised;\r
             this.dataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;\r
-            dataGridViewCellStyle1.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;\r
-            dataGridViewCellStyle1.BackColor = System.Drawing.SystemColors.Window;\r
-            dataGridViewCellStyle1.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));\r
-            dataGridViewCellStyle1.ForeColor = System.Drawing.SystemColors.ControlText;\r
-            dataGridViewCellStyle1.SelectionBackColor = System.Drawing.Color.Gainsboro;\r
-            dataGridViewCellStyle1.SelectionForeColor = System.Drawing.Color.Black;\r
-            dataGridViewCellStyle1.WrapMode = System.Windows.Forms.DataGridViewTriState.False;\r
-            this.dataGridView1.DefaultCellStyle = dataGridViewCellStyle1;\r
             this.dataGridView1.Dock = System.Windows.Forms.DockStyle.Fill;\r
             this.dataGridView1.EditMode = System.Windows.Forms.DataGridViewEditMode.EditProgrammatically;\r
             this.dataGridView1.Location = new System.Drawing.Point(0, 0);\r
-            this.dataGridView1.Margin = new System.Windows.Forms.Padding(6);\r
             this.dataGridView1.MultiSelect = false;\r
             this.dataGridView1.Name = "dataGridView1";\r
-            this.dataGridView1.RowHeadersVisible = false;\r
-            this.dataGridView1.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;\r
             this.dataGridView1.Size = new System.Drawing.Size(263, 217);\r
-            this.dataGridView1.TabIndex = 1;\r
+            this.dataGridView1.TabIndex = 0;\r
             this.dataGridView1.CellContentClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dataGridView1_CellContentClick);\r
             this.dataGridView1.CellDoubleClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dataGridView1_CellDoubleClick);\r
             // \r
-            // panel1\r
-            // \r
-            this.panel1.Controls.Add(this.dataGridView1);\r
-            this.panel1.Dock = System.Windows.Forms.DockStyle.Fill;\r
-            this.panel1.Location = new System.Drawing.Point(0, 62);\r
-            this.panel1.Name = "panel1";\r
-            this.panel1.Size = new System.Drawing.Size(263, 217);\r
-            this.panel1.TabIndex = 11;\r
-            // \r
             // scheduledDate\r
             // \r
             this.scheduledDate.CustomFormat = " ";\r
             this.Name = "TrafficIDSelector";\r
             this.Size = new System.Drawing.Size(263, 279);\r
             ((System.ComponentModel.ISupportInitialize)(this.trafficAPIBindingSource)).EndInit();\r
-            ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).EndInit();\r
             this.panel1.ResumeLayout(false);\r
+            ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).EndInit();\r
             this.flowLayoutPanel1.ResumeLayout(false);\r
             this.flowLayoutPanel1.PerformLayout();\r
             this.tableLayoutPanelSearch.ResumeLayout(false);\r
         private System.ComponentModel.BackgroundWorker backgroundWorker3;\r
         private System.ComponentModel.BackgroundWorker backgroundWorker4;\r
         private System.Windows.Forms.Panel panel1;\r
-        private System.Windows.Forms.DataGridView dataGridView1;\r
         private System.Windows.Forms.DateTimePicker scheduledDate;\r
         private System.Windows.Forms.TextBox textBox1;\r
         private System.Windows.Forms.Button searchButton;\r
         private System.Windows.Forms.RadioButton radioButtonPromo;\r
         private System.Windows.Forms.RadioButton radioButtonAD;\r
         private System.Windows.Forms.Panel panel2;\r
+        private CustomDataGridView dataGridView1;\r
     }\r
 }\r
index 82def78a6f7d22c0a6015d440d4e7d8a86401757..724f73abe85b0c9e630d6782e1b59d0240356696 100644 (file)
@@ -1,6 +1,7 @@
 using System.Windows.Forms;\r
 using System;\r
 using System.Drawing;\r
+using System.ComponentModel;\r
 \r
 namespace TrafficClient {\r
     public delegate void OnSelectedIDChanged(string ID, int variantID);\r
@@ -13,8 +14,9 @@ namespace TrafficClient {
         public TrafficIDSelector() {\r
             InitializeComponent();\r
             InitializeTexts();\r
-            test();\r
+            //test();\r
             panel1.Dock = DockStyle.Fill;\r
+\r
         }\r
 \r
         private void test() {\r
@@ -39,19 +41,24 @@ namespace TrafficClient {
                             HeaderText = Resources.TRAFFIC_ID\r
                     },\r
                     new DataGridViewTextBoxColumn() {\r
-                        AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill,\r
+                        AutoSizeMode = DataGridViewAutoSizeColumnMode.DisplayedCells,\r
                             DataPropertyName = "Title",\r
                             HeaderText = Resources.CIM\r
                     },\r
                     new DataGridViewTextBoxColumn() {\r
-                        AutoSizeMode = DataGridViewAutoSizeColumnMode.ColumnHeader,\r
+                        AutoSizeMode = DataGridViewAutoSizeColumnMode.DisplayedCells,\r
                             DataPropertyName = "EpisodeTitle",\r
                             HeaderText = Resources.EPIZOD_CIM\r
                     },\r
                     new DataGridViewTextBoxColumn() {\r
-                        AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill,\r
-                            DataPropertyName = "EpisodeNumber",\r
+                        AutoSizeMode = DataGridViewAutoSizeColumnMode.DisplayedCells,\r
+                            DataPropertyName = "Episode",\r
                             HeaderText = Resources.EPIZOD\r
+                    },\r
+                    new DataGridViewTextBoxColumn() {\r
+                        AutoSizeMode = DataGridViewAutoSizeColumnMode.DisplayedCells,\r
+                            DataPropertyName = "NextBroadcastDate",\r
+                            HeaderText = Resources.KOVETKEZO_ADASNAP\r
                     }\r
                 }\r
                 );\r
@@ -82,6 +89,7 @@ namespace TrafficClient {
                 return;\r
             }\r
             dataGridView1.DataSource = result;\r
+            //dataGridView1.Sort(dataGridView1.Columns[5], ListSortDirection.Ascending);\r
         }\r
 \r
         private void textBox1_KeyDown(object sender, KeyEventArgs e) {\r
@@ -127,7 +135,7 @@ namespace TrafficClient {
             else\r
                 res.Selected = false;\r
             if (checkBoxCell.Value.Equals(true)) {\r
-                \r
+\r
                 IDChangedEvent?.Invoke(res.MediaID, res.VariantID);\r
             } else\r
                 IDChangedEvent?.Invoke(string.Empty, 0);\r
@@ -147,7 +155,18 @@ namespace TrafficClient {
         public string Title { get; set; }\r
         public string EpisodeTitle { get; set; }\r
         public string EpisodeNumber { get; set; }\r
-\r
         public int VariantID { get; set; }\r
+        public short Episode { get; set; }\r
+        public DateTime? NextBroadcastDate { get; set; }\r
+    }\r
+\r
+    public class ArchiveMatadataWrapper {\r
+\r
+        public string ProgTitle { get; set; }\r
+        public string ProgDescription { get; set; }\r
+        public string ProgID { get; set; }\r
+        public string EpisodeTitle { get; set; }\r
+        public string EpisodeDescription { get; set; }\r
+        public string EpisodeID { get; set; }\r
     }\r
 }\r
index 55e4e722a21865da59834763e94cca94cee9b5bc..542b8b59620d93850da8729967f5db19a4ee7f87 100644 (file)
@@ -23,6 +23,8 @@ public interface IOctopusAPI {
 \r
        List<DBObject> getStoryFoldersByPlaceHolderId(String placeHolderID);\r
        \r
+       List<DBObject> getStoriesByPlaceHolderId(String placeHolderID);\r
+       \r
        List<DBObject> getStories();\r
        \r
        List<DBObject> getStoriesByIDRegex(String id);\r
index d4587c621cbcd6f5ddfcb932eefc1f08878b3932..8a36592cb58cc0d0bca231ad70d4efc37b58c537 100644 (file)
@@ -234,4 +234,20 @@ public class OctopusAPI implements IOctopusAPI {
                }\r
                return mosObjectsResult;\r
        }\r
+\r
+       @Override\r
+       public List<DBObject> getStoriesByPlaceHolderId(String placeHolderID) {\r
+               List<DBObject> result = new ArrayList<>();\r
+               DBCollection storyCollection = db.getCollection(STORY_COLLECTION_NAME);\r
+               DBCollection rundownCollection = db.getCollection(RUNDOWN_COLLECTION_NAME);\r
+               BasicDBObject globalId = new BasicDBObject("id", placeHolderID);\r
+               BasicDBObject elemmatch = new BasicDBObject("$elemMatch", globalId);\r
+               BasicDBObject mosObjects = new BasicDBObject("mosObjects", elemmatch);\r
+               \r
+               DBCursor find = storyCollection.find(mosObjects);\r
+               if(find.hasNext())\r
+                       result.add(find.next());\r
+               //result = getRundownsByReferences(find, rundownCollection, queryedRundownsFromStoryCollection, RUNDOWN);\r
+               return result;\r
+       }\r
 }\r
index 45b0c52694ce2573200257bfbd4e34355208d54e..57a1d4381bd4d34e3687a04701a2f09363094485 100644 (file)
@@ -62,7 +62,16 @@ public class OctopusAPITest {
 \r
                List<DBObject> actual = sut.getStoryFolders(62549297);\r
        }\r
-\r
+       \r
+       @Test\r
+       public void getStoriesByPlaceHolderIdTest() throws SQLException {\r
+               sut = new OctopusAPI();\r
+               \r
+               List<DBObject> actual = sut.getStoriesByPlaceHolderId("1589225");\r
+               \r
+               Assert.assertFalse(actual.isEmpty());\r
+       }\r
+       \r
        @Test\r
        public void getStoryFoldersTest() throws SQLException {\r
                sut = new OctopusAPI();\r
index 857e8a2791a5316f09aa0114480b1156f993b3b5..2db2f3c98e7f2b8da25e89661be0080e71952991 100644 (file)
@@ -173,8 +173,8 @@ public class OctopusRESTService {
                logger.trace("Entry");
                Response result = null;
                try {
-                       List<DBObject> stories = octopusService.getMosObjectsByID(id);
-                       result = Response.ok(stories).build();
+                       List<DBObject> mosObjects = octopusService.getMosObjectsByID(id);
+                       result = Response.ok(mosObjects).build();
                } catch (Exception e) {
                        result = createErrorResponse(e);
                }
@@ -190,8 +190,8 @@ public class OctopusRESTService {
                logger.trace("Entry");
                Response result = null;
                try {
-                       List<DBObject> stories = octopusService.getStoryFolders(Long.parseLong(id));
-                       result = Response.ok(stories).build();
+                       List<DBObject> storyFolders = octopusService.getStoryFolders(Long.parseLong(id));
+                       result = Response.ok(storyFolders).build();
                } catch (Exception e) {
                        result = createErrorResponse(e);
                }
@@ -207,8 +207,42 @@ public class OctopusRESTService {
                logger.trace("Entry");
                Response result = null;
                try {
-                       List<DBObject> stories = octopusService.getRundownByStoryID(Long.parseLong(id));
-                       result = Response.ok(stories).build();
+                       List<DBObject> rundowns = octopusService.getRundownByStoryID(Long.parseLong(id));
+                       result = Response.ok(rundowns).build();
+               } catch (Exception e) {
+                       result = createErrorResponse(e);
+               }
+               logger.trace("Exit");
+               return result;
+       }
+       
+       @GET
+       @Path("/getRundownsByPlaceHolderId/{id}")
+       @Consumes({ MediaType.APPLICATION_JSON })
+       @Produces({ MediaType.APPLICATION_JSON })
+       public Response getRundownsByPlaceHolderId(@PathParam("id") String id) {
+               logger.trace("Entry");
+               Response result = null;
+               try {
+                       List<DBObject> rundowns = octopusService.getRundownsByPlaceHolderId(id);
+                       result = Response.ok(rundowns).build();
+               } catch (Exception e) {
+                       result = createErrorResponse(e);
+               }
+               logger.trace("Exit");
+               return result;
+       }
+       
+       @GET
+       @Path("/getStoryFoldersByPlaceHolderId/{id}")
+       @Consumes({ MediaType.APPLICATION_JSON })
+       @Produces({ MediaType.APPLICATION_JSON })
+       public Response getStoryFoldersByPlaceHolderId(@PathParam("id") String id) {
+               logger.trace("Entry");
+               Response result = null;
+               try {
+                       List<DBObject> storyFolders = octopusService.getStoryFoldersByPlaceHolderId(id);
+                       result = Response.ok(storyFolders).build();
                } catch (Exception e) {
                        result = createErrorResponse(e);
                }
@@ -216,4 +250,20 @@ public class OctopusRESTService {
                return result;
        }
        
+       @GET
+       @Path("/getStoriesByPlaceHolderId/{id}")
+       @Consumes({ MediaType.APPLICATION_JSON })
+       @Produces({ MediaType.APPLICATION_JSON })
+       public Response getStoriesByPlaceHolderId(@PathParam("id") String id) {
+               logger.trace("Entry");
+               Response result = null;
+               try {
+                       List<DBObject> stories = octopusService.getStoriesByPlaceHolderId(id);
+                       result = Response.ok(stories).build();
+               } catch (Exception e) {
+                       result = createErrorResponse(e);
+               }
+               logger.trace("Exit");
+               return result;
+       }
 }
\ No newline at end of file