From 3d8098aebde81de8d3e810da0d11b3b3cd2fc9ba Mon Sep 17 00:00:00 2001 From: =?utf8?q?V=C3=A1s=C3=A1ry=20D=C3=A1niel?= Date: Wed, 25 Oct 2017 22:40:42 +0000 Subject: [PATCH] git-tfs-id: [http://tfs.userrendszerhaz.hu:8080/tfs/DefaultCollection]$/MediaCube;C30672 --- client/AudioRecorder/FileNameForm.cs | 5 +- .../Configuration/configuration-editor.json | 4 +- client/Maestro/MaestroForm.Designer.cs | 197 ++++++++---------- client/Maestro/MaestroForm.Metadata.cs | 14 +- client/Maestro/MaestroForm.Source.cs | 4 +- client/Maestro/MaestroForm.Target.cs | 1 + client/Maestro/MaestroForm.cs | 2 +- client/Maestro/MaestroForm.resx | 3 + client/OctopusClient/OctopusAPI.cs | 1 + client/OctopusClient/OctopusIDSelector.cs | 19 +- .../OctopusLookupResultSelector.cs | 10 +- server/-configuration/scheduledjobs.json | 4 +- server/-product/DEPLOY-README.txt | 9 +- server/-product/log4j2.xml | 12 +- server/-product/mediacube.product | 69 +++--- server/-product/pom.xml | 10 +- .../commons/octopus/OctopusDataMiner.java | 141 ++++++------- .../octopus/test/OctopusDataMinerTest.java | 12 +- .../pages/index.zul | 8 +- 19 files changed, 270 insertions(+), 255 deletions(-) diff --git a/client/AudioRecorder/FileNameForm.cs b/client/AudioRecorder/FileNameForm.cs index 377da3bb..ae58bfaf 100644 --- a/client/AudioRecorder/FileNameForm.cs +++ b/client/AudioRecorder/FileNameForm.cs @@ -18,8 +18,9 @@ namespace AudioRecorder { octopusIDSelector1.Configuration = new OctopusConfiguration() { Address = settings.getAddress(), Password = settings.getPassword(), UserName = settings.getUserName(), Timeout = settings.getTimeout() }; } - private void IdChangedEvent(String id) { - this.id = id; + private void IdChangedEvent(string id, string name) { + //TODO + this.id = name; buttonRendben.Enabled = !String.IsNullOrEmpty(id); } diff --git a/client/Maestro/Configuration/configuration-editor.json b/client/Maestro/Configuration/configuration-editor.json index 00620ca8..d7ccb3a9 100644 --- a/client/Maestro/Configuration/configuration-editor.json +++ b/client/Maestro/Configuration/configuration-editor.json @@ -19,7 +19,7 @@ { "$type": "OctopusMetadata", "server": { - "address": "http://10.10.1.28/services/rest/octopus/", + "address": "http://10.10.1.27/services/rest/octopus/", "timeout": 1000 } }, @@ -35,7 +35,7 @@ { "$type": "MediaCubeMetadata", "server": { - "address": "http://10.10.1.28/services/rest/jobengine/", + "address": "http://10.10.1.27/services/rest/jobengine/", "timeout": 1000 } } diff --git a/client/Maestro/MaestroForm.Designer.cs b/client/Maestro/MaestroForm.Designer.cs index 99f3fbe5..789ec690 100644 --- a/client/Maestro/MaestroForm.Designer.cs +++ b/client/Maestro/MaestroForm.Designer.cs @@ -33,12 +33,12 @@ namespace Maestro { System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle7 = new System.Windows.Forms.DataGridViewCellStyle(); System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle8 = new System.Windows.Forms.DataGridViewCellStyle(); System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle9 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle5 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle6 = new System.Windows.Forms.DataGridViewCellStyle(); System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle10 = new System.Windows.Forms.DataGridViewCellStyle(); System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle11 = new System.Windows.Forms.DataGridViewCellStyle(); System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle12 = new System.Windows.Forms.DataGridViewCellStyle(); System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle13 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle5 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle6 = new System.Windows.Forms.DataGridViewCellStyle(); this.groupSource = new System.Windows.Forms.GroupBox(); this.dataGridSource = new System.Windows.Forms.DataGridView(); this.bindingSource = new System.Windows.Forms.BindingSource(this.components); @@ -74,15 +74,6 @@ namespace Maestro { this.tabControl2 = new System.Windows.Forms.TabControl(); this.tabPage1 = new System.Windows.Forms.TabPage(); this.dataGridJobs = new System.Windows.Forms.DataGridView(); - this.columnLabel = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.columnID = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.columnStatus = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.columnProgress = new Maestro.Commons.DataGridViewProgressColumn(); - this.columnStarted = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.columnFinished = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.columnInput = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.columnOutput = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.columnKillDate = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.bindingSourceJobs = new System.Windows.Forms.BindingSource(this.components); this.tabPage2 = new System.Windows.Forms.TabPage(); this.dataGridMessages = new System.Windows.Forms.DataGridView(); @@ -90,8 +81,16 @@ namespace Maestro { this.Level = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.messageDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.systemMessageBindingSource = new System.Windows.Forms.BindingSource(this.components); - this.columnProgress = new Maestro.Commons.DataGridViewProgressColumn(); this.metadataInfoBindingSource = new System.Windows.Forms.BindingSource(this.components); + this.columnLabel = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.columnID = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.Progress = new Maestro.Commons.DataGridViewProgressColumn(); + this.columnStatus = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.columnStarted = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.columnFinished = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.columnInput = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.columnOutput = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.columnKillDate = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.groupSource.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.dataGridSource)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.bindingSource)).BeginInit(); @@ -621,18 +620,19 @@ namespace Maestro { this.dataGridJobs.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { this.columnLabel, this.columnID, + this.Progress, this.columnStatus, - this.columnProgress, this.columnStarted, this.columnFinished, this.columnInput, this.columnOutput, this.columnKillDate}); this.dataGridJobs.DataSource = this.bindingSourceJobs; - dataGridViewCellStyle7.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; + dataGridViewCellStyle7.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; dataGridViewCellStyle7.BackColor = System.Drawing.SystemColors.Window; dataGridViewCellStyle7.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); dataGridViewCellStyle7.ForeColor = System.Drawing.SystemColors.ControlText; + dataGridViewCellStyle7.NullValue = null; dataGridViewCellStyle7.SelectionBackColor = System.Drawing.Color.Gainsboro; dataGridViewCellStyle7.SelectionForeColor = System.Drawing.Color.Black; dataGridViewCellStyle7.WrapMode = System.Windows.Forms.DataGridViewTriState.False; @@ -659,91 +659,6 @@ namespace Maestro { this.dataGridJobs.CellEnter += new System.Windows.Forms.DataGridViewCellEventHandler(this.dataGridJobs_CellEnter); this.dataGridJobs.MouseClick += new System.Windows.Forms.MouseEventHandler(this.dataGridJobs_MouseClick); // - // columnLabel - // - this.columnLabel.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells; - this.columnLabel.DataPropertyName = "Label"; - this.columnLabel.Frozen = true; - this.columnLabel.HeaderText = "Label"; - this.columnLabel.Name = "columnLabel"; - this.columnLabel.Width = 63; - // - // columnID - // - this.columnID.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells; - this.columnID.DataPropertyName = "ID"; - dataGridViewCellStyle5.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); - this.columnID.DefaultCellStyle = dataGridViewCellStyle5; - this.columnID.Frozen = true; - this.columnID.HeaderText = "ID"; - this.columnID.Name = "columnID"; - this.columnID.Width = 44; - // - // columnStatus - // - this.columnStatus.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells; - this.columnStatus.DataPropertyName = "Status"; - dataGridViewCellStyle6.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); - this.columnStatus.DefaultCellStyle = dataGridViewCellStyle6; - this.columnStatus.Frozen = true; - this.columnStatus.HeaderText = "Status"; - this.columnStatus.Name = "columnStatus"; - this.columnStatus.Width = 66; - // - // columnProgress - // - this.columnProgress.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None; - this.columnProgress.DataPropertyName = "Progress"; - dataGridViewCellStyle7.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - dataGridViewCellStyle7.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); - dataGridViewCellStyle7.NullValue = null; - this.columnProgress.DefaultCellStyle = dataGridViewCellStyle7; - this.columnProgress.HeaderText = "Progress"; - this.columnProgress.Name = "columnProgress"; - this.columnProgress.Resizable = System.Windows.Forms.DataGridViewTriState.True; - this.columnProgress.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic; - this.columnProgress.Width = 200; - // - // columnStarted - // - this.columnStarted.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells; - this.columnStarted.DataPropertyName = "Started"; - this.columnStarted.HeaderText = "Started"; - this.columnStarted.Name = "columnStarted"; - this.columnStarted.Width = 71; - // - // columnFinished - // - this.columnFinished.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells; - this.columnFinished.DataPropertyName = "Finished"; - this.columnFinished.HeaderText = "Finished"; - this.columnFinished.Name = "columnFinished"; - this.columnFinished.Width = 79; - // - // columnInput - // - this.columnInput.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells; - this.columnInput.DataPropertyName = "Input"; - this.columnInput.HeaderText = "Input"; - this.columnInput.Name = "columnInput"; - this.columnInput.Width = 59; - // - // columnOutput - // - this.columnOutput.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells; - this.columnOutput.DataPropertyName = "Output"; - this.columnOutput.HeaderText = "Output"; - this.columnOutput.Name = "columnOutput"; - this.columnOutput.Width = 68; - // - // columnKillDate - // - this.columnKillDate.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells; - this.columnKillDate.DataPropertyName = "KillDate"; - this.columnKillDate.HeaderText = "KillDate"; - this.columnKillDate.Name = "columnKillDate"; - this.columnKillDate.Width = 75; - // // tabPage2 // this.tabPage2.Controls.Add(this.dataGridMessages); @@ -836,14 +751,86 @@ namespace Maestro { // this.systemMessageBindingSource.DataSource = typeof(Maestro.SystemMessage); // - // columnProgress - // - this.columnProgress.Name = "columnProgress"; - // // metadataInfoBindingSource // this.metadataInfoBindingSource.DataSource = typeof(Maestro.Metadata.MetadataInfo); // + // columnLabel + // + this.columnLabel.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells; + this.columnLabel.DataPropertyName = "Label"; + this.columnLabel.HeaderText = "Label"; + this.columnLabel.Name = "columnLabel"; + this.columnLabel.Width = 63; + // + // columnID + // + this.columnID.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells; + this.columnID.DataPropertyName = "ID"; + dataGridViewCellStyle5.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); + this.columnID.DefaultCellStyle = dataGridViewCellStyle5; + this.columnID.HeaderText = "ID"; + this.columnID.Name = "columnID"; + this.columnID.Width = 44; + // + // Progress + // + this.Progress.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None; + this.Progress.DataPropertyName = "Progress"; + this.Progress.HeaderText = ""; + this.Progress.MinimumWidth = 100; + this.Progress.Name = "Progress"; + // + // columnStatus + // + this.columnStatus.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells; + this.columnStatus.DataPropertyName = "Status"; + dataGridViewCellStyle6.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); + this.columnStatus.DefaultCellStyle = dataGridViewCellStyle6; + this.columnStatus.HeaderText = "Status"; + this.columnStatus.Name = "columnStatus"; + this.columnStatus.Width = 66; + // + // columnStarted + // + this.columnStarted.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells; + this.columnStarted.DataPropertyName = "Started"; + this.columnStarted.HeaderText = "Started"; + this.columnStarted.Name = "columnStarted"; + this.columnStarted.Width = 71; + // + // columnFinished + // + this.columnFinished.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells; + this.columnFinished.DataPropertyName = "Finished"; + this.columnFinished.HeaderText = "Finished"; + this.columnFinished.Name = "columnFinished"; + this.columnFinished.Width = 79; + // + // columnInput + // + this.columnInput.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells; + this.columnInput.DataPropertyName = "Input"; + this.columnInput.HeaderText = "Input"; + this.columnInput.Name = "columnInput"; + this.columnInput.Width = 59; + // + // columnOutput + // + this.columnOutput.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells; + this.columnOutput.DataPropertyName = "Output"; + this.columnOutput.HeaderText = "Output"; + this.columnOutput.Name = "columnOutput"; + this.columnOutput.Width = 68; + // + // columnKillDate + // + this.columnKillDate.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells; + this.columnKillDate.DataPropertyName = "KillDate"; + this.columnKillDate.HeaderText = "KillDate"; + this.columnKillDate.Name = "columnKillDate"; + this.columnKillDate.Width = 75; + // // MaestroForm // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); @@ -944,16 +931,16 @@ namespace Maestro { private System.Windows.Forms.DataGridViewTextBoxColumn timeDataGridViewTextBoxColumn; private System.Windows.Forms.DataGridViewTextBoxColumn Level; private System.Windows.Forms.DataGridViewTextBoxColumn messageDataGridViewTextBoxColumn; + private System.Windows.Forms.Label lbSourceTitle; private System.Windows.Forms.DataGridViewTextBoxColumn columnLabel; private System.Windows.Forms.DataGridViewTextBoxColumn columnID; + private Commons.DataGridViewProgressColumn Progress; private System.Windows.Forms.DataGridViewTextBoxColumn columnStatus; - private Commons.DataGridViewProgressColumn columnProgress; private System.Windows.Forms.DataGridViewTextBoxColumn columnStarted; private System.Windows.Forms.DataGridViewTextBoxColumn columnFinished; private System.Windows.Forms.DataGridViewTextBoxColumn columnInput; private System.Windows.Forms.DataGridViewTextBoxColumn columnOutput; private System.Windows.Forms.DataGridViewTextBoxColumn columnKillDate; - private System.Windows.Forms.Label lbSourceTitle; } } diff --git a/client/Maestro/MaestroForm.Metadata.cs b/client/Maestro/MaestroForm.Metadata.cs index 47d46030..e9bf3d0c 100644 --- a/client/Maestro/MaestroForm.Metadata.cs +++ b/client/Maestro/MaestroForm.Metadata.cs @@ -197,7 +197,9 @@ namespace Maestro { private ArchiveMetadata GetOctopusMetadata() { ArchiveMetadata result = new ArchiveMetadata(); - string id = textSelectedMetadata.Text; + string id = SelectedMetadata?.VariantID.ToString(); + if (String.IsNullOrEmpty(id)) + return null; OctopusAPI api = octopusIDSelector.GetClient(); IEnumerable storyEnum = api.GetStoriesById(id); if (storyEnum != null) @@ -257,17 +259,18 @@ namespace Maestro { return result; } - private void OnOctopusIDSelected(string selectedID) { + private void OnOctopusIDSelected(string id, string name) { trafficIDSelector.ClearSelection(); archiveMetadata = null; - if (selectedID == null) { + if (id == null) { SelectedMetadata = null; return; } SelectedMetadata = new MetadataInfo() { Kind = MetadataType.OctopusStory, Tooltip = "Story ID", - ID = selectedID + ID = name, + VariantID = int.Parse(id) }; UpdateEditArchiveMetadataEnabled(); UpdateDefineSegmentEnabled(); @@ -291,7 +294,8 @@ namespace Maestro { } private void UpdateEditArchiveMetadataEnabled() { - ctxiModifyArchiveMetadata.Enabled = !String.IsNullOrEmpty(textSelectedMetadata.Text); +// ctxiModifyArchiveMetadata.Enabled = !String.IsNullOrEmpty(textSelectedMetadata.Text); + ctxiModifyArchiveMetadata.Enabled = true; } private void UpdateDefineSegmentEnabled() { diff --git a/client/Maestro/MaestroForm.Source.cs b/client/Maestro/MaestroForm.Source.cs index 06e16ef5..9322b1ac 100644 --- a/client/Maestro/MaestroForm.Source.cs +++ b/client/Maestro/MaestroForm.Source.cs @@ -272,7 +272,7 @@ namespace Maestro { if (list.Count == 1) { UpdateEditArchiveMetadataEnabled(); textSelectedMetadata.Text = list[0].ID; - octopusMetadataSelected?.Invoke(list[0].ID); + octopusMetadataSelected?.Invoke(list[0].ID, null); } else { OctopusLookupResultSelector box = new OctopusLookupResultSelector(list, octopusMetadataSelected); box.ShowDialog(); @@ -294,7 +294,7 @@ namespace Maestro { if (list.Count == 1) { UpdateEditArchiveMetadataEnabled(); textSelectedMetadata.Text = list[0].ID; - octopusMetadataSelected?.Invoke(list[0].ID); + octopusMetadataSelected?.Invoke(list[0].ID, null); //octopusIDSelector.IDSelectedFromOutside(list[0].ID); return; } diff --git a/client/Maestro/MaestroForm.Target.cs b/client/Maestro/MaestroForm.Target.cs index 5f3fce01..61304216 100644 --- a/client/Maestro/MaestroForm.Target.cs +++ b/client/Maestro/MaestroForm.Target.cs @@ -214,6 +214,7 @@ namespace Maestro { UpdateDefineSegmentEnabled(); UpdateEditArchiveMetadataEnabled(); UpdateLookupMetadataEnabled(); + archiveMetadata = null; } private void ChangeProcessButtonsState(bool enabled) { diff --git a/client/Maestro/MaestroForm.cs b/client/Maestro/MaestroForm.cs index ea53ee2e..cb2fa09d 100644 --- a/client/Maestro/MaestroForm.cs +++ b/client/Maestro/MaestroForm.cs @@ -70,7 +70,7 @@ namespace Maestro { columnFinished.HeaderText = StringResources.BEFEJEZES; columnInput.HeaderText = StringResources.FORRAS; columnOutput.HeaderText = StringResources.CEL; - columnProgress.HeaderText = StringResources.ALLAPOT; + //columnProgress.HeaderText = StringResources.ALLAPOT; columnStatus.HeaderText = StringResources.STATUSZ; columnLabel.HeaderText = StringResources.CIM; ctxiDefineSegments.Text = StringResources.SZEGMENS_LETREHOZASA; diff --git a/client/Maestro/MaestroForm.resx b/client/Maestro/MaestroForm.resx index b4607954..0592b932 100644 --- a/client/Maestro/MaestroForm.resx +++ b/client/Maestro/MaestroForm.resx @@ -129,6 +129,9 @@ True + + True + True diff --git a/client/OctopusClient/OctopusAPI.cs b/client/OctopusClient/OctopusAPI.cs index 1bf81152..36c05557 100644 --- a/client/OctopusClient/OctopusAPI.cs +++ b/client/OctopusClient/OctopusAPI.cs @@ -304,6 +304,7 @@ namespace OctopusClient { }; if (d["script"] != null) r.Script = d["script"].ToString(); + //script_content if (d["story_folder"] != null) r.StoryFolders = GetStoryFolderFromStory(d).ToArray(); if (d["rundown"] != null) diff --git a/client/OctopusClient/OctopusIDSelector.cs b/client/OctopusClient/OctopusIDSelector.cs index 7bc36b06..2f1f6c2a 100644 --- a/client/OctopusClient/OctopusIDSelector.cs +++ b/client/OctopusClient/OctopusIDSelector.cs @@ -8,7 +8,7 @@ using System.Drawing; using System.Runtime.InteropServices; namespace OctopusClient { - public delegate void OnSelectedIDChanged(string ID); + public delegate void OnSelectedIDChanged(string id, string name); public delegate void ClearCheckBox(); public delegate void OctopusErrorReporterDelegate(DateTime time, String level, String message, Color color); @@ -68,7 +68,8 @@ namespace OctopusClient { HideCheckBox(treeOctopus, actualNode); MosObject[] mosObjects = story.MosObjects; foreach (MosObject mosObject in mosObjects) { - actualNode.Nodes.Add(mosObject.ID, mosObject.ID); + TreeNode node = actualNode.Nodes.Add(mosObject.ObjID, String.Format($"{mosObject.ObjID}")); + node.Tag = mosObject.ID; } } selectedRundownIndex = comboRudowns.SelectedIndex; @@ -89,8 +90,10 @@ namespace OctopusClient { TreeNode actualNode = treeOctopus.Nodes.Add(story.ID, String.Format($"{story.ID} {story.Name}")); HideCheckBox(treeOctopus, actualNode); MosObject[] mosObjects = story.MosObjects; - foreach (MosObject mosObject in mosObjects) - actualNode.Nodes.Add(mosObject.ID, mosObject.ID); + foreach (MosObject mosObject in mosObjects) { + TreeNode node = actualNode.Nodes.Add(mosObject.ObjID, String.Format($"{mosObject.ObjID}")); + node.Tag = mosObject.ID; + } } selectedStoryFolderIndex = comboStoryFolder.SelectedIndex; } @@ -193,7 +196,7 @@ namespace OctopusClient { } private void OnTreeAfterCheck(object sender, TreeViewEventArgs e) { - logger.Debug("Handling {0} {1}", e.Node.Name, e.Node.Text); + logger.Debug("Handling {0} {1} {2}", e.Node.Name, e.Node.Text, e.Node.Checked); if (e.Node.Level == 0) { if (e.Node.Checked) { e.Node.Checked = false; @@ -206,8 +209,10 @@ namespace OctopusClient { selectedNode = e.Node; treeOctopus.SelectedNode = selectedNode; } - id = selectedNode.Checked ? selectedNode.Name : null; - IDChangedEvent?.Invoke(id); + if (selectedNode.Checked) + IDChangedEvent?.Invoke(selectedNode.Tag as string, selectedNode.Name); + else + IDChangedEvent?.Invoke(null, null); } public void IDSelectedFromOutside(string id) { diff --git a/client/OctopusClient/OctopusLookupResultSelector.cs b/client/OctopusClient/OctopusLookupResultSelector.cs index 905c38e1..c7785c96 100644 --- a/client/OctopusClient/OctopusLookupResultSelector.cs +++ b/client/OctopusClient/OctopusLookupResultSelector.cs @@ -2,7 +2,7 @@ using System.Collections.Generic; namespace OctopusClient { - public delegate void OctopusMetadataSelected(string ID); + public delegate void OctopusMetadataSelected(string id, string name); public class OctopusLookupResultSelector : Form { private System.ComponentModel.BackgroundWorker backgroundWorker1; private System.ComponentModel.BackgroundWorker backgroundWorker2; @@ -202,9 +202,9 @@ namespace OctopusClient { Story story = dataGridView1.SelectedRows[0].DataBoundItem as Story; MosObject mosObject = dataGridView1.SelectedRows[0].DataBoundItem as MosObject; if (story != null) - metadataSelected?.Invoke(story.ID); + metadataSelected?.Invoke(story.ID, null); else if (mosObject != null) - metadataSelected?.Invoke(mosObject.ID); + metadataSelected?.Invoke(mosObject.ID, null); Dispose(); //string result = dataGridView1.SelectedCells[row].Value.ToString(); //if (string.IsNullOrEmpty(result)) @@ -224,9 +224,9 @@ namespace OctopusClient { Story story = dataGridView1.Rows[e.RowIndex].DataBoundItem as Story; MosObject mosObject = dataGridView1.Rows[e.RowIndex].DataBoundItem as MosObject; if (story != null) - metadataSelected?.Invoke(story.ID); + metadataSelected?.Invoke(story.ID, null); else if (mosObject != null) - metadataSelected?.Invoke(mosObject.ID); + metadataSelected?.Invoke(mosObject.ID, null); Dispose(); } } diff --git a/server/-configuration/scheduledjobs.json b/server/-configuration/scheduledjobs.json index 0477cf26..a872b482 100644 --- a/server/-configuration/scheduledjobs.json +++ b/server/-configuration/scheduledjobs.json @@ -64,11 +64,11 @@ ] }, { - "active": false, + "active": true, "name" : "OCTOPUS adatok szinkronizálása", "template": "sync-octopus.xml", "executeimmediate": true, - "cronexpression": "0 0 0/1 1/1 * ? *" + "cronexpression": "0 0/2 * * * ?" }, { "active": false, diff --git a/server/-product/DEPLOY-README.txt b/server/-product/DEPLOY-README.txt index 508dba7f..55304477 100644 --- a/server/-product/DEPLOY-README.txt +++ b/server/-product/DEPLOY-README.txt @@ -72,4 +72,11 @@ Windows mapping Selenio ------- - mount -t cifs -o username=root,password=Broadca5T //10.10.1.71/Data/Output/MP4_H264_AAC \ No newline at end of file + mount -t cifs -o username=root,password=Broadca5T //10.10.1.71/Data/Output/MP4_H264_AAC + + +MediaCube +--------- +Schedule + http://www.quartz-scheduler.org/documentation/quartz-2.2.x/configuration/ + https://docs.oracle.com/cd/E12058_01/doc/doc.1014/e12030/cron_expressions.htm \ No newline at end of file diff --git a/server/-product/log4j2.xml b/server/-product/log4j2.xml index fa326f12..52abb418 100644 --- a/server/-product/log4j2.xml +++ b/server/-product/log4j2.xml @@ -1,12 +1,12 @@ - log/mediacube.log - log/$${date:yyyy-MM}/mediacube-%d{MM-dd-yyyy}-%i.log.gz - log/markered-mediacube.log - log/$${date:yyyy-MM}/markered-mediacube-%d{MM-dd-yyyy}-%i.log.gz - log/mediacube-err.log - log/$${date:yyyy-MM}/mediacube-err-%d{MM-dd-yyyy}-%i.log.gz + /opt/mediacube/log/mediacube.log + /opt/mediacube/log/$${date:yyyy-MM}/mediacube-%d{MM-dd-yyyy}-%i.log.gz + /opt/mediacube/log/markered-mediacube.log + /opt/mediacube/log/$${date:yyyy-MM}/markered-mediacube-%d{MM-dd-yyyy}-%i.log.gz + /opt/mediacube/log/mediacube-err.log + /opt/mediacube/log/$${date:yyyy-MM}/mediacube-err-%d{MM-dd-yyyy}-%i.log.gz diff --git a/server/-product/mediacube.product b/server/-product/mediacube.product index 29ee557b..6cce7cfa 100644 --- a/server/-product/mediacube.product +++ b/server/-product/mediacube.product @@ -9,42 +9,43 @@ -consoleLog -console 5555 - -Dfile.encoding=UTF-8 --agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=8888 --Djavax.ws.rs.ext.RuntimeDelegate=org.jboss.resteasy.spi.ResteasyProviderFactory - -#System --Dorg.eclipse.equinox.http.jetty.http.port=80 --Dorg.eclipse.epp.logging.aeri.skipReports=true --Declipse.ignoreApp=true --Dosgi.noShutdown=true --Djetty.home=./configuration/jetty --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 --Dlog4j.configurationFile=./configuration/log4j2.xml --Djobengine.loglevel=INFO --Djobengine.jobsteps.root=./configuration/executors --Djobengine.jobtemplates.root=./configuration/jobtemplates --Djobengine.jobscheduling.config=./configuration/scheduledjobs.json - - #Database --Djobengine.db.url=jdbc:db2://localhost:50000/mc:retrieveMessagesFromServerOnGetMessage=true; --Djobengine.db.user=db2admin --Djobengine.db.password=password --Djobengine.nosql.db.url=jdbc:db2://localhost:50000/mc:retrieveMessagesFromServerOnGetMessage=true; --Djobengine.nosql.db.user=db2admin --Djobengine.nosql.db.password=password --Djobengine.nosql.db.schema=test - -#Octopus --Djobengine.octopus.api.address=http://10.10.1.11/api/v1 --Djobengine.octopus.api.user=mam --Djobengine.octopus.api.password=napocska + -Dfile.encoding=UTF-8 +-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=8888 +-Djavax.ws.rs.ext.RuntimeDelegate=org.jboss.resteasy.spi.ResteasyProviderFactory -#Selenio --Djobengine.selenio.address=http://10.10.1.71:44000/TranscodeMgrWS?wsdl --Djobengine.selenio.projectfilepath=\\10.10.1.71\Data\Blueprints\MP4_H264_AAC_v4.zenium +#System +-Djetty.home=/opt/mediacube/configuration/jetty +-Dlog4j.configurationFile=/opt/mediacube/configuration/log4j2.xml +-Djobengine.jobsteps.root=/opt/mediacube/configuration/executors +-Djobengine.jobtemplates.root=/opt/mediacube/configuration/jobtemplates +-Djobengine.jobscheduling.config=/opt/mediacube/configuration/scheduledjobs.json -#Nexio +-Dorg.eclipse.equinox.http.jetty.http.port=80 +-Dorg.eclipse.epp.logging.aeri.skipReports=true +-Declipse.ignoreApp=true +-Dosgi.noShutdown=true +-Djobengine.loglevel=INFO +-Djetty.etc.config.urls=etc/user-jetty.xml,etc/user-jetty-ssl.xml,etc/user-jetty-ssl-context.xml,etc/user-jetty-http.xml,etc/user-jetty-https.xml + + #Database +-Djobengine.db.url=jdbc:db2://localhost:50000/mc:retrieveMessagesFromServerOnGetMessage=true; +-Djobengine.db.user=db2admin +-Djobengine.db.password=password +-Djobengine.nosql.db.url=jdbc:db2://localhost:50000/mc:retrieveMessagesFromServerOnGetMessage=true; +-Djobengine.nosql.db.user=db2admin +-Djobengine.nosql.db.password=password +-Djobengine.nosql.db.schema=test + +#Octopus +-Djobengine.octopus.api.address=http://10.10.1.11/api/v1 +-Djobengine.octopus.api.user=mam +-Djobengine.octopus.api.password=napocska + +#Selenio +-Djobengine.selenio.address=http://10.10.1.71:44000/TranscodeMgrWS?wsdl +-Djobengine.selenio.projectfilepath=\\10.10.1.71\Data\Blueprints\MP4_H264_AAC_v4.zenium + +#Nexio -Dnexio.host=10.10.1.56 -XstartOnFirstThread -Dorg.eclipse.swt.internal.carbon.smallFonts diff --git a/server/-product/pom.xml b/server/-product/pom.xml index 1cc362ae..2224abe2 100644 --- a/server/-product/pom.xml +++ b/server/-product/pom.xml @@ -274,16 +274,18 @@ /command "open ${remote.address} -hostkey=""${remote.hostkey}""" - "call ${remote.location}/stop-mediacube.sh 2>/dev/null" + + "call pcs resource disable mediacube_script" "call rm -rf ${remote.location}" "call mkdir ${remote.location}" "lcd ${local.location}" "cd ${remote.location}" "synchronize remote" "call chmod +x mediacube" - "call chmod +x stop-mediacube.sh" - "call chmod +x start-mediacube.sh" - "call ./start-mediacube.sh" + "call pcs resource enable mediacube_script" + + + "exit" diff --git a/server/user.jobengine.osgi.commons/src/user/commons/octopus/OctopusDataMiner.java b/server/user.jobengine.osgi.commons/src/user/commons/octopus/OctopusDataMiner.java index bfd3fbf2..7da25a28 100644 --- a/server/user.jobengine.osgi.commons/src/user/commons/octopus/OctopusDataMiner.java +++ b/server/user.jobengine.osgi.commons/src/user/commons/octopus/OctopusDataMiner.java @@ -111,12 +111,12 @@ public class OctopusDataMiner implements Runnable { return result; } - private void checkAndStoreStory(BasicDBObject modifiedStory, Date lastUpdateTime, long storyID, int position, - long referenceID, String referenceName, DBCollection collection) { + private void checkAndStoreStory(BasicDBObject modifiedStory, Date lastUpdateTime, long storyID, int position, long referenceID, String referenceName, + DBCollection collection) { boolean isContains = storyIDs.contains(storyID); if (!isContains) storyIDs.add(storyID); - if (lastUpdateTime != null && !isModified(lastUpdateTime, modifiedStory, MODIFIED)) + if (lastUpdateTime != null && !isModified(lastUpdateTime, modifiedStory)) return; if (isContains) { logger.trace(PROCESSING_MULTI_REFERENCED_STORY_ID + storyID); @@ -134,57 +134,6 @@ public class OctopusDataMiner implements Runnable { collection.save(modifiedStory); } - private String GetScriptContent(BasicDBObject story) { - BasicDBObject script = (BasicDBObject) story.get("script"); - String scriptContent = "text: "; - if (script != null && !script.isEmpty()) { - BasicDBList body = (BasicDBList) script.get("body"); - if (body != null && !body.isEmpty()) - for (Object actualBody : body) { - BasicDBObject actualDBBody = (BasicDBObject) actualBody; - BasicDBList contents = (BasicDBList) actualDBBody.get("content"); - if (contents != null && !contents.isEmpty()) - for (Object actualContent : contents) { - BasicDBObject actualDBContent = (BasicDBObject) actualContent; - scriptContent += GetContent(actualDBContent); - } - } - } - return scriptContent; - } - - private String GetContent(BasicDBObject actualDBContent) { - String type = actualDBContent.getString("type"); - String scriptContent = ""; - switch (type) { - case "text": { - String text = actualDBContent.getString("text"); - if (text != null) - scriptContent += String.format("%s: %s\r\n", type, text.replaceAll("\n", "\r\n")); - break; - } - case "mos": { - BasicDBObject mosObject = (BasicDBObject) actualDBContent.get("object"); - if (mosObject != null && !mosObject.isEmpty()) { - String objID = mosObject.getString("objId"); - scriptContent += String.format("%s %s\r\n", type.toUpperCase(), objID); - } - break; - } - default: { - BasicDBList innerContents = (BasicDBList) actualDBContent.get("content"); - if (innerContents != null && !innerContents.isEmpty()) - for (Object actualInnerContent : innerContents) { - BasicDBObject actualDBInnerContent = (BasicDBObject) actualInnerContent; - if (actualDBInnerContent != null && actualDBInnerContent.isEmpty()) - scriptContent += GetContent(actualDBInnerContent); - } - break; - } - } - return scriptContent; - } - public void clear() { db.getCollection(RUNDOWN_COLLECTION_NAME).remove(); db.getCollection(STORY_COLLECTION_NAME).remove(); @@ -244,6 +193,38 @@ public class OctopusDataMiner implements Runnable { } } + private String GetContent(BasicDBObject actualDBContent) { + String type = actualDBContent.getString("type"); + String scriptContent = ""; + switch (type) { + case "text": { + String text = actualDBContent.getString("text"); + if (text != null) + scriptContent += String.format("%s: %s\r\n", type, text.replaceAll("\n", "\r\n")); + break; + } + case "mos": { + BasicDBObject mosObject = (BasicDBObject) actualDBContent.get("object"); + if (mosObject != null && !mosObject.isEmpty()) { + String objID = mosObject.getString("objId"); + scriptContent += String.format("%s %s\r\n", type.toUpperCase(), objID); + } + break; + } + default: { + BasicDBList innerContents = (BasicDBList) actualDBContent.get("content"); + if (innerContents != null && !innerContents.isEmpty()) + for (Object actualInnerContent : innerContents) { + BasicDBObject actualDBInnerContent = (BasicDBObject) actualInnerContent; + if (actualDBInnerContent != null && actualDBInnerContent.isEmpty()) + scriptContent += GetContent(actualDBInnerContent); + } + break; + } + } + return scriptContent; + } + private Date getLastUpdateTime() { Date result = null; DBCollection collection = db.getCollection(TIME_COLLECTION_NAME); @@ -253,15 +234,34 @@ public class OctopusDataMiner implements Runnable { return result; } - private boolean isModified(Date date, BasicDBObject object, String name) { - Date actualModifiedString = toDate(object, name); - if (actualModifiedString == null) - logger.trace(ACTUAL_MODIFIED_STRING_IS_NULL); - int result = date.compareTo(actualModifiedString); - return result <= 0; + private String GetScriptContent(BasicDBObject story) { + BasicDBObject script = (BasicDBObject) story.get("script"); + String scriptContent = "text: "; + if (script != null && !script.isEmpty()) { + BasicDBList body = (BasicDBList) script.get("body"); + if (body != null && !body.isEmpty()) + for (Object actualBody : body) { + BasicDBObject actualDBBody = (BasicDBObject) actualBody; + BasicDBList contents = (BasicDBList) actualDBBody.get("content"); + if (contents != null && !contents.isEmpty()) + for (Object actualContent : contents) { + BasicDBObject actualDBContent = (BasicDBObject) actualContent; + scriptContent += GetContent(actualDBContent); + } + } + } + return scriptContent; } - private boolean isModifiedRundown(Date date, BasicDBObject object) { + // private boolean isModified(Date date, BasicDBObject object, String name) { + // Date actualModifiedString = toDate(object, name); + // if (actualModifiedString == null) + // logger.trace(ACTUAL_MODIFIED_STRING_IS_NULL); + // int result = date.compareTo(actualModifiedString); + // return result <= 0; + // } + + private boolean isModified(Date date, BasicDBObject object) { Date modified = (Date) object.get(MODIFIED); int result = date.compareTo(modified); return result <= 0; @@ -389,7 +389,7 @@ public class OctopusDataMiner implements Runnable { rundown.put(SCHEDULED_START, toDate(rundown, SCHEDULED_START)); rundown.put(MODIFIED, toDate(rundown, MODIFIED)); DBCollection collection = db.getCollection(RUNDOWN_COLLECTION_NAME); - if (lastUpdateTime == null || (lastUpdateTime != null && isModifiedRundown(lastUpdateTime, rundown))) { + if (lastUpdateTime == null || (lastUpdateTime != null && isModified(lastUpdateTime, rundown))) { logger.info(String.format(SAVEING_RUNDOWN_D, rundownID)); collection.save(rundown); } @@ -488,14 +488,12 @@ public class OctopusDataMiner implements Runnable { List slugsList = NoSQLUtils.asList(slugs); for (BasicDBObject slug : slugsList) { if (slug.containsKey(STORY)) - storeStory((BasicDBObject) slug.get(STORY), slug.getInt(POSITION), referenceID, RUNDOWN2, - lastUpdateTime); + storeStory((BasicDBObject) slug.get(STORY), slug.getInt(POSITION), referenceID, RUNDOWN2, lastUpdateTime); } logger.trace(EXIT); } - private void storeStory(BasicDBObject story, int position, long referenceID, String referenceName, - Date lastUpdateTime) { + private void storeStory(BasicDBObject story, int position, long referenceID, String referenceName, Date lastUpdateTime) { logger.trace(ENTER); try { // a run v�g�n lek�rj�k az �sszes storyID-t az adatb�zisb�l @@ -512,8 +510,7 @@ public class OctopusDataMiner implements Runnable { * collection.findOne(new BasicDBObject(ID, storyID), new * BasicDBObject(_ID, 1)); collection.remove(modifiedStory); } else */ - checkAndStoreStory(modifiedStory, lastUpdateTime, storyID, position, referenceID, referenceName, - collection); + checkAndStoreStory(modifiedStory, lastUpdateTime, storyID, position, referenceID, referenceName, collection); } catch (Exception e) { logger.error(e); throw e; @@ -531,7 +528,7 @@ public class OctopusDataMiner implements Runnable { storeStoryFolderStories(stories, storyFolderID, storyFolderID, lastUpdateTime); storyFolder.put(MODIFIED, toDate(storyFolder, MODIFIED)); DBCollection collection = db.getCollection(STORY_FOLDER_COLLECTION_NAME); - if (lastUpdateTime == null || (lastUpdateTime != null && isModifiedRundown(lastUpdateTime, storyFolder))) { + if (lastUpdateTime == null || (lastUpdateTime != null && isModified(lastUpdateTime, storyFolder))) { logger.trace(String.format("saving storyFolder %d", storyFolderID)); collection.save(storyFolder); } @@ -543,8 +540,7 @@ public class OctopusDataMiner implements Runnable { List storyFolderList = NoSQLUtils.asList(storyFolders); int idx = 1; for (BasicDBObject storyFolder : storyFolderList) { - logger.info( - String.format(CHECKING_STORY_FOLDER_S_D_D, storyFolder.getLong(ID), storyFolderList.size(), idx)); + logger.info(String.format(CHECKING_STORY_FOLDER_S_D_D, storyFolder.getLong(ID), storyFolderList.size(), idx)); storeStoryFolder(storyFolder, lastUpdateTime); int progress = 50 + (idx * 50 / storyFolderList.size()); if (progress - progressEvent.getProgress() > 0) { @@ -556,8 +552,7 @@ public class OctopusDataMiner implements Runnable { logger.trace(EXIT); } - private void storeStoryFolderStories(BasicDBList stories, long storyFolderID, long referenceID, - Date lastUpdateTime) { + private void storeStoryFolderStories(BasicDBList stories, long storyFolderID, long referenceID, Date lastUpdateTime) { logger.trace(ENTER); List list = NoSQLUtils.asList(stories); for (BasicDBObject story : list) diff --git a/server/user.jobengine.osgi.commons/test/user/common/octopus/test/OctopusDataMinerTest.java b/server/user.jobengine.osgi.commons/test/user/common/octopus/test/OctopusDataMinerTest.java index 14710599..da8d37cb 100644 --- a/server/user.jobengine.osgi.commons/test/user/common/octopus/test/OctopusDataMinerTest.java +++ b/server/user.jobengine.osgi.commons/test/user/common/octopus/test/OctopusDataMinerTest.java @@ -41,8 +41,8 @@ public class OctopusDataMinerTest { Properties properties = new Properties(); URL srcLocation = MethodHandles.lookup().lookupClass().getProtectionDomain().getCodeSource().getLocation(); - //URL location = new URL(srcLocation, "../../-configuration/mediacube-dev.properties"); - URL location = new URL(srcLocation, "../../-configuration/mediacube-dev-user.properties"); + URL location = new URL(srcLocation, "../../-configuration/mediacube-dev.properties"); + //URL location = new URL(srcLocation, "../../-configuration/mediacube-dev-user.properties"); properties.load(new FileInputStream(location.toURI().getPath().toString())); System.getProperties().putAll(properties); @@ -94,6 +94,14 @@ public class OctopusDataMinerTest { } } + @Test + public void integrationTestClear() { + // fixture + sut = new OctopusDataMiner(); + // Exercise + sut.clear(); + } + @Test public void integrationTestWithClear() { // fixture diff --git a/server/user.jobengine.osgi.server/pages/index.zul b/server/user.jobengine.osgi.server/pages/index.zul index c02f7065..27399a55 100644 --- a/server/user.jobengine.osgi.server/pages/index.zul +++ b/server/user.jobengine.osgi.server/pages/index.zul @@ -1,4 +1,4 @@ - +