git-tfs-id: [http://tfs.userrendszerhaz.hu:8080/tfs/DefaultCollection]$/MediaCube...
authorVásáry Dániel <daniel.vasary@userrendszerhaz.hu>
Sun, 26 Nov 2017 14:29:45 +0000 (14:29 +0000)
committerVásáry Dániel <daniel.vasary@userrendszerhaz.hu>
Sun, 26 Nov 2017 14:29:45 +0000 (14:29 +0000)
21 files changed:
client/AudioRecorder/FileNameForm.Designer.cs
client/AudioRecorder/FileNameForm.cs
client/AudioRecorder/MainForm.Designer.cs
client/AudioRecorder/MainForm.cs
client/Maestro/Configuration/configuration-studio.json
client/Maestro/MaestroForm.Source.cs
client/Maestro/Sources/NexioRESTSource.cs
client/Maestro/Sources/NexioSourceItem.cs
client/Maestro/StringResources.Designer.cs
client/Maestro/StringResources.resx
client/MaestroShared/Resources/MaestroColors.cs
server/user.jobengine.osgi.commons/src/user/commons/Job.java
server/user.jobengine.osgi.commons/src/user/commons/nexio/NexioClipEventDispatcher.java
server/user.jobengine.osgi.commons/src/user/commons/nexio/api/Clip.java
server/user.jobengine.osgi.commons/src/user/commons/nexio/api/ClipImpl.java
server/user.jobengine.osgi.server/pages/joblist.zul
server/user.jobengine.osgi.server/pages/jobselector.zul
server/user.jobengine.osgi.server/pages/retrieveselector.zul
server/user.jobengine.osgi.server/src/user/jobengine/server/JobRuntime.java
server/user.jobengine.osgi.server/src/user/jobengine/server/actions/FinishRunableAction.java
server/user.jobengine.osgi.server/src/user/jobengine/zk/model/JobListModel.java

index 8193383352a207b456540e715b3ddd7d859fab31..0a36f7f3f6a2c232791ff1f47fd1027870d38e73 100644 (file)
@@ -26,7 +26,7 @@
             System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FileNameForm));\r
             this.octopusIDSelector1 = new OctopusClient.OctopusIDSelector();\r
             this.buttonCancel = new System.Windows.Forms.Button();\r
-            this.buttonRendben = new System.Windows.Forms.Button();\r
+            this.buttonOK = new System.Windows.Forms.Button();\r
             this.SuspendLayout();\r
             // \r
             // octopusIDSelector1\r
             // \r
             // buttonRendben\r
             // \r
-            this.buttonRendben.Enabled = false;\r
-            this.buttonRendben.Location = new System.Drawing.Point(195, 356);\r
-            this.buttonRendben.Name = "buttonRendben";\r
-            this.buttonRendben.Size = new System.Drawing.Size(75, 23);\r
-            this.buttonRendben.TabIndex = 7;\r
-            this.buttonRendben.Text = "Rendben";\r
-            this.buttonRendben.UseVisualStyleBackColor = true;\r
-            this.buttonRendben.Click += new System.EventHandler(this.buttonRendben_Click);\r
+            this.buttonOK.Enabled = false;\r
+            this.buttonOK.Location = new System.Drawing.Point(195, 356);\r
+            this.buttonOK.Name = "buttonRendben";\r
+            this.buttonOK.Size = new System.Drawing.Size(75, 23);\r
+            this.buttonOK.TabIndex = 7;\r
+            this.buttonOK.Text = "Rendben";\r
+            this.buttonOK.UseVisualStyleBackColor = true;\r
+            this.buttonOK.Click += new System.EventHandler(this.buttonOK_Click);\r
             // \r
             // FileNameForm\r
             // \r
-            this.AcceptButton = this.buttonRendben;\r
+            this.AcceptButton = this.buttonOK;\r
             this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);\r
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;\r
             this.BackColor = System.Drawing.Color.White;\r
             this.CancelButton = this.buttonCancel;\r
             this.ClientSize = new System.Drawing.Size(276, 383);\r
             this.ControlBox = false;\r
-            this.Controls.Add(this.buttonRendben);\r
+            this.Controls.Add(this.buttonOK);\r
             this.Controls.Add(this.buttonCancel);\r
             this.Controls.Add(this.octopusIDSelector1);\r
             this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;\r
@@ -81,7 +81,6 @@
             this.Name = "FileNameForm";\r
             this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;\r
             this.Text = "File Name";\r
-            this.Load += new System.EventHandler(this.FileNameForm_Load);\r
             this.ResumeLayout(false);\r
 \r
         }\r
@@ -89,6 +88,6 @@
         #endregion\r
         private OctopusClient.OctopusIDSelector octopusIDSelector1;\r
         private System.Windows.Forms.Button buttonCancel;\r
-        private System.Windows.Forms.Button buttonRendben;\r
+        private System.Windows.Forms.Button buttonOK;\r
     }\r
 }
\ No newline at end of file
index 74392addc3760850e944670172157b66938d12a7..d332f58ea3b951614f35b993a0744ec69b64846d 100644 (file)
@@ -7,7 +7,7 @@ namespace AudioRecorder {
     public partial class FileNameForm : Form {\r
         private String result;\r
         private MainForm mainForm;\r
-        private String id;\r
+        public string ID { get; internal set; }\r
 \r
         public FileNameForm(MainForm mainForm, AudioRecorderSettings settings) {\r
             InitializeComponent();\r
@@ -27,27 +27,19 @@ namespace AudioRecorder {
         }\r
 \r
         private void IdChangedEvent(string id, string name, string text) {\r
-            //TODO\r
-            this.id = name;\r
-            buttonRendben.Enabled = !String.IsNullOrEmpty(id);\r
+            buttonOK.Enabled = !String.IsNullOrEmpty(id);\r
+            ID = name;\r
         }\r
 \r
-        private void FileNameForm_Load(object sender, EventArgs e)\r
-        {\r
-\r
-        }\r
-\r
-        private void cancelButton_Click(object sender, EventArgs e)\r
-        {\r
-            Dispose();\r
+    \r
+        private void cancelButton_Click(object sender, EventArgs e) {\r
+            DialogResult = DialogResult.Cancel;\r
+            Close();\r
         }\r
 \r
-        private void buttonRendben_Click(object sender, EventArgs e) {\r
-            result = String.Format("{0}.wav", id);\r
-            if (!result.EndsWith(".wav"))\r
-                result = String.Format("{0}{1}", result, StringResources.DOT_WAV);\r
-            mainForm.recordFireEvent(result, id);\r
-            Dispose();\r
+        private void buttonOK_Click(object sender, EventArgs e) {\r
+            DialogResult = DialogResult.OK;\r
+            Close();\r
         }\r
     }\r
 }\r
index f87baebf9539c9237c960a58e9d87e84a189999e..a565f469c7c4b8bf4dd874d33cb63a648ae9da94 100644 (file)
@@ -34,7 +34,7 @@ namespace AudioRecorder {
             this.pauseButton = new System.Windows.Forms.Button();\r
             this.groupBox2 = new System.Windows.Forms.GroupBox();\r
             this.pmVolume = new Ernzo.WinForms.Controls.PeakMeterCtrl();\r
-            this.fileNameLabel = new System.Windows.Forms.Label();\r
+            this.txtRecordFilePath = new System.Windows.Forms.Label();\r
             this.playButton = new System.Windows.Forms.Button();\r
             this.groupBox3 = new System.Windows.Forms.GroupBox();\r
             this.tbVolume = new System.Windows.Forms.TrackBar();\r
@@ -158,11 +158,11 @@ namespace AudioRecorder {
             // \r
             // fileNameLabel\r
             // \r
-            this.fileNameLabel.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;\r
-            this.fileNameLabel.Location = new System.Drawing.Point(8, 45);\r
-            this.fileNameLabel.Name = "fileNameLabel";\r
-            this.fileNameLabel.Size = new System.Drawing.Size(233, 23);\r
-            this.fileNameLabel.TabIndex = 8;\r
+            this.txtRecordFilePath.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;\r
+            this.txtRecordFilePath.Location = new System.Drawing.Point(8, 45);\r
+            this.txtRecordFilePath.Name = "fileNameLabel";\r
+            this.txtRecordFilePath.Size = new System.Drawing.Size(233, 23);\r
+            this.txtRecordFilePath.TabIndex = 8;\r
             // \r
             // playButton\r
             // \r
@@ -183,7 +183,7 @@ namespace AudioRecorder {
             // \r
             this.groupBox3.Controls.Add(this.btnSelectAudio);\r
             this.groupBox3.Controls.Add(this.playButton);\r
-            this.groupBox3.Controls.Add(this.fileNameLabel);\r
+            this.groupBox3.Controls.Add(this.txtRecordFilePath);\r
             this.groupBox3.Location = new System.Drawing.Point(15, 258);\r
             this.groupBox3.Name = "groupBox3";\r
             this.groupBox3.Size = new System.Drawing.Size(332, 86);\r
@@ -239,7 +239,7 @@ namespace AudioRecorder {
         private System.Windows.Forms.Button btnSelectAudio;\r
         private System.Windows.Forms.GroupBox groupBox1;\r
         private System.Windows.Forms.GroupBox groupBox2;\r
-        private System.Windows.Forms.Label fileNameLabel;\r
+        private System.Windows.Forms.Label txtRecordFilePath;\r
         private System.Windows.Forms.Button playButton;\r
         private System.Windows.Forms.Button pauseButton;\r
         private System.Windows.Forms.GroupBox groupBox3;\r
index ad85735125a47134d827b988f96c1e7a48e27606..b14e058eccc9016920767e6a48f257aba546eb4c 100644 (file)
@@ -22,8 +22,6 @@ namespace AudioRecorder {
         private AudioRecorderSettings parameters;\r
         private ITimeCodeWorker timeCodeWorker;\r
         private IFileWorker fileWorker;\r
-        private String currentFileName;\r
-        private String currentFilePath;\r
         private bool recording;\r
         private Timer countDownTimer;\r
         private int countDown = 3;\r
@@ -143,37 +141,20 @@ namespace AudioRecorder {
         }\r
 \r
         void AudioEndpointVolume_OnVolumeNotification(AudioVolumeNotificationData data) {\r
-            //customTrackBar1.SetValue((int)CurrentDevice.AudioEndpointVolume.MasterVolumeLevel);\r
+            this.BeginInvoke(new Action(() => {\r
+                tbVolume.Value = (int)Math.Round(CurrentDevice.AudioEndpointVolume.MasterVolumeLevel);\r
+            }));\r
         }\r
 \r
 \r
-        //private void RefreshVolumePanel() {\r
-        //    try {\r
-        //        if (recording) {\r
-        //            if (volumeHeight >= parameters.loud_percent)\r
-        //                //SendMessage(verticalProgressBar1.Handle, 1040, 2, 0);\r
-        //                verticalProgressBar1.ForeColor = Color.Red;\r
-        //            else\r
-        //                // SendMessage(verticalProgressBar1.Handle, 1040, 1, 0);\r
-        //                verticalProgressBar1.ForeColor = Color.Green;\r
-        //            verticalProgressBar1.Value = (int)volumeHeight;\r
-        //        }\r
-        //    } catch (Exception e) {\r
-        //        Console.WriteLine(e.Message);\r
-        //    }\r
-        //}\r
-\r
-\r
         private void stop_Click(object sender, EventArgs e) {\r
             stopRecording();\r
         }\r
 \r
-\r
         private void startRecord() {\r
             try {\r
                 recording = true;\r
-                currentFilePath = Path.Combine(parameters.working_dir, "1.wav");\r
-                recorder.StartRecording(currentFilePath);\r
+                recorder.StartRecording(txtRecordFilePath.Text);\r
                 timeCodeWorker.Start();\r
                 pauseButton.Enabled = true;\r
                 recordButton.Enabled = false;\r
@@ -232,34 +213,34 @@ namespace AudioRecorder {
         }\r
 \r
         private void OnRecordClick(object sender, EventArgs e) {\r
-            //FileNameForm nameForm = new FileNameForm(this, parameters);\r
-            //nameForm.ShowDialog();\r
-\r
-            startRecord();\r
+            FileNameForm idSelectorForm = new FileNameForm(this, parameters);\r
+            if (idSelectorForm.ShowDialog() == DialogResult.Cancel)\r
+                return;\r
+            //string fileName = String.Format("{0}{1}", StringResources.DOT_WAV);\r
+            //currentFilePath = Path.Combine(parameters.working_dir, fileName);\r
+            recordFireEvent(idSelectorForm.ID);\r
+            //startRecord();\r
         }\r
 \r
-        public void recordFireEvent(String currentFileName, string id) {\r
+        public void recordFireEvent(String id) {\r
             recordButton.Enabled = false;\r
-            String path = String.Format("{0}\\{1}", parameters.working_dir, id);\r
-            if (!Directory.Exists(path))\r
-                Directory.CreateDirectory(path);\r
-            SetCurrentFileNameAndPath(currentFileName, path);\r
-            fileNameLabel.Text = currentFileName;\r
-            setToolTipToFileNameLabel(currentFilePath);\r
+            if (!Directory.Exists(parameters.working_dir))\r
+                Directory.CreateDirectory(parameters.working_dir);\r
+            \r
+            txtRecordFilePath.Text = GetCurrentFileNameAndPath(parameters.working_dir, id); ;\r
             countDownTimer.Start();\r
         }\r
 \r
-        private void SetCurrentFileNameAndPath(string currentFileName, string path) {\r
-            String filePath = String.Format("{0}\\{1}", path, currentFileName);\r
-            int i = 0;\r
-            this.currentFileName = currentFileName;\r
-            currentFilePath = String.Format("{0}\\{1}", path, currentFileName);\r
-            while (File.Exists(this.currentFilePath)) {\r
-                this.currentFileName = File.Exists(filePath) ? currentFileName.Insert(currentFileName.IndexOf("."), String.Format("-{0}", i)) : currentFileName;\r
-                currentFilePath = String.Format("{0}\\{1}", path, this.currentFileName);\r
+        private string GetCurrentFileNameAndPath(string path, string id) {\r
+            string fileName = String.Format("{0}{1}", id, ".WAV");\r
+            int i = 1;\r
+            string fullPath = Path.Combine(path, fileName);\r
+            while (File.Exists(fullPath)) {\r
+                fileName = String.Format("{0}-{1}{2}", id, i, ".WAV");\r
+                fullPath = Path.Combine(path, fileName);\r
                 i++;\r
             }\r
-\r
+            return fileName;\r
         }\r
 \r
         void timer_Tick(object sender, EventArgs e) {\r
@@ -273,13 +254,6 @@ namespace AudioRecorder {
             }\r
         }\r
 \r
-        private void setToolTipToFileNameLabel(String filePath) {\r
-            ToolTip toolTip = new ToolTip();\r
-            String uncPath = String.Format("{0}{1}{2}", parameters.unc_path, Path.DirectorySeparatorChar, currentFileName);\r
-            String tip = String.Format("{0}\n{1}", filePath, uncPath);\r
-            toolTip.SetToolTip(fileNameLabel, tip);\r
-        }\r
-\r
         private void selectAudioButton_Click(object sender, EventArgs e) {\r
             ShowAudioDeviceSelectorForm(true);\r
         }\r
@@ -313,7 +287,7 @@ namespace AudioRecorder {
         private void OnPlayClick(object sender, EventArgs e) {\r
             Process process = new Process();\r
             ProcessStartInfo startInfo = new ProcessStartInfo();\r
-            startInfo.FileName = new FileInfo(currentFilePath).FullName;\r
+            startInfo.FileName = new FileInfo(txtRecordFilePath.Text).FullName;\r
             process.StartInfo = startInfo;\r
             process.Start();\r
         }\r
index a3db7e9421fe30875103e5e7f5970f2fc9fc264f..d1b924fef166ff72456eec014eed2d9a9f10e1be 100644 (file)
@@ -1,6 +1,6 @@
 {\r
   "title": "Stúdió",\r
-  "active": false,\r
+  "active": true,\r
   "startInTray": false,\r
   "enableCustomMetadataId": true,\r
   "filter": "avi",\r
@@ -12,7 +12,7 @@
       "address": "ws://10.10.1.28/services/nexio"\r
     },\r
     "remote": {\r
-      "address": "ftp://10.10.1.56:2098",\r
+      "address": "ftp://10.10.1.55:2098",\r
       "userName": "administrator",\r
       "password": "+QtkeQdCTiOvZOgK/kUND4pO4/D+//r7ZIyluwMMdiqMEgO8iJErAG10ooWhPfiljQeXrdeyMzo7gWEZtcWpNSomGeDIbdMyQwtpqmMo1VEM3A27ZfzigY09YD46ECRh"\r
     }\r
index 64c140ef6831e77f08bc5deddd12532cac4d7935..16ff98b1068b2765b4a6d0ac8f6dd72d1f2fd2bd 100644 (file)
@@ -343,8 +343,8 @@ namespace Maestro {
                 return;\r
             DataGridViewRow row = dgSource.Rows[e.RowIndex];\r
             if (item.IsHighlighted) {\r
-                row.DefaultCellStyle.BackColor = MaestroColors.Green200;\r
-                row.DefaultCellStyle.ForeColor = Color.White;\r
+                row.DefaultCellStyle.BackColor = MaestroColors.LightGreen100;\r
+                row.DefaultCellStyle.ForeColor = Color.Black;\r
             } else\r
                 row.DefaultCellStyle = null;\r
         }\r
index 5fc1e3df67061407f4bd2d8804021a4df1fb50ae..2a74a9a144085e9ca491e1384f616ccade705128 100644 (file)
@@ -12,6 +12,7 @@ using System.Drawing;
 using NLog;\r
 using System.Collections.Generic;\r
 using MaestroShared.Commons;\r
+using MaestroShared.Metadata;\r
 \r
 namespace Maestro.Sources {\r
     class NexioRESTSource : BindingList<NexioSourceItem>, ISource {\r
@@ -48,6 +49,11 @@ namespace Maestro.Sources {
                         HeaderText = StringResources.UGYNOKSEG,\r
                         AutoSizeMode = DataGridViewAutoSizeColumnMode.None\r
                     },\r
+                    new DataGridViewTextBoxColumn(){\r
+                        DataPropertyName = "Duration",\r
+                        HeaderText = StringResources.HOSSZ,\r
+                        AutoSizeMode = DataGridViewAutoSizeColumnMode.None\r
+                    },\r
                     new DataGridViewTextBoxColumn() {\r
                         DataPropertyName = "Created",\r
                         HeaderText = StringResources.FELVETEL_DATUMA,\r
@@ -128,6 +134,9 @@ namespace Maestro.Sources {
                 case "Created":\r
                     result = i.Created;\r
                     break;\r
+                case "Duration":\r
+                    result = i.Duration;\r
+                    break;\r
             }\r
             return result;\r
         }\r
@@ -198,10 +207,14 @@ namespace Maestro.Sources {
 \r
         private void SetItem(ref NexioSourceItem item, JToken token) {\r
             item.ID = token[ID].ToString();\r
-            item.Name = token[LONGNAMEID].ToString() + ".mxf";\r
+            item.Name = token[LONGNAMEID].ToString() + ".MXF";\r
             item.Agency = token[EXTAGENCY]?.ToString();\r
             item.Created = DateTime.Parse(token[RECORDDATE]?.ToString());\r
             item.Modified = DateTime.Parse(token[MODIFIED]?.ToString());\r
+            int d = token.Value<int>(DURATION);\r
+            if (d < 0)\r
+                d = d * -1;\r
+            item.Duration = new Timecode(d).ToString();\r
         }\r
 \r
 \r
@@ -230,6 +243,7 @@ namespace Maestro.Sources {
             } else {\r
                 parent.SafeCall(() => {\r
                     SetItem(ref item, token);\r
+                    item.IsHighlighted = true;\r
                     if (item.CanHandle(acceptableAgencies))\r
                         return;\r
                     Remove(item);\r
index 19308822d5f94fc47bdc719327ee8dd3d95e660f..80d0ce53a921101bdfb71f42b49b19166a7e5986 100644 (file)
@@ -12,6 +12,7 @@ namespace Maestro.Sources {
         private DateTime modified;\r
         private string agency;\r
         private string id;\r
+        private string duration;\r
 \r
         public event PropertyChangedEventHandler PropertyChanged;\r
 \r
@@ -85,6 +86,14 @@ namespace Maestro.Sources {
             }\r
         }\r
 \r
+        public string Duration {\r
+            get => duration;\r
+            set {\r
+                duration = value;\r
+                NotifyPropertyChanged();\r
+            }\r
+        }\r
+\r
         public bool CanHandle(List<String> extensions) {\r
             if (extensions == null || extensions.Count < 1)\r
                 return true;\r
index f9070afab2a8146deea2f0b3004fa66cf1f213bc..5185848e851db9c4c618c798496c704d3550b2b5 100644 (file)
@@ -186,6 +186,15 @@ namespace Maestro {
             }\r
         }\r
         \r
+        /// <summary>\r
+        ///   Looks up a localized string similar to Hossz.\r
+        /// </summary>\r
+        internal static string HOSSZ {\r
+            get {\r
+                return ResourceManager.GetString("HOSSZ", resourceCulture);\r
+            }\r
+        }\r
+        \r
         /// <summary>\r
         ///   Looks up a localized string similar to Idő.\r
         /// </summary>\r
index d0cfc2822c6e8f4a2612426cb6cf2700278403de..9d5c831c91e0f3967ed444b9fe7536a33e1a26fe 100644 (file)
   <data name="HIBAS_TARGET_REFERENCE_CONFIG" xml:space="preserve">\r
     <value>Hibás reference configuráció a(z) {0} targetba</value>\r
   </data>\r
+  <data name="HOSSZ" xml:space="preserve">\r
+    <value>Hossz</value>\r
+  </data>\r
   <data name="IDO" xml:space="preserve">\r
     <value>Idő</value>\r
   </data>\r
index 32497ac4a6b538b565b2ed0ede2426c4aff25378..137886009d505ab4a2c952c6af1292b821ad4844 100644 (file)
@@ -2,7 +2,8 @@
 \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 LightGreen200 = Color.FromArgb(0xFF, 0xC5, 0xE1, 0xA5);\r
+        public static readonly Color LightGreen100 = Color.FromArgb(0xFF, 0xDC, 0xED, 0xC8);\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
index d0f18f663cb18c1d9c03f1d7986892a38e592766..a076568cfc279a24261de531729d2034e95d9d42 100644 (file)
@@ -26,7 +26,7 @@ public class Job extends Syncable implements IJob, Comparable<IJob> {
                priority = 0;\r
        }\r
 \r
-       /*      \r
+       /*\r
                @Override\r
                public int compareTo(IJob other) {\r
                        int res = 0;\r
@@ -38,8 +38,7 @@ public class Job extends Syncable implements IJob, Comparable<IJob> {
                }\r
        */\r
        /**\r
-        * 1. szempont prioritas\r
-        * 2. szempont azonos prioritasnal a rogzites datuma\r
+        * 1. szempont prioritas 2. szempont azonos prioritasnal a rogzites datuma\r
         */\r
        @Override\r
        public int compareTo(IJob job0) {\r
index 78a9f920036314da88dcec940e06248b60189ed8..a0a11137edcff99c5a995d2441ae3ebd429e51cb 100644 (file)
@@ -256,11 +256,6 @@ public class NexioClipEventDispatcher implements ClipEventListener {
                } catch (Exception e) {\r
                        //                      System.out.println(e);\r
                }\r
-               try {\r
-                       jsClip.put(DURATION, clip.getDuration());\r
-               } catch (Exception e) {\r
-                       //                      System.out.println(e);\r
-               }\r
                //jsClip.put(RECORDDATE, new DateTime(rs.getString(i++)).toDate());\r
                //jsClip.put(EXTAGENCY, rs.getString(i++));\r
                //jsClip.put(START, rs.getString(i++));\r
@@ -284,8 +279,9 @@ public class NexioClipEventDispatcher implements ClipEventListener {
                                BasicDBObject jsonClip = convertClipToJSON(clip);\r
                                String fileName = jsonClip.getString(LONGNAMEID);\r
                                String agency = jsonClip.getString(EXTAGENCY);\r
+                               int duration = jsonClip.getInt(DURATION);\r
                                if (fileName != null && !"".equals(fileName)) {\r
-                                       logger.debug("Found NEXIO clip: {} {} {}", clip.getId(), fileName, agency);\r
+                                       logger.debug("Found NEXIO clip: {} duration: {} agency: {}", fileName, duration, agency);\r
                                        this.saveClipIntoMongo(jsonClip, emptyMap, emptyMap);\r
                                } else {\r
                                        logger.debug("Found NEXIO clip: {} XID IS MISSING!!", clip.getId());\r
@@ -342,14 +338,14 @@ public class NexioClipEventDispatcher implements ClipEventListener {
                }\r
 \r
                /*\r
-               \r
+\r
                                int c = connection.read(buffer, 0, 2);\r
                                //2 bytes hosszan az idokozben hozzaadott id-k szamossaga\r
                                if (c < 2) {\r
                                        throw new ProtocolException("c, 2, 2");\r
                                }\r
                                //MSB, LSB\r
-               \r
+\r
                                return nofIds;\r
                        */\r
                return ret;\r
index 114fb300c5fced44135b5d1ae0f4fb4e6720e3b5..cfebc0a63741d47a5add574d7d152f3c9be7cdd5 100644 (file)
@@ -18,6 +18,8 @@ public interface Clip {
 
        public Calendar getKillDate() throws ClipNotFoundException, IOException, ProtocolException;
 
+       byte[] getMetadata();
+
        public Calendar getModifiedTimestamp() throws ClipNotFoundException, IOException, ProtocolException;
 
        Calendar getRecordDateTimestamp() throws ClipNotFoundException, IOException, ProtocolException;
index ece5fd4b82b30e513b03661deb080a39e946f308..f490640d65c7ac9e704e78759e2233cb4d5cf64d 100644 (file)
@@ -65,7 +65,8 @@ class ClipImpl implements Clip {
                        metadata = protocol.executeGetIDMetadata(id);
                        checkClipExists(metadata);
                }
-               return metadata[16] + (metadata[17] << 8) + (metadata[18] << 16) + (metadata[19] << 24);
+               //return metadata[16] + (metadata[17] << 8) + (metadata[18] << 16) + (metadata[19] << 24);
+               return metadata[19] << 24 | (metadata[18] & 0xFF) << 16 | (metadata[17] & 0xFF) << 8 | (metadata[16] & 0xFF);
        }
 
        @Override
@@ -116,6 +117,11 @@ class ClipImpl implements Clip {
                return result;
        }
 
+       @Override
+       public byte[] getMetadata() {
+               return metadata;
+       }
+
        @Override
        public Calendar getModifiedTimestamp() throws ClipNotFoundException, IOException, ProtocolException {
                if (timestamp == null) {
index 03191576463a351b517e6d7657cc092d08cdafa0..cfbc89fbd00dce272b2e3790f1eefa85a9b96295 100644 (file)
                <div height="100%" width="100%" style="background: #e3e3e3" align="left">\r
                        <groupbox height="94%" closable="false">\r
                                <caption sclass="boldfont" label="Aktív folyamatok" />\r
-                               <listbox id="lbJobList" sizedByContent="false" model="@load(jlm.jobList)" multiple="true" autopaging="true" mold="default" vflex="true" checkmark="true" \r
+                               <listbox id="lbJobList" sizedByContent="false" model="@load(jlm.jobList)" multiple="true" autopaging="true" mold="paging" vflex="true" checkmark="true" \r
                                        onSelect="@command('selectJob')" style="border: none; background: #e3e3e3 !important;" oddRowSclass="listbox-odd-style" sclass="listbox-normal-style" >\r
                                       <listhead sizable="true">\r
                                        <listheader label="Id" hflex="min" align="left"/>\r
-                                       <listheader label="Name" hflex="150px" align="left"/>\r
+                                       <listheader label="Submitted" hflex="min" align="left"/>\r
+                                       <listheader label="Finished" hflex="min" align="left"/>\r
+                                       <listheader label="Name" hflex="min" align="left"/>\r
                                        <listheader label="Priority" hflex="min" align="left"/>\r
-                                       <listheader label="Status" hflex="50px" align="left"/>\r
-                                       <listheader label="Progress" width="200px" align="left"/>\r
-                                       <listheader label="Message" align="left"/>\r
+                                       <listheader label="Status" hflex="min" align="left"/>\r
+                                       <listheader label="Progress" width="100px" align="left"/>\r
+                                       <listheader label="Message" align="max"/>\r
                                       </listhead>\r
                                       \r
                                       <template name="model">\r
                                           <listitem>\r
                                                        <listcell label="@load(each.id)"/>\r
+                                                       <listcell label="@load(each.submitted)"/>\r
+                                                       <listcell label="@load(each.finished)"/>\r
                                                        <listcell label="@load(each.name)"/>\r
                                                        <listcell label="@load(each.priority)"/>\r
                                                        <listcell label="@load(each.status)"/>\r
index 3572bf2fd971cea70442d315434906c7599df690..07687e2d36aa42e0f06286e150c6caf87b17446f 100644 (file)
@@ -11,7 +11,7 @@
            </listitem>\r
        </template>\r
        </listbox>\r
-    <hbox width="100%" pack="end">\r
+    <hbox width="100%" pack="center" align="center">\r
         <button id="closeButton" label="Mégsem" onClick="@command('close')" />\r
         <button id="executeButton" label="Futtatás" onClick="@command('execute')" />\r
     </hbox>\r
index 8e0249575c24846c84e900c2a30b6a7770d6a349..0a7b553f6e8d1ffd6d329673a2f48a3e78966c60 100644 (file)
@@ -16,7 +16,7 @@
                        </row>\r
                </rows>\r
        </grid>\r
-       <hbox width="100%" pack="end">\r
+       <hbox width="100%" pack="center">\r
         <button id="closeButton" label="Mégsem" onClick="@command('close')" />\r
         <button id="executeButton" label="Végrehajtás" onClick="@command('execute')" />\r
     </hbox>\r
index 1be00f5a2d2bb4769efaaec9e1a3f363194d63a0..2dfdf4931c21bd03cfeab744b178593e54de38d2 100644 (file)
@@ -54,6 +54,23 @@ public class JobRuntime extends Job implements IJobRuntime {
                status = JobStatus.RUNABLE;
        }
 
+       public JobRuntime(IJob job) {
+               variables = null;
+               jobEngine = null;
+               program = null;
+               listeners = null;
+               id = job.getId();
+               description = job.getDescription();
+               name = job.getName();
+               owner = job.getOwner();
+               priority = job.getPriority();
+               status = job.getStatus();
+               progress = job.getProgress();
+               template = job.getTemplate();
+               finished = job.getFinished();
+               submitted = job.getSubmitted();
+       }
+
        public JobRuntime(IJobEngine jobEngine, IJobRuntime runtime, IProgram program) {
                this.program = program;
                this.jobEngine = jobEngine;
index 1a47aa5235f09a0345f58f47981ad7e2ca7099c8..988623dd03777b0a72fb8d9702bb0a2cedae15bf 100644 (file)
@@ -14,6 +14,7 @@ public class FinishRunableAction implements IJobStatusAction {
                jobRuntime.setFinished(new Timestamp(System.currentTimeMillis()));\r
                jobRuntime.NotifyUpdate();\r
                jobRuntime.done();\r
+               jobRuntime.modify();\r
                jobEngine.removeJob(jobRuntime.getId());\r
        }\r
 }\r
index 6b3cbb3c214a00758c9391df5d7639032a457361..d64a859b8a4e9e6d337df9c036b764ad11cefb72 100644 (file)
@@ -26,48 +26,57 @@ import user.jobengine.server.JobRuntime;
 \r
 public class JobListModel extends BaseModel implements IJobChangedListener {\r
 \r
-       private List<JobChangedEvent> jobEvents = new ArrayList<JobChangedEvent>();\r
-       private static final Logger logger = LogManager.getLogger();\r
-       //protected CachedListModel searchResult = null;\r
-       private ListModelList<IJobRuntime> jobList = new ListModelList<IJobRuntime>();\r
-       private IJobRuntime selectedJob = null;\r
-       private IJobEngine jobEngine = null;\r
-       private int newPriority = 1;\r
-\r
-       @Init\r
-       public void init() {\r
-               try {\r
-                       jobList.setMultiple(true);\r
-\r
-                       this.jobEngine = JobEngine.getInstance();\r
+       class JobTweaker implements Runnable {\r
+               public JobTweaker() {\r
+                       Thread t = new Thread(this, "JobTweaker");\r
+                       t.start();\r
+               }\r
 \r
-                       //TESTJOBOK\r
-                       //test();\r
+               @Override\r
+               public void run() {\r
+                       for (int c = 1000; true; c++) {\r
+                               try {\r
+                                       for (int j = 0; j < jobList.size(); j++) {\r
+                                               IJobRuntime job = jobList.get(j);\r
+                                               if (j % 2 == 0) {\r
+                                                       if (job.getProgress() < 100) {\r
+                                                               job.setProgress(job.getProgress() + 2);\r
+                                                               jobEngine.fireJobChangedEvent(new JobChangedEvent(job, SignalType.UPDATE));\r
+                                                       }\r
+                                               }\r
+                                               if (job.getProgress() >= 100) {\r
+                                                       //calls : fireJobChangedEvent(new JobChangedEvent(job, SignalType.DELETE));\r
+                                                       jobEngine.removeJob(job.getId());\r
+                                                       jobEngine.fireJobChangedEvent(new JobChangedEvent(job, SignalType.DELETE));\r
+                                               }\r
+                                       }\r
 \r
-                       this.jobEngine.addJobChangedEventListener(this);\r
-                       Map<Long, IJobRuntime> jobMap = this.jobEngine.getJobs();\r
-                       jobList.addAll(jobMap.values());\r
-                       Collections.sort((List) jobList); //forditott sorrend?\r
-               } catch (Exception exc) {\r
-                       logger.error("", exc);\r
+                                       if (c % 3 == 0) {\r
+                                               IJobRuntime newJob = createTestJob(c, 1, 50, "NEW" + c);\r
+                                               //calls : fireJobChangedEvent(new JobChangedEvent(jobRuntime, SignalType.CREATE));\r
+                                               jobEngine.addToRunQueue(newJob);\r
+                                               jobEngine.fireJobChangedEvent(new JobChangedEvent(newJob, SignalType.CREATE));\r
+                                       }\r
+                                       Thread.sleep(1000);\r
+                               } catch (Exception exc) {\r
+                                       logger.error("", exc);\r
+                               }\r
+                       }\r
                }\r
        }\r
 \r
-       public void setSelectedJob(IJobRuntime _selectedJob) {\r
-               this.selectedJob = _selectedJob;\r
-       }\r
+       private static final Logger logger = LogManager.getLogger();\r
+       private List<JobChangedEvent> jobEvents = new ArrayList<JobChangedEvent>();\r
+       //protected CachedListModel searchResult = null;\r
+       private ListModelList<IJobRuntime> jobList = new ListModelList<IJobRuntime>();\r
+       private IJobRuntime selectedJob = null;\r
+       private IJobEngine jobEngine = null;\r
 \r
-       public IJobRuntime getSelectedJob() {\r
-               return this.selectedJob;\r
-       }\r
+       private int newPriority = 1;\r
 \r
-       public ListModelList<IJobRuntime> getJobList() {\r
-               return jobList;\r
-       }\r
+       private JobTweaker jobTweaker = null;\r
 \r
-       public void setJobList(ListModelList<IJobRuntime> jobList) {\r
-               this.jobList = jobList;\r
-       }\r
+       private int nofJobs = 10;\r
 \r
        @Command\r
        public void changeJobsPriority() {\r
@@ -80,6 +89,15 @@ public class JobListModel extends BaseModel implements IJobChangedListener {
                }\r
        }\r
 \r
+       private IJobRuntime createTestJob(int id, int prio, int progress, String name) {\r
+               IJobRuntime job = new JobRuntime();\r
+               job.setId(id);\r
+               job.setName(name == null ? ("Name " + id) : name);\r
+               job.setPriority(prio);\r
+               job.setProgress(progress);\r
+               return job;\r
+       }\r
+\r
        @Command\r
        public void executeJob() {\r
                Map<String, Object> arguments = new HashMap<String, Object>();\r
@@ -89,10 +107,41 @@ public class JobListModel extends BaseModel implements IJobChangedListener {
                window.doModal();\r
        }\r
 \r
-       @Command\r
-       @NotifyChange({ "updatePriorityDisabled" })\r
-       public void selectJob() {\r
-               //only for notification\r
+       public ListModelList<IJobRuntime> getJobList() {\r
+               return jobList;\r
+       }\r
+\r
+       public int getNewPriority() {\r
+               return newPriority;\r
+       }\r
+\r
+       public IJobRuntime getSelectedJob() {\r
+               return this.selectedJob;\r
+       }\r
+\r
+       @SuppressWarnings("unchecked")\r
+       @Init\r
+       public void init() {\r
+               try {\r
+                       jobList.setMultiple(true);\r
+\r
+                       this.jobEngine = JobEngine.getInstance();\r
+\r
+                       //TESTJOBOK\r
+                       //test();\r
+\r
+                       this.jobEngine.addJobChangedEventListener(this);\r
+                       Map<Long, IJobRuntime> jobMap = this.jobEngine.getJobs();\r
+\r
+                       jobList.addAll(jobMap.values());\r
+                       //                      List<IEntityBase> allItems = jobEngine.getItemManager().getAll(Job.class);\r
+                       //                      for (IEntityBase entity : allItems) {\r
+                       //                              jobList.add(new JobRuntime((IJob) entity));\r
+                       //                      }\r
+                       Collections.sort((List) jobList); //forditott sorrend?\r
+               } catch (Exception exc) {\r
+                       logger.error("", exc);\r
+               }\r
        }\r
 \r
        public boolean isUpdatePriorityDisabled() {\r
@@ -104,6 +153,17 @@ public class JobListModel extends BaseModel implements IJobChangedListener {
                return true;\r
        }\r
 \r
+       //TEST CODE *****************************************************\r
+\r
+       @Override\r
+       public void jobChanged(JobChangedEvent event) {\r
+               if (event != null) {\r
+                       synchronized (jobEvents) {\r
+                               jobEvents.add(event);\r
+                       }\r
+               }\r
+       }\r
+\r
        @Command\r
        //@NotifyChange({ "jobList" })\r
        public void refreshJobList() {\r
@@ -130,82 +190,30 @@ public class JobListModel extends BaseModel implements IJobChangedListener {
                }\r
        }\r
 \r
-       @Override\r
-       public void jobChanged(JobChangedEvent event) {\r
-               if (event != null) {\r
-                       synchronized (jobEvents) {\r
-                               jobEvents.add(event);\r
-                       }\r
-               }\r
-       }\r
-\r
-       //TEST CODE *****************************************************\r
-\r
-       private JobTweaker jobTweaker = null;\r
-       private int nofJobs = 10;\r
-\r
-       private void test() {\r
-               this.jobEngine = new JobEngine();\r
-               for (int j = 0; j < nofJobs; j++) {\r
-                       this.jobEngine.addToRunQueue(createTestJob(j, 1, j, null));\r
-               }\r
-               jobTweaker = new JobTweaker();\r
-       }\r
-\r
-       private IJobRuntime createTestJob(int id, int prio, int progress, String name) {\r
-               IJobRuntime job = new JobRuntime();\r
-               job.setId(id);\r
-               job.setName(name == null ? ("Name " + id) : name);\r
-               job.setPriority(prio);\r
-               job.setProgress(progress);\r
-               return job;\r
+       @Command\r
+       @NotifyChange({ "updatePriorityDisabled" })\r
+       public void selectJob() {\r
+               //only for notification\r
        }\r
 \r
-       public int getNewPriority() {\r
-               return newPriority;\r
+       public void setJobList(ListModelList<IJobRuntime> jobList) {\r
+               this.jobList = jobList;\r
        }\r
 \r
        public void setNewPriority(int newPriority) {\r
                this.newPriority = newPriority;\r
        }\r
 \r
-       class JobTweaker implements Runnable {\r
-               public JobTweaker() {\r
-                       Thread t = new Thread(this, "JobTweaker");\r
-                       t.start();\r
-               }\r
-\r
-               @Override\r
-               public void run() {\r
-                       for (int c = 1000; true; c++) {\r
-                               try {\r
-                                       for (int j = 0; j < jobList.size(); j++) {\r
-                                               IJobRuntime job = jobList.get(j);\r
-                                               if (j % 2 == 0) {\r
-                                                       if (job.getProgress() < 100) {\r
-                                                               job.setProgress(job.getProgress() + 2);\r
-                                                               jobEngine.fireJobChangedEvent(new JobChangedEvent(job, SignalType.UPDATE));\r
-                                                       }\r
-                                               }\r
-                                               if (job.getProgress() >= 100) {\r
-                                                       //calls : fireJobChangedEvent(new JobChangedEvent(job, SignalType.DELETE));\r
-                                                       jobEngine.removeJob(job.getId());\r
-                                                       jobEngine.fireJobChangedEvent(new JobChangedEvent(job, SignalType.DELETE));\r
-                                               }\r
-                                       }\r
+       public void setSelectedJob(IJobRuntime _selectedJob) {\r
+               this.selectedJob = _selectedJob;\r
+       }\r
 \r
-                                       if (c % 3 == 0) {\r
-                                               IJobRuntime newJob = createTestJob(c, 1, 50, "NEW" + c);\r
-                                               //calls : fireJobChangedEvent(new JobChangedEvent(jobRuntime, SignalType.CREATE));\r
-                                               jobEngine.addToRunQueue(newJob);\r
-                                               jobEngine.fireJobChangedEvent(new JobChangedEvent(newJob, SignalType.CREATE));\r
-                                       }\r
-                                       Thread.sleep(1000);\r
-                               } catch (Exception exc) {\r
-                                       logger.error("", exc);\r
-                               }\r
-                       }\r
+       private void test() {\r
+               this.jobEngine = new JobEngine();\r
+               for (int j = 0; j < nofJobs; j++) {\r
+                       this.jobEngine.addToRunQueue(createTestJob(j, 1, j, null));\r
                }\r
+               jobTweaker = new JobTweaker();\r
        }\r
 \r
        //END OF TEST CODE ************************************************\r