From: Vásáry Dániel Date: Tue, 28 Nov 2017 12:49:30 +0000 (+0000) Subject: git-tfs-id: [http://tfs.userrendszerhaz.hu:8080/tfs/DefaultCollection]$/MediaCube... X-Git-Url: http://git.useribm.hu/?a=commitdiff_plain;h=d50f39c27fdbabaf7eefb11093f985289af1c999;p=mediacube.git git-tfs-id: [tfs.userrendszerhaz.hu:8080/tfs/DefaultCollection]$/MediaCube;C30772 --- diff --git a/client/Maestro/Configuration/configuration-archive.json b/client/Maestro/Configuration/configuration-archive.json new file mode 100644 index 00000000..bf961418 --- /dev/null +++ b/client/Maestro/Configuration/configuration-archive.json @@ -0,0 +1,66 @@ +{ + "title": "Archiválás", + "active": true, + "startInTray": false, + "enableCustomMetadataId": true, + "player": { + "enabled": true, + "autoStart": false, + "segmentEditor": true + }, + "source": { + "$type": "UNCSource", + "filter": "avi,wav,mxf", + "local": { + "address": "file://10.10.1.100/BRAAVOS/TOROKOR", + "userName": "mediacube", + "password": "Dn8t4gfHcK98o8hyPgLDhr5SgSji4JCxsfpMJsODikUp3nXgrM0UNCi45lLAK8ZOnmEneO44P9qpJ4QDqhctN6MxZodjJgdZTyoZKmSa+ECzEzLr/wPYNgxVaXrVotEy", + "timeout": 1000 + } + }, + "metadatas": [ + { + "$type": "OctopusMetadata", + "server": { + "address": "http://10.10.1.27/services/rest/octopus/", + "timeout": 1000 + } + }, + { + "$type": "TrafficMetadata", + "server": { + "address": "Data Source=10.10.1.45\\sql16;Initial Catalog=PA_Echo;Persist Security Info=True;", + "userName": "MAM", + "password": "7RKZYBzumKjL40SJwuwiFCvX57xuCN8zay6OttUm2wbrgImyYZBHyZTUUYrXX31Ge2Uwew07HYsqh2uzdJeDBDwcVntxaHg3nIpv9Dyq/odVoiC4tUF/K+lgvKWANcrZ", + "timeout": 1000 + } + }, + { + "$type": "MediaCubeMetadata", + "metadataTitleFormat": "%SOURCENAME%", + "metadataIDFormat": "%SOURCESTARTID%", + "server": { + "address": "http://10.10.1.27/services/rest/jobengine/", + "timeout": 1000 + } + } + ], + "targets": [ + { + "label": "Archiválás", + "processor": "UNCTargetProcessor", + "outputFormat": "%SOURCENAME%", + "tag": "Archiválás", + "saveArchiveMetadata": true, + "disableFileVersioning": true, + "killDateDays": 1, + "remote": { + "address": "file://10.10.1.100/BRAAVOS/ARCHIVE", + "userName": "mediacube", + "password": "Dn8t4gfHcK98o8hyPgLDhr5SgSji4JCxsfpMJsODikUp3nXgrM0UNCi45lLAK8ZOnmEneO44P9qpJ4QDqhctN6MxZodjJgdZTyoZKmSa+ECzEzLr/wPYNgxVaXrVotEy", + "timeout": 1000 + } + } + + ] +} diff --git a/client/Maestro/Configuration/configuration-nexio-ingest.json b/client/Maestro/Configuration/configuration-nexio-ingest.json index 829e0542..2686a69c 100644 --- a/client/Maestro/Configuration/configuration-nexio-ingest.json +++ b/client/Maestro/Configuration/configuration-nexio-ingest.json @@ -45,7 +45,7 @@ "targets": [ { "label": "Octopus mappába küldés", - "processor": "FTPTargetProcessor", + "processor": "FXPTargetProcessor", "outputFormat": "%ID%-%SOURCENAME%", "tag": "Betöltés", "subFolderFormat": "%IDROOT%", @@ -60,7 +60,7 @@ }, { "label": "Traffic mappába küldés", - "processor": "FTPTargetProcessor", + "processor": "FXPTargetProcessor", "outputFormat": "%ID%-%SOURCENAME%", "tag": "Betöltés", "subFolderFormat": "%IDROOT%", @@ -93,7 +93,7 @@ }, { "label": "Lebonyba küldés", - "processor": "FTPTargetProcessor", + "processor": "FXPTargetProcessor", "outputFormat": "%ID%", "tag": "Betöltés", "killDateDays": 7, @@ -106,7 +106,7 @@ }, { "label": "Archiválás", - "processor": "FTPTargetProcessor", + "processor": "FXPTargetProcessor", "outputFormat": "%ID%", "tag": "Archiválás", "saveArchiveMetadata": true, diff --git a/client/Maestro/Configuration/configuration-nle.json b/client/Maestro/Configuration/configuration-nle.json index 5f050d3d..0e3d822f 100644 --- a/client/Maestro/Configuration/configuration-nle.json +++ b/client/Maestro/Configuration/configuration-nle.json @@ -1,6 +1,6 @@ { "title": "NLE", - "active": true, + "active": false, "startInTray": false, "enableCustomMetadataId": true, "defaultWindowColor": "#E1BEE7", diff --git a/client/Maestro/Configuration/configuration-playout-ingest.json b/client/Maestro/Configuration/configuration-playout-ingest.json index aa818ef7..ddd13040 100644 --- a/client/Maestro/Configuration/configuration-playout-ingest.json +++ b/client/Maestro/Configuration/configuration-playout-ingest.json @@ -1,6 +1,6 @@ { "title": "Lebony betöltő", - "active": true, + "active": false, "startInTray": false, "enableCustomMetadataId": true, "player": { diff --git a/client/Maestro/Configuration/configuration-studio.json b/client/Maestro/Configuration/configuration-studio.json index d1b924fe..59b522ee 100644 --- a/client/Maestro/Configuration/configuration-studio.json +++ b/client/Maestro/Configuration/configuration-studio.json @@ -1,6 +1,6 @@ { "title": "Stúdió", - "active": true, + "active": false, "startInTray": false, "enableCustomMetadataId": true, "filter": "avi", diff --git a/client/Maestro/Maestro.csproj b/client/Maestro/Maestro.csproj index 3d557d72..0483df6f 100644 --- a/client/Maestro/Maestro.csproj +++ b/client/Maestro/Maestro.csproj @@ -245,6 +245,9 @@ Form + + Always + Always diff --git a/client/Maestro/MaestroForm.Designer.cs b/client/Maestro/MaestroForm.Designer.cs index 2c368a5f..a39221e2 100644 --- a/client/Maestro/MaestroForm.Designer.cs +++ b/client/Maestro/MaestroForm.Designer.cs @@ -32,11 +32,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); @@ -72,16 +72,10 @@ namespace Maestro { this.btnExecute = new System.Windows.Forms.Button(); this.scMain = new System.Windows.Forms.SplitContainer(); this.groupActions = new System.Windows.Forms.GroupBox(); + this.chkAutoScroll = new System.Windows.Forms.CheckBox(); 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(); @@ -92,6 +86,13 @@ 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(); @@ -220,7 +221,8 @@ namespace Maestro { // this.ilFolders.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("ilFolders.ImageStream"))); this.ilFolders.TransparentColor = System.Drawing.Color.Transparent; - this.ilFolders.Images.SetKeyName(0, "ic_folder_open_black_24dp_1x.jpg"); + this.ilFolders.Images.SetKeyName(0, "ic_folder_black_24dp_1x.png"); + this.ilFolders.Images.SetKeyName(1, "ic_folder_open_black_24dp_1x.png"); // // pSourceFilter // @@ -650,6 +652,7 @@ namespace Maestro { // groupActions // this.groupActions.BackColor = System.Drawing.Color.Transparent; + this.groupActions.Controls.Add(this.chkAutoScroll); this.groupActions.Controls.Add(this.tabSystem); this.groupActions.Dock = System.Windows.Forms.DockStyle.Fill; this.groupActions.Location = new System.Drawing.Point(0, 0); @@ -662,6 +665,20 @@ namespace Maestro { this.groupActions.Enter += new System.EventHandler(this.groupBox_Enter); this.groupActions.Leave += new System.EventHandler(this.groupBox_Leave); // + // chkAutoScroll + // + this.chkAutoScroll.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.chkAutoScroll.AutoSize = true; + this.chkAutoScroll.Checked = true; + this.chkAutoScroll.CheckState = System.Windows.Forms.CheckState.Checked; + this.chkAutoScroll.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238))); + this.chkAutoScroll.Location = new System.Drawing.Point(944, 24); + this.chkAutoScroll.Name = "chkAutoScroll"; + this.chkAutoScroll.Size = new System.Drawing.Size(69, 19); + this.chkAutoScroll.TabIndex = 2; + this.chkAutoScroll.Text = "Követés"; + this.chkAutoScroll.UseVisualStyleBackColor = true; + // // tabSystem // this.tabSystem.Controls.Add(this.tabPage1); @@ -734,80 +751,6 @@ 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; @@ -886,11 +829,86 @@ namespace Maestro { // // Message // + this.Message.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells; this.Message.DataPropertyName = "Message"; this.Message.HeaderText = "Üzenet"; 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); @@ -940,6 +958,7 @@ namespace Maestro { ((System.ComponentModel.ISupportInitialize)(this.scMain)).EndInit(); this.scMain.ResumeLayout(false); this.groupActions.ResumeLayout(false); + this.groupActions.PerformLayout(); this.tabSystem.ResumeLayout(false); this.tabPage1.ResumeLayout(false); ((System.ComponentModel.ISupportInitialize)(this.dgJobs)).EndInit(); @@ -999,6 +1018,7 @@ namespace Maestro { private System.Windows.Forms.ToolStripButton btnShowFolders; 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 Commons.DataGridViewProgressColumn Progress; diff --git a/client/Maestro/MaestroForm.Metadata.cs b/client/Maestro/MaestroForm.Metadata.cs index 7a022140..caf99e13 100644 --- a/client/Maestro/MaestroForm.Metadata.cs +++ b/client/Maestro/MaestroForm.Metadata.cs @@ -112,7 +112,10 @@ namespace Maestro { if (result == DialogResult.OK && String.IsNullOrEmpty(textSelectedMetadata.Text)) { ArchiveMetadata saved = archiveMetadata; - textSelectedMetadata.Text = archiveMetadata.itemHouseId; + if (String.IsNullOrEmpty(textSelectedMetadata.Text)) + textSelectedMetadata.Text = archiveMetadata.mediaHouseId; + else + textSelectedMetadata.Text = archiveMetadata.itemHouseId; archiveMetadata = saved; SelectedMetadata.MetadataText = archiveMetadata.itemTitle; } @@ -238,10 +241,12 @@ namespace Maestro { if (masterId == null) return null; ArchiveMetadata result = new ArchiveMetadata(); - result.itemHouseId = ARCHIVEID_PREFIX + masterId.id.ToString(); - result.itemTitle = result.itemHouseId; - result.mediaHouseId = result.itemHouseId; - result.mediaTitle = result.mediaHouseId; + MediaCubeMetadata metadata = Configuration.GetMetadataProvider(); + string mcID = ARCHIVEID_PREFIX + masterId.id.ToString(); + result.itemHouseId = string.IsNullOrEmpty(metadata?.MetadataIDFormat) ? mcID : metadata.MetadataIDFormat; + result.itemTitle = String.IsNullOrEmpty(metadata?.MetadataTitleFormat) ? result.itemHouseId : metadata.MetadataTitleFormat; + result.mediaHouseId = mcID; + result.mediaTitle = result.itemTitle; return result; } diff --git a/client/Maestro/MaestroForm.Target.cs b/client/Maestro/MaestroForm.Target.cs index 665014c1..af9fb32b 100644 --- a/client/Maestro/MaestroForm.Target.cs +++ b/client/Maestro/MaestroForm.Target.cs @@ -8,6 +8,7 @@ using MaestroShared.Metadata; using MaestroShared.Targets; using MaestroShared.Target; using System.ComponentModel; +using MaestroShared.Commons; namespace Maestro { @@ -146,7 +147,7 @@ namespace Maestro { private TargetProcessorParameter CreateProcessorParameter(Target target, ISourceItem sourceItem) { FileSystemSource source = bindingSource.DataSource as FileSystemSource; - return new TargetProcessorParameter() { + TargetProcessorParameter result = new TargetProcessorParameter() { SourcePathOverride = (source == null || source.Path.Equals(Configuration.Source.Local.Address.LocalPath)) ? null : source.Path, MediaCubeApi = mediaCubeApi, SourceConfig = Configuration.Source, @@ -161,6 +162,23 @@ namespace Maestro { UserName = TrayApplicationContext.UserName, MessageBus = MessageBus }; + + if (SelectedMetadata.Kind == MetadataType.MediaCube) { + if (true.Equals(result.ArchiveMetadata?.itemTitle?.Contains("%"))) { + string title = PatternNameMaker.Get(result.ArchiveMetadata.itemTitle, result.ID, result.InputFileName, result.MetadataText); + result.ArchiveMetadata.itemTitle = title; + result.ArchiveMetadata.mediaTitle = title; + } + if (true.Equals(result.ArchiveMetadata?.itemHouseId?.Contains("%"))) { + string id = PatternNameMaker.Get(result.ArchiveMetadata.itemHouseId, result.ID, result.InputFileName, result.MetadataText); + if (String.IsNullOrEmpty(id)) + result.ArchiveMetadata.itemHouseId = result.ArchiveMetadata.mediaHouseId; + else + result.ArchiveMetadata.itemHouseId = id; + } + //result.ArchiveMetadata.mediaHouseId = id; + } + return result; } private List HandleCheckBoxReferences(string[] reference, bool check) { @@ -230,8 +248,8 @@ namespace Maestro { } ClearSelectedProcessors(); - if (processorWorker == null) - CreateJobsQueueWorker(); + if (processorWorkers == null) + CreateJobsQueueWorkers(); ActivateTab(0); SelectedSource = null; ClearSelectedMetadata(); diff --git a/client/Maestro/MaestroForm.cs b/client/Maestro/MaestroForm.cs index 9c721752..7d1b3748 100644 --- a/client/Maestro/MaestroForm.cs +++ b/client/Maestro/MaestroForm.cs @@ -7,6 +7,7 @@ using System.ComponentModel; using System.Drawing; using System.Windows.Forms; using System.Threading; +using System.Linq; using TrafficClient; using OctopusClient; using System.IO; @@ -27,7 +28,7 @@ namespace Maestro { private Dictionary> currentProcessors = new Dictionary>(); private BindingList jobs = new BindingList(); private ConcurrentQueue jobsQueue = new ConcurrentQueue(); - private BackgroundWorker processorWorker; + private BackgroundWorker[] processorWorkers; public IMessageBus MessageBus { get; set; } private IMessageBus errorMessageBus = new MessageBus(); private ToolTip formTooltip = new ToolTip(); @@ -132,30 +133,40 @@ namespace Maestro { e.Cancel = true; } - private void CreateJobsQueueWorker() { - processorWorker = new BackgroundWorker() { + private void CreateJobsQueueWorkers() { + processorWorkers = new BackgroundWorker[1]; + processorWorkers[0] = CreateWorker(); + //processorWorkers[1] = CreateWorker(); + } + + private BackgroundWorker CreateWorker() { + BackgroundWorker processorWorker = new BackgroundWorker() { WorkerSupportsCancellation = true }; - processorWorker.DoWork += (s, e) => { - while (!e.Cancel) { - ITargetProcessor job; - if (jobsQueue.TryDequeue(out job)) { - if (TargetProcessor.REVOKED.Equals(job.Status)) - continue; - (this).SafeCall(() => { - int position = jobs.IndexOf(job); - if (position == -1) - return; - bindingSourceJobs.Position = position; + processorWorker.DoWork += ProcessorWorker_DoWork; + processorWorker.RunWorkerAsync(); + return processorWorker; + } + + private void ProcessorWorker_DoWork(object sender, DoWorkEventArgs e) { + while (!e.Cancel) { + ITargetProcessor job; + if (jobsQueue.TryDequeue(out job)) { + if (TargetProcessor.REVOKED.Equals(job.Status)) + continue; + (this).SafeCall(() => { + int position = jobs.IndexOf(job); + if (position == -1) + return; + bindingSourceJobs.Position = position; + if (chkAutoScroll.Checked) dgJobs.FirstDisplayedScrollingRowIndex = position; - }); - job.Execute(); - } else { - Thread.Sleep(100); - } + }); + job.Execute(); + } else { + Thread.Sleep(100); } - }; - processorWorker.RunWorkerAsync(); + } } private void groupBox_Enter(object sender, EventArgs e) { @@ -195,8 +206,9 @@ namespace Maestro { } private void MaestroForm_FormClosed(object sender, FormClosedEventArgs e) { - if (processorWorker != null) - processorWorker.CancelAsync(); + if (processorWorkers == null) + return; + processorWorkers.ToList().ForEach(w => w.CancelAsync()); } private void dataGridJobs_CellEnter(object sender, DataGridViewCellEventArgs e) { @@ -213,7 +225,8 @@ namespace Maestro { } private void ActivateTab(int index) { - tabSystem.SelectedIndex = index; + if (chkAutoScroll.Checked) + tabSystem.SelectedIndex = index; } private void dataGridJobs_MouseClick(object sender, MouseEventArgs e) { @@ -252,6 +265,10 @@ namespace Maestro { row.DefaultCellStyle.BackColor = MaestroColors.Orange200; row.DefaultCellStyle.SelectionBackColor = MaestroColors.Orange200; break; + case TargetProcessor.SKIPPED: + row.DefaultCellStyle.BackColor = MaestroColors.Orange200; + row.DefaultCellStyle.SelectionBackColor = MaestroColors.Orange200; + break; case TargetProcessor.READY: row.DefaultCellStyle.BackColor = MaestroColors.BlueGray200; row.DefaultCellStyle.SelectionBackColor = MaestroColors.BlueGray200; @@ -268,6 +285,5 @@ namespace Maestro { treeFolders.SelectedNode = treeFolders.GetNodeAt(e.X, e.Y); } - } } diff --git a/client/Maestro/MaestroForm.resx b/client/Maestro/MaestroForm.resx index 5167bfdf..660d55ac 100644 --- a/client/Maestro/MaestroForm.resx +++ b/client/Maestro/MaestroForm.resx @@ -127,40 +127,42 @@ AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0 - ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAACU - BwAAAk1TRnQBSQF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H5BAABgAEBAZ8B+QQAAYABAQGfAfkEAAGAAQEBnwH5BAABgAEBAZ8B+QQAAYABAQGAAQEEAAGA + AQEBgAEBBAABgAH/AYAB/wQABP8EAAT/BAAE/wQACw== diff --git a/client/Maestro/Program.cs b/client/Maestro/Program.cs index 0aa1d4f6..b37bd606 100644 --- a/client/Maestro/Program.cs +++ b/client/Maestro/Program.cs @@ -37,18 +37,21 @@ namespace Maestro { securitySettings.AddAccessRule(allowEveryoneRule); using (var mutex = new Mutex(false, mutexId, out createdNew, securitySettings)) { var hasHandle = false; + bool enableInstance = TrayApplicationContext.HasCommandlineParameter(TrayApplicationContext.NOSINGLE); try { try { - hasHandle = mutex.WaitOne(500, false); - if (hasHandle == false) - MessageBox.Show("A MediaCube Maestro alkalmazás már fut egy példányban."); + if (!enableInstance) { + hasHandle = mutex.WaitOne(500, false); + if (hasHandle == false) + MessageBox.Show("A MediaCube Maestro alkalmazás már fut egy példányban."); + } } catch (AbandonedMutexException) { hasHandle = true; } } finally { - if (hasHandle) { + if (hasHandle || enableInstance) { TrayApplicationContext context = null; try { Application.EnableVisualStyles(); @@ -62,7 +65,8 @@ namespace Maestro { MessageBox.Show(new Form() { TopMost = true }, e.Message); } finally { - mutex.ReleaseMutex(); + if (hasHandle) + mutex.ReleaseMutex(); if (context != null) context.Stop(); } @@ -82,6 +86,8 @@ namespace Maestro { private const string DOMAIN_QUERY_ERROR = "A bejelentkezett felhasználó domain információja nem elérhető."; private const string NOSPLASH = "nosplash"; private const string NOLOGIN = "nologin"; + public const string NOSINGLE = "nosingle"; + private static Logger logger = LogManager.GetCurrentClassLogger(); private NotifyIcon trayIcon; private ConcurrentBag forms = new ConcurrentBag(); @@ -91,11 +97,11 @@ namespace Maestro { public static GlobalInfo GlobalConfig { get; internal set; } public TrayApplicationContext() { - //string x = Regex.Replace("xxx/yyy/1234-00_aaaANYAG/ANYAG", "[^0-9A-Za-z-._]", "*"); - //Debug.WriteLine(x); + string x = Regex.Replace("1234-00_aaaANYAG", "[^0-9$']", "*"); + Debug.WriteLine(x); } - private bool HasCommandlineParameter(string parameter) { + public static bool HasCommandlineParameter(string parameter) { String[] arguments = Environment.GetCommandLineArgs(); return arguments.ToList().Contains(parameter); } diff --git a/client/Maestro/Properties/AssemblyInfo.cs b/client/Maestro/Properties/AssemblyInfo.cs index f9d37067..7e8c38db 100644 --- a/client/Maestro/Properties/AssemblyInfo.cs +++ b/client/Maestro/Properties/AssemblyInfo.cs @@ -32,5 +32,5 @@ using System.Runtime.InteropServices; // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("2.0.5.4")] -[assembly: AssemblyFileVersion("2.0.5.4")] +[assembly: AssemblyVersion("2.0.5.5")] +[assembly: AssemblyFileVersion("2.0.5.5")] diff --git a/client/Maestro/Sources/FileSystemSource.cs b/client/Maestro/Sources/FileSystemSource.cs index 22408aa4..deffadca 100644 --- a/client/Maestro/Sources/FileSystemSource.cs +++ b/client/Maestro/Sources/FileSystemSource.cs @@ -9,6 +9,9 @@ using Maestro.Sources.Messages; using System.Drawing; using NLog; using MaestroShared.Commons; +using System.Diagnostics; +using MaestroShared.Resources; +using System.Threading; namespace Maestro.Sources { public delegate void ClearAndInitialize(); @@ -171,8 +174,10 @@ namespace Maestro.Sources { private void Shutdown() { parent.SafeCall(() => Clear()); - watcher.Dispose(); - watcher = null; + if (watcher != null) { + watcher.Dispose(); + watcher = null; + } } private void SetAcceptableExtensions(string fileExtensionFilter) { @@ -207,14 +212,35 @@ namespace Maestro.Sources { } private void initializeList(string path) { + logger.Trace("Entry"); string[] files = Directory.GetFiles(path); + logger.Trace("Got list"); var fileSourceItems = files.Select(f => CreateItem(new FileInfo(f), false)).OrderByDescending(i => i.Created); + logger.Trace("Created list"); try { fileSourceItems.Where(x => x.CanHandle(acceptableExtensions)).ToList().ForEach(i => parent.SafeCall(() => Add(i))); + logger.Trace("Added async list"); + //IAsyncResult invokeResult = parent.SafeCall(() => + // fileSourceItems.Where(x => x.CanHandle(acceptableExtensions)).ToList().ForEach(i => Add(i)) + //); + //BackgroundWorker bg = new BackgroundWorker(); + //bg.WorkerSupportsCancellation = true; + //bg.DoWork += (s, e) => { + // Color origColor = parent.BackColor; + // Color hlColor = MaestroColors.Yellow200; + // while (!invokeResult.IsCompleted) { + // parent.BackColor = parent.BackColor == hlColor ? origColor : hlColor; + // Thread.Sleep(1000); + // } + // logger.Trace("Added list"); + //}; + //bg.RunWorkerAsync(); + } catch (Exception e) { Shutdown(); } + Debug.WriteLine("initializeList exit"); } private void createWatch(string path) { diff --git a/client/MaestroShared/Commons/ObjectExtensions.cs b/client/MaestroShared/Commons/ObjectExtensions.cs index 7be04103..52df887f 100644 --- a/client/MaestroShared/Commons/ObjectExtensions.cs +++ b/client/MaestroShared/Commons/ObjectExtensions.cs @@ -4,14 +4,16 @@ using System.Windows.Forms; namespace MaestroShared.Commons { public static class ObjectExtensions { - public static void SafeCall(this Control ctrl, Action x, bool force = false) { - if (x != null) { - if (ctrl.InvokeRequired || force) { - ctrl.BeginInvoke(x); - } else { - x(); - } - } + public static IAsyncResult SafeCall(this Control ctrl, Action x, bool force = false) { + IAsyncResult result = null; + if (x == null) + return null; + if (ctrl.InvokeRequired || force) + result = ctrl.BeginInvoke(x); + else + x(); + + return result; } } diff --git a/client/MaestroShared/Commons/PatterNameMaker.cs b/client/MaestroShared/Commons/PatternNameMaker.cs similarity index 73% rename from client/MaestroShared/Commons/PatterNameMaker.cs rename to client/MaestroShared/Commons/PatternNameMaker.cs index 9927cd50..6112a07f 100644 --- a/client/MaestroShared/Commons/PatterNameMaker.cs +++ b/client/MaestroShared/Commons/PatternNameMaker.cs @@ -5,18 +5,21 @@ using System.Text; using System.Text.RegularExpressions; namespace MaestroShared.Commons { - public class PatterNameMaker { + public class PatternNameMaker { private const string NORMALIZE_TEXT_PATTERN = "[^0-9A-Za-z-._]"; + private const string SOURCESTARTID_PATTERN = "[^0-9]"; private const string PATTERN_TARGETNAME = "%TARGETNAME%"; private const string PATTERN_ID = "%ID%"; private const string PATTERN_IDROOT = "%IDROOT%"; private const string PATTERN_SOURCENAME = "%SOURCENAME%"; + private const string PATTERN_SOURCESTARTID = "%SOURCESTARTID%"; private const string PATTERN_TIMESTAMP = "%TIMESTAMP%"; private const string PATTERN_DATESTAMP = "%DATESTAMP%"; private const string DATETIME_FORMAT = "yyyyMMddhhmmss"; private const string PATTERN_TEXT = "%TEXT%"; private const string UNDERSCORE = "_"; private const string DATE_FORMAT_NODOTS = "yyyyMMdd"; + private const string HYPHEN = "-"; static private string Normalize(String s) { string normalizedString = s.Normalize(NormalizationForm.FormD); @@ -43,8 +46,17 @@ namespace MaestroShared.Commons { .Replace(PATTERN_TIMESTAMP, DateTime.Now.ToString(DATETIME_FORMAT, CultureInfo.InvariantCulture)) .Replace(PATTERN_DATESTAMP, DateTime.Now.ToString(DATE_FORMAT_NODOTS, CultureInfo.InvariantCulture)); - if (!String.IsNullOrEmpty(fileName)) + if (!String.IsNullOrEmpty(fileName)) { result = result.Replace(PATTERN_SOURCENAME, Normalize(Path.GetFileNameWithoutExtension(fileName))); + string sourceStartID = Regex.Replace(fileName, SOURCESTARTID_PATTERN, HYPHEN); + if (sourceStartID.Contains(HYPHEN)) + sourceStartID = sourceStartID.Substring(0, sourceStartID.IndexOf(HYPHEN)); + if (String.IsNullOrEmpty(sourceStartID)) + result = result.Replace(PATTERN_SOURCESTARTID, String.Empty); + else + result = result.Replace(PATTERN_SOURCESTARTID, sourceStartID); + + } if (!String.IsNullOrEmpty(text)) result = result.Replace(PATTERN_TEXT, Normalize(text)); diff --git a/client/MaestroShared/Configuration/ConfigurationInfo.cs b/client/MaestroShared/Configuration/ConfigurationInfo.cs index bb84ab4f..110d2c8a 100644 --- a/client/MaestroShared/Configuration/ConfigurationInfo.cs +++ b/client/MaestroShared/Configuration/ConfigurationInfo.cs @@ -140,5 +140,7 @@ namespace MaestroShared.Configuration { } public class MediaCubeMetadata : MetadataProvider { + public string MetadataTitleFormat { get; set; } + public string MetadataIDFormat { get; set; } } } diff --git a/client/MaestroShared/MaestroShared.csproj b/client/MaestroShared/MaestroShared.csproj index 0de39cbd..2bb82374 100644 --- a/client/MaestroShared/MaestroShared.csproj +++ b/client/MaestroShared/MaestroShared.csproj @@ -84,7 +84,7 @@ - + diff --git a/client/MaestroShared/Targets/FTPTargetProcessor.cs b/client/MaestroShared/Targets/FTPTargetProcessor.cs index b6ead38c..c193ef7f 100644 --- a/client/MaestroShared/Targets/FTPTargetProcessor.cs +++ b/client/MaestroShared/Targets/FTPTargetProcessor.cs @@ -20,9 +20,12 @@ namespace MaestroShared.Targets { public override void Initialize(Control parent, TargetProcessorParameter parameters) { base.Initialize(parent, parameters); FtpTrace.LogFunctions = false; - string address = parameters?.SourceConfig?.Remote?.Address.ToString(); - if (address == null) - throw new Exception("Nem található a 'source.remote.address' beállítás."); + string address = parameters?.SourceConfig?.Local?.Address.ToString(); + if (address == null) { + Message = "Nem található a 'source.local.address' beállítás."; + Status = REVOKED; + return; + } inputFile = null; if (!String.IsNullOrEmpty(parameters.SourcePathOverride)) { @@ -34,6 +37,7 @@ namespace MaestroShared.Targets { else Input = new Uri(Path.Combine(address, parameters.InputFileName)).LocalPath; + inputFile = new FileInfo(Input); //if (address == null) // throw new Exception("Missing 'source.remote' parameter."); //Uri inputUri = new Uri(Path.Combine(address, parameters.InputFileName)); diff --git a/client/MaestroShared/Targets/FXPTargetProcessor.cs b/client/MaestroShared/Targets/FXPTargetProcessor.cs index 09513ee2..49175610 100644 --- a/client/MaestroShared/Targets/FXPTargetProcessor.cs +++ b/client/MaestroShared/Targets/FXPTargetProcessor.cs @@ -25,8 +25,11 @@ namespace MaestroShared.Targets { //Input = inputUri.ToString(); string address = parameters?.SourceConfig?.Remote?.Address.ToString(); - if (address == null) - throw new Exception("Nem található a 'source.remote.address' beállítás."); + if (address == null) { + Message = "Nem található a 'source.remote.address' beállítás."; + Status = REVOKED; + return; + } if (!String.IsNullOrEmpty(parameters.SourcePathOverride)) { string relativePath = parameters.SourcePathOverride.Replace(parameters.SourceConfig.Local.Address.LocalPath, "").Replace(BACKSLASH, SLASH); @@ -96,8 +99,8 @@ namespace MaestroShared.Targets { FtpReply monitorReplyTYPE = monitorFTP.Execute("TYPE I"); if (!monitorReplyTYPE.Success) throw new Exception(targetReplyTYPE.ErrorMessage); - if (!monitorFTP.FileExists(OutputName)) - throw new Exception("A cél állomány nem jött létre."); + //if (!FileExists(OutputName)) + // throw new Exception("A cél állomány nem jött létre."); long overall = 0; long lastSize = 0; while (overall != ilength) { diff --git a/client/MaestroShared/Targets/TargetProcessor.cs b/client/MaestroShared/Targets/TargetProcessor.cs index 877d3a85..074b0fae 100644 --- a/client/MaestroShared/Targets/TargetProcessor.cs +++ b/client/MaestroShared/Targets/TargetProcessor.cs @@ -13,6 +13,7 @@ namespace MaestroShared.Targets { public const string ERROR = "Hiba"; public const string READY = "Kész"; public const string REVOKED = "Visszavonva"; + public const string SKIPPED = "Kihagyva"; private string status; private string message; private string id; diff --git a/client/MaestroShared/Targets/UNCTargetProcessor.cs b/client/MaestroShared/Targets/UNCTargetProcessor.cs index 2c0cdae0..5b2ef4a7 100644 --- a/client/MaestroShared/Targets/UNCTargetProcessor.cs +++ b/client/MaestroShared/Targets/UNCTargetProcessor.cs @@ -14,7 +14,7 @@ namespace MaestroShared.Targets { public class UNCTargetProcessor : TargetProcessor { private readonly Logger logger = LogManager.GetCurrentClassLogger(); - private const string SUCCESS = "Successfully completed."; + private const string SUCCESS = "Sikeresen betöltve."; private const string PROCESSING = "Processing {0}"; private const string PROCESSING_COMPLETED = "Finished processing {0}"; private const string FILENAME = "{0}{1}"; @@ -83,10 +83,11 @@ namespace MaestroShared.Targets { if (DeleteExisting(currentFile)) { UploadFile(); //logger.Info("Spend (s):" + (DateTime.Now - started).TotalSeconds); - ExecuteCompleted(); + Status = READY; + Message = SUCCESS; } - Status = READY; - Message = SUCCESS; + + ExecuteCompleted(); } catch (Exception e) { Status = ERROR; @@ -117,8 +118,11 @@ namespace MaestroShared.Targets { } else { if (Parameters.TargetConfig.EnableOverride) DeleteFile(currentFile); - else + else { + Status = SKIPPED; + Message = "A célállomány létezik, felülírása a konfiuráció alapján nem lehetséges."; result = false; + } } } return result; @@ -369,7 +373,7 @@ namespace MaestroShared.Targets { } protected string GetDynamicText(string pattern) { - return PatterNameMaker.Get(pattern, ID, InputName, Parameters.MetadataText); + return PatternNameMaker.Get(pattern, ID, InputName, Parameters.MetadataText); } private string CreateOutputFileName() { diff --git a/client/OctopusClient/OctopusIDSelector.cs b/client/OctopusClient/OctopusIDSelector.cs index 690a83e4..6c7c8acf 100644 --- a/client/OctopusClient/OctopusIDSelector.cs +++ b/client/OctopusClient/OctopusIDSelector.cs @@ -11,6 +11,7 @@ using System.IO; using MaestroShared.Targets; using MaestroShared.Target; using System.Diagnostics; +using MaestroShared.Commons; namespace OctopusClient { public delegate void OnSelectedIDChanged(string id, string name, string text); @@ -433,10 +434,15 @@ namespace OctopusClient { ITargetProcessor processor = TargetProcessor.Create(projectConfiguration.Target.Processor); processor.Initialize(null, processorParameter); + if (TargetProcessor.REVOKED.Equals(processor.Status)) { + MsgBox.Error(processor.Message); + return; + } + processor.Execute(); - if (!TargetProcessor.READY.Equals(processor.Status)) { - MessageBox.Show(processor.Message, null, MessageBoxButtons.OK, MessageBoxIcon.Error); + if (!TargetProcessor.READY.Equals(processor.Status) || !TargetProcessor.SKIPPED.Equals(processor.Status)) { + MsgBox.Error(processor.Message); return; }