From f4ca853a7cd12913f6e7382e7bd86c9b40630aff Mon Sep 17 00:00:00 2001 From: =?utf8?q?V=C3=A1s=C3=A1ry=20D=C3=A1niel?= Date: Mon, 16 Dec 2019 12:34:13 +0000 Subject: [PATCH] git-tfs-id: [http://tfs.userrendszerhaz.hu:8080/tfs/DefaultCollection]$/MediaCube;C31677 --- client/DxPlay/Model/DxPlayModel.cs | 2 +- client/DxPlay/PlayerForm.Designer.cs | 229 ++++++++---------- client/DxPlay/PlayerForm.cs | 8 + client/DxPlay/PlayerForm.resx | 2 +- client/Maestro/MaestroForm.Metadata.cs | 6 +- .../executors/tests/SupportCheckItem.java | 88 +++++-- .../server/steps/MetadataTransformStep.java | 13 +- .../src/user/jobengine/db/IItemManager.java | 63 ++--- .../src/user/jobengine/db/ItemManager.java | 38 +++ 9 files changed, 254 insertions(+), 195 deletions(-) diff --git a/client/DxPlay/Model/DxPlayModel.cs b/client/DxPlay/Model/DxPlayModel.cs index e976b95d..42c70f0d 100644 --- a/client/DxPlay/Model/DxPlayModel.cs +++ b/client/DxPlay/Model/DxPlayModel.cs @@ -36,7 +36,7 @@ namespace DxPlay.Model { this.settings = settings; IsSegmentEditorVisible = true.Equals(settings?.Player?.SegmentEditor); IsMenuVisible = true.Equals(settings?.IsStandalone); - Segments = settings.Segments ?? new BindingList(); + Segments = new BindingList(settings.Segments) ?? new BindingList(); multiSegment = true.Equals(settings?.Metadata?.MultiSegmentEnabled); MessageBus.Subscribe(OnMessage); diff --git a/client/DxPlay/PlayerForm.Designer.cs b/client/DxPlay/PlayerForm.Designer.cs index 6902b5da..181d0b38 100644 --- a/client/DxPlay/PlayerForm.Designer.cs +++ b/client/DxPlay/PlayerForm.Designer.cs @@ -28,14 +28,10 @@ namespace DxPlay { /// 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.ComponentModel.ComponentResourceManager resources = - new System.ComponentModel.ComponentResourceManager(typeof(PlayerForm)); + 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.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(PlayerForm)); this.pVideo = new System.Windows.Forms.Panel(); this.mainSplit = new System.Windows.Forms.SplitContainer(); this.panelPlayer = new System.Windows.Forms.Panel(); @@ -66,11 +62,11 @@ namespace DxPlay { this.menuApprove = new DxPlay.Controls.BindableToolStripMenuItem(); this.toolStripSeparator3 = new System.Windows.Forms.ToolStripSeparator(); this.menuRedefineSegments = new DxPlay.Controls.BindableToolStripMenuItem(); - this.playerControls = new DxPlay.Controls.PlayerControls(); this.flowLayoutPanel1 = new System.Windows.Forms.FlowLayoutPanel(); this.btnSave = new System.Windows.Forms.Button(); this.btnCancel = new System.Windows.Forms.Button(); - ((System.ComponentModel.ISupportInitialize) (this.mainSplit)).BeginInit(); + this.playerControls = new DxPlay.Controls.PlayerControls(); + ((System.ComponentModel.ISupportInitialize)(this.mainSplit)).BeginInit(); this.mainSplit.Panel1.SuspendLayout(); this.mainSplit.Panel2.SuspendLayout(); this.mainSplit.SuspendLayout(); @@ -79,8 +75,8 @@ namespace DxPlay { this.tabEditor.SuspendLayout(); this.tpMetadata.SuspendLayout(); this.tpSegments.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize) (this.dgSegments)).BeginInit(); - ((System.ComponentModel.ISupportInitialize) (this.bsSegments)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.dgSegments)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.bsSegments)).BeginInit(); this.segmentActions.SuspendLayout(); this.pMetadataDisplay.SuspendLayout(); this.mainMenu.SuspendLayout(); @@ -94,7 +90,7 @@ namespace DxPlay { this.pVideo.Dock = System.Windows.Forms.DockStyle.Fill; this.pVideo.Location = new System.Drawing.Point(0, 0); this.pVideo.Name = "pVideo"; - this.pVideo.Size = new System.Drawing.Size(478, 331); + this.pVideo.Size = new System.Drawing.Size(478, 385); this.pVideo.TabIndex = 0; this.pVideo.TabStop = true; this.pVideo.SizeChanged += new System.EventHandler(this.panel1_SizeChanged); @@ -117,7 +113,7 @@ namespace DxPlay { this.mainSplit.Panel2.Controls.Add(this.tableLayoutPanel1); this.mainSplit.Panel2.Controls.Add(this.pMetadataDisplay); this.mainSplit.Panel2MinSize = 300; - this.mainSplit.Size = new System.Drawing.Size(784, 333); + this.mainSplit.Size = new System.Drawing.Size(784, 387); this.mainSplit.SplitterDistance = 480; this.mainSplit.TabIndex = 20; // @@ -127,15 +123,14 @@ namespace DxPlay { this.panelPlayer.Dock = System.Windows.Forms.DockStyle.Fill; this.panelPlayer.Location = new System.Drawing.Point(0, 0); this.panelPlayer.Name = "panelPlayer"; - this.panelPlayer.Size = new System.Drawing.Size(478, 331); + this.panelPlayer.Size = new System.Drawing.Size(478, 385); this.panelPlayer.TabIndex = 0; // // tableLayoutPanel1 // this.tableLayoutPanel1.ColumnCount = 2; this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); - this.tableLayoutPanel1.ColumnStyles.Add( - new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); + this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); this.tableLayoutPanel1.Controls.Add(this.tabEditor, 1, 0); this.tableLayoutPanel1.Controls.Add(this.btnToggleSegmentEditor, 0, 0); this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill; @@ -143,9 +138,8 @@ namespace DxPlay { this.tableLayoutPanel1.Margin = new System.Windows.Forms.Padding(0); this.tableLayoutPanel1.Name = "tableLayoutPanel1"; this.tableLayoutPanel1.RowCount = 1; - this.tableLayoutPanel1.RowStyles.Add( - new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); - this.tableLayoutPanel1.Size = new System.Drawing.Size(298, 268); + this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); + this.tableLayoutPanel1.Size = new System.Drawing.Size(298, 322); this.tableLayoutPanel1.TabIndex = 4; // // tabEditor @@ -154,29 +148,27 @@ namespace DxPlay { this.tabEditor.Controls.Add(this.tpMetadata); this.tabEditor.Controls.Add(this.tpSegments); this.tabEditor.Dock = System.Windows.Forms.DockStyle.Fill; - this.tabEditor.Font = new System.Drawing.Font("Microsoft Sans Serif", 10F, System.Drawing.FontStyle.Bold, - System.Drawing.GraphicsUnit.Point, ((byte) (238))); + this.tabEditor.Font = new System.Drawing.Font("Microsoft Sans Serif", 10F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(238))); this.tabEditor.ImageList = this.imagesTabEdit; - this.tabEditor.Location = new System.Drawing.Point(28, 4); + this.tabEditor.Location = new System.Drawing.Point(23, 4); this.tabEditor.Margin = new System.Windows.Forms.Padding(0, 4, 4, 4); this.tabEditor.Multiline = true; this.tabEditor.Name = "tabEditor"; this.tabEditor.Padding = new System.Drawing.Point(10, 5); this.tabEditor.SelectedIndex = 0; - this.tabEditor.Size = new System.Drawing.Size(266, 260); + this.tabEditor.Size = new System.Drawing.Size(271, 314); this.tabEditor.TabIndex = 2; // // tpMetadata // this.tpMetadata.BackColor = System.Drawing.Color.Transparent; this.tpMetadata.Controls.Add(this.trafficBrowser); - this.tpMetadata.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, - System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte) (238))); + this.tpMetadata.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); this.tpMetadata.ImageIndex = 0; this.tpMetadata.Location = new System.Drawing.Point(4, 4); this.tpMetadata.Name = "tpMetadata"; this.tpMetadata.Padding = new System.Windows.Forms.Padding(3); - this.tpMetadata.Size = new System.Drawing.Size(258, 221); + this.tpMetadata.Size = new System.Drawing.Size(263, 275); this.tpMetadata.TabIndex = 0; this.tpMetadata.Text = "Metadata"; // @@ -189,20 +181,19 @@ namespace DxPlay { this.trafficBrowser.Margin = new System.Windows.Forms.Padding(0); this.trafficBrowser.Name = "trafficBrowser"; this.trafficBrowser.Parameters = null; - this.trafficBrowser.Size = new System.Drawing.Size(252, 215); + this.trafficBrowser.Size = new System.Drawing.Size(257, 269); this.trafficBrowser.TabIndex = 0; // // tpSegments // this.tpSegments.Controls.Add(this.dgSegments); this.tpSegments.Controls.Add(this.segmentActions); - this.tpSegments.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, - System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte) (238))); + this.tpSegments.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); this.tpSegments.ImageIndex = 1; this.tpSegments.Location = new System.Drawing.Point(4, 4); this.tpSegments.Name = "tpSegments"; this.tpSegments.Padding = new System.Windows.Forms.Padding(3); - this.tpSegments.Size = new System.Drawing.Size(317, 325); + this.tpSegments.Size = new System.Drawing.Size(192, 30); this.tpSegments.TabIndex = 1; this.tpSegments.Text = "Segments"; this.tpSegments.UseVisualStyleBackColor = true; @@ -217,36 +208,30 @@ namespace DxPlay { this.dgSegments.BorderStyle = System.Windows.Forms.BorderStyle.None; dataGridViewCellStyle1.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; dataGridViewCellStyle1.BackColor = System.Drawing.SystemColors.Control; - dataGridViewCellStyle1.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, - System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte) (238))); + dataGridViewCellStyle1.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, 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.dgSegments.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle1; - this.dgSegments.ColumnHeadersHeightSizeMode = - System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; + this.dgSegments.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; this.dgSegments.DataSource = this.bsSegments; dataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; dataGridViewCellStyle2.BackColor = System.Drawing.SystemColors.Window; - dataGridViewCellStyle2.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, - System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte) (238))); - dataGridViewCellStyle2.ForeColor = System.Drawing.Color.FromArgb(((int) (((byte) (0)))), - ((int) (((byte) (0)))), ((int) (((byte) (0))))); - dataGridViewCellStyle2.SelectionBackColor = System.Drawing.Color.FromArgb(((int) (((byte) (224)))), - ((int) (((byte) (224)))), ((int) (((byte) (224))))); + dataGridViewCellStyle2.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); + dataGridViewCellStyle2.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(0))))); + dataGridViewCellStyle2.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224))))); dataGridViewCellStyle2.SelectionForeColor = System.Drawing.Color.Black; dataGridViewCellStyle2.WrapMode = System.Windows.Forms.DataGridViewTriState.False; this.dgSegments.DefaultCellStyle = dataGridViewCellStyle2; this.dgSegments.Dock = System.Windows.Forms.DockStyle.Fill; this.dgSegments.EditMode = System.Windows.Forms.DataGridViewEditMode.EditOnF2; - this.dgSegments.Location = new System.Drawing.Point(3, 33); + this.dgSegments.Location = new System.Drawing.Point(3, 28); this.dgSegments.MultiSelect = false; this.dgSegments.Name = "dgSegments"; dataGridViewCellStyle3.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; dataGridViewCellStyle3.BackColor = System.Drawing.SystemColors.Control; - dataGridViewCellStyle3.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, - System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte) (238))); + dataGridViewCellStyle3.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); dataGridViewCellStyle3.ForeColor = System.Drawing.SystemColors.WindowText; dataGridViewCellStyle3.SelectionBackColor = System.Drawing.SystemColors.Highlight; dataGridViewCellStyle3.SelectionForeColor = System.Drawing.SystemColors.HighlightText; @@ -254,22 +239,15 @@ namespace DxPlay { this.dgSegments.RowHeadersDefaultCellStyle = dataGridViewCellStyle3; this.dgSegments.RowHeadersVisible = false; this.dgSegments.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; - this.dgSegments.Size = new System.Drawing.Size(311, 289); + this.dgSegments.Size = new System.Drawing.Size(186, 0); this.dgSegments.TabIndex = 1; - this.dgSegments.CellBeginEdit += - new System.Windows.Forms.DataGridViewCellCancelEventHandler(this.OnSegmentsCellBeginEdit); - this.dgSegments.CellContentClick += - new System.Windows.Forms.DataGridViewCellEventHandler(this.OnSegmentsCellContentClick); - this.dgSegments.CellMouseDoubleClick += - new System.Windows.Forms.DataGridViewCellMouseEventHandler(this.OnSegmentsCellMouseDoubleClick); - this.dgSegments.CellMouseEnter += - new System.Windows.Forms.DataGridViewCellEventHandler(this.OnSegmentsCellMouseEnter); - this.dgSegments.CellMouseLeave += - new System.Windows.Forms.DataGridViewCellEventHandler(this.OnSegmentsCellMouseLeave); - this.dgSegments.CellPainting += - new System.Windows.Forms.DataGridViewCellPaintingEventHandler(this.OnSegmentsCellPainting); - this.dgSegments.ColumnAdded += - new System.Windows.Forms.DataGridViewColumnEventHandler(this.OnSegmentsColumnAdded); + this.dgSegments.CellBeginEdit += new System.Windows.Forms.DataGridViewCellCancelEventHandler(this.OnSegmentsCellBeginEdit); + this.dgSegments.CellContentClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.OnSegmentsCellContentClick); + this.dgSegments.CellMouseDoubleClick += new System.Windows.Forms.DataGridViewCellMouseEventHandler(this.OnSegmentsCellMouseDoubleClick); + this.dgSegments.CellMouseEnter += new System.Windows.Forms.DataGridViewCellEventHandler(this.OnSegmentsCellMouseEnter); + this.dgSegments.CellMouseLeave += new System.Windows.Forms.DataGridViewCellEventHandler(this.OnSegmentsCellMouseLeave); + this.dgSegments.CellPainting += new System.Windows.Forms.DataGridViewCellPaintingEventHandler(this.OnSegmentsCellPainting); + this.dgSegments.ColumnAdded += new System.Windows.Forms.DataGridViewColumnEventHandler(this.OnSegmentsColumnAdded); this.dgSegments.MouseClick += new System.Windows.Forms.MouseEventHandler(this.OnSegmentsMouseClick); // // segmentActions @@ -277,86 +255,88 @@ namespace DxPlay { this.segmentActions.AutoSize = false; this.segmentActions.GripStyle = System.Windows.Forms.ToolStripGripStyle.Hidden; this.segmentActions.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.tbDefineSegment, this.toolStripSeparator2, this.tbPositionAsTCIn, this.tbSplitSegment, - this.tbPositionAsTCOut, this.toolStripSeparator1, this.tbDeleteSegment - }); + this.tbDefineSegment, + this.toolStripSeparator2, + this.tbPositionAsTCIn, + this.tbSplitSegment, + this.tbPositionAsTCOut, + this.toolStripSeparator1, + this.tbDeleteSegment}); this.segmentActions.Location = new System.Drawing.Point(3, 3); this.segmentActions.Name = "segmentActions"; this.segmentActions.RenderMode = System.Windows.Forms.ToolStripRenderMode.System; - this.segmentActions.Size = new System.Drawing.Size(311, 30); + this.segmentActions.Size = new System.Drawing.Size(186, 25); this.segmentActions.TabIndex = 0; this.segmentActions.Text = "toolStrip1"; // // tbDefineSegment // this.tbDefineSegment.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; - this.tbDefineSegment.Image = ((System.Drawing.Image) (resources.GetObject("tbDefineSegment.Image"))); + this.tbDefineSegment.Image = ((System.Drawing.Image)(resources.GetObject("tbDefineSegment.Image"))); this.tbDefineSegment.ImageScaling = System.Windows.Forms.ToolStripItemImageScaling.None; this.tbDefineSegment.ImageTransparentColor = System.Drawing.Color.Magenta; this.tbDefineSegment.Name = "tbDefineSegment"; - this.tbDefineSegment.Size = new System.Drawing.Size(23, 27); + this.tbDefineSegment.Size = new System.Drawing.Size(23, 22); this.tbDefineSegment.Text = "toolStripButton5"; this.tbDefineSegment.Click += new System.EventHandler(this.OnDefineOneSegmentClick); // // toolStripSeparator2 // this.toolStripSeparator2.Name = "toolStripSeparator2"; - this.toolStripSeparator2.Size = new System.Drawing.Size(6, 30); + this.toolStripSeparator2.Size = new System.Drawing.Size(6, 25); // // tbPositionAsTCIn // this.tbPositionAsTCIn.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; - this.tbPositionAsTCIn.Image = ((System.Drawing.Image) (resources.GetObject("tbPositionAsTCIn.Image"))); + this.tbPositionAsTCIn.Image = ((System.Drawing.Image)(resources.GetObject("tbPositionAsTCIn.Image"))); this.tbPositionAsTCIn.ImageScaling = System.Windows.Forms.ToolStripItemImageScaling.None; this.tbPositionAsTCIn.ImageTransparentColor = System.Drawing.Color.Magenta; this.tbPositionAsTCIn.Name = "tbPositionAsTCIn"; - this.tbPositionAsTCIn.Size = new System.Drawing.Size(23, 27); + this.tbPositionAsTCIn.Size = new System.Drawing.Size(23, 22); this.tbPositionAsTCIn.Text = "toolStripButton1"; this.tbPositionAsTCIn.Click += new System.EventHandler(this.OnActualPositionToTCInToolStripMenuItem1Click); // // tbSplitSegment // this.tbSplitSegment.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; - this.tbSplitSegment.Image = ((System.Drawing.Image) (resources.GetObject("tbSplitSegment.Image"))); + this.tbSplitSegment.Image = ((System.Drawing.Image)(resources.GetObject("tbSplitSegment.Image"))); this.tbSplitSegment.ImageScaling = System.Windows.Forms.ToolStripItemImageScaling.None; this.tbSplitSegment.ImageTransparentColor = System.Drawing.Color.Magenta; this.tbSplitSegment.Name = "tbSplitSegment"; - this.tbSplitSegment.Size = new System.Drawing.Size(23, 27); + this.tbSplitSegment.Size = new System.Drawing.Size(23, 22); this.tbSplitSegment.Text = "toolStripButton4"; this.tbSplitSegment.Click += new System.EventHandler(this.OnSplitSegmentAtCurrentPositionClick); // // tbPositionAsTCOut // this.tbPositionAsTCOut.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; - this.tbPositionAsTCOut.Image = ((System.Drawing.Image) (resources.GetObject("tbPositionAsTCOut.Image"))); + this.tbPositionAsTCOut.Image = ((System.Drawing.Image)(resources.GetObject("tbPositionAsTCOut.Image"))); this.tbPositionAsTCOut.ImageScaling = System.Windows.Forms.ToolStripItemImageScaling.None; this.tbPositionAsTCOut.ImageTransparentColor = System.Drawing.Color.Magenta; this.tbPositionAsTCOut.Name = "tbPositionAsTCOut"; - this.tbPositionAsTCOut.Size = new System.Drawing.Size(23, 27); + this.tbPositionAsTCOut.Size = new System.Drawing.Size(23, 22); this.tbPositionAsTCOut.Text = "toolStripButton2"; - this.tbPositionAsTCOut.Click += - new System.EventHandler(this.OnActualPositionToTCOutToolStripMenuItem1Click); + this.tbPositionAsTCOut.Click += new System.EventHandler(this.OnActualPositionToTCOutToolStripMenuItem1Click); // // toolStripSeparator1 // this.toolStripSeparator1.Name = "toolStripSeparator1"; - this.toolStripSeparator1.Size = new System.Drawing.Size(6, 30); + this.toolStripSeparator1.Size = new System.Drawing.Size(6, 25); // // tbDeleteSegment // this.tbDeleteSegment.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; - this.tbDeleteSegment.Image = ((System.Drawing.Image) (resources.GetObject("tbDeleteSegment.Image"))); + this.tbDeleteSegment.Image = ((System.Drawing.Image)(resources.GetObject("tbDeleteSegment.Image"))); this.tbDeleteSegment.ImageScaling = System.Windows.Forms.ToolStripItemImageScaling.None; this.tbDeleteSegment.ImageTransparentColor = System.Drawing.Color.Magenta; this.tbDeleteSegment.Name = "tbDeleteSegment"; - this.tbDeleteSegment.Size = new System.Drawing.Size(23, 27); + this.tbDeleteSegment.Size = new System.Drawing.Size(23, 22); this.tbDeleteSegment.Text = "toolStripButton3"; this.tbDeleteSegment.Click += new System.EventHandler(this.OnDeleteSegmentClick); // // imagesTabEdit // - this.imagesTabEdit.ImageStream = - ((System.Windows.Forms.ImageListStreamer) (resources.GetObject("imagesTabEdit.ImageStream"))); + this.imagesTabEdit.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("imagesTabEdit.ImageStream"))); this.imagesTabEdit.TransparentColor = System.Drawing.Color.Transparent; this.imagesTabEdit.Images.SetKeyName(0, "round_publish_black_24dp.png"); this.imagesTabEdit.Images.SetKeyName(1, "ic_playlist_add_check_black_24dp_1x.png"); @@ -366,12 +346,11 @@ namespace DxPlay { this.btnToggleSegmentEditor.BackColor = System.Drawing.Color.White; this.btnToggleSegmentEditor.FlatAppearance.BorderSize = 0; this.btnToggleSegmentEditor.FlatStyle = System.Windows.Forms.FlatStyle.Flat; - this.btnToggleSegmentEditor.Image = - ((System.Drawing.Image) (resources.GetObject("btnToggleSegmentEditor.Image"))); + this.btnToggleSegmentEditor.Image = ((System.Drawing.Image)(resources.GetObject("btnToggleSegmentEditor.Image"))); this.btnToggleSegmentEditor.Location = new System.Drawing.Point(0, 4); this.btnToggleSegmentEditor.Margin = new System.Windows.Forms.Padding(0, 4, 0, 0); this.btnToggleSegmentEditor.Name = "btnToggleSegmentEditor"; - this.btnToggleSegmentEditor.Size = new System.Drawing.Size(28, 77); + this.btnToggleSegmentEditor.Size = new System.Drawing.Size(23, 63); this.btnToggleSegmentEditor.TabIndex = 0; this.btnToggleSegmentEditor.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageBeforeText; this.btnToggleSegmentEditor.UseVisualStyleBackColor = false; @@ -381,14 +360,13 @@ namespace DxPlay { // this.pMetadataDisplay.AutoSize = true; this.pMetadataDisplay.ColumnCount = 2; - this.pMetadataDisplay.ColumnStyles.Add( - new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); + this.pMetadataDisplay.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); this.pMetadataDisplay.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); this.pMetadataDisplay.Controls.Add(this.btnApprove, 1, 1); this.pMetadataDisplay.Controls.Add(this.labelSelectedMetadata, 0, 0); this.pMetadataDisplay.Controls.Add(this.txtSelectedID, 0, 1); this.pMetadataDisplay.Dock = System.Windows.Forms.DockStyle.Bottom; - this.pMetadataDisplay.Location = new System.Drawing.Point(0, 268); + this.pMetadataDisplay.Location = new System.Drawing.Point(0, 322); this.pMetadataDisplay.Margin = new System.Windows.Forms.Padding(0); this.pMetadataDisplay.Name = "pMetadataDisplay"; this.pMetadataDisplay.RowCount = 2; @@ -404,9 +382,8 @@ namespace DxPlay { this.btnApprove.BackColor = System.Drawing.Color.White; this.btnApprove.FlatAppearance.BorderSize = 0; this.btnApprove.FlatStyle = System.Windows.Forms.FlatStyle.Flat; - this.btnApprove.Font = new System.Drawing.Font("Microsoft Sans Serif", 10F, System.Drawing.FontStyle.Bold, - System.Drawing.GraphicsUnit.Point, ((byte) (238))); - this.btnApprove.Image = ((System.Drawing.Image) (resources.GetObject("btnApprove.Image"))); + this.btnApprove.Font = new System.Drawing.Font("Microsoft Sans Serif", 10F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(238))); + this.btnApprove.Image = ((System.Drawing.Image)(resources.GetObject("btnApprove.Image"))); this.btnApprove.Location = new System.Drawing.Point(196, 29); this.btnApprove.Margin = new System.Windows.Forms.Padding(0, 4, 0, 0); this.btnApprove.Name = "btnApprove"; @@ -422,8 +399,7 @@ namespace DxPlay { this.labelSelectedMetadata.AutoSize = true; this.labelSelectedMetadata.BackColor = System.Drawing.Color.Transparent; this.labelSelectedMetadata.Dock = System.Windows.Forms.DockStyle.Fill; - this.labelSelectedMetadata.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, - System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte) (238))); + this.labelSelectedMetadata.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); this.labelSelectedMetadata.ForeColor = System.Drawing.SystemColors.ActiveCaption; this.labelSelectedMetadata.Location = new System.Drawing.Point(3, 0); this.labelSelectedMetadata.Name = "labelSelectedMetadata"; @@ -437,8 +413,7 @@ namespace DxPlay { this.txtSelectedID.BackColor = System.Drawing.SystemColors.ActiveCaption; this.txtSelectedID.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; this.txtSelectedID.Dock = System.Windows.Forms.DockStyle.Fill; - this.txtSelectedID.Font = new System.Drawing.Font("Microsoft Sans Serif", 16F, - System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte) (238))); + this.txtSelectedID.Font = new System.Drawing.Font("Microsoft Sans Serif", 16F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(238))); this.txtSelectedID.Location = new System.Drawing.Point(3, 28); this.txtSelectedID.Name = "txtSelectedID"; this.txtSelectedID.Size = new System.Drawing.Size(190, 32); @@ -446,7 +421,8 @@ namespace DxPlay { // // mainMenu // - this.mainMenu.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {this.fileToolStripMenuItem}); + this.mainMenu.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.fileToolStripMenuItem}); this.mainMenu.Location = new System.Drawing.Point(0, 0); this.mainMenu.Name = "mainMenu"; this.mainMenu.Size = new System.Drawing.Size(784, 24); @@ -455,8 +431,11 @@ namespace DxPlay { // // fileToolStripMenuItem // - this.fileToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] - {this.menuOpenFile, this.menuApprove, this.toolStripSeparator3, this.menuRedefineSegments}); + this.fileToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.menuOpenFile, + this.menuApprove, + this.toolStripSeparator3, + this.menuRedefineSegments}); this.fileToolStripMenuItem.Name = "fileToolStripMenuItem"; this.fileToolStripMenuItem.Size = new System.Drawing.Size(37, 20); this.fileToolStripMenuItem.Text = "File"; @@ -464,8 +443,7 @@ namespace DxPlay { // menuOpenFile // this.menuOpenFile.Name = "menuOpenFile"; - this.menuOpenFile.ShortcutKeys = - ((System.Windows.Forms.Keys) ((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.O))); + this.menuOpenFile.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.O))); this.menuOpenFile.Size = new System.Drawing.Size(215, 22); this.menuOpenFile.Text = "Open file"; this.menuOpenFile.Click += new System.EventHandler(this.menuOpenFile_Click); @@ -473,8 +451,7 @@ namespace DxPlay { // menuApprove // this.menuApprove.Name = "menuApprove"; - this.menuApprove.ShortcutKeys = - ((System.Windows.Forms.Keys) ((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.S))); + this.menuApprove.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.S))); this.menuApprove.Size = new System.Drawing.Size(215, 22); this.menuApprove.Text = "Approve"; this.menuApprove.Click += new System.EventHandler(this.OnApprove); @@ -487,67 +464,68 @@ namespace DxPlay { // menuRedefineSegments // this.menuRedefineSegments.Name = "menuRedefineSegments"; - this.menuRedefineSegments.ShortcutKeys = - ((System.Windows.Forms.Keys) ((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.R))); + this.menuRedefineSegments.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.R))); this.menuRedefineSegments.Size = new System.Drawing.Size(215, 22); this.menuRedefineSegments.Text = "Redefine segments"; this.menuRedefineSegments.Click += new System.EventHandler(this.OnRedefineSegments); // - // playerControls - // - this.playerControls.AutoSize = true; - this.playerControls.BackColor = System.Drawing.Color.Transparent; - this.playerControls.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom; - this.playerControls.Dock = System.Windows.Forms.DockStyle.Bottom; - this.playerControls.Location = new System.Drawing.Point(0, 357); - this.playerControls.Margin = new System.Windows.Forms.Padding(0); - this.playerControls.Name = "playerControls"; - this.playerControls.Size = new System.Drawing.Size(784, 170); - this.playerControls.TabIndex = 22; - // // flowLayoutPanel1 // this.flowLayoutPanel1.AutoSize = true; this.flowLayoutPanel1.Controls.Add(this.btnSave); this.flowLayoutPanel1.Controls.Add(this.btnCancel); this.flowLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Bottom; - this.flowLayoutPanel1.Location = new System.Drawing.Point(0, 527); + this.flowLayoutPanel1.Location = new System.Drawing.Point(0, 532); this.flowLayoutPanel1.Name = "flowLayoutPanel1"; this.flowLayoutPanel1.RightToLeft = System.Windows.Forms.RightToLeft.Yes; - this.flowLayoutPanel1.Size = new System.Drawing.Size(784, 34); + this.flowLayoutPanel1.Size = new System.Drawing.Size(784, 29); this.flowLayoutPanel1.TabIndex = 23; // // btnSave // - this.btnSave.Location = new System.Drawing.Point(691, 3); + this.btnSave.Location = new System.Drawing.Point(706, 3); this.btnSave.Name = "btnSave"; - this.btnSave.Size = new System.Drawing.Size(90, 28); + this.btnSave.Size = new System.Drawing.Size(75, 23); this.btnSave.TabIndex = 0; this.btnSave.Text = "Save"; this.btnSave.UseVisualStyleBackColor = true; + this.btnSave.Click += new System.EventHandler(this.btnSave_Click); // // btnCancel // - this.btnCancel.Location = new System.Drawing.Point(595, 3); + this.btnCancel.Location = new System.Drawing.Point(625, 3); this.btnCancel.Name = "btnCancel"; - this.btnCancel.Size = new System.Drawing.Size(90, 28); + this.btnCancel.Size = new System.Drawing.Size(75, 23); this.btnCancel.TabIndex = 1; this.btnCancel.Text = "Cancel"; this.btnCancel.UseVisualStyleBackColor = true; + this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click); + // + // playerControls + // + this.playerControls.AutoSize = true; + this.playerControls.BackColor = System.Drawing.Color.Transparent; + this.playerControls.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom; + this.playerControls.Dock = System.Windows.Forms.DockStyle.Bottom; + this.playerControls.Location = new System.Drawing.Point(0, 411); + this.playerControls.Margin = new System.Windows.Forms.Padding(0); + this.playerControls.Name = "playerControls"; + this.playerControls.Size = new System.Drawing.Size(784, 121); + this.playerControls.TabIndex = 22; // // PlayerForm // this.AllowDrop = true; - this.AutoScaleBaseSize = new System.Drawing.Size(6, 16); + this.AutoScaleBaseSize = new System.Drawing.Size(5, 13); this.BackColor = System.Drawing.Color.White; this.ClientSize = new System.Drawing.Size(784, 561); this.Controls.Add(this.mainSplit); this.Controls.Add(this.mainMenu); this.Controls.Add(this.playerControls); this.Controls.Add(this.flowLayoutPanel1); - this.Icon = ((System.Drawing.Icon) (resources.GetObject("$this.Icon"))); + this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); this.KeyPreview = true; - this.MinimumSize = new System.Drawing.Size(768, 591); + this.MinimumSize = new System.Drawing.Size(640, 480); this.Name = "PlayerForm"; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; this.Text = "MediaCube Player"; @@ -562,15 +540,15 @@ namespace DxPlay { this.mainSplit.Panel1.ResumeLayout(false); this.mainSplit.Panel2.ResumeLayout(false); this.mainSplit.Panel2.PerformLayout(); - ((System.ComponentModel.ISupportInitialize) (this.mainSplit)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.mainSplit)).EndInit(); this.mainSplit.ResumeLayout(false); this.panelPlayer.ResumeLayout(false); this.tableLayoutPanel1.ResumeLayout(false); this.tabEditor.ResumeLayout(false); this.tpMetadata.ResumeLayout(false); this.tpSegments.ResumeLayout(false); - ((System.ComponentModel.ISupportInitialize) (this.dgSegments)).EndInit(); - ((System.ComponentModel.ISupportInitialize) (this.bsSegments)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.dgSegments)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.bsSegments)).EndInit(); this.segmentActions.ResumeLayout(false); this.segmentActions.PerformLayout(); this.pMetadataDisplay.ResumeLayout(false); @@ -580,6 +558,7 @@ namespace DxPlay { this.flowLayoutPanel1.ResumeLayout(false); this.ResumeLayout(false); this.PerformLayout(); + } #endregion diff --git a/client/DxPlay/PlayerForm.cs b/client/DxPlay/PlayerForm.cs index b3278a6d..90b6e09e 100644 --- a/client/DxPlay/PlayerForm.cs +++ b/client/DxPlay/PlayerForm.cs @@ -566,5 +566,13 @@ namespace DxPlay { btnApprove.Text = Settings.Resource("REDEFINE", Resources.REDEFINE); } + private void btnSave_Click(object sender, EventArgs e) { + settings.Segments = model.Segments; + Close(); + } + + private void btnCancel_Click(object sender, EventArgs e) { + Close(); + } } } diff --git a/client/DxPlay/PlayerForm.resx b/client/DxPlay/PlayerForm.resx index 91538d64..acfc813c 100644 --- a/client/DxPlay/PlayerForm.resx +++ b/client/DxPlay/PlayerForm.resx @@ -173,7 +173,7 @@ AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0 ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAABo - CAAAAk1TRnQBSQFMAgEBAgEAATgBAgE4AQIBGAEAARgBAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo + CAAAAk1TRnQBSQFMAgEBAgEAAVgBAgFYAQIBGAEAARgBAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo AwABYAMAARgDAAEBAQABCAYAAQkYAAGAAgABgAMAAoABAAGAAwABgAEAAYABAAKAAgADwAEAAcAB3AHA AQAB8AHKAaYBAAEzBQABMwEAATMBAAEzAQACMwIAAxYBAAMcAQADIgEAAykBAANVAQADTQEAA0IBAAM5 AQABgAF8Af8BAAJQAf8BAAGTAQAB1gEAAf8B7AHMAQABxgHWAe8BAAHWAucBAAGQAakBrQIAAf8BMwMA diff --git a/client/Maestro/MaestroForm.Metadata.cs b/client/Maestro/MaestroForm.Metadata.cs index 6d9a7c50..e290c152 100644 --- a/client/Maestro/MaestroForm.Metadata.cs +++ b/client/Maestro/MaestroForm.Metadata.cs @@ -171,8 +171,10 @@ namespace Maestro { readOnly = ArchiveMetadata.ok; } else readOnly = ArchiveMetadata.ok; - if (readOnly && ArchiveMetadata != null && !SelectedMetadata.IsRedefine) - MsgBox.Warning("Az anyag már el van fogadva, a szegmens módosítás nem kerül mentésre. A szegmensek módosításához vissza kell vonni az anyag elfogadását az adástervező rendszerben."); + if (readOnly && !SelectedMetadata.IsRedefine) { + MsgBox.Warning("Az anyag már el van fogadva, a szegmens módosítás nem lehetséges."); + return; + } OpenFile(fileInfo, true, readOnly, !readOnly); UpdateDefineSegmentsStatus(); Cursor.Current = Cursors.Default; diff --git a/server/hu.user.mediacube.executors.tests/src/hu/user/mediacube/executors/tests/SupportCheckItem.java b/server/hu.user.mediacube.executors.tests/src/hu/user/mediacube/executors/tests/SupportCheckItem.java index 53a900d5..08492587 100644 --- a/server/hu.user.mediacube.executors.tests/src/hu/user/mediacube/executors/tests/SupportCheckItem.java +++ b/server/hu.user.mediacube.executors.tests/src/hu/user/mediacube/executors/tests/SupportCheckItem.java @@ -4,7 +4,6 @@ import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; -import java.sql.Timestamp; import org.junit.AfterClass; import org.junit.BeforeClass; @@ -14,7 +13,9 @@ import user.commons.logging.LogUtils; import user.jobengine.db.IItemManager; import user.jobengine.db.IResultSetConsumer; import user.jobengine.db.IStatementDecorator; +import user.jobengine.db.Item; import user.jobengine.db.ItemManager; +import user.jobengine.db.Media; import user.jobengine.server.steps.MetadataTypeDetector; import user.jobengine.server.steps.MetadataTypeDetector.MetadataType; import user.jobengine.server.steps.PlanAirExtensions; @@ -101,6 +102,51 @@ public class SupportCheckItem { manager.disconnect(); } + private void createItem(final Connection[] con, ResultSet rs, int progress) throws Exception { + long itemId = rs.getLong("itemId"); + String itemHouseId = rs.getString("itemHouseId"); + itemHouseId = itemHouseId == null ? "" : itemHouseId; + String itemTitle = rs.getString("itemTitle"); + itemTitle = itemTitle == null ? "" : itemTitle; + String mediaFileHouseId = rs.getString("mediaFileHouseId"); + String mediaType = rs.getString("mediaType"); + long mediaId = rs.getLong("mediaId"); + long mediaFileId = rs.getLong("mediaFileId"); + try { + if (mediaFileHouseId.length() > 7) + mediaFileHouseId = mediaFileHouseId.substring(0, 8); + + PlanAirProcessor p = new PlanAirProcessor(mediaFileHouseId); + if (p.getType() == MetadataType.TrafficMaterial) { + con[0] = p.process(con[0]); + String itemHouseId2 = p.getItemHouseId() == null ? "" : p.getItemHouseId(); + String itemTitle2 = p.getItemTitle() == null ? "" : p.getItemTitle(); + if (!itemHouseId2.equals(itemHouseId) || !itemTitle2.equals(itemTitle)) { + Item item = manager.getItem(itemId); + System.out.println(itemId + " : wrong | " + rs.getString("mediaFileHouseId") + ", " + itemHouseId + ", " + itemTitle + ", " + mediaType); + System.out.println("\t good | " + itemHouseId2 + ", " + itemTitle2 + ", " + progress + "%"); + item.setId(0); + item.setTitle(itemTitle2); + item.setHouseId(itemHouseId2); + manager.add(item); + + Media media = manager.getMedia(mediaId); + media.setItemId(item.getId()); + manager.modify(media); + //item.setMedias(null); + + updateMediaDescription(itemId, mediaId, mediaFileId); + + //delete from MEDIADESCRIPTION where MEDIAID=364228; + + } + + } + } catch (Exception e) { + e.printStackTrace(); + } + } + @Test public void process() throws SQLException { final Connection[] con = { null }; @@ -108,7 +154,7 @@ public class SupportCheckItem { final int[] processed = { 0 }; String sqlb = "select %s from vw_items where (mediatype = 'ECHO műsor' or mediatype = 'Műsor')"; // and mediaFileHouseId like '%%M109138A%%' String sqlc = String.format(sqlb, "count(*)"); - String sql = String.format(sqlb + " order by mediacreated desc", "itemid, itemhouseid, itemtitle, mediaid, mediafilehouseid, mediacreated"); + String sql = String.format(sqlb + " order by mediacreated desc", "itemid, itemhouseid, itemtitle, mediaid, mediafilehouseid, mediafileid, mediatype"); manager.executeQuery(sqlc, rs -> { count[0] = rs.getInt(1); @@ -116,33 +162,14 @@ public class SupportCheckItem { }, null); manager.executeQuery(sql, rs -> { processed[0]++; - long itemId = rs.getLong("itemId"); - String itemHouseId = rs.getString("itemHouseId"); - itemHouseId = itemHouseId == null ? "" : itemHouseId; - String itemTitle = rs.getString("itemTitle"); - itemTitle = itemTitle == null ? "" : itemTitle; - String mediaFileHouseId = rs.getString("mediaFileHouseId"); - Timestamp mediaCreated = rs.getTimestamp("mediaCreated"); - try { - if (mediaFileHouseId.length() > 7) - mediaFileHouseId = mediaFileHouseId.substring(0, 8); - - PlanAirProcessor p = new PlanAirProcessor(mediaFileHouseId); - if (p.getType() == MetadataType.TrafficMaterial) { - con[0] = p.process(con[0]); - String itemHouseId2 = p.getItemHouseId() == null ? "" : p.getItemHouseId(); - String itemTitle2 = p.getItemTitle() == null ? "" : p.getItemTitle(); - if (!itemHouseId2.equals(itemHouseId) || !itemTitle2.equals(itemTitle)) { + int progress = (processed[0] * 100) / count[0]; - System.out.println("Item " + itemId + " : wrong | " + mediaCreated + ", " + mediaFileHouseId + ", " + itemHouseId + ", " + itemTitle); - System.out.println("\t good | " + itemHouseId2 + ", " + itemTitle2 + ", " + (processed[0] * 100) / count[0] + "%"); - - } - - } + try { + createItem(con, rs, progress); } catch (Exception e) { - e.printStackTrace(); + return false; } + processed[0]++; return true; }, null); @@ -151,4 +178,13 @@ public class SupportCheckItem { con[0].close(); } + private void updateMediaDescription(long itemId, long mediaId, long mediaFileId) { + // TODO Auto-generated method stub + manager.executeUpdate(String.format("delete from MEDIADESCRIPTION where ITEMID=%d and MEDIAID=%d", itemId, mediaId), null); + String sql = String.format("insert into mediadescription (itemid, mediaid, mediafileid, description) " + + "select itemid, mediaid, mediafileid, fulldesc(itemid, mediaid, mediafileid) from vw_items " + "where mediafileid=%d", mediaFileId); + manager.executeUpdate(sql, null); + + } + } diff --git a/server/user.jobengine.executors/src/user/jobengine/server/steps/MetadataTransformStep.java b/server/user.jobengine.executors/src/user/jobengine/server/steps/MetadataTransformStep.java index 9d33d622..16492856 100644 --- a/server/user.jobengine.executors/src/user/jobengine/server/steps/MetadataTransformStep.java +++ b/server/user.jobengine.executors/src/user/jobengine/server/steps/MetadataTransformStep.java @@ -66,7 +66,7 @@ public class MetadataTransformStep extends JobStep { } private Item createItem(ArchiveItem archiveItem) { - Item mediaCubeItem = itemManager.getItemByHouseID(archiveItem.getItemHouseId(), archiveItem.getItemTitle()); + Item mediaCubeItem = getExistingItem(archiveItem.getItemHouseId(), archiveItem.getItemTitle()); if (mediaCubeItem == null) mediaCubeItem = itemManager.createItem(DEFAULT_MEDIATYPE, archiveItem.getItemTitle(), archiveItem.getItemDescription(), archiveItem.getItemHouseId()); @@ -123,4 +123,15 @@ public class MetadataTransformStep extends JobStep { return mediaType; } + private Item getExistingItem(String itemHouseId, String itemTitle) { + Item[] result = { null }; + String sql = String.format("select id from item where houseid='%s' and title='%s'", itemHouseId, itemTitle); + itemManager.executeQuery(sql, rs -> { + long id = rs.getLong("id"); + result[0] = itemManager.getItem(id); + return true; + }, null); + return result[0]; + } + } diff --git a/server/user.jobengine.osgi.db/src/user/jobengine/db/IItemManager.java b/server/user.jobengine.osgi.db/src/user/jobengine/db/IItemManager.java index fd61c327..c012a7bc 100644 --- a/server/user.jobengine.osgi.db/src/user/jobengine/db/IItemManager.java +++ b/server/user.jobengine.osgi.db/src/user/jobengine/db/IItemManager.java @@ -25,9 +25,8 @@ import user.jobengine.db.ItemManagerData.UserRight; import user.jobengine.search.SearchResult; /*** - * Adatbázis kezelő API. Az implementáció OSGI szolgáltatásként érhető el ezen - * az interfészen keresztül. Az API főbb szolgáltatásai: az adatmodell - * objektumainak létrehozása, módosítása, törlése az adatbázisban. + * Adatbázis kezelő API. Az implementáció OSGI szolgáltatásként érhető el ezen az interfészen keresztül. Az API főbb szolgáltatásai: az adatmodell objektumainak + * létrehozása, módosítása, törlése az adatbázisban. * * @author comtrans * @@ -105,9 +104,12 @@ public interface IItemManager extends IEntityPersister { void executeQuery(String query, IResultSetConsumer consumer, IStatementDecorator decorator); + int executeUpdate(Connection connection, String query, IStatementDecorator decorator); + + void executeUpdate(String query, IStatementDecorator decorator); + /** - * A type paraméterből lekéri az entitás DAO objektumát, amin keresztül - * visszakapjuk az összes entitást. + * A type paraméterből lekéri az entitás DAO objektumát, amin keresztül visszakapjuk az összes entitást. * * @param type * @return @@ -131,6 +133,8 @@ public interface IItemManager extends IEntityPersister { */ List getAllCached(Class baseClass); + // long getExistingRundownMedia(String houseid); + /** * Visszaadja az entitásnak megfelelő DAO objektumot. * @@ -143,8 +147,6 @@ public interface IItemManager extends IEntityPersister { DefaultContext getDbContext(); - // long getExistingRundownMedia(String houseid); - /** * Elkéri az összes dinamikus anyag típust. * @@ -153,8 +155,7 @@ public interface IItemManager extends IEntityPersister { List getDynamicItemTypes(); /** - * Elkéri a FileTypeDAO-tól a bemeneti paraméterként kapott névvel - * rendelekző FileType-ot. + * Elkéri a FileTypeDAO-tól a bemeneti paraméterként kapott névvel rendelekző FileType-ot. * * @param name * @return @@ -189,8 +190,7 @@ public interface IItemManager extends IEntityPersister { List getFilteredScene(String name, boolean isChunked); /** - * A bemenő paraméterként kapott azonosító alaján lekéri a megfelelő Mappa - * objektumokat. + * A bemenő paraméterként kapott azonosító alaján lekéri a megfelelő Mappa objektumokat. * * @param id * @return @@ -271,8 +271,7 @@ public interface IItemManager extends IEntityPersister { Shot getShot(long id); /** - * A bemenő paraméterként kapott azonosító alaján lekéri a megfelelő Szkript - * objektumokat. + * A bemenő paraméterként kapott azonosító alaján lekéri a megfelelő Szkript objektumokat. * * @param id * @return @@ -303,9 +302,7 @@ public interface IItemManager extends IEntityPersister { Store getStore(String name); /** - * Elkér a StoreDAO-tól, egy olyan Rendszer tárolót, amely a lowres - * paraméterben kapott érték alapján vagy kisfelbontású videók tárolója, - * vagy nem. + * Elkér a StoreDAO-tól, egy olyan Rendszer tárolót, amely a lowres paraméterben kapott érték alapján vagy kisfelbontású videók tárolója, vagy nem. * * @param lowres * @return @@ -313,8 +310,7 @@ public interface IItemManager extends IEntityPersister { Store getSystemStore(boolean lowres); /** - * Ha a bemeneti paraméter alapján létezik ilyen felhasználó, akkor true-val - * tér vissza. + * Ha a bemeneti paraméter alapján létezik ilyen felhasználó, akkor true-val tér vissza. * * @param userName * @param password @@ -323,8 +319,7 @@ public interface IItemManager extends IEntityPersister { boolean getUser(String userName, String password); /** - * A bemeneti paraméterként megadott felhasználónév/jelszó páros alapján - * visszaad egy UserInfo objektumot. + * A bemeneti paraméterként megadott felhasználónév/jelszó páros alapján visszaad egy UserInfo objektumot. * * @param userName * @param password @@ -343,8 +338,7 @@ public interface IItemManager extends IEntityPersister { void putDbContext(DefaultContext context); /** - * A bemeneti paraméterként kapott típus és azonosító lista alapján - * eltávolítja a megfelelő adatbázis bejegyzéseket. + * A bemeneti paraméterként kapott típus és azonosító lista alapján eltávolítja a megfelelő adatbázis bejegyzéseket. * * @param type * @param ids @@ -352,8 +346,7 @@ public interface IItemManager extends IEntityPersister { void remove(Class type, List ids); /** - * A bemeneti paraméterként kapott típus és azonosító alapján az objektumot - * eltávolítja az átmeneti tárolóból. + * A bemeneti paraméterként kapott típus és azonosító alapján az objektumot eltávolítja az átmeneti tárolóból. * * @param baseClass * @param key @@ -361,8 +354,7 @@ public interface IItemManager extends IEntityPersister { void removeCached(Class baseClass, Object key); /** - * A bemeneti paraméterként kapott típus és kulcs alapján elkéri a megfelelő - * objektumot az átmeneti tárolóból. + * A bemeneti paraméterként kapott típus és kulcs alapján elkéri a megfelelő objektumot az átmeneti tárolóból. * * @param baseClass * @param key @@ -373,9 +365,7 @@ public interface IItemManager extends IEntityPersister { SearchResult search(String criteria, List searchFilters, String orderBy, boolean orderAscending, int fromResult, int toResult); /** - * A bemeneti paraméterként kapott keresési feltételeknek megfelelő - * Anyagokat lekéri az adatbázisból és SearchResult objektumba csomagolva - * visszatér. + * A bemeneti paraméterként kapott keresési feltételeknek megfelelő Anyagokat lekéri az adatbázisból és SearchResult objektumba csomagolva visszatér. * * @param parameter * @return @@ -385,8 +375,7 @@ public interface IItemManager extends IEntityPersister { SearchResult searchItem(String criteria, int fromResult, int toResult); /** - * A bemeneti paraméterként kapott keresési feltételeknek megfelelő - * Munkafolyamatokat lekéri az adaatbázisból. + * A bemeneti paraméterként kapott keresési feltételeknek megfelelő Munkafolyamatokat lekéri az adaatbázisból. * * @param parameter * @return @@ -394,8 +383,7 @@ public interface IItemManager extends IEntityPersister { List searchJob(QueryObject parameter); /** - * A kapott három paraméter alapján létrehoz egy Signal objektumot, - * átkonvertálja bájt tömbbé és beteszi a Signalserver üzenetküldő sorába. + * A kapott három paraméter alapján létrehoz egy Signal objektumot, átkonvertálja bájt tömbbé és beteszi a Signalserver üzenetküldő sorába. * * @param id * @param signalType @@ -413,22 +401,19 @@ public interface IItemManager extends IEntityPersister { boolean storeCached(Object key, IEntityBase entity); /** - * Kivétel dobása esetén a kivétel üzenetét és a keletkezés helyét - * becsomagolja egy string-be, majd átadja a logger-nek. + * Kivétel dobása esetén a kivétel üzenetét és a keletkezés helyét becsomagolja egy string-be, majd átadja a logger-nek. * * @param e */ void throwError(Exception e); /** - * Kiloggolja az kapott művelethez tartozó objektum típusát és a metódus - * nevét. + * Kiloggolja az kapott művelethez tartozó objektum típusát és a metódus nevét. */ void traceIn(); /** - * Kiloggolja az kapott művelet végén az objektum típusát és a metódus - * nevét. + * Kiloggolja az kapott művelet végén az objektum típusát és a metódus nevét. */ void traceOut(); diff --git a/server/user.jobengine.osgi.db/src/user/jobengine/db/ItemManager.java b/server/user.jobengine.osgi.db/src/user/jobengine/db/ItemManager.java index 1f80e07d..425f32d4 100644 --- a/server/user.jobengine.osgi.db/src/user/jobengine/db/ItemManager.java +++ b/server/user.jobengine.osgi.db/src/user/jobengine/db/ItemManager.java @@ -495,6 +495,44 @@ public class ItemManager extends MemoryCache implements IItemManager { } } + @Override + public int executeUpdate(Connection connection, String query, IStatementDecorator decorator) { + int result = -1; + PreparedStatement st = null; + try { + st = connection.prepareStatement(query); + if (decorator != null) + decorator.decorate(st); + result = st.executeUpdate(); + connection.commit(); + } catch (Exception e) { + logger.catching(e); + try { + connection.rollback(); + } catch (Exception e1) { + } + } finally { + try { + if (st != null) + st.close(); + } catch (Exception e1) { + } + } + return result; + } + + @Override + public void executeUpdate(String query, IStatementDecorator decorator) { + DefaultContext context = getDbContext(); + Connection connection = context.getConnection(); + try { + executeUpdate(connection, query, decorator); + } catch (Exception e) { + } finally { + putDbContext(context); + } + } + @Override public IEntityBase get(Class classInfo, long id) { traceIn(); -- 2.54.0