--- /dev/null
+""\r
+{\r
+"FILE_VERSION" = "9237"\r
+"ENLISTMENT_CHOICE" = "NEVER"\r
+"PROJECT_FILE_RELATIVE_PATH" = ""\r
+"NUMBER_OF_EXCLUDED_FILES" = "0"\r
+"ORIGINAL_PROJECT_FILE_PATH" = ""\r
+"NUMBER_OF_NESTED_PROJECTS" = "0"\r
+"SOURCE_CONTROL_SETTINGS_PROVIDER" = "PROVIDER"\r
+}\r
{\r
"title": "Szerkesztő",\r
- "active": false,\r
+ "active": true,\r
"startInTray": false,\r
"enableCustomMetadataId": true,\r
"player": {\r
"outputFormat": "%ID%",\r
"tag": "Betöltés",\r
"nexioServer": true,\r
+ "nexioFileExistsMessage": "A feltöltéshez új 'placeholder' generálása szükséges az Octopus rendszerben, az anyagon belül az ALT+1 billenytűkombináció segítségével.",\r
"killDateDays": 7,\r
"disableFileVersioning": true,\r
"agency": "MAESTRO-EDITOR",\r
{\r
"title": "Lebony betöltő",\r
- "active": true,\r
+ "active": false,\r
"startInTray": false,\r
"enableCustomMetadataId": true,\r
"player": {\r
this.dgSource.CellMouseDoubleClick += new System.Windows.Forms.DataGridViewCellMouseEventHandler(this.dataGridSource_CellMouseDoubleClick);\r
this.dgSource.CellMouseEnter += new System.Windows.Forms.DataGridViewCellEventHandler(this.dataGridSource_CellMouseEnter);\r
this.dgSource.CellMouseLeave += new System.Windows.Forms.DataGridViewCellEventHandler(this.dataGridSource_CellMouseLeave);\r
- this.dgSource.CellPainting += new System.Windows.Forms.DataGridViewCellPaintingEventHandler(this.dataGridSource_CellPainting);\r
+ this.dgSource.CellPainting += new System.Windows.Forms.DataGridViewCellPaintingEventHandler(this.OnSourceCellPainting);\r
this.dgSource.KeyDown += new System.Windows.Forms.KeyEventHandler(this.dataGridSource_KeyDown);\r
// \r
// treeFolders\r
this.dgJobs.Size = new System.Drawing.Size(988, 90);\r
this.dgJobs.TabIndex = 0;\r
this.dgJobs.CellEnter += new System.Windows.Forms.DataGridViewCellEventHandler(this.dataGridJobs_CellEnter);\r
+ this.dgJobs.CellPainting += new System.Windows.Forms.DataGridViewCellPaintingEventHandler(this.OnJobsCellPainting);\r
this.dgJobs.MouseClick += new System.Windows.Forms.MouseEventHandler(this.dataGridJobs_MouseClick);\r
// \r
// columnLabel\r
using DxPlay;\r
using Maestro.Metadata;\r
using Maestro.Sources;\r
+using MaestroShared.Commons;\r
using MaestroShared.Configuration;\r
using MaestroShared.Metadata;\r
+using MaestroShared.Resources;\r
using System;\r
using System.Collections.Generic;\r
using System.Diagnostics;\r
return new FileInfo(inputUri.LocalPath);\r
}\r
\r
- private void dataGridSource_CellPainting(object sender, DataGridViewCellPaintingEventArgs e) {\r
+ private void OnSourceCellPainting(object sender, DataGridViewCellPaintingEventArgs e) {\r
if (e.RowIndex < 0)\r
return;\r
ISourceItem item = dgSource.Rows[e.RowIndex].DataBoundItem as ISourceItem;\r
return;\r
DataGridViewRow row = dgSource.Rows[e.RowIndex];\r
if (item.IsHighlighted) {\r
- row.DefaultCellStyle.BackColor = Color.DarkGreen;\r
+ row.DefaultCellStyle.BackColor = MaestroColors.Green200;\r
row.DefaultCellStyle.ForeColor = Color.White;\r
} else\r
row.DefaultCellStyle = null;\r
return;\r
var controlls = panelActions.Controls;\r
foreach (Control actual in controlls) {\r
- CheckBox actualCheckbox = actual as CheckBox;\r
- if (actualCheckbox != null && actualCheckbox.Text.Equals(reference)) {\r
+ if (actual is CheckBox actualCheckbox && actualCheckbox.Text.Equals(reference)) {\r
if (check)\r
actualCheckbox.Checked = check;\r
-\r
actualCheckbox.Enabled = !check;\r
}\r
}\r
}\r
\r
private void OnExecuteClick(object sender, EventArgs e) {\r
- foreach (var element in currentProcessors)\r
- foreach (ITargetProcessor value in element.Value) {\r
- jobs.Add(value);\r
- jobsQueue.Add(value);\r
+ foreach (var element in currentProcessors) {\r
+ foreach (ITargetProcessor processor in element.Value) {\r
+ jobs.Add(processor);\r
+ jobsQueue.Enqueue(processor);\r
}\r
+ }\r
\r
ClearSelectedProcessors();\r
if (processorWorker == null)\r
using MaestroShared.Configuration;\r
using MaestroShared.Targets;\r
using MaestroShared.Commons;\r
+using MaestroShared.Resources;\r
\r
namespace Maestro {\r
\r
private GroupBox[] groups;\r
private Dictionary<CheckBox, List<ITargetProcessor>> currentProcessors = new Dictionary<CheckBox, List<ITargetProcessor>>();\r
private BindingList<ITargetProcessor> jobs = new BindingList<ITargetProcessor>();\r
- private BlockingCollection<ITargetProcessor> jobsQueue = new BlockingCollection<ITargetProcessor>();\r
+ private ConcurrentQueue<ITargetProcessor> jobsQueue = new ConcurrentQueue<ITargetProcessor>();\r
private BackgroundWorker processorWorker;\r
public IMessageBus MessageBus { get; set; }\r
private IMessageBus errorMessageBus = new MessageBus();\r
\r
private void InitializeJobs() {\r
bindingSourceJobs.DataSource = jobs;\r
- foreach (DataGridViewColumn column in dgJobs.Columns) {\r
- column.HeaderCell.Style.Font = new Font(dgJobs.Font, FontStyle.Regular);\r
- }\r
+ //foreach (DataGridViewColumn column in dgJobs.Columns) {\r
+ // column.HeaderCell.Style.Font = new Font(dgJobs.Font, FontStyle.Regular);\r
+ //}\r
}\r
\r
private void MaestroForm_Resize(object sender, EventArgs e) {\r
processorWorker.DoWork += (s, e) => {\r
while (!e.Cancel) {\r
ITargetProcessor job;\r
- if (jobsQueue.TryTake(out job)) {\r
+ if (jobsQueue.TryDequeue(out job)) {\r
+ if (TargetProcessor.REVOKED.Equals(job.Status))\r
+ continue;\r
(this).SafeCall(() => {\r
int position = jobs.IndexOf(job);\r
if (position == -1)\r
}\r
\r
private void MaestroForm_FormClosed(object sender, FormClosedEventArgs e) {\r
- if (processorWorker != null) {\r
+ if (processorWorker != null)\r
processorWorker.CancelAsync();\r
- }\r
}\r
\r
private void dataGridJobs_CellEnter(object sender, DataGridViewCellEventArgs e) {\r
InitializeComponents();\r
}\r
\r
- //private void textBox1_KeyUp(object sender, KeyEventArgs e) {\r
- // if (e.KeyCode != Keys.Return)\r
- // return;\r
- // if (String.IsNullOrEmpty(txtSorceFilter.Text))\r
- // bindingSource.RemoveFilter();\r
- // else {\r
- // bindingSource.Filter = txtSorceFilter.Text;\r
- // }\r
- //}\r
-\r
private void ActivateTab(int index) {\r
tabSystem.SelectedIndex = index;\r
}\r
\r
- //private void UpdateDataGridMessagesChanged() {\r
- // dataGridMessages.DataSource = null;\r
- // dataGridMessages.DataSource = systemMessageBindingSource;\r
- //}\r
-\r
- //private void buttonDeleteFilter_Click(object sender, EventArgs e) {\r
- // if (!String.IsNullOrEmpty(txtSorceFilter.Text)) {\r
- // bindingSource.RemoveFilter();\r
- // txtSorceFilter.Text = string.Empty;\r
- // }\r
- //}\r
-\r
private void dataGridJobs_MouseClick(object sender, MouseEventArgs e) {\r
if (e.Button == MouseButtons.Right && dgJobs.SelectedRows.Count == 1) {\r
ContextMenu popupMenu = new ContextMenu();\r
MenuItem makeFileToProtected = new MenuItem(StringResources.ALLOMANY_VEDETTE_TETELE);\r
makeFileToProtected.Click += MakeFileToProtected_click;\r
- MenuItem deleteProcess = new MenuItem(StringResources.TORLES);\r
- deleteProcess.Click += DeleteProcess_click;\r
popupMenu.MenuItems.Add(makeFileToProtected);\r
- popupMenu.MenuItems.Add(deleteProcess);\r
popupMenu.Show(dgJobs, new Point(e.X, e.Y));\r
}\r
}\r
\r
private void MakeFileToProtected_click(object sender, EventArgs e) {\r
- ITargetProcessor current = bindingSourceJobs.Current as ITargetProcessor;\r
- if (current == null)\r
+ ITargetProcessor processor = bindingSourceJobs.Current as ITargetProcessor;\r
+ if (processor == null)\r
return;\r
- if (File.Exists(current.KillDatePath)) {\r
- File.Delete(current.KillDatePath);\r
- current.KillDate = string.Empty;\r
+ if (File.Exists(processor.KillDatePath)) {\r
+ File.Delete(processor.KillDatePath);\r
+ processor.KillDate = string.Empty;\r
}\r
}\r
\r
- private void DeleteProcess_click(object sender, EventArgs e) {\r
- ITargetProcessor current = bindingSourceJobs.Current as ITargetProcessor;\r
- if (current == null)\r
+ private void OnJobsCellPainting(object sender, DataGridViewCellPaintingEventArgs e) {\r
+ if (e.RowIndex < 0)\r
return;\r
- //ha van státusza, már nem törölhető\r
- if (current.Status != null)\r
+ ITargetProcessor item = dgJobs.Rows[e.RowIndex].DataBoundItem as ITargetProcessor;\r
+ if (item == null)\r
return;\r
- BackgroundWorker worker = new BackgroundWorker();\r
- worker.DoWork += (s, r) => {\r
- ITargetProcessor outJob;\r
- while (jobsQueue.TryTake(out outJob)) {\r
- if (!outJob.Equals(current)) {\r
- jobsQueue.TryAdd(outJob);\r
- }\r
- }\r
- };\r
- var actualRow = dgJobs.SelectedRows[0];\r
- dgJobs.Rows.Remove(actualRow);\r
+ DataGridViewRow row = dgJobs.Rows[e.RowIndex];\r
+ switch (item.Status) {\r
+ case TargetProcessor.ERROR:\r
+ row.DefaultCellStyle.BackColor = MaestroColors.Red200;\r
+ break;\r
+ case TargetProcessor.REVOKED:\r
+ row.DefaultCellStyle.BackColor = MaestroColors.Orange200;\r
+ break;\r
+ case TargetProcessor.READY:\r
+ row.DefaultCellStyle.BackColor = MaestroColors.BlueGray200;\r
+ break;\r
+ }\r
}\r
-\r
}\r
}\r
AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w\r
LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0\r
ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAACc\r
- BwAAAk1TRnQBSQFMAwEBAAEQAQABEAEAARABAAEQAQAE/wEJAQAI/wFCAU0BNgEEBgABNgEEAgABKAMA\r
+ BwAAAk1TRnQBSQFMAwEBAAEYAQABGAEAARABAAEQAQAE/wEJAQAI/wFCAU0BNgEEBgABNgEEAgABKAMA\r
AUADAAEQAwABAQEAAQgGAAEEGAABgAIAAYADAAKAAQABgAMAAYABAAGAAQACgAIAA8ABAAHAAdwBwAEA\r
AfABygGmAQABMwUAATMBAAEzAQABMwEAAjMCAAMWAQADHAEAAyIBAAMpAQADVQEAA00BAANCAQADOQEA\r
AYABfAH/AQACUAH/AQABkwEAAdYBAAH/AewBzAEAAcYB1gHvAQAB1gLnAQABkAGpAa0CAAH/ATMDAAFm\r
public string SuccessEmailPattern { get; set; }\r
public string Reference { get; set; }\r
public bool NexioServer { get; set; }\r
+ public string NexioFileExistsMessage { get; set; }\r
public string Agency { get; set; }\r
}\r
\r
<Compile Include="Metadata\Timecode.cs" />\r
<Compile Include="Properties\AssemblyInfo.cs" />\r
<Compile Include="Metadata\ArchiveMetadata.cs" />\r
+ <Compile Include="Resources\MaestroColors.cs" />\r
<Compile Include="Targets\FTPTargetProcessor.cs" />\r
<Compile Include="Targets\FXPTargetProcessor.cs" />\r
<Compile Include="Targets\ITargetProcessor.cs" />\r
--- /dev/null
+""\r
+{\r
+"FILE_VERSION" = "9237"\r
+"ENLISTMENT_CHOICE" = "NEVER"\r
+"PROJECT_FILE_RELATIVE_PATH" = ""\r
+"NUMBER_OF_EXCLUDED_FILES" = "0"\r
+"ORIGINAL_PROJECT_FILE_PATH" = ""\r
+"NUMBER_OF_NESTED_PROJECTS" = "0"\r
+"SOURCE_CONTROL_SETTINGS_PROVIDER" = "PROVIDER"\r
+}\r
--- /dev/null
+using System.Drawing;\r
+\r
+namespace MaestroShared.Resources {\r
+ public class MaestroColors {\r
+ public static readonly Color Green200 = Color.FromArgb(0xFF, 0xC5, 0xE1, 0xA5);\r
+ public static readonly Color Yellow200 = Color.FromArgb(0xFF, 0xE6, 0xEE, 0x9C);\r
+ public static readonly Color Orange200 = Color.FromArgb(0xFF, 0xFF, 0xCC, 0x80);\r
+ public static readonly Color Red200 = Color.FromArgb(0xFF, 0xEF, 0x9A, 0x9A);\r
+ public static readonly Color BlueGray200 = Color.FromArgb(0xFF, 0xB0, 0xBE, 0xC5);\r
+ }\r
+}\r
\r
protected override void BeforeExecute() {\r
base.BeforeExecute();\r
- targetFTP = CreateClient(parameters.TargetConfig.Remote);\r
+ targetFTP = CreateClient(Parameters.TargetConfig.Remote);\r
}\r
\r
protected override void AfterExecute() {\r
\r
protected void reconnect() {\r
TerminateClient(targetFTP);\r
- targetFTP = CreateClient(parameters.TargetConfig.Remote);\r
+ targetFTP = CreateClient(Parameters.TargetConfig.Remote);\r
EnsureDirectoryExistence(workingDir);\r
}\r
\r
\r
protected override string DetermineWorkingDirectory(Connection connection) {\r
string result = null;\r
- if (!String.IsNullOrEmpty(parameters.TargetConfig.SubFolderFormat)) {\r
- string name = GetDynamicName(parameters.TargetConfig.SubFolderFormat);\r
- if (parameters.TargetConfig.SubFolderFormat.Contains(PATTERN_TEXT)) {\r
+ if (!String.IsNullOrEmpty(Parameters.TargetConfig.SubFolderFormat)) {\r
+ string name = GetDynamicName(Parameters.TargetConfig.SubFolderFormat);\r
+ if (Parameters.TargetConfig.SubFolderFormat.Contains(PATTERN_TEXT)) {\r
string pattern = name.Split(HYPHEN[0])[0] + HYPHEN;\r
targetFTP.SetWorkingDirectory(connection.Address.LocalPath);\r
FtpListItem item = targetFTP.GetListing()?.Where(i => i.Type.Equals(FtpFileSystemObjectType.Directory) && i.Name.StartsWith(pattern)).FirstOrDefault();\r
\r
string input = inputUri.AbsolutePath.Replace(LITERAL_SPACE, SPACE);\r
long ilength = sourceFTP.GetFileSize(input);\r
- if (parameters.TargetConfig.NexioServer)\r
+ if (Parameters.TargetConfig.NexioServer)\r
ilength = ilength / 2;\r
\r
FtpReply replyPASV = targetFTP.Execute("PASV");\r
throw new Exception(replySTOR.ErrorMessage);\r
\r
\r
- monitorFTP = CreateClient(parameters.TargetConfig.Remote);\r
+ monitorFTP = CreateClient(Parameters.TargetConfig.Remote);\r
monitorFTP.SetWorkingDirectory(workingDir);\r
FtpReply monitorReplyTYPE = monitorFTP.Execute("TYPE I");\r
if (!monitorReplyTYPE.Success)\r
\r
namespace MaestroShared.Targets {\r
public interface ITargetProcessor : INotifyPropertyChanged {\r
+ TargetProcessorParameter Parameters { get; }\r
DateTime Started { get; set; }\r
DateTime Finished { get; set; }\r
string Input { get; set; }\r
\r
namespace MaestroShared.Targets {\r
public abstract class TargetProcessor : MarshalByRefObject, ITargetProcessor {\r
+ public const string INPROGRESS = "Folyamatban";\r
+ public const string ERROR = "Hiba";\r
+ public const string READY = "Kész";\r
+ public const string REVOKED = "Visszavonva";\r
private string status;\r
private string message;\r
private string id;\r
\r
public virtual void Initialize(Control parent, TargetProcessorParameter parameters) {\r
this.parent = parent;\r
+ this.Parameters = parameters;\r
}\r
\r
protected void NotifyPropertyChanged([CallerMemberName] String propertyName = "") {\r
protected virtual void ExecuteCompleted() {\r
}\r
\r
+ public TargetProcessorParameter Parameters { get; internal set; }\r
+\r
public string Status {\r
get {\r
return status;\r
private const string COMMERCIAL = "COMMERCIAL";\r
private const string JUNCTION = "JUNCTION";\r
private const string XML_EXT = ".xml";\r
- private const string INPROGRESS = "Folyamatban";\r
- private const string ERROR = "Hiba";\r
private const string DOT = ".";\r
private const string HYPHENSTAR = "-*";\r
private const string DATE_FORMAT_NODOTS = "yyyyMMdd";\r
- private const string READY = "Kész";\r
private const string HYPHEN_SPACES = " - ";\r
private const string PATTERN_TARGETNAME = "%TARGETNAME%";\r
private const string PATTERN_ID = "%ID%";\r
protected const string SLASH = "/";\r
protected FileInfo inputFile;\r
protected string workingDir;\r
- protected TargetProcessorParameter parameters;\r
\r
public WorkflowAction workFlowAction { get; set; }\r
\r
public override void Initialize(Control parent, TargetProcessorParameter parameters) {\r
base.Initialize(parent, parameters);\r
- this.parameters = parameters;\r
InputName = parameters.InputFileName;\r
Input = Path.Combine(parameters.SourceConfig.Local.Address.LocalPath, parameters.InputFileName);\r
inputFile = new FileInfo(Input);\r
bool result = false;\r
try {\r
BeforeExecute();\r
- workingDir = DetermineWorkingDirectory(parameters.TargetConfig.Remote);\r
+ workingDir = DetermineWorkingDirectory(Parameters.TargetConfig.Remote);\r
EnsureDirectoryExistence(workingDir);\r
OutputName = CreateOutputFileName();\r
- OutputName = OutputName.ToUpper();\r
- Output = "/".Equals(workingDir) ? OutputName : Path.Combine(workingDir, OutputName);\r
- Output = Output.Replace(@"\", "/");\r
+ CreateOutput(workingDir);\r
workFlowAction.source = Input;\r
workFlowAction.destination = Output;\r
Status = INPROGRESS;\r
//DateTime started = DateTime.Now;\r
string currentFile = GetOutputFilePath(workingDir, OutputName);\r
- if (FileExists(currentFile) && parameters.TargetConfig.DisableFileVersioning) {\r
- if (parameters.TargetConfig.NexioServer) {\r
- MessageBox.Show(String.Format($"Az '{OutputName}' állomány már létezik. A feltöltéshez új Octopus azonosító generálása szükséges."));\r
- } else \r
- DeleteFile(currentFile);\r
+ HandleFileExists(currentFile);\r
+ if (!REVOKED.Equals(Status)) {\r
+ UploadFile();\r
+ //logger.Info("Spend (s):" + (DateTime.Now - started).TotalSeconds);\r
+ ExecuteCompleted();\r
}\r
- UploadFile();\r
- //logger.Info("Spend (s):" + (DateTime.Now - started).TotalSeconds);\r
- ExecuteCompleted();\r
}\r
catch (Exception e) {\r
Status = ERROR;\r
Message = e.Message;\r
workFlowAction.description = Message;\r
logger.Error(e);\r
- if (parameters.TargetConfig.SendEmailOnError && !String.IsNullOrEmpty(parameters.TargetConfig.ErrorEmailRecipient) && !String.IsNullOrEmpty(parameters.TargetConfig.ErrorEmailPattern))\r
- SendEmail(parameters.TargetConfig.ErrorEmailRecipient, parameters.TargetConfig.ErrorEmailPattern);\r
+ if (Parameters.TargetConfig.SendEmailOnError && !String.IsNullOrEmpty(Parameters.TargetConfig.ErrorEmailRecipient) && !String.IsNullOrEmpty(Parameters.TargetConfig.ErrorEmailPattern))\r
+ SendEmail(Parameters.TargetConfig.ErrorEmailRecipient, Parameters.TargetConfig.ErrorEmailPattern);\r
}\r
finally {\r
AfterExecute();\r
return result;\r
}\r
\r
+ private void CreateOutput(string workingDir) {\r
+ Output = "/".Equals(workingDir) ? OutputName : Path.Combine(workingDir, OutputName);\r
+ Output = Output.Replace(@"\", "/");\r
+ }\r
+\r
+ private void HandleFileExists(string currentFile) {\r
+ if (FileExists(currentFile) && Parameters.TargetConfig.DisableFileVersioning) {\r
+ if (Parameters.TargetConfig.NexioServer) {\r
+ Status = REVOKED;\r
+ ShowNexioFileExistsMessage();\r
+ } else\r
+ DeleteFile(currentFile);\r
+ }\r
+ }\r
+\r
+ private void ShowNexioFileExistsMessage() {\r
+ string message = null;\r
+ if (String.IsNullOrEmpty(Parameters.TargetConfig.NexioFileExistsMessage))\r
+ message = "A feltöltéshez új Octopus azonosító generálása szükséges.";\r
+ else\r
+ message = Parameters.TargetConfig.NexioFileExistsMessage;\r
+ MessageBox.Show(String.Format($"Az '{OutputName}' állomány már létezik. {message}"));\r
+ }\r
+\r
protected virtual void DeleteFile(string currentFile) {\r
File.Delete(currentFile);\r
}\r
base.ExecuteCompleted();\r
workFlowAction.description = SUCCESS;\r
workFlowAction.successful = true;\r
- if (parameters.TargetConfig.NexioServer)\r
+ if (Parameters.TargetConfig.NexioServer)\r
UploadNexioMetadata();\r
else {\r
- if (parameters.TargetConfig.KillDateDays > 0)\r
+ if (Parameters.TargetConfig.KillDateDays > 0)\r
UploadKillDateFile();\r
}\r
\r
- if (parameters.TargetConfig.SaveArchiveMetadata && parameters.ArchiveMetadata != null)\r
+ if (Parameters.TargetConfig.SaveArchiveMetadata && Parameters.ArchiveMetadata != null)\r
CreateArchiveMetadata();\r
- if (parameters.TargetConfig.SaveMorpheusMetadata && parameters.ArchiveMetadata != null && parameters.MovieSegments != null && parameters.MovieSegments.Count > 0)\r
+ if (Parameters.TargetConfig.SaveMorpheusMetadata && Parameters.ArchiveMetadata != null && Parameters.MovieSegments != null && Parameters.MovieSegments.Count > 0)\r
UploadMorpheusMetadata();\r
- if (parameters.TargetConfig.SaveSegments && parameters.Segments != null)\r
- parameters.TrafficApi.UpdateTrafficInformation(parameters.VariantID, true, (TrafficMetadataType)parameters.MetadataKind, parameters.Segments);\r
+ if (Parameters.TargetConfig.SaveSegments && Parameters.Segments != null)\r
+ Parameters.TrafficApi.UpdateTrafficInformation(Parameters.VariantID, true, (TrafficMetadataType)Parameters.MetadataKind, Parameters.Segments);\r
\r
- if (parameters.TargetConfig.SendEmailOnSuccess && !String.IsNullOrEmpty(parameters.TargetConfig.SuccessEmailRecipient) && !String.IsNullOrEmpty(parameters.TargetConfig.SuccessEmailPattern))\r
- SendEmail(parameters.TargetConfig.SuccessEmailRecipient, parameters.TargetConfig.SuccessEmailPattern);\r
+ if (Parameters.TargetConfig.SendEmailOnSuccess && !String.IsNullOrEmpty(Parameters.TargetConfig.SuccessEmailRecipient) && !String.IsNullOrEmpty(Parameters.TargetConfig.SuccessEmailPattern))\r
+ SendEmail(Parameters.TargetConfig.SuccessEmailRecipient, Parameters.TargetConfig.SuccessEmailPattern);\r
Status = READY;\r
Message = SUCCESS;\r
}\r
private void UploadNexioMetadata() {\r
String xml = null;\r
string name = GetOutputName();\r
- string description = parameters.ArchiveMetadata?.mediaTitle;\r
- if (parameters.TargetConfig.KillDateDays > 0) {\r
+ string description = Parameters.ArchiveMetadata?.mediaTitle;\r
+ if (Parameters.TargetConfig.KillDateDays > 0) {\r
DateTime date = GetKillDate();\r
KillDate = date.ToString(DATE_FORMAT);\r
- xml = NexioXML.ToXML(name, date, description, parameters.TargetConfig.Agency);\r
+ xml = NexioXML.ToXML(name, date, description, Parameters.TargetConfig.Agency);\r
} else\r
- xml = NexioXML.ToXML(name, null, description, parameters.TargetConfig.Agency);\r
+ xml = NexioXML.ToXML(name, null, description, Parameters.TargetConfig.Agency);\r
byte[] content = Encoding.Unicode.GetBytes(xml);\r
UploadContent(name + XML_EXT, content);\r
}\r
\r
private void UploadMorpheusMetadata() {\r
string name = GetOutputName();\r
- string title = parameters.ArchiveMetadata?.itemTitle;\r
- if (!title.Equals(parameters.ArchiveMetadata?.mediaTitle))\r
- title += HYPHEN_SPACES + parameters.ArchiveMetadata?.mediaTitle;\r
+ string title = Parameters.ArchiveMetadata?.itemTitle;\r
+ if (!title.Equals(Parameters.ArchiveMetadata?.mediaTitle))\r
+ title += HYPHEN_SPACES + Parameters.ArchiveMetadata?.mediaTitle;\r
string type = null;\r
- switch (parameters.MetadataKind) {\r
+ switch (Parameters.MetadataKind) {\r
case MetadataType.TrafficMaterial:\r
type = PROGRAMME;\r
break;\r
type = JUNCTION;\r
break;\r
}\r
- byte[] content = MorpheusXML.ToXML(title, name, parameters.TargetConfig.DeviceIDMorpheus, type, parameters.MovieSegments);\r
- EnsureDirectoryExistence(parameters.TargetConfig.PathMorpheusMetadata);\r
+ byte[] content = MorpheusXML.ToXML(title, name, Parameters.TargetConfig.DeviceIDMorpheus, type, Parameters.MovieSegments);\r
+ EnsureDirectoryExistence(Parameters.TargetConfig.PathMorpheusMetadata);\r
UploadContent(name + XML_EXT, content);\r
}\r
\r
private void SendEmail(string to, string messagePattern) {\r
try {\r
string message = messagePattern.Replace(PATTERN_TARGETNAME, OutputName);\r
- parameters.MediaCubeApi.Notify(to, message);\r
+ Parameters.MediaCubeApi.Notify(to, message);\r
}\r
catch (Exception e) {\r
MessageBox.Show(parent, e.Message);\r
\r
private void SendWorkFlowAction() {\r
try {\r
- parameters.MediaCubeApi.Create<WorkflowAction>(workFlowAction);\r
+ Parameters.MediaCubeApi.Create<WorkflowAction>(workFlowAction);\r
}\r
catch (Exception e) {\r
MessageBox.Show(parent, e.Message);\r
\r
protected virtual string DetermineWorkingDirectory(Connection connection) {\r
string result = null;\r
- if (!String.IsNullOrEmpty(parameters.TargetConfig.SubFolderFormat)) {\r
- string name = GetDynamicName(parameters.TargetConfig.SubFolderFormat);\r
- if (parameters.TargetConfig.SubFolderFormat.Contains(PATTERN_TEXT)) {\r
+ if (!String.IsNullOrEmpty(Parameters.TargetConfig.SubFolderFormat)) {\r
+ string name = GetDynamicName(Parameters.TargetConfig.SubFolderFormat);\r
+ if (Parameters.TargetConfig.SubFolderFormat.Contains(PATTERN_TEXT)) {\r
string pattern = name.Split(HYPHEN[0])[0] + HYPHENSTAR;\r
string[] dirs = Directory.GetDirectories(connection.Address.LocalPath, pattern);\r
if (dirs.Length > 0)\r
\r
private DateTime GetKillDate() {\r
DateTime result = DateTime.Now;\r
- result = result.AddDays(parameters.TargetConfig.KillDateDays);\r
+ result = result.AddDays(Parameters.TargetConfig.KillDateDays);\r
return result;\r
}\r
\r
private void UploadKillDateFile() {\r
- Uri address = parameters.TargetConfig.Remote.Address;\r
+ Uri address = Parameters.TargetConfig.Remote.Address;\r
string statusWorkDir = Path.Combine(workingDir, STATUS_FOLDER);\r
EnsureDirectoryExistence(statusWorkDir);\r
DateTime date = GetKillDate();\r
}\r
\r
private void CreateArchiveMetadata() {\r
- Uri address = parameters.TargetConfig.Remote.Address;\r
+ Uri address = Parameters.TargetConfig.Remote.Address;\r
string statusWorkDir = Path.Combine(workingDir, STATUS_FOLDER);\r
EnsureDirectoryExistence(statusWorkDir);\r
string fileName = String.Format(METADATA_FILE, OutputName);\r
//logger.Debug("Creating METADATA file {0}", fileName);\r
- byte[] content = Encoding.UTF8.GetBytes(parameters.ArchiveMetadata.ToString());\r
+ byte[] content = Encoding.UTF8.GetBytes(Parameters.ArchiveMetadata.ToString());\r
string ouputPath = GetOutputFilePath(statusWorkDir, fileName);\r
UploadContent(ouputPath, content);\r
}\r
\r
private void CreateTrafficMetadata() {\r
- Uri address = parameters.TargetConfig.Remote.Address;\r
+ Uri address = Parameters.TargetConfig.Remote.Address;\r
string statusWorkDir = Path.Combine(workingDir, STATUS_FOLDER);\r
EnsureDirectoryExistence(statusWorkDir);\r
string fileName = String.Format(METADATA_FILE, OutputName);\r
//logger.Debug("Creating METADATA file {0}", fileName);\r
- byte[] content = Encoding.UTF8.GetBytes(parameters.ArchiveMetadata.ToString());\r
+ byte[] content = Encoding.UTF8.GetBytes(Parameters.ArchiveMetadata.ToString());\r
string ouputPath = GetOutputFilePath(statusWorkDir, fileName);\r
UploadContent(ouputPath, content);\r
}\r
.Replace(PATTERN_TIMESTAMP, DateTime.Now.ToString(DATETIME_FORMAT, CultureInfo.InvariantCulture))\r
.Replace(PATTERN_DATESTAMP, DateTime.Now.ToString(DATE_FORMAT_NODOTS, CultureInfo.InvariantCulture));\r
\r
- if (!String.IsNullOrEmpty(parameters.MetadataText))\r
- result = result.Replace(PATTERN_TEXT, HYPHEN + RemoveDiacritics(parameters.MetadataText));\r
+ if (!String.IsNullOrEmpty(Parameters.MetadataText))\r
+ result = result.Replace(PATTERN_TEXT, HYPHEN + RemoveDiacritics(Parameters.MetadataText));\r
\r
// replace hungarian and special characters\r
result = Regex.Replace(result, NORMALIZE_TEXT_PATTERN, UNDERSCORE);\r
}\r
\r
protected virtual string CreateOutputFileName() {\r
- string nameWithoutExtension = GetDynamicName(parameters.TargetConfig.OutputFormat);\r
+ string nameWithoutExtension = GetDynamicName(Parameters.TargetConfig.OutputFormat);\r
string extension = InputName.Contains(DOT) ? InputName.Substring(InputName.LastIndexOf(DOT)) : DEFAULT_EXTENSION;\r
extension = extension.ToUpper();\r
string result = String.Format(FILENAME, nameWithoutExtension, extension);\r
- if (!parameters.TargetConfig.DisableFileVersioning) {\r
+ if (!Parameters.TargetConfig.DisableFileVersioning) {\r
int version = 1;\r
while (FileExists(GetOutputFilePath(workingDir, result))) {\r
string versioned = String.Format(VERSIONED_FILENAME, nameWithoutExtension, version, extension);\r
version++;\r
}\r
}\r
- return result;\r
+ return result.ToUpper();\r
}\r
\r
protected virtual void EnsureDirectoryExistence(string path) {\r