From d58b01b6af4c5bc4886b228b647ac56898e6ca1d Mon Sep 17 00:00:00 2001 From: =?utf8?q?V=C3=A1s=C3=A1ry=20D=C3=A1niel?= Date: Fri, 5 Oct 2018 12:48:32 +0000 Subject: [PATCH] git-tfs-id: [http://tfs.userrendszerhaz.hu:8080/tfs/DefaultCollection]$/MediaCube;C31311 --- client/AudioRecorder/AudioRecorderSettings.cs | 2 + client/AudioRecorder/MainForm.cs | 4 + .../Maestro/ArchiveMetadataForm.Designer.cs | 213 ++++++++++++------ client/Maestro/ArchiveMetadataForm.cs | 70 ++++-- .../Configuration/configuration-nle.json | 2 +- .../Configuration/configuration-studio.json | 5 +- client/Maestro/MaestroForm.Designer.cs | 41 ++-- client/Maestro/MaestroForm.Metadata.cs | 13 +- client/Maestro/MaestroForm.cs | 47 +--- client/Maestro/MaestroForm.resx | 10 +- client/Maestro/Sources/NexioRESTSource.cs | 8 +- client/Maestro/StringResources.Designer.cs | 47 ++-- client/Maestro/StringResources.resx | 15 +- .../Configuration/ConfigurationInfo.cs | 1 + .../Targets/FTPTargetProcessor.cs | 19 +- .../Targets/FXPTargetProcessor.cs | 11 - .../MaestroShared/Targets/ITargetProcessor.cs | 1 + .../Targets/UNCTargetProcessor.cs | 7 +- client/OctopusClient/OctopusAPI.cs | 17 ++ .../CopyForArchiveNEXIORecordingsStep.java | 31 +-- .../src/user/commons/octopus/IOctopusAPI.java | 4 + .../src/user/commons/octopus/OctopusAPI.java | 41 ++++ .../osgi/rest/octopus/OctopusRESTService.java | 52 +++++ 23 files changed, 416 insertions(+), 245 deletions(-) diff --git a/client/AudioRecorder/AudioRecorderSettings.cs b/client/AudioRecorder/AudioRecorderSettings.cs index 344638c0..c3966a50 100644 --- a/client/AudioRecorder/AudioRecorderSettings.cs +++ b/client/AudioRecorder/AudioRecorderSettings.cs @@ -11,6 +11,8 @@ namespace AudioRecorder { public MetadataProvider[] Metadatas { get; set; } public Target OctopusTarget { get; set; } public Target TrafficTarget { get; set; } + public Target TrafficADTarget { get; set; } + public Target TrafficPromoTarget { get; set; } public Target FreeTarget { get; set; } } } diff --git a/client/AudioRecorder/MainForm.cs b/client/AudioRecorder/MainForm.cs index 1c9190eb..69c3c751 100644 --- a/client/AudioRecorder/MainForm.cs +++ b/client/AudioRecorder/MainForm.cs @@ -347,7 +347,11 @@ namespace AudioRecorder { target = parameters.OctopusTarget; break; case TargetType.TrafficAD: + target = parameters.TrafficADTarget; + break; case TargetType.TrafficPromo: + target = parameters.TrafficPromoTarget; + break; case TargetType.TrafficMaterial: target = parameters.TrafficTarget; break; diff --git a/client/Maestro/ArchiveMetadataForm.Designer.cs b/client/Maestro/ArchiveMetadataForm.Designer.cs index abc40b02..b844726c 100644 --- a/client/Maestro/ArchiveMetadataForm.Designer.cs +++ b/client/Maestro/ArchiveMetadataForm.Designer.cs @@ -29,19 +29,24 @@ this.label_mediaID = new System.Windows.Forms.Label(); this.label_mediaTitle = new System.Windows.Forms.Label(); this.label_mediaDescription = new System.Windows.Forms.Label(); - this.textBox_itemID = new System.Windows.Forms.TextBox(); - this.textBox_itemTitle = new System.Windows.Forms.TextBox(); - this.textBox_itemDescription = new System.Windows.Forms.TextBox(); + this.txtItemID = new System.Windows.Forms.TextBox(); + this.txtItemTitle = new System.Windows.Forms.TextBox(); + this.txtItemDescription = new System.Windows.Forms.TextBox(); this.textBox_mediaID = new System.Windows.Forms.TextBox(); - this.textBox_mediaTitle = new System.Windows.Forms.TextBox(); - this.textBox_mediaDescription = new System.Windows.Forms.TextBox(); + this.txtMediaTitle = new System.Windows.Forms.TextBox(); + this.txtMediaDescription = new System.Windows.Forms.TextBox(); this.label_stuffTitle = new System.Windows.Forms.Label(); this.groupBox1 = new System.Windows.Forms.GroupBox(); this.btnOk = new System.Windows.Forms.Button(); this.btnCancel = new System.Windows.Forms.Button(); this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel(); + this.cbFolders = new System.Windows.Forms.ComboBox(); + this.dtScheduled = new System.Windows.Forms.DateTimePicker(); + this.btnImportOctopus = new System.Windows.Forms.Button(); + this.tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel(); this.groupBox1.SuspendLayout(); this.tableLayoutPanel1.SuspendLayout(); + this.tableLayoutPanel2.SuspendLayout(); this.SuspendLayout(); // // label_stuffID @@ -70,7 +75,7 @@ // this.label_mediaID.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); this.label_mediaID.AutoSize = true; - this.label_mediaID.Location = new System.Drawing.Point(11, 253); + this.label_mediaID.Location = new System.Drawing.Point(11, 192); this.label_mediaID.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label_mediaID.Name = "label_mediaID"; this.label_mediaID.Size = new System.Drawing.Size(111, 17); @@ -82,7 +87,7 @@ this.label_mediaTitle.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); this.label_mediaTitle.AutoSize = true; this.label_mediaTitle.Font = new System.Drawing.Font("Microsoft Sans Serif", 10F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(238))); - this.label_mediaTitle.Location = new System.Drawing.Point(11, 301); + this.label_mediaTitle.Location = new System.Drawing.Point(11, 240); this.label_mediaTitle.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label_mediaTitle.Name = "label_mediaTitle"; this.label_mediaTitle.Size = new System.Drawing.Size(80, 17); @@ -93,74 +98,74 @@ // this.label_mediaDescription.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); this.label_mediaDescription.AutoSize = true; - this.label_mediaDescription.Location = new System.Drawing.Point(11, 349); + this.label_mediaDescription.Location = new System.Drawing.Point(11, 288); this.label_mediaDescription.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label_mediaDescription.Name = "label_mediaDescription"; this.label_mediaDescription.Size = new System.Drawing.Size(84, 17); this.label_mediaDescription.TabIndex = 5; this.label_mediaDescription.Text = "Média leírás"; // - // textBox_itemID - // - this.textBox_itemID.Dock = System.Windows.Forms.DockStyle.Fill; - this.textBox_itemID.Location = new System.Drawing.Point(11, 27); - this.textBox_itemID.Margin = new System.Windows.Forms.Padding(4); - this.textBox_itemID.Name = "textBox_itemID"; - this.textBox_itemID.ReadOnly = true; - this.textBox_itemID.Size = new System.Drawing.Size(660, 23); - this.textBox_itemID.TabIndex = 6; - this.textBox_itemID.TabStop = false; - // - // textBox_itemTitle - // - this.textBox_itemTitle.Dock = System.Windows.Forms.DockStyle.Fill; - this.textBox_itemTitle.Location = new System.Drawing.Point(11, 75); - this.textBox_itemTitle.Margin = new System.Windows.Forms.Padding(4); - this.textBox_itemTitle.Name = "textBox_itemTitle"; - this.textBox_itemTitle.Size = new System.Drawing.Size(660, 23); - this.textBox_itemTitle.TabIndex = 1; - // - // textBox_itemDescription - // - this.textBox_itemDescription.Dock = System.Windows.Forms.DockStyle.Fill; - this.textBox_itemDescription.Location = new System.Drawing.Point(11, 123); - this.textBox_itemDescription.Margin = new System.Windows.Forms.Padding(4); - this.textBox_itemDescription.Multiline = true; - this.textBox_itemDescription.Name = "textBox_itemDescription"; - this.textBox_itemDescription.ScrollBars = System.Windows.Forms.ScrollBars.Both; - this.textBox_itemDescription.Size = new System.Drawing.Size(660, 126); - this.textBox_itemDescription.TabIndex = 2; + // txtItemID + // + this.txtItemID.Dock = System.Windows.Forms.DockStyle.Fill; + this.txtItemID.Location = new System.Drawing.Point(11, 27); + this.txtItemID.Margin = new System.Windows.Forms.Padding(4); + this.txtItemID.Name = "txtItemID"; + this.txtItemID.ReadOnly = true; + this.txtItemID.Size = new System.Drawing.Size(749, 23); + this.txtItemID.TabIndex = 6; + this.txtItemID.TabStop = false; + // + // txtItemTitle + // + this.txtItemTitle.Dock = System.Windows.Forms.DockStyle.Fill; + this.txtItemTitle.Location = new System.Drawing.Point(11, 75); + this.txtItemTitle.Margin = new System.Windows.Forms.Padding(4); + this.txtItemTitle.Name = "txtItemTitle"; + this.txtItemTitle.Size = new System.Drawing.Size(749, 23); + this.txtItemTitle.TabIndex = 1; + // + // txtItemDescription + // + this.txtItemDescription.Dock = System.Windows.Forms.DockStyle.Fill; + this.txtItemDescription.Location = new System.Drawing.Point(11, 123); + this.txtItemDescription.Margin = new System.Windows.Forms.Padding(4); + this.txtItemDescription.Multiline = true; + this.txtItemDescription.Name = "txtItemDescription"; + this.txtItemDescription.ScrollBars = System.Windows.Forms.ScrollBars.Both; + this.txtItemDescription.Size = new System.Drawing.Size(749, 65); + this.txtItemDescription.TabIndex = 2; // // textBox_mediaID // this.textBox_mediaID.Dock = System.Windows.Forms.DockStyle.Fill; - this.textBox_mediaID.Location = new System.Drawing.Point(11, 274); + this.textBox_mediaID.Location = new System.Drawing.Point(11, 213); this.textBox_mediaID.Margin = new System.Windows.Forms.Padding(4); this.textBox_mediaID.Name = "textBox_mediaID"; this.textBox_mediaID.ReadOnly = true; - this.textBox_mediaID.Size = new System.Drawing.Size(660, 23); + this.textBox_mediaID.Size = new System.Drawing.Size(749, 23); this.textBox_mediaID.TabIndex = 9; this.textBox_mediaID.TabStop = false; // - // textBox_mediaTitle + // txtMediaTitle // - this.textBox_mediaTitle.Dock = System.Windows.Forms.DockStyle.Fill; - this.textBox_mediaTitle.Location = new System.Drawing.Point(11, 322); - this.textBox_mediaTitle.Margin = new System.Windows.Forms.Padding(4); - this.textBox_mediaTitle.Name = "textBox_mediaTitle"; - this.textBox_mediaTitle.Size = new System.Drawing.Size(660, 23); - this.textBox_mediaTitle.TabIndex = 3; + this.txtMediaTitle.Dock = System.Windows.Forms.DockStyle.Fill; + this.txtMediaTitle.Location = new System.Drawing.Point(11, 261); + this.txtMediaTitle.Margin = new System.Windows.Forms.Padding(4); + this.txtMediaTitle.Name = "txtMediaTitle"; + this.txtMediaTitle.Size = new System.Drawing.Size(749, 23); + this.txtMediaTitle.TabIndex = 3; // - // textBox_mediaDescription + // txtMediaDescription // - this.textBox_mediaDescription.Dock = System.Windows.Forms.DockStyle.Fill; - this.textBox_mediaDescription.Location = new System.Drawing.Point(11, 370); - this.textBox_mediaDescription.Margin = new System.Windows.Forms.Padding(4); - this.textBox_mediaDescription.Multiline = true; - this.textBox_mediaDescription.Name = "textBox_mediaDescription"; - this.textBox_mediaDescription.ScrollBars = System.Windows.Forms.ScrollBars.Both; - this.textBox_mediaDescription.Size = new System.Drawing.Size(660, 113); - this.textBox_mediaDescription.TabIndex = 4; + this.txtMediaDescription.Dock = System.Windows.Forms.DockStyle.Fill; + this.txtMediaDescription.Location = new System.Drawing.Point(11, 351); + this.txtMediaDescription.Margin = new System.Windows.Forms.Padding(4); + this.txtMediaDescription.Multiline = true; + this.txtMediaDescription.Name = "txtMediaDescription"; + this.txtMediaDescription.ScrollBars = System.Windows.Forms.ScrollBars.Both; + this.txtMediaDescription.Size = new System.Drawing.Size(749, 136); + this.txtMediaDescription.TabIndex = 4; // // label_stuffTitle // @@ -179,18 +184,18 @@ this.groupBox1.Controls.Add(this.btnOk); this.groupBox1.Controls.Add(this.btnCancel); this.groupBox1.Dock = System.Windows.Forms.DockStyle.Bottom; - this.groupBox1.Location = new System.Drawing.Point(0, 486); + this.groupBox1.Location = new System.Drawing.Point(0, 497); this.groupBox1.Margin = new System.Windows.Forms.Padding(4); this.groupBox1.Name = "groupBox1"; this.groupBox1.Padding = new System.Windows.Forms.Padding(4); - this.groupBox1.Size = new System.Drawing.Size(682, 59); + this.groupBox1.Size = new System.Drawing.Size(771, 51); this.groupBox1.TabIndex = 1; this.groupBox1.TabStop = false; // // btnOk // this.btnOk.Anchor = System.Windows.Forms.AnchorStyles.Right; - this.btnOk.Location = new System.Drawing.Point(574, 20); + this.btnOk.Location = new System.Drawing.Point(663, 16); this.btnOk.Margin = new System.Windows.Forms.Padding(4); this.btnOk.Name = "btnOk"; this.btnOk.Size = new System.Drawing.Size(100, 28); @@ -203,7 +208,7 @@ // this.btnCancel.Anchor = System.Windows.Forms.AnchorStyles.Right; this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; - this.btnCancel.Location = new System.Drawing.Point(468, 20); + this.btnCancel.Location = new System.Drawing.Point(557, 16); this.btnCancel.Margin = new System.Windows.Forms.Padding(4); this.btnCancel.Name = "btnCancel"; this.btnCancel.Size = new System.Drawing.Size(100, 28); @@ -216,24 +221,25 @@ // this.tableLayoutPanel1.ColumnCount = 1; this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); - this.tableLayoutPanel1.Controls.Add(this.textBox_mediaDescription, 0, 11); - this.tableLayoutPanel1.Controls.Add(this.textBox_mediaTitle, 0, 9); + this.tableLayoutPanel1.Controls.Add(this.txtMediaDescription, 0, 12); + this.tableLayoutPanel1.Controls.Add(this.txtMediaTitle, 0, 9); this.tableLayoutPanel1.Controls.Add(this.label_mediaTitle, 0, 8); this.tableLayoutPanel1.Controls.Add(this.textBox_mediaID, 0, 7); this.tableLayoutPanel1.Controls.Add(this.label_mediaID, 0, 6); - this.tableLayoutPanel1.Controls.Add(this.textBox_itemDescription, 0, 5); - this.tableLayoutPanel1.Controls.Add(this.textBox_itemTitle, 0, 3); - this.tableLayoutPanel1.Controls.Add(this.textBox_itemID, 0, 1); + this.tableLayoutPanel1.Controls.Add(this.txtItemDescription, 0, 5); + this.tableLayoutPanel1.Controls.Add(this.txtItemTitle, 0, 3); + this.tableLayoutPanel1.Controls.Add(this.txtItemID, 0, 1); this.tableLayoutPanel1.Controls.Add(this.label_stuffID, 0, 0); this.tableLayoutPanel1.Controls.Add(this.label_mediaDescription, 0, 10); this.tableLayoutPanel1.Controls.Add(this.label_stuffDescription, 0, 4); this.tableLayoutPanel1.Controls.Add(this.label_stuffTitle, 0, 2); + this.tableLayoutPanel1.Controls.Add(this.tableLayoutPanel2, 0, 11); this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill; this.tableLayoutPanel1.Location = new System.Drawing.Point(0, 0); this.tableLayoutPanel1.Margin = new System.Windows.Forms.Padding(4); this.tableLayoutPanel1.Name = "tableLayoutPanel1"; this.tableLayoutPanel1.Padding = new System.Windows.Forms.Padding(7, 6, 7, 6); - this.tableLayoutPanel1.RowCount = 12; + this.tableLayoutPanel1.RowCount = 13; this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle()); this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle()); this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle()); @@ -246,15 +252,71 @@ this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle()); this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle()); this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle()); - this.tableLayoutPanel1.Size = new System.Drawing.Size(682, 486); + this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle()); + this.tableLayoutPanel1.Size = new System.Drawing.Size(771, 497); this.tableLayoutPanel1.TabIndex = 3; // + // cbFolders + // + this.cbFolders.Dock = System.Windows.Forms.DockStyle.Fill; + this.cbFolders.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.cbFolders.Font = new System.Drawing.Font("Microsoft Sans Serif", 10F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); + this.cbFolders.FormattingEnabled = true; + this.cbFolders.Location = new System.Drawing.Point(99, 6); + this.cbFolders.Margin = new System.Windows.Forms.Padding(4, 6, 4, 4); + this.cbFolders.Name = "cbFolders"; + this.cbFolders.Size = new System.Drawing.Size(540, 24); + this.cbFolders.TabIndex = 8; + // + // dtScheduled + // + this.dtScheduled.Anchor = System.Windows.Forms.AnchorStyles.None; + this.dtScheduled.CustomFormat = " "; + this.dtScheduled.Font = new System.Drawing.Font("Microsoft Sans Serif", 10F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); + this.dtScheduled.Format = System.Windows.Forms.DateTimePickerFormat.Short; + this.dtScheduled.Location = new System.Drawing.Point(4, 6); + this.dtScheduled.Margin = new System.Windows.Forms.Padding(4); + this.dtScheduled.Name = "dtScheduled"; + this.dtScheduled.Size = new System.Drawing.Size(87, 23); + this.dtScheduled.TabIndex = 7; + this.dtScheduled.ValueChanged += new System.EventHandler(this.OnDateChanged); + // + // btnImportOctopus + // + this.btnImportOctopus.Anchor = System.Windows.Forms.AnchorStyles.None; + this.btnImportOctopus.Location = new System.Drawing.Point(647, 4); + this.btnImportOctopus.Margin = new System.Windows.Forms.Padding(4); + this.btnImportOctopus.Name = "btnImportOctopus"; + this.btnImportOctopus.Size = new System.Drawing.Size(100, 28); + this.btnImportOctopus.TabIndex = 9; + this.btnImportOctopus.Text = "Import"; + this.btnImportOctopus.UseVisualStyleBackColor = true; + this.btnImportOctopus.Click += new System.EventHandler(this.OnImportOctopusData); + // + // tableLayoutPanel2 + // + this.tableLayoutPanel2.AutoSize = true; + this.tableLayoutPanel2.ColumnCount = 3; + this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); + this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); + this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); + this.tableLayoutPanel2.Controls.Add(this.btnImportOctopus, 2, 0); + this.tableLayoutPanel2.Controls.Add(this.cbFolders, 1, 0); + this.tableLayoutPanel2.Controls.Add(this.dtScheduled, 0, 0); + this.tableLayoutPanel2.Dock = System.Windows.Forms.DockStyle.Fill; + this.tableLayoutPanel2.Location = new System.Drawing.Point(10, 308); + this.tableLayoutPanel2.Name = "tableLayoutPanel2"; + this.tableLayoutPanel2.RowCount = 1; + this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); + this.tableLayoutPanel2.Size = new System.Drawing.Size(751, 36); + this.tableLayoutPanel2.TabIndex = 10; + // // ArchiveMetadataForm // this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.CancelButton = this.btnCancel; - this.ClientSize = new System.Drawing.Size(682, 545); + this.ClientSize = new System.Drawing.Size(771, 548); this.Controls.Add(this.tableLayoutPanel1); this.Controls.Add(this.groupBox1); this.Font = new System.Drawing.Font("Microsoft Sans Serif", 10F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); @@ -266,6 +328,7 @@ this.groupBox1.ResumeLayout(false); this.tableLayoutPanel1.ResumeLayout(false); this.tableLayoutPanel1.PerformLayout(); + this.tableLayoutPanel2.ResumeLayout(false); this.ResumeLayout(false); } @@ -278,15 +341,19 @@ private System.Windows.Forms.Label label_mediaID; private System.Windows.Forms.Label label_mediaTitle; private System.Windows.Forms.Label label_mediaDescription; - private System.Windows.Forms.TextBox textBox_itemID; - private System.Windows.Forms.TextBox textBox_itemTitle; - private System.Windows.Forms.TextBox textBox_itemDescription; + private System.Windows.Forms.TextBox txtItemID; + private System.Windows.Forms.TextBox txtItemTitle; + private System.Windows.Forms.TextBox txtItemDescription; private System.Windows.Forms.TextBox textBox_mediaID; - private System.Windows.Forms.TextBox textBox_mediaTitle; - private System.Windows.Forms.TextBox textBox_mediaDescription; + private System.Windows.Forms.TextBox txtMediaTitle; + private System.Windows.Forms.TextBox txtMediaDescription; private System.Windows.Forms.GroupBox groupBox1; private System.Windows.Forms.Button btnOk; private System.Windows.Forms.Button btnCancel; private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1; + private System.Windows.Forms.ComboBox cbFolders; + private System.Windows.Forms.DateTimePicker dtScheduled; + private System.Windows.Forms.Button btnImportOctopus; + private System.Windows.Forms.TableLayoutPanel tableLayoutPanel2; } } \ No newline at end of file diff --git a/client/Maestro/ArchiveMetadataForm.cs b/client/Maestro/ArchiveMetadataForm.cs index e93d6622..f1aa3a54 100644 --- a/client/Maestro/ArchiveMetadataForm.cs +++ b/client/Maestro/ArchiveMetadataForm.cs @@ -1,39 +1,83 @@ using System.Windows.Forms; using MaestroShared.Metadata; +using LinkDotNet.MessageHandling.Contracts; +using OctopusClient; +using MaestroShared.Configuration; +using System.Collections.Generic; +using System.Linq; +using System; +using MaestroShared.Commons; namespace Maestro { public partial class ArchiveMetadataForm : Form { private ArchiveMetadata model; + private OctopusAPI client; - public ArchiveMetadataForm(ref ArchiveMetadata model) : this() { + public ArchiveMetadataForm(ref ArchiveMetadata model, OctopusMetadata metadata, IMessageBus errorMessageBus) : this() { this.model = model; - textBox_itemID.Text = model.itemHouseId; - textBox_itemTitle.Text = model.itemTitle; - textBox_itemDescription.Text = model.itemDescription; + txtItemID.Text = model.itemHouseId; + txtItemTitle.Text = model.itemTitle; + txtItemDescription.Text = model.itemDescription; textBox_mediaID.Text = model.mediaHouseId; - textBox_mediaTitle.Text = model.mediaTitle; - textBox_mediaDescription.Text = model.mediaDescription; + txtMediaTitle.Text = model.mediaTitle; + txtMediaDescription.Text = model.mediaDescription; + if (metadata == null) { + dtScheduled.Visible = false; + cbFolders.Visible = false; + btnImportOctopus.Visible = false; + + } else { + client = new OctopusAPI(metadata.Server?.Address?.OriginalString, metadata.Server?.UserName, metadata.Server?.Password, metadata.Server?.Timeout ?? 0, errorMessageBus); + RefreshFolders(); + } + } + + private void RefreshFolders() { + Cursor.Current = Cursors.WaitCursor; + List rundownsResult = client.GetRundowns(dtScheduled.Value.Date)?.ToList(); + cbFolders.DataSource = rundownsResult; + Cursor.Current = Cursors.Default; + } + + private void OnDateChanged(object sender, EventArgs e) { + RefreshFolders(); } public ArchiveMetadataForm() { InitializeComponent(); } - private void OnOkClick(object sender, System.EventArgs e) { - model.itemHouseId = textBox_itemID.Text; - model.itemTitle = textBox_itemTitle.Text; - model.itemDescription = textBox_itemDescription.Text; + private void OnOkClick(object sender, EventArgs e) { + model.itemHouseId = txtItemID.Text; + model.itemTitle = txtItemTitle.Text; + model.itemDescription = txtItemDescription.Text; model.mediaHouseId = textBox_mediaID.Text; - model.mediaTitle = textBox_mediaTitle.Text; - model.mediaDescription = textBox_mediaDescription.Text; + model.mediaTitle = txtMediaTitle.Text; + model.mediaDescription = txtMediaDescription.Text; DialogResult = DialogResult.OK; Close(); } - private void OnCancelClick(object sender, System.EventArgs e) { + private void OnCancelClick(object sender, EventArgs e) { DialogResult = DialogResult.Cancel; Close(); } + + private void OnImportOctopusData(object sender, EventArgs e) { + if (!String.IsNullOrEmpty(txtMediaDescription.Text)) { + if (!MsgBox.YesNoQuestion("A média leírása nem üres és törlődni fog. Folytatja?")) + return; + } + + Rundown rundown = cbFolders.SelectedItem as Rundown; + if (rundown == null) + return; + string text = client.GetRundownContent(rundown.ID); + if (String.IsNullOrEmpty(text)) + MsgBox.Info("A tükör üres vagy nem található."); + else + txtMediaDescription.Text = text; + } } } diff --git a/client/Maestro/Configuration/configuration-nle.json b/client/Maestro/Configuration/configuration-nle.json index 8baca8e5..f13a4c19 100644 --- a/client/Maestro/Configuration/configuration-nle.json +++ b/client/Maestro/Configuration/configuration-nle.json @@ -129,8 +129,8 @@ "outputFormat": "%ID%", "tag": "Archiválás", "saveArchiveMetadata": true, - "deleteAfterCopy": true, "temporaryCopy": true, + "killDateDays": 5, "remote": { "address": "ftp://10.10.1.100/ARCHIVE/TESZT", "userName": "mediacube", diff --git a/client/Maestro/Configuration/configuration-studio.json b/client/Maestro/Configuration/configuration-studio.json index c33de940..56f2a609 100644 --- a/client/Maestro/Configuration/configuration-studio.json +++ b/client/Maestro/Configuration/configuration-studio.json @@ -21,7 +21,7 @@ { "$type": "OctopusMetadata", "server": { - "address": "http://10.10.1.27/services/rest/octopus", + "address": "http://localhost:8888/services/rest/octopus", "timeout": 1000 } }, @@ -51,7 +51,8 @@ "outputFormat": "%ID%", "tag": "Archiválás", "saveArchiveMetadata": true, - "deleteAfterCopy": false, + "deleteAfterCopy": false, + "killDateDays": 5, "remote": { "address": "ftp://10.10.1.100:21/ARCHIVE/TESZT", "userName": "mediacube", diff --git a/client/Maestro/MaestroForm.Designer.cs b/client/Maestro/MaestroForm.Designer.cs index ac61f892..b620c7a3 100644 --- a/client/Maestro/MaestroForm.Designer.cs +++ b/client/Maestro/MaestroForm.Designer.cs @@ -85,16 +85,16 @@ namespace Maestro { this.dataGridViewProgressColumn1 = new Maestro.Commons.DataGridViewProgressColumn(); this.systemMessageBindingSource = new System.Windows.Forms.BindingSource(this.components); this.metadataInfoBindingSource = new System.Windows.Forms.BindingSource(this.components); + this.columnInputName = new System.Windows.Forms.DataGridViewTextBoxColumn(); 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.Message = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.columnMessage = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.groupSource.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.dgSource)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.bindingSource)).BeginInit(); @@ -732,16 +732,16 @@ namespace Maestro { this.dgJobs.BorderStyle = System.Windows.Forms.BorderStyle.None; this.dgJobs.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; this.dgJobs.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { + this.columnInputName, this.columnLabel, this.columnID, - this.Progress, this.columnStatus, this.columnStarted, this.columnFinished, this.columnInput, this.columnOutput, this.columnKillDate, - this.Message}); + this.columnMessage}); this.dgJobs.DataSource = this.bindingSourceJobs; dataGridViewCellStyle6.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; dataGridViewCellStyle6.BackColor = System.Drawing.SystemColors.Window; @@ -765,8 +765,8 @@ namespace Maestro { this.dgJobs.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; this.dgJobs.Size = new System.Drawing.Size(988, 90); this.dgJobs.TabIndex = 0; - this.dgJobs.CellEnter += new System.Windows.Forms.DataGridViewCellEventHandler(this.dataGridJobs_CellEnter); this.dgJobs.CellPainting += new System.Windows.Forms.DataGridViewCellPaintingEventHandler(this.OnJobsCellPainting); + this.dgJobs.CellToolTipTextNeeded += new System.Windows.Forms.DataGridViewCellToolTipTextNeededEventHandler(this.dgJobs_CellToolTipTextNeeded); this.dgJobs.MouseClick += new System.Windows.Forms.MouseEventHandler(this.dataGridJobs_MouseClick); // // tabPage2 @@ -851,9 +851,18 @@ namespace Maestro { // this.metadataInfoBindingSource.DataSource = typeof(Maestro.Metadata.MetadataInfo); // + // columnInputName + // + this.columnInputName.DataPropertyName = "InputName"; + this.columnInputName.Frozen = true; + this.columnInputName.HeaderText = "InputName"; + this.columnInputName.Name = "columnInputName"; + this.columnInputName.Width = 93; + // // columnLabel // this.columnLabel.DataPropertyName = "Label"; + this.columnLabel.Frozen = true; this.columnLabel.HeaderText = "Label"; this.columnLabel.Name = "columnLabel"; this.columnLabel.Width = 63; @@ -867,13 +876,6 @@ namespace Maestro { this.columnID.Name = "columnID"; this.columnID.Width = 44; // - // Progress - // - this.Progress.DataPropertyName = "Progress"; - this.Progress.HeaderText = ""; - this.Progress.MinimumWidth = 100; - this.Progress.Name = "Progress"; - // // columnStatus // this.columnStatus.DataPropertyName = "Status"; @@ -918,12 +920,12 @@ namespace Maestro { this.columnKillDate.Name = "columnKillDate"; this.columnKillDate.Width = 75; // - // Message + // columnMessage // - this.Message.DataPropertyName = "Message"; - this.Message.HeaderText = "Üzenet"; - this.Message.Name = "Message"; - this.Message.Width = 71; + this.columnMessage.DataPropertyName = "Message"; + this.columnMessage.HeaderText = "Message"; + this.columnMessage.Name = "columnMessage"; + this.columnMessage.Width = 83; // // MaestroForm // @@ -1038,16 +1040,17 @@ namespace Maestro { private System.Windows.Forms.CheckBox chkAutoScroll; private Commons.DataGridViewProgressColumn dataGridViewProgressColumn1; private PictureBox picResetSearch; + private Commons.DataGridViewProgressColumn columnProgress; + private DataGridViewTextBoxColumn columnInputName; private DataGridViewTextBoxColumn columnLabel; private DataGridViewTextBoxColumn columnID; - private Commons.DataGridViewProgressColumn Progress; private DataGridViewTextBoxColumn columnStatus; private DataGridViewTextBoxColumn columnStarted; private DataGridViewTextBoxColumn columnFinished; private DataGridViewTextBoxColumn columnInput; private DataGridViewTextBoxColumn columnOutput; private DataGridViewTextBoxColumn columnKillDate; - private DataGridViewTextBoxColumn Message; + private DataGridViewTextBoxColumn columnMessage; } } diff --git a/client/Maestro/MaestroForm.Metadata.cs b/client/Maestro/MaestroForm.Metadata.cs index d6f7b9f5..e2b56137 100644 --- a/client/Maestro/MaestroForm.Metadata.cs +++ b/client/Maestro/MaestroForm.Metadata.cs @@ -61,7 +61,7 @@ namespace Maestro { private void InitializeTrafficSelector() { TrafficMetadata metadata = MetadataProvider.Get(Configuration.Metadatas); - if (metadata == null) { + if (metadata == null || metadata.Disabled) { tabMetadata.TabPages.Remove(tpTraffic); return; } @@ -74,13 +74,13 @@ namespace Maestro { } private void InitializeOctopusSelector() { - OctopusMetadata octopusConfiguration = MetadataProvider.Get(Configuration.Metadatas); - if (octopusConfiguration == null) { + OctopusMetadata metadata = MetadataProvider.Get(Configuration.Metadatas); + if (metadata == null || metadata.Disabled) { tabMetadata.TabPages.Remove(tpOctopus); return; } octopusIDSelector.Parameters = new OctopusParameters() { - Configuration = octopusConfiguration, + Configuration = metadata, UserName = TrayApplicationContext.UserName, MessageBus = errorMessageBus, }; @@ -89,7 +89,7 @@ namespace Maestro { private void InitializeMediaCubeApi() { MediaCubeMetadata metadata = MetadataProvider.Get(Configuration.Metadatas); - if (metadata == null) + if (metadata == null || metadata.Disabled) return; mediaCubeApi = new MediaCubeApi(metadata.Server.Address.ToString(), metadata.Server.UserName, metadata.Server.Password, metadata.Server.Timeout, errorMessageBus); } @@ -105,7 +105,8 @@ namespace Maestro { return; } - ArchiveMetadataForm form = new ArchiveMetadataForm(ref archiveMetadata); + OctopusMetadata metadata = MetadataProvider.Get(Configuration.Metadatas); + ArchiveMetadataForm form = new ArchiveMetadataForm(ref archiveMetadata, metadata, errorMessageBus); form.BackColor = partialColor; DialogResult result = form.ShowDialog(); diff --git a/client/Maestro/MaestroForm.cs b/client/Maestro/MaestroForm.cs index 1356429f..7dc9eef3 100644 --- a/client/Maestro/MaestroForm.cs +++ b/client/Maestro/MaestroForm.cs @@ -70,11 +70,10 @@ namespace Maestro { columnFinished.HeaderText = StringResources.BEFEJEZES; columnInput.HeaderText = StringResources.FORRAS; columnOutput.HeaderText = StringResources.CEL; - //columnProgress.HeaderText = StringResources.ALLAPOT; columnStatus.HeaderText = StringResources.STATUSZ; - columnLabel.HeaderText = StringResources.CIM; - //ctxiDefineSegments.Text = StringResources.SZEGMENS_LETREHOZASA; - //ctxiModifyArchiveMetadata.Text = StringResources.ARCHIV_METAADATOK; + columnLabel.HeaderText = StringResources.ACTION; + columnMessage.HeaderText = StringResources.MESSAGE; + columnInputName.HeaderText = StringResources.INPUTNAME; } private void InitializeComponents() { @@ -210,14 +209,6 @@ namespace Maestro { processorWorkers.ToList().ForEach(w => w.CancelAsync()); } - private void dataGridJobs_CellEnter(object sender, DataGridViewCellEventArgs e) { - ITargetProcessor item = bindingSourceJobs.Current as ITargetProcessor; - if (item == null || e.RowIndex < 0 || e.ColumnIndex < 0) - return; - DataGridViewCell cell = dgJobs.Rows[e.RowIndex].Cells[e.ColumnIndex]; - cell.ToolTipText = item.Message; - } - private void MaestroForm_Shown(object sender, EventArgs e) { Text = Configuration.Title; InitializeComponents(); @@ -289,32 +280,10 @@ namespace Maestro { e.Node.Expand(); } - //private void OnEditMetadata(object sender, EventArgs e) { - - //} - - //private void OnDefineSegments(object sender, EventArgs e) { - - //} - - //private void OnLookupByMetadata(object sender, EventArgs e) { - - //} - - //private void OnMetadataIDChanged(object sender, EventArgs e) { - - //} - - //private void OnSelectedMetadataKeyDown(object sender, KeyEventArgs e) { - - //} - - //private void OnTargetPanelsMouseClick(object sender, MouseEventArgs e) { - - //} - - //private void OnExecuteClick(object sender, EventArgs e) { - - //} + private void dgJobs_CellToolTipTextNeeded(object sender, DataGridViewCellToolTipTextNeededEventArgs e) { + if (e.ColumnIndex < 0 || e.RowIndex < 0) + return; + e.ToolTipText = dgJobs.Rows[e.RowIndex].Cells[e.ColumnIndex].FormattedValue as string; + } } } diff --git a/client/Maestro/MaestroForm.resx b/client/Maestro/MaestroForm.resx index abe96545..6d44e5c3 100644 --- a/client/Maestro/MaestroForm.resx +++ b/client/Maestro/MaestroForm.resx @@ -128,7 +128,7 @@ AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0 ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAAAS - CAAAAk1TRnQBSQFMAgEBAgEAAYABAQGAAQEBEAEAARABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo + CAAAAk1TRnQBSQFMAgEBAgEAAbgBAQG4AQEBEAEAARABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo AwABQAMAARADAAEBAQABCAYAAQQYAAGAAgABgAMAAoABAAGAAwABgAEAAYABAAKAAgADwAEAAcAB3AHA AQAB8AHKAaYBAAEzBQABMwEAATMBAAEzAQACMwIAAxYBAAMcAQADIgEAAykBAANVAQADTQEAA0IBAAM5 AQABgAF8Af8BAAJQAf8BAAGTAQAB1gEAAf8B7AHMAQABxgHWAe8BAAHWAucBAAGQAakBrQIAAf8BMwMA @@ -180,13 +180,13 @@ 846, 17 - + True - + True - + True @@ -207,7 +207,7 @@ True - + True diff --git a/client/Maestro/Sources/NexioRESTSource.cs b/client/Maestro/Sources/NexioRESTSource.cs index c3b463ef..7b4f8400 100644 --- a/client/Maestro/Sources/NexioRESTSource.cs +++ b/client/Maestro/Sources/NexioRESTSource.cs @@ -47,13 +47,13 @@ namespace Maestro.Sources { Width = 200 }, new DataGridViewTextBoxColumn(){ - DataPropertyName = "Agency", - HeaderText = StringResources.UGYNOKSEG, + DataPropertyName = "Duration", + HeaderText = StringResources.HOSSZ, AutoSizeMode = DataGridViewAutoSizeColumnMode.None }, new DataGridViewTextBoxColumn(){ - DataPropertyName = "Duration", - HeaderText = StringResources.HOSSZ, + DataPropertyName = "Agency", + HeaderText = StringResources.UGYNOKSEG, AutoSizeMode = DataGridViewAutoSizeColumnMode.None }, new DataGridViewTextBoxColumn() { diff --git a/client/Maestro/StringResources.Designer.cs b/client/Maestro/StringResources.Designer.cs index 5185848e..c4b44169 100644 --- a/client/Maestro/StringResources.Designer.cs +++ b/client/Maestro/StringResources.Designer.cs @@ -19,7 +19,7 @@ namespace Maestro { // class via a tool like ResGen or Visual Studio. // To add or remove a member, edit your .ResX file then rerun ResGen // with the /str option, or rebuild your VS project. - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "15.0.0.0")] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] internal class StringResources { @@ -60,6 +60,15 @@ namespace Maestro { } } + /// + /// Looks up a localized string similar to Akció. + /// + internal static string ACTION { + get { + return ResourceManager.GetString("ACTION", resourceCulture); + } + } + /// /// Looks up a localized string similar to Akciók. /// @@ -132,15 +141,6 @@ namespace Maestro { } } - /// - /// Looks up a localized string similar to Cím. - /// - internal static string CIM { - get { - return ResourceManager.GetString("CIM", resourceCulture); - } - } - /// /// Looks up a localized string similar to Felvétel dátuma. /// @@ -204,6 +204,15 @@ namespace Maestro { } } + /// + /// Looks up a localized string similar to Forrásnév. + /// + internal static string INPUTNAME { + get { + return ResourceManager.GetString("INPUTNAME", resourceCulture); + } + } + /// /// Looks up a localized string similar to Kezdés. /// @@ -258,6 +267,15 @@ namespace Maestro { } } + /// + /// Looks up a localized string similar to Üzenet. + /// + internal static string MESSAGE { + get { + return ResourceManager.GetString("MESSAGE", resourceCulture); + } + } + /// /// Looks up a localized string similar to Metaadat. /// @@ -330,15 +348,6 @@ namespace Maestro { } } - /// - /// Looks up a localized string similar to Üzenet. - /// - internal static string UZENET { - get { - return ResourceManager.GetString("UZENET", resourceCulture); - } - } - /// /// Looks up a localized string similar to Üzenetek. /// diff --git a/client/Maestro/StringResources.resx b/client/Maestro/StringResources.resx index 9d5c831c..cea79ac4 100644 --- a/client/Maestro/StringResources.resx +++ b/client/Maestro/StringResources.resx @@ -117,6 +117,9 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + Akció + Akciók @@ -141,9 +144,6 @@ Cél akció - - Cím - Felvétel dátuma @@ -165,6 +165,9 @@ Idő + + Forrásnév + Kezdés @@ -183,6 +186,9 @@ Méret + + Üzenet + Metaadat @@ -207,9 +213,6 @@ Ügynökség - - Üzenet - Üzenetek diff --git a/client/MaestroShared/Configuration/ConfigurationInfo.cs b/client/MaestroShared/Configuration/ConfigurationInfo.cs index 9d0ebeba..c65e215d 100644 --- a/client/MaestroShared/Configuration/ConfigurationInfo.cs +++ b/client/MaestroShared/Configuration/ConfigurationInfo.cs @@ -149,6 +149,7 @@ namespace MaestroShared.Configuration { public class MetadataProvider : UISettings { public Connection Server { get; set; } + public bool Disabled { get; set; } public static T Get(MetadataProvider[] providers) { MetadataProvider provider = providers?.Where(m => { return m is T; }).FirstOrDefault(); T result = default(T); diff --git a/client/MaestroShared/Targets/FTPTargetProcessor.cs b/client/MaestroShared/Targets/FTPTargetProcessor.cs index a3d909ff..4d73b055 100644 --- a/client/MaestroShared/Targets/FTPTargetProcessor.cs +++ b/client/MaestroShared/Targets/FTPTargetProcessor.cs @@ -14,9 +14,6 @@ namespace MaestroShared.Targets { private const string PATTERN_CONCAT = "{0}{1}"; protected const string _226 = "226"; protected const string UPLOAD_ERROR = "Feltöltési hiba."; - protected const string _200 = "200"; - private const string SITE0011 = "SITE 0011"; - private const string _1211 = "1211"; private readonly Logger logger = LogManager.GetCurrentClassLogger(); protected FtpClient targetFTP; @@ -47,15 +44,6 @@ namespace MaestroShared.Targets { } - protected bool IsNexioServer(FtpClient ftpClient) { - bool result = false; - //Device Type Request - FtpReply reply = ftpClient.Execute(SITE0011); - if (_200.Equals(reply.Code)) - result = reply.Message != null && reply.Message.Contains(_1211); - return result; - } - protected override void BeforeExecute() { base.BeforeExecute(); targetFTP = CreateClient(Parameters.TargetConfig.Remote); @@ -63,7 +51,7 @@ namespace MaestroShared.Targets { protected override void ValidateTransfer() { - if (!IsNexioServer(targetFTP)) { + if (!targetFTP.IsNexio()) { long sourceSize = inputFile.Length; long uploadedSize = targetFTP.GetFileSize(OutputName); if (sourceSize != uploadedSize) @@ -94,7 +82,8 @@ namespace MaestroShared.Targets { protected override void UploadFile() { string targetFilePath = OutputName; - if (Parameters.TargetConfig.TemporaryCopy) + bool temporaryCopy = !targetFTP.IsNexio() && Parameters.TargetConfig.TemporaryCopy; + if (temporaryCopy) targetFilePath = OutputName + ".tmp"; using (FileStream istream = File.OpenRead(Input)) { @@ -113,7 +102,7 @@ namespace MaestroShared.Targets { if (!reply.Success || !_226.Equals(reply.Code)) throw new Exception(UPLOAD_ERROR); - if (Parameters.TargetConfig.TemporaryCopy) { + if (temporaryCopy) { if (!targetFTP.MoveFile(targetFilePath, OutputName)) throw new Exception(UPLOAD_ERROR); } diff --git a/client/MaestroShared/Targets/FXPTargetProcessor.cs b/client/MaestroShared/Targets/FXPTargetProcessor.cs index 8882da73..853abded 100644 --- a/client/MaestroShared/Targets/FXPTargetProcessor.cs +++ b/client/MaestroShared/Targets/FXPTargetProcessor.cs @@ -127,17 +127,6 @@ namespace MaestroShared.Targets { //logger.Debug("Done"); } - public static String ReadFully(Stream input) { - byte[] buffer = new byte[1024]; - using (MemoryStream ms = new MemoryStream()) { - int read; - while ((read = input.Read(buffer, 0, buffer.Length)) > 0) { - ms.Write(buffer, 0, read); - } - return ms.ToString(); - } - } - private long GetNexioLength() { long result = 0; string xml = Input.Replace(".MXF", ".XML"); diff --git a/client/MaestroShared/Targets/ITargetProcessor.cs b/client/MaestroShared/Targets/ITargetProcessor.cs index da99cf59..04b3b4e1 100644 --- a/client/MaestroShared/Targets/ITargetProcessor.cs +++ b/client/MaestroShared/Targets/ITargetProcessor.cs @@ -9,6 +9,7 @@ namespace MaestroShared.Targets { TargetProcessorParameter Parameters { get; } DateTime Started { get; set; } DateTime Finished { get; set; } + string InputName { get; set; } string Input { get; set; } string Output { get; set; } string Status { get; set; } diff --git a/client/MaestroShared/Targets/UNCTargetProcessor.cs b/client/MaestroShared/Targets/UNCTargetProcessor.cs index 3a111c55..d82893d5 100644 --- a/client/MaestroShared/Targets/UNCTargetProcessor.cs +++ b/client/MaestroShared/Targets/UNCTargetProcessor.cs @@ -91,7 +91,7 @@ namespace MaestroShared.Targets { ValidateTransfer(); //logger.Info("Spend (s):" + (DateTime.Now - started).TotalSeconds); Status = READY; - Message = SUCCESS; + Message = SUCCESS + " " + SUCCESS + " " + SUCCESS + " " + SUCCESS + " " + SUCCESS; } if (Parameters.TargetConfig.DeleteAfterCopy) DeleteAfterCopy(); @@ -179,8 +179,8 @@ namespace MaestroShared.Targets { protected override void ExecuteCompleted() { logger.Trace(Strings.ENTRY); - base.ExecuteCompleted(); workFlowAction.description = SUCCESS; + base.ExecuteCompleted(); workFlowAction.successful = true; if (Parameters.TargetConfig.NexioServer) UploadNexioMetadata(); @@ -358,6 +358,9 @@ namespace MaestroShared.Targets { KillDatePath = GetOutputFilePath(statusWorkDir, fileName); UploadContent(KillDatePath, new byte[] { }); KillDate = date.ToString(DATE_FORMAT); + if (!FileExists(fileName)) { + workFlowAction.description += " A KILLDATE állomány nem jött létre!"; + } logger.Trace(Strings.EXIT); } diff --git a/client/OctopusClient/OctopusAPI.cs b/client/OctopusClient/OctopusAPI.cs index aaff347a..65c242e5 100644 --- a/client/OctopusClient/OctopusAPI.cs +++ b/client/OctopusClient/OctopusAPI.cs @@ -77,6 +77,23 @@ namespace OctopusClient { this.messageBus = messageBus; } + public String GetRundownContent(string id) { + String result = null; + try { + var request = new RestRequest("rundownContent/{id}", Method.GET); + request.AddParameter(ID, id, ParameterType.UrlSegment); + var response = client.Execute(request); + if (String.IsNullOrEmpty(response.Content)) + return null; + if (response.ErrorException != null) + throw new Exception(response.ErrorMessage); + result = response.Content; + } catch (Exception e) { + OnError(e); + } + return result; + } + public IEnumerable GetRundowns(DateTime scheduledDate) { IEnumerable result = null; try { diff --git a/server/user.jobengine.executors/src/user/jobengine/server/steps/CopyForArchiveNEXIORecordingsStep.java b/server/user.jobengine.executors/src/user/jobengine/server/steps/CopyForArchiveNEXIORecordingsStep.java index 6021bec1..6bd36918 100644 --- a/server/user.jobengine.executors/src/user/jobengine/server/steps/CopyForArchiveNEXIORecordingsStep.java +++ b/server/user.jobengine.executors/src/user/jobengine/server/steps/CopyForArchiveNEXIORecordingsStep.java @@ -289,39 +289,10 @@ public class CopyForArchiveNEXIORecordingsStep extends JobStep { result.setItemHouseId(String.valueOf(rundownID)); result.setItemTitle(String.format("%s %s %s", start, name, channel)); - // StringBuilder sb = new StringBuilder(); - // for (DBObject s : stories) { - // BasicDBObject story = (BasicDBObject) s; - // sb.append(story.getString(IOctopusAPI.PARENT_STORY_ID)); - // sb.append(" [" + story.getString(IOctopusAPI.FORMAT) + "] "); - // sb.append(story.getString(IOctopusAPI.NAME)); - // sb.append("\r\n"); - // } - - StringBuilder sb = new StringBuilder(); - for (DBObject s : stories) { - BasicDBObject story = (BasicDBObject) s; - - sb.append("*** "); - sb.append(story.getString(IOctopusAPI.PARENT_STORY_ID)); - sb.append(" [" + story.getString(IOctopusAPI.FORMAT) + "] "); - sb.append(story.getString(IOctopusAPI.NAME)); - sb.append(" ***"); - sb.append("\r\n"); - String content = story.getString(IOctopusAPI.SCRIPT_CONTENT); - if (content != null) { - content = content.replace("\r\n\r\n\r\n\r\n", "\r\n"); - content = content.replace("\r\n\r\n\r\n", "\r\n"); - content = content.replace("\r\n\r\n", "\r\n"); - sb.append(content); - sb.append("\r\n"); - } - } - StoryArchive storyArchive = new StoryArchive(); storyArchive.setMediaHouseId(result.getItemHouseId()); storyArchive.setMediaTitle(clipName); - storyArchive.setMediaDesc(sb.toString()); + storyArchive.setMediaDesc(octopusAPI.getRundownContent(stories)); result.addStoryArchive(storyArchive); storyArchive.addFileArchive(new FileArchive(clipName, duration)); return result; diff --git a/server/user.jobengine.osgi.commons/src/user/commons/octopus/IOctopusAPI.java b/server/user.jobengine.osgi.commons/src/user/commons/octopus/IOctopusAPI.java index 86360d46..83ae7876 100644 --- a/server/user.jobengine.osgi.commons/src/user/commons/octopus/IOctopusAPI.java +++ b/server/user.jobengine.osgi.commons/src/user/commons/octopus/IOctopusAPI.java @@ -55,6 +55,10 @@ public interface IOctopusAPI { DBObject getRundownByID(long rundownID); + String getRundownContent(List stories); + + String getRundownContent(long id); + List getRundownFullStories(long id); List getRundowns(Date scheduledDate); diff --git a/server/user.jobengine.osgi.commons/src/user/commons/octopus/OctopusAPI.java b/server/user.jobengine.osgi.commons/src/user/commons/octopus/OctopusAPI.java index 4244dd5d..d77ef208 100644 --- a/server/user.jobengine.osgi.commons/src/user/commons/octopus/OctopusAPI.java +++ b/server/user.jobengine.osgi.commons/src/user/commons/octopus/OctopusAPI.java @@ -91,6 +91,47 @@ public class OctopusAPI implements IOctopusAPI { return result; } + @Override + public String getRundownContent(List stories) { + if (stories == null || stories.size() == 0) + return null; + + StringBuilder sb = new StringBuilder(); + for (DBObject s : stories) { + BasicDBObject story = (BasicDBObject) s; + + sb.append("*** "); + sb.append(story.getString(IOctopusAPI.PARENT_STORY_ID)); + String format = story.getString(IOctopusAPI.FORMAT); + if (format != null) + sb.append(" [" + story.getString(IOctopusAPI.FORMAT) + "] "); + else + sb.append(" "); + String name = story.getString(IOctopusAPI.NAME); + if (name != null) + sb.append(name); + sb.append(" ***"); + sb.append("\r\n"); + String content = story.getString(IOctopusAPI.SCRIPT_CONTENT); + if (content != null) { + content = content.replace("\r\n\r\n\r\n\r\n", "\r\n"); + content = content.replace("\r\n\r\n\r\n", "\r\n"); + content = content.replace("\r\n\r\n", "\r\n"); + sb.append(content); + sb.append("\r\n"); + } + } + return sb.toString(); + } + + @Override + public String getRundownContent(long id) { + BasicDBObject fields = new BasicDBObject(ID, 1).append(PARENT_STORY_ID, 1).append(NAME, 1).append(MODIFIED, 1).append(REF_RUNDOWN, 1).append(FORMAT, 1) + .append(MOS_OBJECTS, 1).append(SCRIPT_CONTENT, 1); + List stories = getRundownStories(id, fields); + return getRundownContent(stories); + } + @Override public List getRundownFullStories(long id) { List result = null; diff --git a/server/user.jobengine.osgi.services/src/user/jobengine/osgi/rest/octopus/OctopusRESTService.java b/server/user.jobengine.osgi.services/src/user/jobengine/osgi/rest/octopus/OctopusRESTService.java index 5e986db0..d8e19993 100644 --- a/server/user.jobengine.osgi.services/src/user/jobengine/osgi/rest/octopus/OctopusRESTService.java +++ b/server/user.jobengine.osgi.services/src/user/jobengine/osgi/rest/octopus/OctopusRESTService.java @@ -1,5 +1,6 @@ package user.jobengine.osgi.rest.octopus; +import java.text.SimpleDateFormat; import java.util.Date; import java.util.List; @@ -15,8 +16,10 @@ import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.joda.time.DateTime; +import com.ibm.nosql.json.api.BasicDBObject; import com.ibm.nosql.json.api.DBObject; +import user.commons.ListUtils; import user.commons.octopus.IOctopusAPI; import user.jobengine.osgi.rest.ComponentBinder; @@ -34,6 +37,55 @@ public class OctopusRESTService { return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(e.getMessage()).build(); } + @GET + @Path("/rundownContent/{id}") + @Produces({ MediaType.APPLICATION_JSON + ";charset=utf-8" }) + public Response getRundownContent(@PathParam(ID) long id) { + logger.trace("Entry"); + Response result = null; + try { + result = Response.ok(octopusService.getRundownContent(id)).build(); + } catch (Exception e) { + result = createErrorResponse(e); + } + logger.trace("Exit"); + return result; + } + + @GET + @Path("/rundownList") + @Produces({ MediaType.TEXT_HTML + ";charset=utf-8" }) + public Response getRundownList() { + logger.trace("Entry"); + Response result = null; + try { + StringBuilder sb = new StringBuilder(); + + List rundowns = ListUtils.cast(octopusService.getRundowns(null)); + SimpleDateFormat sdt = new SimpleDateFormat("yyyy.MM.dd hh:mm"); + for (BasicDBObject rundown : rundowns) { + String name = rundown.getString(IOctopusAPI.NAME); + + if (name != null) { + int pos = name.lastIndexOf(" "); + pos = name.lastIndexOf(" ", pos - 1); + if (pos > 0) + name = name.substring(0, pos); + } + + String date = sdt.format(rundown.getDate(IOctopusAPI.SCHEDULED_START)); + long id = rundown.getLong(IOctopusAPI.ID); + sb.append(String.format("[%s] %s
", id, date, name)); + } + + result = Response.ok(sb.toString()).build(); + } catch (Exception e) { + result = createErrorResponse(e); + } + logger.trace("Exit"); + return result; + } + @GET @Path("/rundowns") @Consumes({ MediaType.APPLICATION_JSON }) -- 2.54.0