From 02068b8e192c6e06467d4a4ad4703230e627a0cc Mon Sep 17 00:00:00 2001 From: =?utf8?q?V=C3=A1s=C3=A1ry=20D=C3=A1niel?= Date: Fri, 1 Dec 2017 00:37:42 +0000 Subject: [PATCH] git-tfs-id: [http://tfs.userrendszerhaz.hu:8080/tfs/DefaultCollection]$/MediaCube;C30780 --- ...-ACTIVE-configuration-editor-project.json} | 0 ...le.json => -ACTIVE-configuration-nle.json} | 0 .../Configuration/configuration-archive.json | 4 +- .../Configuration/configuration-studio.json | 2 +- .../installforge-installer-project.ifp | Bin 4079 -> 4079 bytes client/Maestro/Maestro.csproj | 4 +- client/Maestro/MaestroForm.Designer.cs | 216 +++++++++--------- client/Maestro/MaestroForm.resx | 4 +- client/Maestro/Program.cs | 4 +- client/Maestro/Sources/NexioRESTSource.cs | 11 +- server/-configuration/scheduledjobs.json | 31 ++- server/-modules/pom.xml | 7 +- server/-product/pom.xml | 6 +- .../config/config.xml | 2 +- .../config/scheduledjobs.json | 6 +- .../deploy-steps-to-bsh.bat | 1 - .../deploy-steps-to-bsh2.bat | 33 +++ .../user/jobengine/server/steps/FakeStep.java | 29 +-- .../server/steps/SyncOCTOPUSDataStep.java | 8 +- .../src/user/commons/Job.java | 4 + .../commons/octopus/OctopusDataMiner.java | 172 +++++++------- .../octopus/test/OctopusDataMinerTest.java | 50 ---- .../pages/index.zul | 2 +- .../src/user/jobengine/server/JobEngine.java | 65 ++++-- .../src/user/jobengine/server/JobRuntime.java | 5 - .../jobengine/server/JobStepExecutor.java | 51 +++-- .../server/actions/SkipExecutingAction.java | 1 + .../server/actions/StatusMachine.java | 2 +- .../server/scheduler/ScheduledJob.java | 2 +- .../server/scheduler/SchedulerService.java | 2 +- 30 files changed, 381 insertions(+), 343 deletions(-) rename client/Maestro/Configuration/{ACTIVE-configuration-editor-project.json => -ACTIVE-configuration-editor-project.json} (100%) rename client/Maestro/Configuration/{ACTIVE-configuration-nle.json => -ACTIVE-configuration-nle.json} (100%) create mode 100644 server/user.jobengine.executors/deploy-steps-to-bsh2.bat diff --git a/client/Maestro/Configuration/ACTIVE-configuration-editor-project.json b/client/Maestro/Configuration/-ACTIVE-configuration-editor-project.json similarity index 100% rename from client/Maestro/Configuration/ACTIVE-configuration-editor-project.json rename to client/Maestro/Configuration/-ACTIVE-configuration-editor-project.json diff --git a/client/Maestro/Configuration/ACTIVE-configuration-nle.json b/client/Maestro/Configuration/-ACTIVE-configuration-nle.json similarity index 100% rename from client/Maestro/Configuration/ACTIVE-configuration-nle.json rename to client/Maestro/Configuration/-ACTIVE-configuration-nle.json diff --git a/client/Maestro/Configuration/configuration-archive.json b/client/Maestro/Configuration/configuration-archive.json index 784321bb..7e04aea1 100644 --- a/client/Maestro/Configuration/configuration-archive.json +++ b/client/Maestro/Configuration/configuration-archive.json @@ -1,6 +1,6 @@ { "title": "Archiválás", - "active": false, + "active": true, "startInTray": false, "enableCustomMetadataId": true, "player": { @@ -13,7 +13,7 @@ "filter": "mov,wav,mxf", "foldersAutoExpand": false, "local": { - "address": "file://10.10.1.100/BRAAVOS/MEGTEKINTO_ARCHIVE", + "address": "file://10.10.1.100/BRAAVOS/TOROKOR", "userName": "mediacube", "password": "Dn8t4gfHcK98o8hyPgLDhr5SgSji4JCxsfpMJsODikUp3nXgrM0UNCi45lLAK8ZOnmEneO44P9qpJ4QDqhctN6MxZodjJgdZTyoZKmSa+ECzEzLr/wPYNgxVaXrVotEy", "timeout": 1000 diff --git a/client/Maestro/Configuration/configuration-studio.json b/client/Maestro/Configuration/configuration-studio.json index 8a9e20f8..7666e579 100644 --- a/client/Maestro/Configuration/configuration-studio.json +++ b/client/Maestro/Configuration/configuration-studio.json @@ -1,6 +1,6 @@ { "title": "Stúdió", - "active": false, + "active": true, "startInTray": false, "enableCustomMetadataId": true, "filter": "avi", diff --git a/client/Maestro/Installer/installforge-installer-project.ifp b/client/Maestro/Installer/installforge-installer-project.ifp index 1e50aabd5fb67105e33cfd4092727f0d597784a1..ffa701412e0ec8a65b9d8e4f26d3100bd03cd58c 100644 GIT binary patch delta 19 bcmaDa|6YDVHlxMHoEt2R7MopJS8)LVQKknp delta 19 bcmaDa|6YDVHlz8*oEt2R=9^tvS8)LVQIrQV diff --git a/client/Maestro/Maestro.csproj b/client/Maestro/Maestro.csproj index 510b101f..e2f2d510 100644 --- a/client/Maestro/Maestro.csproj +++ b/client/Maestro/Maestro.csproj @@ -246,10 +246,10 @@ Form - + Always - + Always diff --git a/client/Maestro/MaestroForm.Designer.cs b/client/Maestro/MaestroForm.Designer.cs index aaebe637..643de7f0 100644 --- a/client/Maestro/MaestroForm.Designer.cs +++ b/client/Maestro/MaestroForm.Designer.cs @@ -33,11 +33,11 @@ namespace Maestro { System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MaestroForm)); System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle6 = new System.Windows.Forms.DataGridViewCellStyle(); System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle7 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle4 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle5 = new System.Windows.Forms.DataGridViewCellStyle(); System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle9 = new System.Windows.Forms.DataGridViewCellStyle(); System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle10 = new System.Windows.Forms.DataGridViewCellStyle(); System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle8 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle4 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle5 = new System.Windows.Forms.DataGridViewCellStyle(); this.groupSource = new System.Windows.Forms.GroupBox(); this.dgSource = new System.Windows.Forms.DataGridView(); this.bindingSource = new System.Windows.Forms.BindingSource(this.components); @@ -77,6 +77,13 @@ namespace Maestro { this.tabSystem = new System.Windows.Forms.TabControl(); this.tabPage1 = new System.Windows.Forms.TabPage(); this.dgJobs = new System.Windows.Forms.DataGridView(); + this.bindingSourceJobs = new System.Windows.Forms.BindingSource(this.components); + this.tabPage2 = new System.Windows.Forms.TabPage(); + this.dgMessages = new System.Windows.Forms.DataGridView(); + this.dataGridViewTextBoxColumn1 = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.dataGridViewTextBoxColumn2 = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.systemMessageBindingSource = new System.Windows.Forms.BindingSource(this.components); + this.metadataInfoBindingSource = new System.Windows.Forms.BindingSource(this.components); this.columnLabel = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.columnID = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.Progress = new Maestro.Commons.DataGridViewProgressColumn(); @@ -87,13 +94,6 @@ namespace Maestro { this.columnOutput = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.columnKillDate = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.Message = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.bindingSourceJobs = new System.Windows.Forms.BindingSource(this.components); - this.tabPage2 = new System.Windows.Forms.TabPage(); - this.dgMessages = new System.Windows.Forms.DataGridView(); - this.dataGridViewTextBoxColumn1 = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.dataGridViewTextBoxColumn2 = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.systemMessageBindingSource = new System.Windows.Forms.BindingSource(this.components); - this.metadataInfoBindingSource = new System.Windows.Forms.BindingSource(this.components); this.groupSource.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.dgSource)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.bindingSource)).BeginInit(); @@ -190,7 +190,7 @@ namespace Maestro { this.dgSource.RowsDefaultCellStyle = dataGridViewCellStyle3; this.dgSource.RowTemplate.DefaultCellStyle.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); this.dgSource.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; - this.dgSource.Size = new System.Drawing.Size(330, 159); + this.dgSource.Size = new System.Drawing.Size(330, 162); this.dgSource.TabIndex = 0; this.dgSource.CellContentClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.sourceGridView_CellContentClick); this.dgSource.CellEnter += new System.Windows.Forms.DataGridViewCellEventHandler(this.dataGridSource_CellEnter); @@ -203,13 +203,13 @@ namespace Maestro { // treeFolders // this.treeFolders.BorderStyle = System.Windows.Forms.BorderStyle.None; + this.treeFolders.Cursor = System.Windows.Forms.Cursors.Hand; this.treeFolders.Dock = System.Windows.Forms.DockStyle.Bottom; this.treeFolders.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); this.treeFolders.HotTracking = true; - this.treeFolders.Cursor = Cursors.Hand; this.treeFolders.ImageIndex = 0; this.treeFolders.ImageList = this.ilFolders; - this.treeFolders.Location = new System.Drawing.Point(10, 206); + this.treeFolders.Location = new System.Drawing.Point(10, 209); this.treeFolders.Name = "treeFolders"; this.treeFolders.SelectedImageIndex = 0; this.treeFolders.Size = new System.Drawing.Size(330, 161); @@ -280,16 +280,14 @@ namespace Maestro { this.pSourceDisplay.Controls.Add(this.lSelectedSource, 0, 1); this.pSourceDisplay.Controls.Add(this.btnLookupBySource, 1, 2); this.pSourceDisplay.Dock = System.Windows.Forms.DockStyle.Bottom; - this.pSourceDisplay.Location = new System.Drawing.Point(10, 367); + this.pSourceDisplay.Location = new System.Drawing.Point(10, 370); this.pSourceDisplay.Margin = new System.Windows.Forms.Padding(0); this.pSourceDisplay.Name = "pSourceDisplay"; this.pSourceDisplay.RowCount = 3; - this.pSourceDisplay.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 30F)); - this.pSourceDisplay.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 30F)); - this.pSourceDisplay.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 30F)); - this.pSourceDisplay.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F)); - this.pSourceDisplay.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F)); - this.pSourceDisplay.Size = new System.Drawing.Size(330, 94); + this.pSourceDisplay.RowStyles.Add(new System.Windows.Forms.RowStyle()); + this.pSourceDisplay.RowStyles.Add(new System.Windows.Forms.RowStyle()); + this.pSourceDisplay.RowStyles.Add(new System.Windows.Forms.RowStyle()); + this.pSourceDisplay.Size = new System.Drawing.Size(330, 91); this.pSourceDisplay.TabIndex = 12; // // tsSource @@ -303,7 +301,7 @@ namespace Maestro { this.tsSource.Name = "tsSource"; this.tsSource.RenderMode = System.Windows.Forms.ToolStripRenderMode.System; this.tsSource.RightToLeft = System.Windows.Forms.RightToLeft.Yes; - this.tsSource.Size = new System.Drawing.Size(330, 30); + this.tsSource.Size = new System.Drawing.Size(330, 31); this.tsSource.TabIndex = 18; // // btnShowFolders @@ -324,7 +322,7 @@ namespace Maestro { this.textSelectedSource.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; this.textSelectedSource.Dock = System.Windows.Forms.DockStyle.Fill; this.textSelectedSource.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(238))); - this.textSelectedSource.Location = new System.Drawing.Point(3, 63); + this.textSelectedSource.Location = new System.Drawing.Point(3, 59); this.textSelectedSource.Name = "textSelectedSource"; this.textSelectedSource.ReadOnly = true; this.textSelectedSource.Size = new System.Drawing.Size(288, 26); @@ -337,10 +335,10 @@ namespace Maestro { this.pSourceDisplay.SetColumnSpan(this.lSelectedSource, 2); this.lSelectedSource.Dock = System.Windows.Forms.DockStyle.Fill; this.lSelectedSource.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); - this.lSelectedSource.Location = new System.Drawing.Point(3, 30); + this.lSelectedSource.Location = new System.Drawing.Point(3, 31); this.lSelectedSource.Name = "lSelectedSource"; this.lSelectedSource.Padding = new System.Windows.Forms.Padding(0, 5, 0, 5); - this.lSelectedSource.Size = new System.Drawing.Size(324, 30); + this.lSelectedSource.Size = new System.Drawing.Size(324, 25); this.lSelectedSource.TabIndex = 13; this.lSelectedSource.Text = "Selected source"; // @@ -354,7 +352,7 @@ namespace Maestro { this.btnLookupBySource.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.btnLookupBySource.Font = new System.Drawing.Font("Microsoft Sans Serif", 10F); this.btnLookupBySource.Image = global::Maestro.Properties.Resources.ic_search_black_24dp_1x; - this.btnLookupBySource.Location = new System.Drawing.Point(297, 63); + this.btnLookupBySource.Location = new System.Drawing.Point(297, 59); this.btnLookupBySource.Name = "btnLookupBySource"; this.btnLookupBySource.Size = new System.Drawing.Size(30, 26); this.btnLookupBySource.TabIndex = 14; @@ -753,6 +751,80 @@ namespace Maestro { this.dgJobs.CellPainting += new System.Windows.Forms.DataGridViewCellPaintingEventHandler(this.OnJobsCellPainting); this.dgJobs.MouseClick += new System.Windows.Forms.MouseEventHandler(this.dataGridJobs_MouseClick); // + // tabPage2 + // + this.tabPage2.Controls.Add(this.dgMessages); + this.tabPage2.Location = new System.Drawing.Point(4, 24); + this.tabPage2.Name = "tabPage2"; + this.tabPage2.Padding = new System.Windows.Forms.Padding(3); + this.tabPage2.Size = new System.Drawing.Size(994, 96); + this.tabPage2.TabIndex = 1; + this.tabPage2.Text = global::Maestro.StringResources.UZENETEK; + this.tabPage2.UseVisualStyleBackColor = true; + // + // dgMessages + // + this.dgMessages.AllowUserToAddRows = false; + this.dgMessages.AllowUserToResizeRows = false; + this.dgMessages.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.DisplayedCells; + this.dgMessages.AutoSizeRowsMode = System.Windows.Forms.DataGridViewAutoSizeRowsMode.DisplayedCells; + this.dgMessages.BackgroundColor = System.Drawing.Color.White; + this.dgMessages.BorderStyle = System.Windows.Forms.BorderStyle.None; + this.dgMessages.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; + this.dgMessages.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { + this.dataGridViewTextBoxColumn1, + this.dataGridViewTextBoxColumn2}); + dataGridViewCellStyle9.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; + dataGridViewCellStyle9.BackColor = System.Drawing.SystemColors.Window; + dataGridViewCellStyle9.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); + dataGridViewCellStyle9.ForeColor = System.Drawing.Color.Red; + dataGridViewCellStyle9.NullValue = null; + dataGridViewCellStyle9.SelectionBackColor = System.Drawing.Color.Gainsboro; + dataGridViewCellStyle9.SelectionForeColor = System.Drawing.Color.Red; + dataGridViewCellStyle9.WrapMode = System.Windows.Forms.DataGridViewTriState.False; + this.dgMessages.DefaultCellStyle = dataGridViewCellStyle9; + this.dgMessages.Dock = System.Windows.Forms.DockStyle.Fill; + this.dgMessages.EditMode = System.Windows.Forms.DataGridViewEditMode.EditProgrammatically; + this.dgMessages.EnableHeadersVisualStyles = false; + this.dgMessages.GridColor = System.Drawing.Color.White; + this.dgMessages.Location = new System.Drawing.Point(3, 3); + this.dgMessages.Name = "dgMessages"; + this.dgMessages.ReadOnly = true; + this.dgMessages.RowHeadersVisible = false; + dataGridViewCellStyle10.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); + this.dgMessages.RowsDefaultCellStyle = dataGridViewCellStyle10; + this.dgMessages.RowTemplate.DefaultCellStyle.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); + this.dgMessages.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; + this.dgMessages.Size = new System.Drawing.Size(988, 90); + this.dgMessages.TabIndex = 1; + // + // dataGridViewTextBoxColumn1 + // + this.dataGridViewTextBoxColumn1.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells; + this.dataGridViewTextBoxColumn1.DataPropertyName = "Time"; + this.dataGridViewTextBoxColumn1.HeaderText = "Időpont"; + this.dataGridViewTextBoxColumn1.Name = "dataGridViewTextBoxColumn1"; + this.dataGridViewTextBoxColumn1.ReadOnly = true; + this.dataGridViewTextBoxColumn1.Width = 73; + // + // dataGridViewTextBoxColumn2 + // + this.dataGridViewTextBoxColumn2.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; + this.dataGridViewTextBoxColumn2.DataPropertyName = "Message"; + dataGridViewCellStyle8.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); + this.dataGridViewTextBoxColumn2.DefaultCellStyle = dataGridViewCellStyle8; + this.dataGridViewTextBoxColumn2.HeaderText = "Üzenet"; + this.dataGridViewTextBoxColumn2.Name = "dataGridViewTextBoxColumn2"; + this.dataGridViewTextBoxColumn2.ReadOnly = true; + // + // systemMessageBindingSource + // + this.systemMessageBindingSource.DataSource = typeof(Maestro.SystemMessage); + // + // metadataInfoBindingSource + // + this.metadataInfoBindingSource.DataSource = typeof(Maestro.Metadata.MetadataInfo); + // // columnLabel // this.columnLabel.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells; @@ -791,7 +863,7 @@ namespace Maestro { // // columnStarted // - this.columnStarted.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells; + this.columnStarted.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.ColumnHeader; this.columnStarted.DataPropertyName = "Started"; this.columnStarted.HeaderText = "Started"; this.columnStarted.Name = "columnStarted"; @@ -799,7 +871,7 @@ namespace Maestro { // // columnFinished // - this.columnFinished.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells; + this.columnFinished.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.ColumnHeader; this.columnFinished.DataPropertyName = "Finished"; this.columnFinished.HeaderText = "Finished"; this.columnFinished.Name = "columnFinished"; @@ -837,80 +909,6 @@ namespace Maestro { this.Message.Name = "Message"; this.Message.Width = 71; // - // tabPage2 - // - this.tabPage2.Controls.Add(this.dgMessages); - this.tabPage2.Location = new System.Drawing.Point(4, 24); - this.tabPage2.Name = "tabPage2"; - this.tabPage2.Padding = new System.Windows.Forms.Padding(3); - this.tabPage2.Size = new System.Drawing.Size(994, 96); - this.tabPage2.TabIndex = 1; - this.tabPage2.Text = global::Maestro.StringResources.UZENETEK; - this.tabPage2.UseVisualStyleBackColor = true; - // - // dgMessages - // - this.dgMessages.AllowUserToAddRows = false; - this.dgMessages.AllowUserToResizeRows = false; - this.dgMessages.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.DisplayedCells; - this.dgMessages.AutoSizeRowsMode = System.Windows.Forms.DataGridViewAutoSizeRowsMode.DisplayedCells; - this.dgMessages.BackgroundColor = System.Drawing.Color.White; - this.dgMessages.BorderStyle = System.Windows.Forms.BorderStyle.None; - this.dgMessages.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; - this.dgMessages.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { - this.dataGridViewTextBoxColumn1, - this.dataGridViewTextBoxColumn2}); - dataGridViewCellStyle9.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; - dataGridViewCellStyle9.BackColor = System.Drawing.SystemColors.Window; - dataGridViewCellStyle9.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); - dataGridViewCellStyle9.ForeColor = System.Drawing.Color.Red; - dataGridViewCellStyle9.NullValue = null; - dataGridViewCellStyle9.SelectionBackColor = System.Drawing.Color.Gainsboro; - dataGridViewCellStyle9.SelectionForeColor = System.Drawing.Color.Red; - dataGridViewCellStyle9.WrapMode = System.Windows.Forms.DataGridViewTriState.False; - this.dgMessages.DefaultCellStyle = dataGridViewCellStyle9; - this.dgMessages.Dock = System.Windows.Forms.DockStyle.Fill; - this.dgMessages.EditMode = System.Windows.Forms.DataGridViewEditMode.EditProgrammatically; - this.dgMessages.EnableHeadersVisualStyles = false; - this.dgMessages.GridColor = System.Drawing.Color.White; - this.dgMessages.Location = new System.Drawing.Point(3, 3); - this.dgMessages.Name = "dgMessages"; - this.dgMessages.ReadOnly = true; - this.dgMessages.RowHeadersVisible = false; - dataGridViewCellStyle10.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); - this.dgMessages.RowsDefaultCellStyle = dataGridViewCellStyle10; - this.dgMessages.RowTemplate.DefaultCellStyle.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); - this.dgMessages.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; - this.dgMessages.Size = new System.Drawing.Size(988, 90); - this.dgMessages.TabIndex = 1; - // - // dataGridViewTextBoxColumn1 - // - this.dataGridViewTextBoxColumn1.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells; - this.dataGridViewTextBoxColumn1.DataPropertyName = "Time"; - this.dataGridViewTextBoxColumn1.HeaderText = "Időpont"; - this.dataGridViewTextBoxColumn1.Name = "dataGridViewTextBoxColumn1"; - this.dataGridViewTextBoxColumn1.ReadOnly = true; - this.dataGridViewTextBoxColumn1.Width = 73; - // - // dataGridViewTextBoxColumn2 - // - this.dataGridViewTextBoxColumn2.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; - this.dataGridViewTextBoxColumn2.DataPropertyName = "Message"; - dataGridViewCellStyle8.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); - this.dataGridViewTextBoxColumn2.DefaultCellStyle = dataGridViewCellStyle8; - this.dataGridViewTextBoxColumn2.HeaderText = "Üzenet"; - this.dataGridViewTextBoxColumn2.Name = "dataGridViewTextBoxColumn2"; - this.dataGridViewTextBoxColumn2.ReadOnly = true; - // - // systemMessageBindingSource - // - this.systemMessageBindingSource.DataSource = typeof(Maestro.SystemMessage); - // - // metadataInfoBindingSource - // - this.metadataInfoBindingSource.DataSource = typeof(Maestro.Metadata.MetadataInfo); - // // MaestroForm // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); @@ -1021,16 +1019,16 @@ namespace Maestro { private System.Windows.Forms.TreeView treeFolders; private System.Windows.Forms.ImageList ilFolders; private System.Windows.Forms.CheckBox chkAutoScroll; - private System.Windows.Forms.DataGridViewTextBoxColumn columnLabel; - private System.Windows.Forms.DataGridViewTextBoxColumn columnID; + private DataGridViewTextBoxColumn columnLabel; + private DataGridViewTextBoxColumn columnID; private Commons.DataGridViewProgressColumn Progress; - private System.Windows.Forms.DataGridViewTextBoxColumn columnStatus; - private System.Windows.Forms.DataGridViewTextBoxColumn columnStarted; - private System.Windows.Forms.DataGridViewTextBoxColumn columnFinished; - private System.Windows.Forms.DataGridViewTextBoxColumn columnInput; - private System.Windows.Forms.DataGridViewTextBoxColumn columnOutput; - private System.Windows.Forms.DataGridViewTextBoxColumn columnKillDate; - private System.Windows.Forms.DataGridViewTextBoxColumn Message; + private DataGridViewTextBoxColumn columnStatus; + private DataGridViewTextBoxColumn columnStarted; + private DataGridViewTextBoxColumn columnFinished; + private DataGridViewTextBoxColumn columnInput; + private DataGridViewTextBoxColumn columnOutput; + private DataGridViewTextBoxColumn columnKillDate; + private DataGridViewTextBoxColumn Message; } } diff --git a/client/Maestro/MaestroForm.resx b/client/Maestro/MaestroForm.resx index 660d55ac..6d1ada1a 100644 --- a/client/Maestro/MaestroForm.resx +++ b/client/Maestro/MaestroForm.resx @@ -128,7 +128,7 @@ AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0 ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAAAS - CAAAAk1TRnQBSQFMAgEBAgEAAdABAAHQAQABEAEAARABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo + CAAAAk1TRnQBSQFMAgEBAgEAAdgBAAHYAQABEAEAARABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo AwABQAMAARADAAEBAQABCAYAAQQYAAGAAgABgAMAAoABAAGAAwABgAEAAYABAAKAAgADwAEAAcAB3AHA AQAB8AHKAaYBAAEzBQABMwEAATMBAAEzAQACMwIAAxYBAAMcAQADIgEAAykBAANVAQADTQEAA0IBAAM5 AQABgAF8Af8BAAJQAf8BAAGTAQAB1gEAAf8B7AHMAQABxgHWAe8BAAHWAucBAAGQAakBrQIAAf8BMwMA @@ -226,7 +226,7 @@ 309, 17 - 59 + 25 diff --git a/client/Maestro/Program.cs b/client/Maestro/Program.cs index 0395a8aa..1f90331d 100644 --- a/client/Maestro/Program.cs +++ b/client/Maestro/Program.cs @@ -87,7 +87,7 @@ namespace Maestro { private const string NOSPLASH = "nosplash"; private const string NOLOGIN = "nologin"; public const string NOSINGLE = "nosingle"; - + private const string HYPHEN = "-"; private static Logger logger = LogManager.GetCurrentClassLogger(); private NotifyIcon trayIcon; private ConcurrentBag forms = new ConcurrentBag(); @@ -134,6 +134,8 @@ namespace Maestro { string globalFile = Path.Combine(CONFIGURATION_FOLDER, GLOBAL_JSON); if (file.Equals(globalFile)) continue; + if (Path.GetFileName(file).StartsWith(HYPHEN)) + continue; CreateForm(file); } if (forms.Count == 0) diff --git a/client/Maestro/Sources/NexioRESTSource.cs b/client/Maestro/Sources/NexioRESTSource.cs index 8fc6d2b5..da2220c5 100644 --- a/client/Maestro/Sources/NexioRESTSource.cs +++ b/client/Maestro/Sources/NexioRESTSource.cs @@ -228,8 +228,15 @@ namespace Maestro.Sources { private void OnList(JToken l) { if (l == null) return; - l.Children().ToList().Select(t => CreateItem(t, false)).Where(x => x.CanHandle(acceptableAgencies)).OrderByDescending(i => i.Created).ToList().ForEach(i => parent.SafeCall(() => Add(i))); - initialized = true; + parent.SafeCall(() => { + l.Children(). + ToList(). + Select(t => CreateItem(t, false)). + Where(x => x.CanHandle(acceptableAgencies)). + OrderByDescending(i => i.Created). + ToList().ForEach(i => Add(i)); + initialized = true; + }); } private void OnChanged(JToken token) { diff --git a/server/-configuration/scheduledjobs.json b/server/-configuration/scheduledjobs.json index 01d40197..2c972df5 100644 --- a/server/-configuration/scheduledjobs.json +++ b/server/-configuration/scheduledjobs.json @@ -14,6 +14,20 @@ ] }, { + "active": false, + "name" : "Egy archiválás", + "template": "archive-ondemand.xml", + "executeimmediate": true, + "cronexpression": "0 0 0/1 1/1 * ? *", + "parameters": [ + {"name": "sourcePath", "value": "/mnt/ISILON/ARCHIVE/ONE", "type": "java.lang.String"}, + {"name": "globalSourcePath", "value": "\\\\10.10.1.100\\BRAAVOS\\ARCHIVE\\ONE", "type": "java.lang.String"}, + {"name": "transcoderTargetPath", "value": "/mnt/SELENIO", "type": "java.lang.String"}, + {"name": "webPath", "value": "/mediacube/data/lowres/www/video", "type": "java.lang.String"}, + {"name": "killDateDays", "value": 1, "type": "java.lang.Integer"} + ] + }, + { "active": false, "name" : "TRAFFIC anyagok visszatöltése", "template": "retrieve-traffic-missing-materials.xml", @@ -70,7 +84,20 @@ "name" : "OCTOPUS adatok szinkronizálása", "template": "sync-octopus.xml", "executeimmediate": true, - "cronexpression": "0 0/1 * * * ?" + "cronexpression": "0/20 * * * * ?", + "parameters": [ + {"name": "forceFull", "value": false, "type": "java.lang.Boolean"} + ] + }, + { + "active": false, + "name" : "OCTOPUS adatok teljes szinkronizálása", + "template": "sync-octopus.xml", + "executeimmediate": false, + "cronexpression": "0/30 * * * * ?", + "parameters": [ + {"name": "forceFull", "value": true, "type": "java.lang.Boolean"} + ] }, { "active": false, @@ -85,7 +112,7 @@ "name" : "Teszt folyamat", "template": "fake.xml", "executeimmediate": false, - "cronexpression": "* 0/1 * ? * *", + "cronexpression": "0/10 * * ? * *", "parameters": [ {"name": "itemID", "value": 1, "type": "java.lang.Long"} ] } ]} diff --git a/server/-modules/pom.xml b/server/-modules/pom.xml index 309864f6..a7da8e11 100644 --- a/server/-modules/pom.xml +++ b/server/-modules/pom.xml @@ -18,6 +18,10 @@ + scp://root:password@10.10.1.27 + ssh-ed25519 256 ea:ab:67:70:79:63:2f:6a:34:81:48:e2:b9:dd:ca:d4 + + 1.0.0 1.0.0 1.8 @@ -25,9 +29,6 @@ UTF-8 UTF-8 - scp://root:password@10.10.1.27 - ssh-ed25519 256 ea:ab:67:70:79:63:2f:6a:34:81:48:e2:b9:dd:ca:d4 - diff --git a/server/-product/pom.xml b/server/-product/pom.xml index b208a624..1343c4a8 100644 --- a/server/-product/pom.xml +++ b/server/-product/pom.xml @@ -290,8 +290,7 @@ /command "open ${remote.address} -hostkey=""${remote.hostkey}""" - - "call pcs resource disable mediacube_script" + "call rm -rf ${remote.location}" "call mkdir ${remote.location}" @@ -301,9 +300,6 @@ "mkdir log" "call chmod +x mediacube" - - - "exit" diff --git a/server/user.jobengine.executors/config/config.xml b/server/user.jobengine.executors/config/config.xml index 329c35f5..58d87ef9 100644 --- a/server/user.jobengine.executors/config/config.xml +++ b/server/user.jobengine.executors/config/config.xml @@ -12,5 +12,5 @@ - + \ No newline at end of file diff --git a/server/user.jobengine.executors/config/scheduledjobs.json b/server/user.jobengine.executors/config/scheduledjobs.json index b6bdbf94..f7014c18 100644 --- a/server/user.jobengine.executors/config/scheduledjobs.json +++ b/server/user.jobengine.executors/config/scheduledjobs.json @@ -80,7 +80,7 @@ ] }, { - "active": true, + "active": false, "name" : "OCTOPUS adatok szinkronizálása", "template": "sync-octopus.xml", "executeimmediate": true, @@ -90,11 +90,11 @@ ] }, { - "active": false, + "active": true, "name" : "OCTOPUS adatok teljes szinkronizálása", "template": "sync-octopus.xml", "executeimmediate": false, - "cronexpression": "#0/20 * * * * ?", + "cronexpression": "0/30 * * * * ?", "parameters": [ {"name": "forceFull", "value": true, "type": "java.lang.Boolean"} ] diff --git a/server/user.jobengine.executors/deploy-steps-to-bsh.bat b/server/user.jobengine.executors/deploy-steps-to-bsh.bat index 288eec44..63732372 100644 --- a/server/user.jobengine.executors/deploy-steps-to-bsh.bat +++ b/server/user.jobengine.executors/deploy-steps-to-bsh.bat @@ -24,7 +24,6 @@ SET LOCAL_CONFIG_LOCATION=config "synchronize remote -filemask=config.xml" ^ "cd .." ^ "synchronize remote -filemask=scheduledjobs.json" ^ - "call pcs resource restart mediacube_script" ^ "exit" ECHO *** Completed *** diff --git a/server/user.jobengine.executors/deploy-steps-to-bsh2.bat b/server/user.jobengine.executors/deploy-steps-to-bsh2.bat new file mode 100644 index 00000000..288eec44 --- /dev/null +++ b/server/user.jobengine.executors/deploy-steps-to-bsh2.bat @@ -0,0 +1,33 @@ +@ECHO OFF + +SET REMOTE_HOST=10.10.1.27 +SET REMOTE_LOCATION=/opt/mediacube/configuration/executors +SET REMOTE_SERVER_HOSTKEY=ssh-ed25519 256 ea:ab:67:70:79:63:2f:6a:34:81:48:e2:b9:dd:ca:d4 +SET REMOTE_SERVER_ADDRESS=scp://root:password@%REMOTE_HOST% +SET LOCAL_STEPS_LOCATION=bin/user/jobengine/server/steps +SET LOCAL_CONFIG_LOCATION=config + + ECHO *** Begin deploy steps to server %REMOTE_HOST% *** + ECHO --- Deploying + + WinSCP.com /command ^ + "open %REMOTE_SERVER_ADDRESS% -hostkey=""%REMOTE_SERVER_HOSTKEY%"" -timeout=60" ^ + "cd %REMOTE_LOCATION%" ^ + "lcd %LOCAL_STEPS_LOCATION%" ^ + "synchronize remote" ^ + "lcd ..\" ^ + "lcd ..\" ^ + "lcd ..\" ^ + "lcd ..\" ^ + "lcd ..\" ^ + "lcd %LOCAL_CONFIG_LOCATION%" ^ + "synchronize remote -filemask=config.xml" ^ + "cd .." ^ + "synchronize remote -filemask=scheduledjobs.json" ^ + "call pcs resource restart mediacube_script" ^ + "exit" + + ECHO *** Completed *** +@ECHO ON + + diff --git a/server/user.jobengine.executors/src/user/jobengine/server/steps/FakeStep.java b/server/user.jobengine.executors/src/user/jobengine/server/steps/FakeStep.java index 061d0b98..9e7a831c 100644 --- a/server/user.jobengine.executors/src/user/jobengine/server/steps/FakeStep.java +++ b/server/user.jobengine.executors/src/user/jobengine/server/steps/FakeStep.java @@ -11,20 +11,21 @@ public class FakeStep extends JobStep { int count = 10; @StepEntry - public Object[] execute(long itemID, IJobEngine jobEngine, IJobRuntime jobRuntime) { - try { - for (int i = 0; i < count; i++) { - if (!canContinue()) - break; - jobRuntime.incrementProgress((i + 1) * count); - Thread.sleep(1000); - logger.info(getMarker(), "Log markered"); - logger.info("Progress {}", jobRuntime.getProgress()); - } - } catch (Exception e) { - logger.error(e.getMessage()); - } - return new Object[] { itemID + 1 }; + public Object[] execute(long itemID, IJobEngine jobEngine, IJobRuntime jobRuntime) throws Exception { + throw new Exception("42"); + // try { + // for (int i = 0; i < count; i++) { + // if (!canContinue()) + // break; + // jobRuntime.incrementProgress((i + 1) * count); + // Thread.sleep(1000); + // //logger.info(getMarker(), "Log markered"); + // //logger.info("Progress {}", jobRuntime.getProgress()); + // } + // } catch (Exception e) { + // logger.error(e.getMessage()); + // } + //return null; } } diff --git a/server/user.jobengine.executors/src/user/jobengine/server/steps/SyncOCTOPUSDataStep.java b/server/user.jobengine.executors/src/user/jobengine/server/steps/SyncOCTOPUSDataStep.java index 4753075a..19a59c35 100644 --- a/server/user.jobengine.executors/src/user/jobengine/server/steps/SyncOCTOPUSDataStep.java +++ b/server/user.jobengine.executors/src/user/jobengine/server/steps/SyncOCTOPUSDataStep.java @@ -27,12 +27,16 @@ public class SyncOCTOPUSDataStep extends JobStep { public Object[] execute(boolean forceFull, IJobEngine jobEngine, final IJobRuntime jobRuntime) { OctopusDataMiner dataMiner = null; try { + jobRuntime.incrementProgress(10); progressListener = createListener(jobRuntime); dataMiner = new OctopusDataMiner(); dataMiner.addProgressListener(progressListener); - dataMiner.run(forceFull); + if (forceFull) + dataMiner.execute(); + else + dataMiner.run(); } catch (Exception e) { - logger.catching(e); + logger.error(getMarker(), "Általános folyamat hiba. A rendszer hibaüzenete: {}", e.getMessage()); throw e; } finally { if (dataMiner != null) diff --git a/server/user.jobengine.osgi.commons/src/user/commons/Job.java b/server/user.jobengine.osgi.commons/src/user/commons/Job.java index a076568c..f5973b24 100644 --- a/server/user.jobengine.osgi.commons/src/user/commons/Job.java +++ b/server/user.jobengine.osgi.commons/src/user/commons/Job.java @@ -175,4 +175,8 @@ public class Job extends Syncable implements IJob, Comparable { this.template = template; } + @Override + public String toString() { + return String.format("## %d - %s - %s ##", getId(), getName(), status); + } } diff --git a/server/user.jobengine.osgi.commons/src/user/commons/octopus/OctopusDataMiner.java b/server/user.jobengine.osgi.commons/src/user/commons/octopus/OctopusDataMiner.java index 5f427ad4..7f25b32a 100644 --- a/server/user.jobengine.osgi.commons/src/user/commons/octopus/OctopusDataMiner.java +++ b/server/user.jobengine.osgi.commons/src/user/commons/octopus/OctopusDataMiner.java @@ -96,6 +96,28 @@ public class OctopusDataMiner implements Runnable { progressListenerList.add(IProgressEventListener.class, listener); } + private Map buildFolderReferences(BasicDBList storyFolders) { + Map result = new HashMap<>(); + List storyFolderList = NoSQLUtils.asList(storyFolders); + for (BasicDBObject storyFolder : storyFolderList) { + long storyFolderId = storyFolder.getLong(IOctopusAPI.ID); + List stories = NoSQLUtils.asList(storyFolder, IOctopusAPI.STORIES); + if (stories == null) + continue; + long position = 1; + for (BasicDBObject story : stories) { + long storyId = story.getLong(IOctopusAPI.ID); + BasicDBList references = result.get(storyId); + if (references == null) { + references = new BasicDBList(); + result.put(storyId, references); + } + references.add(new BasicDBObject(IOctopusAPI.ID, storyFolderId).append(IOctopusAPI.POSITION, position++)); + } + } + return result; + } + private Map buildRundownReferences(BasicDBList rundowns) { Map result = new HashMap<>(); List rundownsList = NoSQLUtils.asList(rundowns); @@ -162,28 +184,6 @@ public class OctopusDataMiner implements Runnable { } } - private Map buildFolderReferences(BasicDBList storyFolders) { - Map result = new HashMap<>(); - List storyFolderList = NoSQLUtils.asList(storyFolders); - for (BasicDBObject storyFolder : storyFolderList) { - long storyFolderId = storyFolder.getLong(IOctopusAPI.ID); - List stories = NoSQLUtils.asList(storyFolder, IOctopusAPI.STORIES); - if (stories == null) - continue; - long position = 1; - for (BasicDBObject story : stories) { - long storyId = story.getLong(IOctopusAPI.ID); - BasicDBList references = result.get(storyId); - if (references == null) { - references = new BasicDBList(); - result.put(storyId, references); - } - references.add(new BasicDBObject(IOctopusAPI.ID, storyFolderId).append(IOctopusAPI.POSITION, position++)); - } - } - return result; - } - public void clear() { db.getCollection(RUNDOWN_COLLECTION).remove(); db.getCollection(STORY_COLLECTION).remove(); @@ -277,69 +277,6 @@ public class OctopusDataMiner implements Runnable { } - private BasicDBList extractRelevantMOSObjects(BasicDBObject story) { - List mosObjects = NoSQLUtils.asList(story, IOctopusAPI.MOS_OBJECTS); - if (mosObjects == null) - return null; - BasicDBList result = null; - for (BasicDBObject mosObject : mosObjects) { - if (!mosObject.containsKey(IOctopusAPI.MOS_ID)) - continue; - String mosId = mosObject.getString(IOctopusAPI.MOS_ID); - if (!IOctopusAPI.NEXIO_MOS.equals(mosId)) - continue; - if (result == null) - result = new BasicDBList(); - result.add(mosObject); - } - return result; - } - - // private boolean isModified(Date date, BasicDBObject object, String name) { - // Date actualModifiedString = toDate(object, name); - // if (actualModifiedString == null) - // logger.trace(ACTUAL_MODIFIED_STRING_IS_NULL); - // int result = date.compareTo(actualModifiedString); - // return result <= 0; - // } - - private String extractScriptContent(BasicDBObject story) { - BasicDBObject script = NoSQLUtils.asDBObject(story, IOctopusAPI.SCRIPT); - if (script == null || script.isEmpty()) - return null; - - List body = NoSQLUtils.asList(script, IOctopusAPI.BODY); - if (body == null || body.size() == 0) - return null; - - StringBuilder sb = new StringBuilder(); - - for (BasicDBObject bodyItem : body) { - if (bodyItem.containsKey(IOctopusAPI.LABEL)) { - sb.append(bodyItem.getString(IOctopusAPI.LABEL)); - sb.append(LINEFEED); - } - List contents = NoSQLUtils.asList(bodyItem, IOctopusAPI.CONTENT); - if (contents == null) - continue; - for (BasicDBObject content : contents) { - sb.append(extractContent(content)); - } - } - return sb.length() == 0 ? null : sb.toString(); - } - - private void fireProgressEvent(ProgressEvent evt) { - logger.debug("Progress changed to " + evt.getProgress() + "%"); - if (progressListenerList == null) - return; - Object[] listeners = progressListenerList.getListenerList(); - for (int i = 0; i < listeners.length; i += 2) { - if (listeners[i] == IProgressEventListener.class) - ((IProgressEventListener) listeners[i + 1]).progressChanged(evt); - } - } - private String extractContent(BasicDBObject content) { String scriptContent = ""; if (!content.containsKey(IOctopusAPI.TYPE)) @@ -380,6 +317,14 @@ public class OctopusDataMiner implements Runnable { return scriptContent; } + // private boolean isModified(Date date, BasicDBObject object, String name) { + // Date actualModifiedString = toDate(object, name); + // if (actualModifiedString == null) + // logger.trace(ACTUAL_MODIFIED_STRING_IS_NULL); + // int result = date.compareTo(actualModifiedString); + // return result <= 0; + // } + private String extractCustomColumnValue(String columnName, BasicDBObject story) { List customColumns = NoSQLUtils.asList(story, IOctopusAPI.CUSTOM_COLUMNS); if (customColumns == null) @@ -401,6 +346,61 @@ public class OctopusDataMiner implements Runnable { return result; } + private BasicDBList extractRelevantMOSObjects(BasicDBObject story) { + List mosObjects = NoSQLUtils.asList(story, IOctopusAPI.MOS_OBJECTS); + if (mosObjects == null) + return null; + BasicDBList result = null; + for (BasicDBObject mosObject : mosObjects) { + if (!mosObject.containsKey(IOctopusAPI.MOS_ID)) + continue; + String mosId = mosObject.getString(IOctopusAPI.MOS_ID); + if (!IOctopusAPI.NEXIO_MOS.equals(mosId)) + continue; + if (result == null) + result = new BasicDBList(); + result.add(mosObject); + } + return result; + } + + private String extractScriptContent(BasicDBObject story) { + BasicDBObject script = NoSQLUtils.asDBObject(story, IOctopusAPI.SCRIPT); + if (script == null || script.isEmpty()) + return null; + + List body = NoSQLUtils.asList(script, IOctopusAPI.BODY); + if (body == null || body.size() == 0) + return null; + + StringBuilder sb = new StringBuilder(); + + for (BasicDBObject bodyItem : body) { + if (bodyItem.containsKey(IOctopusAPI.LABEL)) { + sb.append(bodyItem.getString(IOctopusAPI.LABEL)); + sb.append(LINEFEED); + } + List contents = NoSQLUtils.asList(bodyItem, IOctopusAPI.CONTENT); + if (contents == null) + continue; + for (BasicDBObject content : contents) { + sb.append(extractContent(content)); + } + } + return sb.length() == 0 ? null : sb.toString(); + } + + private void fireProgressEvent(ProgressEvent evt) { + logger.debug("Progress changed to " + evt.getProgress() + "%"); + if (progressListenerList == null) + return; + Object[] listeners = progressListenerList.getListenerList(); + for (int i = 0; i < listeners.length; i += 2) { + if (listeners[i] == IProgressEventListener.class) + ((IProgressEventListener) listeners[i + 1]).progressChanged(evt); + } + } + private Date getLastUpdateTime() { Date result = null; DBCollection collection = db.getCollection(IOctopusAPI.TIME_COLLECTION_NAME); @@ -578,7 +578,7 @@ public class OctopusDataMiner implements Runnable { List rundownsList = NoSQLUtils.asList(rundowns); int idx = 1; for (BasicDBObject rundown : rundownsList) { - //logger.debug(CHECKING_RUNDOWN, rundown.getLong(ID), rundownsList.size(), idx); + logger.info(CHECKING_RUNDOWN, rundown.getLong(IOctopusAPI.ID), rundownsList.size(), idx); storeRundown(rundown, lastUpdateTime); int progress = idx * 50 / rundownsList.size(); if (progress - progressEvent.getProgress() > 0) { diff --git a/server/user.jobengine.osgi.commons/test/user/common/octopus/test/OctopusDataMinerTest.java b/server/user.jobengine.osgi.commons/test/user/common/octopus/test/OctopusDataMinerTest.java index 80e0bcc7..eb4ba4c0 100644 --- a/server/user.jobengine.osgi.commons/test/user/common/octopus/test/OctopusDataMinerTest.java +++ b/server/user.jobengine.osgi.commons/test/user/common/octopus/test/OctopusDataMinerTest.java @@ -7,7 +7,6 @@ import java.io.FileInputStream; import java.lang.invoke.MethodHandles; import java.net.URL; import java.sql.SQLException; -import java.util.HashSet; import java.util.List; import java.util.Properties; @@ -16,12 +15,7 @@ import org.junit.Test; import com.ibm.nosql.json.api.BasicDBList; import com.ibm.nosql.json.api.BasicDBObject; -import com.ibm.nosql.json.api.DB; -import com.ibm.nosql.json.api.DBCollection; import com.ibm.nosql.json.api.DBObject; -import com.ibm.nosql.json.api.NoSQLClient; -import com.ibm.nosql.json.api.QueryBuilder; -import com.ibm.nosql.json.api.WriteResult; import user.commons.octopus.IOctopusAPI; import user.commons.octopus.OctopusAPI; @@ -53,50 +47,6 @@ public class OctopusDataMinerTest { private OctopusDataMiner sut; - @Test - public void deleteOrphanStories() { - try { - DB db = NoSQLClient.getDB("jdbc:db2://10.228.198.1:50000/mccache:retrieveMessagesFromServerOnGetMessage=true;", "db2admin", "password", "test"); - DBCollection collection = db.getCollection("testCollection"); - - long id1 = 1, id2 = 2, id3 = 3, id4 = 4, id5 = 5; - - BasicDBObject obj1 = new BasicDBObject("id", id1); - BasicDBObject obj2 = new BasicDBObject("id", id2); - BasicDBObject obj3 = new BasicDBObject("id", id3); - BasicDBObject obj4 = new BasicDBObject("id", id4); - BasicDBObject obj5 = new BasicDBObject("id", id5); - - collection.save(obj1); - collection.save(obj2); - collection.save(obj3); - collection.save(obj4); - collection.save(obj5); - System.out.println("collection count " + collection.count()); - - HashSet storyIDs = new HashSet<>(); - // storyIDs.add(tesztid); - storyIDs.add(id1); - storyIDs.add(id2); - BasicDBObject query = (BasicDBObject) QueryBuilder.start().put("id").notIn(storyIDs.toArray()).get(); - - /* - * DBCursor cursor = collection.find(query); while - * (cursor.hasNext()) { DBObject obj = cursor.next(); - * System.out.println(obj); collection.remove(obj); } - */ - - WriteResult res = collection.remove(query); - System.out.println("collection count " + collection.count()); - System.out.println(res.getN()); - // BasicDBObject query = (BasicDBObject) - // QueryBuilder.start().put(ID).notIn(Arrays.asList(storyIDs)).get(); - - } catch (Exception e) { - System.out.println(e); - } - } - @Test public void integrationExecute() { // fixture diff --git a/server/user.jobengine.osgi.server/pages/index.zul b/server/user.jobengine.osgi.server/pages/index.zul index 3e3577e4..4cdc84cb 100644 --- a/server/user.jobengine.osgi.server/pages/index.zul +++ b/server/user.jobengine.osgi.server/pages/index.zul @@ -57,7 +57,7 @@ - +
diff --git a/server/user.jobengine.osgi.server/src/user/jobengine/server/JobEngine.java b/server/user.jobengine.osgi.server/src/user/jobengine/server/JobEngine.java index 5b0d9c2a..e08b3281 100644 --- a/server/user.jobengine.osgi.server/src/user/jobengine/server/JobEngine.java +++ b/server/user.jobengine.osgi.server/src/user/jobengine/server/JobEngine.java @@ -68,7 +68,7 @@ public class JobEngine implements IJobEngine { while (!messageQueue.isEmpty()) { IJobMessage message = messageQueue.poll(50, TimeUnit.MILLISECONDS); if (message != null) { - logger.info("Processing {}", message.getClass()); + //logger.debug("Processing {}", message.getClass()); message.process(JobEngine.this); } } @@ -100,8 +100,7 @@ public class JobEngine implements IJobEngine { while (!shutdown) { try { - IJobRuntime jobRuntime = null; - jobRuntime = runQueue.poll(50, TimeUnit.MILLISECONDS); + IJobRuntime jobRuntime = runQueue.poll(50, TimeUnit.MILLISECONDS); if (jobRuntime != null) { //logger.info("Begin processing job {}, RC count {}", jobRuntime.getId(), runQueue.size()); while (jobRuntime.hasNextInstruction() && jobRuntime.isRunable()) { @@ -145,8 +144,6 @@ public class JobEngine implements IJobEngine { } private volatile boolean isRunning; - - private volatile boolean shutdown = false; private final BlockingQueue runQueue; private final BlockingQueue messageQueue; private final List jobTemplates; @@ -210,27 +207,36 @@ public class JobEngine implements IJobEngine { @Override public void addToExecutorQueue(IJobRuntime jobRuntime) { - Object typeName = jobRuntime.popFromStack(); - // logger.info("addToExecutorQueue: " + typeName); - if (typeName != null && String.class.equals(typeName.getClass())) { - for (IJobStepExecutor executor : executors.values()) { - Class clazz = executor.getStepClass(); - if (clazz != null && clazz.getName().equals(typeName)) { - executor.submit(jobRuntime); - break; - } - } - } else { - logger.error("Executor type name is not correcty defined."); + try { + Object typeName = jobRuntime.popFromStack(); + if (typeName == null) + throw new Exception(jobRuntime.toString() + " illegal execution state detected: executor name is null."); + String executorName = String.valueOf(typeName); + if (!executors.containsKey(executorName)) + throw new Exception(jobRuntime.toString() + " executor is unavailable: " + executorName); + executors.get(executorName).submit(jobRuntime); + } catch (Exception e) { + logger.catching(e); + suspendJob(e, jobRuntime); } + // logger.info("addToExecutorQueue: " + typeName); + // if (typeName != null && String.class.equals(typeName.getClass())) { + // for (IJobStepExecutor executor : executors.values()) { + // Class clazz = executor.getStepClass(); + // if (clazz != null && clazz.getName().equals(typeName)) { + // executor.submit(jobRuntime); + // break; + // } + // } + // } else { + // logger.error("Executor type name is not correcty defined."); + // } } @Override public void addToRunQueue(IJobRuntime jobRuntime) { try { - - //if (jobRuntime.getIp() == 0) - logger.info("Adding Job {}-{} to run queue {}", jobRuntime.getId(), jobRuntime.getName(), jobRuntime.getProgram()); + logger.info("{} ading to run queue", jobRuntime); runQueue.put(jobRuntime); } catch (Exception e) { logger.error(e.getMessage(), e); @@ -668,7 +674,7 @@ public class JobEngine implements IJobEngine { if (submittedJobs.containsKey(id)) { IJobRuntime jobRuntime = submittedJobs.remove(id); fireJobChangedEvent(new JobChangedEvent(jobRuntime, SignalType.DELETE)); - logger.info("Removed from VM {}>", jobRuntime); + logger.info("--- {} removed from VM", jobRuntime); } } @@ -679,6 +685,16 @@ public class JobEngine implements IJobEngine { } } + private void removeSuspended() { + List removeId = new ArrayList<>(); + for (Long id : submittedJobs.keySet()) { + if (submittedJobs.get(id).getStatus() == JobStatus.SUSPENDED) + removeId.add(id); + } + for (Long id : removeId) + submittedJobs.remove(id); + } + /** * Job prioritasa megvaltozott. Job main queue-ban es a JobStepExecutorok soraiban is ujra kell rendezni a jobokat. Az ujrarendezes a put-nal is megy * automatikusan, mivel eltero prioritasu jobot dobhatnak be vagy default prioritasut a korabban atrendezett listaba. @@ -724,7 +740,6 @@ public class JobEngine implements IJobEngine { @Override public void shutdown() { - shutdown = true; if (schedulerService != null) schedulerService.shutdown(); @@ -750,7 +765,7 @@ public class JobEngine implements IJobEngine { } for (IJobStepExecutor executor : executors.values()) { logger.info("Stopping executor {}", executor.getStepClass()); - executor.shutdown(); + executor.waitShutdown(); } } @@ -758,6 +773,8 @@ public class JobEngine implements IJobEngine { @Override public void startup() { try { + removeSuspended(); + loadPrograms(); loadExecutors(); @@ -789,7 +806,7 @@ public class JobEngine implements IJobEngine { runtime.add(); addToRunQueue(runtime); submittedJobs.put(runtime.getId(), runtime); - logger.info("< Added to VM {}", runtime); + logger.info("+++ {} added to VM ", runtime); } IJobRuntime submit(IProgram program, IJobStatusChangedListener listener) { diff --git a/server/user.jobengine.osgi.server/src/user/jobengine/server/JobRuntime.java b/server/user.jobengine.osgi.server/src/user/jobengine/server/JobRuntime.java index 4ccf2d88..12b312c1 100644 --- a/server/user.jobengine.osgi.server/src/user/jobengine/server/JobRuntime.java +++ b/server/user.jobengine.osgi.server/src/user/jobengine/server/JobRuntime.java @@ -523,9 +523,4 @@ public class JobRuntime extends Job implements IJobRuntime { return job; } - @Override - public String toString() { - return String.format("#%s - %d - %s#", getName(), getId(), status); - } - } diff --git a/server/user.jobengine.osgi.server/src/user/jobengine/server/JobStepExecutor.java b/server/user.jobengine.osgi.server/src/user/jobengine/server/JobStepExecutor.java index 25790905..930f5def 100644 --- a/server/user.jobengine.osgi.server/src/user/jobengine/server/JobStepExecutor.java +++ b/server/user.jobengine.osgi.server/src/user/jobengine/server/JobStepExecutor.java @@ -17,7 +17,7 @@ import user.jobengine.server.steps.IJobStep; public class JobStepExecutor implements IJobStepExecutor { private class Worker extends Thread { - private boolean shutdown = false; + private volatile boolean shutdown = false; @Override public void run() { @@ -31,30 +31,33 @@ public class JobStepExecutor implements IJobStepExecutor { while (true) { try { jobRuntime = queue.poll(50, TimeUnit.MILLISECONDS); - if (jobRuntime != null) { - if (shutdown) { - jobEngine.sendMessage(new JobStepSkippedMessage(jobRuntime.getId())); - continue; - } - Object[] inputs = jobEngine.getInputsFromStack(jobRuntime); - Object[] outputs = null; - jobRuntime.setStatus(JobStatus.EXECUTING); - jobRuntime.NotifyUpdate(); - step = createStepObject(); - if (step == null) - throw new Exception("Step object is null"); - logger.info("Executing {}", jobRuntime); - jobRuntime.IncrementPriority(); - - // logger.info("Executor thread name is {} id is {}", Thread.currentThread().getName(), - // Thread.currentThread().getId()); - - outputs = step.run(jobEngine, jobRuntime, inputs); - jobEngine.sendMessage(new JobStepCompletedMessage(jobRuntime.getId(), outputs)); - } else { - if (shutdown) - break; + if (jobRuntime == null && shutdown) { + logger.trace("Shutting down"); + break; } + if (jobRuntime == null) + continue; + if (shutdown) { + logger.trace("{} skipping by shutdown", jobRuntime); + jobEngine.sendMessage(new JobStepSkippedMessage(jobRuntime.getId())); + continue; + } + Object[] inputs = jobEngine.getInputsFromStack(jobRuntime); + Object[] outputs = null; + jobRuntime.setStatus(JobStatus.EXECUTING); + jobRuntime.NotifyUpdate(); + step = createStepObject(); + if (step == null) + throw new Exception("Step object is null"); + logger.info("{} executing", jobRuntime); + jobRuntime.IncrementPriority(); + + // logger.info("Executor thread name is {} id is {}", Thread.currentThread().getName(), + // Thread.currentThread().getId()); + + outputs = step.run(jobEngine, jobRuntime, inputs); + jobEngine.sendMessage(new JobStepCompletedMessage(jobRuntime.getId(), outputs)); + } catch (Exception e) { logger.error("Error in {}", jobRuntime); Throwable t = e.getCause() == null ? e : e.getCause(); diff --git a/server/user.jobengine.osgi.server/src/user/jobengine/server/actions/SkipExecutingAction.java b/server/user.jobengine.osgi.server/src/user/jobengine/server/actions/SkipExecutingAction.java index f534b54e..31cce6a9 100644 --- a/server/user.jobengine.osgi.server/src/user/jobengine/server/actions/SkipExecutingAction.java +++ b/server/user.jobengine.osgi.server/src/user/jobengine/server/actions/SkipExecutingAction.java @@ -11,6 +11,7 @@ public class SkipExecutingAction implements IJobStatusAction { jobRuntime.decrementInstructionPointer(); jobRuntime.setStatus(JobStatus.RUNABLE); jobRuntime.NotifyUpdate(); + jobRuntime.restoreStack(); jobEngine.addToRunQueue(jobRuntime); } } diff --git a/server/user.jobengine.osgi.server/src/user/jobengine/server/actions/StatusMachine.java b/server/user.jobengine.osgi.server/src/user/jobengine/server/actions/StatusMachine.java index 84131cf4..a030bcdd 100644 --- a/server/user.jobengine.osgi.server/src/user/jobengine/server/actions/StatusMachine.java +++ b/server/user.jobengine.osgi.server/src/user/jobengine/server/actions/StatusMachine.java @@ -30,7 +30,7 @@ public class StatusMachine implements IStatusMachine { StatusMachineAction machineAction = new StatusMachineAction(jobAction, jobRuntime.getStatus()); if (actions.containsKey(machineAction)) { IJobStatusAction action = actions.get(machineAction); - logger.debug("New status at {} ({} -> {})", jobRuntime, jobRuntime.getStatus(), jobAction); + logger.debug("{} status change {} -> {}", jobRuntime, jobRuntime.getStatus(), jobAction); action.processAction(jobEngine, jobRuntime); } diff --git a/server/user.jobengine.osgi.server/src/user/jobengine/server/scheduler/ScheduledJob.java b/server/user.jobengine.osgi.server/src/user/jobengine/server/scheduler/ScheduledJob.java index 2c3eff85..b47e93d7 100644 --- a/server/user.jobengine.osgi.server/src/user/jobengine/server/scheduler/ScheduledJob.java +++ b/server/user.jobengine.osgi.server/src/user/jobengine/server/scheduler/ScheduledJob.java @@ -34,7 +34,7 @@ public class ScheduledJob extends NativeJob { //implements InterruptableJob{ public void doJob() { try { IJobRuntime runtime = jobEngine.submit(templateName, jobName, jobParameters); //new JobStart(JobStartType.IMMEDIATE) - logger.info("Scheduled job start completed for {}", runtime); + // logger.info("{} scheduled", runtime); } catch (Exception e) { logger.error(e); } diff --git a/server/user.jobengine.osgi.server/src/user/jobengine/server/scheduler/SchedulerService.java b/server/user.jobengine.osgi.server/src/user/jobengine/server/scheduler/SchedulerService.java index 456c0bb7..f8005d39 100644 --- a/server/user.jobengine.osgi.server/src/user/jobengine/server/scheduler/SchedulerService.java +++ b/server/user.jobengine.osgi.server/src/user/jobengine/server/scheduler/SchedulerService.java @@ -186,7 +186,7 @@ public class SchedulerService { jobDataMap.put(ScheduledJob.JOB_SERVICE_INSTANCE, job); JobDetail jobDetail = JobBuilder.newJob(ScheduledJob.class).withIdentity(jobID).setJobData(jobDataMap).build(); scheduler.addJob(jobDetail, false, true); - logger.info("Job {} is successfully registered in scheduler", job); + logger.info("{} is registered in scheduler", job); } public void schedule(ScheduledJob job) { -- 2.54.0