From b0440b0d5bd5af22d51a38aa3f2f11e0cac87639 Mon Sep 17 00:00:00 2001 From: =?utf8?q?V=C3=A1s=C3=A1ry=20D=C3=A1niel?= Date: Sun, 12 Nov 2017 21:07:02 +0000 Subject: [PATCH] git-tfs-id: [http://tfs.userrendszerhaz.hu:8080/tfs/DefaultCollection]$/MediaCube;C30716 --- .../Configuration/configuration-editor.json | 2 +- .../configuration-nexio-ingest.json | 2 +- .../Configuration/configuration-sxs.json | 2 +- client/Maestro/MaestroForm.Designer.cs | 185 ++++++++--------- client/Maestro/MaestroForm.Metadata.cs | 40 +++- client/Maestro/MaestroForm.Source.cs | 10 +- client/Maestro/MaestroForm.cs | 1 + client/OctopusClient/OctopusAPI.cs | 43 ++-- .../OctopusIDSelector.Designer.cs | 114 ++++------- client/OctopusClient/OctopusIDSelector.cs | 193 ++++++++++-------- client/OctopusClient/OctopusIDSelector.resx | 6 - .../server/steps/SyncOCTOPUSDataStep.java | 2 +- .../commons/octopus/OctopusDataMiner.java | 2 +- 13 files changed, 309 insertions(+), 293 deletions(-) diff --git a/client/Maestro/Configuration/configuration-editor.json b/client/Maestro/Configuration/configuration-editor.json index 55e90f01..72689711 100644 --- a/client/Maestro/Configuration/configuration-editor.json +++ b/client/Maestro/Configuration/configuration-editor.json @@ -1,6 +1,6 @@ { "title": "Szerkesztő", - "active": true, + "active": false, "startInTray": false, "enableCustomMetadataId": true, "player": { diff --git a/client/Maestro/Configuration/configuration-nexio-ingest.json b/client/Maestro/Configuration/configuration-nexio-ingest.json index d247d4f9..17c6143e 100644 --- a/client/Maestro/Configuration/configuration-nexio-ingest.json +++ b/client/Maestro/Configuration/configuration-nexio-ingest.json @@ -1,6 +1,6 @@ { "title": "NEXIO betöltő", - "active": true, + "active": false, "startInTray": false, "enableCustomMetadataId": true, "player": { diff --git a/client/Maestro/Configuration/configuration-sxs.json b/client/Maestro/Configuration/configuration-sxs.json index a3a97954..7032fa13 100644 --- a/client/Maestro/Configuration/configuration-sxs.json +++ b/client/Maestro/Configuration/configuration-sxs.json @@ -1,6 +1,6 @@ { "title": "SxS", - "active": false, + "active": true, "startInTray": false, "enableCustomMetadataId": true, "player": { diff --git a/client/Maestro/MaestroForm.Designer.cs b/client/Maestro/MaestroForm.Designer.cs index 5040ec99..f921ac34 100644 --- a/client/Maestro/MaestroForm.Designer.cs +++ b/client/Maestro/MaestroForm.Designer.cs @@ -26,21 +26,21 @@ namespace Maestro { /// private void InitializeComponent() { this.components = new System.ComponentModel.Container(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle3 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle15 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle16 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle17 = new System.Windows.Forms.DataGridViewCellStyle(); System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MaestroForm)); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle4 = new System.Windows.Forms.DataGridViewCellStyle(); - 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 dataGridViewCellStyle12 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle13 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle14 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle11 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle18 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle21 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle22 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle23 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle19 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle20 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle24 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle26 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle27 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle28 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle25 = new System.Windows.Forms.DataGridViewCellStyle(); this.groupSource = new System.Windows.Forms.GroupBox(); this.dgSource = new System.Windows.Forms.DataGridView(); this.bindingSource = new System.Windows.Forms.BindingSource(this.components); @@ -158,32 +158,32 @@ namespace Maestro { this.dgSource.BackgroundColor = System.Drawing.Color.White; this.dgSource.BorderStyle = System.Windows.Forms.BorderStyle.None; this.dgSource.CellBorderStyle = System.Windows.Forms.DataGridViewCellBorderStyle.Raised; - dataGridViewCellStyle1.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; - dataGridViewCellStyle1.BackColor = System.Drawing.SystemColors.Control; - dataGridViewCellStyle1.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); - dataGridViewCellStyle1.ForeColor = System.Drawing.SystemColors.WindowText; - dataGridViewCellStyle1.SelectionBackColor = System.Drawing.SystemColors.Highlight; - dataGridViewCellStyle1.SelectionForeColor = System.Drawing.SystemColors.HighlightText; - dataGridViewCellStyle1.WrapMode = System.Windows.Forms.DataGridViewTriState.True; - this.dgSource.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle1; + dataGridViewCellStyle15.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; + dataGridViewCellStyle15.BackColor = System.Drawing.SystemColors.Control; + dataGridViewCellStyle15.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); + dataGridViewCellStyle15.ForeColor = System.Drawing.SystemColors.WindowText; + dataGridViewCellStyle15.SelectionBackColor = System.Drawing.SystemColors.Highlight; + dataGridViewCellStyle15.SelectionForeColor = System.Drawing.SystemColors.HighlightText; + dataGridViewCellStyle15.WrapMode = System.Windows.Forms.DataGridViewTriState.True; + this.dgSource.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle15; this.dgSource.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; this.dgSource.DataSource = this.bindingSource; - dataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; - dataGridViewCellStyle2.BackColor = System.Drawing.SystemColors.Window; - dataGridViewCellStyle2.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); - dataGridViewCellStyle2.ForeColor = System.Drawing.SystemColors.ControlText; - dataGridViewCellStyle2.SelectionBackColor = System.Drawing.Color.Gainsboro; - dataGridViewCellStyle2.SelectionForeColor = System.Drawing.Color.Black; - dataGridViewCellStyle2.WrapMode = System.Windows.Forms.DataGridViewTriState.False; - this.dgSource.DefaultCellStyle = dataGridViewCellStyle2; + dataGridViewCellStyle16.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; + dataGridViewCellStyle16.BackColor = System.Drawing.SystemColors.Window; + dataGridViewCellStyle16.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); + dataGridViewCellStyle16.ForeColor = System.Drawing.SystemColors.ControlText; + dataGridViewCellStyle16.SelectionBackColor = System.Drawing.Color.Gainsboro; + dataGridViewCellStyle16.SelectionForeColor = System.Drawing.Color.Black; + dataGridViewCellStyle16.WrapMode = System.Windows.Forms.DataGridViewTriState.False; + this.dgSource.DefaultCellStyle = dataGridViewCellStyle16; this.dgSource.Dock = System.Windows.Forms.DockStyle.Fill; this.dgSource.EditMode = System.Windows.Forms.DataGridViewEditMode.EditProgrammatically; this.dgSource.EnableHeadersVisualStyles = false; this.dgSource.Location = new System.Drawing.Point(10, 47); this.dgSource.Name = "dgSource"; this.dgSource.RowHeadersVisible = false; - dataGridViewCellStyle3.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); - this.dgSource.RowsDefaultCellStyle = dataGridViewCellStyle3; + dataGridViewCellStyle17.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); + this.dgSource.RowsDefaultCellStyle = dataGridViewCellStyle17; this.dgSource.RowTemplate.DefaultCellStyle.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); this.dgSource.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; this.dgSource.Size = new System.Drawing.Size(347, 352); @@ -468,6 +468,7 @@ namespace Maestro { this.btnLookupMetadata.Size = new System.Drawing.Size(30, 26); this.btnLookupMetadata.TabIndex = 16; this.btnLookupMetadata.UseVisualStyleBackColor = false; + this.btnLookupMetadata.Click += new System.EventHandler(this.OnLookupByMetadata); // // mbActions // @@ -633,14 +634,14 @@ namespace Maestro { this.dgJobs.AutoSizeRowsMode = System.Windows.Forms.DataGridViewAutoSizeRowsMode.DisplayedCells; this.dgJobs.BackgroundColor = System.Drawing.Color.White; this.dgJobs.BorderStyle = System.Windows.Forms.BorderStyle.None; - dataGridViewCellStyle4.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; - dataGridViewCellStyle4.BackColor = System.Drawing.SystemColors.Control; - dataGridViewCellStyle4.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); - dataGridViewCellStyle4.ForeColor = System.Drawing.SystemColors.WindowText; - dataGridViewCellStyle4.SelectionBackColor = System.Drawing.SystemColors.Highlight; - dataGridViewCellStyle4.SelectionForeColor = System.Drawing.SystemColors.HighlightText; - dataGridViewCellStyle4.WrapMode = System.Windows.Forms.DataGridViewTriState.True; - this.dgJobs.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle4; + dataGridViewCellStyle18.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; + dataGridViewCellStyle18.BackColor = System.Drawing.SystemColors.Control; + dataGridViewCellStyle18.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); + dataGridViewCellStyle18.ForeColor = System.Drawing.SystemColors.WindowText; + dataGridViewCellStyle18.SelectionBackColor = System.Drawing.SystemColors.Highlight; + dataGridViewCellStyle18.SelectionForeColor = System.Drawing.SystemColors.HighlightText; + dataGridViewCellStyle18.WrapMode = System.Windows.Forms.DataGridViewTriState.True; + this.dgJobs.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle18; this.dgJobs.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; this.dgJobs.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { this.columnLabel, @@ -653,32 +654,32 @@ namespace Maestro { this.columnOutput, this.columnKillDate}); this.dgJobs.DataSource = this.bindingSourceJobs; - dataGridViewCellStyle7.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; - dataGridViewCellStyle7.BackColor = System.Drawing.SystemColors.Window; - dataGridViewCellStyle7.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); - dataGridViewCellStyle7.ForeColor = System.Drawing.SystemColors.ControlText; - dataGridViewCellStyle7.NullValue = null; - dataGridViewCellStyle7.SelectionBackColor = System.Drawing.Color.Gainsboro; - dataGridViewCellStyle7.SelectionForeColor = System.Drawing.Color.Black; - dataGridViewCellStyle7.WrapMode = System.Windows.Forms.DataGridViewTriState.False; - this.dgJobs.DefaultCellStyle = dataGridViewCellStyle7; + dataGridViewCellStyle21.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; + dataGridViewCellStyle21.BackColor = System.Drawing.SystemColors.Window; + dataGridViewCellStyle21.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); + dataGridViewCellStyle21.ForeColor = System.Drawing.SystemColors.ControlText; + dataGridViewCellStyle21.NullValue = null; + dataGridViewCellStyle21.SelectionBackColor = System.Drawing.Color.Gainsboro; + dataGridViewCellStyle21.SelectionForeColor = System.Drawing.Color.Black; + dataGridViewCellStyle21.WrapMode = System.Windows.Forms.DataGridViewTriState.False; + this.dgJobs.DefaultCellStyle = dataGridViewCellStyle21; this.dgJobs.Dock = System.Windows.Forms.DockStyle.Fill; this.dgJobs.EditMode = System.Windows.Forms.DataGridViewEditMode.EditProgrammatically; this.dgJobs.EnableHeadersVisualStyles = false; this.dgJobs.GridColor = System.Drawing.Color.White; this.dgJobs.Location = new System.Drawing.Point(3, 3); this.dgJobs.Name = "dgJobs"; - dataGridViewCellStyle8.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; - dataGridViewCellStyle8.BackColor = System.Drawing.SystemColors.Control; - dataGridViewCellStyle8.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); - dataGridViewCellStyle8.ForeColor = System.Drawing.SystemColors.WindowText; - dataGridViewCellStyle8.SelectionBackColor = System.Drawing.SystemColors.Highlight; - dataGridViewCellStyle8.SelectionForeColor = System.Drawing.SystemColors.HighlightText; - dataGridViewCellStyle8.WrapMode = System.Windows.Forms.DataGridViewTriState.True; - this.dgJobs.RowHeadersDefaultCellStyle = dataGridViewCellStyle8; + dataGridViewCellStyle22.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; + dataGridViewCellStyle22.BackColor = System.Drawing.SystemColors.Control; + dataGridViewCellStyle22.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); + dataGridViewCellStyle22.ForeColor = System.Drawing.SystemColors.WindowText; + dataGridViewCellStyle22.SelectionBackColor = System.Drawing.SystemColors.Highlight; + dataGridViewCellStyle22.SelectionForeColor = System.Drawing.SystemColors.HighlightText; + dataGridViewCellStyle22.WrapMode = System.Windows.Forms.DataGridViewTriState.True; + this.dgJobs.RowHeadersDefaultCellStyle = dataGridViewCellStyle22; this.dgJobs.RowHeadersVisible = false; - dataGridViewCellStyle9.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); - this.dgJobs.RowsDefaultCellStyle = dataGridViewCellStyle9; + dataGridViewCellStyle23.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); + this.dgJobs.RowsDefaultCellStyle = dataGridViewCellStyle23; this.dgJobs.RowTemplate.DefaultCellStyle.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); this.dgJobs.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; this.dgJobs.Size = new System.Drawing.Size(988, 92); @@ -698,8 +699,8 @@ namespace Maestro { // 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; + dataGridViewCellStyle19.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); + this.columnID.DefaultCellStyle = dataGridViewCellStyle19; this.columnID.HeaderText = "ID"; this.columnID.Name = "columnID"; this.columnID.Width = 44; @@ -716,8 +717,8 @@ namespace Maestro { // 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; + dataGridViewCellStyle20.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); + this.columnStatus.DefaultCellStyle = dataGridViewCellStyle20; this.columnStatus.HeaderText = "Status"; this.columnStatus.Name = "columnStatus"; this.columnStatus.Width = 66; @@ -781,27 +782,27 @@ namespace Maestro { this.dgMessages.AutoSizeRowsMode = System.Windows.Forms.DataGridViewAutoSizeRowsMode.DisplayedCells; this.dgMessages.BackgroundColor = System.Drawing.Color.White; this.dgMessages.BorderStyle = System.Windows.Forms.BorderStyle.None; - dataGridViewCellStyle10.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; - dataGridViewCellStyle10.BackColor = System.Drawing.SystemColors.Control; - dataGridViewCellStyle10.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); - dataGridViewCellStyle10.ForeColor = System.Drawing.SystemColors.WindowText; - dataGridViewCellStyle10.SelectionBackColor = System.Drawing.SystemColors.Highlight; - dataGridViewCellStyle10.SelectionForeColor = System.Drawing.SystemColors.HighlightText; - dataGridViewCellStyle10.WrapMode = System.Windows.Forms.DataGridViewTriState.True; - this.dgMessages.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle10; + dataGridViewCellStyle24.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; + dataGridViewCellStyle24.BackColor = System.Drawing.SystemColors.Control; + dataGridViewCellStyle24.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); + dataGridViewCellStyle24.ForeColor = System.Drawing.SystemColors.WindowText; + dataGridViewCellStyle24.SelectionBackColor = System.Drawing.SystemColors.Highlight; + dataGridViewCellStyle24.SelectionForeColor = System.Drawing.SystemColors.HighlightText; + dataGridViewCellStyle24.WrapMode = System.Windows.Forms.DataGridViewTriState.True; + this.dgMessages.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle24; this.dgMessages.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; this.dgMessages.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { this.dataGridViewTextBoxColumn1, this.dataGridViewTextBoxColumn2}); - dataGridViewCellStyle12.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; - dataGridViewCellStyle12.BackColor = System.Drawing.SystemColors.Window; - dataGridViewCellStyle12.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); - dataGridViewCellStyle12.ForeColor = System.Drawing.Color.Red; - dataGridViewCellStyle12.NullValue = null; - dataGridViewCellStyle12.SelectionBackColor = System.Drawing.Color.Gainsboro; - dataGridViewCellStyle12.SelectionForeColor = System.Drawing.Color.Red; - dataGridViewCellStyle12.WrapMode = System.Windows.Forms.DataGridViewTriState.False; - this.dgMessages.DefaultCellStyle = dataGridViewCellStyle12; + dataGridViewCellStyle26.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; + dataGridViewCellStyle26.BackColor = System.Drawing.SystemColors.Window; + dataGridViewCellStyle26.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); + dataGridViewCellStyle26.ForeColor = System.Drawing.Color.Red; + dataGridViewCellStyle26.NullValue = null; + dataGridViewCellStyle26.SelectionBackColor = System.Drawing.Color.Gainsboro; + dataGridViewCellStyle26.SelectionForeColor = System.Drawing.Color.Red; + dataGridViewCellStyle26.WrapMode = System.Windows.Forms.DataGridViewTriState.False; + this.dgMessages.DefaultCellStyle = dataGridViewCellStyle26; this.dgMessages.Dock = System.Windows.Forms.DockStyle.Fill; this.dgMessages.EditMode = System.Windows.Forms.DataGridViewEditMode.EditProgrammatically; this.dgMessages.EnableHeadersVisualStyles = false; @@ -809,17 +810,17 @@ namespace Maestro { this.dgMessages.Location = new System.Drawing.Point(3, 3); this.dgMessages.Name = "dgMessages"; this.dgMessages.ReadOnly = true; - dataGridViewCellStyle13.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; - dataGridViewCellStyle13.BackColor = System.Drawing.SystemColors.Control; - dataGridViewCellStyle13.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); - dataGridViewCellStyle13.ForeColor = System.Drawing.SystemColors.WindowText; - dataGridViewCellStyle13.SelectionBackColor = System.Drawing.SystemColors.Highlight; - dataGridViewCellStyle13.SelectionForeColor = System.Drawing.SystemColors.HighlightText; - dataGridViewCellStyle13.WrapMode = System.Windows.Forms.DataGridViewTriState.True; - this.dgMessages.RowHeadersDefaultCellStyle = dataGridViewCellStyle13; + dataGridViewCellStyle27.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; + dataGridViewCellStyle27.BackColor = System.Drawing.SystemColors.Control; + dataGridViewCellStyle27.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); + dataGridViewCellStyle27.ForeColor = System.Drawing.SystemColors.WindowText; + dataGridViewCellStyle27.SelectionBackColor = System.Drawing.SystemColors.Highlight; + dataGridViewCellStyle27.SelectionForeColor = System.Drawing.SystemColors.HighlightText; + dataGridViewCellStyle27.WrapMode = System.Windows.Forms.DataGridViewTriState.True; + this.dgMessages.RowHeadersDefaultCellStyle = dataGridViewCellStyle27; this.dgMessages.RowHeadersVisible = false; - dataGridViewCellStyle14.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); - this.dgMessages.RowsDefaultCellStyle = dataGridViewCellStyle14; + dataGridViewCellStyle28.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); + this.dgMessages.RowsDefaultCellStyle = dataGridViewCellStyle28; this.dgMessages.RowTemplate.DefaultCellStyle.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); this.dgMessages.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; this.dgMessages.Size = new System.Drawing.Size(988, 92); @@ -838,8 +839,8 @@ namespace Maestro { // this.dataGridViewTextBoxColumn2.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; this.dataGridViewTextBoxColumn2.DataPropertyName = "Message"; - dataGridViewCellStyle11.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); - this.dataGridViewTextBoxColumn2.DefaultCellStyle = dataGridViewCellStyle11; + dataGridViewCellStyle25.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); + this.dataGridViewTextBoxColumn2.DefaultCellStyle = dataGridViewCellStyle25; this.dataGridViewTextBoxColumn2.HeaderText = "Üzenet"; this.dataGridViewTextBoxColumn2.Name = "dataGridViewTextBoxColumn2"; this.dataGridViewTextBoxColumn2.ReadOnly = true; diff --git a/client/Maestro/MaestroForm.Metadata.cs b/client/Maestro/MaestroForm.Metadata.cs index 992234aa..56efa401 100644 --- a/client/Maestro/MaestroForm.Metadata.cs +++ b/client/Maestro/MaestroForm.Metadata.cs @@ -290,7 +290,7 @@ namespace Maestro { Rundown rundown = rundowns[0]; model.itemHouseId = rundown.ID; model.itemTitle = rundown.Name; - model.itemDescription = rundown.Start; + model.itemDescription = rundown.Start.ToString(); } model.mediaHouseId = story.ID; model.mediaTitle = story.Name; @@ -317,7 +317,7 @@ namespace Maestro { UpdateProcessorButtonsEnabled(); UpdateDefineSegmentEnabled(); UpdateEditArchiveMetadataEnabled(); - UpdateLookupMetadataEnabled(); + UpdateLookupByMetadataEnabled(); } private void OnOctopusIDSelected(string id, string name) { @@ -364,9 +364,12 @@ namespace Maestro { case MetadataType.TrafficPromo: tooltip = "Traffic promó azonosító"; break; - case MetadataType.OctopusPlaceHolder: + case MetadataType.OctopusStory: tooltip = "Octopus azonosító"; break; + case MetadataType.OctopusPlaceHolder: + tooltip = "Octopus bejátszó azonosító"; + break; case MetadataType.MediaCube: tooltip = "MediaCube azonosító"; break; @@ -375,6 +378,33 @@ namespace Maestro { return tooltip; } + private void OnLookupByMetadata(object sender, EventArgs e) { + MetadataProvider config = null; + switch (SelectedMetadata?.Kind) { + case MetadataType.TrafficAD: + case MetadataType.TrafficMaterial: + case MetadataType.TrafficPromo: + config = Configuration.GetMetadataProvider(); + if (config == null) + return; + break; + case MetadataType.OctopusPlaceHolder: + config = Configuration.GetMetadataProvider(); + if (config == null) + return; + octopusIDSelector.LookupByPlaceHolder(SelectedMetadata.ID); + break; + case MetadataType.OctopusStory: + config = Configuration.GetMetadataProvider(); + if (config == null) + return; + octopusIDSelector.LookupByStory(SelectedMetadata.ID); + break; + } + } + + + private void UpdateEditArchiveMetadataEnabled() { ctxiModifyArchiveMetadata.Enabled = SelectedSource != null; } @@ -389,5 +419,9 @@ namespace Maestro { validTypes.ToList().Contains(SelectedMetadata.Kind); } + private void UpdateLookupByMetadataEnabled() { + MetadataType metadataType = GuessMetadataType(SelectedMetadata?.ID); + btnLookupMetadata.Enabled = metadataType != MetadataType.None && metadataType != MetadataType.MediaCube; + } } } diff --git a/client/Maestro/MaestroForm.Source.cs b/client/Maestro/MaestroForm.Source.cs index 7165c17e..7810788c 100644 --- a/client/Maestro/MaestroForm.Source.cs +++ b/client/Maestro/MaestroForm.Source.cs @@ -36,7 +36,7 @@ namespace Maestro { UpdateProcessorButtonsEnabled(); UpdateDefineSegmentEnabled(); UpdateEditArchiveMetadataEnabled(); - UpdateLookupMetadataEnabled(); + UpdateLookupBySourceEnabled(); } } @@ -302,10 +302,6 @@ namespace Maestro { } } - private void UpdateLookupMetadataEnabled() { - MetadataType metadataType = GuessMetadataType(SelectedSource?.Prefix); - btnLookupBySource.Enabled = metadataType != MetadataType.MediaCube && metadataType != MetadataType.None; - } private void picClearFilter_Click(object sender, EventArgs e) { txtSourceFilter.Text = null; @@ -320,6 +316,10 @@ namespace Maestro { SelectedSource = null; } + private void UpdateLookupBySourceEnabled() { + MetadataType metadataType = GuessMetadataType(SelectedSource?.Prefix); + btnLookupBySource.Enabled = metadataType != MetadataType.MediaCube && metadataType != MetadataType.None; + } } } diff --git a/client/Maestro/MaestroForm.cs b/client/Maestro/MaestroForm.cs index fb17448d..50081ba6 100644 --- a/client/Maestro/MaestroForm.cs +++ b/client/Maestro/MaestroForm.cs @@ -239,5 +239,6 @@ namespace Maestro { var actualRow = dgJobs.SelectedRows[0]; dgJobs.Rows.Remove(actualRow); } + } } diff --git a/client/OctopusClient/OctopusAPI.cs b/client/OctopusClient/OctopusAPI.cs index d766c817..7e5fee05 100644 --- a/client/OctopusClient/OctopusAPI.cs +++ b/client/OctopusClient/OctopusAPI.cs @@ -13,7 +13,7 @@ namespace OctopusClient { public class Rundown { public string ID { get; set; } public string Name { get; set; } - public string Start { get; set; } + public DateTime Start { get; set; } public override String ToString() { string displayName = string.IsNullOrEmpty(Name) ? OctopusAPI.UNNAMED : Name; string result = ID.Equals("0") ? displayName : String.Format($"{Start} | {displayName} "); @@ -61,7 +61,7 @@ namespace OctopusClient { public class OctopusAPI { private static Logger logger = LogManager.GetCurrentClassLogger(); - public const string UNNAMED = ""; + public const string UNNAMED = "<üres>"; private RestClient client; private string user; private string pwd; @@ -98,15 +98,7 @@ namespace OctopusClient { } JArray resultObject = JArray.Parse(response.Content); - result = resultObject.Children().Select(d => { - Rundown r = new Rundown { - ID = d["id"].ToString(), - Name = d["name"].ToString(), - Start = d["scheduledStart"].ToString() - }; - //logger.Debug($"{r}"); - return r; - }); + result = resultObject.Children().Select(d => ToRundown(d)); } catch (Exception e) { OnError(e); @@ -342,16 +334,7 @@ namespace OctopusClient { } JArray resultObject = JArray.Parse(response.Content); - result = resultObject.Children().Select(d => { - Rundown r = new Rundown { - ID = d["id"].ToString(), - Name = String.IsNullOrEmpty(d["name"].ToString()) ? OctopusAPI.UNNAMED : d["name"].ToString(), - Start = d["scheduledStart"].ToString() - }; - - logger.Debug($"{r}"); - return r; - }); + result = resultObject.Children().Select(d => ToRundown(d)); } catch (Exception e) { OnError(e); @@ -404,15 +387,7 @@ namespace OctopusClient { } JArray resultObject = JArray.Parse(response.Content); - result = resultObject.Children().Select(d => { - Rundown r = new Rundown { - ID = d["id"].ToString(), - Name = d["name"].ToString(), - Start = d["scheduledStart"].ToString() - }; - logger.Debug($"{r}"); - return r; - }); + result = resultObject.Children().Select(d =>ToRundown(d)); } catch (Exception e) { OnError(e); @@ -420,6 +395,14 @@ namespace OctopusClient { return result; } + private static Rundown ToRundown(JToken d) { + return new Rundown { + ID = d["id"].ToString(), + Name = d["name"]?.ToString() ?? UNNAMED, + Start = DateTime.Parse(d["scheduledStart"]?.ToString()) + }; + } + public IEnumerable GetStoryFoldersByPlaceHolderId(string placeHolderID) { IEnumerable result = null; try { diff --git a/client/OctopusClient/OctopusIDSelector.Designer.cs b/client/OctopusClient/OctopusIDSelector.Designer.cs index ec053bf4..26faa3d0 100644 --- a/client/OctopusClient/OctopusIDSelector.Designer.cs +++ b/client/OctopusClient/OctopusIDSelector.Designer.cs @@ -23,22 +23,16 @@ /// the contents of this method with the code editor. /// private void InitializeComponent() { - this.components = new System.ComponentModel.Container(); this.dateScheduled = new System.Windows.Forms.DateTimePicker(); - this.comboRudowns = new System.Windows.Forms.ComboBox(); - this.bindingRundown = new System.Windows.Forms.BindingSource(this.components); + this.cbRundowns = new System.Windows.Forms.ComboBox(); this.treeOctopus = new OctopusClient.CheckableTreeView(); - this.tabControl1 = new System.Windows.Forms.TabControl(); + this.tabOctopusFilter = new System.Windows.Forms.TabControl(); this.tpRundown = new System.Windows.Forms.TabPage(); this.tpStoryFolder = new System.Windows.Forms.TabPage(); - this.comboStoryFolder = new System.Windows.Forms.ComboBox(); - this.bindingStoryFolder = new System.Windows.Forms.BindingSource(this.components); - this.linkID = new System.Windows.Forms.LinkLabel(); - ((System.ComponentModel.ISupportInitialize)(this.bindingRundown)).BeginInit(); - this.tabControl1.SuspendLayout(); + this.cbStoryFolder = new System.Windows.Forms.ComboBox(); + this.tabOctopusFilter.SuspendLayout(); this.tpRundown.SuspendLayout(); this.tpStoryFolder.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.bindingStoryFolder)).BeginInit(); this.SuspendLayout(); // // dateScheduled @@ -50,18 +44,17 @@ this.dateScheduled.TabIndex = 0; this.dateScheduled.ValueChanged += new System.EventHandler(this.dateScheduled_ValueChanged); // - // comboRudowns + // cbRundowns // - this.comboRudowns.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + this.cbRundowns.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); - this.comboRudowns.DataSource = this.bindingRundown; - this.comboRudowns.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; - this.comboRudowns.FormattingEnabled = true; - this.comboRudowns.Location = new System.Drawing.Point(94, 6); - this.comboRudowns.Name = "comboRudowns"; - this.comboRudowns.Size = new System.Drawing.Size(143, 21); - this.comboRudowns.TabIndex = 3; - this.comboRudowns.SelectedValueChanged += new System.EventHandler(this.comboRudowns_SelectedValueChanged); + this.cbRundowns.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.cbRundowns.FormattingEnabled = true; + this.cbRundowns.Location = new System.Drawing.Point(94, 6); + this.cbRundowns.Name = "cbRundowns"; + this.cbRundowns.Size = new System.Drawing.Size(143, 21); + this.cbRundowns.TabIndex = 3; + this.cbRundowns.SelectedValueChanged += new System.EventHandler(this.comboRudowns_SelectedValueChanged); // // treeOctopus // @@ -71,27 +64,27 @@ this.treeOctopus.Dock = System.Windows.Forms.DockStyle.Fill; this.treeOctopus.Location = new System.Drawing.Point(10, 70); this.treeOctopus.Name = "treeOctopus"; - this.treeOctopus.Size = new System.Drawing.Size(251, 273); + this.treeOctopus.Size = new System.Drawing.Size(251, 296); this.treeOctopus.TabIndex = 5; this.treeOctopus.KeyDown += new System.Windows.Forms.KeyEventHandler(this.treeContent_KeyDown); // - // tabControl1 + // tabOctopusFilter // - this.tabControl1.Controls.Add(this.tpRundown); - this.tabControl1.Controls.Add(this.tpStoryFolder); - this.tabControl1.Dock = System.Windows.Forms.DockStyle.Top; - this.tabControl1.Location = new System.Drawing.Point(10, 10); - this.tabControl1.Name = "tabControl1"; - this.tabControl1.SelectedIndex = 0; - this.tabControl1.Size = new System.Drawing.Size(251, 60); - this.tabControl1.TabIndex = 10; - this.tabControl1.Selected += new System.Windows.Forms.TabControlEventHandler(this.tabControl1_Selected); - this.tabControl1.KeyDown += new System.Windows.Forms.KeyEventHandler(this.tabControl1_KeyDown); + this.tabOctopusFilter.Controls.Add(this.tpRundown); + this.tabOctopusFilter.Controls.Add(this.tpStoryFolder); + this.tabOctopusFilter.Dock = System.Windows.Forms.DockStyle.Top; + this.tabOctopusFilter.Location = new System.Drawing.Point(10, 10); + this.tabOctopusFilter.Name = "tabOctopusFilter"; + this.tabOctopusFilter.SelectedIndex = 0; + this.tabOctopusFilter.Size = new System.Drawing.Size(251, 60); + this.tabOctopusFilter.TabIndex = 10; + this.tabOctopusFilter.Selected += new System.Windows.Forms.TabControlEventHandler(this.tabControl1_Selected); + this.tabOctopusFilter.KeyDown += new System.Windows.Forms.KeyEventHandler(this.tabControl1_KeyDown); // // tpRundown // this.tpRundown.Controls.Add(this.dateScheduled); - this.tpRundown.Controls.Add(this.comboRudowns); + this.tpRundown.Controls.Add(this.cbRundowns); this.tpRundown.Location = new System.Drawing.Point(4, 22); this.tpRundown.Name = "tpRundown"; this.tpRundown.Padding = new System.Windows.Forms.Padding(3); @@ -102,7 +95,7 @@ // // tpStoryFolder // - this.tpStoryFolder.Controls.Add(this.comboStoryFolder); + this.tpStoryFolder.Controls.Add(this.cbStoryFolder); this.tpStoryFolder.Location = new System.Drawing.Point(4, 22); this.tpStoryFolder.Name = "tpStoryFolder"; this.tpStoryFolder.Padding = new System.Windows.Forms.Padding(3); @@ -111,34 +104,18 @@ this.tpStoryFolder.Text = "Story Folder"; this.tpStoryFolder.UseVisualStyleBackColor = true; // - // comboStoryFolder + // cbStoryFolder // - this.comboStoryFolder.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + this.cbStoryFolder.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); - this.comboStoryFolder.DataSource = this.bindingStoryFolder; - this.comboStoryFolder.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; - this.comboStoryFolder.FormattingEnabled = true; - this.comboStoryFolder.Location = new System.Drawing.Point(6, 7); - this.comboStoryFolder.Margin = new System.Windows.Forms.Padding(3, 3, 3, 6); - this.comboStoryFolder.Name = "comboStoryFolder"; - this.comboStoryFolder.Size = new System.Drawing.Size(231, 21); - this.comboStoryFolder.TabIndex = 1; - this.comboStoryFolder.SelectedValueChanged += new System.EventHandler(this.comboStoryFolder_SelectedValueChanged); - // - // linkID - // - this.linkID.Dock = System.Windows.Forms.DockStyle.Bottom; - this.linkID.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); - this.linkID.LinkBehavior = System.Windows.Forms.LinkBehavior.HoverUnderline; - this.linkID.Location = new System.Drawing.Point(10, 343); - this.linkID.Name = "linkID"; - this.linkID.Size = new System.Drawing.Size(251, 23); - this.linkID.TabIndex = 12; - this.linkID.TabStop = true; - this.linkID.Text = "Search"; - this.linkID.TextAlign = System.Drawing.ContentAlignment.MiddleRight; - this.linkID.Visible = false; - this.linkID.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linkID_LinkClicked); + this.cbStoryFolder.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.cbStoryFolder.FormattingEnabled = true; + this.cbStoryFolder.Location = new System.Drawing.Point(6, 7); + this.cbStoryFolder.Margin = new System.Windows.Forms.Padding(3, 3, 3, 6); + this.cbStoryFolder.Name = "cbStoryFolder"; + this.cbStoryFolder.Size = new System.Drawing.Size(231, 21); + this.cbStoryFolder.TabIndex = 1; + this.cbStoryFolder.SelectedValueChanged += new System.EventHandler(this.comboStoryFolder_SelectedValueChanged); // // OctopusIDSelector // @@ -146,18 +123,14 @@ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.BackColor = System.Drawing.Color.White; this.Controls.Add(this.treeOctopus); - this.Controls.Add(this.tabControl1); - this.Controls.Add(this.linkID); + this.Controls.Add(this.tabOctopusFilter); this.Margin = new System.Windows.Forms.Padding(10); this.Name = "OctopusIDSelector"; this.Padding = new System.Windows.Forms.Padding(10); this.Size = new System.Drawing.Size(271, 376); - this.Load += new System.EventHandler(this.OctopusIDSelector_Load); - ((System.ComponentModel.ISupportInitialize)(this.bindingRundown)).EndInit(); - this.tabControl1.ResumeLayout(false); + this.tabOctopusFilter.ResumeLayout(false); this.tpRundown.ResumeLayout(false); this.tpStoryFolder.ResumeLayout(false); - ((System.ComponentModel.ISupportInitialize)(this.bindingStoryFolder)).EndInit(); this.ResumeLayout(false); } @@ -165,14 +138,11 @@ #endregion private System.Windows.Forms.DateTimePicker dateScheduled; - private System.Windows.Forms.ComboBox comboRudowns; - private System.Windows.Forms.BindingSource bindingRundown; - private System.Windows.Forms.TabControl tabControl1; + private System.Windows.Forms.ComboBox cbRundowns; + private System.Windows.Forms.TabControl tabOctopusFilter; private System.Windows.Forms.TabPage tpRundown; private System.Windows.Forms.TabPage tpStoryFolder; - private System.Windows.Forms.LinkLabel linkID; - private System.Windows.Forms.ComboBox comboStoryFolder; - private System.Windows.Forms.BindingSource bindingStoryFolder; + private System.Windows.Forms.ComboBox cbStoryFolder; private CheckableTreeView treeOctopus; } } diff --git a/client/OctopusClient/OctopusIDSelector.cs b/client/OctopusClient/OctopusIDSelector.cs index dd6a265f..3226f983 100644 --- a/client/OctopusClient/OctopusIDSelector.cs +++ b/client/OctopusClient/OctopusIDSelector.cs @@ -3,7 +3,6 @@ using System; using System.Linq; using System.Windows.Forms; using System.Collections.Generic; -using System.ComponentModel; using System.Runtime.InteropServices; using LinkDotNet.MessageHandling.Contracts; using System.Drawing; @@ -13,9 +12,10 @@ namespace OctopusClient { public partial class OctopusIDSelector : UserControl { private static Logger logger = LogManager.GetCurrentClassLogger(); - private string id; - private int selectedStoryFolderIndex = -1; - private int selectedRundownIndex = -1; + private string lookupStoryId; + private string lookupPlaceHolderId; + //private int selectedStoryFolderIndex = -1; + //private int selectedRundownIndex = -1; private TreeNode selectedNode; private OctopusAPI client; public OnSelectedIDChanged IDChangedEvent { get; set; } @@ -25,18 +25,38 @@ namespace OctopusClient { set { configuration = value; client = new OctopusAPI(value.Address.OriginalString, value.UserName, value.Password, value.Timeout, value.MessageBus); - //refreshStoryFolders(); refreshRundowns(); } } + private const int TVIF_STATE = 0x8; + private const int TVIS_STATEIMAGEMASK = 0xF000; + private const int TV_FIRST = 0x1100; + private const int TVM_SETITEM = TV_FIRST + 63; + + [StructLayout(LayoutKind.Sequential, Pack = 8, CharSet = CharSet.Auto)] + private struct TVITEM { + public int mask; + public IntPtr hItem; + public int state; + public int stateMask; + [MarshalAs(UnmanagedType.LPTStr)] + public string lpszText; + public int cchTextMax; + public int iImage; + public int iSelectedImage; + public int cChildren; + public IntPtr lParam; + } + + [DllImport("user32.dll", CharSet = CharSet.Auto)] + private static extern IntPtr SendMessage(IntPtr hWnd, int Msg, IntPtr wParam, ref TVITEM lParam); + public OctopusIDSelector() { InitializeComponent(); InitializeControlTexts(); treeOctopus.AfterCheck += OnTreeAfterCheck; treeOctopus.AfterSelect += OnAfterSelect; - //treeOctopus.DrawMode = TreeViewDrawMode.OwnerDrawText; - //treeOctopus.DrawNode += OnDrawNode; } public TreeNode previousSelectedNode = null; @@ -65,12 +85,6 @@ namespace OctopusClient { private void InitializeControlTexts() { tpRundown.Text = Resources.ADASTUKOR; tpStoryFolder.Text = Resources.MAPPA; - linkID.Text = Resources.KERESES; - //bindingRundown.Add(Resources.VALASSZON_ELEMET); - //bindingStoryFolder.Add(Resources.VALASSZON_ELEMET); - } - - private void OctopusIDSelector_Load(object sender, EventArgs e) { } private void dateScheduled_ValueChanged(object sender, EventArgs e) { @@ -78,7 +92,7 @@ namespace OctopusClient { } private void comboRudowns_SelectedValueChanged(object sender, EventArgs e) { - Rundown rundown = comboRudowns.SelectedValue as Rundown; + Rundown rundown = cbRundowns.SelectedValue as Rundown; treeOctopus.Nodes.Clear(); if (rundown == null) return; @@ -89,12 +103,12 @@ namespace OctopusClient { if (stories == null) return; AddStories(stories); - selectedRundownIndex = comboRudowns.SelectedIndex; + //selectedRundownIndex = cbRundowns.SelectedIndex; } private void AddStories(IEnumerable stories) { foreach (var story in stories) { - string name = story.Name == null ? "" : story.Name; + string name = story.Name == null ? OctopusAPI.UNNAMED : story.Name; string label = story.ID; if (!String.IsNullOrEmpty(story.Format)) label += String.Format($" [{story.Format}] {story.Name}"); @@ -104,20 +118,30 @@ namespace OctopusClient { storyNode.Tag = story.ID; if (configuration.DisableStoryCheck) HideCheckBox(treeOctopus, storyNode); + else { + if (lookupStoryId != null && lookupStoryId.Equals(story.ID)) + storyNode.Checked = true; + } + MosObject[] mosObjects = story.MosObjects; if (mosObjects == null) continue; foreach (MosObject mosObject in mosObjects) { TreeNode placeHolderNode = storyNode.Nodes.Add(mosObject.ObjID, String.Format($"{mosObject.ObjID}")); + // TODO wich? placeHolderNode.Tag = mosObject.ID; if (configuration.DisablePlaceHolderCheck) HideCheckBox(treeOctopus, placeHolderNode); + else { + if (lookupPlaceHolderId != null && lookupPlaceHolderId.Equals(mosObject.ID)) + placeHolderNode.Checked = true; + } } } } private void comboStoryFolder_SelectedValueChanged(object sender, EventArgs e) { - StoryFolder storyFolder = comboStoryFolder.SelectedValue as StoryFolder; + StoryFolder storyFolder = cbStoryFolder.SelectedValue as StoryFolder; if (storyFolder == null) return; treeOctopus.Nodes.Clear(); @@ -128,55 +152,46 @@ namespace OctopusClient { if (stories == null) return; AddStories(stories); - selectedStoryFolderIndex = comboStoryFolder.SelectedIndex; + //selectedStoryFolderIndex = cbStoryFolder.SelectedIndex; } private void refreshRundowns() { ClearSelection(); Cursor.Current = Cursors.WaitCursor; - IEnumerable rundowns = client.GetRundowns(dateScheduled.Value.Date)?.ToArray(); - if (rundowns == null) { - //bindingRundown.DataSource = null; + List rundownsResult = client.GetRundowns(dateScheduled.Value.Date)?.ToList(); + if (rundownsResult == null || rundownsResult.Count == 0) { + cbRundowns.DataSource = null; Cursor.Current = Cursors.Default; return; } - BindingList bindingRundowns = new BindingList(); - bindingRundowns.Add(new Rundown() { ID = 0.ToString(), Name = Resources.VALASSZON_ELEMET }); - foreach (Rundown actualRundown in rundowns) { - bindingRundowns.Add(actualRundown); - } - bindingRundown.DataSource = bindingRundowns; - comboRudowns.SelectedIndex = selectedRundownIndex == -1 ? 0 : selectedRundownIndex; - InitCheckID(treeOctopus.Nodes); + List rundowns = new List(); + rundowns.Add(new Rundown() { ID = 0.ToString(), Name = Resources.VALASSZON_ELEMET }); + rundowns.AddRange(rundownsResult); + cbRundowns.DataSource = rundowns; Cursor.Current = Cursors.Default; } private void refreshStoryFolders() { ClearSelection(); Cursor.Current = Cursors.WaitCursor; - IEnumerable storyFolders = client.getStoryFolders()?.ToArray(); - if (storyFolders == null) { - bindingStoryFolder.Remove(Resources.VALASSZON_ELEMET); + List storyFoldersResult = client.getStoryFolders()?.ToList(); + if (storyFoldersResult == null || storyFoldersResult.Count == 0) { + Cursor.Current = Cursors.Default; + cbStoryFolder.DataSource = null; return; } - BindingList bindingStoryFolders = new BindingList(); - bindingStoryFolders.Add(new StoryFolder() { ID = 0.ToString(), Name = Resources.VALASSZON_ELEMET }); - foreach (StoryFolder actualStoryFolder in storyFolders) - bindingStoryFolders.Add(actualStoryFolder); - bindingStoryFolder.DataSource = bindingStoryFolders; - comboStoryFolder.SelectedIndex = selectedStoryFolderIndex == -1 ? 0 : selectedStoryFolderIndex; - InitCheckID(treeOctopus.Nodes); + List storyFolders = new List(); + storyFolders.Add(new StoryFolder() { ID = 0.ToString(), Name = Resources.VALASSZON_ELEMET }); + storyFolders.AddRange(storyFoldersResult); + cbStoryFolder.DataSource = storyFolders; + Cursor.Current = Cursors.Default; } - private void InitCheckID(TreeNodeCollection collection) { - if (!String.IsNullOrEmpty(id)) { - foreach (TreeNode actual in collection) { - if (actual.Text.StartsWith(id)) { - actual.Checked = true; - break; - } else - InitCheckID(actual.Nodes); - + private void InitCheckID(string id, TreeNodeCollection collection) { + foreach (TreeNode actual in collection) { + if (id.Equals(actual.Tag)) { + actual.Checked = true; + break; } } } @@ -188,6 +203,7 @@ namespace OctopusClient { selectedNode.Checked = false; treeOctopus.AfterCheck += OnTreeAfterCheck; selectedNode = null; + IDChangedEvent?.Invoke(null, null); } private void tabControl1_Selected(object sender, TabControlEventArgs e) { @@ -198,15 +214,6 @@ namespace OctopusClient { refreshStoryFolders(); } - private void linkID_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) { - OctopusLookupResultSelector searchMessageBox = new OctopusLookupResultSelector(); - searchMessageBox.ShowDialog(); - } - - public void setLinkIDText(string value) { - linkID.Text = value; - } - private void RefreshPlaceHolderIDS(String ID) { treeOctopus.Nodes.Clear(); @@ -260,29 +267,6 @@ namespace OctopusClient { return client; } - private const int TVIF_STATE = 0x8; - private const int TVIS_STATEIMAGEMASK = 0xF000; - private const int TV_FIRST = 0x1100; - private const int TVM_SETITEM = TV_FIRST + 63; - - [StructLayout(LayoutKind.Sequential, Pack = 8, CharSet = CharSet.Auto)] - private struct TVITEM { - public int mask; - public IntPtr hItem; - public int state; - public int stateMask; - [MarshalAs(UnmanagedType.LPTStr)] - public string lpszText; - public int cchTextMax; - public int iImage; - public int iSelectedImage; - public int cChildren; - public IntPtr lParam; - } - - [DllImport("user32.dll", CharSet = CharSet.Auto)] - private static extern IntPtr SendMessage(IntPtr hWnd, int Msg, IntPtr wParam, - ref TVITEM lParam); /// /// Hides the checkbox for the specified node on a TreeView control. @@ -295,6 +279,55 @@ namespace OctopusClient { tvi.state = 0; SendMessage(tvw.Handle, TVM_SETITEM, IntPtr.Zero, ref tvi); } + + public bool LookupByStory(string storyId) { + if (String.IsNullOrEmpty(storyId)) + return false; + var rundown = client.GetRundownsByStoryID(storyId)?.FirstOrDefault(); + if (rundown == null) + return false; + tabOctopusFilter.SelectedIndex = 0; + dateScheduled.Value = rundown.Start; + refreshRundowns(); + List rundowns = cbRundowns.DataSource as List; + if (rundowns == null) + return false; + var rundownToFelect = rundowns.Where(f => f.ID.Equals(rundown.ID)).FirstOrDefault(); + if (rundownToFelect == null) + return false; + lookupStoryId = storyId; + cbRundowns.SelectedItem = rundownToFelect; + lookupStoryId = null; + return selectedNode != null; + } + + public bool LookupByPlaceHolder(string placeHolderId) { + if (String.IsNullOrEmpty(placeHolderId)) + return false; + var rundown = client.GetRundownsByPlaceHolderId(placeHolderId)?.FirstOrDefault(); + if (rundown == null) { + var storyFolder = client.GetStoryFoldersByPlaceHolderId(placeHolderId)?.FirstOrDefault(); + if (storyFolder == null) + return false; + tabOctopusFilter.SelectedIndex = 1; + refreshStoryFolders(); + List storyFolders = cbStoryFolder.DataSource as List; + if (storyFolders == null) + return false; + var folderToFelect = storyFolders.Where(f => f.ID.Equals(storyFolder.ID)).FirstOrDefault(); + if (folderToFelect == null) + return false; + lookupPlaceHolderId = placeHolderId; + cbStoryFolder.SelectedItem = folderToFelect; + } else { + lookupPlaceHolderId = placeHolderId; + tabOctopusFilter.SelectedIndex = 0; + dateScheduled.Value = rundown.Start; + refreshRundowns(); + } + lookupPlaceHolderId = null; + return selectedNode != null; + } } public class OctopusAPIMessage : IMessage { diff --git a/client/OctopusClient/OctopusIDSelector.resx b/client/OctopusClient/OctopusIDSelector.resx index f50ab11f..29dcb1b3 100644 --- a/client/OctopusClient/OctopusIDSelector.resx +++ b/client/OctopusClient/OctopusIDSelector.resx @@ -117,10 +117,4 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - 17, 17 - - - 155, 17 - \ No newline at end of file diff --git a/server/user.jobengine.executors/src/user/jobengine/server/steps/SyncOCTOPUSDataStep.java b/server/user.jobengine.executors/src/user/jobengine/server/steps/SyncOCTOPUSDataStep.java index f6e6fc21..75f3fe09 100644 --- a/server/user.jobengine.executors/src/user/jobengine/server/steps/SyncOCTOPUSDataStep.java +++ b/server/user.jobengine.executors/src/user/jobengine/server/steps/SyncOCTOPUSDataStep.java @@ -17,7 +17,7 @@ public class SyncOCTOPUSDataStep extends JobStep { return new IProgressEventListener() { @Override public void progressChanged(ProgressEvent evt) { - logger.info("Progress changed to " + evt.getProgress() + "%"); + //logger.debug("Progress changed to " + evt.getProgress() + "%"); jobRuntime.incrementProgress(evt.getProgress()); } }; 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 183fb311..85478e7c 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 @@ -440,7 +440,7 @@ public class OctopusDataMiner implements Runnable { @Override public void run() { - logger.info(STARTING); + logger.trace(STARTING); try { ensureIndexes(); Date lastUpdateTime = getLastUpdateTime(); -- 2.54.0