git-tfs-id: [http://tfs.userrendszerhaz.hu:8080/tfs/DefaultCollection]$/MediaCube...
authorVásáry Dániel <daniel.vasary@userrendszerhaz.hu>
Tue, 24 Jul 2018 12:11:23 +0000 (12:11 +0000)
committerVásáry Dániel <daniel.vasary@userrendszerhaz.hu>
Tue, 24 Jul 2018 12:11:23 +0000 (12:11 +0000)
client/Maestro/Configuration/UJ-configuration-tqc-check.json
client/Maestro/Configuration/configuration-nexio-ingest.json [moved from client/Maestro/Configuration/-configuration-nexio-ingest.json with 88% similarity]
client/Maestro/Maestro.csproj
client/MaestroShared/Targets/FTPTargetProcessor.cs
client/MaestroShared/Targets/UNCTargetProcessor.cs
server/user.jobengine.osgi.server/test/user/jobengine/server/IT/Support.java

index 765596ccc15e27820043d2d235af8ed7f3938e0c..d655bfec5b92f9846f05384f5d341d446a684420 100644 (file)
     "$type": "UNCSource",\r
     "filter": "avi,wav,mxf",\r
     "local": {\r
-      "address": "file://c:/_video",\r
+      "address": "file://10.10.1.100/BRAAVOS/ARCHIVE/ONE",\r
       "userName": "mediacube",\r
       "password": "Dn8t4gfHcK98o8hyPgLDhr5SgSji4JCxsfpMJsODikUp3nXgrM0UNCi45lLAK8ZOnmEneO44P9qpJ4QDqhctN6MxZodjJgdZTyoZKmSa+ECzEzLr/wPYNgxVaXrVotEy",\r
       "timeout": 1000\r
     },\r
     "remote": {\r
-      "address": "ftp://10.10.1.100/TQC/CHECK",\r
+      "address": "ftp://10.10.1.100/ARCHIVE/ONE",\r
       "userName": "mediacube",\r
       "password": "Dn8t4gfHcK98o8hyPgLDhr5SgSji4JCxsfpMJsODikUp3nXgrM0UNCi45lLAK8ZOnmEneO44P9qpJ4QDqhctN6MxZodjJgdZTyoZKmSa+ECzEzLr/wPYNgxVaXrVotEy",\r
       "timeout": 1000\r
     },\r
     {\r
       "label": "Archiválás",\r
-      "processor": "UNCTargetProcessor",\r
+      "processor": "FTPTargetProcessor",\r
       "outputFormat": "%ID%",\r
       "tag": "Archiválás",\r
       "saveArchiveMetadata": true,\r
       "disableFileVersioning": true,\r
       "enableOverride": true,\r
       "remote": {\r
-        "address": "file://10.10.1.100/BRAAVOS/ARCHIVE",\r
+        "address": "ftp://10.10.1.100/ARCHIVE/ONE",\r
         "userName": "mediacube",\r
         "password": "Dn8t4gfHcK98o8hyPgLDhr5SgSji4JCxsfpMJsODikUp3nXgrM0UNCi45lLAK8ZOnmEneO44P9qpJ4QDqhctN6MxZodjJgdZTyoZKmSa+ECzEzLr/wPYNgxVaXrVotEy",\r
         "timeout": 1000\r
similarity index 88%
rename from client/Maestro/Configuration/-configuration-nexio-ingest.json
rename to client/Maestro/Configuration/configuration-nexio-ingest.json
index fbb58f3575dc7774d8a0888cb96da232ee956576..187185c5bd55d2379c0d295c8760e61e5d6bb6e4 100644 (file)
     "$type": "UNCSource",\r
     "filter": "avi,wav,mxf",\r
     "local": {\r
-      "address": "file://10.10.1.100/BRAAVOS/READY",\r
-      "userName": "mediacube",\r
-      "password": "Dn8t4gfHcK98o8hyPgLDhr5SgSji4JCxsfpMJsODikUp3nXgrM0UNCi45lLAK8ZOnmEneO44P9qpJ4QDqhctN6MxZodjJgdZTyoZKmSa+ECzEzLr/wPYNgxVaXrVotEy",\r
-      "timeout": 1000\r
-    },\r
-    "remote": {\r
-      "address": "ftp://10.10.1.100/READY",\r
+      "address": "file://c:\\_video",\r
       "userName": "mediacube",\r
       "password": "Dn8t4gfHcK98o8hyPgLDhr5SgSji4JCxsfpMJsODikUp3nXgrM0UNCi45lLAK8ZOnmEneO44P9qpJ4QDqhctN6MxZodjJgdZTyoZKmSa+ECzEzLr/wPYNgxVaXrVotEy",\r
       "timeout": 1000\r
@@ -83,7 +77,6 @@
       "killDateDays": 7,\r
       "disableFileVersioning": true,\r
       "agency": "MAESTRO-EDITOR",\r
-      "reference": [ "Octopus mappába küldés" ],\r
       "remote": {\r
         "address": "ftp://10.10.1.55:2098",\r
         "userName": "administrator",\r
index c6cda3bc822e139e039b6ae52f308bb25bb08911..8a3fe707be9d5912f2deee3e8fc4cef9109c8728 100644 (file)
     <None Include="Configuration\global.json">\r
       <CopyToOutputDirectory>Always</CopyToOutputDirectory>\r
     </None>\r
-    <None Include="Configuration\-configuration-nexio-ingest.json">\r
+    <None Include="Configuration\configuration-nexio-ingest.json">\r
       <CopyToOutputDirectory>Always</CopyToOutputDirectory>\r
     </None>\r
     <None Include="Configuration\-configuration-editor.json">\r
index 6778ff729bb0c6abadbbc69ff8c446a14bffd011..4cf88f19ab3fc331ea303b48bc919f0b1c29d27b 100644 (file)
@@ -6,6 +6,7 @@ using System;
 using System.IO;\r
 using System.Linq;\r
 using System.Net;\r
+using System.Text;\r
 using System.Windows.Forms;\r
 \r
 namespace MaestroShared.Targets {\r
@@ -14,7 +15,9 @@ namespace MaestroShared.Targets {
         private const string PATTERN_CONCAT = "{0}{1}";\r
         private const string _226 = "226";\r
         private const string UPLOAD_ERROR = "Feltöltési hiba.";\r
-        protected const string UPLOAD_SIZE_ERROR = "Feltöltési hiba, a feltöltött fájl mérete nem egyezik a forrásfájl méretével.";\r
+        private const string _200 = "200";\r
+        private const string SITE0011 = "SITE 0011";\r
+        private const string _1211 = "1211";\r
         private readonly Logger logger = LogManager.GetCurrentClassLogger();\r
         protected FtpClient targetFTP;\r
 \r
@@ -45,11 +48,31 @@ namespace MaestroShared.Targets {
             //Input = inputUri.ToString();\r
         }\r
 \r
+\r
+        protected bool IsNexioServer(FtpClient ftpClient) {\r
+            bool result = false;\r
+            //Device Type Request\r
+            FtpReply reply = targetFTP.Execute(SITE0011);\r
+            if (_200.Equals(reply.Code))\r
+                result = reply.Message != null && reply.Message.Contains(_1211);\r
+            return result;\r
+        }\r
+\r
         protected override void BeforeExecute() {\r
             base.BeforeExecute();\r
             targetFTP = CreateClient(Parameters.TargetConfig.Remote);\r
         }\r
 \r
+\r
+        protected override void ValidateTransfer() {\r
+            if (!IsNexioServer(targetFTP)) {\r
+                long sourceSize = inputFile.Length;\r
+                long uploadedSize = targetFTP.GetFileSize(OutputName);\r
+                if (sourceSize != uploadedSize)\r
+                    throw new Exception(UPLOAD_ERROR);\r
+            }\r
+        }\r
+\r
         protected override void AfterExecute() {\r
             base.AfterExecute();\r
             TerminateClient(targetFTP);\r
@@ -89,10 +112,6 @@ namespace MaestroShared.Targets {
             FtpReply reply = targetFTP.GetReply();\r
             if (!reply.Success || !_226.Equals(reply.Code))\r
                 throw new Exception(UPLOAD_ERROR);\r
-            //long sourceSize = inputFile.Length;\r
-            //long uploadedSize = targetFTP.GetFileSize(OutputName);\r
-            //if (sourceSize != uploadedSize)\r
-            //    throw new Exception(UPLOAD_SIZE_ERROR);\r
         }\r
 \r
         protected override void UploadContent(string outputPath, byte[] content) {\r
index a151ac04398591ccdca1de6a188d6135be33696f..9b8ff2e8fd6a5a7d800f6e97b530eabc883a216d 100644 (file)
@@ -37,7 +37,7 @@ namespace MaestroShared.Targets {
         protected const string HYPHEN = "-";\r
         protected const string SLASH = "/";\r
         protected const string BACKSLASH = @"\";\r
-        private const string COPY_SIZE_ERROR = "Másolási hiba, a másolt fájl mérete nem egyezik a forrásfájl méretével.";\r
+        protected const string COPY_SIZE_ERROR = "Másolási hiba, a másolt fájl mérete nem egyezik a forrásfájl méretével.";\r
         private const string STAR = "*";\r
         protected FileInfo inputFile;\r
         protected string workingDir;\r
@@ -89,6 +89,7 @@ namespace MaestroShared.Targets {
                 string currentFile = GetOutputFilePath(workingDir, OutputName);\r
                 if (DeleteExisting(currentFile)) {\r
                     UploadFile();\r
+                    ValidateTransfer();\r
                     //logger.Info("Spend (s):" + (DateTime.Now - started).TotalSeconds);\r
                     Status = READY;\r
                     Message = SUCCESS;\r
@@ -111,6 +112,13 @@ namespace MaestroShared.Targets {
             return result;\r
         }\r
 \r
+        protected virtual void ValidateTransfer() {\r
+            long sourceSize = inputFile.Length;\r
+            long uploadedSize = new FileInfo(Output).Length;\r
+            if (sourceSize != uploadedSize)\r
+                throw new Exception(COPY_SIZE_ERROR);\r
+        }\r
+\r
         protected virtual void CreateOutput(string workingDir) {\r
             Output = SLASH.Equals(workingDir) ? OutputName : Path.Combine(workingDir, OutputName);\r
         }\r
@@ -382,10 +390,6 @@ namespace MaestroShared.Targets {
         protected virtual void UploadFile() {\r
             int pbCancel = 0;\r
             Win32File.CopyFileEx(Input, Output, new CopyProgressRoutine(this.CopyProgressHandler), IntPtr.Zero, ref pbCancel, CopyFileFlags.COPY_FILE_RESTARTABLE);\r
-            //long sourceSize = inputFile.Length;\r
-            //long uploadedSize = new FileInfo(Output).Length;\r
-            //if (sourceSize != uploadedSize)\r
-            //    throw new Exception(COPY_SIZE_ERROR);\r
         }\r
 \r
         protected virtual string GetOutputFilePath(string path, string fileName) {\r
index e14bc22366584cc3218f31df323b34321a5253c5..262abe82bae32921326d7fd1680d9321c88969a8 100644 (file)
@@ -612,4 +612,12 @@ public class Support {
 \r
        }\r
 \r
+       @Test\r
+       public void test2() throws Exception {\r
+               Item i = manager.createItem("Generic", "Gyűjtő elgekko", "Gyűjtő elgekko", "100000");\r
+               Media m = manager.createMedia("Generic", "Média elgekko", "Média elgekko", "200000");\r
+               manager.add(i);\r
+               m.setItemId(i.getId());\r
+               manager.add(m);\r
+       }\r
 }\r