"label": "Adáskész",\r
"processor": "FXPTargetProcessor",\r
"outputFormat": "%ID%",\r
- "reference": [ "Mentés" ],\r
"saveSegments": true,\r
- "subFolderFormat": "%SOURCEFOLDERNAME%",\r
+ "subFolderFormat": "%SOURCEFOLDERNAME%_%CUSTOMPART%",\r
"tag": "Adáskész",\r
"remote": {\r
"address": "ftp://10.11.1.100/Promise/PROGRAM/TEST",\r
"timeout": 1000\r
}\r
},\r
- {\r
- "label": "Mentés",\r
- "readOnly": true,\r
- "processor": "UNCTargetProcessor",\r
- "outputFormat": "%SOURCENAME%",\r
- "tag": "Mentés",\r
- "subFolderFormat": "Transfered",\r
- "moveToFolder": true\r
+ {\r
+ "label": "Mentés",\r
+ "readOnly": true,\r
+ "processor": "UNCTargetProcessor",\r
+ "subFolderFormat": "Transfered_%SOURCEFOLDERNAME%_%CUSTOMPART%",\r
+ "outputFormat": "%SOURCENAME%",\r
+ "tag": "Mentés",\r
+ "moveToFolder": true\r
+ },\r
+ {\r
+ "label": "Mentés1",\r
+ "processor": "UNCTargetProcessor",\r
+ "subFolderFormat": "Transfered_%SOURCEFOLDERNAME%_%CUSTOMPART%",\r
+ "outputFormat": "%SOURCENAME%",\r
+ "tag": "Mentés1",\r
+ "remote": {\r
+ "address": "file://c:/_video",\r
+ "timeout": 1000\r
}\r
\r
+ }\r
+\r
+\r
]\r
}\r
using System;\r
using System.Collections.Generic;\r
using System.ComponentModel;\r
+using System.IO;\r
using System.Linq;\r
using System.Windows.Forms;\r
\r
private List<ITargetProcessor> CreateProcessors(Target target, CheckBox checkBox) {\r
List<ITargetProcessor> result = null;\r
DateTime createDate = DateTime.Now;\r
+\r
+ string partReplace = null;\r
+ if ((!string.IsNullOrEmpty(target.SubFolderFormat) && target.SubFolderFormat.Contains(PatternNameMaker.PATTERN_CUSTOMPART))\r
+ || !string.IsNullOrEmpty(target.OutputFormat) && target.OutputFormat.Contains(PatternNameMaker.PATTERN_CUSTOMPART)) {\r
+ partReplace = MsgBox.InputBox("Kérem adja meg a mappa/fájl nevének dinamikus részét!");\r
+ if (string.IsNullOrEmpty(partReplace)) {\r
+ checkBox.Checked = false;\r
+ throw new Exception("A szöveg kitöltése kötelező.");\r
+ }\r
+ if (partReplace.Any(Path.GetInvalidFileNameChars().Contains)) {\r
+ checkBox.Checked = false;\r
+ throw new Exception("A név nem tartalmazhat speciális karaktereket.");\r
+ }\r
+\r
+ MsgBox.Info(partReplace);\r
+ }\r
+\r
foreach (ISourceItem sourceItem in selectedSourceItems) {\r
if (sourceItem == null)\r
continue;\r
\r
TargetProcessorParameter processorParameter = null;\r
try {\r
- processorParameter = CreateProcessorParameter(target, sourceItem, createDate);\r
+ processorParameter = CreateProcessorParameter(target, sourceItem, createDate, partReplace);\r
} catch (Exception e) {\r
result = null;\r
break;\r
return true;\r
}\r
\r
- private TargetProcessorParameter CreateProcessorParameter(Target target, ISourceItem sourceItem, DateTime createDate) {\r
+ private TargetProcessorParameter CreateProcessorParameter(Target target, ISourceItem sourceItem, DateTime createDate, string partReplace) {\r
FileSystemSource source = bindingSource.DataSource as FileSystemSource;\r
\r
TargetProcessorParameter result = new TargetProcessorParameter();\r
result.Frames = sourceItem.Frames;\r
result.TargetOrder = Configuration.Targets.ToList().IndexOf(target);\r
result.SelectedSegments = SelectedMetadata?.Selected;\r
-\r
+ result.PartReplace = partReplace;\r
if (ArchiveMetadata != null) {\r
result.ArchiveMetadata = ArchiveMetadata.DeepClone(ArchiveMetadata);\r
result.ArchiveMetadata.duration = sourceItem.Frames;\r
result.ArchiveMetadata.userName = result.UserName;\r
if (SelectedMetadata.Kind == MetadataType.MediaCube) {\r
- result.ArchiveMetadata.itemHouseId = PatternNameMaker.Get(result.ArchiveMetadata.itemHouseId, result.ID, null, result.InputFileName, null, null, result.MetadataText);\r
- result.ArchiveMetadata.itemTitle = PatternNameMaker.Get(result.ArchiveMetadata.itemTitle, result.ID, null, result.InputFileName, null, null, result.MetadataText);\r
- result.ArchiveMetadata.mediaHouseId = PatternNameMaker.Get(result.ArchiveMetadata.mediaHouseId, result.ID, null, result.InputFileName, null, null, result.MetadataText);\r
- result.ArchiveMetadata.mediaTitle = PatternNameMaker.Get(result.ArchiveMetadata.mediaTitle, result.ID, null, result.InputFileName, null, null, result.MetadataText);\r
+ result.ArchiveMetadata.itemHouseId = PatternNameMaker.Get(result.ArchiveMetadata.itemHouseId, result.ID, null, result.InputFileName, null, null, result.MetadataText, null);\r
+ result.ArchiveMetadata.itemTitle = PatternNameMaker.Get(result.ArchiveMetadata.itemTitle, result.ID, null, result.InputFileName, null, null, result.MetadataText, null);\r
+ result.ArchiveMetadata.mediaHouseId = PatternNameMaker.Get(result.ArchiveMetadata.mediaHouseId, result.ID, null, result.InputFileName, null, null, result.MetadataText, null);\r
+ result.ArchiveMetadata.mediaTitle = PatternNameMaker.Get(result.ArchiveMetadata.mediaTitle, result.ID, null, result.InputFileName, null, null, result.MetadataText, null);\r
}\r
}\r
return result;\r
// You can specify all the values or you can default the Build and Revision Numbers\r
// by using the '*' as shown below:\r
// [assembly: AssemblyVersion("1.0.*")]\r
-[assembly: AssemblyVersion("2.1.0.8")]\r
-[assembly: AssemblyFileVersion("2.1.0.8")]\r
+[assembly: AssemblyVersion("2.1.0.9")]\r
+[assembly: AssemblyFileVersion("2.1.0.9")]\r
--- /dev/null
+namespace MaestroShared.Commons {\r
+ partial class InputForm {\r
+ /// <summary>\r
+ /// Required designer variable.\r
+ /// </summary>\r
+ private System.ComponentModel.IContainer components = null;\r
+\r
+ /// <summary>\r
+ /// Clean up any resources being used.\r
+ /// </summary>\r
+ /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>\r
+ protected override void Dispose(bool disposing) {\r
+ if (disposing && (components != null)) {\r
+ components.Dispose();\r
+ }\r
+ base.Dispose(disposing);\r
+ }\r
+\r
+ #region Windows Form Designer generated code\r
+\r
+ /// <summary>\r
+ /// Required method for Designer support - do not modify\r
+ /// the contents of this method with the code editor.\r
+ /// </summary>\r
+ private void InitializeComponent() {\r
+ this.txtText = new System.Windows.Forms.TextBox();\r
+ this.btnOK = new System.Windows.Forms.Button();\r
+ this.btnCancel = new System.Windows.Forms.Button();\r
+ this.SuspendLayout();\r
+ // \r
+ // txtText\r
+ // \r
+ this.txtText.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) \r
+ | System.Windows.Forms.AnchorStyles.Right)));\r
+ this.txtText.Location = new System.Drawing.Point(12, 12);\r
+ this.txtText.Name = "txtText";\r
+ this.txtText.Size = new System.Drawing.Size(380, 20);\r
+ this.txtText.TabIndex = 1;\r
+ // \r
+ // btnOK\r
+ // \r
+ this.btnOK.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));\r
+ this.btnOK.DialogResult = System.Windows.Forms.DialogResult.OK;\r
+ this.btnOK.Location = new System.Drawing.Point(317, 38);\r
+ this.btnOK.Name = "btnOK";\r
+ this.btnOK.Size = new System.Drawing.Size(75, 23);\r
+ this.btnOK.TabIndex = 2;\r
+ this.btnOK.Text = "Rendben";\r
+ this.btnOK.UseVisualStyleBackColor = true;\r
+ // \r
+ // btnCancel\r
+ // \r
+ this.btnCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));\r
+ this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;\r
+ this.btnCancel.Location = new System.Drawing.Point(236, 38);\r
+ this.btnCancel.Name = "btnCancel";\r
+ this.btnCancel.Size = new System.Drawing.Size(75, 23);\r
+ this.btnCancel.TabIndex = 3;\r
+ this.btnCancel.Text = "Mégsem";\r
+ this.btnCancel.UseVisualStyleBackColor = true;\r
+ // \r
+ // InputForm\r
+ // \r
+ this.AcceptButton = this.btnOK;\r
+ this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);\r
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;\r
+ this.AutoSize = true;\r
+ this.CancelButton = this.btnCancel;\r
+ this.ClientSize = new System.Drawing.Size(404, 68);\r
+ this.Controls.Add(this.btnCancel);\r
+ this.Controls.Add(this.btnOK);\r
+ this.Controls.Add(this.txtText);\r
+ this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow;\r
+ this.Name = "InputForm";\r
+ this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;\r
+ this.Text = "InputForm";\r
+ this.ResumeLayout(false);\r
+ this.PerformLayout();\r
+\r
+ }\r
+\r
+ #endregion\r
+\r
+ private System.Windows.Forms.TextBox txtText;\r
+ private System.Windows.Forms.Button btnOK;\r
+ private System.Windows.Forms.Button btnCancel;\r
+ }\r
+}
\ No newline at end of file
--- /dev/null
+using System;\r
+using System.Collections.Generic;\r
+using System.ComponentModel;\r
+using System.Data;\r
+using System.Drawing;\r
+using System.Linq;\r
+using System.Text;\r
+using System.Threading.Tasks;\r
+using System.Windows.Forms;\r
+\r
+namespace MaestroShared.Commons {\r
+ public partial class InputForm : Form {\r
+ public InputForm() {\r
+ InitializeComponent();\r
+ }\r
+\r
+ internal string getText() {\r
+ return txtText.Text;\r
+ }\r
+\r
+ internal void setTitle(string label) {\r
+ Text = label;\r
+ }\r
+ }\r
+}\r
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>\r
+<root>\r
+ <!-- \r
+ Microsoft ResX Schema \r
+ \r
+ Version 2.0\r
+ \r
+ The primary goals of this format is to allow a simple XML format \r
+ that is mostly human readable. The generation and parsing of the \r
+ various data types are done through the TypeConverter classes \r
+ associated with the data types.\r
+ \r
+ Example:\r
+ \r
+ ... ado.net/XML headers & schema ...\r
+ <resheader name="resmimetype">text/microsoft-resx</resheader>\r
+ <resheader name="version">2.0</resheader>\r
+ <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>\r
+ <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>\r
+ <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>\r
+ <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>\r
+ <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">\r
+ <value>[base64 mime encoded serialized .NET Framework object]</value>\r
+ </data>\r
+ <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">\r
+ <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>\r
+ <comment>This is a comment</comment>\r
+ </data>\r
+ \r
+ There are any number of "resheader" rows that contain simple \r
+ name/value pairs.\r
+ \r
+ Each data row contains a name, and value. The row also contains a \r
+ type or mimetype. Type corresponds to a .NET class that support \r
+ text/value conversion through the TypeConverter architecture. \r
+ Classes that don't support this are serialized and stored with the \r
+ mimetype set.\r
+ \r
+ The mimetype is used for serialized objects, and tells the \r
+ ResXResourceReader how to depersist the object. This is currently not \r
+ extensible. For a given mimetype the value must be set accordingly:\r
+ \r
+ Note - application/x-microsoft.net.object.binary.base64 is the format \r
+ that the ResXResourceWriter will generate, however the reader can \r
+ read any of the formats listed below.\r
+ \r
+ mimetype: application/x-microsoft.net.object.binary.base64\r
+ value : The object must be serialized with \r
+ : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter\r
+ : and then encoded with base64 encoding.\r
+ \r
+ mimetype: application/x-microsoft.net.object.soap.base64\r
+ value : The object must be serialized with \r
+ : System.Runtime.Serialization.Formatters.Soap.SoapFormatter\r
+ : and then encoded with base64 encoding.\r
+\r
+ mimetype: application/x-microsoft.net.object.bytearray.base64\r
+ value : The object must be serialized into a byte array \r
+ : using a System.ComponentModel.TypeConverter\r
+ : and then encoded with base64 encoding.\r
+ -->\r
+ <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">\r
+ <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />\r
+ <xsd:element name="root" msdata:IsDataSet="true">\r
+ <xsd:complexType>\r
+ <xsd:choice maxOccurs="unbounded">\r
+ <xsd:element name="metadata">\r
+ <xsd:complexType>\r
+ <xsd:sequence>\r
+ <xsd:element name="value" type="xsd:string" minOccurs="0" />\r
+ </xsd:sequence>\r
+ <xsd:attribute name="name" use="required" type="xsd:string" />\r
+ <xsd:attribute name="type" type="xsd:string" />\r
+ <xsd:attribute name="mimetype" type="xsd:string" />\r
+ <xsd:attribute ref="xml:space" />\r
+ </xsd:complexType>\r
+ </xsd:element>\r
+ <xsd:element name="assembly">\r
+ <xsd:complexType>\r
+ <xsd:attribute name="alias" type="xsd:string" />\r
+ <xsd:attribute name="name" type="xsd:string" />\r
+ </xsd:complexType>\r
+ </xsd:element>\r
+ <xsd:element name="data">\r
+ <xsd:complexType>\r
+ <xsd:sequence>\r
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />\r
+ <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />\r
+ </xsd:sequence>\r
+ <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />\r
+ <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />\r
+ <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />\r
+ <xsd:attribute ref="xml:space" />\r
+ </xsd:complexType>\r
+ </xsd:element>\r
+ <xsd:element name="resheader">\r
+ <xsd:complexType>\r
+ <xsd:sequence>\r
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />\r
+ </xsd:sequence>\r
+ <xsd:attribute name="name" type="xsd:string" use="required" />\r
+ </xsd:complexType>\r
+ </xsd:element>\r
+ </xsd:choice>\r
+ </xsd:complexType>\r
+ </xsd:element>\r
+ </xsd:schema>\r
+ <resheader name="resmimetype">\r
+ <value>text/microsoft-resx</value>\r
+ </resheader>\r
+ <resheader name="version">\r
+ <value>2.0</value>\r
+ </resheader>\r
+ <resheader name="reader">\r
+ <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\r
+ </resheader>\r
+ <resheader name="writer">\r
+ <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>\r
+ </resheader>\r
+</root>
\ No newline at end of file
\r
namespace MaestroShared.Commons {\r
public class MsgBox {\r
+\r
+ private static InputForm inputForm;\r
+\r
public static void Info(string text) {\r
MessageBox.Show(text, string.Empty, MessageBoxButtons.OK, MessageBoxIcon.Information);\r
}\r
public static bool YesNoQuestion(string text) {\r
return MessageBox.Show(text, string.Empty, MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes;\r
}\r
+ public static string InputBox(string label) {\r
+ if (inputForm == null)\r
+ inputForm = new InputForm();\r
+\r
+ inputForm.setTitle(label);\r
+ if (inputForm.ShowDialog() == DialogResult.OK)\r
+ return inputForm.getText();\r
+ return null;\r
+ }\r
}\r
}\r
using System;\r
using System.Globalization;\r
using System.IO;\r
+using System.Linq;\r
using System.Text;\r
using System.Text.RegularExpressions;\r
\r
private const string PATTERN_SOURCESTARTID = "%SOURCESTARTID%";\r
private const string PATTERN_TIMESTAMP = "%TIMESTAMP%";\r
private const string PATTERN_DATESTAMP = "%DATESTAMP%";\r
+ public const string PATTERN_CUSTOMPART = "%CUSTOMPART%";\r
private const string DATETIME_FORMAT = "yyyyMMddhhmmss";\r
private const string PATTERN_TEXT = "%TEXT%";\r
private const string UNDERSCORE = "_";\r
return result;\r
}\r
\r
- static public string Get(string pattern, string id, string sourcePath, string inputName, string outputName, string userName, string text, DateTime? storedDateTime = null, string json = null, string itemTitle = null, string mediaTitle = null, string format = null) {\r
+ static public string Get(string pattern, string id, string sourcePath, string inputName, string outputName, string userName, string text, string partReplace, DateTime? storedDateTime = null, string json = null, string itemTitle = null, string mediaTitle = null, string format = null) {\r
if (pattern == null)\r
return null;\r
string idRoot = id != null && id.Contains(UNDERSCORE) ? id.Split(UNDERSCORE[0])[0] : id;\r
.Replace(PATTERN_MEDIATITLE, mediaTitle)\r
.Replace(PATTERN_FORMAT, format);\r
\r
- if (!String.IsNullOrEmpty(inputName)) {\r
+ if (!string.IsNullOrEmpty(inputName)) {\r
result = result.Replace(PATTERN_SOURCENAME, Normalize(Path.GetFileNameWithoutExtension(inputName)));\r
string sourceStartID = Regex.Replace(inputName, SOURCESTARTID_PATTERN, HYPHEN);\r
if (sourceStartID.Contains(HYPHEN))\r
sourceStartID = sourceStartID.Substring(0, sourceStartID.IndexOf(HYPHEN));\r
- if (String.IsNullOrEmpty(sourceStartID))\r
+ if (string.IsNullOrEmpty(sourceStartID))\r
result = result.Replace(PATTERN_SOURCESTARTID, String.Empty);\r
else\r
result = result.Replace(PATTERN_SOURCESTARTID, sourceStartID);\r
}\r
\r
- if (!String.IsNullOrEmpty(sourcePath)) {\r
+ if (!string.IsNullOrEmpty(sourcePath)) {\r
result = result.Replace(PATTERN_SOURCEFOLDERNAME, Normalize(Path.GetFileName(sourcePath)));\r
}\r
\r
- if (!String.IsNullOrEmpty(outputName))\r
+ if (!string.IsNullOrEmpty(outputName))\r
result = result.Replace(PATTERN_TARGETNAME, outputName);\r
\r
- if (!String.IsNullOrEmpty(userName))\r
+ if (!string.IsNullOrEmpty(userName))\r
result = result.Replace(PATTERN_USERNAME, userName);\r
\r
- if (!String.IsNullOrEmpty(Environment.MachineName))\r
+ if (!string.IsNullOrEmpty(Environment.MachineName))\r
result = result.Replace(PATTERN_COMPUTERNAME, Environment.MachineName);\r
\r
- if (!String.IsNullOrEmpty(text))\r
+ if (!string.IsNullOrEmpty(text))\r
result = result.Replace(PATTERN_TEXT, Normalize(text));\r
+\r
+ if (result.Contains(PATTERN_CUSTOMPART)) {\r
+ if (string.IsNullOrEmpty(partReplace))\r
+ throw new Exception("Hiányzik a csereszöveg!");\r
+ result = result.Replace(PATTERN_CUSTOMPART, partReplace);\r
+ }\r
+\r
return result;\r
}\r
\r
<ItemGroup>\r
<Compile Include="Commons\CustomFileCopier.cs" />\r
<Compile Include="Commons\EdiusProject.cs" />\r
+ <Compile Include="Commons\InputForm.cs">\r
+ <SubType>Form</SubType>\r
+ </Compile>\r
+ <Compile Include="Commons\InputForm.Designer.cs">\r
+ <DependentUpon>InputForm.cs</DependentUpon>\r
+ </Compile>\r
<Compile Include="Commons\MsgBox.cs" />\r
<Compile Include="Commons\MorpheusXML.cs" />\r
<Compile Include="Commons\NexioXML.cs" />\r
</ProjectReference>\r
</ItemGroup>\r
<ItemGroup>\r
+ <EmbeddedResource Include="Commons\InputForm.resx">\r
+ <DependentUpon>InputForm.cs</DependentUpon>\r
+ </EmbeddedResource>\r
<EmbeddedResource Include="Controls\ColorSlider.resx">\r
<DependentUpon>ColorSlider.cs</DependentUpon>\r
</EmbeddedResource>\r
// You can specify all the values or you can default the Build and Revision Numbers\r
// by using the '*' as shown below:\r
// [assembly: AssemblyVersion("1.0.*")]\r
-[assembly: AssemblyVersion("2.1.0.4")]\r
-[assembly: AssemblyFileVersion("2.1.0.4")]\r
+[assembly: AssemblyVersion("2.1.0.5")]\r
+[assembly: AssemblyFileVersion("2.1.0.5")]\r
\r
namespace MaestroShared.Target {\r
public class TargetProcessorParameter {\r
+ public string PartReplace { get; set; }\r
public string SourcePath { get; set; }\r
public string SourcePathOverride { get; set; }\r
public Source SourceConfig { get; set; }\r
}\r
\r
protected string GetDynamicText(string pattern) {\r
- return PatternNameMaker.Get(pattern, ID, sourcePath, InputName, Output, Parameters.UserName, Parameters.MetadataText, Parameters.CreateDate, Parameters.ArchiveMetadata?.ToString(), Parameters.ArchiveMetadata?.itemTitle, Parameters.ArchiveMetadata?.mediaTitle, Parameters.ArchiveMetadata?.format);\r
+ return PatternNameMaker.Get(pattern, ID, sourcePath, InputName, Output, Parameters.UserName, Parameters.MetadataText, Parameters.PartReplace, Parameters.CreateDate, Parameters.ArchiveMetadata?.ToString(), Parameters.ArchiveMetadata?.itemTitle, Parameters.ArchiveMetadata?.mediaTitle, Parameters.ArchiveMetadata?.format);\r
}\r
\r
private string CreateOutputFileName() {\r
--- /dev/null
+package user.jobengine.server.steps;\r
+\r
+import user.commons.StoreUri;\r
+\r
+public class FILEZILLA_AVIDTransferToStep extends TransferStep {\r
+ @Override\r
+ @StepEntry\r
+ public Object[] execute(StoreUri sourceStoreUri, String sourceFileName, StoreUri targetStoreUri, String targetFileName) throws Exception {\r
+ return super.execute(sourceStoreUri, sourceFileName, targetStoreUri, targetFileName);\r
+ }\r
+}\r
--- /dev/null
+package user.jobengine.server.steps;\r
+\r
+import java.nio.file.Path;\r
+import java.nio.file.Paths;\r
+\r
+import org.apache.logging.log4j.LogManager;\r
+import org.apache.logging.log4j.Logger;\r
+\r
+import user.commons.StoreUri;\r
+\r
+public class NEXIO1TransferFromStep extends TransferStep {\r
+ private static final Logger logger = LogManager.getLogger();\r
+\r
+ @Override\r
+ @StepEntry\r
+ public Object[] execute(StoreUri sourceStoreUri, String sourceFileName, StoreUri targetStoreUri, String targetFileName) throws Exception {\r
+ Object[] result = null;\r
+ try {\r
+ Path targetFile = Paths.get(targetStoreUri.toString(true), targetFileName);\r
+ if (targetFile.toFile().exists()) {\r
+ logger.info(getMarker(), "Using previously retrived file {}", targetFile);\r
+ } else {\r
+ result = super.execute(sourceStoreUri, sourceFileName, targetStoreUri, targetFileName);\r
+ }\r
+ } catch (Exception e) {\r
+ logger.error(getMarker(), e.getMessage());\r
+ }\r
+ return result;\r
+ }\r
+}\r
--- /dev/null
+package user.jobengine.server.steps;\r
+\r
+import user.commons.StoreUri;\r
+\r
+public class NEXIO1TransferToStep extends TransferStep {\r
+ @Override\r
+ @StepEntry\r
+ public Object[] execute(StoreUri sourceStoreUri, String sourceFileName, StoreUri targetStoreUri, String targetFileName) throws Exception {\r
+ return super.execute(sourceStoreUri, sourceFileName, targetStoreUri, targetFileName);\r
+ }\r
+}\r
--- /dev/null
+package user.jobengine.server.steps;\r
+\r
+import java.nio.file.Path;\r
+import java.nio.file.Paths;\r
+\r
+import org.apache.logging.log4j.LogManager;\r
+import org.apache.logging.log4j.Logger;\r
+\r
+import user.commons.StoreUri;\r
+\r
+public class NEXIO2TransferFromStep extends TransferStep {\r
+ private static final Logger logger = LogManager.getLogger();\r
+\r
+ @Override\r
+ @StepEntry\r
+ public Object[] execute(StoreUri sourceStoreUri, String sourceFileName, StoreUri targetStoreUri, String targetFileName) throws Exception {\r
+ Object[] result = null;\r
+ try {\r
+ Path targetFile = Paths.get(targetStoreUri.toString(true), targetFileName);\r
+ if (targetFile.toFile().exists()) {\r
+ logger.info(getMarker(), "Using previously retrived file {}", targetFile);\r
+ } else {\r
+ result = super.execute(sourceStoreUri, sourceFileName, targetStoreUri, targetFileName);\r
+ }\r
+ } catch (Exception e) {\r
+ logger.error(getMarker(), e.getMessage());\r
+ }\r
+ return result;\r
+ }\r
+}\r
--- /dev/null
+package user.jobengine.server.steps;\r
+\r
+import user.commons.StoreUri;\r
+\r
+public class NEXIO2TransferToStep extends TransferStep {\r
+ @Override\r
+ @StepEntry\r
+ public Object[] execute(StoreUri sourceStoreUri, String sourceFileName, StoreUri targetStoreUri, String targetFileName) throws Exception {\r
+ return super.execute(sourceStoreUri, sourceFileName, targetStoreUri, targetFileName);\r
+ }\r
+}\r
--- /dev/null
+package user.jobengine.server.steps;\r
+\r
+import org.apache.logging.log4j.LogManager;\r
+import org.apache.logging.log4j.Logger;\r
+\r
+import user.commons.StoreUri;\r
+\r
+public class PASAPOOLTransferToStep extends TransferStep {\r
+ private static final Logger logger = LogManager.getLogger();\r
+\r
+ @Override\r
+ @StepEntry\r
+ public Object[] execute(StoreUri sourceStoreUri, String sourceFileName, StoreUri targetStoreUri, String targetFileName) throws Exception {\r
+ // try {\r
+ // StoreUri storeUri = getManager().getStoreUri("PEABLEBEACH", RemoteStoreProtocol.LOCAL);\r
+ // Path targetFile = Paths.get(storeUri.toString(true), targetFileName);\r
+ // if (targetFile.toFile().exists()) {\r
+ // logger.info("File already exists on BEACHPOOL: {}, skipping copy", targetFileName);\r
+ // return null;\r
+ // }\r
+ // } catch (Exception e) {\r
+ // logger.error(e.getMessage());\r
+ // }\r
+\r
+ return super.execute(sourceStoreUri, sourceFileName, targetStoreUri, targetFileName);\r
+ }\r
+}\r
--- /dev/null
+package user.jobengine.server.steps;\r
+\r
+import java.nio.file.Path;\r
+import java.nio.file.Paths;\r
+\r
+import org.apache.logging.log4j.LogManager;\r
+import org.apache.logging.log4j.Logger;\r
+\r
+import user.commons.StoreUri;\r
+\r
+public class TSMTransferFromStep extends TransferStep {\r
+ private static final Logger logger = LogManager.getLogger();\r
+\r
+ @Override\r
+ @StepEntry\r
+ public Object[] execute(StoreUri sourceStoreUri, String sourceFileName, StoreUri targetStoreUri, String targetFileName) throws Exception {\r
+ Object[] result = null;\r
+ try {\r
+ Path targetFile = Paths.get(targetStoreUri.toString(true), targetFileName);\r
+ if (targetFile.toFile().exists()) {\r
+ logger.info(getMarker(), "Using previously retrived file {}", targetFile);\r
+ } else {\r
+ result = super.execute(sourceStoreUri, sourceFileName, targetStoreUri, targetFileName);\r
+ }\r
+ } catch (Exception e) {\r
+ logger.error(getMarker(), e.getMessage());\r
+ }\r
+ return result;\r
+ }\r
+\r
+}\r
--- /dev/null
+package user.jobengine.server.steps;\r
+\r
+import user.commons.StoreUri;\r
+\r
+public class TSMTransferToStep extends TransferStep {\r
+ @Override\r
+ @StepEntry\r
+ public Object[] execute(StoreUri sourceStoreUri, String sourceFileName, StoreUri targetStoreUri, String targetFileName) throws Exception {\r
+ return super.execute(sourceStoreUri, sourceFileName, targetStoreUri, targetFileName);\r
+ }\r
+}\r
import java.lang.reflect.InvocationTargetException;\r
import java.sql.Connection;\r
import java.sql.DriverManager;\r
-import java.sql.ResultSet;\r
-import java.sql.SQLException;\r
-import java.sql.Statement;\r
import java.util.Properties;\r
\r
import org.apache.logging.log4j.LogManager;\r
\r
@Override\r
protected boolean checkObject(Object resourceObject) {\r
- DefaultContext context = (DefaultContext) resourceObject;\r
- boolean result = false;\r
- String sql = "SELECT 1 FROM SYSIBM.SYSDUMMY1";\r
- Statement stmt = null;\r
- ResultSet rs = null;\r
- try {\r
- stmt = context.getConnection().createStatement();\r
- rs = stmt.executeQuery(sql);\r
- result = true;\r
- } catch (Exception e1) {\r
- logger.catching(e1);\r
- if (rs != null)\r
- try {\r
- rs.close();\r
- } catch (SQLException e) {\r
- logger.catching(e);\r
- }\r
- if (stmt != null)\r
- try {\r
- stmt.close();\r
- } catch (SQLException e) {\r
- logger.catching(e);\r
- }\r
-\r
- }\r
- return result;\r
+ // DefaultContext context = (DefaultContext) resourceObject;\r
+ // boolean result = false;\r
+ // String sql = "SELECT 1 FROM SYSIBM.SYSDUMMY1";\r
+ // Statement stmt = null;\r
+ // ResultSet rs = null;\r
+ // try {\r
+ // stmt = context.getConnection().createStatement();\r
+ // rs = stmt.executeQuery(sql);\r
+ // while (rs.next())\r
+ // rs.getInt(1);\r
+ //\r
+ // result = true;\r
+ // } catch (Exception e1) {\r
+ // logger.catching(e1);\r
+ // if (rs != null)\r
+ // try {\r
+ // rs.close();\r
+ // } catch (SQLException e) {\r
+ // logger.catching(e);\r
+ // }\r
+ // if (stmt != null)\r
+ // try {\r
+ // stmt.close();\r
+ // } catch (SQLException e) {\r
+ // logger.catching(e);\r
+ // }\r
+ //\r
+ // }\r
+ // return result;\r
+ return true;\r
}\r
\r
@Override\r
validateObject(value);\r
DefaultContext context = (DefaultContext) value;\r
try {\r
- if (context == null)\r
+ if (context == null || context.isClosed())\r
return;\r
context.close();\r
} catch (Exception e) {\r
\r
public class TestConnectionPool {\r
private static ConnectionPool pool = null;\r
- \r
- @BeforeClass \r
- public static void beforeTest() {\r
- ConnectionPoolProperties properties = new ConnectionPoolProperties("com.ibm.db2.jcc.DB2Driver", \r
- "jdbc:db2://localhost:50000/MF", "Balazs Dombovari", "balage1", false, 1000);\r
- properties.add(ResourcePool.POOLSIZE, 2);\r
- pool = new ConnectionPool(properties);\r
- }\r
\r
- @AfterClass \r
+ @AfterClass\r
public static void afterTest() {\r
pool.close();\r
}\r
\r
+ @BeforeClass\r
+ public static void beforeTest() {\r
+ ConnectionPoolProperties properties = new ConnectionPoolProperties("com.ibm.db2.jcc.DB2Driver",\r
+ "-Djobengine.db.url=jdbc:db2://10.228.198.1:50000/mediaarc:retrieveMessagesFromServerOnGetMessage=true;", "db2admin", "password", false, 1000);\r
+ properties.add(ResourcePool.POOLSIZE, 10);\r
+ pool = new ConnectionPool(properties);\r
+ }\r
+\r
@Test\r
- public void testConcurrentBorrow(){\r
- //3 szál próbál kölcsönözni, de csak 2 erõforrás van. \r
- //A harmadik várakozik, míg fel nem szabadul egy erõforrás.\r
- TestingThread thread1 = new TestingThread("Thread1", pool);\r
- TestingThread thread2 = new TestingThread("Thread2", pool);\r
- TestingThread thread3 = new TestingThread("Thread3", pool);\r
- \r
- thread1.start();\r
- thread2.start();\r
- thread3.start();\r
+ public void testConcurrentBorrow() {\r
+\r
+ for (int i = 0; i < 10; i++) {\r
+ TestingThread thread = new TestingThread("Thread" + i, pool);\r
+ thread.start();\r
+ }\r
\r
try {\r
- Thread.sleep(10000);\r
+ Thread.sleep(10000);\r
} catch (InterruptedException e) {\r
}\r
-\r
- thread1.interrupt();\r
}\r
\r
}\r
<listheader label="Id" hflex="min" align="left" sort="auto(id)" />\r
<listheader label="ParentId" hflex="min" align="left" sort="auto(parentJobId)" />\r
<listheader label="Indítás" hflex="min" align="left" sort="auto(submitted)" />\r
- <listheader label="Kész" hflex="min" align="left" sort="auto(finnished)" />\r
+ <listheader label="Kész" width="60px" align="left" sort="auto(finnished)" />\r
<listheader label="Név" width="140px" align="left" sort="auto(name)" />\r
<listheader label="Prioritás" hflex="min" align="left" sort="auto(priority)" />\r
<listheader label="Anyag" width="140px" align="left" sort="auto(related)" />\r
<listcell label="@load(each.finished)" />\r
<listcell label="@load(each.name)" tooltiptext="@load(each.name)" />\r
<listcell label="@load(each.priority)" />\r
- <listcell label="@load(each.related)" />\r
+ <listcell label="@load(each.related)" tooltiptext="@load(each.related)" />\r
<listcell label="@load(each.status)" />\r
<listcell>\r
<progressmeter ca:data-animationspeed="-1" value="@load(each.progress)" width="100%" />\r