this.backgroundWorker1 = new System.ComponentModel.BackgroundWorker();\r
this.label_stuffID = new System.Windows.Forms.Label();\r
this.label_stuffDescription = new System.Windows.Forms.Label();\r
- this.label_mediaID = new System.Windows.Forms.Label();\r
this.label_mediaTitle = new System.Windows.Forms.Label();\r
- this.label_mediaDescription = new System.Windows.Forms.Label();\r
this.txtItemID = new System.Windows.Forms.TextBox();\r
this.txtItemTitle = new System.Windows.Forms.TextBox();\r
this.txtItemDescription = new System.Windows.Forms.TextBox();\r
this.groupBox1 = new System.Windows.Forms.GroupBox();\r
this.btnOk = new System.Windows.Forms.Button();\r
this.btnCancel = new System.Windows.Forms.Button();\r
- this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();\r
- this.tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel();\r
+ this.btnMxfMetadata = new System.Windows.Forms.Button();\r
this.btnImportOctopus = new System.Windows.Forms.Button();\r
this.cbFolders = new System.Windows.Forms.ComboBox();\r
this.dtScheduled = new System.Windows.Forms.DateTimePicker();\r
- this.btnMxfMetadata = new System.Windows.Forms.Button();\r
+ this.comboTags = new System.Windows.Forms.ComboBox();\r
+ this.tcMediaDesc = new System.Windows.Forms.TabControl();\r
+ this.tabMediaDesc = new System.Windows.Forms.TabPage();\r
+ this.tabMediaImport = new System.Windows.Forms.TabPage();\r
+ this.groupBox3 = new System.Windows.Forms.GroupBox();\r
+ this.groupBox2 = new System.Windows.Forms.GroupBox();\r
+ this.label_mediaID = new System.Windows.Forms.Label();\r
+ this.label1 = new System.Windows.Forms.Label();\r
+ this.textTags = new System.Windows.Forms.TextBox();\r
+ this.btnAddTag = new System.Windows.Forms.Button();\r
this.groupBox1.SuspendLayout();\r
- this.tableLayoutPanel1.SuspendLayout();\r
- this.tableLayoutPanel2.SuspendLayout();\r
+ this.tcMediaDesc.SuspendLayout();\r
+ this.tabMediaDesc.SuspendLayout();\r
+ this.tabMediaImport.SuspendLayout();\r
+ this.groupBox3.SuspendLayout();\r
+ this.groupBox2.SuspendLayout();\r
this.SuspendLayout();\r
// \r
// label_stuffID\r
// \r
- this.label_stuffID.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));\r
this.label_stuffID.AutoSize = true;\r
- this.label_stuffID.Location = new System.Drawing.Point(11, 6);\r
+ this.label_stuffID.Location = new System.Drawing.Point(6, 6);\r
this.label_stuffID.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);\r
this.label_stuffID.Name = "label_stuffID";\r
this.label_stuffID.Size = new System.Drawing.Size(113, 17);\r
// \r
// label_stuffDescription\r
// \r
- this.label_stuffDescription.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));\r
this.label_stuffDescription.AutoSize = true;\r
- this.label_stuffDescription.Location = new System.Drawing.Point(11, 102);\r
+ this.label_stuffDescription.Location = new System.Drawing.Point(33, 68);\r
this.label_stuffDescription.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);\r
this.label_stuffDescription.Name = "label_stuffDescription";\r
this.label_stuffDescription.Size = new System.Drawing.Size(86, 17);\r
this.label_stuffDescription.TabIndex = 2;\r
this.label_stuffDescription.Text = "Anyag leírás";\r
// \r
- // label_mediaID\r
- // \r
- this.label_mediaID.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));\r
- this.label_mediaID.AutoSize = true;\r
- this.label_mediaID.Location = new System.Drawing.Point(11, 192);\r
- this.label_mediaID.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);\r
- this.label_mediaID.Name = "label_mediaID";\r
- this.label_mediaID.Size = new System.Drawing.Size(111, 17);\r
- this.label_mediaID.TabIndex = 3;\r
- this.label_mediaID.Text = "Média azonosító";\r
- // \r
// label_mediaTitle\r
// \r
- this.label_mediaTitle.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));\r
this.label_mediaTitle.AutoSize = true;\r
this.label_mediaTitle.Font = new System.Drawing.Font("Microsoft Sans Serif", 10F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(238)));\r
- this.label_mediaTitle.Location = new System.Drawing.Point(11, 240);\r
+ this.label_mediaTitle.Location = new System.Drawing.Point(39, 174);\r
this.label_mediaTitle.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);\r
this.label_mediaTitle.Name = "label_mediaTitle";\r
this.label_mediaTitle.Size = new System.Drawing.Size(80, 17);\r
this.label_mediaTitle.TabIndex = 4;\r
this.label_mediaTitle.Text = "Média cím";\r
// \r
- // label_mediaDescription\r
- // \r
- this.label_mediaDescription.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));\r
- this.label_mediaDescription.AutoSize = true;\r
- this.label_mediaDescription.Location = new System.Drawing.Point(11, 288);\r
- this.label_mediaDescription.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);\r
- this.label_mediaDescription.Name = "label_mediaDescription";\r
- this.label_mediaDescription.Size = new System.Drawing.Size(84, 17);\r
- this.label_mediaDescription.TabIndex = 5;\r
- this.label_mediaDescription.Text = "Média leírás";\r
- // \r
// txtItemID\r
// \r
- this.txtItemID.Dock = System.Windows.Forms.DockStyle.Fill;\r
- this.txtItemID.Location = new System.Drawing.Point(11, 27);\r
+ this.txtItemID.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) \r
+ | System.Windows.Forms.AnchorStyles.Right)));\r
+ this.txtItemID.Location = new System.Drawing.Point(127, 3);\r
this.txtItemID.Margin = new System.Windows.Forms.Padding(4);\r
this.txtItemID.Name = "txtItemID";\r
this.txtItemID.ReadOnly = true;\r
- this.txtItemID.Size = new System.Drawing.Size(749, 23);\r
+ this.txtItemID.Size = new System.Drawing.Size(750, 23);\r
this.txtItemID.TabIndex = 6;\r
this.txtItemID.TabStop = false;\r
// \r
// txtItemTitle\r
// \r
- this.txtItemTitle.Dock = System.Windows.Forms.DockStyle.Fill;\r
- this.txtItemTitle.Location = new System.Drawing.Point(11, 75);\r
+ this.txtItemTitle.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) \r
+ | System.Windows.Forms.AnchorStyles.Right)));\r
+ this.txtItemTitle.Location = new System.Drawing.Point(127, 34);\r
this.txtItemTitle.Margin = new System.Windows.Forms.Padding(4);\r
this.txtItemTitle.Name = "txtItemTitle";\r
- this.txtItemTitle.Size = new System.Drawing.Size(749, 23);\r
+ this.txtItemTitle.Size = new System.Drawing.Size(750, 23);\r
this.txtItemTitle.TabIndex = 1;\r
// \r
// txtItemDescription\r
// \r
- this.txtItemDescription.Dock = System.Windows.Forms.DockStyle.Fill;\r
- this.txtItemDescription.Location = new System.Drawing.Point(11, 123);\r
+ this.txtItemDescription.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) \r
+ | System.Windows.Forms.AnchorStyles.Right)));\r
+ this.txtItemDescription.Location = new System.Drawing.Point(127, 65);\r
this.txtItemDescription.Margin = new System.Windows.Forms.Padding(4);\r
this.txtItemDescription.Multiline = true;\r
this.txtItemDescription.Name = "txtItemDescription";\r
this.txtItemDescription.ScrollBars = System.Windows.Forms.ScrollBars.Both;\r
- this.txtItemDescription.Size = new System.Drawing.Size(749, 65);\r
+ this.txtItemDescription.Size = new System.Drawing.Size(750, 65);\r
this.txtItemDescription.TabIndex = 2;\r
// \r
// textBox_mediaID\r
// \r
- this.textBox_mediaID.Dock = System.Windows.Forms.DockStyle.Fill;\r
- this.textBox_mediaID.Location = new System.Drawing.Point(11, 213);\r
+ this.textBox_mediaID.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) \r
+ | System.Windows.Forms.AnchorStyles.Right)));\r
+ this.textBox_mediaID.Location = new System.Drawing.Point(127, 138);\r
this.textBox_mediaID.Margin = new System.Windows.Forms.Padding(4);\r
this.textBox_mediaID.Name = "textBox_mediaID";\r
this.textBox_mediaID.ReadOnly = true;\r
- this.textBox_mediaID.Size = new System.Drawing.Size(749, 23);\r
+ this.textBox_mediaID.Size = new System.Drawing.Size(750, 23);\r
this.textBox_mediaID.TabIndex = 9;\r
this.textBox_mediaID.TabStop = false;\r
// \r
// txtMediaTitle\r
// \r
- this.txtMediaTitle.Dock = System.Windows.Forms.DockStyle.Fill;\r
- this.txtMediaTitle.Location = new System.Drawing.Point(11, 261);\r
+ this.txtMediaTitle.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) \r
+ | System.Windows.Forms.AnchorStyles.Right)));\r
+ this.txtMediaTitle.Location = new System.Drawing.Point(127, 171);\r
this.txtMediaTitle.Margin = new System.Windows.Forms.Padding(4);\r
this.txtMediaTitle.Name = "txtMediaTitle";\r
- this.txtMediaTitle.Size = new System.Drawing.Size(749, 23);\r
+ this.txtMediaTitle.Size = new System.Drawing.Size(750, 23);\r
this.txtMediaTitle.TabIndex = 3;\r
// \r
// txtMediaDescription\r
// \r
this.txtMediaDescription.Dock = System.Windows.Forms.DockStyle.Fill;\r
- this.txtMediaDescription.Location = new System.Drawing.Point(11, 351);\r
+ this.txtMediaDescription.Location = new System.Drawing.Point(3, 3);\r
this.txtMediaDescription.Margin = new System.Windows.Forms.Padding(4);\r
this.txtMediaDescription.Multiline = true;\r
this.txtMediaDescription.Name = "txtMediaDescription";\r
this.txtMediaDescription.ScrollBars = System.Windows.Forms.ScrollBars.Both;\r
- this.txtMediaDescription.Size = new System.Drawing.Size(749, 186);\r
+ this.txtMediaDescription.Size = new System.Drawing.Size(851, 202);\r
this.txtMediaDescription.TabIndex = 4;\r
// \r
// label_stuffTitle\r
// \r
- this.label_stuffTitle.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));\r
this.label_stuffTitle.AutoSize = true;\r
this.label_stuffTitle.Font = new System.Drawing.Font("Microsoft Sans Serif", 10F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(238)));\r
- this.label_stuffTitle.Location = new System.Drawing.Point(11, 54);\r
+ this.label_stuffTitle.Location = new System.Drawing.Point(37, 37);\r
this.label_stuffTitle.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);\r
this.label_stuffTitle.Name = "label_stuffTitle";\r
this.label_stuffTitle.Size = new System.Drawing.Size(82, 17);\r
// \r
// groupBox1\r
// \r
- this.groupBox1.Controls.Add(this.btnMxfMetadata);\r
this.groupBox1.Controls.Add(this.btnOk);\r
this.groupBox1.Controls.Add(this.btnCancel);\r
this.groupBox1.Dock = System.Windows.Forms.DockStyle.Bottom;\r
- this.groupBox1.Location = new System.Drawing.Point(0, 547);\r
+ this.groupBox1.Location = new System.Drawing.Point(0, 498);\r
this.groupBox1.Margin = new System.Windows.Forms.Padding(4);\r
this.groupBox1.Name = "groupBox1";\r
this.groupBox1.Padding = new System.Windows.Forms.Padding(4);\r
- this.groupBox1.Size = new System.Drawing.Size(771, 51);\r
+ this.groupBox1.Size = new System.Drawing.Size(889, 51);\r
this.groupBox1.TabIndex = 1;\r
this.groupBox1.TabStop = false;\r
// \r
// btnOk\r
// \r
this.btnOk.Anchor = System.Windows.Forms.AnchorStyles.Right;\r
- this.btnOk.Location = new System.Drawing.Point(663, 16);\r
+ this.btnOk.Location = new System.Drawing.Point(781, 16);\r
this.btnOk.Margin = new System.Windows.Forms.Padding(4);\r
this.btnOk.Name = "btnOk";\r
this.btnOk.Size = new System.Drawing.Size(100, 28);\r
// \r
this.btnCancel.Anchor = System.Windows.Forms.AnchorStyles.Right;\r
this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;\r
- this.btnCancel.Location = new System.Drawing.Point(557, 16);\r
+ this.btnCancel.Location = new System.Drawing.Point(675, 16);\r
this.btnCancel.Margin = new System.Windows.Forms.Padding(4);\r
this.btnCancel.Name = "btnCancel";\r
this.btnCancel.Size = new System.Drawing.Size(100, 28);\r
this.btnCancel.UseVisualStyleBackColor = true;\r
this.btnCancel.Click += new System.EventHandler(this.OnCancelClick);\r
// \r
- // tableLayoutPanel1\r
- // \r
- this.tableLayoutPanel1.ColumnCount = 1;\r
- this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));\r
- this.tableLayoutPanel1.Controls.Add(this.txtMediaDescription, 0, 12);\r
- this.tableLayoutPanel1.Controls.Add(this.txtMediaTitle, 0, 9);\r
- this.tableLayoutPanel1.Controls.Add(this.label_mediaTitle, 0, 8);\r
- this.tableLayoutPanel1.Controls.Add(this.textBox_mediaID, 0, 7);\r
- this.tableLayoutPanel1.Controls.Add(this.label_mediaID, 0, 6);\r
- this.tableLayoutPanel1.Controls.Add(this.txtItemDescription, 0, 5);\r
- this.tableLayoutPanel1.Controls.Add(this.txtItemTitle, 0, 3);\r
- this.tableLayoutPanel1.Controls.Add(this.txtItemID, 0, 1);\r
- this.tableLayoutPanel1.Controls.Add(this.label_stuffID, 0, 0);\r
- this.tableLayoutPanel1.Controls.Add(this.label_mediaDescription, 0, 10);\r
- this.tableLayoutPanel1.Controls.Add(this.label_stuffDescription, 0, 4);\r
- this.tableLayoutPanel1.Controls.Add(this.label_stuffTitle, 0, 2);\r
- this.tableLayoutPanel1.Controls.Add(this.tableLayoutPanel2, 0, 11);\r
- this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;\r
- this.tableLayoutPanel1.Location = new System.Drawing.Point(0, 0);\r
- this.tableLayoutPanel1.Margin = new System.Windows.Forms.Padding(4);\r
- this.tableLayoutPanel1.Name = "tableLayoutPanel1";\r
- this.tableLayoutPanel1.Padding = new System.Windows.Forms.Padding(7, 6, 7, 6);\r
- this.tableLayoutPanel1.RowCount = 13;\r
- this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());\r
- this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());\r
- this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());\r
- this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());\r
- this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());\r
- this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());\r
- this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());\r
- this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());\r
- this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());\r
- this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());\r
- this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());\r
- this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());\r
- this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());\r
- this.tableLayoutPanel1.Size = new System.Drawing.Size(771, 547);\r
- this.tableLayoutPanel1.TabIndex = 3;\r
- // \r
- // tableLayoutPanel2\r
- // \r
- this.tableLayoutPanel2.AutoSize = true;\r
- this.tableLayoutPanel2.ColumnCount = 3;\r
- this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());\r
- this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));\r
- this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());\r
- this.tableLayoutPanel2.Controls.Add(this.btnImportOctopus, 2, 0);\r
- this.tableLayoutPanel2.Controls.Add(this.cbFolders, 1, 0);\r
- this.tableLayoutPanel2.Controls.Add(this.dtScheduled, 0, 0);\r
- this.tableLayoutPanel2.Dock = System.Windows.Forms.DockStyle.Fill;\r
- this.tableLayoutPanel2.Location = new System.Drawing.Point(10, 308);\r
- this.tableLayoutPanel2.Name = "tableLayoutPanel2";\r
- this.tableLayoutPanel2.RowCount = 1;\r
- this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));\r
- this.tableLayoutPanel2.Size = new System.Drawing.Size(751, 36);\r
- this.tableLayoutPanel2.TabIndex = 10;\r
+ // btnMxfMetadata\r
+ // \r
+ this.btnMxfMetadata.Anchor = System.Windows.Forms.AnchorStyles.Left;\r
+ this.btnMxfMetadata.Location = new System.Drawing.Point(25, 20);\r
+ this.btnMxfMetadata.Margin = new System.Windows.Forms.Padding(4);\r
+ this.btnMxfMetadata.Name = "btnMxfMetadata";\r
+ this.btnMxfMetadata.Size = new System.Drawing.Size(100, 26);\r
+ this.btnMxfMetadata.TabIndex = 7;\r
+ this.btnMxfMetadata.Text = "Import";\r
+ this.btnMxfMetadata.UseVisualStyleBackColor = true;\r
+ this.btnMxfMetadata.Click += new System.EventHandler(this.OnImportMxfMetadataClick);\r
// \r
// btnImportOctopus\r
// \r
- this.btnImportOctopus.Anchor = System.Windows.Forms.AnchorStyles.None;\r
- this.btnImportOctopus.Location = new System.Drawing.Point(647, 4);\r
+ this.btnImportOctopus.Location = new System.Drawing.Point(341, 20);\r
this.btnImportOctopus.Margin = new System.Windows.Forms.Padding(4);\r
this.btnImportOctopus.Name = "btnImportOctopus";\r
- this.btnImportOctopus.Size = new System.Drawing.Size(100, 28);\r
+ this.btnImportOctopus.Size = new System.Drawing.Size(100, 26);\r
this.btnImportOctopus.TabIndex = 9;\r
this.btnImportOctopus.Text = "Import";\r
this.btnImportOctopus.UseVisualStyleBackColor = true;\r
// \r
// cbFolders\r
// \r
- this.cbFolders.Dock = System.Windows.Forms.DockStyle.Fill;\r
this.cbFolders.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;\r
this.cbFolders.Font = new System.Drawing.Font("Microsoft Sans Serif", 10F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));\r
this.cbFolders.FormattingEnabled = true;\r
- this.cbFolders.Location = new System.Drawing.Point(99, 6);\r
+ this.cbFolders.Location = new System.Drawing.Point(102, 22);\r
this.cbFolders.Margin = new System.Windows.Forms.Padding(4, 6, 4, 4);\r
this.cbFolders.Name = "cbFolders";\r
- this.cbFolders.Size = new System.Drawing.Size(540, 24);\r
+ this.cbFolders.Size = new System.Drawing.Size(231, 24);\r
this.cbFolders.TabIndex = 8;\r
// \r
// dtScheduled\r
// \r
- this.dtScheduled.Anchor = System.Windows.Forms.AnchorStyles.None;\r
this.dtScheduled.CustomFormat = " ";\r
this.dtScheduled.Font = new System.Drawing.Font("Microsoft Sans Serif", 10F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));\r
this.dtScheduled.Format = System.Windows.Forms.DateTimePickerFormat.Short;\r
- this.dtScheduled.Location = new System.Drawing.Point(4, 6);\r
+ this.dtScheduled.Location = new System.Drawing.Point(7, 23);\r
this.dtScheduled.Margin = new System.Windows.Forms.Padding(4);\r
this.dtScheduled.Name = "dtScheduled";\r
this.dtScheduled.Size = new System.Drawing.Size(87, 23);\r
this.dtScheduled.TabIndex = 7;\r
this.dtScheduled.ValueChanged += new System.EventHandler(this.OnDateChanged);\r
// \r
- // btnMxfMetadata\r
+ // comboTags\r
+ // \r
+ this.comboTags.FormattingEnabled = true;\r
+ this.comboTags.Location = new System.Drawing.Point(127, 203);\r
+ this.comboTags.Name = "comboTags";\r
+ this.comboTags.Size = new System.Drawing.Size(318, 24);\r
+ this.comboTags.TabIndex = 11;\r
+ // \r
+ // tcMediaDesc\r
+ // \r
+ this.tcMediaDesc.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) \r
+ | System.Windows.Forms.AnchorStyles.Left) \r
+ | System.Windows.Forms.AnchorStyles.Right)));\r
+ this.tcMediaDesc.Controls.Add(this.tabMediaDesc);\r
+ this.tcMediaDesc.Controls.Add(this.tabMediaImport);\r
+ this.tcMediaDesc.Location = new System.Drawing.Point(12, 270);\r
+ this.tcMediaDesc.Name = "tcMediaDesc";\r
+ this.tcMediaDesc.SelectedIndex = 0;\r
+ this.tcMediaDesc.Size = new System.Drawing.Size(865, 237);\r
+ this.tcMediaDesc.TabIndex = 14;\r
+ // \r
+ // tabMediaDesc\r
+ // \r
+ this.tabMediaDesc.Controls.Add(this.txtMediaDescription);\r
+ this.tabMediaDesc.Location = new System.Drawing.Point(4, 25);\r
+ this.tabMediaDesc.Name = "tabMediaDesc";\r
+ this.tabMediaDesc.Padding = new System.Windows.Forms.Padding(3);\r
+ this.tabMediaDesc.Size = new System.Drawing.Size(857, 208);\r
+ this.tabMediaDesc.TabIndex = 0;\r
+ this.tabMediaDesc.Text = "Média leírás";\r
+ this.tabMediaDesc.UseVisualStyleBackColor = true;\r
+ // \r
+ // tabMediaImport\r
+ // \r
+ this.tabMediaImport.Controls.Add(this.groupBox3);\r
+ this.tabMediaImport.Controls.Add(this.groupBox2);\r
+ this.tabMediaImport.Location = new System.Drawing.Point(4, 25);\r
+ this.tabMediaImport.Name = "tabMediaImport";\r
+ this.tabMediaImport.Padding = new System.Windows.Forms.Padding(3);\r
+ this.tabMediaImport.Size = new System.Drawing.Size(857, 208);\r
+ this.tabMediaImport.TabIndex = 1;\r
+ this.tabMediaImport.Text = "Média leírás beemelése";\r
+ this.tabMediaImport.UseVisualStyleBackColor = true;\r
+ // \r
+ // groupBox3\r
+ // \r
+ this.groupBox3.Controls.Add(this.btnMxfMetadata);\r
+ this.groupBox3.Location = new System.Drawing.Point(6, 6);\r
+ this.groupBox3.Name = "groupBox3";\r
+ this.groupBox3.Size = new System.Drawing.Size(151, 57);\r
+ this.groupBox3.TabIndex = 13;\r
+ this.groupBox3.TabStop = false;\r
+ this.groupBox3.Text = "MXF Metadata";\r
+ // \r
+ // groupBox2\r
+ // \r
+ this.groupBox2.Controls.Add(this.btnImportOctopus);\r
+ this.groupBox2.Controls.Add(this.dtScheduled);\r
+ this.groupBox2.Controls.Add(this.cbFolders);\r
+ this.groupBox2.Location = new System.Drawing.Point(163, 6);\r
+ this.groupBox2.Name = "groupBox2";\r
+ this.groupBox2.Size = new System.Drawing.Size(448, 57);\r
+ this.groupBox2.TabIndex = 12;\r
+ this.groupBox2.TabStop = false;\r
+ this.groupBox2.Text = "Octopus";\r
// \r
- this.btnMxfMetadata.Anchor = System.Windows.Forms.AnchorStyles.Left;\r
- this.btnMxfMetadata.Location = new System.Drawing.Point(8, 15);\r
- this.btnMxfMetadata.Margin = new System.Windows.Forms.Padding(4);\r
- this.btnMxfMetadata.Name = "btnMxfMetadata";\r
- this.btnMxfMetadata.Size = new System.Drawing.Size(126, 28);\r
- this.btnMxfMetadata.TabIndex = 7;\r
- this.btnMxfMetadata.Text = "MXF Metadata";\r
- this.btnMxfMetadata.UseVisualStyleBackColor = true;\r
- this.btnMxfMetadata.Click += new System.EventHandler(this.OnImportMxfMetadataClick);\r
+ // label_mediaID\r
+ // \r
+ this.label_mediaID.AutoSize = true;\r
+ this.label_mediaID.Location = new System.Drawing.Point(8, 141);\r
+ this.label_mediaID.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);\r
+ this.label_mediaID.Name = "label_mediaID";\r
+ this.label_mediaID.Size = new System.Drawing.Size(111, 17);\r
+ this.label_mediaID.TabIndex = 3;\r
+ this.label_mediaID.Text = "Média azonosító";\r
+ // \r
+ // label1\r
+ // \r
+ this.label1.AutoSize = true;\r
+ this.label1.Location = new System.Drawing.Point(66, 206);\r
+ this.label1.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);\r
+ this.label1.Name = "label1";\r
+ this.label1.Size = new System.Drawing.Size(53, 17);\r
+ this.label1.TabIndex = 15;\r
+ this.label1.Text = "Cimkék";\r
+ // \r
+ // textTags\r
+ // \r
+ this.textTags.AcceptsReturn = true;\r
+ this.textTags.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) \r
+ | System.Windows.Forms.AnchorStyles.Right)));\r
+ this.textTags.Location = new System.Drawing.Point(451, 203);\r
+ this.textTags.Multiline = true;\r
+ this.textTags.Name = "textTags";\r
+ this.textTags.ReadOnly = true;\r
+ this.textTags.ScrollBars = System.Windows.Forms.ScrollBars.Both;\r
+ this.textTags.Size = new System.Drawing.Size(426, 86);\r
+ this.textTags.TabIndex = 16;\r
+ this.textTags.WordWrap = false;\r
+ // \r
+ // btnAddTag\r
+ // \r
+ this.btnAddTag.Anchor = System.Windows.Forms.AnchorStyles.Left;\r
+ this.btnAddTag.Location = new System.Drawing.Point(345, 234);\r
+ this.btnAddTag.Margin = new System.Windows.Forms.Padding(4);\r
+ this.btnAddTag.Name = "btnAddTag";\r
+ this.btnAddTag.Size = new System.Drawing.Size(100, 26);\r
+ this.btnAddTag.TabIndex = 17;\r
+ this.btnAddTag.Text = "Listára";\r
+ this.btnAddTag.UseVisualStyleBackColor = true;\r
+ this.btnAddTag.Click += new System.EventHandler(this.btnAddTag_Click);\r
// \r
// ArchiveMetadataForm\r
// \r
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F);\r
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;\r
this.CancelButton = this.btnCancel;\r
- this.ClientSize = new System.Drawing.Size(771, 598);\r
- this.Controls.Add(this.tableLayoutPanel1);\r
+ this.ClientSize = new System.Drawing.Size(889, 549);\r
+ this.Controls.Add(this.btnAddTag);\r
+ this.Controls.Add(this.textTags);\r
+ this.Controls.Add(this.label1);\r
+ this.Controls.Add(this.tcMediaDesc);\r
+ this.Controls.Add(this.comboTags);\r
+ this.Controls.Add(this.txtMediaTitle);\r
this.Controls.Add(this.groupBox1);\r
+ this.Controls.Add(this.label_mediaTitle);\r
+ this.Controls.Add(this.label_stuffID);\r
+ this.Controls.Add(this.textBox_mediaID);\r
+ this.Controls.Add(this.label_stuffTitle);\r
+ this.Controls.Add(this.label_mediaID);\r
+ this.Controls.Add(this.txtItemID);\r
+ this.Controls.Add(this.txtItemDescription);\r
+ this.Controls.Add(this.txtItemTitle);\r
+ this.Controls.Add(this.label_stuffDescription);\r
this.Font = new System.Drawing.Font("Microsoft Sans Serif", 10F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));\r
this.Icon = global::Maestro.Properties.Resources.AppIcon;\r
this.Margin = new System.Windows.Forms.Padding(4);\r
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;\r
this.Text = "Archiv adatok";\r
this.groupBox1.ResumeLayout(false);\r
- this.tableLayoutPanel1.ResumeLayout(false);\r
- this.tableLayoutPanel1.PerformLayout();\r
- this.tableLayoutPanel2.ResumeLayout(false);\r
+ this.tcMediaDesc.ResumeLayout(false);\r
+ this.tabMediaDesc.ResumeLayout(false);\r
+ this.tabMediaDesc.PerformLayout();\r
+ this.tabMediaImport.ResumeLayout(false);\r
+ this.groupBox3.ResumeLayout(false);\r
+ this.groupBox2.ResumeLayout(false);\r
this.ResumeLayout(false);\r
+ this.PerformLayout();\r
\r
}\r
\r
private System.Windows.Forms.Label label_stuffTitle;\r
private System.Windows.Forms.Label label_stuffID;\r
private System.Windows.Forms.Label label_stuffDescription;\r
- private System.Windows.Forms.Label label_mediaID;\r
private System.Windows.Forms.Label label_mediaTitle;\r
- private System.Windows.Forms.Label label_mediaDescription;\r
private System.Windows.Forms.TextBox txtItemID;\r
private System.Windows.Forms.TextBox txtItemTitle;\r
private System.Windows.Forms.TextBox txtItemDescription;\r
private System.Windows.Forms.GroupBox groupBox1;\r
private System.Windows.Forms.Button btnOk;\r
private System.Windows.Forms.Button btnCancel;\r
- private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1;\r
private System.Windows.Forms.ComboBox cbFolders;\r
private System.Windows.Forms.DateTimePicker dtScheduled;\r
private System.Windows.Forms.Button btnImportOctopus;\r
- private System.Windows.Forms.TableLayoutPanel tableLayoutPanel2;\r
private System.Windows.Forms.Button btnMxfMetadata;\r
+ private System.Windows.Forms.ComboBox comboTags;\r
+ private System.Windows.Forms.TabControl tcMediaDesc;\r
+ private System.Windows.Forms.TabPage tabMediaDesc;\r
+ private System.Windows.Forms.TabPage tabMediaImport;\r
+ private System.Windows.Forms.GroupBox groupBox3;\r
+ private System.Windows.Forms.GroupBox groupBox2;\r
+ private System.Windows.Forms.Label label_mediaID;\r
+ private System.Windows.Forms.Label label1;\r
+ private System.Windows.Forms.TextBox textTags;\r
+ private System.Windows.Forms.Button btnAddTag;\r
}\r
}
\ No newline at end of file
using Myriadbits.MXF;\r
using System.Xml.Linq;\r
using System.Diagnostics;\r
+using MediaCubeClient;\r
+using Maestro.Commons;\r
\r
namespace Maestro {\r
public partial class ArchiveMetadataForm : Form {\r
\r
private ArchiveMetadata model;\r
private readonly SourceInfo selectedSource;\r
- private OctopusAPI client;\r
+ private OctopusAPI octopusAPI;\r
+\r
+ public ArchiveMetadataForm(ref ArchiveMetadata model, OctopusAPI octopusAPI, MediaCubeApi mediaCubeApi, IMessageBus errorMessageBus, SourceInfo selectedSource) : this() {\r
\r
- public ArchiveMetadataForm(ref ArchiveMetadata model, OctopusMetadata metadata, IMessageBus errorMessageBus, SourceInfo selectedSource) : this() {\r
this.model = model;\r
+ this.octopusAPI = octopusAPI;\r
this.selectedSource = selectedSource;\r
txtItemID.Text = model.itemHouseId;\r
txtItemTitle.Text = model.itemTitle;\r
textBox_mediaID.Text = model.mediaHouseId;\r
txtMediaTitle.Text = model.mediaTitle;\r
txtMediaDescription.Text = model.mediaDescription;\r
- if (metadata == null) {\r
- dtScheduled.Visible = false;\r
- cbFolders.Visible = false;\r
- btnImportOctopus.Visible = false;\r
+ if (octopusAPI == null) {\r
+ dtScheduled.Enabled = false;\r
+ cbFolders.Enabled = false;\r
+ btnImportOctopus.Enabled = false;\r
+ }\r
\r
+ if (mediaCubeApi == null) {\r
+ comboTags.Enabled = false;\r
+ textTags.Enabled = false;\r
} else {\r
- client = new OctopusAPI(metadata.Server?.Address?.OriginalString, metadata.Server?.UserName, metadata.Server?.Password, metadata.Server?.Timeout ?? 0, errorMessageBus);\r
- RefreshFolders();\r
+ comboTags.Items.AddRange(mediaCubeApi.GetAllTags().ToArray());\r
}\r
\r
+\r
btnMxfMetadata.Enabled = selectedSource?.FileInfo != null;\r
}\r
\r
private void RefreshFolders() {\r
Cursor.Current = Cursors.WaitCursor;\r
- List<Rundown> rundownsResult = client.GetRundowns(dtScheduled.Value.Date)?.ToList();\r
+ List<Rundown> rundownsResult = octopusAPI.GetRundowns(dtScheduled.Value.Date)?.ToList();\r
cbFolders.DataSource = rundownsResult;\r
Cursor.Current = Cursors.Default;\r
}\r
model.mediaHouseId = textBox_mediaID.Text;\r
model.mediaTitle = txtMediaTitle.Text;\r
model.mediaDescription = txtMediaDescription.Text;\r
+ model.tags = textTags.Lines;\r
DialogResult = DialogResult.OK;\r
Close();\r
}\r
}\r
\r
private void OnImportOctopusData(object sender, EventArgs e) {\r
- if (!String.IsNullOrEmpty(txtMediaDescription.Text)) {\r
- if (!MsgBox.YesNoQuestion("A média leírása nem üres és törlődni fog. Folytatja?"))\r
+ Cursor.Current = Cursors.WaitCursor;\r
+ try {\r
+\r
+ if (!String.IsNullOrEmpty(txtMediaDescription.Text)) {\r
+ if (!MsgBox.YesNoQuestion("A média leírása nem üres és törlődni fog. Folytatja?"))\r
+ return;\r
+ }\r
+\r
+ Rundown rundown = cbFolders.SelectedItem as Rundown;\r
+ if (rundown == null)\r
return;\r
- }\r
+ string text = octopusAPI.GetRundownContent(rundown.ID);\r
+ if (String.IsNullOrEmpty(text))\r
+ MsgBox.Info("A tükör üres vagy nem található.");\r
+ else\r
+ txtMediaDescription.Text = text;\r
+ } catch { }\r
+\r
+\r
+ Cursor.Current = Cursors.Default;\r
+ tcMediaDesc.SelectedIndex = 0;\r
\r
- Rundown rundown = cbFolders.SelectedItem as Rundown;\r
- if (rundown == null)\r
- return;\r
- string text = client.GetRundownContent(rundown.ID);\r
- if (String.IsNullOrEmpty(text))\r
- MsgBox.Info("A tükör üres vagy nem található.");\r
- else\r
- txtMediaDescription.Text = text;\r
}\r
\r
private void OnImportMxfMetadataClick(object sender, EventArgs e) {\r
+ Cursor.Current = Cursors.WaitCursor;\r
try {\r
- MXFFile mxf = new MXFFile(selectedSource.FileInfo.FullName);\r
- string xml = mxf.GetMetadata();\r
- if (xml == null) {\r
- MessageBox.Show("Nem található metaadat a fájlban.");\r
- return;\r
- }\r
-\r
- XElement root = XElement.Parse(xml);\r
- string ns = root.GetDefaultNamespace()?.NamespaceName;\r
- if (ns != null)\r
- ns = "{" + ns + "}";\r
-\r
- XElement xCreator = root.Elements(ns + "Creator").FirstOrDefault();\r
- if (xCreator != null)\r
- txtItemTitle.Text = xCreator.Attribute("name").Value;\r
- XElement xTitle = root.Elements(ns + "Title").FirstOrDefault();\r
- if (xTitle != null)\r
- txtMediaTitle.Text = xTitle.Attribute("usAscii").Value;\r
- XElement xDescription = root.Elements(ns + "Description").FirstOrDefault();\r
- if (xDescription != null)\r
- txtMediaDescription.Text = xDescription.Value;\r
-\r
+ ArchiveMetadata metadata = MXFMetadataReader.Read(selectedSource.FileInfo.FullName, false);\r
+ txtItemTitle.Text = metadata.itemTitle;\r
+ txtMediaTitle.Text = metadata.mediaTitle;\r
+ txtMediaDescription.Text = metadata.mediaDescription;\r
} catch (Exception ex) {\r
MessageBox.Show("Hiba! A rendszer üzenete: " + ex.Message);\r
}\r
+ Cursor.Current = Cursors.Default;\r
+ tcMediaDesc.SelectedIndex = 0;\r
+ }\r
+\r
+ private void btnAddTag_Click(object sender, EventArgs e) {\r
+ string tag = comboTags.Text;\r
+ if (string.IsNullOrWhiteSpace(comboTags.Text))\r
+ return;\r
+\r
+ if (textTags.Lines.Contains(tag))\r
+ return;\r
\r
+ List<string> lines = textTags.Lines.ToList();\r
+ lines.Add(tag);\r
+ textTags.Lines = lines.ToArray();\r
\r
}\r
}\r
}\r
+;
\ No newline at end of file
<value>17, 17</value>\r
</metadata>\r
<metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">\r
- <value>25</value>\r
+ <value>94</value>\r
</metadata>\r
</root>
\ No newline at end of file
--- /dev/null
+using MaestroShared.Metadata;\r
+using Myriadbits.MXF;\r
+using System.Linq;\r
+using System.Windows.Forms;\r
+using System.Xml.Linq;\r
+\r
+namespace Maestro.Commons {\r
+\r
+ class MXFMetadataReader {\r
+ static public ArchiveMetadata Read(string file, bool readLength) {\r
+ ArchiveMetadata result = new ArchiveMetadata();\r
+ MXFFile mxf = new MXFFile(file);\r
+\r
+ string xml = mxf.GetMetadata();\r
+ if (xml == null) {\r
+ MessageBox.Show("Nem található metaadat a fájlban.");\r
+ } else {\r
+ XElement root = XElement.Parse(xml);\r
+ string ns = root.GetDefaultNamespace()?.NamespaceName;\r
+ if (ns != null)\r
+ ns = "{" + ns + "}";\r
+\r
+ XElement xCreator = root.Elements(ns + "Creator").FirstOrDefault();\r
+ if (xCreator != null)\r
+ result.itemTitle = xCreator.Attribute("name").Value;\r
+ XElement xTitle = root.Elements(ns + "Title").FirstOrDefault();\r
+ if (xTitle != null)\r
+ result.mediaTitle = xTitle.Attribute("usAscii").Value;\r
+ XElement xDescription = root.Elements(ns + "Description").FirstOrDefault();\r
+ if (xDescription != null)\r
+ result.mediaDescription = xDescription.Value;\r
+ else\r
+ MessageBox.Show("A fájlban üres a média leírás.");\r
+ }\r
+\r
+ if (result != null && readLength) {\r
+ mxf.Inspect();\r
+ result.duration = (long)mxf.TimecodeComponent.Duration;\r
+ }\r
+\r
+ return result;\r
+ }\r
+\r
+ }\r
+}\r
{\r
"title": "Development",\r
- "active": false,\r
+ "active": true,\r
"startInTray": false,\r
"enableCustomMetadataId": true,\r
"filter": "avi",\r
"source": {\r
"$type": "UNCSource",\r
"filter": "avi,wav,mxf,mts",\r
- "useAlternateCopy": true,\r
+ "useAlternateCopy": true,\r
+ "autoTarget": "AUTOTARGET",\r
"local": {\r
- "address": "file://c:/_video",\r
+ "address": "file://f:/Clip",\r
"userName": "mediacube",\r
"password": "Dn8t4gfHcK98o8hyPgLDhr5SgSji4JCxsfpMJsODikUp3nXgrM0UNCi45lLAK8ZOnmEneO44P9qpJ4QDqhctN6MxZodjJgdZTyoZKmSa+ECzEzLr/wPYNgxVaXrVotEy",\r
"timeout": 1000\r
{\r
"$type": "MediaCubeMetadata",\r
"server": {\r
- "address": "http://10.10.1.27:88/services/rest/jobengine",\r
+ "address": "http://localhost:8888/services/rest/jobengine",\r
"userName": "mediacube",\r
"password": "Dn8t4gfHcK98o8hyPgLDhr5SgSji4JCxsfpMJsODikUp3nXgrM0UNCi45lLAK8ZOnmEneO44P9qpJ4QDqhctN6MxZodjJgdZTyoZKmSa+ECzEzLr/wPYNgxVaXrVotEy",\r
"timeout": 1000\r
}\r
},\r
{\r
- "label": "UNC Teszt",\r
+ "label": "AUTOTARGET",\r
"processor": "UNCTargetProcessor",\r
- "outputFormat": "%ID%-%SOURCENAME%",\r
+ "outputFormat": "%SOURCENAME%",\r
"tag": "Betöltés",\r
- "killDateDays": 7,\r
- "saveArchiveMetadata": false,\r
+ "killDateDays": 0,\r
+ "saveArchiveMetadata": true,\r
"remote": {\r
"address": "file://c:/opt1",\r
"userName": "mediacube",\r
{\r
"title": "Editor",\r
- "active": true,\r
+ "active": false,\r
"startInTray": false,\r
"enableCustomMetadataId": true,\r
"player": {\r
--- /dev/null
+namespace Maestro {\r
+ partial class Form1 {\r
+ /// <summary>\r
+ /// Required designer variable.\r
+ /// </summary>\r
+ private System.ComponentModel.IContainer components = null;\r
+\r
+ /// <summary>\r
+ /// Clean up any resources being used.\r
+ /// </summary>\r
+ /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>\r
+ protected override void Dispose(bool disposing) {\r
+ if (disposing && (components != null)) {\r
+ components.Dispose();\r
+ }\r
+ base.Dispose(disposing);\r
+ }\r
+\r
+ #region Windows Form Designer generated code\r
+\r
+ /// <summary>\r
+ /// Required method for Designer support - do not modify\r
+ /// the contents of this method with the code editor.\r
+ /// </summary>\r
+ private void InitializeComponent() {\r
+ this.textBox1 = new System.Windows.Forms.TextBox();\r
+ this.label1 = new System.Windows.Forms.Label();\r
+ this.label2 = new System.Windows.Forms.Label();\r
+ this.textBox2 = new System.Windows.Forms.TextBox();\r
+ this.label3 = new System.Windows.Forms.Label();\r
+ this.textBox3 = new System.Windows.Forms.TextBox();\r
+ this.label4 = new System.Windows.Forms.Label();\r
+ this.textBox4 = new System.Windows.Forms.TextBox();\r
+ this.SuspendLayout();\r
+ // \r
+ // textBox1\r
+ // \r
+ this.textBox1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) \r
+ | System.Windows.Forms.AnchorStyles.Right)));\r
+ this.textBox1.Location = new System.Drawing.Point(53, 6);\r
+ this.textBox1.Name = "textBox1";\r
+ this.textBox1.Size = new System.Drawing.Size(310, 20);\r
+ this.textBox1.TabIndex = 0;\r
+ // \r
+ // label1\r
+ // \r
+ this.label1.AutoSize = true;\r
+ this.label1.Location = new System.Drawing.Point(12, 9);\r
+ this.label1.Name = "label1";\r
+ this.label1.Size = new System.Drawing.Size(35, 13);\r
+ this.label1.TabIndex = 1;\r
+ this.label1.Text = "label1";\r
+ // \r
+ // label2\r
+ // \r
+ this.label2.AutoSize = true;\r
+ this.label2.Location = new System.Drawing.Point(12, 35);\r
+ this.label2.Name = "label2";\r
+ this.label2.Size = new System.Drawing.Size(35, 13);\r
+ this.label2.TabIndex = 3;\r
+ this.label2.Text = "label2";\r
+ // \r
+ // textBox2\r
+ // \r
+ this.textBox2.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) \r
+ | System.Windows.Forms.AnchorStyles.Right)));\r
+ this.textBox2.Location = new System.Drawing.Point(53, 32);\r
+ this.textBox2.Name = "textBox2";\r
+ this.textBox2.Size = new System.Drawing.Size(310, 20);\r
+ this.textBox2.TabIndex = 2;\r
+ // \r
+ // label3\r
+ // \r
+ this.label3.AutoSize = true;\r
+ this.label3.Location = new System.Drawing.Point(12, 61);\r
+ this.label3.Name = "label3";\r
+ this.label3.Size = new System.Drawing.Size(35, 13);\r
+ this.label3.TabIndex = 5;\r
+ this.label3.Text = "label3";\r
+ // \r
+ // textBox3\r
+ // \r
+ this.textBox3.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) \r
+ | System.Windows.Forms.AnchorStyles.Right)));\r
+ this.textBox3.Location = new System.Drawing.Point(53, 58);\r
+ this.textBox3.Name = "textBox3";\r
+ this.textBox3.Size = new System.Drawing.Size(310, 20);\r
+ this.textBox3.TabIndex = 4;\r
+ // \r
+ // label4\r
+ // \r
+ this.label4.AutoSize = true;\r
+ this.label4.Location = new System.Drawing.Point(12, 87);\r
+ this.label4.Name = "label4";\r
+ this.label4.Size = new System.Drawing.Size(35, 13);\r
+ this.label4.TabIndex = 7;\r
+ this.label4.Text = "label4";\r
+ // \r
+ // textBox4\r
+ // \r
+ this.textBox4.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) \r
+ | System.Windows.Forms.AnchorStyles.Right)));\r
+ this.textBox4.Location = new System.Drawing.Point(53, 84);\r
+ this.textBox4.Name = "textBox4";\r
+ this.textBox4.Size = new System.Drawing.Size(310, 20);\r
+ this.textBox4.TabIndex = 6;\r
+ // \r
+ // Form1\r
+ // \r
+ this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);\r
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;\r
+ this.ClientSize = new System.Drawing.Size(775, 357);\r
+ this.Controls.Add(this.label4);\r
+ this.Controls.Add(this.textBox4);\r
+ this.Controls.Add(this.label3);\r
+ this.Controls.Add(this.textBox3);\r
+ this.Controls.Add(this.label2);\r
+ this.Controls.Add(this.textBox2);\r
+ this.Controls.Add(this.label1);\r
+ this.Controls.Add(this.textBox1);\r
+ this.Name = "Form1";\r
+ this.Text = "Form1";\r
+ this.ResumeLayout(false);\r
+ this.PerformLayout();\r
+\r
+ }\r
+\r
+ #endregion\r
+\r
+ private System.Windows.Forms.TextBox textBox1;\r
+ private System.Windows.Forms.Label label1;\r
+ private System.Windows.Forms.Label label2;\r
+ private System.Windows.Forms.TextBox textBox2;\r
+ private System.Windows.Forms.Label label3;\r
+ private System.Windows.Forms.TextBox textBox3;\r
+ private System.Windows.Forms.Label label4;\r
+ private System.Windows.Forms.TextBox textBox4;\r
+ }\r
+}
\ No newline at end of file
--- /dev/null
+using System;\r
+using System.Collections.Generic;\r
+using System.ComponentModel;\r
+using System.Data;\r
+using System.Drawing;\r
+using System.Linq;\r
+using System.Text;\r
+using System.Threading.Tasks;\r
+using System.Windows.Forms;\r
+\r
+namespace Maestro {\r
+ public partial class Form1 : Form {\r
+ public Form1() {\r
+ InitializeComponent();\r
+ }\r
+ }\r
+}\r
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>\r
+<root>\r
+ <!-- \r
+ Microsoft ResX Schema \r
+ \r
+ Version 2.0\r
+ \r
+ The primary goals of this format is to allow a simple XML format \r
+ that is mostly human readable. The generation and parsing of the \r
+ various data types are done through the TypeConverter classes \r
+ associated with the data types.\r
+ \r
+ Example:\r
+ \r
+ ... ado.net/XML headers & schema ...\r
+ <resheader name="resmimetype">text/microsoft-resx</resheader>\r
+ <resheader name="version">2.0</resheader>\r
+ <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>\r
+ <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>\r
+ <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>\r
+ <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>\r
+ <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">\r
+ <value>[base64 mime encoded serialized .NET Framework object]</value>\r
+ </data>\r
+ <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">\r
+ <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>\r
+ <comment>This is a comment</comment>\r
+ </data>\r
+ \r
+ There are any number of "resheader" rows that contain simple \r
+ name/value pairs.\r
+ \r
+ Each data row contains a name, and value. The row also contains a \r
+ type or mimetype. Type corresponds to a .NET class that support \r
+ text/value conversion through the TypeConverter architecture. \r
+ Classes that don't support this are serialized and stored with the \r
+ mimetype set.\r
+ \r
+ The mimetype is used for serialized objects, and tells the \r
+ ResXResourceReader how to depersist the object. This is currently not \r
+ extensible. For a given mimetype the value must be set accordingly:\r
+ \r
+ Note - application/x-microsoft.net.object.binary.base64 is the format \r
+ that the ResXResourceWriter will generate, however the reader can \r
+ read any of the formats listed below.\r
+ \r
+ mimetype: application/x-microsoft.net.object.binary.base64\r
+ value : The object must be serialized with \r
+ : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter\r
+ : and then encoded with base64 encoding.\r
+ \r
+ mimetype: application/x-microsoft.net.object.soap.base64\r
+ value : The object must be serialized with \r
+ : System.Runtime.Serialization.Formatters.Soap.SoapFormatter\r
+ : and then encoded with base64 encoding.\r
+\r
+ mimetype: application/x-microsoft.net.object.bytearray.base64\r
+ value : The object must be serialized into a byte array \r
+ : using a System.ComponentModel.TypeConverter\r
+ : and then encoded with base64 encoding.\r
+ -->\r
+ <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">\r
+ <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />\r
+ <xsd:element name="root" msdata:IsDataSet="true">\r
+ <xsd:complexType>\r
+ <xsd:choice maxOccurs="unbounded">\r
+ <xsd:element name="metadata">\r
+ <xsd:complexType>\r
+ <xsd:sequence>\r
+ <xsd:element name="value" type="xsd:string" minOccurs="0" />\r
+ </xsd:sequence>\r
+ <xsd:attribute name="name" use="required" type="xsd:string" />\r
+ <xsd:attribute name="type" type="xsd:string" />\r
+ <xsd:attribute name="mimetype" type="xsd:string" />\r
+ <xsd:attribute ref="xml:space" />\r
+ </xsd:complexType>\r
+ </xsd:element>\r
+ <xsd:element name="assembly">\r
+ <xsd:complexType>\r
+ <xsd:attribute name="alias" type="xsd:string" />\r
+ <xsd:attribute name="name" type="xsd:string" />\r
+ </xsd:complexType>\r
+ </xsd:element>\r
+ <xsd:element name="data">\r
+ <xsd:complexType>\r
+ <xsd:sequence>\r
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />\r
+ <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />\r
+ </xsd:sequence>\r
+ <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />\r
+ <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />\r
+ <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />\r
+ <xsd:attribute ref="xml:space" />\r
+ </xsd:complexType>\r
+ </xsd:element>\r
+ <xsd:element name="resheader">\r
+ <xsd:complexType>\r
+ <xsd:sequence>\r
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />\r
+ </xsd:sequence>\r
+ <xsd:attribute name="name" type="xsd:string" use="required" />\r
+ </xsd:complexType>\r
+ </xsd:element>\r
+ </xsd:choice>\r
+ </xsd:complexType>\r
+ </xsd:element>\r
+ </xsd:schema>\r
+ <resheader name="resmimetype">\r
+ <value>text/microsoft-resx</value>\r
+ </resheader>\r
+ <resheader name="version">\r
+ <value>2.0</value>\r
+ </resheader>\r
+ <resheader name="reader">\r
+ <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\r
+ </resheader>\r
+ <resheader name="writer">\r
+ <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\r
+ </resheader>\r
+</root>
\ No newline at end of file
<DependentUpon>ArchiveMetadataForm.cs</DependentUpon>\r
</Compile>\r
<Compile Include="Commons\DataGridViewProgressColumn.cs" />\r
+ <Compile Include="Commons\MXFMetadataReader.cs" />\r
<Compile Include="Commons\SambaClient.cs" />\r
<Compile Include="Commons\WindowsIdentityMembers.cs" />\r
+ <Compile Include="Form1.cs">\r
+ <SubType>Form</SubType>\r
+ </Compile>\r
+ <Compile Include="Form1.Designer.cs">\r
+ <DependentUpon>Form1.cs</DependentUpon>\r
+ </Compile>\r
<Compile Include="LoginForm.cs">\r
<SubType>Form</SubType>\r
</Compile>\r
<EmbeddedResource Include="ArchiveMetadataForm.resx">\r
<DependentUpon>ArchiveMetadataForm.cs</DependentUpon>\r
</EmbeddedResource>\r
+ <EmbeddedResource Include="Form1.resx">\r
+ <DependentUpon>Form1.cs</DependentUpon>\r
+ </EmbeddedResource>\r
<EmbeddedResource Include="LoginForm.resx">\r
<DependentUpon>LoginForm.cs</DependentUpon>\r
</EmbeddedResource>\r
/// </summary>\r
private void InitializeComponent() {\r
this.components = new System.ComponentModel.Container();\r
- System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle31 = new System.Windows.Forms.DataGridViewCellStyle();\r
- System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle32 = new System.Windows.Forms.DataGridViewCellStyle();\r
- System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle33 = new System.Windows.Forms.DataGridViewCellStyle();\r
+ System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle();\r
+ System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle();\r
+ System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle3 = new System.Windows.Forms.DataGridViewCellStyle();\r
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MaestroForm));\r
- System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle36 = new System.Windows.Forms.DataGridViewCellStyle();\r
- System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle37 = new System.Windows.Forms.DataGridViewCellStyle();\r
- System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle34 = new System.Windows.Forms.DataGridViewCellStyle();\r
- System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle35 = new System.Windows.Forms.DataGridViewCellStyle();\r
- System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle39 = new System.Windows.Forms.DataGridViewCellStyle();\r
- System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle40 = new System.Windows.Forms.DataGridViewCellStyle();\r
- System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle38 = new System.Windows.Forms.DataGridViewCellStyle();\r
+ System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle6 = new System.Windows.Forms.DataGridViewCellStyle();\r
+ System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle7 = new System.Windows.Forms.DataGridViewCellStyle();\r
+ System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle4 = new System.Windows.Forms.DataGridViewCellStyle();\r
+ System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle5 = new System.Windows.Forms.DataGridViewCellStyle();\r
+ System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle9 = new System.Windows.Forms.DataGridViewCellStyle();\r
+ System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle10 = new System.Windows.Forms.DataGridViewCellStyle();\r
+ System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle8 = new System.Windows.Forms.DataGridViewCellStyle();\r
this.groupSource = new System.Windows.Forms.GroupBox();\r
this.dgSource = new System.Windows.Forms.DataGridView();\r
this.bindingSource = new System.Windows.Forms.BindingSource(this.components);\r
this.dgSource.BackgroundColor = System.Drawing.Color.White;\r
this.dgSource.BorderStyle = System.Windows.Forms.BorderStyle.None;\r
this.dgSource.CellBorderStyle = System.Windows.Forms.DataGridViewCellBorderStyle.Raised;\r
- dataGridViewCellStyle31.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;\r
- dataGridViewCellStyle31.BackColor = System.Drawing.SystemColors.Control;\r
- dataGridViewCellStyle31.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));\r
- dataGridViewCellStyle31.ForeColor = System.Drawing.SystemColors.WindowText;\r
- dataGridViewCellStyle31.SelectionBackColor = System.Drawing.SystemColors.Highlight;\r
- dataGridViewCellStyle31.SelectionForeColor = System.Drawing.SystemColors.HighlightText;\r
- dataGridViewCellStyle31.WrapMode = System.Windows.Forms.DataGridViewTriState.True;\r
- this.dgSource.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle31;\r
+ dataGridViewCellStyle1.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;\r
+ dataGridViewCellStyle1.BackColor = System.Drawing.SystemColors.Control;\r
+ dataGridViewCellStyle1.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));\r
+ dataGridViewCellStyle1.ForeColor = System.Drawing.SystemColors.WindowText;\r
+ dataGridViewCellStyle1.SelectionBackColor = System.Drawing.SystemColors.Highlight;\r
+ dataGridViewCellStyle1.SelectionForeColor = System.Drawing.SystemColors.HighlightText;\r
+ dataGridViewCellStyle1.WrapMode = System.Windows.Forms.DataGridViewTriState.True;\r
+ this.dgSource.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle1;\r
this.dgSource.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;\r
this.dgSource.DataSource = this.bindingSource;\r
- dataGridViewCellStyle32.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;\r
- dataGridViewCellStyle32.BackColor = System.Drawing.SystemColors.Window;\r
- dataGridViewCellStyle32.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));\r
- dataGridViewCellStyle32.ForeColor = System.Drawing.SystemColors.ControlText;\r
- dataGridViewCellStyle32.SelectionBackColor = System.Drawing.Color.Gainsboro;\r
- dataGridViewCellStyle32.SelectionForeColor = System.Drawing.Color.Black;\r
- dataGridViewCellStyle32.WrapMode = System.Windows.Forms.DataGridViewTriState.False;\r
- this.dgSource.DefaultCellStyle = dataGridViewCellStyle32;\r
+ dataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;\r
+ dataGridViewCellStyle2.BackColor = System.Drawing.SystemColors.Window;\r
+ dataGridViewCellStyle2.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));\r
+ dataGridViewCellStyle2.ForeColor = System.Drawing.SystemColors.ControlText;\r
+ dataGridViewCellStyle2.SelectionBackColor = System.Drawing.Color.Gainsboro;\r
+ dataGridViewCellStyle2.SelectionForeColor = System.Drawing.Color.Black;\r
+ dataGridViewCellStyle2.WrapMode = System.Windows.Forms.DataGridViewTriState.False;\r
+ this.dgSource.DefaultCellStyle = dataGridViewCellStyle2;\r
this.dgSource.Dock = System.Windows.Forms.DockStyle.Fill;\r
this.dgSource.EditMode = System.Windows.Forms.DataGridViewEditMode.EditProgrammatically;\r
this.dgSource.EnableHeadersVisualStyles = false;\r
this.dgSource.Location = new System.Drawing.Point(10, 47);\r
this.dgSource.Name = "dgSource";\r
this.dgSource.RowHeadersVisible = false;\r
- dataGridViewCellStyle33.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));\r
- this.dgSource.RowsDefaultCellStyle = dataGridViewCellStyle33;\r
+ dataGridViewCellStyle3.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));\r
+ this.dgSource.RowsDefaultCellStyle = dataGridViewCellStyle3;\r
this.dgSource.RowTemplate.DefaultCellStyle.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));\r
this.dgSource.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;\r
this.dgSource.Size = new System.Drawing.Size(330, 163);\r
this.columnKillDate,\r
this.columnMessage});\r
this.dgJobs.DataSource = this.bindingSourceJobs;\r
- dataGridViewCellStyle36.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;\r
- dataGridViewCellStyle36.BackColor = System.Drawing.SystemColors.Window;\r
- dataGridViewCellStyle36.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));\r
- dataGridViewCellStyle36.ForeColor = System.Drawing.SystemColors.ControlText;\r
- dataGridViewCellStyle36.NullValue = null;\r
- dataGridViewCellStyle36.SelectionBackColor = System.Drawing.Color.Gainsboro;\r
- dataGridViewCellStyle36.SelectionForeColor = System.Drawing.Color.Black;\r
- dataGridViewCellStyle36.WrapMode = System.Windows.Forms.DataGridViewTriState.False;\r
- this.dgJobs.DefaultCellStyle = dataGridViewCellStyle36;\r
+ dataGridViewCellStyle6.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;\r
+ dataGridViewCellStyle6.BackColor = System.Drawing.SystemColors.Window;\r
+ dataGridViewCellStyle6.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));\r
+ dataGridViewCellStyle6.ForeColor = System.Drawing.SystemColors.ControlText;\r
+ dataGridViewCellStyle6.NullValue = null;\r
+ dataGridViewCellStyle6.SelectionBackColor = System.Drawing.Color.Gainsboro;\r
+ dataGridViewCellStyle6.SelectionForeColor = System.Drawing.Color.Black;\r
+ dataGridViewCellStyle6.WrapMode = System.Windows.Forms.DataGridViewTriState.False;\r
+ this.dgJobs.DefaultCellStyle = dataGridViewCellStyle6;\r
this.dgJobs.Dock = System.Windows.Forms.DockStyle.Fill;\r
this.dgJobs.EditMode = System.Windows.Forms.DataGridViewEditMode.EditProgrammatically;\r
this.dgJobs.EnableHeadersVisualStyles = false;\r
this.dgJobs.Location = new System.Drawing.Point(3, 3);\r
this.dgJobs.Name = "dgJobs";\r
this.dgJobs.RowHeadersVisible = false;\r
- dataGridViewCellStyle37.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));\r
- this.dgJobs.RowsDefaultCellStyle = dataGridViewCellStyle37;\r
+ dataGridViewCellStyle7.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));\r
+ this.dgJobs.RowsDefaultCellStyle = dataGridViewCellStyle7;\r
this.dgJobs.RowTemplate.DefaultCellStyle.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));\r
this.dgJobs.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;\r
this.dgJobs.Size = new System.Drawing.Size(988, 96);\r
// columnID\r
// \r
this.columnID.DataPropertyName = "ID";\r
- dataGridViewCellStyle34.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));\r
- this.columnID.DefaultCellStyle = dataGridViewCellStyle34;\r
+ dataGridViewCellStyle4.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));\r
+ this.columnID.DefaultCellStyle = dataGridViewCellStyle4;\r
this.columnID.HeaderText = "ID";\r
this.columnID.Name = "columnID";\r
this.columnID.Width = 44;\r
// columnStatus\r
// \r
this.columnStatus.DataPropertyName = "Status";\r
- dataGridViewCellStyle35.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));\r
- this.columnStatus.DefaultCellStyle = dataGridViewCellStyle35;\r
+ dataGridViewCellStyle5.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));\r
+ this.columnStatus.DefaultCellStyle = dataGridViewCellStyle5;\r
this.columnStatus.HeaderText = "Status";\r
this.columnStatus.Name = "columnStatus";\r
this.columnStatus.Width = 66;\r
this.dgMessages.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {\r
this.columnMessagesTime,\r
this.columnMessagesMessage});\r
- dataGridViewCellStyle39.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;\r
- dataGridViewCellStyle39.BackColor = System.Drawing.SystemColors.Window;\r
- dataGridViewCellStyle39.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));\r
- dataGridViewCellStyle39.ForeColor = System.Drawing.Color.Red;\r
- dataGridViewCellStyle39.NullValue = null;\r
- dataGridViewCellStyle39.SelectionBackColor = System.Drawing.Color.Gainsboro;\r
- dataGridViewCellStyle39.SelectionForeColor = System.Drawing.Color.Red;\r
- dataGridViewCellStyle39.WrapMode = System.Windows.Forms.DataGridViewTriState.False;\r
- this.dgMessages.DefaultCellStyle = dataGridViewCellStyle39;\r
+ dataGridViewCellStyle9.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;\r
+ dataGridViewCellStyle9.BackColor = System.Drawing.SystemColors.Window;\r
+ dataGridViewCellStyle9.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));\r
+ dataGridViewCellStyle9.ForeColor = System.Drawing.Color.Red;\r
+ dataGridViewCellStyle9.NullValue = null;\r
+ dataGridViewCellStyle9.SelectionBackColor = System.Drawing.Color.Gainsboro;\r
+ dataGridViewCellStyle9.SelectionForeColor = System.Drawing.Color.Red;\r
+ dataGridViewCellStyle9.WrapMode = System.Windows.Forms.DataGridViewTriState.False;\r
+ this.dgMessages.DefaultCellStyle = dataGridViewCellStyle9;\r
this.dgMessages.Dock = System.Windows.Forms.DockStyle.Fill;\r
this.dgMessages.EditMode = System.Windows.Forms.DataGridViewEditMode.EditProgrammatically;\r
this.dgMessages.EnableHeadersVisualStyles = false;\r
this.dgMessages.Name = "dgMessages";\r
this.dgMessages.ReadOnly = true;\r
this.dgMessages.RowHeadersVisible = false;\r
- dataGridViewCellStyle40.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));\r
- this.dgMessages.RowsDefaultCellStyle = dataGridViewCellStyle40;\r
+ dataGridViewCellStyle10.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));\r
+ this.dgMessages.RowsDefaultCellStyle = dataGridViewCellStyle10;\r
this.dgMessages.RowTemplate.DefaultCellStyle.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));\r
this.dgMessages.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;\r
this.dgMessages.Size = new System.Drawing.Size(988, 96);\r
// \r
this.columnMessagesMessage.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;\r
this.columnMessagesMessage.DataPropertyName = "Message";\r
- dataGridViewCellStyle38.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));\r
- this.columnMessagesMessage.DefaultCellStyle = dataGridViewCellStyle38;\r
+ dataGridViewCellStyle8.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));\r
+ this.columnMessagesMessage.DefaultCellStyle = dataGridViewCellStyle8;\r
this.columnMessagesMessage.HeaderText = "Üzenet";\r
this.columnMessagesMessage.Name = "columnMessagesMessage";\r
this.columnMessagesMessage.ReadOnly = true;\r
if (metadata == null || metadata.Disabled)\r
return;\r
mediaCubeApi = new MediaCubeApi(metadata.Server.Address.ToString(), metadata.Server.UserName, metadata.Server.Password, metadata.Server.Timeout, errorMessageBus);\r
+ //List<string> list = mediaCubeApi.GetAllTags();\r
+\r
}\r
\r
+\r
private void OnEditMetadata(object sender, EventArgs e) {\r
if (ArchiveMetadata == null)\r
ArchiveMetadata = GetArchiveMetadata();\r
return;\r
}\r
\r
- OctopusMetadata metadata = MetadataProvider.Get<OctopusMetadata>(Configuration.Metadatas);\r
- ArchiveMetadataForm form = new ArchiveMetadataForm(ref archiveMetadata, metadata, errorMessageBus, SelectedSource);\r
+ OctopusAPI octopusAPI = octopusIDSelector?.GetClient();\r
+\r
+ ArchiveMetadataForm form = new ArchiveMetadataForm(ref archiveMetadata, octopusAPI, mediaCubeApi, errorMessageBus, SelectedSource);\r
form.BackColor = partialColor;\r
DialogResult result = form.ShowDialog();\r
\r
\r
\r
//MetadataType metadataType = MetadataTypeUtil.Guess(textSelectedMetadata.Text);\r
- MetadataType metadataType = SelectedMetadata.Kind;\r
+ MetadataType metadataType = MetadataType.MediaCube;\r
+ \r
+ if (SelectedMetadata != null)\r
+ metadataType = SelectedMetadata.Kind;\r
\r
switch (metadataType) {\r
case MetadataType.None:\r
using DxPlay;\r
+using Maestro.Commons;\r
using Maestro.Metadata;\r
using Maestro.Sources;\r
+using MaestroShared.Commons;\r
using MaestroShared.Configuration;\r
using MaestroShared.Metadata;\r
using MaestroShared.Resources;\r
+using MaestroShared.Target;\r
+using MaestroShared.Targets;\r
using System;\r
using System.Collections.Generic;\r
using System.Diagnostics;\r
using System.Drawing;\r
using System.IO;\r
using System.Linq;\r
+using System.Threading;\r
using System.Windows.Forms;\r
+using System.Xml;\r
\r
namespace Maestro {\r
\r
btnShowFolders.Enabled = true;\r
logger.Debug("UNC source initialization");\r
source = new FileSystemSource(this, MessageBus, Configuration.Player.Enabled, Configuration.Source.Filter);\r
+ ((FileSystemSource)source).OnListReadCompleted += MaestroForm_OnListReadCompleted;\r
logger.Debug("UNC source created");\r
}\r
if (Configuration?.Source is NEXIOSource) {\r
treeFolders.NodeDoubleClick += OnDoubleClickFolder;\r
}\r
\r
+ private void MaestroForm_OnListReadCompleted(string[] files) {\r
+ //nem UNC forras\r
+ if (!(Configuration?.Source is UNCSource))\r
+ return;\r
+\r
+ //nincs beallitva autotarget\r
+ UNCSource source = Configuration?.Source as UNCSource;\r
+ if (string.IsNullOrWhiteSpace(source.AutoTarget))\r
+ return;\r
+ if (files == null || files.Count() == 0) {\r
+ logger.Info("Source is empty, skipping auto process");\r
+ return;\r
+ }\r
+\r
+ //nincs autotarget\r
+ var target = Configuration?.Targets?.FirstOrDefault(t => source.AutoTarget.Equals(t.Label));\r
+ if (target == null) {\r
+ logger.Error($"Auto target {source.AutoTarget} is not available");\r
+ return;\r
+ }\r
+\r
+ //nincs discmeta.xml\r
+ string discMeta = Path.Combine(source.Local.Address.AbsolutePath.Replace("Clip", ""), "discmeta.xml");\r
+ FileInfo discFileInfo = new FileInfo(discMeta);\r
+ if (!discFileInfo.Exists) { \r
+ logger.Info("discmeta.xml not exists, skipping auto process");\r
+ return;\r
+ }\r
+\r
+\r
+\r
+ XmlDocument doc = new XmlDocument();\r
+ doc.Load(discMeta);\r
+\r
+ string itemHouseId = null;\r
+ try {\r
+ XmlNode node = doc.DocumentElement.GetElementsByTagName("UserDiscId")[0];\r
+ itemHouseId = node.Attributes["value"].Value;\r
+ } catch {\r
+ logger.Info("discmeta.xml doesn't contains UserDiscId, skipping auto process");\r
+ return;\r
+ }\r
+\r
+\r
+ if (MsgBox.YesNoQuestion("Új betöltendő tartalmat deketáltam. Indulhat az automatikus betöltés?"))\r
+ BeginInvoke(new Action(() => AutoProcess(files, target, itemHouseId)));\r
+ \r
+ }\r
+\r
+ private void AutoProcess(string[] files, Target target, string itemHouseId) {\r
+\r
+ long count = files.Count() / 2;\r
+ logger.Info($"Auto processing {count} items");\r
+\r
+ //List<string> allFiles = new List<string>();\r
+ foreach (string file in files) {\r
+ if (!file.ToUpper().EndsWith(".MXF"))\r
+ continue;\r
+\r
+ var sourceItem = new FileSourceItem() {\r
+ FileInfo = new FileInfo(file)\r
+ };\r
+\r
+ logger.Info($"Reading metadata from {file}");\r
+\r
+ string proxy = file.Replace("\\Clip\\", "\\Sub\\");\r
+ proxy = proxy.Substring(0, proxy.LastIndexOf(".")) + "S01" + proxy.Substring(proxy.LastIndexOf("."));\r
+\r
+ FileInfo proxyFi = new FileInfo(proxy);\r
+ if (!proxyFi.Exists) {\r
+ logger.Info($"Proxy {proxy} not exists, skipping {file}");\r
+ continue;\r
+ }\r
+\r
+ TargetProcessorParameter processorParameter = null;\r
+ try {\r
+ //mxf metadata + duration\r
+ ArchiveMetadata metadata = MXFMetadataReader.Read(file, true);\r
+ metadata.itemHouseId = itemHouseId;\r
+ metadata.mediaHouseId = metadata.mediaTitle;\r
+ metadata.mediaTitle = sourceItem.FileInfo.Name;\r
+ processorParameter = CreateProcessorParameter(target, sourceItem, metadata, DateTime.Now, null);\r
+ processorParameter.ProxyPath = proxy;\r
+ } catch (Exception e) {\r
+ logger.Error(e.Message);\r
+ break;\r
+ }\r
+\r
+ ITargetProcessor p = TargetProcessor.Create(target.Processor);\r
+ p.Initialize(this, processorParameter);\r
+ ProcessJob(p);\r
+ Application.DoEvents();\r
+ }\r
+ logger.Info("Auto processing source completed");\r
+ }\r
+\r
private void Source_ListChanged(object sender, System.ComponentModel.ListChangedEventArgs e) {\r
UpdateSelectionCounts();\r
}\r
\r
TargetProcessorParameter processorParameter = null;\r
try {\r
- processorParameter = CreateProcessorParameter(target, sourceItem, createDate, partReplace);\r
+ processorParameter = CreateProcessorParameter(target, sourceItem, ArchiveMetadata, createDate, partReplace);\r
} catch (Exception e) {\r
result = null;\r
break;\r
return true;\r
}\r
\r
- private TargetProcessorParameter CreateProcessorParameter(Target target, ISourceItem sourceItem, DateTime createDate, string partReplace) {\r
+ private TargetProcessorParameter CreateProcessorParameter(Target target, ISourceItem sourceItem, ArchiveMetadata metadata, DateTime createDate, string partReplace) {\r
FileSystemSource source = bindingSource.DataSource as FileSystemSource;\r
\r
TargetProcessorParameter result = new TargetProcessorParameter();\r
result.TargetOrder = Configuration.Targets.ToList().IndexOf(target);\r
result.SelectedSegments = SelectedMetadata?.Selected;\r
result.PartReplace = partReplace;\r
- if (ArchiveMetadata != null) {\r
- result.ArchiveMetadata = ArchiveMetadata.DeepClone(ArchiveMetadata);\r
- result.ArchiveMetadata.duration = sourceItem.Frames;\r
+ if (metadata != null) {\r
+ result.ArchiveMetadata = ArchiveMetadata.DeepClone(metadata);\r
+\r
+ //ket uton is johet a hossz\r
+ if (metadata.duration > 0)\r
+ result.Frames = metadata.duration;\r
+ else\r
+ if (sourceItem.Frames > 0)\r
+ result.ArchiveMetadata.duration = sourceItem.Frames;\r
+\r
+\r
result.ArchiveMetadata.userName = result.UserName;\r
- if (SelectedMetadata.Kind == MetadataType.MediaCube) {\r
+ if (SelectedMetadata?.Kind == MetadataType.MediaCube) {\r
result.ArchiveMetadata.itemHouseId = PatternNameMaker.Get(result.ArchiveMetadata.itemHouseId, result.ID, null, result.InputFileName, null, null, result.MetadataText, null);\r
result.ArchiveMetadata.itemTitle = PatternNameMaker.Get(result.ArchiveMetadata.itemTitle, result.ID, null, result.InputFileName, null, null, result.MetadataText, null);\r
result.ArchiveMetadata.mediaHouseId = PatternNameMaker.Get(result.ArchiveMetadata.mediaHouseId, result.ID, null, result.InputFileName, null, null, result.MetadataText, null);\r
.ThenByDescending(p => p.Parameters.TargetConfig.NexioServer)\r
.ThenBy(p => p.Parameters.TargetOrder)\r
.ToList()\r
- .ForEach(p => {\r
- jobs.Add(p);\r
- jobsQueue.Enqueue(p);\r
- });\r
+ .ForEach(p => ProcessJob(p) );\r
\r
UpdateJobCounts();\r
\r
ClearSelectedProcessors();\r
- if (processorWorkers == null)\r
- CreateJobsQueueWorkers();\r
ActivateTab(0);\r
SelectedSource = null;\r
ClearSelectedMetadata();\r
}\r
\r
+ private void ProcessJob(ITargetProcessor p) {\r
+ jobs.Add(p);\r
+ jobsQueue.Enqueue(p);\r
+ //az elso job eseten indul el a feldolgozo szal\r
+ if (processorWorkers == null)\r
+ CreateJobsQueueWorkers();\r
+ }\r
+\r
}\r
}\r
AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w\r
LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0\r
ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAAAS\r
- CAAAAk1TRnQBSQFMAgEBAgEAAcABAgHAAQIBEAEAARABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo\r
+ CAAAAk1TRnQBSQFMAgEBAgEAAcgBAgHIAQIBEAEAARABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo\r
AwABQAMAARADAAEBAQABCAYAAQQYAAGAAgABgAMAAoABAAGAAwABgAEAAYABAAKAAgADwAEAAcAB3AHA\r
AQAB8AHKAaYBAAEzBQABMwEAATMBAAEzAQACMwIAAxYBAAMcAQADIgEAAykBAANVAQADTQEAA0IBAAM5\r
AQABgAF8Af8BAAJQAf8BAAGTAQAB1gEAAf8B7AHMAQABxgHWAe8BAAHWAucBAAGQAakBrQIAAf8BMwMA\r
<metadata name="tsSource.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">\r
<value>951, 17</value>\r
</metadata>\r
- <metadata name="tsSource.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">\r
- <value>951, 17</value>\r
- </metadata>\r
<metadata name="tsMetadata.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">\r
<value>846, 17</value>\r
</metadata>\r
- <metadata name="toolStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">\r
- <value>1146, 17</value>\r
- </metadata>\r
<metadata name="columnInputName.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">\r
<value>True</value>\r
</metadata>\r
using System.Windows.Forms;\r
\r
namespace Maestro.Sources {\r
- public delegate void ClearAndInitialize();\r
\r
class FileSystemSource : BindingList<FileSourceItem>, ISource, IBindingListView {\r
+ public delegate void ListReadCompletedHandler(string[] files);\r
+ public event ListReadCompletedHandler OnListReadCompleted;\r
+\r
private static readonly Logger logger = LogManager.GetCurrentClassLogger();\r
private IMessageBus messageBus;\r
private List<CreatedFileMonitor> createdFileMonitors = new List<CreatedFileMonitor>();\r
try {\r
fileSourceItems.Where(x => x.CanHandle(acceptableExtensions)).ToList().ForEach(i => parent.SafeCall(() => Add(i)));\r
logger.Trace("Added async list");\r
- //IAsyncResult invokeResult = parent.SafeCall(() =>\r
- // fileSourceItems.Where(x => x.CanHandle(acceptableExtensions)).ToList().ForEach(i => Add(i))\r
- //);\r
- //BackgroundWorker bg = new BackgroundWorker();\r
- //bg.WorkerSupportsCancellation = true;\r
- //bg.DoWork += (s, e) => {\r
- // Color origColor = parent.BackColor;\r
- // Color hlColor = MaestroColors.Yellow200;\r
- // while (!invokeResult.IsCompleted) {\r
- // parent.BackColor = parent.BackColor == hlColor ? origColor : hlColor;\r
- // Thread.Sleep(1000);\r
- // }\r
- // logger.Trace("Added list");\r
- //};\r
- //bg.RunWorkerAsync();\r
-\r
} catch (Exception e) {\r
logger.Error(e);\r
Shutdown();\r
}\r
+\r
+ OnListReadCompleted?.Invoke(files);\r
+\r
logger.Trace("Exit");\r
}\r
\r
public class Source {\r
public Connection Local { get; set; }\r
public Connection Remote { get; set; }\r
- public String Filter { get; set; }\r
+ public string Filter { get; set; }\r
+ public string AutoTarget { get; set; }\r
}\r
\r
public class UNCSource : Source {\r
public string userName { get; set; }\r
public string mediaType { get; set; }\r
public long duration { get; set; }\r
+ public string[] tags { get; set; }\r
\r
public override string ToString() {\r
return JsonConvert.SerializeObject(this, Formatting.Indented);\r
public long Frames { get; set; }\r
public int TargetOrder { get; set; }\r
public TrafficMetadata TrafficMetadata { get; set; }\r
+\r
+ public string ProxyPath;\r
+\r
}\r
}\r
//logger.Info("Spend (s):" + (DateTime.Now - started).TotalSeconds);\r
if (Parameters.TargetConfig.DeleteAfterCopy || Parameters.TargetConfig.MoveToFolder)\r
DeleteAfterCopy();\r
+\r
+ //automatikus betoltes, letezo proxyval\r
+ if (!string.IsNullOrWhiteSpace(Parameters.SourceConfig.AutoTarget) && !string.IsNullOrWhiteSpace(Parameters.ProxyPath)) {\r
+ UploadProxy();\r
+ }\r
+\r
ExecuteCompleted();\r
\r
Status = READY;\r
bool copyResult = false;\r
\r
if (Parameters.SourceConfig is UNCSource && ((UNCSource)Parameters.SourceConfig).UseAlternateCopy)\r
- copyResult = doAlternateCopy(targetFilePath);\r
+ copyResult = doAlternateCopy(Input, targetFilePath);\r
else\r
- copyResult = doCopy(ref pbCancel, targetFilePath);\r
+ copyResult = doCopy(ref pbCancel, Input, targetFilePath);\r
\r
\r
if (copyResult && Parameters.TargetConfig.TemporaryCopy) {\r
}\r
}\r
\r
- private bool doCopy(ref int pbCancel, string targetFilePath) {\r
+ protected virtual void UploadProxy() {\r
+ int pbCancel = 0;\r
+ string outputPath = Path.GetDirectoryName(Output);\r
+ string outputFile = Path.GetFileName(Parameters.ProxyPath);\r
+\r
+ string targetFilePath = Path.Combine(outputPath, STATUS_FOLDER, outputFile);\r
+ EnsureDirectoryExistence(Path.GetDirectoryName(targetFilePath));\r
+\r
+ string tmpPath = targetFilePath;\r
+ if (Parameters.TargetConfig.TemporaryCopy)\r
+ tmpPath = targetFilePath + ".tmp";\r
+\r
+ bool copyResult = false;\r
+\r
+ if (Parameters.SourceConfig is UNCSource && ((UNCSource)Parameters.SourceConfig).UseAlternateCopy)\r
+ copyResult = doAlternateCopy(Parameters.ProxyPath, tmpPath);\r
+ else\r
+ copyResult = doCopy(ref pbCancel, Parameters.ProxyPath, tmpPath);\r
+\r
+\r
+ if (copyResult && Parameters.TargetConfig.TemporaryCopy) {\r
+ File.Move(tmpPath, targetFilePath);\r
+ }\r
+ }\r
+\r
+ private bool doCopy(ref int pbCancel, string sourceFilePath, string targetFilePath) {\r
return Win32File.CopyFileEx(Input, targetFilePath, new CopyProgressRoutine(this.CopyProgressHandler), IntPtr.Zero, ref pbCancel, CopyFileFlags.COPY_FILE_RESTARTABLE);\r
}\r
\r
- private bool doAlternateCopy(string targetFilePath) {\r
- CustomFileCopier copier = new CustomFileCopier(Input, targetFilePath);\r
+ private bool doAlternateCopy(string sourceFilePath, string targetFilePath) {\r
+ CustomFileCopier copier = new CustomFileCopier(sourceFilePath, targetFilePath);\r
copier.OnProgressChanged += Copier_OnProgressChanged;\r
copier.Copy();\r
Boolean result = true;\r
using NLog;\r
using RestSharp;\r
using RestSharp.Authenticators;\r
+using System.Collections.Generic;\r
using System.Diagnostics;\r
using System.Net;\r
\r
return null;\r
}\r
\r
+ public List<string> GetAllTags() {\r
+ var request = new RestRequest("tags", Method.GET);\r
+ var response = client.Execute(request);\r
+ if (response.StatusCode != HttpStatusCode.OK &&\r
+ !response.ErrorMessage.IsEmpty()) {\r
+ messageBus.Send(new MediaCubeMessage("Hiba a lekérdezésben. A rendszer üzenete: " + response.ErrorMessage));\r
+ return null;\r
+ }\r
+\r
+ if (!response.Content.IsEmpty() && response.Content != "[]") {\r
+ JArray media = JArray.Parse(response.Content);\r
+ if (media != null)\r
+ return media.Deserialize<List<string>>();\r
+ }\r
+ return null;\r
+ }\r
+\r
public void Item() {\r
var request = new RestRequest("item", Method.GET);\r
var response = client.Execute(request);\r
// Build Number\r
// Revision\r
//\r
-[assembly: AssemblyVersion("1.0.0.2")]\r
-[assembly: AssemblyFileVersion("1.0.0.2")]\r
+[assembly: AssemblyVersion("1.0.0.3")]\r
+[assembly: AssemblyFileVersion("1.0.0.3")]\r
<stringAttribute key="org.eclipse.jdt.launching.JRE_CONTAINER" value="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>\r
<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-os ${target.os} -ws ${target.ws} -arch ${target.arch} -nl ${target.nl} -consoleLog -console"/>\r
<stringAttribute key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER" value="org.eclipse.pde.ui.workbenchClasspathProvider"/>\r
-<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Djavax.ws.rs.ext.RuntimeDelegate=org.jboss.resteasy.spi.ResteasyProviderFactory -Dorg.eclipse.epp.logging.aeri.skipReports=true -Declipse.ignoreApp=true -Dosgi.noShutdown=true -Djobengine.jobsteps.root="${workspace_loc}/user.jobengine.executors/bin" -Djobengine.jobtemplates.root="${workspace_loc}/user.jobengine.executors/jobtemplates" -Djobengine.db.url=jdbc:db2://10.228.198.1:50000/mediaarc:retrieveMessagesFromServerOnGetMessage=true; -Djobengine.db.user=db2admin -Djobengine.db.password=password -Djobengine.loglevel=INFO -Dlog4j.configurationFile="${workspace_loc}/-configuration/log4j2.xml" -Djetty.home="${workspace_loc:}/-configuration/jetty" -Djetty.etc.config.urls=etc/user-jetty.xml,etc/user-jetty-ssl.xml,etc/user-jetty-ssl-context.xml,,etc/user-jetty-http.xml,etc/user-jetty-https.xml -Dorg.eclipse.jetty.webapp.basetempdir=c:\temp\jetty -Djava.io.tmpdir=c:\temp\jetty -Djobengine.octopus.api.address=http://10.10.1.11/api/v1 -Djobengine.octopus.api.user=mam -Djobengine.octopus.api.password=napocska -Djobengine.nosql.db.url=jdbc:db2://10.228.198.1:50000/mccache:retrieveMessagesFromServerOnGetMessage=true; -Djobengine.nosql.db.user=db2admin -Djobengine.nosql.db.password=password -Djobengine.nosql.db.schema=test -Djobengine.selenio.address=http://10.10.1.71:44000/TranscodeMgrWS?wsdl -Djobengine.selenio.projectfilepath=\\10.10.1.71\Data\Blueprints\MP4_H264_AAC.zenium -Djobengine.transcoder.address=http://10.11.1.111:65445/api/json/v1/ -Djobengine.transcoder.template=MP4 -Djobengine.transcoder.version=1 -Djobengine.jobscheduling.config="${workspace_loc}/-configuration/scheduledjobs.json" -Djobengine.nexio.db.url=jdbc:sqlserver://10.10.1.59:1433;databaseName=NXDB; -Djobengine.nexio.db.user=sa -Djobengine.nexio.db.password=resolve -Djobengine.planair.db.url=jdbc:sqlserver://10.11.254.86;databaseName=PA_Vivantis; -Djobengine.planair.db.user=MAM -Djobengine.planair.db.password=VDani -Dnexio.host=192.168.0.12 -Djobengine.nexio.name=testnexioclips -Dnexio.useMOSGateway=false -Dnexio.disable=true -Djobengine.octopus.rundowns.name=rundowns181026 -Djobengine.octopus.storyfolders.name=storyfolders181026 -Djobengine.octopus.stories.name=stories181026 -Djobengine.maestro.config="${workspace_loc}/-configuration/maestro.json" -Djobengine.mediacube.config="${workspace_loc}/-configuration/mediacube.json" -Dgui.statistics.disable=true -Dgui.help.disable=true -Dgui.editor.disable=true -Djobengine.mediafinder.external=false -Djobengine.mediacube.service.proxyroot="/opt" -Djobengine.scheduledexecution.disabled=false -Djobengine.randomize.archives=false -Djobengine.jobsteps.config="${workspace_loc}/user.jobengine.executors/config/config.xml" -Djobengine.jobsteps.groovy.root="${workspace_loc}/user.jobengine.executors/src/user/jobengine/server/steps" -Dgui.jobs.alternate.selector=true"/>\r
+<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Djavax.ws.rs.ext.RuntimeDelegate=org.jboss.resteasy.spi.ResteasyProviderFactory -Dorg.eclipse.epp.logging.aeri.skipReports=true -Declipse.ignoreApp=true -Dosgi.noShutdown=true -Djobengine.jobsteps.root="${workspace_loc}/user.jobengine.executors/bin" -Djobengine.jobtemplates.root="${workspace_loc}/user.jobengine.executors/jobtemplates" -Djobengine.db.url=jdbc:db2://10.228.198.1:50000/mc:retrieveMessagesFromServerOnGetMessage=true; -Djobengine.db.user=db2admin -Djobengine.db.password=password -Djobengine.loglevel=INFO -Dlog4j.configurationFile="${workspace_loc}/-configuration/log4j2.xml" -Djetty.home="${workspace_loc:}/-configuration/jetty" -Djetty.etc.config.urls=etc/user-jetty.xml,etc/user-jetty-ssl.xml,etc/user-jetty-ssl-context.xml,,etc/user-jetty-http.xml,etc/user-jetty-https.xml -Dorg.eclipse.jetty.webapp.basetempdir=c:\temp\jetty -Djava.io.tmpdir=c:\temp\jetty -Djobengine.octopus.api.address=http://10.10.1.11/api/v1 -Djobengine.octopus.api.user=mam -Djobengine.octopus.api.password=napocska -Djobengine.nosql.db.url=jdbc:db2://10.228.198.1:50000/mccache:retrieveMessagesFromServerOnGetMessage=true; -Djobengine.nosql.db.user=db2admin -Djobengine.nosql.db.password=password -Djobengine.nosql.db.schema=test -Djobengine.selenio.address=http://10.10.1.71:44000/TranscodeMgrWS?wsdl -Djobengine.selenio.projectfilepath=\\10.10.1.71\Data\Blueprints\MP4_H264_AAC.zenium -Djobengine.transcoder.address=http://10.11.1.111:65445/api/json/v1/ -Djobengine.transcoder.template=MP4 -Djobengine.transcoder.version=1 -Djobengine.jobscheduling.config="${workspace_loc}/-configuration/scheduledjobs.json" -Djobengine.nexio.db.url=jdbc:sqlserver://10.10.1.59:1433;databaseName=NXDB; -Djobengine.nexio.db.user=sa -Djobengine.nexio.db.password=resolve -Djobengine.planair.db.url=jdbc:sqlserver://10.11.254.86;databaseName=PA_Vivantis; -Djobengine.planair.db.user=MAM -Djobengine.planair.db.password=VDani -Dnexio.host=192.168.0.12 -Djobengine.nexio.name=testnexioclips -Dnexio.useMOSGateway=false -Dnexio.disable=true -Djobengine.octopus.rundowns.name=rundowns181026 -Djobengine.octopus.storyfolders.name=storyfolders181026 -Djobengine.octopus.stories.name=stories181026 -Djobengine.maestro.config="${workspace_loc}/-configuration/maestro.json" -Djobengine.mediacube.config="${workspace_loc}/-configuration/mediacube.json" -Dgui.statistics.disable=true -Dgui.help.disable=true -Dgui.editor.disable=true -Dgui.maestro.disable=true -Djobengine.mediafinder.external=false -Djobengine.mediacube.service.proxyroot="/opt" -Djobengine.scheduledexecution.disabled=false -Djobengine.randomize.archives=false -Djobengine.jobsteps.config="${workspace_loc}/user.jobengine.executors/config/config.xml" -Djobengine.jobsteps.groovy.root="${workspace_loc}/user.jobengine.executors/src/user/jobengine/server/steps" -Dgui.jobs.alternate.selector=true -Dmediacube.simplesearch=true"/>\r
<stringAttribute key="pde.version" value="3.3"/>\r
<booleanAttribute key="show_selected_only" value="false"/>\r
<stringAttribute key="target_bundles" value="cglib@default:default,com.fasterxml.jackson.core.jackson-annotations@default:default,com.fasterxml.jackson.core.jackson-core@default:default,com.fasterxml.jackson.core.jackson-databind@default:default,com.fasterxml.jackson.datatype.jackson-datatype-joda@default:default,com.fasterxml.jackson.jaxrs.jackson-jaxrs-base@default:default,com.fasterxml.jackson.jaxrs.jackson-jaxrs-json-provider@default:default,com.fasterxml.jackson.module.jackson-module-jaxb-annotations@default:default,com.ibm.db2.jcc@default:default,com.ibm.nosql@default:default,com.microsoft.sqlserver.sqljdbc@default:default,groovy@default:default,humble.video.noarch@default:default,humble.video.windows@default:default,javax.annotation-api@default:default,javax.mail@default:default,javax.servlet-api@default:default,javax.ws.rs-api@default:default,jcifs@default:default,joda-time@default:default,org.apache.aries.spifly.dynamic.bundle@default:default,org.apache.aries.util@default:default,org.apache.commons.beanutils@default:default,org.apache.commons.collections@default:default,org.apache.commons.digester@default:default,org.apache.commons.io@default:default,org.apache.commons.lang@default:default,org.apache.commons.logging@default:default,org.apache.commons.net@default:default,org.apache.felix.gogo.command@default:default,org.apache.felix.gogo.runtime@default:default,org.apache.felix.gogo.shell@default:default,org.apache.httpcomponents.httpclient@default:default,org.apache.httpcomponents.httpcore@default:default,org.apache.logging.log4j.api@1:true,org.apache.logging.log4j.core@default:default,org.apache.logging.log4j.slf4j-impl@default:default,org.apache.servicemix.bundles.quartz@default:default,org.eclipse.equinox.common@2:true,org.eclipse.equinox.console@default:default,org.eclipse.equinox.ds@1:true,org.eclipse.equinox.util@default:default,org.eclipse.jetty.deploy@default:default,org.eclipse.jetty.http@default:default,org.eclipse.jetty.io@default:default,org.eclipse.jetty.osgi.boot@default:true,org.eclipse.jetty.schemas@default:default,org.eclipse.jetty.security@default:default,org.eclipse.jetty.server@default:default,org.eclipse.jetty.servlet@default:default,org.eclipse.jetty.util@default:default,org.eclipse.jetty.webapp@default:default,org.eclipse.jetty.websocket.api@default:default,org.eclipse.jetty.websocket.client@default:default,org.eclipse.jetty.websocket.common@default:default,org.eclipse.jetty.websocket.server@default:default,org.eclipse.jetty.websocket.servlet@default:default,org.eclipse.jetty.xml@default:default,org.eclipse.osgi.services@default:default,org.eclipse.osgi@-1:true,org.hamcrest.core@default:default,org.jboss.resteasy.client@default:default,org.jboss.resteasy.jaxrs@default:default,org.jmock.junit4@default:default,org.jmock@default:default,org.junit@default:default,org.mybatis.mybatis@default:default,org.objectweb.asm.commons@default:default,org.objectweb.asm.tree@default:default,org.objectweb.asm@default:default,org.omnifaces@default:default,slf4j.api@default:default,slf4j.simple@default:false"/>\r
<?xml version="1.0" encoding="UTF-8" standalone="no"?>\r
-<?pde version="3.8"?><target name="JobEngine" sequenceNumber="313">\r
+<?pde version="3.8"?><target name="JobEngine" sequenceNumber="317">\r
<locations>\r
<location path="${eclipse_home}" type="Profile"/>\r
<location path="${workspace_loc}/-dependencies/target/repository/plugins" type="Directory"/>\r
<plugin id="humble.video.linux"/>\r
<plugin id="humble.video.noarch"/>\r
<plugin id="humble.video.windows"/>\r
+<plugin id="javax.annotation"/>\r
<plugin id="javax.annotation-api"/>\r
<plugin id="javax.inject"/>\r
<plugin id="javax.mail" version="1.5.0.b01"/>\r
<plugin id="com.ibm.nosql"/>\r
<plugin id="com.microsoft.sqlserver.sqljdbc"/>\r
<plugin id="commons-logging"/>\r
+ <plugin id="groovy"/>\r
<plugin id="humble.video.linux"/>\r
<plugin id="humble.video.noarch"/>\r
<plugin id="humble.video.windows"/>\r
import java.nio.file.Files;\r
import java.nio.file.Path;\r
import java.nio.file.Paths;\r
+import java.sql.Timestamp;\r
+import java.time.Duration;\r
+import java.time.Instant;\r
+import java.time.LocalDateTime;\r
+import java.time.ZoneOffset;\r
+import java.time.format.DateTimeFormatter;\r
+import java.time.temporal.ChronoUnit;\r
import java.util.ArrayList;\r
import java.util.Arrays;\r
import java.util.Collection;\r
\r
import user.jobengine.db.Media;\r
import user.jobengine.server.steps.EscortFiles;\r
+import user.jobengine.server.steps.FFMpeg;\r
import user.jobengine.server.steps.TSMExtendedRetrieveStep;\r
\r
public class SmallTests {\r
\r
Files.write(Paths.get("/opt/sql.txt"), out);\r
}\r
+\r
+ //ffmpeg hls\r
+ @Test\r
+ public void test99() throws Exception {\r
+ System.setProperty("jobengine.ffmpeg.location", "/Programs/ffmpeg/bin/ffmpeg.exe");\r
+ System.setProperty("java.library.path", System.getProperty("java.library.path") + ";/_workspace/USER/MediaCube/server/-dependencies/libs");\r
+ Path input = Paths.get("/_XDCAM/Sub/0410_1006_DEMO_mariagyud_mixS01.MXF");\r
+ Path output = Paths.get("/_XDCAM/out");\r
+\r
+ FFMpeg.hls_audio4ch(input.toAbsolutePath().toString(), output.toAbsolutePath().toString(), p -> {\r
+ System.out.println(p + "%");\r
+ });\r
+ }\r
+\r
+ //mc tsm tartalom osszehasonlitas\r
+ @Test\r
+ public void test990() throws Exception {\r
+ List<String> missing = new ArrayList<>();\r
+\r
+ //pasatol/lekerdezes\r
+ List<String> mcL = Files.readAllLines(Paths.get("/opt/AMC/mc.txt"));\r
+ //\r
+ List<String> tsmL = Files.readAllLines(Paths.get("/opt/AMC/tsm.txt"));\r
+ int count = 0;\r
+ for (String mc : mcL) {\r
+ if (!tsmL.contains(mc)) {\r
+ missing.add(mc);\r
+ System.out.println(mc);\r
+ count++;\r
+ }\r
+ }\r
+ System.out.println(count);\r
+\r
+ Files.write(Paths.get("/opt/AMC/missing.txt"), missing);\r
+ }\r
+\r
+ //tsm-missing pasa tartalom osszehasonlitas\r
+ @Test\r
+ public void test991() throws Exception {\r
+ List<String> mcmissing = new ArrayList<>();\r
+ List<String> missingL = Files.readAllLines(Paths.get("/opt/AMC/missing.txt"));\r
+ List<String> pasaL = Files.readAllLines(Paths.get("/opt/AMC/pasa.txt"));\r
+ for (String missing : missingL) {\r
+ if (pasaL.contains(missing))\r
+ System.out.println("PASA: " + missing);\r
+ else {\r
+ System.out.println("MC: " + missing);\r
+ mcmissing.add(missing);\r
+ }\r
+ }\r
+ Files.write(Paths.get("/opt/AMC/mcmissing.txt"), mcmissing);\r
+ }\r
+\r
+ //nexio modification change\r
+ @Test\r
+ public void test992() throws Exception {\r
+ Timestamp nexio = Timestamp.from(Instant.now().minus(2, ChronoUnit.HOURS));\r
+ LocalDateTime ldt = LocalDateTime.ofInstant(Instant.now(), ZoneOffset.systemDefault());\r
+ LocalDateTime ldn = LocalDateTime.ofInstant(Instant.now().minus(2, ChronoUnit.HOURS), ZoneOffset.systemDefault());\r
+ long modifiedHours = Duration.between(ldt, ldn).toHours();\r
+ System.out.println(modifiedHours);\r
+ System.out.println(DateTimeFormatter.ISO_LOCAL_DATE_TIME.format(ldt));\r
+ }\r
}\r
\r
private void updateMediaDescription(long itemId, long mediaId, long mediaFileId) {\r
// TODO Auto-generated method stub\r
- manager.executeUpdate(String.format("delete from MEDIADESCRIPTION where ITEMID=%d and MEDIAID=%d", itemId, mediaId), null);\r
+ manager.executeUpdate(String.format("delete from MEDIADESCRIPTION where ITEMID=%d and MEDIAID=%d", itemId, mediaId), null, null);\r
String sql = String.format("insert into mediadescription (itemid, mediaid, mediafileid, description) "\r
+ "select itemid, mediaid, mediafileid, fulldesc(itemid, mediaid, mediafileid) from vw_items " + "where mediafileid=%d", mediaFileId);\r
- manager.executeUpdate(sql, null);\r
+ manager.executeUpdate(sql, null, null);\r
\r
}\r
\r
<executors>\r
\r
<executor className="HarrisMissingMaterialCheckerStep.java" maxConcurrent="1" isRemote="false" />\r
- <executor className="CancelableStep.java" maxConcurrent="1" isRemote="false" />\r
+ <executor className="CancelableStep.java" maxConcurrent="1"/>\r
<executor className="FakeStep.java" maxConcurrent="20" isRemote="false" />\r
<executor className="MergeStep.java" maxConcurrent="20" isRemote="false" />\r
<executor className="TestForkCancelableStep.java" maxConcurrent="10" isRemote="false" />\r
package user.jobengine.server.steps;\r
\r
+import org.apache.commons.net.ftp.FTPClient;\r
import org.apache.logging.log4j.LogManager;\r
import org.apache.logging.log4j.Logger;\r
\r
-import com.fasterxml.jackson.databind.ObjectMapper;\r
-\r
-import user.commons.rest.ServiceObjectMapper;\r
+import user.commons.StoreUri;\r
+import user.commons.remotestore.FtpDirectoryLister;\r
+import user.commons.remotestore.RemoteStoreProtocol;\r
\r
public class CancelableStep extends JobStep {\r
private static final Logger logger = LogManager.getLogger();\r
int count = 10;\r
- private ObjectMapper mapper = ServiceObjectMapper.getMapper();\r
\r
@StepEntry\r
public Object[] execute(int param) throws Exception {\r
-\r
- // DownloadableArchive a = new DownloadableArchive();\r
- // Media media = getManager().createMedia("Generic", "Name", "description", "houseId");\r
- // a.setMedia(media);\r
- //\r
- // String m1 = mapper.writeValueAsString(media);\r
- // Media m2 = mapper.readValue(m1, Media.class);\r
- //\r
- // String prettyString = mapper.writeValueAsString(a);\r
- // DownloadableArchive b = mapper.readValue(prettyString, DownloadableArchive.class);\r
- // Media media2 = b.getMedia();\r
-\r
- // getJobRuntime().setDescription(String.valueOf(param));\r
-\r
try {\r
- //logger.info(new MediaCubeMarker("vasary@elgekko.net", "TESZT"), "Heloka");\r
- logger.error(getSessionMarker(), "Heloka");\r
+ // ftpTest();\r
+\r
for (int i = 0; i < count; i++) {\r
if (getJobRuntime().isWaitingCancel())\r
break;\r
Thread.sleep(500);\r
int progress = (i + 1) * 100 / count;\r
setProgress(progress);\r
- // if (i == 5)\r
- // throw new Exception("Test");\r
}\r
} catch (Exception e) {\r
e.printStackTrace();\r
throw e;\r
}\r
-\r
- // Path filePath = Paths.get("/mnt/ISILON/ARCHIVE_RESTORE/XXX/xxx-ARCH-209740793_2-207990326.MXF");\r
- // MediaInfo mi = new MediaInfo(filePath);\r
- // mi.process();\r
- // if (true)\r
- // throw new Exception("Frames. " + mi.getFrames());\r
return null;\r
}\r
\r
+ void ftpTest() throws Exception {\r
+ StoreUri source = null;\r
+ StoreUri target = null;\r
+ try {\r
+ source = getManager().getStoreUri("MEDIACUBE_UPLOADS", RemoteStoreProtocol.LOCAL);\r
+ target = getManager().getStoreUri("NEXIO1", RemoteStoreProtocol.FTP);\r
+ source.addProgressListener(e -> setProgress(e.getProgress()));\r
+ logger.info("Uploading file PART_TEST.mxf");\r
+ source.transferFrom(target, "PART_TEST.mxf", "PART_TEST.mxf");\r
+ FTPClient client = ((FtpDirectoryLister) target.getLister()).connect();\r
+ logger.info("Renaming file PART_TEST.mxf to RENAME_TEST.mxf");\r
+ client.rename("PART_TEST.mxf", "RENAME_TEST.mxf");\r
+ } catch (Exception e) {\r
+ logger.catching(e);\r
+ } finally {\r
+ if (target != null)\r
+ target.cleanUp();\r
+ if (source != null)\r
+ source.cleanUp();\r
+ }\r
+\r
+ }\r
+\r
}\r
--- /dev/null
+package user.jobengine.server.steps;\r
+\r
+import java.io.BufferedReader;\r
+import java.io.InputStreamReader;\r
+import java.util.ArrayList;\r
+import java.util.List;\r
+\r
+import org.apache.logging.log4j.LogManager;\r
+import org.apache.logging.log4j.Logger;\r
+\r
+public class Cmd {\r
+ interface IResponseCallback {\r
+ void onResponse(String line);\r
+ }\r
+\r
+ private static final Logger log = LogManager.getLogger();\r
+\r
+ public static ProcessBuilder create(String... args) {\r
+ List<String> chunks = new ArrayList<>();\r
+ for (String arg : args)\r
+ chunks.add(arg);\r
+\r
+ ProcessBuilder processBuilder = new ProcessBuilder();\r
+ processBuilder.command(chunks).redirectErrorStream(true);\r
+ return processBuilder;\r
+ }\r
+\r
+ public static ProcessBuilder create(String command, StringBuilder args) {\r
+ args.insert(0, command + "\r\n");\r
+ String[] chunks = args.toString().replace("\r\n", " ").split(" ");\r
+ return create(chunks);\r
+ }\r
+\r
+ public static String execute(ProcessBuilder processBuilder) {\r
+ return execute(processBuilder, true);\r
+ }\r
+\r
+ public static String execute(ProcessBuilder processBuilder, boolean firstResponse) {\r
+ return execute(processBuilder, firstResponse, null);\r
+ }\r
+\r
+ public static String execute(ProcessBuilder processBuilder, boolean firstResponse, IResponseCallback responseCallBack) {\r
+ String result = null;\r
+ try {\r
+ log.debug("Executing : {}", processBuilder.command().toString().replace("[", "").replace("]", "").replace(",", ""));\r
+ Process process = processBuilder.start();\r
+\r
+ try (BufferedReader reader = new BufferedReader(new InputStreamReader(process.getInputStream()))) {\r
+ String line = null;\r
+ while ((line = reader.readLine()) != null) {\r
+ log.debug("Process response: {}", line);\r
+ if (responseCallBack != null)\r
+ responseCallBack.onResponse(line);\r
+ //System.out.println(line);\r
+ if (line != null && line.length() > 0) {\r
+ result = line;\r
+ if (firstResponse)\r
+ break;\r
+ }\r
+ }\r
+ int exitCode = process.waitFor();\r
+ if (exitCode != 0)\r
+ log.error("Exited with error code : " + exitCode);\r
+ } catch (Exception e) {\r
+ throw e;\r
+ }\r
+ } catch (Exception e) {\r
+ log.error(e);\r
+ }\r
+\r
+ return result;\r
+ }\r
+\r
+ public static String getFFMpegExecutable() {\r
+ return System.getProperty("jobengine.ffmpeg.location");\r
+ }\r
+\r
+}\r
--- /dev/null
+package user.jobengine.server.steps;\r
+\r
+import java.io.FileNotFoundException;\r
+import java.nio.file.Files;\r
+import java.nio.file.Paths;\r
+import java.util.ArrayList;\r
+import java.util.List;\r
+\r
+import org.apache.commons.lang.StringUtils;\r
+import org.apache.logging.log4j.LogManager;\r
+import org.apache.logging.log4j.Logger;\r
+\r
+import user.commons.mediatool.MediaInfo;\r
+\r
+public class FFMpeg {\r
+ public interface IProgressChanged {\r
+ void onProgressChanged(long progress);\r
+ }\r
+\r
+ private static final String FPS = "fps=";\r
+ private static final String FRAME = "frame=";\r
+\r
+ private static final Logger logger = LogManager.getLogger();\r
+\r
+ //@formatter:off\r
+ public static void concatenate(String chunklist, String output) {\r
+ ProcessBuilder processBuilder = Cmd.create(\r
+ Cmd.getFFMpegExecutable(),\r
+ "-f", "concat",\r
+ "-safe", "0",\r
+ "-i", chunklist,\r
+ "-vcodec", "copy", "-acodec", "libmp3lame",\r
+ "-y", "-v", "error", "-stats", output);\r
+\r
+ Cmd.execute(processBuilder, false);\r
+ }\r
+\r
+ //@formatter:off\r
+ public static void encode(String input, String output, double from, double length) {\r
+ ProcessBuilder processBuilder = Cmd.create(\r
+ Cmd.getFFMpegExecutable(),\r
+ "-ss", String.valueOf(from),\r
+ "-t", String.valueOf(length),\r
+ "-i", input,\r
+ "-vcodec", "libx264", "-acodec", "ac3",\r
+ "-movflags", "+faststart",\r
+ "-vf", "scale=-2:480,format=yuv420p",\r
+ "-y", "-v", "error", "-stats", "-f", "mp4", output);\r
+\r
+ Cmd.execute(processBuilder, false);\r
+ }\r
+\r
+ //@formatter:off\r
+ static public void hls_audio4ch(String input, String output, IProgressChanged progressCallback) throws Exception {\r
+ StringBuilder sb = new StringBuilder();\r
+ sb.append("-v panic -stats -y")\r
+ .append("\r\n")\r
+ .append(String.format("-i %s", input))\r
+ .append("\r\n")\r
+ .append("-map 0:0 -c:v h264 -an -hls_time 100000000000 -hls_list_size 0")\r
+ .append("\r\n")\r
+ .append(String.format("-f hls %s/video.m3u8", output))\r
+ .append("\r\n");\r
+\r
+ for (int i = 0; i < 4; i++) {\r
+ sb.append(String.format("-map 0:%d -f segment -segment_time 100000000000 -segment_list_size 0", i+1))\r
+ .append("\r\n")\r
+ .append(String.format("-segment_list %s/audio%d.m3u8 -segment_format mpegts %s/audio%d%%d.aac", output, i, output, i))\r
+ .append("\r\n");\r
+ }\r
+ System.out.println(sb);\r
+ ProcessBuilder processBuilder = Cmd.create(Cmd.getFFMpegExecutable(), sb);\r
+ long allFrames[] = {0};\r
+\r
+ try {\r
+ MediaInfo mi = new MediaInfo(Paths.get(input));\r
+ mi.process();\r
+ allFrames[0] = mi.getFrames();\r
+ } catch (Exception e ){\r
+ System.err.println(e);\r
+\r
+ }\r
+\r
+ Cmd.execute(processBuilder, false, l -> {\r
+ if (allFrames[0] == 0) {\r
+ logger.debug(l);\r
+ System.out.println(l);\r
+ return;\r
+ }\r
+\r
+ if (progressCallback == null)\r
+ return;\r
+ if (l.contains(FRAME) && l.contains(FPS)) {\r
+ String p = StringUtils.substringBetween(l, FRAME, FPS);\r
+ if (p != null) {\r
+ p = p.trim();\r
+ try {\r
+ int currentFrames = Integer.parseInt(p);\r
+ progressCallback.onProgressChanged((long)currentFrames * 100 / allFrames[0]);\r
+ } catch (Exception e){}\r
+ }\r
+ }\r
+ });\r
+\r
+// #EXTM3U\r
+// #EXT-X-MEDIA:TYPE=AUDIO,GROUP-ID="audio",NAME="CH1",URI="audio0.m3u8"\r
+// #EXT-X-MEDIA:TYPE=AUDIO,GROUP-ID="audio",NAME="CH2",URI="audio1.m3u8"\r
+// #EXT-X-MEDIA:TYPE=AUDIO,GROUP-ID="audio",NAME="CH3",URI="audio2.m3u8"\r
+// #EXT-X-MEDIA:TYPE=AUDIO,GROUP-ID="audio",NAME="CH4",URI="audio3.m3u8"\r
+// #EXT-X-STREAM-INF:PROGRAM-ID=1,AUDIO="audio"\r
+// video.m3u8\r
+\r
+ if (!Paths.get(output, "video.m3u8").toFile().exists())\r
+ throw new FileNotFoundException("video.m3u8");\r
+ if (!Paths.get(output, "video0.ts").toFile().exists())\r
+ throw new FileNotFoundException("video0.ts");\r
+ for (int i = 0; i < 4; i++) {\r
+ String file = String.format("audio%d.m3u8", i);\r
+ if (!Paths.get(output, file).toFile().exists())\r
+ throw new FileNotFoundException(file);\r
+ file = String.format("audio%d0.aac", i);\r
+ if (!Paths.get(output, file).toFile().exists())\r
+ throw new FileNotFoundException(file);\r
+ }\r
+\r
+ List<String> indexLines = new ArrayList<>();\r
+ indexLines.add("#EXTM3U");\r
+ for (int i = 0; i < 4; i++) {\r
+ indexLines.add(String.format("#EXT-X-MEDIA:TYPE=AUDIO,GROUP-ID=\"audio\",NAME=\"CH%d\",URI=\"audio%d.m3u8\"", i+1, i));\r
+ }\r
+ indexLines.add("#EXT-X-STREAM-INF:PROGRAM-ID=1,AUDIO=\"audio\"");\r
+ indexLines.add("video.m3u8");\r
+\r
+ Files.write(Paths.get(output, "index.m3u8"), indexLines);\r
+ }\r
+}\r
Message msg = new ParameterizedMessage("Validációs hiba miatt a {} fájl másolása nem lehetséges.", filePath.getFileName());\r
EscortFiles.notifyRecipient(Paths.get(escortFile), logger, msg);\r
\r
- EscortFiles.remove(filePath);\r
- EscortFiles.remove(Paths.get(escortFile));\r
+ //200924 komment, mert a mar TSM-bol letoltott mozikat hagyjuk ott, a download irany ugyis felulir\r
+ //EscortFiles.remove(filePath);\r
+ //EscortFiles.remove(Paths.get(escortFile));\r
+\r
//200911 a kommentet kivettem, mert ezeket is torolni kell\r
EscortFiles.remove(Paths.get(escortFile + EscortFiles.DOT_CATCHED));\r
throw new Exception("Length mismatch in " + filePath + ". Expected: " + expectedFrameNumber + ", found: " + frames);\r
import java.util.List;\r
import java.util.Map;\r
\r
+import org.apache.commons.lang.StringUtils;\r
import org.apache.logging.log4j.LogManager;\r
import org.apache.logging.log4j.Logger;\r
\r
private String getTSMFileName(long mediaId, StoreUri sourceStoreUri) {\r
String result = null;\r
Media media = getManager().getMedia(mediaId);\r
- List<MediaFile> mediaFiles = media.getMediaFiles();\r
- for (MediaFile mediaFile : mediaFiles) {\r
- if (mediaFile.getStoreId() == sourceStoreUri.getStoreId()) {\r
- result = mediaFile.getRelativePath();\r
- break;\r
+\r
+ if (media != null) {\r
+ List<MediaFile> mediaFiles = media.getMediaFiles();\r
+ for (MediaFile mediaFile : mediaFiles) {\r
+ if (mediaFile.getStoreId() == sourceStoreUri.getStoreId()) {\r
+ result = mediaFile.getRelativePath();\r
+ break;\r
+ }\r
}\r
}\r
+\r
return result;\r
}\r
\r
}\r
\r
StoreUri sourceStoreUri = getManager().getStoreUri("TSM", RemoteStoreProtocol.TSM);\r
+\r
+ long mediaId = downloadable.getLong("mediaId");\r
+ String tsmFileName = getTSMFileName(mediaId, sourceStoreUri);\r
+ if (StringUtils.isBlank(tsmFileName)) {\r
+ logger.error(getMarker(), "Media ID not exists anymore {}", mediaId);\r
+ return false;\r
+ }\r
+\r
StoreUri targetStoreUri = getManager().getStoreUri(downloadable.getLong("targetStoreUriId"));\r
\r
Store targetStore = getManager().getStore(targetStoreUri.getStoreId());\r
template = targetStore.getName() + "-" + template;\r
logger.info(getMarker(), "Starting {} for {}", template, escortFileName);\r
\r
- String tsmFileName = getTSMFileName(downloadable.getLong("mediaId"), sourceStoreUri);\r
String targetFileName = downloadable.getString("fileName");\r
\r
Map<String, Object> parameters = new HashMap<>();\r
--- /dev/null
+package user.jobengine.server.steps;\r
+\r
+import java.nio.file.Path;\r
+import java.nio.file.Paths;\r
+\r
+import org.apache.logging.log4j.LogManager;\r
+import org.apache.logging.log4j.Logger;\r
+import org.apache.logging.log4j.Marker;\r
+\r
+import user.commons.StoreUri;\r
+import user.commons.remotestore.RemoteStoreProtocol;\r
+import user.jobengine.db.Media;\r
+import user.jobengine.db.MediaFile;\r
+import user.jobengine.db.Store;\r
+\r
+public class HLSProxyStep extends JobStep {\r
+ private static final Logger logger = LogManager.getLogger();\r
+ private static final String LOWRES_FILETYPE = "Low-res";\r
+ private Marker marker;\r
+\r
+ @StepEntry\r
+ public Object[] execute(ArchiveItem archiveItem, Media mediaCubeMedia) throws Exception {\r
+ marker = getSessionMarker();\r
+\r
+ Path sourceFilePath = Paths.get(archiveItem.getMediaFile());\r
+ try {\r
+ String fileName = sourceFilePath.getFileName().toString();\r
+ String proxyName = fileName.substring(0, fileName.lastIndexOf(".")) + "S01" + fileName.substring(fileName.lastIndexOf("."));\r
+ Path lowresSourcePath = Paths.get(sourceFilePath.getParent().toString(), EscortFiles.STATUSFOLDER, proxyName);\r
+ if (!lowresSourcePath.toFile().exists())\r
+ throw new Exception("File not exists: " + lowresSourcePath);\r
+\r
+ Store lowresStore = getManager().getCurrentLowresStore();\r
+ StoreUri lowresStoreUri = lowresStore.getTargetStoreUri(RemoteStoreProtocol.LOCAL);\r
+ String webPath = lowresStoreUri.toString(true);\r
+\r
+ Path subdirPath = null;\r
+ if (proxyName.indexOf(".") > 2) {\r
+ subdirPath = Paths.get(proxyName.substring(0, 1), proxyName.substring(1, 2), proxyName.substring(2, 3), proxyName);\r
+ } else {\r
+ subdirPath = Paths.get(proxyName);\r
+ }\r
+\r
+ String subDir = subdirPath.toString();\r
+ Path lowresTargetPath = Paths.get(webPath, subDir);\r
+\r
+ int version = 1;\r
+ while (lowresTargetPath.toFile().exists()) {\r
+ subDir = subDir + version;\r
+ lowresTargetPath = Paths.get(webPath, subDir);\r
+ version++;\r
+ }\r
+\r
+ EscortFiles.ensureUNCFolder(webPath, subDir);\r
+ lowresTargetPath = Paths.get(webPath, subDir);\r
+ //Files.move(lowresSourcePath, lowresTargetPath);\r
+\r
+ FFMpeg.hls_audio4ch(lowresSourcePath.toAbsolutePath().toString(), lowresTargetPath.toAbsolutePath().toString(), p -> {\r
+ setProgress((int) p);\r
+ });\r
+\r
+ Path lowresHTTPPath = Paths.get(subDir, "index.m3u8");\r
+ MediaFile mediaFile = getManager().createMediaFile(lowresHTTPPath.toString(), LOWRES_FILETYPE, lowresStore.getName());\r
+ mediaFile.setMediaId(mediaCubeMedia.getId());\r
+ getManager().add(mediaFile);\r
+ } catch (Exception e) {\r
+ logger.catching(e);\r
+ logger.error(marker, "A HLS proxy létrehozása sikertelen a '{}' fájlból. A rendszer üzenete: {}", sourceFilePath, e.getMessage());\r
+ }\r
+ return null;\r
+ }\r
+\r
+}\r
break;\r
}\r
\r
- boolean contains = fileNames.contains(record.getFileName());\r
+ boolean contains = fileNames.contains(record.getFileName() + ".lxf");\r
if (contains)\r
logger.info(getMarker(), "File {} already exists on {}", record.getFileName(), targetStoreName);\r
else\r
package user.jobengine.server.steps;\r
\r
+import java.io.File;\r
import java.nio.file.Path;\r
import java.nio.file.Paths;\r
import java.sql.Timestamp;\r
mediaId = tryGetMediaId(title, mediaId);\r
}\r
\r
- //TODO ha van mediaId, akkor update!!!!!!!!!\r
+ long fileSize = 0;\r
+ try {\r
+ Path filePath = Paths.get(escortFilePath.getParent().toString(), fileName);\r
+ File file = filePath.toFile();\r
+ if (file.exists())\r
+ fileSize = file.length();\r
+ } catch (Exception e) {\r
+ logger.error(getMarker(), e.getMessage());\r
+ }\r
+\r
+ Timestamp modified = downloadable.getTimestamp("modified");\r
+ Timestamp created = downloadable.getTimestamp("created");\r
+ long frames = downloadable.getLong("frames");\r
\r
if (mediaId == 0) {\r
String targetStoreName = getManager().getStore(targetStoreUri.getStoreId()).getName();\r
//TODO megoldani egy tranzakcioban\r
item.add();\r
media.setItemId(item.getId());\r
- media.setLength(downloadable.getLong("frames"));\r
- media.setArchived(Timestamp.from(Instant.now()));\r
- Timestamp modified = downloadable.getTimestamp("modified");\r
- Timestamp created = downloadable.getTimestamp("created");\r
- media.setModified(Timestamp.from(Instant.now()));\r
+ media.setLength(frames);\r
media.setCreated(created);\r
+ media.setModified(modified);\r
+ media.setArchived(Timestamp.from(Instant.now()));\r
media.add();\r
+\r
+ //TODO\r
mediaFile.setMediaId(media.getId());\r
mediaFile.setLastModified(modified);\r
- //TODO\r
- //mediaFile.setFileSize(fileSize);\r
+ mediaFile.setFileSize(fileSize);\r
mediaFile.add();\r
} else {\r
Media media = manager.getMedia(mediaId);\r
- Timestamp modified = downloadable.getTimestamp("modified");\r
- Timestamp created = downloadable.getTimestamp("created");\r
- media.setModified(Timestamp.from(Instant.now()));\r
+ media.setLength(frames);\r
media.setCreated(created);\r
+ media.setModified(modified);\r
+ media.setArchived(Timestamp.from(Instant.now()));\r
manager.modify(media);\r
- MediaFile mediaFile = manager.getSystemMediaFile(media);\r
+\r
//TODO\r
- //mediaFile.setFileSize(fileSize);\r
+ MediaFile mediaFile = manager.getSystemMediaFile(media);\r
+ mediaFile.setRelativePath(fileName);\r
mediaFile.setLastModified(modified);\r
+ mediaFile.setFileSize(fileSize);\r
manager.modify(mediaFile);\r
}\r
\r
package user.jobengine.server.steps;\r
\r
+import java.util.Arrays;\r
+import java.util.List;\r
+\r
+import org.apache.commons.net.ftp.FTPClient;\r
import org.apache.logging.log4j.LogManager;\r
import org.apache.logging.log4j.Logger;\r
\r
-import user.commons.RemoteFile;\r
import user.commons.StoreUri;\r
+import user.commons.remotestore.FtpDirectoryLister;\r
\r
public class NEXIO1TransferToStep extends TransferStep {\r
private static final Logger logger = LogManager.getLogger();\r
@Override\r
@StepEntry\r
public Object[] execute(StoreUri sourceStoreUri, String sourceFileName, StoreUri targetStoreUri, String targetFileName) throws Exception {\r
+ //\r
+ // try {\r
+ // String title = targetFileName;\r
+ // if (title.contains("."))\r
+ // title = title.substring(0, title.lastIndexOf("."));\r
+ // RemoteFile remoteFile = targetStoreUri.getFileWithContent(title + ".xml");\r
+ // if (remoteFile != null && remoteFile.getContent() != null) {\r
+ // logger.info("File already exists on NEXIO1 {}", targetFileName);\r
+ // return null;\r
+ // }\r
+ // } catch (Exception e) {\r
+ // logger.error(e.getMessage());\r
+ // } finally {\r
+ // targetStoreUri.cleanUp();\r
+ // }\r
\r
try {\r
- String title = targetFileName;\r
- if (title.contains("."))\r
- title = title.substring(0, title.lastIndexOf("."));\r
- RemoteFile remoteFile = targetStoreUri.getFileWithContent(title + ".xml");\r
- if (remoteFile != null && remoteFile.getContent() != null) {\r
- logger.info("File already exists on NEXIO1 {}", targetFileName);\r
+ FTPClient client = ((FtpDirectoryLister) targetStoreUri.getLister()).connect();\r
+ logger.info(getMarker(), "Reading target file list");\r
+ List<String> fileNames = Arrays.asList(client.listNames());\r
+ logger.info(getMarker(), "Target file list reading completed, mediabase size is {}", fileNames.size());\r
+ String title = targetFileName.replace(".mxf", ".lxf");\r
+ boolean contains = fileNames.contains(title);\r
+ if (contains) {\r
+ logger.info(getMarker(), "File already exists {} on {}", title, getManager().getStore(targetStoreUri.getStoreId()).getName());\r
return null;\r
}\r
} catch (Exception e) {\r
- logger.error(e.getMessage());\r
+ logger.catching(e);\r
} finally {\r
targetStoreUri.cleanUp();\r
}\r
package user.jobengine.server.steps;\r
\r
+import java.util.Arrays;\r
+import java.util.List;\r
+\r
+import org.apache.commons.net.ftp.FTPClient;\r
import org.apache.logging.log4j.LogManager;\r
import org.apache.logging.log4j.Logger;\r
\r
-import user.commons.RemoteFile;\r
import user.commons.StoreUri;\r
+import user.commons.remotestore.FtpDirectoryLister;\r
\r
public class NEXIO2TransferToStep extends TransferStep {\r
private static final Logger logger = LogManager.getLogger();\r
@Override\r
@StepEntry\r
public Object[] execute(StoreUri sourceStoreUri, String sourceFileName, StoreUri targetStoreUri, String targetFileName) throws Exception {\r
+ // try {\r
+ // String title = targetFileName;\r
+ // if (title.contains("."))\r
+ // title = title.substring(0, title.lastIndexOf("."));\r
+ // RemoteFile remoteFile = targetStoreUri.getFileWithContent(title + ".xml");\r
+ // if (remoteFile != null && remoteFile.getContent() != null) {\r
+ // logger.info("File already exists on NEXIO2 {}", targetFileName);\r
+ // return null;\r
+ // }\r
+ // } catch (Exception e) {\r
+ // logger.error(e.getMessage());\r
+ // } finally {\r
+ // targetStoreUri.cleanUp();\r
+ // }\r
try {\r
- String title = targetFileName;\r
- if (title.contains("."))\r
- title = title.substring(0, title.lastIndexOf("."));\r
- RemoteFile remoteFile = targetStoreUri.getFileWithContent(title + ".xml");\r
- if (remoteFile != null && remoteFile.getContent() != null) {\r
- logger.info("File already exists on NEXIO2 {}", targetFileName);\r
+ FTPClient client = ((FtpDirectoryLister) targetStoreUri.getLister()).connect();\r
+ logger.info(getMarker(), "Reading target file list");\r
+ List<String> fileNames = Arrays.asList(client.listNames());\r
+ logger.info(getMarker(), "Target file list reading completed, mediabase size is {}", fileNames.size());\r
+ String title = targetFileName.replace(".mxf", ".lxf");\r
+ boolean contains = fileNames.contains(title);\r
+ if (contains) {\r
+ logger.info(getMarker(), "File already exists {} on {}", title, getManager().getStore(targetStoreUri.getStoreId()).getName());\r
return null;\r
}\r
} catch (Exception e) {\r
- logger.error(e.getMessage());\r
+ logger.catching(e);\r
} finally {\r
targetStoreUri.cleanUp();\r
}\r
import java.text.SimpleDateFormat;\r
import java.time.Duration;\r
import java.time.Instant;\r
+import java.util.Date;\r
import java.util.Iterator;\r
\r
import org.apache.logging.log4j.LogManager;\r
return false;\r
}\r
\r
- //utolso modositas a mosthoz kepest\r
- //The result of this method can be a negative period if the end is before the start.\r
- long modifiedHours = Duration.between(modified.toInstant(), Instant.now()).toHours();\r
- if (modifiedHours < 0) {\r
- logger.info(getMarker(), "{} modification time greather than now", title);\r
- return false;\r
- }\r
- if (modifiedHours < lastModifiedHours) {\r
- logger.debug(getMarker(), "{} modification time is too cloose for now", title);\r
+ if (!checkModifiedByTime(title, modified, lastModifiedHours))\r
return false;\r
- }\r
\r
//utolso modositas\r
MediaFile mediaFile = getManager().getSystemMediaFile(media);\r
return false;\r
}\r
\r
+ private boolean checkModifiedByTime(String title, Timestamp modified, int lastModifiedHours) {\r
+ //utolso modositas a mosthoz kepest\r
+ //The result of this method can be a negative period if the end is before the start.\r
+\r
+ long modifiedHours = Duration.between(modified.toInstant(), Instant.now()).toHours();\r
+ if (modifiedHours < 0) {\r
+ logger.info(getMarker(), "{} modification time greather than now", title);\r
+ return false;\r
+ }\r
+ if (modifiedHours < lastModifiedHours) {\r
+ logger.debug(getMarker(), "{} modification time is too cloose for now", title);\r
+ return false;\r
+ }\r
+\r
+ logger.info(getMarker(), "Found modified media {} with NEXIO timestamp {}", title, df.format(new Date(modified.getTime())));\r
+\r
+ return true;\r
+ }\r
+\r
@StepEntry\r
public Object[] execute(String sourceStoreName, String escortStoreName, int lastModifiedHours) throws Exception {\r
Controller controller = null;\r
\r
long mediaId = 0;\r
if (media == null) {\r
- createEscort = true;\r
- logger.info(getMarker(), "{} not archived yet", title);\r
+ if (checkModifiedByTime(title, modified, lastModifiedHours)) {\r
+ createEscort = true;\r
+ logger.info(getMarker(), "{} not archived yet", title);\r
+ }\r
} else {\r
mediaId = media.getId();\r
createEscort = check(modified, created, frames, media, videoFormat, lastModifiedHours);\r
continue;\r
}\r
\r
- if (poolContent.contains(mediaName))\r
+ if (poolContent.contains(mediaName)) {\r
+ logger.info("Pool already contains {}", mediaName);\r
continue;\r
+ }\r
\r
String usageTime = getAttribute(mediaNode, "earliestUsageTime");\r
putEarliest(result, mediaName, usageTime);\r
continue;\r
}\r
\r
- if (poolContent.contains(mediaName))\r
+ if (poolContent.contains(mediaName)) {\r
+ logger.info("Pool already contains {}", mediaName);\r
continue;\r
+ }\r
\r
Node usageChild = mediaNode.getFirstChild();\r
if (usageChild == null) {\r
// private static final String CHILD_TEMPLATE = "fake-concurrent.xml";\r
private static final String CHILD_TEMPLATE = "cancelable.xml";\r
private static final Logger logger = LogManager.getLogger();\r
- int count = 5;\r
+ int count = 20;\r
\r
@StepEntry\r
public Object[] execute(IJobEngine jobEngine, IJobRuntime jobRuntime) throws Exception {\r
this.filePath = filePath;\r
}\r
\r
+ public int getAudioStreams() {\r
+ return audioStreams;\r
+ }\r
+\r
public int getBitRate() {\r
return bitRate;\r
}\r
\r
+ public String getColorSpace() {\r
+ return colorSpace;\r
+ }\r
+\r
public long getFrames() {\r
return frames;\r
}\r
\r
+ public int getVideoStreams() {\r
+ return videoStreams;\r
+ }\r
+\r
public void process() throws InterruptedException, IOException {\r
- final Demuxer demuxer = Demuxer.make();\r
+ Demuxer demuxer = null;\r
try {\r
+ demuxer = Demuxer.make();\r
demuxer.open(filePath.toString(), null, false, true, null, null);\r
\r
bitRate = demuxer.getBitRate();\r
}\r
if (videoStreamId == -1)\r
throw new RuntimeException("Could not find video stream in " + filePath);\r
-\r
+ } catch (UnsatisfiedLinkError e) {\r
+ logger.catching(e);\r
} catch (Exception e) {\r
logger.catching(e);\r
throw e;\r
} finally {\r
try {\r
- demuxer.close();\r
+ if (demuxer != null)\r
+ demuxer.close();\r
} catch (Exception e) {\r
logger.catching(e);\r
throw e;\r
}\r
}\r
\r
- public String getColorSpace() {\r
- return colorSpace;\r
- }\r
-\r
- public int getAudioStreams() {\r
- return audioStreams;\r
- }\r
-\r
- public int getVideoStreams() {\r
- return videoStreams;\r
- }\r
-\r
}\r
\r
public class TSMLister implements IDirectoryLister {\r
\r
+ private static final String DELIMITER = "/";\r
private static final String NODENAME = System.getProperty("tsm.nodename", "JOBENGINE");\r
private static final String FSNAME = System.getProperty("tsm.fsname", "JOBENGINE");\r
private static final String ALTERNATE_FSNAME = System.getProperty("tsm.fsname.alternate", "JOBENGINE");\r
\r
String currentFileName = fileName;\r
logger.info("Getting {}, {}, {}", FSNAME, HLNAME, currentFileName);\r
- TSMBackupFileObject backupFileObject = client.getActiveBackupFileObject(FSNAME, "\\", "\\" + currentFileName);\r
+ TSMBackupFileObject backupFileObject = client.getActiveBackupFileObject(FSNAME, DELIMITER, DELIMITER + currentFileName);\r
\r
//probaljuk meg a masik tarbol\r
if (backupFileObject == null) {\r
logger.info("Getting {}, {}, {}", ALTERNATE_FSNAME, HLNAME, currentFileName);\r
- backupFileObject = client.getActiveBackupFileObject(ALTERNATE_FSNAME, "\\", "\\" + currentFileName);\r
+ backupFileObject = client.getActiveBackupFileObject(ALTERNATE_FSNAME, DELIMITER, DELIMITER + currentFileName);\r
}\r
\r
//probaljuk meg kiterjesztes nelkul is\r
// } catch (Exception e) {\r
// logger.info(e.getMessage());\r
// }\r
- TSMOutputStream outputStream = new TSMOutputStream(client, FSNAME, "\\", remoteFile);\r
+ TSMOutputStream outputStream = new TSMOutputStream(client, FSNAME, DELIMITER, remoteFile);\r
outputStream.open();\r
return outputStream;\r
}\r
private boolean initialized;\r
private long sizeEstimate;\r
\r
+ //highLevelName == delimiter\r
public TSMOutputStream(TSMBufferedClient client, String filespaceName, String highLevelName, RemoteFile remoteFile) {\r
this.client = client;\r
this.filespaceName = filespaceName;\r
}\r
\r
public void open() throws TSMException, FileNotFoundException {\r
- backupObject = new TSMBackupFileObject(filespaceName, highLevelName, "\\" + fileName);\r
+ backupObject = new TSMBackupFileObject(filespaceName, highLevelName, highLevelName + fileName);\r
backupObject.setSizeEstimate(sizeEstimate);\r
}\r
\r
ALTER TABLE MEDIAFILE ADD COLUMN FILESIZE BIGINT default 0
@
-CALL SYSPROC.ADMIN_CMD ( 'REORG TABLE DB2ADMIN.MEDIAFILE' )
-@
+--CALL SYSPROC.ADMIN_CMD ( 'REORG TABLE DB2ADMIN.MEDIAFILE' )
+--@
-- //@UNDO
-- SQL to undo the change goes here.
ALTER TABLE MEDIAFILE DROP COLUMN FILESIZE
@
-CALL SYSPROC.ADMIN_CMD ( 'REORG TABLE DB2ADMIN.MEDIAFILE' )
-@
+--CALL SYSPROC.ADMIN_CMD ( 'REORG TABLE DB2ADMIN.MEDIAFILE' )
+--@
ALTER TABLE MEDIAFILE ADD COLUMN LASTMODIFIED TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL
@
-CALL SYSPROC.ADMIN_CMD('REORG TABLE DB2ADMIN.MEDIAFILE')
-@
+--CALL SYSPROC.ADMIN_CMD('REORG TABLE DB2ADMIN.MEDIAFILE')
+--@
-- //@UNDO
-- SQL to undo the change goes here.
ALTER TABLE MEDIAFILE DROP COLUMN LASTMODIFIED
@
-CALL SYSPROC.ADMIN_CMD('REORG TABLE DB2ADMIN.MEDIAFILE')
-@
+--CALL SYSPROC.ADMIN_CMD('REORG TABLE DB2ADMIN.MEDIAFILE')
+--@
-- limitations under the License.
--
--- // Alter JOB table, add RELATED column
+-- // Create TAG TAG2MEDIA tables
-- Migration SQL that makes the change goes here.
-ALTER TABLE JOB ADD COLUMN RELATED VARCHAR(255)
+CREATE TABLE TAG
+(
+ ID BIGINT GENERATED ALWAYS AS IDENTITY (START WITH 1) PRIMARY KEY,
+ NAME VARCHAR(40) NOT NULL
+)@
+
+CREATE UNIQUE INDEX UDX_TAG_NAME ON TAG ("NAME")
+@
+
+CREATE TABLE MEDIATAGS
+(
+ MEDIAID BIGINT NOT NULL,
+ TAGID BIGINT NOT NULL
+)@
+
+CREATE UNIQUE INDEX UDX_MEDIATAG ON MEDIATAGS (MEDIAID, TAGID)
@
-CREATE INDEX IDX_JOB_RELATED ON JOB ("RELATED")
+ALTER TABLE MEDIATAGS
+ ADD CONSTRAINT FK_MEDIATAGS_MEDIAID
+ FOREIGN KEY(MEDIAID)
+ REFERENCES MEDIA(ID)
+ ON DELETE CASCADE
+ ON UPDATE NO ACTION
@
-CALL SYSPROC.ADMIN_CMD('REORG TABLE DB2ADMIN.JOB')
+ALTER TABLE MEDIATAGS
+ ADD CONSTRAINT FK_MEDIATAGS_TAGID
+ FOREIGN KEY(TAGID)
+ REFERENCES TAG(ID)
+ ON DELETE CASCADE
+ ON UPDATE NO ACTION
@
-- //@UNDO
-- SQL to undo the change goes here.
-DROP INDEX IDX_JOB_RELATED
+DROP TABLE TAG
@
-ALTER TABLE JOB DROP COLUMN RELATED
-@
-
-CALL SYSPROC.ADMIN_CMD('REORG TABLE DB2ADMIN.JOB')
-@
+DROP TABLE MEDIATAGS
+@
\ No newline at end of file
-- limitations under the License.
--
--- // Add LOOKUP function for use dynamic like from sqlj
+-- // Create TAG TAG2MEDIA tables
-- Migration SQL that makes the change goes here.
-CREATE OR REPLACE FUNCTION LOOKUP(col VARCHAR(255), search VARCHAR(255))
- RETURNS int
- RETURN
-SELECT LOCATE(search, LOWER(col)) FROM SYSIBM.SYSDUMMY1
+ALTER TABLE MEDIAFILE
+ ALTER COLUMN LASTMODIFIED
+ DROP NOT NULL
@
-- //@UNDO
-- SQL to undo the change goes here.
-DROP FUNCTION LOOKUP
+ALTER TABLE MEDIAFILE
+ ALTER COLUMN LASTMODIFIED
+ SET NOT NULL
@
package user.jobengine.db;\r
\r
import java.io.Serializable;\r
+import java.util.ArrayList;\r
+import java.util.List;\r
\r
public class ArchivedMedia implements Serializable {\r
private static final long serialVersionUID = 1L;\r
private String relevant;\r
private Float tcIn;\r
private Float tcOut;\r
+ private List<String> tags;\r
\r
public Item getItem() {\r
return item;\r
return relevant;\r
}\r
\r
+ public List<String> getTags() {\r
+ if (tags == null)\r
+ tags = new ArrayList<>();\r
+ return tags;\r
+ }\r
+\r
public Float getTcIn() {\r
return this.tcIn;\r
}\r
this.relevant = relevant;\r
}\r
\r
+ public void setTags(List<String> tags) {\r
+ this.tags = tags;\r
+ }\r
+\r
public void setTcIn(Float tcIn) {\r
this.tcIn = tcIn;\r
}\r
import java.util.Calendar;\r
import java.util.Date;\r
import java.util.List;\r
+import java.util.TreeMap;\r
\r
import com.ibm.nosql.json.api.BasicDBObject;\r
\r
*\r
*/\r
public interface IItemManager extends IEntityPersister {\r
+ void addMediaTag(long tagId, long mediaId);\r
+\r
+ long addMediaTag(String tagText, long mediaId);\r
+\r
+ long addTag(String tagText);\r
+\r
/**\r
* Létrehoz egy új adatbázis kapcsolatot.\r
*/\r
\r
void executeQuery(String query, IResultSetConsumer consumer, IStatementDecorator decorator);\r
\r
- int executeUpdate(Connection connection, String query, IStatementDecorator decorator);\r
+ int executeUpdate(Connection connection, String query, IStatementDecorator decorator, IResultSetConsumer keysConsumer);\r
+\r
+ // long getExistingRundownMedia(String houseid);\r
\r
- void executeUpdate(String query, IStatementDecorator decorator);\r
+ void executeUpdate(String query, IStatementDecorator decorator, IResultSetConsumer keysConsumer);\r
\r
/**\r
* A type paraméterből lekéri az entitás DAO objektumát, amin keresztül visszakapjuk az összes entitást.\r
*/\r
List<IEntityBase> getAll(Class<? extends IEntityBase> type, long id);\r
\r
- // long getExistingRundownMedia(String houseid);\r
-\r
/**\r
* Visszaadja egy átmeneti tárolóban tárolt entitás listáját.\r
*\r
*/\r
List<IEntityBase> getAllCached(Class<? extends IEntityBase> baseClass);\r
\r
+ TreeMap<String, Long> getAllTags();\r
+\r
/**\r
* Visszaadja az entitásnak megfelelő DAO objektumot.\r
*\r
\r
Media getMedia(String title);\r
\r
+ List<String> getMediaTags(long mediaId);\r
+\r
/**\r
* Azonosító alapján elkér egy Metaadat elem objektumot.\r
*\r
*/\r
void removeCached(Class<? extends IEntityBase> baseClass, Object key);\r
\r
+ void removeMediaTag(long tagId, long mediaId);\r
+\r
/**\r
* A bemeneti paraméterként kapott típus és kulcs alapján elkéri a megfelelő objektumot az átmeneti tárolóból.\r
*\r
import java.util.Hashtable;\r
import java.util.List;\r
import java.util.Map;\r
+import java.util.TreeMap;\r
import java.util.stream.Collectors;\r
\r
import org.apache.commons.io.FileSystemUtils;\r
traceOut();\r
}\r
\r
+ @Override\r
+ public void addMediaTag(long tagId, long mediaId) {\r
+ String query = "INSERT INTO MEDIATAGS (tagId, mediaId) VALUES (?, ?)";\r
+ executeUpdate(query, p -> {\r
+ p.setLong(1, tagId);\r
+ p.setLong(2, mediaId);\r
+ }, null);\r
+ }\r
+\r
+ @Override\r
+ public long addMediaTag(String tagText, long mediaId) {\r
+ long tagId = getTagId(tagText);\r
+ if (tagId == 0)\r
+ tagId = addTag(tagText);\r
+ addMediaTag(tagId, mediaId);\r
+ return tagId;\r
+ }\r
+\r
+ @Override\r
+ public long addTag(String tagText) {\r
+ long result[] = { 0 };\r
+ String query = "INSERT INTO TAG (name) VALUES (?)";\r
+ executeUpdate(query, p -> {\r
+ p.setString(1, tagText);\r
+ }, r -> {\r
+ long id = r.getLong(1);\r
+ result[0] = id;\r
+ return false;\r
+ });\r
+\r
+ return result[0];\r
+ }\r
+\r
public synchronized void bindSignalServerService(SignalServer service) {\r
try {\r
initializeItemManager(service);\r
while (rs.next()) {\r
\r
if (!consumer.process(rs)) {\r
- // ha nem megyunk vevig pool exception a tranzakcio miatt\r
+ // ha nem megyunk vegig pool exception a tranzakcio miatt\r
connection.rollback();\r
break;\r
}\r
}\r
\r
@Override\r
- public int executeUpdate(Connection connection, String query, IStatementDecorator decorator) {\r
+ public int executeUpdate(Connection connection, String query, IStatementDecorator decorator, IResultSetConsumer keysConsumer) {\r
int result = -1;\r
PreparedStatement st = null;\r
+ ResultSet rs = null;\r
try {\r
- st = connection.prepareStatement(query);\r
+ st = connection.prepareStatement(query, Statement.RETURN_GENERATED_KEYS);\r
if (decorator != null)\r
decorator.decorate(st);\r
result = st.executeUpdate();\r
connection.commit();\r
+ if (keysConsumer != null) {\r
+ rs = st.getGeneratedKeys();\r
+ while (rs.next()) {\r
+ if (!keysConsumer.process(rs)) {\r
+ // ha nem megyunk vegig pool exception a tranzakcio miatt ???\r
+ connection.rollback();\r
+ break;\r
+ }\r
+ }\r
+ }\r
+\r
} catch (Exception e) {\r
logger.catching(e);\r
try {\r
} catch (Exception e1) {\r
}\r
} finally {\r
+ try {\r
+ if (rs != null)\r
+ rs.close();\r
+ } catch (Exception e1) {\r
+ }\r
try {\r
if (st != null)\r
st.close();\r
}\r
\r
@Override\r
- public void executeUpdate(String query, IStatementDecorator decorator) {\r
+ public void executeUpdate(String query, IStatementDecorator decorator, IResultSetConsumer keysConsumer) {\r
DefaultContext context = getDbContext();\r
Connection connection = null;\r
try {\r
connection = context.getConnection();\r
- executeUpdate(connection, query, decorator);\r
+ executeUpdate(connection, query, decorator, keysConsumer);\r
} catch (Exception e) {\r
} finally {\r
putDbContext(context);\r
return result;\r
}\r
\r
+ //a map miatt az ID-k elerhetoek\r
+ @Override\r
+ public TreeMap<String, Long> getAllTags() {\r
+ TreeMap<String, Long> result = new TreeMap<>();\r
+ String query = "SELECT id, name FROM TAG ORDER BY name";\r
+ executeQuery(query, r -> {\r
+ long id = r.getLong("id");\r
+ String name = r.getString("name");\r
+ result.put(name, id);\r
+ return true;\r
+ }, null);\r
+ return result;\r
+ }\r
+\r
@Override\r
public IEntityBaseDAO getBaseDAO(Class<? extends IEntityBase> classInfo) {\r
IEntityBaseDAO entityBaseDb = null;\r
return result;\r
}\r
\r
- @Override\r
- public DefaultContext getDbContext() {\r
- DefaultContext context = null;\r
- if (contextPool != null)\r
- context = contextPool.borrowObject();\r
- return context;\r
- }\r
-\r
// @Override\r
// public long getExistingRundownMedia(String houseid) {\r
// final long[] result = { 0 };\r
// return result[0];\r
// }\r
\r
+ @Override\r
+ public DefaultContext getDbContext() {\r
+ DefaultContext context = null;\r
+ if (contextPool != null)\r
+ context = contextPool.borrowObject();\r
+ return context;\r
+ }\r
+\r
@Override\r
public List<ItemType> getDynamicItemTypes() {\r
List<ItemType> result = new ArrayList<ItemType>();\r
});\r
}\r
\r
+ @Override\r
+ public List<String> getMediaTags(long mediaId) {\r
+ List<String> result = new ArrayList<>();\r
+ long id[] = { mediaId };\r
+ String query = "SELECT t.name FROM TAG t, MEDIATAGS mt WHERE mt.tagid=t.id AND mt.mediaId=? ORDER BY name";\r
+ executeQuery(query, r -> {\r
+ String name = r.getString("name");\r
+ result.add(name);\r
+ return true;\r
+ }, p -> {\r
+ p.setLong(1, id[0]);\r
+ });\r
+ return result;\r
+ }\r
+\r
@Override\r
public MetadataElement getMetadataElement(long id) {\r
return (MetadataElement) get(MetadataElement.class, id);\r
return result;\r
}\r
\r
+ public long getTagId(String tagText) {\r
+ long result[] = { 0 };\r
+ String query = "SELECT id FROM TAG WHERE name=?";\r
+ executeQuery(query, r -> {\r
+ long id = r.getLong("id");\r
+ result[0] = id;\r
+ return true;\r
+ }, p -> {\r
+ p.setString(1, tagText);\r
+ });\r
+ return result[0];\r
+ }\r
+\r
@SuppressWarnings("unchecked")\r
@Override\r
public List<Store> getTargetStores() {\r
traceOut();\r
}\r
\r
+ @Override\r
+ public void removeMediaTag(long tagId, long mediaId) {\r
+ String query = "DELETE FROM MEDIATAGS WHERE tagId = ? AND mediaId = ?";\r
+ executeUpdate(query, p -> {\r
+ p.setLong(1, tagId);\r
+ p.setLong(2, mediaId);\r
+ }, null);\r
+ }\r
+\r
@Override\r
public SearchResult<ArchivedMedia> search(SearchOptions options) {\r
traceIn();\r
import java.util.List;\r
\r
public class SearchOptions {\r
- final private String text;\r
- final private List<String> filters;\r
- final private Date searchFrom;\r
- final private Date searchTo;\r
- final private int descLength;\r
- final private String orderBy;\r
- final private boolean orderAscending;\r
- final private boolean missingProxy;\r
+ static public SearchOptions create() {\r
+ return new SearchOptions();\r
+ }\r
+\r
+ private String text;\r
+ private List<Long> types;\r
+ private List<Long> tags;\r
+ private Date from;\r
+ private Date to;\r
+ private int descLength;\r
+ private String orderBy;\r
+ private boolean orderAscending;\r
+ private boolean missingProxy;\r
private long mediaId;\r
private int fromResult;\r
+\r
private int toResult;\r
\r
- public SearchOptions(String text, List<String> filters, Date searchFrom, Date searchTo, boolean missingProxy, int descLength, String orderBy,\r
- boolean orderAscending) {\r
- this.text = text;\r
- this.filters = filters;\r
- this.searchFrom = searchFrom;\r
- this.searchTo = searchTo;\r
- this.missingProxy = missingProxy;\r
- this.descLength = descLength;\r
- this.orderBy = orderBy;\r
- this.orderAscending = orderAscending;\r
+ public StringBuilder getCriteriaForTag() {\r
+ StringBuilder result = null;\r
+ if (tags != null && tags.size() > 0) {\r
+ result = new StringBuilder();\r
+ for (Long tagId : tags) {\r
+ if (result.length() > 0)\r
+ result.append(",");\r
+ result.append(tagId);\r
+ }\r
+ result.insert(0, "(");\r
+ result.append(")");\r
+ }\r
+ return result;\r
+ }\r
+\r
+ public StringBuilder getCriteriaForType() {\r
+ StringBuilder result = null;\r
+ if (types != null && types.size() > 0) {\r
+ result = new StringBuilder();\r
+ for (Long typeId : types) {\r
+ if (result.length() > 0)\r
+ result.append(",");\r
+ result.append(typeId);\r
+ }\r
+ result.insert(0, "(");\r
+ result.append(")");\r
+ }\r
+ return result;\r
+ }\r
+\r
+ public int getDescLength() {\r
+ return descLength;\r
}\r
\r
- public List<String> getFilters() {\r
- return filters;\r
+ public Date getFrom() {\r
+ return from;\r
}\r
\r
public int getFromResult() {\r
return orderBy;\r
}\r
\r
- public Date getSearchFrom() {\r
- return searchFrom;\r
- }\r
-\r
- public Date getSearchTo() {\r
- return searchTo;\r
+ public List<Long> getTags() {\r
+ return tags;\r
}\r
\r
public String getText() {\r
return text;\r
}\r
\r
+ public Date getTo() {\r
+ return to;\r
+ }\r
+\r
public int getToResult() {\r
return toResult;\r
}\r
\r
+ public List<Long> getTypes() {\r
+ return types;\r
+ }\r
+\r
public boolean isMissingProxy() {\r
return missingProxy;\r
}\r
return orderAscending;\r
}\r
\r
- public void setFromResult(int fromResult) {\r
+ public boolean isValid() {\r
+ if (text != null && text.trim().length() > 2)\r
+ return true;\r
+\r
+ if (from != null || to != null)\r
+ return true;\r
+\r
+ if (missingProxy)\r
+ return true;\r
+\r
+ if (types != null && types.size() > 0)\r
+ return true;\r
+\r
+ if (tags != null && tags.size() > 0)\r
+ return true;\r
+\r
+ return false;\r
+ }\r
+\r
+ public SearchOptions setDescLength(int descLength) {\r
+ this.descLength = descLength;\r
+ return this;\r
+ }\r
+\r
+ public SearchOptions setFrom(Date from) {\r
+ this.from = from;\r
+ return this;\r
+ }\r
+\r
+ public SearchOptions setFromResult(int fromResult) {\r
this.fromResult = fromResult;\r
+ return this;\r
}\r
\r
- public void setMediaId(long mediaId) {\r
+ public SearchOptions setMediaId(long mediaId) {\r
this.mediaId = mediaId;\r
+ return this;\r
+ }\r
+\r
+ public SearchOptions setMissingProxy(boolean missingProxy) {\r
+ this.missingProxy = missingProxy;\r
+ return this;\r
+ }\r
+\r
+ public SearchOptions setOrder(String orderBy, boolean orderAscending) {\r
+ this.orderBy = orderBy;\r
+ this.orderAscending = orderAscending;\r
+ return this;\r
+ }\r
+\r
+ public SearchOptions setTags(List<Long> tags) {\r
+ this.tags = tags;\r
+ return this;\r
+ }\r
+\r
+ public SearchOptions setText(String text) {\r
+ this.text = text;\r
+ return this;\r
+ }\r
+\r
+ public SearchOptions setTo(Date to) {\r
+ this.to = to;\r
+ return this;\r
}\r
\r
- public void setToResult(int toResult) {\r
+ public SearchOptions setToResult(int toResult) {\r
this.toResult = toResult;\r
+ return this;\r
}\r
\r
- public int getDescLength() {\r
- return descLength;\r
+ public SearchOptions setTypes(List<Long> types) {\r
+ this.types = types;\r
+ return this;\r
}\r
\r
}\r
this.manager = manager;\r
}\r
\r
- private PreparedStatement createStatement(Connection connection, String criteria, List<String> typeIDs, SearchOptions options) throws Exception {\r
- StringBuilder typeCriteria = getTypeCriterias(typeIDs);\r
+ private PreparedStatement createStatement(Connection connection, String criteria, SearchOptions options) throws Exception {\r
String criteriasPattern = getCriteriasRegexPattern(criteria);\r
\r
StringBuilder sql = new StringBuilder();\r
sql.append("m.length,");\r
sql.append("m.itemtypeid mediaitemtypeid,");\r
sql.append(String.format("HIGHLIGHT(md.description, '<span class=''rhl''>', '</span>', '%s') description,", criteriasPattern));\r
- // sql.append("'blabla' description,");\r
sql.append("it.name mediaitemtypename,");\r
sql.append("m.houseid mediahouseid,");\r
sql.append("mf.houseid mediafilehouseid,");\r
sql.append(" FROM ITEM i, MEDIA m, MEDIAFILE mf, MEDIADESCRIPTION md, VW_MEDIAFILES vw_mf, ITEMTYPE it");\r
sql.append(" WHERE i.id = md.itemid AND m.id = md.mediaid AND mf.id = md.mediafileid");\r
sql.append(" AND m.id=vw_mf.mediaid AND m.itemTypeId = it.id");\r
- if (typeIDs != null) {\r
+\r
+ StringBuilder criteriaForType = options.getCriteriaForType();\r
+ if (criteriaForType != null) {\r
sql.append(" AND m.itemtypeid IN ");\r
- sql.append(typeCriteria.toString());\r
+ sql.append(criteriaForType.toString());\r
+ }\r
+\r
+ StringBuilder criteriaForTag = options.getCriteriaForTag();\r
+ if (criteriaForTag != null) {\r
+ sql.append(" AND m.id IN (SELECT mediaid FROM MEDIATAGS WHERE tagid IN ");\r
+ sql.append(criteriaForTag.toString());\r
+ sql.append(" )");\r
}\r
\r
if (simpleSearch) {\r
sql.append(" AND CONTAINS(md.description, '" + criteria + "') >= 1");\r
}\r
\r
- if (options.getSearchFrom() != null)\r
- sql.append(String.format(" AND m.archived > '%s'", df.format(options.getSearchFrom())));\r
+ if (options.getFrom() != null)\r
+ sql.append(String.format(" AND m.archived > '%s'", df.format(options.getFrom())));\r
\r
- if (options.getSearchTo() != null)\r
- sql.append(String.format(" AND m.archived < '%s'", df.format(options.getSearchTo())));\r
+ if (options.getTo() != null)\r
+ sql.append(String.format(" AND m.archived < '%s'", df.format(options.getTo())));\r
\r
if (options.isMissingProxy())\r
sql.append(" AND vw_mf.mediafilecount=1");\r
return sb.toString();\r
}\r
\r
- private StringBuilder getTypeCriterias(List<String> typeIDs) {\r
- StringBuilder typeCriteria = new StringBuilder();\r
- if (typeIDs != null) {\r
- typeCriteria.append("(");\r
- for (int i = 0; i < typeIDs.size(); i++) {\r
- typeCriteria.append(typeIDs.get(i));\r
- if (i < typeIDs.size() - 1)\r
- typeCriteria.append(",");\r
- }\r
- typeCriteria.append(")");\r
- }\r
- return typeCriteria;\r
- }\r
-\r
- private List<String> getTypeIDs(List<String> searchFilters) {\r
- List<String> result = null;\r
- if (searchFilters != null) {\r
- for (String typeName : searchFilters) {\r
- ItemType itemType = manager.getItemType(typeName);\r
- if (itemType == null)\r
- continue;\r
- if (result == null)\r
- result = new ArrayList<>();\r
- result.add(String.valueOf(itemType.getId()));\r
- }\r
- }\r
- return result;\r
- }\r
-\r
@Override\r
public SearchResult<ArchivedMedia> search(SearchOptions options) {\r
SearchResult<ArchivedMedia> result = new SearchResult<>();\r
\r
- List<String> typeIDs = getTypeIDs(options.getFilters());\r
-\r
ResultSet rs = null;\r
PreparedStatement st = null;\r
DefaultContext context = manager.getDbContext();\r
Connection connection = context.getConnection();\r
try {\r
- st = createStatement(connection, options.getText(), typeIDs, options);\r
+ st = createStatement(connection, options.getText(), options);\r
rs = st.executeQuery();\r
rs.last();\r
result.setItemCount(rs.getRow());\r
return result;\r
}\r
\r
- // private void setRelevant(String[] criterias, ArchivedMedia am, String content) {\r
- // if (content == null)\r
- // return;\r
- // for (String c : criterias) {\r
- // if (c != null && c.length() > 2) {\r
- //\r
- // int pos = content.toLowerCase().indexOf(c.toLowerCase());\r
- // if (pos > -1) {\r
- // int start = 0;\r
- // if (pos > 100)\r
- // start = pos - 100;\r
- // else\r
- // start = 0;\r
- // int end = pos + 200;\r
- // if (end > content.length() - 1)\r
- // end = content.length() - 1;\r
- //\r
- // String relevant = content.substring(start, pos) + "<span class='rhl'>" + content.substring(pos, pos + c.length()) + "</span>"\r
- // + content.substring(pos + c.length(), end);\r
- //\r
- // if (start > 0)\r
- // relevant = "..." + relevant;\r
- // if (end < content.length() - 1)\r
- // relevant = relevant + "...";\r
- //\r
- // am.setRelevant(relevant);\r
- // break;\r
- // }\r
- //\r
- // }\r
- // }\r
- // }\r
}\r
preload : "auto"\r
});\r
\r
-function setSource(src) {\r
+function setSource(src, srcType) {\r
console.log("setSource", player, src);\r
if (src != null) {\r
player.src({\r
- type : 'video/mp4',\r
+ type : srcType,\r
src : src\r
});\r
} else {\r
\r
/* Címke kezelés */ \r
\r
-var input = document.querySelector('textarea[name=tags2]'), tagify = new Tagify(\r
- input, \r
- {\r
- enforceWhitelist : false,\r
- keepInvalidTags : true,\r
- callbacks : {\r
- add : onTag, // callback when adding a tag\r
- remove : onTag\r
- // callback when removing a tag\r
- }\r
- }\r
-);\r
+var mediaTagify = new Tagify(document.querySelector('textarea[name=mediaTags]'), {\r
+ enforceWhitelist : false,\r
+ keepInvalidTags : true,\r
+ callbacks : {\r
+ add : onTag,\r
+ remove : onTag\r
+ }\r
+});\r
+\r
+var filterTagify = new Tagify(document.querySelector('textarea[name=filterTags]'), {\r
+ enforceWhitelist : true,\r
+ keepInvalidTags : false,\r
+ settings : {\r
+ readOnly: true\r
+ },\r
+ callbacks : {\r
+ add : onFilterTag,\r
+ remove : onFilterTag\r
+ }\r
+});\r
\r
-function addTags(tags, current) {\r
- // console.log("Adding tags", tagify, input);\r
- tagify.settings.whitelist = tags;\r
- tagify.addTags(current);\r
+function addAllTags(tags) {\r
+ console.log("Adding all tags", tags);\r
+ filterTagify.settings.whitelist = tags;\r
+ mediaTagify.settings.whitelist = tags;\r
}\r
\r
+function addMediaTags(tags) {\r
+ console.log("Clear selected tags");\r
+ mediaTagify.removeAllTags();\r
+ console.log("Adding selected tags", tags);\r
+ mediaTagify.addTags(tags);\r
+}\r
+\r
+\r
function onTag(e) {\r
- console.log("onTag", e);\r
- zk.Widget.$('$listenerDiv').fire('onChange', e, {\r
+// console.log("onTag", e);\r
+ \r
+ zk.Widget.$('$tagListener').fire('onChange',{\r
+ source: 'media',\r
+ type : e.type,\r
+ tagtext: e.detail.data.value,\r
+ index: e.detail.index\r
+ },{\r
toServer : true\r
});\r
}\r
\r
-function addTags(tags, current) {\r
-}
\ No newline at end of file
+function onFilterTag(e) {\r
+ zk.Widget.$('$tagListener').fire('onChange',{\r
+ source: 'filter',\r
+ type : e.type,\r
+ tagtext: e.detail.data.value,\r
+ index: e.detail.index\r
+ },{\r
+ toServer : true\r
+ });\r
+}\r
<div height="100%" width="100%">\r
<groupbox height="94%" closable="false">\r
<caption sclass="boldfont" label="Aktív folyamatok" />\r
- <listbox id="lbJobList" sizedByContent="false" span="false" model="@load(jlm.jobList)" multiple="true" pagingPosition="top" autopaging="true" mold="paging"\r
+ <listbox id="jobsListBox" sizedByContent="false" span="false" model="@load(jlm.jobList)" multiple="true" pagingPosition="top" autopaging="true" mold="paging"\r
vflex="true" checkmark="true" style="border: none; background: #e3e3e3 !important;" oddRowSclass="listbox-odd-style" sclass="listbox-normal-style"\r
emptyMessage="Nincs futó folyamat" onSelect="@command('onSelect')" >\r
<listhead sizable="true">\r
document.selection.empty();\r
}\r
}\r
+ \r
</script>\r
\r
<!-- csak igy jo a list sebessege -->\r
\r
<div id="scdiv" width="100%" height="100%" apply="org.zkoss.bind.BindComposer" viewModel="@id('vm') @init('user.jobengine.zk.model.SearchModel')">\r
<timer id="timer" delay="1" repeats="false" onTimer="@command('uiTick')" />\r
+ <div id="tagListener" onChange="@command('onTagChanged')" />\r
\r
<borderlayout width="100%" height="100%">\r
- <west border="none" flex="true" size="60%" splittable="true" minsize="500" onSize="@command('onWestResize', west=self)">\r
+ <west id="searchWest" border="none" flex="true" size="60%" splittable="true" minsize="500" onSize="@command('onWestResize', west=self)">\r
<div height="100%" width="100%">\r
\r
<search-filters />\r
<label multiline="true" value="@load(vm.selectedObject.media.description)" />\r
</div>\r
</div>\r
+ \r
<div>\r
- <h:textarea name='tags2' placeholder='Címkék'></h:textarea>\r
- <div id="listenerDiv" onChange="@command('onTag')" />\r
-\r
+ <h:textarea name='mediaTags' placeholder='Címkék'></h:textarea>\r
</div>\r
</div>\r
</div>\r
-<zk xmlns:w="http://www.zkoss.org/2005/zk/client" xmlns:c="client" height="100%" width="100%">\r
+<zk xmlns:w="http://www.zkoss.org/2005/zk/client" xmlns:h="xhtml" xmlns:c="client" height="100%" width="100%">\r
<menupopup id="searchSettings">\r
<menuitem label="10 találat oldalanként" value="10" checked="true" onClick="@command('setPageSize', source=self)" />\r
<menuitem label="25 találat oldalanként" value="25" checked="true" onClick="@command('setPageSize', source=self)" />\r
<menuseparator />\r
<menuitem label="Törlés" value="300" onClick="@command('setCalendar', source=self)" />\r
</menupopup>\r
+\r
+ <toolbar width="100%" style="background: transparent">\r
+ <h:textarea name='filterTags' placeholder='Címkék'></h:textarea>\r
+ </toolbar>\r
<toolbar id="tb" width="100%" style="background: transparent">\r
<toolbarbutton iconSclass="z-icon-caret-down" mode="toggle">\r
<attribute name="onCheck">\r
</combobox>\r
<toolbarbutton iconSclass="z-icon-search" label="Keresés" onClick="@command('doSearch')" />\r
</toolbar>\r
-\r
+ \r
<panel id="serachDetails" title="" border="none" open="false" collapsible="true">\r
<panelchildren>\r
<vbox width="100%">\r
<caption label="Egyéb" />\r
<checkbox label="Hiányzó proxy" checked="@bind(vm.missingProxy)"/>\r
</groupbox>\r
+ <groupbox>\r
+ </groupbox>\r
</vbox>\r
</panelchildren>\r
</panel>\r
emptyMessage="Nincs találat!" pageSize="50" onAfterRender="@command('onAfterRenderGrid')" style="border: none; background: white !important;"\r
oddRowSclass="listbox-odd-style">\r
<attribute name="onAfterRender">\r
- Clients.evalJavaScript("clearSelection();");\r
- </attribute>\r
+ Clients.evalJavaScript("clearSelection();");\r
+ </attribute>\r
<columns id="orderColumns">\r
<column hflex="min">\r
<checkbox checked="@bind(vm.rowsExpanded)" />\r
<checkbox checked="@save(vm.itemSelected) @validator(vm.itemSelectedValidator, arg=each)" />\r
<label value="@load(each.media.houseId)" />\r
<label value="@load(each.media.title)" />\r
- <label value="@load(each.media.mediaFilesName)" />\r
+ <label value="@load(each.media.mediaFileRealName)" />\r
<label style="font-size: 10px;" value="@load(each.media.archived) @converter('user.jobengine.zk.model.ShortDateConverter')" />\r
<cell>\r
<vlayout>\r
} else {
Class<? extends Object> parameterValueType = value.getClass();
if (!ClassUtils.isAssignable(parameterValueType, requiredType, true) && !isRuntimeAssignable(parameterValueType, requiredType))
- throw new RuntimeException(
- String.format("Got unassignable parameter value type (%s) for parameter %s (%s).", parameterValueType, name, requiredType));
+ throw new RuntimeException(String.format("Got unassignable parameter value type (%s) for parameter %s (%s).", parameterValueType, name,
+ requiredType));
}
}
private Semaphore forkSempahore;
private IJobChangedListener jobChangedListener;
private List<Long> childrenIDs;
-
+
* */
@Override
this.currentStep = currentStep;
}
- @Override
- public void setDescription(String description) {
- super.setDescription(description);
- }
-
@Override
public void setId(long id) {
super.setId(id);
logger.error("Missing system property: 'jobengine.jobscheduling.config'");\r
return;\r
}\r
- logger.error("Loading scheduler configuration file: {}", configPath);\r
+ logger.info("Loading scheduler configuration file: {}", configPath);\r
File schedulingConfigFile = new File(configPath);\r
if (schedulingConfigFile.exists()) {\r
String jsonConfig = new String(Files.readAllBytes(Paths.get(schedulingConfigFile.getAbsolutePath())));\r
import org.zkoss.zk.ui.select.Selectors;\r
import org.zkoss.zk.ui.select.annotation.Wire;\r
import org.zkoss.zul.ListModelList;\r
+import org.zkoss.zul.Listbox;\r
import org.zkoss.zul.Messagebox;\r
import org.zkoss.zul.Window;\r
\r
private List<JobStatus> searchStatuses;\r
@Wire\r
Charts chart;\r
+ @Wire\r
+ Listbox jobsListBox;\r
\r
@AfterCompose\r
public void afterCompose(@ContextParam(ContextType.VIEW) Component view) {\r
Selectors.wireComponents(view, this, false);\r
- Options options = new Options();\r
-\r
- options.getGlobal().setUseUTC(false);\r
- chart.setHeight(150);\r
- chart.setOptions(options);\r
- chart.setAnimation(false);\r
-\r
- chart.getXAxis().setType("datetime");\r
- chart.getXAxis().setTickPixelInterval(150);\r
-\r
- chart.getYAxis().setTitle("Darab");\r
- PlotLine plotLine = new PlotLine();\r
- plotLine.setValue(0);\r
- plotLine.setWidth(1);\r
- plotLine.setColor("#808080");\r
- chart.getYAxis().setMin(0);\r
- chart.getYAxis().addPlotLine(plotLine);\r
-\r
- chart.getTooltip().setHeaderFormat("<b>{series.name}</b><br/>");\r
- chart.getTooltip().setPointFormat("{point.x:%Y-%m-%d %H:%M:%S}<br>{point.y}");\r
-\r
- chart.getLegend().setEnabled(false);\r
- chart.getExporting().setEnabled(false);\r
-\r
- Series series = chart.getSeries();\r
- series.setName("Feladatok");\r
- //updateJobsChart();\r
-\r
- int size = jobList.size();\r
- for (int i = -19; i <= 0; i++) {\r
- Point point = new Point(Calendar.getInstance().getTimeInMillis() + i * 1000, size);\r
- series.addPoint(point);\r
- }\r
+ configureJobsCountChart();\r
+ jobsListBox.getPagingChild().setAutohide(false);\r
}\r
\r
@Command\r
\r
}\r
\r
+ private void configureJobsCountChart() {\r
+ Options options = new Options();\r
+\r
+ options.getGlobal().setUseUTC(false);\r
+ //chart.getPlotOptions().\r
+\r
+ chart.setHeight(100);\r
+ chart.setOptions(options);\r
+ chart.setAnimation(false);\r
+\r
+ chart.getXAxis().setType("datetime");\r
+ chart.getXAxis().setTickPixelInterval(80);\r
+ chart.getXAxis().getLabels().setStyle("fontSize: 8px;");\r
+ chart.getXAxis().getLabels().setFormat("{value: %H:%m}");\r
+ chart.getYAxis().setTitle("Darab");\r
+ PlotLine plotLine = new PlotLine();\r
+ plotLine.setValue(0);\r
+ plotLine.setWidth(1);\r
+ plotLine.setColor("#808080");\r
+ chart.getYAxis().setMin(0);\r
+ chart.getYAxis().addPlotLine(plotLine);\r
+\r
+ chart.getTooltip().setHeaderFormat("<b>{series.name}</b><br/>");\r
+ chart.getTooltip().setPointFormat("{point.x:%Y-%m-%d %H:%M:%S}<br>{point.y}");\r
+\r
+ chart.getLegend().setEnabled(false);\r
+ chart.getExporting().setEnabled(false);\r
+\r
+ Series series = chart.getSeries();\r
+ series.setName("Feladatok");\r
+ //updateJobsChart();\r
+\r
+ int size = jobList.size();\r
+ for (int i = -19; i <= 0; i++) {\r
+ Point point = new Point(Calendar.getInstance().getTimeInMillis() + i * 1000, size);\r
+ series.addPoint(point);\r
+ }\r
+ }\r
+\r
+ @Command\r
+ public void copyRelated(@BindingParam("related") String related) {\r
+ }\r
+\r
@Command\r
public void executeJob() {\r
String template = "/pages/jobselector.zul";\r
import org.zkoss.zul.Window;\r
\r
import user.jobengine.db.ArchivedMedia;\r
-import user.jobengine.osgi.server.ComponentBinder;\r
import user.jobengine.zk.util.SessionUtil;\r
-import user.mediacube.metadata.interfaces.MetadataProviderType;\r
\r
public class MenuModel extends BaseModel {\r
private static final Logger logger = LogManager.getLogger();\r
}\r
\r
public boolean isMaestroAvailable() {\r
- return ComponentBinder.getMetadataProviderFactory() != null\r
- && ComponentBinder.getMetadataProviderFactory().getProvider(MetadataProviderType.PLANAIR) != null\r
- && System.getProperty("jobengine.maestro.config", "").length() > 0;\r
-\r
+ return "false".equals(System.getProperty("gui.maestro.disable", "false"));\r
}\r
\r
@Command\r
import user.jobengine.db.ArchivedMedia;\r
import user.jobengine.db.IItemManager;\r
import user.jobengine.db.ItemManager;\r
+import user.jobengine.db.ItemType;\r
import user.jobengine.db.MediaFile;\r
import user.jobengine.db.SearchOptions;\r
import user.jobengine.db.Store;\r
import user.jobengine.zk.util.SessionUtil;\r
\r
public class SearchModel extends AsyncBaseModel {\r
+ private static final String TAGTYPE_REMOVE = "remove";\r
+ private static final String TAGTYPE_ADD = "add";\r
+ private static final String TAGEVT_TAGTEXT = "tagtext";\r
+ private static final String TAGEVT_INDEX = "index";\r
+ private static final String TAGEVT_TYPE = "type";\r
+ private static final String TAGSRC_FILTER = "filter";\r
+ private static final String TAGSRC_MEDIA = "media";\r
+ private static final String TAGEVT_SOURCE = "source";\r
private static final String CREATE_LOWRES_TEMPLATE = "create-lowres-ondemand.xml";\r
private static final String ARG = "arg";\r
private static final String MEDIA_ID = "showMediaID";\r
private List<TypeFilter> bottomTypeFilters;\r
private Map<String, TypeFilter> typeFilters;\r
private Map<String, String> columnHeaders;\r
- private String searchValue = null;\r
private CachedListModel searchResult = null;\r
private ArchivedMedia selectedObject = null;\r
private Validator allFilterCheckedValidator;\r
private boolean allSelected;\r
private boolean itemSelected;\r
private int descLength;\r
+ private Map<String, Long> tags = null;\r
+ private List<Long> searchTags = new ArrayList<>();\r
protected IItemManager itemManager = null;\r
+\r
@Wire\r
Timer timer;\r
@Wire\r
Menupopup searchSettings;\r
@Wire\r
Div mediaDetails;\r
+ @Wire\r
+ West searchWest;\r
+\r
private String orderBy;\r
\r
private boolean orderAscending;\r
\r
public SearchModel() {\r
this.itemManager = ItemManager.getInstance();\r
+\r
+ tags = itemManager.getAllTags();\r
+\r
typeFilters = new LinkedHashMap<>();\r
MediaCubeConfig mediaCubeConfig = SessionUtil.getMediaCubeConfig();\r
setTopTypeFilters(mediaCubeConfig.getTopTypeFilters());\r
Clients.showNotification(String.format("Figyelem!<br><br><span style='white-space:nowrap'> A keresési paraméterek megváltoztak! </span>"),\r
"warning", searchFiltersMenu, "end_center", 3000);\r
\r
- Clients.evalJavaScript("addTags(['aaa', 'aaab', 'aaabb', 'aaabc', 'aaabd', 'aaabe', 'aaac', 'aaacc', 'teszt'], ['aaa', 'aaab']);");\r
+ if (tags != null)\r
+ setSearchTags();\r
+\r
} catch (Exception e) {\r
handleSearchError(e);\r
}\r
+ Executions.getCurrent().getContextPath();\r
String url = String.format("%s/?%s=%d", baseURL, MEDIA_ID, selectedObject.getMedia().getId());\r
String email = String.format("mailto:?subject=Média címe: %s &body=A média itt tekinthető meg: %s", selectedObject.getMedia().getTitle(), url);\r
- // Toolkit toolkit = Toolkit.getDefaultToolkit();\r
- // Clipboard clipboard = toolkit.getSystemClipboard();\r
- // StringSelection strSel = new StringSelection(url);\r
- // clipboard.setContents(strSel, null);\r
- // Messagebox.show("A médiához szükséges URL a vágólapra másolva, az URL\r
- // a következő:\n" + email, "", Messagebox.OK, Messagebox.NONE);\r
Executions.getCurrent().sendRedirect(email);\r
}\r
\r
searchResult = null;\r
itemsGrid.setActivePage(0);\r
setSelectedObject(null);\r
+ String searchValue = search.getText();\r
\r
- List<String> searchFilters = getSelectedFilters();\r
- if (SessionUtil.getUserColumnOrder() != null) {\r
- orderBy = columnHeaders.get(columnOrder.entrySet().iterator().next().getKey());\r
- orderAscending = columnOrder.entrySet().iterator().next().getValue().equals("ascending");\r
- }\r
-\r
- if (!searchHistory.contains(searchValue)) {\r
+ if (StringUtils.isNotBlank(searchValue) && !searchHistory.contains(searchValue)) {\r
searchHistory.add(0, searchValue);\r
SessionUtil.putUserSearchHistory(searchHistory);\r
}\r
\r
+ List<String> searchFilters = getSelectedFilters();\r
SessionUtil.putUserSearchFilter(searchFilters);\r
\r
- searchValue = search.getText();\r
- if ((StringUtils.isBlank(searchValue) || searchValue.length() < 3) && searchFrom == null && searchTo == null && !missingProxy) {\r
- throw new Exception("Legalább 3 karakter keresőszöveg, a 'hiányzó proxy' beállítás vagy egy dátum kitöltése szükséges!");\r
+ if (SessionUtil.getUserColumnOrder() != null) {\r
+ orderBy = columnHeaders.get(columnOrder.entrySet().iterator().next().getKey());\r
+ orderAscending = columnOrder.entrySet().iterator().next().getValue().equals("ascending");\r
}\r
\r
- SearchOptions options = new SearchOptions(searchValue, searchFilters, searchFrom, searchTo, missingProxy, descLength, orderBy, orderAscending);\r
+ SearchOptions options = SearchOptions.create()\r
+ .setText(searchValue)\r
+ .setTypes(getTypeIDs(searchFilters))\r
+ .setTags(searchTags)\r
+ .setFrom(searchFrom)\r
+ .setTo(searchTo)\r
+ .setMissingProxy(missingProxy)\r
+ .setDescLength(descLength)\r
+ .setOrder(orderBy, orderAscending);\r
+\r
+ if (!options.isValid())\r
+ throw new Exception("Legalább egy keresési opció használata kötelező: 3 karakter, hiányzó proxy, dátum, típus, cimke!");\r
searchResult = new CachedListModel(options);\r
searchResult.addEventListener(e -> {\r
if (e.getName().equals(Events.ON_ERROR)) {\r
handleSearchError(ex);\r
}\r
});\r
- //TODO miert kell meg1x\r
- //setSelectedObject(null);\r
-\r
} catch (Exception e) {\r
handleSearchError(e);\r
}\r
return typeFilters;\r
}\r
\r
+ private List<Long> getTypeIDs(List<String> searchFilters) {\r
+ List<Long> result = null;\r
+ if (searchFilters != null) {\r
+ for (String typeName : searchFilters) {\r
+ ItemType itemType = itemManager.getItemType(typeName);\r
+ if (itemType == null)\r
+ continue;\r
+ if (result == null)\r
+ result = new ArrayList<>();\r
+ result.add(itemType.getId());\r
+ }\r
+ }\r
+ return result;\r
+ }\r
+\r
private void handleSearchError(Exception e) {\r
Clients.showNotification(e.getMessage(), "error", search, "start_center", 2000);\r
logger.error(e);\r
}\r
\r
@Command\r
- public void onTag(@ContextParam(ContextType.TRIGGER_EVENT) Event event) {\r
+ public void onTagChanged(@ContextParam(ContextType.TRIGGER_EVENT) Event event) {\r
+ // source: filter | media,\r
+ // type : add | remove,\r
+ // tagtext: e.detail.data.value,\r
+ // index: e.detail.index\r
+\r
+ JSONObject jsObject = (JSONObject) event.getData();\r
+ if (!jsObject.containsKey(TAGEVT_SOURCE))\r
+ return;\r
+ String source = String.valueOf(jsObject.get(TAGEVT_SOURCE));\r
+\r
+ if (TAGSRC_MEDIA.equals(source))\r
+ processMediaTagChanged(jsObject);\r
+\r
+ if (TAGSRC_FILTER.equals(source))\r
+ processFilterTagChanged(jsObject);\r
+\r
logger.info(event);\r
}\r
\r
window.doModal();\r
}\r
\r
+ private void processFilterTagChanged(JSONObject jsObject) {\r
+ if (!jsObject.containsKey(TAGEVT_TYPE))\r
+ return;\r
+ String type = String.valueOf(jsObject.get(TAGEVT_TYPE));\r
+\r
+ if (!jsObject.containsKey(TAGEVT_TAGTEXT))\r
+ return;\r
+ String tagText = String.valueOf(jsObject.get(TAGEVT_TAGTEXT));\r
+\r
+ long id = tags.get(tagText);\r
+\r
+ switch (type) {\r
+ case TAGTYPE_ADD:\r
+ searchTags.add(id);\r
+ break;\r
+ case TAGTYPE_REMOVE:\r
+ searchTags.remove(id);\r
+ break;\r
+ }\r
+ }\r
+\r
+ private void processMediaTagChanged(JSONObject jsObject) {\r
+ if (selectedObject == null || !SessionUtil.isEditor()) {\r
+ setMediaTags(0);\r
+ return;\r
+ }\r
+\r
+ if (!jsObject.containsKey(TAGEVT_TYPE))\r
+ return;\r
+ String type = String.valueOf(jsObject.get(TAGEVT_TYPE));\r
+\r
+ if (!jsObject.containsKey(TAGEVT_TAGTEXT))\r
+ return;\r
+ String tagText = String.valueOf(jsObject.get(TAGEVT_TAGTEXT));\r
+\r
+ long id = 0;\r
+ if (tags.containsKey(tagText))\r
+ id = tags.get(tagText);\r
+\r
+ List<String> mediaTags = selectedObject.getTags();\r
+ switch (type) {\r
+ case TAGTYPE_ADD:\r
+ if (mediaTags.contains(tagText.toLowerCase()))\r
+ return;\r
+ if (id == 0) {\r
+ id = itemManager.addMediaTag(tagText, selectedObject.getMedia().getId());\r
+ //frissitjuk az osszes Tagify control whitelist-jet\r
+ tags.put(tagText, id);\r
+ setSearchTags();\r
+ } else\r
+ itemManager.addMediaTag(id, selectedObject.getMedia().getId());\r
+\r
+ mediaTags.add(tagText);\r
+ break;\r
+ case TAGTYPE_REMOVE:\r
+ mediaTags.remove(tagText.toLowerCase());\r
+ if (id == 0) {\r
+ Messagebox.show("A cimke már nem található az adatbázisban: " + tagText, "Belső hiba!", Messagebox.OK, Messagebox.EXCLAMATION);\r
+ return;\r
+ }\r
+ itemManager.removeMediaTag(id, selectedObject.getMedia().getId());\r
+ break;\r
+ }\r
+ }\r
+\r
@Command\r
public void rowMouseOut(@BindingParam("evt") MouseEvent event) {\r
logger.info(event);\r
\r
@Command\r
@NotifyChange({ "searchFrom", "searchTo", "selectedDateOption" })\r
- public void setCalendar(@BindingParam("source") Menuitem source) {\r
+ public void setCalendar(@BindingParam(TAGEVT_SOURCE) Menuitem source) {\r
int value = Integer.parseInt(source.getValue());\r
LocalDate now = LocalDate.now();\r
ZoneId zoneId = ZoneId.systemDefault();\r
this.itemSelectedValidator = itemSelectedValidator;\r
}\r
\r
+ private void setMediaTags(long mediaId) {\r
+ // JavaScript : addMediaTags(['aaa']);\r
+\r
+ List<String> mediaTags = null;\r
+\r
+ if (mediaId > 0)\r
+ mediaTags = itemManager.getMediaTags(mediaId);\r
+\r
+ //inicializaljuk, hogy az addTag event ezeket mar ne akarja meg 1x hozzadni\r
+ StringBuilder sb = new StringBuilder();\r
+ if (mediaTags != null) {\r
+ for (String tag : mediaTags) {\r
+ selectedObject.getTags().add(tag.toLowerCase());\r
+ if (tag.contains("'"))\r
+ continue;\r
+ if (sb.length() > 0)\r
+ sb.append(",");\r
+ sb.append(String.format("'%s'", tag));\r
+ }\r
+ }\r
+ sb.insert(0, "addMediaTags([");\r
+ sb.append("]);");\r
+\r
+ String js = sb.toString();\r
+ logger.info(js);\r
+ Clients.evalJavaScript(js);\r
+ }\r
+\r
public void setMissingProxy(boolean missingProxy) {\r
this.missingProxy = missingProxy;\r
}\r
\r
@Command\r
- public void setPageSize(@BindingParam("source") Menuitem source) {\r
+ public void setPageSize(@BindingParam(TAGEVT_SOURCE) Menuitem source) {\r
if (source.isChecked())\r
return;\r
int pageSize = Integer.parseInt(source.getValue());\r
this.searchHistory = searchHistory;\r
}\r
\r
+ private void setSearchTags() {\r
+ // JavaScript : addAllTags(['aaa', 'bbb', 'ccc']);\r
+\r
+ StringBuilder sb = new StringBuilder();\r
+ for (String tag : tags.keySet()) {\r
+ if (tag.contains("'"))\r
+ continue;\r
+ if (sb.length() > 0)\r
+ sb.append(",");\r
+ sb.append(String.format("'%s'", StringUtils.escape(tag)));\r
+ }\r
+ if (sb.length() > 0) {\r
+ sb.insert(0, "addAllTags([");\r
+ sb.append("]);");\r
+\r
+ String js = sb.toString();\r
+ logger.info(js);\r
+ Clients.evalJavaScript(js);\r
+ }\r
+ }\r
+\r
public void setSearchTo(Date searchTo) {\r
this.searchTo = searchTo;\r
}\r
public void setSelectedObject(ArchivedMedia selectedObject) {\r
this.selectedObject = selectedObject;\r
if (selectedObject != null) {\r
- selectedObject.setMedia(itemManager.getMedia(selectedObject.getMedia().getId()));\r
+ long mediaId = selectedObject.getMedia().getId();\r
+ selectedObject.setMedia(itemManager.getMedia(mediaId));\r
selectedObject.setItem(itemManager.getItem(selectedObject.getMedia().getItemId()));\r
\r
+ //tags\r
+ setMediaTags(mediaId);\r
+\r
try {\r
+ //proxy\r
String video = getLowresMediaFilePath();\r
if (video == null) {\r
- Clients.evalJavaScript("setSource(null)");\r
+ Clients.evalJavaScript("setSource(null, null)");\r
} else {\r
- Clients.evalJavaScript("setSource('" + video + "')");\r
+ String srcType = null;\r
+ if (video.endsWith(".m3u8"))\r
+ srcType = "application/x-mpegURL";\r
+ else\r
+ srcType = "video/mp4";\r
+\r
+ Clients.evalJavaScript(String.format("setSource('%s', '%s')", video, srcType));\r
}\r
\r
// Clients.evalJavaScript("setSource('/img/Mediacube_todo2.mp4')");\r
-\r
} catch (Exception e) {\r
logger.error(e);\r
}\r
\r
- }\r
+ } else\r
+ Clients.evalJavaScript("addMediaTags([]);");\r
+\r
}\r
\r
private void setSettingsPageSize(int pageSize) {\r
}\r
\r
private void showExternalMediaID() {\r
- String mediaID = SessionUtil.getQueryParameter(MEDIA_ID);\r
- if (mediaID != null) {\r
- SearchOptions options = new SearchOptions(searchValue, null, searchFrom, searchTo, false, 0, orderBy, orderAscending);\r
- options.setMediaId(Long.parseLong(mediaID));\r
+ String mediaId = SessionUtil.getQueryParameter(MEDIA_ID);\r
+ if (mediaId == null)\r
+ return;\r
+ try {\r
+ SearchOptions options = SearchOptions.create().setMediaId(Long.parseLong(mediaId));\r
searchResult = new InitializedCachedListModel(options);\r
+ } catch (Exception e) {\r
+ Messagebox.show(e.getMessage(), "Hiba!", Messagebox.OK, Messagebox.ERROR);\r
}\r
}\r
\r
package user.jobengine.osgi.mediacube;\r
\r
+import java.util.Set;\r
+\r
import javax.ws.rs.Consumes;\r
import javax.ws.rs.GET;\r
import javax.ws.rs.POST;\r
return result;\r
}\r
\r
+ @GET\r
+ @Path("/tags")\r
+ @Consumes({ MediaType.APPLICATION_JSON })\r
+ @Produces({ MediaType.APPLICATION_JSON })\r
+ public Response getTags() {\r
+ Response result = null;\r
+ try {\r
+ if (itemManager == null)\r
+ throw new Exception("No ItemManager found");\r
+ Set<String> tags = itemManager.getAllTags().keySet();\r
+ result = Response.ok(tags).build();\r
+ } catch (Exception e) {\r
+ result = Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(e.getMessage()).build();\r
+ }\r
+ return result;\r
+ }\r
+\r
@GET\r
@Path("/halt")\r
public Response halt() {\r
qryBackupData.setPitDate(pitDate);\r
try {\r
rc = TSMAPI.dsmBeginBackupQuery(dsmHandle, qryBackupData);\r
- if (rc != TSMAPIConstants.DSM_RC_OK)\r
+ if (rc != TSMAPIConstants.DSM_RC_OK) {\r
+ //TODO 200921 eldumpol egy ido utan. tesztelni!!!!!\r
+ TSMAPI.dsmEndQuery(dsmHandle);\r
throw new TSMException(dsmHandle, rc);\r
+ }\r
QryRespBackupData qryRespBackupData = new QryRespBackupData();\r
do {\r
rc = TSMAPI.dsmGetNextBackupQObj(dsmHandle, qryRespBackupData);\r