Feature #116 Multiszegmens adatok mentési logikája
authorVásáry Dániel <daniel.vasary@userrendszerhaz.hu>
Wed, 12 Dec 2018 14:59:09 +0000 (14:59 +0000)
committerVásáry Dániel <daniel.vasary@userrendszerhaz.hu>
Wed, 12 Dec 2018 14:59:09 +0000 (14:59 +0000)
Feature #115 Multiszegmens Traffic listázás

git-tfs-id: [http://tfs.userrendszerhaz.hu:8080/tfs/DefaultCollection]$/MediaCube;C31367

49 files changed:
client/AudioRecorder/MetadataSelectorForm.cs
client/DxPlay/DxPlay.csproj
client/DxPlay/Integration/Traffic.cs
client/DxPlay/PlayerForm.cs
client/MXFFileParser/MXFFileParser.csproj
client/Maestro/Configuration/configuration.json
client/Maestro/MaestroForm.Metadata.cs
client/Maestro/MaestroForm.Target.cs
client/Maestro/Metadata/MetaDataInfo.cs
client/MaestroShared/Configuration/ConfigurationInfo.cs
client/MaestroShared/Interfaces/ITrafficAPI.cs [new file with mode: 0644]
client/MaestroShared/MaestroShared.csproj
client/MaestroShared/Metadata/Traffic.cs [new file with mode: 0644]
client/MaestroShared/Targets/TargetProcessorParameter.cs
client/MaestroShared/Targets/UNCTargetProcessor.cs
client/MetadataSelector/MetadataIDSelector.cs
client/MetadataSelector/MetadataSelector.csproj
client/NativeOctopusClient/NativeOctopusClient.csproj
client/OctopusClient/OctopusClient.csproj
client/PasswordEncrypter/PasswordEncrypter.csproj
client/PasswordEncrypter/Program.cs
client/PlanAIRClient/Model/PlanAirADResult.cs [moved from client/PlanAIRClient/PlanAirADResult.cs with 96% similarity]
client/PlanAIRClient/Model/PlanAirMaterialResult.cs [new file with mode: 0644]
client/PlanAIRClient/Model/PlanAirMaterialSegmentResult.cs [moved from client/PlanAIRClient/PlanAirMaterialSegmentResult.cs with 96% similarity]
client/PlanAIRClient/Model/PlanAirPromoResult.cs [moved from client/PlanAIRClient/PlanAirPromoResult.cs with 96% similarity]
client/PlanAIRClient/PlanAirDataReader.cs
client/PlanAIRClient/Properties/Settings.Designer.cs
client/PlanAIRClient/Properties/Settings.settings
client/PlanAIRClient/Resources.Designer.cs
client/PlanAIRClient/Resources.resx
client/PlanAIRClient/TrafficAPI.cs
client/PlanAIRClient/TrafficClasses.cs [deleted file]
client/PlanAIRClient/TrafficClasses.dbml [deleted file]
client/PlanAIRClient/TrafficClasses.dbml.layout [deleted file]
client/PlanAIRClient/TrafficClasses.designer.cs [deleted file]
client/PlanAIRClient/TrafficClient.csproj
client/PlanAIRClient/TrafficIDSelector.cs
client/PlanAIRClient/TrafficIDSelectorColumns.cs
client/PlanAIRClient/TrafficLookupResultSelector.cs
client/PlanAIRClient/TrafficParameters.cs [moved from client/PlanAIRClient/TrafficConfiguration.cs with 100% similarity]
client/PlanAIRClient/Workers/ADWorker.cs
client/PlanAIRClient/Workers/MultiSegmentMaterialWorker.cs
client/PlanAIRClient/Workers/PromoWorker.cs
client/PlanAIRClient/Workers/SingleSegmentMaterialWorker.cs
client/PlanAIRClient/Workers/TrafficWorker.cs
client/PlanAIRClient/clIFsp_EC_MAMBradocastResult.cs [deleted file]
server/-dependencies/pom.xml
server/hu.user.mediacube.executors.tests/src/hu/user/mediacube/executors/tests/Support.java
server/user.jobengine.osgi.server/test/user/jobengine/server/IT/Support.java

index cedd49b5d8b8fdc9d857d82e94047dd7346dcf5b..85acb573728833d85d1edd7f2e2448419ff06206 100644 (file)
@@ -1,6 +1,7 @@
 using AudioRecorder.Properties;\r
 using MaestroShared.Metadata;\r
 using System;\r
+using System.Collections.Generic;\r
 using System.Windows.Forms;\r
 \r
 namespace AudioRecorder {\r
@@ -8,7 +9,7 @@ namespace AudioRecorder {
         private Metadata selectedMetadata;\r
 \r
         public enum TargetType {\r
-            Free, Octopus, TrafficPromo, TrafficAD, TrafficMaterial     \r
+            Free, Octopus, TrafficPromo, TrafficAD, TrafficMaterial\r
         }\r
 \r
         public class Metadata {\r
@@ -82,7 +83,7 @@ namespace AudioRecorder {
                 };\r
         }\r
 \r
-        private void TrafficIDChangedEvent(string id, int variantID, string text) {\r
+        private void TrafficIDChangedEvent(string id, int variantID, string text, List<TrafficItem> selected) {\r
             if (id == null)\r
                 SelectedMetadata = null;\r
             else {\r
index 57e4c91fa9bcd55fe7ee49e5db99a5eb017ea6c9..38fc792d15e24179faf8b577b35794071e8ec0f2 100644 (file)
     <ErrorReport>prompt</ErrorReport>\r
     <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>\r
     <Prefer32Bit>false</Prefer32Bit>\r
+    <Deterministic>true</Deterministic>\r
   </PropertyGroup>\r
   <PropertyGroup>\r
     <TargetZone>LocalIntranet</TargetZone>\r
index 90432cac5e9ed92530bf1b19317629a6e19ea0d1..372715f5fb39c5faff1cd5ac478726b739242d11 100644 (file)
@@ -55,11 +55,13 @@ namespace DxPlay.Integration {
 \r
         public void SaveSegments(TargetUpdateTrafficMessage message) {\r
             //logger.Info("Now update!!!!!!!!!");\r
-            selector.trafficAPI.SaveSegments(message.VariantID, message.MetadataType, message.Segments);\r
+            //TODO a listabol kijelolt szegmenseket is at kell adni\r
+            selector.trafficAPI.SaveSegments(message.VariantID, message.MetadataType, message.Segments, null);\r
             //message.Ready, \r
         }\r
 \r
         public void Approve(TargetUpdateTrafficMessage message) {\r
+            //TODO ifCompleted\r
             selector.trafficAPI.Approve(message.VariantID, message.Ready, message.MetadataType);\r
         }\r
     }\r
index 21e290e6611e10999e0d1e9ec0a8fdce2d68a2a3..9d989e0b2aa609df86e1a3e0dff70d075268f1a6 100644 (file)
@@ -1,8 +1,10 @@
 using DxPlay.Model;\r
 using DxPlay.Properties;\r
 using MaestroShared.Commons;\r
+using MaestroShared.Metadata;\r
 using NLog;\r
 using System;\r
+using System.Collections.Generic;\r
 using System.Diagnostics;\r
 using System.IO;\r
 using System.Runtime.InteropServices;\r
@@ -81,7 +83,7 @@ namespace DxPlay {
 \r
         }\r
 \r
-        private void OnSelectedIDChanged(string ID, int variantID, string text) {\r
+        private void OnSelectedIDChanged(string ID, int variantID, string text, List<TrafficItem> selected) {\r
             //logger.Info("Selected ID: " + ID);\r
             try {\r
                 model.ID = ID;\r
index 2c96ba3e7668c5a690c22324e7c49660de54c73f..77dcf2c18a5cf05d905ebcded31e21bc948b5580 100644 (file)
@@ -58,6 +58,7 @@
     <ErrorReport>prompt</ErrorReport>\r
     <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>\r
     <Prefer32Bit>false</Prefer32Bit>\r
+    <Deterministic>true</Deterministic>\r
   </PropertyGroup>\r
   <ItemGroup>\r
     <Reference Include="System" />\r
index 9688cf26012c77940f81746a66aa0d8020c1e843..3932bcbde24b68d7b7ea9e956c895b10362a4c1e 100644 (file)
@@ -41,7 +41,7 @@
         "password": "7RKZYBzumKjL40SJwuwiFCvX57xuCN8zay6OttUm2wbrgImyYZBHyZTUUYrXX31Ge2Uwew07HYsqh2uzdJeDBDwcVntxaHg3nIpv9Dyq/odVoiC4tUF/K+lgvKWANcrZ",\r
         "timeout": 1000\r
       },\r
-      "version": 2\r
+      "version": 1\r
     },\r
     {\r
       "$type": "MediaCubeMetadata",\r
index 51bee82698ef04179dfecd4737402aecd5ca133a..13f3cec2dc7014b5974a575b1b0e02a1775c8a10 100644 (file)
@@ -1,9 +1,9 @@
-using Maestro.Metadata;\r
+using Interfaces;\r
+using Maestro.Metadata;\r
 using MaestroShared.Commons;\r
 using MaestroShared.Configuration;\r
 using MaestroShared.Metadata;\r
 using MaestroShared.Model;\r
-using MaestroShared.Targets;\r
 using MediaCubeClient;\r
 using OctopusClient;\r
 using System;\r
@@ -53,20 +53,6 @@ namespace Maestro {
             textSelectedMetadata.ReadOnly = !Configuration.EnableCustomMetadataId;\r
             UpdateDefineSegmentEnabled();\r
             UpdateEditArchiveMetadataEnabled();\r
-\r
-            MessageBus.Subscribe<TargetUpdateTrafficMessage>(m => OnTargetUpdateTrafficMessage(m));\r
-        }\r
-\r
-        private void OnTargetUpdateTrafficMessage(TargetUpdateTrafficMessage message) {\r
-            if (message.Ready == false) {\r
-                //Target futas elejen elmentjuk a szegmenseket\r
-                logger.Info("Saving segments for {0}", message.VariantID);\r
-                trafficIDSelector.trafficAPI.SaveSegments(message.VariantID, message.MetadataType, message.Segments);\r
-            } else {\r
-                //Target futas vegen OK\r
-                logger.Info("Approving {0}", message.VariantID);\r
-                trafficIDSelector.trafficAPI.Approve(message.VariantID, true, message.MetadataType);\r
-            }\r
         }\r
 \r
         private void InitializeTrafficSelector() {\r
@@ -135,12 +121,12 @@ namespace Maestro {
         private void OnDefineSegments(object sender, EventArgs e) {\r
             if (SelectedSource?.FileInfo == null)\r
                 return;\r
-            DefineSegments(SelectedSource.FileInfo);\r
+            DefineSegments(SelectedSource.FileInfo, false);\r
         }\r
 \r
-        private void DefineSegments(FileInfo fileInfo) {\r
+        private void DefineSegments(FileInfo fileInfo, bool redefine) {\r
             Cursor = Cursors.WaitCursor;\r
-            if (movieSegments == null || movieSegments.Count == 0)\r
+            if (!redefine && (movieSegments == null || movieSegments.Count == 0))\r
                 movieSegments = QuerySegments();\r
             if (movieSegments == null)\r
                 movieSegments = new BindingList<MovieSegment>();\r
@@ -162,7 +148,17 @@ namespace Maestro {
 \r
         private BindingList<MovieSegment> QuerySegments() {\r
             BindingList<MovieSegment> result = null;\r
-            List<MovieSegment> storedSegments = GetSegments();\r
+            List<MovieSegment> storedSegments = null;\r
+            TrafficMetadata metadata = MetadataProvider.Get<TrafficMetadata>(Configuration.Metadatas);\r
+            if (true.Equals(metadata?.MultiSegmentEnabled)) {\r
+                storedSegments = new List<MovieSegment>();\r
+                foreach (TrafficItem item in SelectedMetadata.Selected) {\r
+                    if (item.MovieSegment != null)\r
+                        storedSegments.Add(item.MovieSegment);\r
+                }\r
+            } else\r
+                storedSegments = GetSegments();\r
+\r
             if (storedSegments != null && storedSegments.Count > 0)\r
                 result = new BindingList<MovieSegment>(storedSegments);\r
             return result;\r
@@ -272,7 +268,7 @@ namespace Maestro {
             string id = textSelectedMetadata.Text;\r
             if (String.IsNullOrEmpty(id))\r
                 return null;\r
-            TrafficAPI api = trafficIDSelector.trafficAPI;\r
+            ITrafficAPI api = trafficIDSelector.trafficAPI;\r
             List<TrafficItemMetadata> trafficResult = null;\r
             switch (metadataType) {\r
                 case MetadataType.TrafficMaterial:\r
@@ -350,23 +346,6 @@ namespace Maestro {
                 }\r
             }\r
 \r
-            //switch (SelectedMetadata?.Kind) {\r
-            //    case MetadataType.OctopusStory:\r
-            //    case MetadataType.OctopusPlaceHolder:\r
-            //        ArchiveMetadata = GetArchiveMetadata();\r
-            //        break;\r
-            //    case MetadataType.TrafficAD:\r
-            //    case MetadataType.TrafficMaterial:\r
-            //    case MetadataType.TrafficPromo:\r
-            //        ArchiveMetadata = GetArchiveMetadata();\r
-            //        movieSegments = null;\r
-            //        movieSegments = QuerySegments();\r
-            //        break;\r
-            //    default:\r
-            //        movieSegments = null;\r
-            //        ArchiveMetadata = null;\r
-            //        break;\r
-            //}\r
             movieSegments = null;\r
             ArchiveMetadata = null;\r
 \r
@@ -392,7 +371,7 @@ namespace Maestro {
             };\r
         }\r
 \r
-        private void OnTrafficIDSelected(string id, int variantID, string text) {\r
+        private void OnTrafficIDSelected(string id, int variantID, string text, List<TrafficItem> selected) {\r
             btnRedefineSegments.Visible = false;\r
             if (id == null) {\r
                 ArchiveMetadata = null;\r
@@ -405,7 +384,8 @@ namespace Maestro {
                 Kind = metadataType,\r
                 ID = id,\r
                 MetadataText = text,\r
-                VariantID = variantID\r
+                VariantID = variantID,\r
+                Selected = selected\r
             };\r
 \r
             CheckIfRedefineSegments();\r
@@ -452,11 +432,7 @@ namespace Maestro {
                     return;\r
             }\r
 \r
-            DefineSegments(new FileInfo(SelectedMetadata.RedefineSegmentsFile));\r
-            /*\r
-            trafficIDSelector.trafficAPI.SaveSegments(SelectedMetadata.VariantID, SelectedMetadata.Kind, movieSegments.ToList());\r
-            trafficIDSelector.trafficAPI.Approve(SelectedMetadata.VariantID, true, SelectedMetadata.Kind);\r
-            */\r
+            DefineSegments(new FileInfo(SelectedMetadata.RedefineSegmentsFile), true);\r
         }\r
 \r
         private static string GetMetadataTypeTooltip(MetadataType? metadataType) {\r
index 4d7645c2cd53e01bc11b48ea2fb29ed5fcf55860..0a54f414cd707d6e32e4c74769c2149eb54e8b1e 100644 (file)
@@ -179,12 +179,14 @@ namespace Maestro {
             TargetProcessorParameter result = new TargetProcessorParameter();\r
             result.SourcePathOverride = (source == null || source.Path.Equals(Configuration.Source.Local.Address.LocalPath)) ? null : source.Path;\r
             result.MediaCubeApi = mediaCubeApi;\r
+            result.TrafficApi = trafficIDSelector.trafficAPI;\r
+            result.TrafficMetadata = MetadataProvider.Get<TrafficMetadata>(Configuration.Metadatas);\r
             result.SourceConfig = Configuration.Source;\r
             result.TargetConfig = target;\r
             result.ID = textSelectedMetadata.Text;\r
             result.MetadataText = SelectedMetadata?.MetadataText;\r
             result.InputFileName = sourceItem.Name;\r
-            result.MovieSegments = movieSegments == null ? null : movieSegments.ToList();\r
+            result.MovieSegments = movieSegments?.ToList();\r
             result.ArchiveMetadata = ArchiveMetadata.DeepClone(ArchiveMetadata);\r
             result.VariantID = selectedMetadata == null ? 0 : selectedMetadata.VariantID;\r
             result.MetadataKind = selectedMetadata == null ? MetadataType.None : selectedMetadata.Kind;\r
@@ -194,6 +196,7 @@ namespace Maestro {
             result.Frames = sourceItem.Frames;\r
             result.TargetOrder = Configuration.Targets.ToList().IndexOf(target);\r
             result.ArchiveMetadata.userName = result.UserName;\r
+            result.SelectedSegments = SelectedMetadata?.Selected;\r
             if (SelectedMetadata.Kind == MetadataType.MediaCube && result.ArchiveMetadata != null) {\r
                 result.ArchiveMetadata.itemHouseId = PatternNameMaker.Get(result.ArchiveMetadata.itemHouseId, result.ID, result.InputFileName, null, null, result.MetadataText);\r
                 result.ArchiveMetadata.itemTitle = PatternNameMaker.Get(result.ArchiveMetadata.itemTitle, result.ID, result.InputFileName, null, null, result.MetadataText);\r
index efb2bc892c42ac1842f821a368cb8b3caf52f5ef..4d1e4e85326148742ce659e1166ad978a5f7d407 100644 (file)
@@ -1,5 +1,6 @@
 using MaestroShared.Metadata;\r
 using MaestroShared.Model;\r
+using System.Collections.Generic;\r
 \r
 namespace Maestro.Metadata {\r
     public class MetadataInfo {\r
@@ -10,5 +11,6 @@ namespace Maestro.Metadata {
         public string RedefineSegmentsFile { get; set; }\r
         public bool RedefineWithRestore { get; set; }\r
         public Media RedefineMedia { get; set; }\r
+        public List<TrafficItem> Selected { get; set; }\r
     }\r
 }\r
index 1a31301ad474b4524962e7190ad3cbb899364ec4..5c8cc2a8ece2961aef0a9ea563f3f48331ec3779 100644 (file)
@@ -191,6 +191,10 @@ namespace MaestroShared.Configuration {
         public ProjectSettings ProjectSettings { get; set; }\r
         public string FunctionName { get; set; }\r
         public int Version { get; set; }\r
+        public bool MultiSegmentEnabled {\r
+            get => Version == 1;\r
+        }\r
+\r
     }\r
 \r
     public class MediaCubeMetadata : MetadataProvider {\r
diff --git a/client/MaestroShared/Interfaces/ITrafficAPI.cs b/client/MaestroShared/Interfaces/ITrafficAPI.cs
new file mode 100644 (file)
index 0000000..7b9fd28
--- /dev/null
@@ -0,0 +1,20 @@
+using MaestroShared.Metadata;\r
+using System;\r
+using System.Collections.Generic;\r
+\r
+namespace Interfaces {\r
+    public interface ITrafficAPI {\r
+        void Approve(int itemID, bool ready, MetadataType kind, bool ifCompleted = false);\r
+        TrafficVersion CreateMaterialVersion(string episodeID, bool recut);\r
+        List<TrafficItemMetadata> GetADArchiveMetadata(string strParam);\r
+        List<TrafficItem> GetADs(string search, bool problematic, DateTime? from = null, DateTime? to = null);\r
+        List<MovieSegment> GetADSegments(string strParam);\r
+        List<TrafficItemMetadata> GetMaterialMetadata(string strParam);\r
+        List<TrafficItem> GetMaterials(string strParam, bool problematic, DateTime? from = null, DateTime? to = null);\r
+        List<MovieSegment> GetMaterialSegments(int itemID);\r
+        List<TrafficItemMetadata> GetPromoArchiveMetadata(string strParam);\r
+        List<TrafficItem> GetPromos(string search, bool problematic, DateTime? from = null, DateTime? to = null);\r
+        List<MovieSegment> GetPromoSegments(string strParam);\r
+        string SaveSegments(int itemID, MetadataType kind, List<MovieSegment> segments, List<TrafficItem> selectedSegments);\r
+    }\r
+}
\ No newline at end of file
index 221991be9775532e929f7c9066aab37a104302b1..68a8ab0eba9244c287dcc67bd438ecda7c57c169 100644 (file)
     <Compile Include="Controls\Win32.cs" />\r
     <Compile Include="Interfaces\IMediaCubeApi.cs" />\r
     <Compile Include="MessageBus\MaestroMessage.cs" />\r
+    <Compile Include="Interfaces\ITrafficAPI.cs" />\r
     <Compile Include="Metadata\MetadataType.cs" />\r
     <Compile Include="Metadata\MovieSegment.cs" />\r
     <Compile Include="Metadata\Timecode.cs" />\r
+    <Compile Include="Metadata\Traffic.cs" />\r
     <Compile Include="Model\Model.cs" />\r
     <Compile Include="Properties\AssemblyInfo.cs" />\r
     <Compile Include="Metadata\ArchiveMetadata.cs" />\r
diff --git a/client/MaestroShared/Metadata/Traffic.cs b/client/MaestroShared/Metadata/Traffic.cs
new file mode 100644 (file)
index 0000000..66b6951
--- /dev/null
@@ -0,0 +1,43 @@
+using System;\r
+\r
+namespace MaestroShared.Metadata {\r
+    public class TrafficItem {\r
+        public bool Selected { get; set; }\r
+        public string MediaID { get; set; }\r
+        public bool OK { get; set; }\r
+        public string Title { get; set; }\r
+        public DateTime? NextBroadcastDate { get; set; }\r
+        public DateTime? FirstBroadcastDate { get; set; }\r
+        public int? SegmentCount { get; set; }\r
+        public int? SegmentNr { get; set; }\r
+        public long? SegmentId { get; set; }\r
+        public MovieSegment MovieSegment { get; set; }\r
+        public short EpisodeNumber { get; set; }\r
+        public string EpisodeTitle { get; set; }\r
+        public int VariantID { get; set; }\r
+        public string EpisodeID { get; set; }\r
+        public string Segment {\r
+            get {\r
+                if (SegmentCount != null && SegmentNr != null)\r
+                    return string.Format($"{SegmentCount} / {SegmentNr}");\r
+                else\r
+                    return "";\r
+            }\r
+        }\r
+    }\r
+\r
+    public class TrafficVersion {\r
+        public string MediaID { get; set; }\r
+        public int VariantID { get; set; }\r
+    }\r
+\r
+    public class TrafficItemMetadata {\r
+        public string ProgTitle { get; set; }\r
+        public string ProgDescription { get; set; }\r
+        public string ProgID { get; set; }\r
+        public string EpisodeTitle { get; set; }\r
+        public string EpisodeDescription { get; set; }\r
+        public string EpisodeID { get; set; }\r
+        public bool OK { get; set; }\r
+    }\r
+}\r
index 9771fb538f2dd1d9638b59aa3b8cab35376b0031..932d3e059cbaafa49cc818e1264060de48297d9f 100644 (file)
@@ -1,4 +1,5 @@
-using LinkDotNet.MessageHandling.Contracts;\r
+using Interfaces;\r
+using LinkDotNet.MessageHandling.Contracts;\r
 using MaestroShared.Configuration;\r
 using MaestroShared.Interfaces;\r
 using MaestroShared.Metadata;\r
@@ -14,7 +15,9 @@ namespace MaestroShared.Target {
         public string ID { get; set; }\r
         public string MetadataText { get; set; }\r
         public List<MovieSegment> MovieSegments { get; set; }\r
+        public List<TrafficItem> SelectedSegments { get; set; }\r
         public IMediaCubeApi MediaCubeApi { get; set; }\r
+        public ITrafficAPI TrafficApi { get; set; }\r
         public ArchiveMetadata ArchiveMetadata { get; set; }\r
         public int VariantID { get; set; }\r
         public MetadataType MetadataKind { get; set; }\r
@@ -23,6 +26,6 @@ namespace MaestroShared.Target {
         public DateTime CreateDate { get; set; }\r
         public long Frames { get; set; }\r
         public int TargetOrder { get; set; }\r
-\r
+        public TrafficMetadata TrafficMetadata { get; set; }\r
     }\r
 }\r
index a17b40937373d17c6e41ea378863e74f93521317..3b13eb768c85c8f5648baf0df02e8c6b90cd92dd 100644 (file)
@@ -70,11 +70,13 @@ namespace MaestroShared.Targets {
         protected virtual void BeforeExecute() {\r
             Started = DateTime.Now;\r
             workFlowAction.started = Started;\r
-        }\r
-\r
-        protected virtual void BeforeUpload() {\r
-            if (Parameters.TargetConfig.SaveSegments && Parameters.MovieSegments != null)\r
-                TrafficSaveSegments();\r
+            if (Parameters.TargetConfig.SaveSegments && Parameters.MovieSegments != null) {\r
+                string fileName = Parameters?.TrafficApi?.SaveSegments(Parameters.VariantID, Parameters.MetadataKind, Parameters.MovieSegments, Parameters.SelectedSegments);\r
+                if (true.Equals(Parameters?.TrafficMetadata?.MultiSegmentEnabled)) {\r
+                    //a Traffic adja a nevet\r
+                    OutputName = fileName;\r
+                }\r
+            }\r
         }\r
 \r
         public override bool Execute() {\r
@@ -84,7 +86,10 @@ namespace MaestroShared.Targets {
                 BeforeExecute();\r
                 workingDir = DetermineWorkingDirectory(Parameters.TargetConfig.Remote);\r
                 EnsureDirectoryExistence(workingDir);\r
-                OutputName = CreateOutputFileName();\r
+\r
+                //multiszegmens mukodes eseten a filenevet a traffic generalja\r
+                if (!true.Equals(Parameters?.TrafficMetadata?.MultiSegmentEnabled))\r
+                    OutputName = CreateOutputFileName();\r
                 CreateOutput(workingDir);\r
                 workFlowAction.source = Input;\r
                 workFlowAction.destination = Output;\r
@@ -93,7 +98,6 @@ namespace MaestroShared.Targets {
                 string currentFile = GetOutputFilePath(workingDir, OutputName);\r
                 //csak akkor csinalunk barmit is, ha a feluliras logika engedi\r
                 if (DeleteExisting(currentFile)) {\r
-                    BeforeUpload();\r
                     UploadFile();\r
                     ValidateTransfer();\r
                     //logger.Info("Spend (s):" + (DateTime.Now - started).TotalSeconds);\r
@@ -201,38 +205,19 @@ namespace MaestroShared.Targets {
                 CreateArchiveMetadata();\r
             if (Parameters.TargetConfig.SaveMorpheusMetadata && Parameters.ArchiveMetadata != null && Parameters.MovieSegments != null && Parameters.MovieSegments.Count > 0)\r
                 UploadMorpheusMetadata();\r
-            if (Parameters.TargetConfig.SaveSegments && Parameters.MovieSegments != null)\r
-                TrafficApprove();\r
+\r
+            if (Parameters.TargetConfig.SaveSegments && Parameters.MovieSegments != null) {\r
+                bool ifCompleted = true.Equals(Parameters?.TrafficMetadata?.MultiSegmentEnabled);\r
+                Parameters?.TrafficApi?.Approve(Parameters.VariantID, true, Parameters.MetadataKind, ifCompleted);\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
             logger.Trace(Strings.EXIT);\r
         }\r
 \r
-        private void TrafficApprove() {\r
-            logger.Trace(Strings.ENTRY);\r
-            TargetUpdateTrafficMessage message = new TargetUpdateTrafficMessage {\r
-                VariantID = Parameters.VariantID,\r
-                Ready = true,\r
-                MetadataType = Parameters.MetadataKind\r
-            };\r
-            Parameters.MessageBus.Send(message);\r
-            logger.Trace(Strings.EXIT);\r
-        }\r
-\r
-        private void TrafficSaveSegments() {\r
-            logger.Trace(Strings.ENTRY);\r
-            TargetUpdateTrafficMessage message = new TargetUpdateTrafficMessage {\r
-                VariantID = Parameters.VariantID,\r
-                MetadataType = Parameters.MetadataKind,\r
-                Segments = Parameters.MovieSegments\r
-            };\r
-            Parameters.MessageBus.Send(message);\r
-            logger.Trace(Strings.EXIT);\r
-        }\r
-\r
         private void UploadNexioMetadata() {\r
             logger.Trace(Strings.ENTRY);\r
-            String xml = null;\r
+            string xml = null;\r
             string name = GetOutputName();\r
             string description = Parameters.ArchiveMetadata?.mediaTitle;\r
             if (Parameters.TargetConfig.KillDateDays > 0) {\r
@@ -440,11 +425,11 @@ namespace MaestroShared.Targets {
             string nameWithoutExtension = GetDynamicText(Parameters.TargetConfig.OutputFormat);\r
             string extension = Path.GetExtension(InputName);\r
             extension = extension.ToUpper();\r
-            string result = String.Format(FILENAME, nameWithoutExtension, extension);\r
+            string result = string.Format(FILENAME, nameWithoutExtension, extension);\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
+                    string versioned = string.Format(VERSIONED_FILENAME, nameWithoutExtension, version, extension);\r
                     logger.Debug(ALREADY_EXISTS, result, versioned);\r
                     result = versioned;\r
                     version++;\r
index a37ae9c0032f417d273d10d284c68d5420825af2..ec0048d9be6c3b1fb5c93c0794036d1f66bcd50a 100644 (file)
@@ -7,6 +7,7 @@ using MediaCubeClient;
 using NativeOctopusClient;\r
 using OctopusClient;\r
 using System;\r
+using System.Collections.Generic;\r
 using System.Security.Principal;\r
 using System.Text.RegularExpressions;\r
 using System.Windows.Forms;\r
@@ -29,7 +30,8 @@ namespace MaestroShared.Controls {
         public TrafficIDSelector TrafficIDSelector { get => trafficIDSelector; }\r
         public UISettings Settings { get; set; }\r
 \r
-        public MetadataProvider[] Providers { get => providers;\r
+        public MetadataProvider[] Providers {\r
+            get => providers;\r
             set {\r
                 providers = value;\r
                 if (providers == null)\r
@@ -139,7 +141,7 @@ namespace MaestroShared.Controls {
             textSelectedMetadata.Text = name;\r
         }\r
 \r
-        private void TrafficIDChangedEvent(string id, int variantID, string text) {\r
+        private void TrafficIDChangedEvent(string id, int variantID, string text, List<TrafficItem> selected) {\r
             octopusIDSelector.ClearSelection();\r
             nativeOctopusIDSelector.ClearSelection();\r
             ClearFreeMetadata();\r
@@ -158,7 +160,7 @@ namespace MaestroShared.Controls {
                     config = MetadataProvider.Get<TrafficMetadata>(Providers);\r
                     if (config == null)\r
                         return;\r
-                    tabMetadata.SelectedTab =  tpTraffic;\r
+                    tabMetadata.SelectedTab = tpTraffic;\r
                     trafficIDSelector.LookupByMaterialID(id);\r
                     break;\r
                 case MetadataType.TrafficPromo:\r
index 64e0ca1205c2d99832616528276e682b94ddae7a..bf5a5ed3d7b1f92967ac82677f48241a35928e2b 100644 (file)
@@ -50,6 +50,7 @@
     <PlatformTarget>x64</PlatformTarget>\r
     <ErrorReport>prompt</ErrorReport>\r
     <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>\r
+    <Deterministic>true</Deterministic>\r
   </PropertyGroup>\r
   <ItemGroup>\r
     <Reference Include="LinkDotNet.MessageHandling, Version=0.2.0.0, Culture=neutral, processorArchitecture=MSIL">\r
index a0874dc3d17558c837331eb9e9ba9a9ae07af750..79828f4f8df320adb85b213e1e38a13852602994 100644 (file)
@@ -50,6 +50,7 @@
     <PlatformTarget>x64</PlatformTarget>\r
     <ErrorReport>prompt</ErrorReport>\r
     <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>\r
+    <Deterministic>true</Deterministic>\r
   </PropertyGroup>\r
   <ItemGroup>\r
     <Reference Include="LinkDotNet.MessageHandling.Contracts, Version=0.2.0.0, Culture=neutral, processorArchitecture=MSIL">\r
index 0e1dba6733995b034a2485d94748c9d851f13dd3..ff5561b11eecded226fd6905e953a0793b905c7b 100644 (file)
@@ -71,6 +71,7 @@
     <PlatformTarget>x64</PlatformTarget>\r
     <ErrorReport>prompt</ErrorReport>\r
     <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>\r
+    <Deterministic>true</Deterministic>\r
   </PropertyGroup>\r
   <ItemGroup>\r
     <Reference Include="LinkDotNet.MessageHandling.Contracts, Version=0.2.0.0, Culture=neutral, processorArchitecture=MSIL">\r
index 7a1d39366001ec4ab700ec520772c2c84db91a86..14645450fff9dad1167cf5ca937d2c9c5ea60c0a 100644 (file)
@@ -54,6 +54,7 @@
     <ErrorReport>prompt</ErrorReport>\r
     <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>\r
     <Prefer32Bit>true</Prefer32Bit>\r
+    <Deterministic>true</Deterministic>\r
   </PropertyGroup>\r
   <PropertyGroup>\r
     <ApplicationIcon>maestro.ico</ApplicationIcon>\r
index e05ef4952ddf3c54e1573c785caad7368c05b2cc..e5fd801b9256edef58be2198b0a0b455500b9538 100644 (file)
@@ -6,6 +6,14 @@ namespace PasswordEncrypter {
 \r
         [STAThread]\r
         static void Main(string[] args) {\r
+            /*\r
+            string s = "7RKZYBzumKjL40SJwuwiFCvX57xuCN8zay6OttUm2wbrgImyYZBHyZTUUYrXX31Ge2Uwew07HYsqh2uzdJeDBDwcVntxaHg3nIpv9Dyq/odVoiC4tUF/K+lgvKWANcrZ";\r
+            string original = StringCipher.Decrypt(s);\r
+            Console.WriteLine("Restored password:");\r
+            Console.WriteLine(original);\r
+            Console.ReadLine();\r
+            */\r
+\r
             Console.WriteLine("Password:");\r
             string password = Console.ReadLine();\r
 \r
similarity index 96%
rename from client/PlanAIRClient/PlanAirADResult.cs
rename to client/PlanAIRClient/Model/PlanAirADResult.cs
index 5d34b50ec6ae494ee51e922dda555add548fe2a7..5636e440b737717b6402eb9270d5d321436788d8 100644 (file)
@@ -1,4 +1,4 @@
-namespace TrafficClient {\r
+namespace TrafficClient.Model {\r
     public partial class PlanAirADResult {\r
 \r
         private int _t_SpotID;\r
diff --git a/client/PlanAIRClient/Model/PlanAirMaterialResult.cs b/client/PlanAIRClient/Model/PlanAirMaterialResult.cs
new file mode 100644 (file)
index 0000000..11581b9
--- /dev/null
@@ -0,0 +1,30 @@
+namespace TrafficClient.Model {\r
+    public partial class PlanAirMaterialResult {\r
+        public int v_ProgrammeID;\r
+        public bool v_Live;\r
+        public string v_EpisodeID;\r
+        public int? v_VariantID;\r
+        public string v_MediaID;\r
+        public int? v_VariantTypeID;\r
+        public string v_ProgTitle;\r
+        public string v_EpTitle;\r
+        public short? v_Episode;\r
+        public string v_VariantType;\r
+        public string v_VariantKeywords;\r
+        public string v_VariantLengthTC;\r
+        public int? v_VariantLengthFrame;\r
+        public int? v_VariantNrSegments;\r
+        public System.DateTime? v_FirstBroadcastDate;\r
+        public System.DateTime? v_NextBroadcastDate;\r
+        public bool? v_OkForAir;\r
+        public bool? v_ForTransm;\r
+        public int? v_SegNr;\r
+        public int? v_SegID;\r
+        public int? v_SegTcIn;\r
+        public int? v_SegTcOut;\r
+        public int? v_SegDuration;\r
+        public string v_SegTitle;\r
+        public string v_SegKeyWords;\r
+        public bool? v_SegDropable;\r
+    }\r
+}\r
similarity index 96%
rename from client/PlanAIRClient/PlanAirMaterialSegmentResult.cs
rename to client/PlanAIRClient/Model/PlanAirMaterialSegmentResult.cs
index 9fb85701d05f5b710dbd3e1b02e329fda799b58e..99615b9e2c12a399fe52837ad76a7e1ea3755191 100644 (file)
@@ -1,4 +1,4 @@
-namespace TrafficClient {\r
+namespace TrafficClient.Model {\r
     public partial class PlanAirMaterialSegmentResult {\r
 \r
         private int _v_SegID;\r
similarity index 96%
rename from client/PlanAIRClient/PlanAirPromoResult.cs
rename to client/PlanAIRClient/Model/PlanAirPromoResult.cs
index 4171aaa6893e06df0c19fa47d20283541c10f70c..0837b53ae07f57ed03bfc24a583b7d2c50a4821f 100644 (file)
@@ -1,4 +1,4 @@
-namespace TrafficClient {\r
+namespace TrafficClient.Model {\r
     public partial class PlanAirPromoResult {\r
 \r
         private int _t_SpotID;\r
index d28422c71313eeaa0bcd29748478336f19efc2d1..1fc68f17c4d2c77420dd9a9ac5575e1196cd5bdb 100644 (file)
@@ -1,8 +1,11 @@
-using System;\r
+using NLog;\r
+using System;\r
 using System.Data.SqlClient;\r
+using TrafficClient.Model;\r
 \r
 namespace TrafficClient {\r
     public class PlanAirDataReader {\r
+        private static readonly Logger logger = LogManager.GetCurrentClassLogger();\r
 \r
         private string ReadString(SqlDataReader reader, ref int f) {\r
             string result = null;\r
@@ -39,8 +42,10 @@ namespace TrafficClient {
             return result;\r
         }\r
 \r
-        public clIFsp_EC_MAMBradocastResult ToclIFsp_MAMBroadcastResult(SqlDataReader reader) {\r
-            clIFsp_EC_MAMBradocastResult item = new clIFsp_EC_MAMBradocastResult();\r
+        public PlanAirMaterialResult ToSingleMaterialResult(SqlDataReader reader) {\r
+            //for (int i = 0; i < reader.FieldCount; i++)\r
+            //    logger.Debug($"{i} : {reader.GetName(i)} {reader.GetDataTypeName(i)} {reader.GetFieldType(i)}");\r
+            PlanAirMaterialResult item = new PlanAirMaterialResult();\r
             int f = 0;\r
             item.v_ProgrammeID = (int)ReadInt(reader, ref f);\r
             item.v_Live = (bool)ReadBool(reader, ref f);\r
@@ -63,8 +68,59 @@ namespace TrafficClient {
             item.v_ForTransm = ReadBool(reader, ref f);\r
             return item;\r
         }\r
+        /*\r
+USE [PA_Echo]\r
+GO\r
 \r
-        public PlanAirPromoResult ToclIFsp_MAMPromotionalResult(SqlDataReader reader) {\r
+DECLARE        @return_value int\r
+\r
+EXEC   @return_value = [dbo].[clIFsp_EC_MAM]\r
+               @Operation = 6002,\r
+               @@@Options = 0,\r
+               @@ItemID = NULL,\r
+               @@DateParam1 = N'2018-12-06',\r
+               @@DateParam2 = N'2018-12-06'\r
+\r
+SELECT 'Return Value' = @return_value\r
+\r
+GO\r
+         \r
+             */\r
+        public PlanAirMaterialResult ToMultiMaterialResult(SqlDataReader reader) {\r
+            //for (int i = 0; i < reader.FieldCount; i++)\r
+            //    logger.Debug($"{i} : {reader.GetName(i)} {reader.GetDataTypeName(i)} {reader.GetFieldType(i)}");\r
+            PlanAirMaterialResult item = new PlanAirMaterialResult();\r
+            int f = 0;\r
+            item.v_ProgrammeID = (int)ReadInt(reader, ref f);\r
+            item.v_Live = (bool)ReadBool(reader, ref f);\r
+            item.v_EpisodeID = ReadString(reader, ref f);\r
+            item.v_VariantID = ReadInt(reader, ref f);\r
+            item.v_MediaID = ReadString(reader, ref f);\r
+            item.v_VariantTypeID = ReadInt(reader, ref f);\r
+            item.v_ProgTitle = ReadString(reader, ref f);\r
+            item.v_EpTitle = ReadString(reader, ref f);\r
+            item.v_Episode = ReadShort(reader, ref f);\r
+            item.v_VariantType = ReadString(reader, ref f);\r
+            item.v_VariantKeywords = ReadString(reader, ref f);\r
+            item.v_OkForAir = ReadBool(reader, ref f);\r
+            item.v_ForTransm = ReadBool(reader, ref f);\r
+            item.v_VariantLengthTC = ReadString(reader, ref f);\r
+            item.v_VariantLengthFrame = ReadInt(reader, ref f);\r
+            item.v_VariantNrSegments = ReadInt(reader, ref f);\r
+            item.v_SegNr = ReadInt(reader, ref f);\r
+            item.v_SegID = ReadInt(reader, ref f);\r
+            item.v_SegTcIn = ReadInt(reader, ref f);\r
+            item.v_SegTcOut = ReadInt(reader, ref f);\r
+            item.v_SegDuration = ReadInt(reader, ref f);\r
+            item.v_SegTitle = ReadString(reader, ref f);\r
+            item.v_SegKeyWords = ReadString(reader, ref f);\r
+            item.v_SegDropable = ReadBool(reader, ref f);\r
+            item.v_FirstBroadcastDate = ReadDateTime(reader, ref f);\r
+            item.v_NextBroadcastDate = ReadDateTime(reader, ref f);\r
+            return item;\r
+        }\r
+\r
+        public PlanAirPromoResult ToPromoResult(SqlDataReader reader) {\r
             PlanAirPromoResult item = new PlanAirPromoResult();\r
             int f = 0;\r
             item.t_SpotID = (int)ReadInt(reader, ref f);\r
@@ -89,7 +145,7 @@ namespace TrafficClient {
             return item;\r
         }\r
 \r
-        public PlanAirADResult ToclIFsp_MAMAdvertisementResult(SqlDataReader reader) {\r
+        public PlanAirADResult ToADResult(SqlDataReader reader) {\r
             PlanAirADResult item = new PlanAirADResult();\r
             int f = 0;\r
             item.t_SpotID = (int)ReadInt(reader, ref f);\r
@@ -108,7 +164,7 @@ namespace TrafficClient {
             return item;\r
         }\r
 \r
-        public PlanAirMaterialSegmentResult ToclIFsp_SegmentResult(SqlDataReader reader) {\r
+        public PlanAirMaterialSegmentResult ToMaterialSegmentResult(SqlDataReader reader) {\r
             PlanAirMaterialSegmentResult item = new PlanAirMaterialSegmentResult();\r
             int f = 0;\r
             item.v_SegID = (int)ReadInt(reader, ref f);\r
index 72a5fcf16a0608c24300a66d08468740b9aa83f1..f75ca3e9aeb5d4fd5b718f54302289f7bf45aa60 100644 (file)
@@ -12,7 +12,7 @@ namespace TrafficClient.Properties {
     \r
     \r
     [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]\r
-    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "15.1.0.0")]\r
+    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "15.8.0.0")]\r
     internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {\r
         \r
         private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));\r
@@ -22,16 +22,5 @@ namespace TrafficClient.Properties {
                 return defaultInstance;\r
             }\r
         }\r
-        \r
-        [global::System.Configuration.ApplicationScopedSettingAttribute()]\r
-        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]\r
-        [global::System.Configuration.SpecialSettingAttribute(global::System.Configuration.SpecialSetting.ConnectionString)]\r
-        [global::System.Configuration.DefaultSettingValueAttribute("Data Source=folkloredb.hu\\sql08,33860;Initial Catalog=CLArchiveTF_0;Persist Secur" +\r
-            "ity Info=True;User ID=MAM;Password=Echotv.hu")]\r
-        public string CLArchiveTF_0ConnectionString {\r
-            get {\r
-                return ((string)(this["CLArchiveTF_0ConnectionString"]));\r
-            }\r
-        }\r
     }\r
 }\r
index 63504285a02f5fc002df25e2df73c93f115aa350..2bd17f050c79279d80de789ed2c6a00bffabae92 100644 (file)
@@ -1,14 +1,5 @@
 <?xml version='1.0' encoding='utf-8'?>\r
-<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" GeneratedClassNamespace="PlanAIRClient.Properties" GeneratedClassName="Settings">\r
+<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)">\r
   <Profiles />\r
-  <Settings>\r
-    <Setting Name="CLArchiveTF_0ConnectionString" Type="(Connection string)" Scope="Application">\r
-      <DesignTimeValue Profile="(Default)">&lt;?xml version="1.0" encoding="utf-16"?&gt;\r
-&lt;SerializableConnectionString xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"&gt;\r
-  &lt;ConnectionString&gt;Data Source=folkloredb.hu\sql08,33860;Initial Catalog=CLArchiveTF_0;Persist Security Info=True;User ID=MAM;Password=Echotv.hu&lt;/ConnectionString&gt;\r
-  &lt;ProviderName&gt;System.Data.SqlClient&lt;/ProviderName&gt;\r
-&lt;/SerializableConnectionString&gt;</DesignTimeValue>\r
-      <Value Profile="(Default)">Data Source=folkloredb.hu\sql08,33860;Initial Catalog=CLArchiveTF_0;Persist Security Info=True;User ID=MAM;Password=Echotv.hu</Value>\r
-    </Setting>\r
-  </Settings>\r
+  <Settings />\r
 </SettingsFile>
\ No newline at end of file
index 4c678946b4b17742f4ee4b20b96ca2a06f8423a2..bcbde51cf63d5c173a2d9dc43528dca3e3d72601 100644 (file)
@@ -178,6 +178,15 @@ namespace TrafficClient {
             }\r
         }\r
         \r
+        /// <summary>\r
+        ///   Looks up a localized string similar to Szegmens.\r
+        /// </summary>\r
+        internal static string SEGMENT {\r
+            get {\r
+                return ResourceManager.GetString("SEGMENT", resourceCulture);\r
+            }\r
+        }\r
+        \r
         /// <summary>\r
         ///   Looks up a localized string similar to Szegmensek.\r
         /// </summary>\r
index eb3cd1cac0e634f94e64de2f97561ed66a109cfe..1e9af041b16259477136229e9fde18b5a7f0e50b 100644 (file)
   <data name="IDNOTEXISTS" xml:space="preserve">\r
     <value>Az azonosító jelenleg nem található a rendszerben. Kérem próbálja újra.</value>\r
   </data>\r
+  <data name="SEGMENT" xml:space="preserve">\r
+    <value>Szegmens</value>\r
+  </data>\r
 </root>
\ No newline at end of file
index 4ddd6b8648f38614ede53c35d279732588003525..d0d3b74b4ffcb0dc61f673996e3da742e90bcd8a 100644 (file)
@@ -1,4 +1,5 @@
-using LinkDotNet.MessageHandling.Contracts;\r
+using Interfaces;\r
+using LinkDotNet.MessageHandling.Contracts;\r
 using MaestroShared.Metadata;\r
 using NLog;\r
 using System;\r
@@ -7,9 +8,8 @@ using System.Data.SqlClient;
 using TrafficClient.Workers;\r
 \r
 namespace TrafficClient {\r
-    public class TrafficAPI {\r
+    public class TrafficAPI : ITrafficAPI {\r
         private static readonly Logger logger = LogManager.GetCurrentClassLogger();\r
-        private TrafficContext context = new TrafficContext();\r
         private string connectionString;\r
         private PlanAirDataReader cliFSPReader;\r
         private SqlConnection connection;\r
@@ -17,6 +17,28 @@ namespace TrafficClient {
         private PromoWorker promoWorker;\r
         private ADWorker adWorker;\r
 \r
+        public TrafficParameters Parameters { get; }\r
+\r
+        public TrafficAPI(TrafficParameters parameters) {\r
+            Parameters = parameters;\r
+            var timeout = parameters?.Configuration?.Server?.Timeout;\r
+            timeout = timeout < 1000 ? 1000 : timeout;\r
+            var connString = parameters?.Configuration?.Server.Address;\r
+            var user = parameters?.Configuration?.Server.UserName;\r
+            var password = parameters?.Configuration?.Server.Password;\r
+            var functionName = parameters?.Configuration?.FunctionName;\r
+            var messageBus = parameters?.MessageBus;\r
+            connectionString = string.Format("{0};User ID={1};Password={2};Connection Timeout={3}", connString, user, password, timeout / 1000);\r
+            connection = new SqlConnection(connectionString);\r
+            cliFSPReader = new PlanAirDataReader();\r
+            if (true.Equals(parameters?.Configuration?.MultiSegmentEnabled))\r
+                materialWorker = new MultiSegmentMaterialWorker(connection, cliFSPReader, functionName, messageBus);\r
+            else\r
+                materialWorker = new SingleSegmentMaterialWorker(connection, cliFSPReader, functionName, messageBus);\r
+            promoWorker = new PromoWorker(connection, cliFSPReader, functionName, messageBus);\r
+            adWorker = new ADWorker(connection, cliFSPReader, functionName, messageBus);\r
+        }\r
+\r
         public TrafficAPI(string connString, string user, string password, int timeout, string functionName, IMessageBus messageBus) {\r
             var correctedTimeout = timeout < 1000 ? 1000 : timeout;\r
             connectionString = String.Format("{0};User ID={1};Password={2};Connection Timeout={3}", connString, user, password, correctedTimeout / 1000);\r
@@ -35,10 +57,10 @@ namespace TrafficClient {
             return materialWorker.GetMaterialArchiveMetadata(strParam);\r
         }\r
 \r
-        public void Approve(int itemID, bool ready, MetadataType kind) {\r
+        public void Approve(int itemID, bool ready, MetadataType kind, bool ifCompleted) {\r
             switch (kind) {\r
                 case MetadataType.TrafficMaterial: {\r
-                        materialWorker.SetMaterialOK(itemID, ready);\r
+                        materialWorker.SetMaterialOK(itemID, ready, ifCompleted);\r
                         break;\r
                     }\r
                 case MetadataType.TrafficAD: {\r
@@ -52,14 +74,33 @@ namespace TrafficClient {
             }\r
         }\r
 \r
-        public void SaveSegments(int itemID, MetadataType kind, List<MovieSegment> segments) {\r
+        public string SaveSegments(int itemID, MetadataType kind, List<MovieSegment> segments, List<TrafficItem> selectedSegments) {\r
+            string result = null;\r
             switch (kind) {\r
                 case MetadataType.TrafficMaterial: {\r
-                        //egyebkent nem fogadja el a szegmnesadatokat?\r
-                        materialWorker.SetMaterialOK(itemID, false);\r
-                        materialWorker.DeleteMaterialSegments(itemID);\r
-                        foreach (MovieSegment actualSegment in segments)\r
-                            materialWorker.AddMaterialSegment(itemID, actualSegment);\r
+                        if (true.Equals(Parameters?.Configuration?.MultiSegmentEnabled)) {\r
+                            materialWorker.SetMaterialOK(itemID, false);\r
+                            int delSegCount = selectedSegments.Count - segments.Count;\r
+                            while (delSegCount > 0) {\r
+                                var segNr = (int)selectedSegments[selectedSegments.Count - 1].SegmentNr;\r
+                                materialWorker.DeleteMaterialSegment(itemID, segNr);\r
+                                selectedSegments.RemoveAt(selectedSegments.Count - 1);\r
+                                delSegCount--;\r
+                            }\r
+\r
+                            for (int i = 0; i < segments.Count; i++) {\r
+                                MovieSegment actualSegment = segments[i];\r
+                                var segNr = (int)selectedSegments[i].SegmentNr;\r
+                                result = materialWorker.AddMaterialSegment(itemID, actualSegment, result, segNr);\r
+                            }\r
+\r
+                        } else {\r
+                            //egyebkent nem fogadja el a szegmnesadatokat?\r
+                            materialWorker.SetMaterialOK(itemID, false);\r
+                            materialWorker.DeleteMaterialSegments(itemID);\r
+                            foreach (MovieSegment actualSegment in segments)\r
+                                materialWorker.AddMaterialSegment(itemID, actualSegment);\r
+                        }\r
                         break;\r
                     }\r
                 case MetadataType.TrafficAD: {\r
@@ -73,6 +114,7 @@ namespace TrafficClient {
                         break;\r
                     }\r
             }\r
+            return result;\r
         }\r
 \r
         public List<TrafficItem> GetPromos(string search, bool problematic, DateTime? from = null, DateTime? to = null) {\r
diff --git a/client/PlanAIRClient/TrafficClasses.cs b/client/PlanAIRClient/TrafficClasses.cs
deleted file mode 100644 (file)
index f2771ae..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-namespace TrafficClient {\r
-    partial class TrafficContext {\r
-    }\r
-}
\ No newline at end of file
diff --git a/client/PlanAIRClient/TrafficClasses.dbml b/client/PlanAIRClient/TrafficClasses.dbml
deleted file mode 100644 (file)
index 55f03f0..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?><Database Name="CLArchiveTF_0" Class="TrafficContext" xmlns="http://schemas.microsoft.com/linqtosql/dbml/2007">\r
-  <Connection Mode="AppSettings" ConnectionString="Data Source=folkloredb.hu\sql08,33860;Initial Catalog=CLArchiveTF_0;Persist Security Info=True;User ID=MAM" SettingsObjectName="TrafficClient.Properties.Settings" SettingsPropertyName="CLArchiveTF_0ConnectionString" Provider="System.Data.SqlClient" />\r
-  <Function Name="dbo.clIFsp_EC_MAM" Method="clIFsp_EC_MAM">\r
-    <Parameter Name="Operation" Parameter="operation" Type="System.Int32" DbType="Int" />\r
-    <Parameter Name="@@Options" Parameter="__Options" Type="System.Int32" DbType="Int" />\r
-    <Parameter Name="@ItemID" Parameter="_ItemID" Type="System.Int32" DbType="Int" />\r
-    <Parameter Name="@IntParam1" Parameter="_IntParam1" Type="System.Int32" DbType="Int" />\r
-    <Parameter Name="@IntParam2" Parameter="_IntParam2" Type="System.Int32" DbType="Int" />\r
-    <Parameter Name="@IntParam3" Parameter="_IntParam3" Type="System.Int32" DbType="Int" />\r
-    <Parameter Name="@StrParam1" Parameter="_StrParam1" Type="System.String" DbType="VarChar(200)" />\r
-    <Parameter Name="@StrParam2" Parameter="_StrParam2" Type="System.String" DbType="VarChar(MAX)" />\r
-    <Parameter Name="@DateParam1" Parameter="_DateParam1" Type="System.DateTime" DbType="DateTime" />\r
-    <Parameter Name="@DateParam2" Parameter="_DateParam2" Type="System.DateTime" DbType="DateTime" />\r
-    <ElementType Name="clIFsp_EC_MAMResult">\r
-      <Column Name="v_ProgrammeID" Type="System.Int32" DbType="Int NOT NULL" CanBeNull="false" />\r
-      <Column Name="v_Live" Type="System.Boolean" DbType="Bit NOT NULL" CanBeNull="false" />\r
-      <Column Name="v_EpisodeID" Type="System.String" DbType="VarChar(6) NOT NULL" CanBeNull="false" />\r
-      <Column Name="v_VariantID" Type="System.Int32" DbType="Int" CanBeNull="true" />\r
-      <Column Name="v_VariantTypeID" Type="System.Int32" DbType="Int" CanBeNull="true" />\r
-      <Column Name="v_ProgTitle" Type="System.String" DbType="NVarChar(60)" CanBeNull="true" />\r
-      <Column Name="v_EpTitle" Type="System.String" DbType="NVarChar(60)" CanBeNull="true" />\r
-      <Column Name="v_Episode" Type="System.Int16" DbType="SmallInt" CanBeNull="true" />\r
-      <Column Name="v_VariantType" Type="System.String" DbType="VarChar(40)" CanBeNull="true" />\r
-      <Column Name="v_VariantKeywords" Type="System.String" DbType="VarChar(25)" CanBeNull="true" />\r
-      <Column Name="v_VariantLengthTC" Type="System.String" DbType="VarChar(150)" CanBeNull="true" />\r
-      <Column Name="v_VariantLengthFrame" Type="System.Int32" DbType="Int" CanBeNull="true" />\r
-      <Column Name="v_VariantNrSegments" Type="System.Int32" DbType="Int" CanBeNull="true" />\r
-      <Column Name="v_FirstBroadcastDate" Type="System.DateTime" DbType="DateTime" CanBeNull="true" />\r
-      <Column Name="v_NextBroadcastDate" Type="System.DateTime" DbType="DateTime" CanBeNull="true" />\r
-      <Column Name="v_OkForAir" Type="System.Boolean" DbType="Bit" CanBeNull="true" />\r
-      <Column Name="v_ForTransm" Type="System.Boolean" DbType="Bit" CanBeNull="true" />\r
-    </ElementType>\r
-  </Function>\r
-</Database>
\ No newline at end of file
diff --git a/client/PlanAIRClient/TrafficClasses.dbml.layout b/client/PlanAIRClient/TrafficClasses.dbml.layout
deleted file mode 100644 (file)
index 61038ff..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>\r
-<ordesignerObjectsDiagram dslVersion="1.0.0.0" absoluteBounds="0, 0, 11, 8.5" name="DataClasses1">\r
-  <DataContextMoniker Name="/TrafficContext" />\r
-</ordesignerObjectsDiagram>
\ No newline at end of file
diff --git a/client/PlanAIRClient/TrafficClasses.designer.cs b/client/PlanAIRClient/TrafficClasses.designer.cs
deleted file mode 100644 (file)
index 555d8e0..0000000
+++ /dev/null
@@ -1,60 +0,0 @@
-#pragma warning disable 1591\r
-//------------------------------------------------------------------------------\r
-// <auto-generated>\r
-//     This code was generated by a tool.\r
-//     Runtime Version:4.0.30319.42000\r
-//\r
-//     Changes to this file may cause incorrect behavior and will be lost if\r
-//     the code is regenerated.\r
-// </auto-generated>\r
-//------------------------------------------------------------------------------\r
-\r
-namespace TrafficClient {\r
-    using System.Data.Linq;\r
-    using System.Data.Linq.Mapping;\r
-    using System.Reflection;\r
-\r
-\r
-    [global::System.Data.Linq.Mapping.DatabaseAttribute(Name = "CLArchiveTF_0")]\r
-    public partial class TrafficContext : System.Data.Linq.DataContext {\r
-\r
-        private static System.Data.Linq.Mapping.MappingSource mappingSource = new AttributeMappingSource();\r
-\r
-        #region Extensibility Method Definitions\r
-        partial void OnCreated();\r
-        #endregion\r
-\r
-        public TrafficContext() :\r
-                base(global::TrafficClient.Properties.Settings.Default.CLArchiveTF_0ConnectionString, mappingSource) {\r
-            OnCreated();\r
-        }\r
-\r
-        public TrafficContext(string connection) :\r
-                base(connection, mappingSource) {\r
-            OnCreated();\r
-        }\r
-\r
-        public TrafficContext(System.Data.IDbConnection connection) :\r
-                base(connection, mappingSource) {\r
-            OnCreated();\r
-        }\r
-\r
-        public TrafficContext(string connection, System.Data.Linq.Mapping.MappingSource mappingSource) :\r
-                base(connection, mappingSource) {\r
-            OnCreated();\r
-        }\r
-\r
-        public TrafficContext(System.Data.IDbConnection connection, System.Data.Linq.Mapping.MappingSource mappingSource) :\r
-                base(connection, mappingSource) {\r
-            OnCreated();\r
-        }\r
-\r
-        [global::System.Data.Linq.Mapping.FunctionAttribute(Name = "dbo.clIFsp_EC_MAM")]\r
-        public ISingleResult<clIFsp_EC_MAMBradocastResult> clIFsp_EC_MAM([global::System.Data.Linq.Mapping.ParameterAttribute(Name = "Operation", DbType = "Int")] System.Nullable<int> operation, [global::System.Data.Linq.Mapping.ParameterAttribute(Name = "@@Options", DbType = "Int")] System.Nullable<int> @__Options, [global::System.Data.Linq.Mapping.ParameterAttribute(Name = "@ItemID", DbType = "Int")] System.Nullable<int> _ItemID, [global::System.Data.Linq.Mapping.ParameterAttribute(Name = "@IntParam1", DbType = "Int")] System.Nullable<int> _IntParam1, [global::System.Data.Linq.Mapping.ParameterAttribute(Name = "@IntParam2", DbType = "Int")] System.Nullable<int> _IntParam2, [global::System.Data.Linq.Mapping.ParameterAttribute(Name = "@IntParam3", DbType = "Int")] System.Nullable<int> _IntParam3, [global::System.Data.Linq.Mapping.ParameterAttribute(Name = "@StrParam1", DbType = "VarChar(200)")] string _StrParam1, [global::System.Data.Linq.Mapping.ParameterAttribute(Name = "@StrParam2", DbType = "VarChar(MAX)")] string _StrParam2, [global::System.Data.Linq.Mapping.ParameterAttribute(Name = "@DateParam1", DbType = "DateTime")] System.Nullable<System.DateTime> _DateParam1, [global::System.Data.Linq.Mapping.ParameterAttribute(Name = "@DateParam2", DbType = "DateTime")] System.Nullable<System.DateTime> _DateParam2) {\r
-            IExecuteResult result = this.ExecuteMethodCall(this, ((MethodInfo)(MethodInfo.GetCurrentMethod())), operation, @__Options, _ItemID, _IntParam1, _IntParam2, _IntParam3, _StrParam1, _StrParam2, _DateParam1, _DateParam2);\r
-            return ((ISingleResult<clIFsp_EC_MAMBradocastResult>)(result.ReturnValue));\r
-        }\r
-    }\r
-\r
-}\r
-#pragma warning restore 1591\r
index 9fc03e5b91962ea3a12b5ff664cff1be3a47aa38..bc47cf891b991fe16556d409e885aabaaa73342e 100644 (file)
     <Reference Include="System.Xml" />\r
   </ItemGroup>\r
   <ItemGroup>\r
-    <Compile Include="clIFsp_EC_MAMBradocastResult.cs" />\r
-    <Compile Include="PlanAirADResult.cs" />\r
+    <Compile Include="Model\PlanAirADResult.cs" />\r
     <Compile Include="PlanAirDataReader.cs" />\r
-    <Compile Include="PlanAirMaterialSegmentResult.cs" />\r
-    <Compile Include="PlanAirPromoResult.cs" />\r
+    <Compile Include="Model\PlanAirMaterialResult.cs" />\r
+    <Compile Include="Model\PlanAirMaterialSegmentResult.cs" />\r
+    <Compile Include="Model\PlanAirPromoResult.cs" />\r
     <Compile Include="TrafficMetadataType.cs" />\r
+    <Compile Include="TrafficParameters.cs" />\r
     <Compile Include="Workers\ADWorker.cs" />\r
     <Compile Include="CustomDataGridView.cs">\r
       <SubType>Component</SubType>\r
     <Compile Include="TrafficLookupResultSelector.Designer.cs">\r
       <DependentUpon>TrafficLookupResultSelector.cs</DependentUpon>\r
     </Compile>\r
-    <Compile Include="TrafficClasses.cs">\r
-      <DependentUpon>TrafficClasses.dbml</DependentUpon>\r
-    </Compile>\r
-    <Compile Include="TrafficClasses.designer.cs">\r
-      <AutoGen>True</AutoGen>\r
-      <DesignTime>True</DesignTime>\r
-      <DependentUpon>TrafficClasses.dbml</DependentUpon>\r
-    </Compile>\r
     <Compile Include="TrafficAPI.cs" />\r
     <Compile Include="Properties\AssemblyInfo.cs" />\r
     <Compile Include="Properties\Settings.Designer.cs">\r
       <DesignTimeSharedInput>True</DesignTimeSharedInput>\r
       <DependentUpon>Settings.settings</DependentUpon>\r
     </Compile>\r
-    <Compile Include="TrafficConfiguration.cs" />\r
     <Compile Include="TrafficIDSelector.cs">\r
       <SubType>UserControl</SubType>\r
     </Compile>\r
     <None Include="Properties\DataSources\TrafficAPI.datasource">\r
       <CopyToOutputDirectory>Always</CopyToOutputDirectory>\r
     </None>\r
-    <None Include="TrafficClasses.dbml">\r
-      <Generator>MSLinqToSQLGenerator</Generator>\r
-      <LastGenOutput>TrafficClasses.designer.cs</LastGenOutput>\r
-      <SubType>Designer</SubType>\r
-    </None>\r
-    <None Include="TrafficClasses.dbml.layout">\r
-      <DependentUpon>TrafficClasses.dbml</DependentUpon>\r
-    </None>\r
     <None Include="Properties\Settings.settings">\r
       <Generator>SettingsSingleFileGenerator</Generator>\r
       <LastGenOutput>Settings.Designer.cs</LastGenOutput>\r
index 85dc21cdd9b2e5ba8b34e485b2199704476296b3..0249fcb513deaf9b07d11ce44d89365391d728c3 100644 (file)
@@ -1,17 +1,19 @@
-using System.Windows.Forms;\r
-using System;\r
-using System.Linq;\r
-using System.Collections.Generic;\r
+using Interfaces;\r
 using MaestroShared.Commons;\r
 using MaestroShared.Configuration;\r
-using System.Text.RegularExpressions;\r
 using MaestroShared.MessageBus;\r
+using MaestroShared.Metadata;\r
+using System;\r
+using System.Collections.Generic;\r
+using System.Linq;\r
+using System.Text.RegularExpressions;\r
+using System.Windows.Forms;\r
 \r
 namespace TrafficClient {\r
-    public delegate void OnSelectedIDChanged(string ID, int variantID, string text);\r
+    public delegate void OnSelectedIDChanged(string ID, int variantID, string text, List<TrafficItem> selected);\r
 \r
     public partial class TrafficIDSelector : UserControl {\r
-        public TrafficAPI trafficAPI { get; private set; }\r
+        public ITrafficAPI trafficAPI { get; private set; }\r
         public OnSelectedIDChanged IDChangedEvent { get; set; }\r
         private DataGridViewCheckBoxCell selectedCell;\r
         private bool refreshDisabled;\r
@@ -26,14 +28,12 @@ namespace TrafficClient {
         }\r
 \r
 \r
-        private void InitializeTexts() {\r
+        private void Initialize() {\r
             TrafficMetadata metadata = parameters?.Configuration ?? new TrafficMetadata();\r
-\r
             dgTraffic.AutoGenerateColumns = false;\r
-\r
             chkProblematic.Text = metadata.Resource("PROBLEMATIC", Resources.PROBLEMATIC);\r
             rbMaterial.Text = metadata.Resource("MATERIAL", Resources.MATERIAL);\r
-            rbPromo.Text = metadata.Resource("PROMOTION", Resources.PROMOTION); \r
+            rbPromo.Text = metadata.Resource("PROMOTION", Resources.PROMOTION);\r
             rbAD.Text = metadata.Resource("ADVERTISEMENT", Resources.ADVERTISEMENT);\r
         }\r
 \r
@@ -42,8 +42,8 @@ namespace TrafficClient {
                 parameters = value;\r
                 var server = parameters.Configuration?.Server;\r
                 if (server != null && server.Address != null)\r
-                    trafficAPI = new TrafficAPI(server.Address.OriginalString, server.UserName, server.Password, server.Timeout, parameters.Configuration?.FunctionName, value.MessageBus);\r
-                InitializeTexts();\r
+                    trafficAPI = new TrafficAPI(parameters);\r
+                Initialize();\r
                 RefreshResults();\r
             }\r
         }\r
@@ -61,7 +61,10 @@ namespace TrafficClient {
             dgTraffic.Columns.Clear();\r
             TrafficMetadata metadata = parameters?.Configuration ?? new TrafficMetadata();\r
             if (rbMaterial.Checked) {\r
-                dgTraffic.Columns.AddRange(GetMaterialColumns(metadata));\r
+                if (true.Equals(parameters?.Configuration?.MultiSegmentEnabled))\r
+                    dgTraffic.Columns.AddRange(GetMultiMaterialColumns(metadata));\r
+                else\r
+                    dgTraffic.Columns.AddRange(GetSingleMaterialColumns(metadata));\r
                 string searchText = Regex.Replace(txtFilter.Text, "[^0-9]", "");\r
                 items = trafficAPI.GetMaterials(searchText, chkProblematic.Checked, scheduledDate, scheduledDate);\r
             } else if (rbAD.Checked) {\r
@@ -114,22 +117,47 @@ namespace TrafficClient {
         private void OnSelectionChanged(DataGridViewRow actualRow) {\r
             TrafficItem trafficItem = actualRow.DataBoundItem as TrafficItem;\r
             DataGridViewCheckBoxCell actualCell = actualRow.Cells[0] as DataGridViewCheckBoxCell;\r
-            if (!actualCell.Equals(selectedCell)) {\r
-                ClearSelection();\r
-                selectedCell = actualRow.Cells[0] as DataGridViewCheckBoxCell;\r
-            }\r
+            List<TrafficItem> items = trafficAPIBindingSource.DataSource as List<TrafficItem>;\r
+\r
+            bool selfClick = actualCell.Equals(selectedCell);\r
+\r
+            selectedCell = actualRow.Cells[0] as DataGridViewCheckBoxCell;\r
             selectedCell.Value = !(bool)selectedCell.Value;\r
             bool selected = (bool)selectedCell.Value;\r
 \r
-            if (selected) {\r
-                CreateVersionIfMissing(trafficItem);\r
-                IDChangedEvent?.Invoke(trafficItem.MediaID, trafficItem.VariantID, trafficItem.Title);\r
+            if (true.Equals(parameters?.Configuration?.MultiSegmentEnabled)) {\r
+                bool clear = true;\r
+                List<DataGridViewRow> selectedOthers = null;\r
+                if (selected) {\r
+                    selectedOthers = new List<DataGridViewRow>();\r
+                    foreach (DataGridViewRow r in dgTraffic.Rows) {\r
+                        TrafficItem item = r.DataBoundItem as TrafficItem;\r
+                        if (item.Selected && item.VariantID != trafficItem.VariantID)\r
+                            selectedOthers.Add(r);\r
+                    }\r
+                    if (selectedOthers?.Count() == 0)\r
+                        clear = false;\r
+                }\r
+                if (clear)\r
+                    selectedOthers?.ForEach(r => r.Cells[0].Value = false);\r
+            } else {\r
+                foreach (DataGridViewRow r in dgTraffic.Rows) {\r
+                    TrafficItem item = r.DataBoundItem as TrafficItem;\r
+                    if (actualRow != r && item.Selected)\r
+                        r.Cells[0].Value = false;\r
+                }\r
             }\r
-            else\r
-                IDChangedEvent?.Invoke(null, 0, null);\r
+\r
+            List<TrafficItem> selectedItems = items?.Where(i => i.Selected).ToList();\r
+            if (selectedItems?.Count() > 0) {\r
+                CreateVersionIfMissing(trafficItem);\r
+                IDChangedEvent?.Invoke(trafficItem.MediaID, trafficItem.VariantID, trafficItem.Title, selectedItems);\r
+            } else\r
+                IDChangedEvent?.Invoke(null, 0, null, null);\r
         }\r
 \r
         private void CreateVersionIfMissing(TrafficItem trafficItem) {\r
+            /*\r
             if (String.IsNullOrEmpty(trafficItem.MediaID)) {\r
                 var currentVersion = trafficAPI.GetMaterials(trafficItem.EpisodeID, false)?.FirstOrDefault();\r
                 if (currentVersion == null || String.IsNullOrEmpty(currentVersion.MediaID)) {\r
@@ -152,13 +180,15 @@ namespace TrafficClient {
                     RefreshResults();\r
                 }\r
             }\r
+            */\r
         }\r
 \r
         public void ClearSelection() {\r
-            if (selectedCell == null)\r
-                return;\r
-            selectedCell.Value = false;\r
-            selectedCell = null;\r
+            foreach (DataGridViewRow r in dgTraffic.Rows) {\r
+                TrafficItem item = r.DataBoundItem as TrafficItem;\r
+                if (item.Selected)\r
+                    r.Cells[0].Value = false;\r
+            }\r
         }\r
 \r
         private void OnDataGridKeyDown(object sender, KeyEventArgs e) {\r
@@ -252,35 +282,6 @@ namespace TrafficClient {
         }\r
     }\r
 \r
-    public class TrafficItem {\r
-        public bool Selected { get; set; }\r
-        public string MediaID { get; set; }\r
-        public bool OK { get; set; }\r
-        public string Title { get; set; }\r
-        public DateTime? NextBroadcastDate { get; set; }\r
-        public DateTime? FirstBroadcastDate { get; set; }\r
-        public short SegmentCount { get; set; }\r
-        public short EpisodeNumber { get; set; }\r
-        public string EpisodeTitle { get; set; }\r
-        public int VariantID { get; set; }\r
-        public string EpisodeID { get; set; }\r
-    }\r
-\r
-    public class TrafficVersion {\r
-        public string MediaID { get; set; }\r
-        public int VariantID { get; set; }\r
-    }\r
-\r
-    public class TrafficItemMetadata {\r
-        public string ProgTitle { get; set; }\r
-        public string ProgDescription { get; set; }\r
-        public string ProgID { get; set; }\r
-        public string EpisodeTitle { get; set; }\r
-        public string EpisodeDescription { get; set; }\r
-        public string EpisodeID { get; set; }\r
-        public bool OK { get; set; }\r
-    }\r
-\r
     public class TrafficAPIMessage : MaestroMessage {\r
         public TrafficAPIMessage(string message) : base(message) {\r
         }\r
index 68cda895e3443e507dda37e7d966f55c7e74ec60..2858a86c2874d60540c0314870fa972229f1ad9e 100644 (file)
@@ -4,7 +4,7 @@ using System.Windows.Forms;
 \r
 namespace TrafficClient {\r
     public partial class TrafficIDSelector {\r
-        DataGridViewColumn[] GetMaterialColumns(TrafficMetadata metadata) {\r
+        DataGridViewColumn[] GetSingleMaterialColumns(TrafficMetadata metadata) {\r
             return new DataGridViewColumn[] {\r
                 new DataGridViewCheckBoxColumn() {\r
                     AutoSizeMode = DataGridViewAutoSizeColumnMode.DisplayedCells,\r
@@ -42,7 +42,7 @@ namespace TrafficClient {
                 },\r
                 new DataGridViewTextBoxColumn() {\r
                     AutoSizeMode = DataGridViewAutoSizeColumnMode.None,\r
-                    DataPropertyName = "FirsBroadcastDate",\r
+                    DataPropertyName = "FirstBroadcastDate",\r
                     HeaderText = metadata.Resource("FIRSTBROADCASTDATE", Resources.FIRSTBROADCASTDATE),\r
                     Width = 100\r
                 },\r
@@ -67,6 +67,70 @@ namespace TrafficClient {
             };\r
         }\r
 \r
+        DataGridViewColumn[] GetMultiMaterialColumns(TrafficMetadata metadata) {\r
+            return new DataGridViewColumn[] {\r
+                new DataGridViewCheckBoxColumn() {\r
+                    AutoSizeMode = DataGridViewAutoSizeColumnMode.DisplayedCells,\r
+                    DataPropertyName = "Selected",\r
+                    Frozen = true\r
+                },\r
+                new DataGridViewTextBoxColumn() {\r
+                    AutoSizeMode = DataGridViewAutoSizeColumnMode.None,\r
+                    DataPropertyName = "MediaID",\r
+                    HeaderText = metadata.Resource("TRAFFICID", Resources.TRAFFICID),\r
+                    Width = 100\r
+                },\r
+                new DataGridViewTextBoxColumn() {\r
+                    AutoSizeMode = DataGridViewAutoSizeColumnMode.None,\r
+                    DataPropertyName = "Segment",\r
+                    HeaderText = metadata.Resource("SEGMENT", Resources.SEGMENT),\r
+                    Width = 100\r
+                },\r
+                new DataGridViewTextBoxColumn() {\r
+                    AutoSizeMode = DataGridViewAutoSizeColumnMode.None,\r
+                    DataPropertyName = "Title",\r
+                    HeaderText = metadata.Resource("TITLE", Resources.TITLE),\r
+                    Width = 100\r
+                },\r
+                new DataGridViewTextBoxColumn() {\r
+                    AutoSizeMode = DataGridViewAutoSizeColumnMode.None,\r
+                    DataPropertyName = "EpisodeTitle",\r
+                    HeaderText = metadata.Resource("EPISODETITLE", Resources.EPISODETITLE),\r
+                    Width = 100\r
+                },\r
+                new DataGridViewCheckBoxColumn() {\r
+                    AutoSizeMode = DataGridViewAutoSizeColumnMode.DisplayedCells,\r
+                    DataPropertyName = "OK",\r
+                    ReadOnly = true\r
+                },\r
+                new DataGridViewTextBoxColumn() {\r
+                    AutoSizeMode = DataGridViewAutoSizeColumnMode.None,\r
+                    DataPropertyName = "EpisodeNumber",\r
+                    HeaderText = metadata.Resource("EPISODENUMBER", Resources.EPISODENUMBER),\r
+                    Width = 100\r
+                },\r
+                new DataGridViewTextBoxColumn() {\r
+                    AutoSizeMode = DataGridViewAutoSizeColumnMode.None,\r
+                    DataPropertyName = "EpisodeID",\r
+                    HeaderText = metadata.Resource("EPISODEID", Resources.EPISODEID),\r
+                    Width = 100\r
+                },\r
+                new DataGridViewTextBoxColumn() {\r
+                    AutoSizeMode = DataGridViewAutoSizeColumnMode.None,\r
+                    DataPropertyName = "FirstBroadcastDate",\r
+                    HeaderText = metadata.Resource("FIRSTBROADCASTDATE", Resources.FIRSTBROADCASTDATE),\r
+                    Width = 100\r
+                },\r
+                new DataGridViewTextBoxColumn() {\r
+                    AutoSizeMode = DataGridViewAutoSizeColumnMode.None,\r
+                    DataPropertyName = "NextBroadcastDate",\r
+                    HeaderText = metadata.Resource("NEXTBROADCASTDATE", Resources.NEXTBROADCASTDATE),\r
+                    Width = 100\r
+                },\r
+            };\r
+        }\r
+\r
+\r
         DataGridViewColumn[] GetADColumns(TrafficMetadata metadata) {\r
             return new DataGridViewColumn[] {\r
                 new DataGridViewCheckBoxColumn() {\r
index 2a05da2444859c10b8b4e0fe59c5573af209b962..8bf9f3ee7154066863cf19e33df0b0033df29df1 100644 (file)
@@ -1,4 +1,5 @@
-using System;\r
+using MaestroShared.Metadata;\r
+using System;\r
 using System.Collections.Generic;\r
 using System.Windows.Forms;\r
 \r
index 4e70aa44e64487063c4b813c833234f1bd271bc1..57e2b4ef94896c0ee0e5bf08096c24b4a5cd9f04 100644 (file)
@@ -5,6 +5,7 @@ using System;
 using System.Collections.Generic;\r
 using System.Data;\r
 using System.Data.SqlClient;\r
+using TrafficClient.Model;\r
 \r
 namespace TrafficClient.Workers {\r
     public class ADWorker : TrafficWorker {\r
@@ -55,7 +56,7 @@ namespace TrafficClient.Workers {
                         while (reader.Read()) {\r
                             if (result == null)\r
                                 result = new List<TrafficItem>();\r
-                            PlanAirADResult item = cliFSPReader.ToclIFsp_MAMAdvertisementResult(reader);\r
+                            PlanAirADResult item = dataReader.ToADResult(reader);\r
                             result.Add(ToTrafficItem(item));\r
                         }\r
                     }\r
@@ -112,7 +113,7 @@ namespace TrafficClient.Workers {
                         while (reader.Read()) {\r
                             if (result == null)\r
                                 result = new List<TrafficItemMetadata>();\r
-                            PlanAirADResult item = cliFSPReader.ToclIFsp_MAMAdvertisementResult(reader);\r
+                            PlanAirADResult item = dataReader.ToADResult(reader);\r
                             result.Add(ToTrafficItemMetadata(item));\r
                         }\r
                     }\r
@@ -170,7 +171,7 @@ namespace TrafficClient.Workers {
                         while (reader.Read()) {\r
                             if (result == null)\r
                                 result = new List<MovieSegment>();\r
-                            PlanAirADResult item = cliFSPReader.ToclIFsp_MAMAdvertisementResult(reader);\r
+                            PlanAirADResult item = dataReader.ToADResult(reader);\r
                             MovieSegment segment = ToSegment(item);\r
                             if (segment.TCOut.Frames != 0)\r
                                 result.Add(segment);\r
index 67f95b34f8efa610881c9703dbef89ce367f83ea..e7646f1c28a06a993d0b7a3f5b259d707314b9e5 100644 (file)
@@ -1,9 +1,33 @@
-using NLog;\r
+using LinkDotNet.MessageHandling.Contracts;\r
+using MaestroShared.Metadata;\r
+using NLog;\r
+using System.Data.SqlClient;\r
+using TrafficClient.Model;\r
 \r
 namespace TrafficClient.Workers {\r
 \r
-    public class MultiSegmentMaterialWorker : TrafficWorker {\r
-\r
+    public class MultiSegmentMaterialWorker : SingleSegmentMaterialWorker {\r
         private static Logger logger = LogManager.GetCurrentClassLogger();\r
+\r
+        public MultiSegmentMaterialWorker(SqlConnection connection, PlanAirDataReader cliFSPReader, string functionName, IMessageBus messageBus)\r
+            : base(connection, cliFSPReader, functionName, messageBus) {\r
+        }\r
+\r
+        protected override int GetMaterialsID {\r
+            get => 6002;\r
+        }\r
+\r
+        protected override TrafficItem CreateTrafficItem(SqlDataReader reader) {\r
+            PlanAirMaterialResult item = dataReader.ToMultiMaterialResult(reader);\r
+            TrafficItem trafficItem = ToTrafficItem(item);\r
+            return trafficItem;\r
+        }\r
+\r
+        protected override int AddMaterialSegmentsID {\r
+            get => 6115;\r
+        }\r
+\r
+\r
     }\r
+\r
 }\r
index 03972a8388f71bcb2c645c9223a9c4cde4413175..6b2a5e8b49552a3145e5245648ac1fa2ec163ab1 100644 (file)
@@ -6,6 +6,7 @@ using System.Collections.Generic;
 using System.Data;\r
 using System.Data.SqlClient;\r
 using System.Diagnostics;\r
+using TrafficClient.Model;\r
 \r
 namespace TrafficClient.Workers {\r
     public class PromoWorker : TrafficWorker {\r
@@ -61,7 +62,7 @@ namespace TrafficClient.Workers {
                         while (reader.Read()) {\r
                             if (result == null)\r
                                 result = new List<TrafficItem>();\r
-                            PlanAirPromoResult item = cliFSPReader.ToclIFsp_MAMPromotionalResult(reader);\r
+                            PlanAirPromoResult item = dataReader.ToPromoResult(reader);\r
                             result.Add(ToTrafficItem(item));\r
                         }\r
                     }\r
@@ -108,7 +109,7 @@ namespace TrafficClient.Workers {
                         while (reader.Read()) {\r
                             if (result == null)\r
                                 result = new List<TrafficItemMetadata>();\r
-                            PlanAirPromoResult item = cliFSPReader.ToclIFsp_MAMPromotionalResult(reader);\r
+                            PlanAirPromoResult item = dataReader.ToPromoResult(reader);\r
                             result.Add(ToTrafficItemMetadata(item));\r
                         }\r
                     }\r
@@ -167,7 +168,7 @@ namespace TrafficClient.Workers {
                             if (result == null)\r
                                 result = new List<MovieSegment>();\r
 \r
-                            PlanAirPromoResult item = cliFSPReader.ToclIFsp_MAMPromotionalResult(reader);\r
+                            PlanAirPromoResult item = dataReader.ToPromoResult(reader);\r
                             MovieSegment segment = ToSegment(item);\r
                             if (segment.TCOut.Frames != 0)\r
                                 result.Add(segment);\r
index 7bc9463fb8f2d6dd5894a1287cd0f04b7a8c8f2a..95953902d0027343d65582533c622880d144b850 100644 (file)
@@ -5,6 +5,7 @@ using System;
 using System.Collections.Generic;\r
 using System.Data;\r
 using System.Data.SqlClient;\r
+using TrafficClient.Model;\r
 \r
 namespace TrafficClient.Workers {\r
 \r
@@ -16,10 +17,8 @@ namespace TrafficClient.Workers {
             : base(connection, cliFSPReader, functionName, messageBus) {\r
         }\r
 \r
-        private TrafficItem ToTrafficItem(clIFsp_EC_MAMBradocastResult data) {\r
-            //Debug.WriteLine(data.v_OkForAir);\r
-\r
-            return new TrafficItem() {\r
+        protected TrafficItem ToTrafficItem(PlanAirMaterialResult data) {\r
+            var result = new TrafficItem() {\r
                 MediaID = data.v_MediaID,\r
                 EpisodeTitle = data.v_EpTitle,\r
                 Title = data.v_ProgTitle,\r
@@ -28,12 +27,23 @@ namespace TrafficClient.Workers {
                 NextBroadcastDate = data.v_NextBroadcastDate,\r
                 FirstBroadcastDate = data.v_FirstBroadcastDate,\r
                 EpisodeID = data.v_EpisodeID,\r
-                SegmentCount = (short)data.v_VariantNrSegments,\r
-                OK = data.v_OkForAir != null && true.Equals(data.v_OkForAir)\r
+                OK = data.v_OkForAir != null && true.Equals(data.v_OkForAir),\r
+                SegmentCount = data.v_VariantNrSegments,\r
+                SegmentNr = data.v_SegNr,\r
+                SegmentId = data.v_SegID\r
             };\r
+            if (data.v_SegID != null && data.v_SegTcOut > 0) {\r
+                result.MovieSegment = new MovieSegment {\r
+                    TCIn = new Timecode((int)data.v_SegTcIn),\r
+                    TCOut = new Timecode((int)data.v_SegTcOut),\r
+                    Comment = data.v_SegTitle,\r
+                    Optional = true.Equals(data.v_SegDropable)\r
+                };\r
+            }\r
+            return result;\r
         }\r
 \r
-        private TrafficItemMetadata ToTrafficItemMetadata(clIFsp_EC_MAMBradocastResult data) {\r
+        private TrafficItemMetadata ToTrafficItemMetadata(PlanAirMaterialResult data) {\r
             return new TrafficItemMetadata() {\r
                 EpisodeID = data.v_EpisodeID,\r
                 EpisodeTitle = data.v_EpTitle,\r
@@ -71,8 +81,8 @@ namespace TrafficClient.Workers {
                         while (reader.Read()) {\r
                             if (result == null)\r
                                 result = new List<TrafficItem>();\r
-                            clIFsp_EC_MAMBradocastResult item = cliFSPReader.ToclIFsp_MAMBroadcastResult(reader);\r
-                            result.Add(ToTrafficItem(item));\r
+                            TrafficItem trafficItem = CreateTrafficItem(reader);\r
+                            result.Add(trafficItem);\r
                         }\r
                     }\r
                 }\r
@@ -84,6 +94,11 @@ namespace TrafficClient.Workers {
             return result;\r
         }\r
 \r
+        protected virtual TrafficItem CreateTrafficItem(SqlDataReader reader) {\r
+            PlanAirMaterialResult item = dataReader.ToSingleMaterialResult(reader);\r
+            TrafficItem trafficItem = ToTrafficItem(item);\r
+            return trafficItem;\r
+        }\r
 \r
         public List<TrafficItemMetadata> GetMaterialArchiveMetadata(string strParam) {\r
             List<TrafficItemMetadata> result = null;\r
@@ -91,7 +106,7 @@ namespace TrafficClient.Workers {
                 TryConnect();\r
                 using (SqlCommand cmd = CreateCommmad()) {\r
                     cmd.CommandType = CommandType.StoredProcedure;\r
-                    cmd.Parameters.AddWithValue("@Operation", GetMaterialsID);\r
+                    cmd.Parameters.AddWithValue("@Operation", 1002);\r
                     cmd.Parameters.AddWithValue("@@@Options", 0);\r
                     cmd.Parameters.AddWithValue("@@ItemID", DBNull.Value);\r
                     cmd.Parameters.AddWithValue("@@StrParam1", strParam);\r
@@ -100,7 +115,7 @@ namespace TrafficClient.Workers {
                         while (reader.Read()) {\r
                             if (result == null)\r
                                 result = new List<TrafficItemMetadata>();\r
-                            clIFsp_EC_MAMBradocastResult item = cliFSPReader.ToclIFsp_MAMBroadcastResult(reader);\r
+                            PlanAirMaterialResult item = dataReader.ToSingleMaterialResult(reader);\r
                             result.Add(ToTrafficItemMetadata(item));\r
                         }\r
                     }\r
@@ -153,16 +168,45 @@ namespace TrafficClient.Workers {
             get => 1100;\r
         }\r
 \r
-        public void SetMaterialOK(int itemID, bool ok) {\r
+        public void SetMaterialOK(int itemID, bool ok, bool ifCompleted = false) {\r
             try {\r
+                if (ifCompleted) {\r
+                    logger.Info("Checking if material {0} can be approved", itemID);\r
+                    List<TrafficItem> items = GetMaterials(itemID.ToString(), false, null, null);\r
+                    if (items == null || items.Count == 0) {\r
+                        logger.Info("Material {0} not exists", itemID);\r
+                        return;\r
+                    }\r
+                    var allCount = items[0].SegmentCount;\r
+                    if (allCount == 0) {\r
+                        logger.Info("Material {0} has no segments", itemID);\r
+                    }\r
+\r
+                    List<MovieSegment> segments = GetMaterialSegments(itemID);\r
+                    if (allCount != segments.Count) {\r
+                        logger.Info("Material {0} needs more segments", itemID);\r
+                    }\r
+\r
+                    if (segments == null || segments.Count == 0) {\r
+                        logger.Info("Material {0} not exists", itemID);\r
+                    }\r
+                    foreach (MovieSegment segment in segments) {\r
+                        if (segment.TCOut.Frames == 0) {\r
+                            logger.Info("Material {0} has untouched segment", itemID);\r
+                            return;\r
+                        }\r
+                    }\r
+\r
+                    logger.Info("Approving material {0}", itemID);\r
+                }\r
+\r
                 TryConnect();\r
-                int options = ok ? 1 : 0;\r
                 using (SqlCommand cmd = CreateCommmad()) {\r
                     cmd.CommandType = CommandType.StoredProcedure;\r
                     cmd.Parameters.AddWithValue("@Operation", SetMaterialOKID);\r
                     cmd.Parameters.AddWithValue("@@ItemID", itemID);\r
                     cmd.Parameters.AddWithValue("@@@Options", DBNull.Value);\r
-                    cmd.Parameters.AddWithValue("@@IntParam1", options);\r
+                    cmd.Parameters.AddWithValue("@@IntParam1", ok ? 1 : 0);\r
                     cmd.ExecuteNonQuery();\r
                 }\r
             } catch (Exception e) {\r
@@ -181,24 +225,20 @@ namespace TrafficClient.Workers {
             };\r
         }\r
 \r
-        protected virtual int GetMaterialSegmentsID {\r
-            get => 1010;\r
-        }\r
-\r
         public List<MovieSegment> GetMaterialSegments(int itemID) {\r
             List<MovieSegment> result = null;\r
             try {\r
                 TryConnect();\r
                 using (SqlCommand cmd = CreateCommmad()) {\r
                     cmd.CommandType = CommandType.StoredProcedure;\r
-                    cmd.Parameters.AddWithValue("@Operation", GetMaterialSegmentsID);\r
+                    cmd.Parameters.AddWithValue("@Operation", 1010);\r
                     cmd.Parameters.AddWithValue("@@@Options", DBNull.Value);\r
                     cmd.Parameters.AddWithValue("@@ItemID", itemID);\r
                     using (SqlDataReader reader = cmd.ExecuteReader()) {\r
                         while (reader.Read()) {\r
                             if (result == null)\r
                                 result = new List<MovieSegment>();\r
-                            PlanAirMaterialSegmentResult item = cliFSPReader.ToclIFsp_SegmentResult(reader);\r
+                            PlanAirMaterialSegmentResult item = dataReader.ToMaterialSegmentResult(reader);\r
                             result.Add(ToSegment(item));\r
                         }\r
                     }\r
@@ -248,21 +288,28 @@ namespace TrafficClient.Workers {
             }\r
         }\r
 \r
-        public void AddMaterialSegment(int itemID, MovieSegment segment) {\r
-            object comment = segment.Comment;\r
-            if (String.IsNullOrEmpty(segment.Comment))\r
-                comment = DBNull.Value;\r
+        protected virtual int AddMaterialSegmentsID {\r
+            get => 1115;\r
+        }\r
+\r
+        public string AddMaterialSegment(int itemID, MovieSegment segment, string fileName = null, int segNr = 0) {\r
             try {\r
                 TryConnect();\r
                 using (SqlCommand cmd = CreateCommmad()) {\r
                     int optionalParam = segment.Optional ? 1 : 0;\r
                     cmd.CommandType = CommandType.StoredProcedure;\r
-                    cmd.Parameters.AddWithValue("@Operation", 1115);\r
+                    cmd.Parameters.AddWithValue("@Operation", AddMaterialSegmentsID);\r
                     cmd.Parameters.AddWithValue("@@ItemID", itemID);\r
                     cmd.Parameters.AddWithValue("@@IntParam1", segment.TCIn.Frames);\r
                     cmd.Parameters.AddWithValue("@@IntParam2", segment.TCOut.Frames);\r
-                    cmd.Parameters.AddWithValue("@@StrParam1", comment);\r
+                    cmd.Parameters.AddWithValue("@@IntParam3", segNr);\r
+                    if (segment.Comment == null)\r
+                        cmd.Parameters.AddWithValue("@@StrParam1", DBNull.Value);\r
+                    else\r
+                        cmd.Parameters.AddWithValue("@@StrParam1", segment.Comment);\r
                     cmd.Parameters.AddWithValue("@@StrParam2", DBNull.Value);\r
+                    if (fileName != null)\r
+                        cmd.Parameters.AddWithValue("@@StrParam3", fileName);\r
                     cmd.Parameters.AddWithValue("@@@Options", optionalParam);\r
                     cmd.ExecuteNonQuery();\r
                 }\r
@@ -271,6 +318,7 @@ namespace TrafficClient.Workers {
             } finally {\r
                 connection.Close();\r
             }\r
+            return null;\r
         }\r
 \r
     }\r
index 508a73674df1ede81763d18a4c33d4af49b5cead..e96e6acdad1037a214e945fc87b4b650c364ad96 100644 (file)
@@ -8,13 +8,13 @@ namespace TrafficClient.Workers {
     public class TrafficWorker {\r
 \r
         protected IMessageBus messageBus;\r
-        protected PlanAirDataReader cliFSPReader;\r
+        protected PlanAirDataReader dataReader;\r
         private readonly string functionName;\r
         protected SqlConnection connection;\r
 \r
-        public TrafficWorker(SqlConnection connection, PlanAirDataReader cliFSPReader, string functionName, IMessageBus messageBus) {\r
+        public TrafficWorker(SqlConnection connection, PlanAirDataReader dataReader, string functionName, IMessageBus messageBus) {\r
             this.connection = connection;\r
-            this.cliFSPReader = cliFSPReader;\r
+            this.dataReader = dataReader;\r
             this.functionName = functionName;\r
             this.messageBus = messageBus;\r
         }\r
diff --git a/client/PlanAIRClient/clIFsp_EC_MAMBradocastResult.cs b/client/PlanAIRClient/clIFsp_EC_MAMBradocastResult.cs
deleted file mode 100644 (file)
index 6a49b0d..0000000
+++ /dev/null
@@ -1,259 +0,0 @@
-namespace TrafficClient {\r
-    public partial class clIFsp_EC_MAMBradocastResult {\r
-\r
-        private int _v_ProgrammeID;\r
-\r
-        private bool _v_Live;\r
-\r
-        private string _v_EpisodeID;\r
-\r
-        private System.Nullable<int> _v_VariantID;\r
-\r
-        private System.Nullable<int> _v_VariantTypeID;\r
-\r
-        private string _v_ProgTitle;\r
-\r
-        private string _v_EpTitle;\r
-\r
-        private System.Nullable<short> _v_Episode;\r
-\r
-        private string _v_VariantType;\r
-\r
-        private string _v_VariantKeywords;\r
-\r
-        private string _v_VariantLengthTC;\r
-\r
-        private System.Nullable<int> _v_VariantLengthFrame;\r
-\r
-        private System.Nullable<int> _v_VariantNrSegments;\r
-\r
-        private System.Nullable<System.DateTime> _v_FirstBroadcastDate;\r
-\r
-        private System.Nullable<System.DateTime> _v_NextBroadcastDate;\r
-\r
-        private System.Nullable<bool> _v_OkForAir;\r
-\r
-        private System.Nullable<bool> _v_ForTransm;\r
-\r
-        private string _v_MediaID;\r
-\r
-        public clIFsp_EC_MAMBradocastResult() {\r
-        }\r
-\r
-        [global::System.Data.Linq.Mapping.ColumnAttribute(Storage = "_v_ProgrammeID", DbType = "Int NOT NULL")]\r
-        public int v_ProgrammeID {\r
-            get {\r
-                return this._v_ProgrammeID;\r
-            }\r
-            set {\r
-                if ((this._v_ProgrammeID != value)) {\r
-                    this._v_ProgrammeID = value;\r
-                }\r
-            }\r
-        }\r
-\r
-        [global::System.Data.Linq.Mapping.ColumnAttribute(Storage = "_v_Live", DbType = "Bit NOT NULL")]\r
-        public bool v_Live {\r
-            get {\r
-                return this._v_Live;\r
-            }\r
-            set {\r
-                if ((this._v_Live != value)) {\r
-                    this._v_Live = value;\r
-                }\r
-            }\r
-        }\r
-\r
-        [global::System.Data.Linq.Mapping.ColumnAttribute(Storage = "_v_EpisodeID", DbType = "VarChar(6) NOT NULL", CanBeNull = false)]\r
-        public string v_EpisodeID {\r
-            get {\r
-                return this._v_EpisodeID;\r
-            }\r
-            set {\r
-                if ((this._v_EpisodeID != value)) {\r
-                    this._v_EpisodeID = value;\r
-                }\r
-            }\r
-        }\r
-\r
-        [global::System.Data.Linq.Mapping.ColumnAttribute(Storage = "_v_VariantID", DbType = "Int")]\r
-        public System.Nullable<int> v_VariantID {\r
-            get {\r
-                return this._v_VariantID;\r
-            }\r
-            set {\r
-                if ((this._v_VariantID != value)) {\r
-                    this._v_VariantID = value;\r
-                }\r
-            }\r
-        }\r
-\r
-        [global::System.Data.Linq.Mapping.ColumnAttribute(Storage = "_v_VariantTypeID", DbType = "Int")]\r
-        public System.Nullable<int> v_VariantTypeID {\r
-            get {\r
-                return this._v_VariantTypeID;\r
-            }\r
-            set {\r
-                if ((this._v_VariantTypeID != value)) {\r
-                    this._v_VariantTypeID = value;\r
-                }\r
-            }\r
-        }\r
-\r
-        [global::System.Data.Linq.Mapping.ColumnAttribute(Storage = "_v_ProgTitle", DbType = "NVarChar(60)")]\r
-        public string v_ProgTitle {\r
-            get {\r
-                return this._v_ProgTitle;\r
-            }\r
-            set {\r
-                if ((this._v_ProgTitle != value)) {\r
-                    this._v_ProgTitle = value;\r
-                }\r
-            }\r
-        }\r
-\r
-        [global::System.Data.Linq.Mapping.ColumnAttribute(Storage = "_v_EpTitle", DbType = "NVarChar(60)")]\r
-        public string v_EpTitle {\r
-            get {\r
-                return this._v_EpTitle;\r
-            }\r
-            set {\r
-                if ((this._v_EpTitle != value)) {\r
-                    this._v_EpTitle = value;\r
-                }\r
-            }\r
-        }\r
-\r
-        [global::System.Data.Linq.Mapping.ColumnAttribute(Storage = "_v_Episode", DbType = "SmallInt")]\r
-        public System.Nullable<short> v_Episode {\r
-            get {\r
-                return this._v_Episode;\r
-            }\r
-            set {\r
-                if ((this._v_Episode != value)) {\r
-                    this._v_Episode = value;\r
-                }\r
-            }\r
-        }\r
-\r
-        [global::System.Data.Linq.Mapping.ColumnAttribute(Storage = "_v_VariantType", DbType = "VarChar(40)")]\r
-        public string v_VariantType {\r
-            get {\r
-                return this._v_VariantType;\r
-            }\r
-            set {\r
-                if ((this._v_VariantType != value)) {\r
-                    this._v_VariantType = value;\r
-                }\r
-            }\r
-        }\r
-\r
-        [global::System.Data.Linq.Mapping.ColumnAttribute(Storage = "_v_VariantKeywords", DbType = "VarChar(25)")]\r
-        public string v_VariantKeywords {\r
-            get {\r
-                return this._v_VariantKeywords;\r
-            }\r
-            set {\r
-                if ((this._v_VariantKeywords != value)) {\r
-                    this._v_VariantKeywords = value;\r
-                }\r
-            }\r
-        }\r
-\r
-        [global::System.Data.Linq.Mapping.ColumnAttribute(Storage = "_v_VariantLengthTC", DbType = "VarChar(150)")]\r
-        public string v_VariantLengthTC {\r
-            get {\r
-                return this._v_VariantLengthTC;\r
-            }\r
-            set {\r
-                if ((this._v_VariantLengthTC != value)) {\r
-                    this._v_VariantLengthTC = value;\r
-                }\r
-            }\r
-        }\r
-\r
-        [global::System.Data.Linq.Mapping.ColumnAttribute(Storage = "_v_VariantLengthFrame", DbType = "Int")]\r
-        public System.Nullable<int> v_VariantLengthFrame {\r
-            get {\r
-                return this._v_VariantLengthFrame;\r
-            }\r
-            set {\r
-                if ((this._v_VariantLengthFrame != value)) {\r
-                    this._v_VariantLengthFrame = value;\r
-                }\r
-            }\r
-        }\r
-\r
-        [global::System.Data.Linq.Mapping.ColumnAttribute(Storage = "_v_VariantNrSegments", DbType = "Int")]\r
-        public System.Nullable<int> v_VariantNrSegments {\r
-            get {\r
-                return this._v_VariantNrSegments;\r
-            }\r
-            set {\r
-                if ((this._v_VariantNrSegments != value)) {\r
-                    this._v_VariantNrSegments = value;\r
-                }\r
-            }\r
-        }\r
-\r
-        [global::System.Data.Linq.Mapping.ColumnAttribute(Storage = "_v_FirstBroadcastDate", DbType = "DateTime")]\r
-        public System.Nullable<System.DateTime> v_FirstBroadcastDate {\r
-            get {\r
-                return this._v_FirstBroadcastDate;\r
-            }\r
-            set {\r
-                if ((this._v_FirstBroadcastDate != value)) {\r
-                    this._v_FirstBroadcastDate = value;\r
-                }\r
-            }\r
-        }\r
-\r
-        [global::System.Data.Linq.Mapping.ColumnAttribute(Storage = "_v_NextBroadcastDate", DbType = "DateTime")]\r
-        public System.Nullable<System.DateTime> v_NextBroadcastDate {\r
-            get {\r
-                return this._v_NextBroadcastDate;\r
-            }\r
-            set {\r
-                if ((this._v_NextBroadcastDate != value)) {\r
-                    this._v_NextBroadcastDate = value;\r
-                }\r
-            }\r
-        }\r
-\r
-        [global::System.Data.Linq.Mapping.ColumnAttribute(Storage = "_v_OkForAir", DbType = "Bit")]\r
-        public System.Nullable<bool> v_OkForAir {\r
-            get {\r
-                return this._v_OkForAir;\r
-            }\r
-            set {\r
-                if ((this._v_OkForAir != value)) {\r
-                    this._v_OkForAir = value;\r
-                }\r
-            }\r
-        }\r
-\r
-        [global::System.Data.Linq.Mapping.ColumnAttribute(Storage = "_v_ForTransm", DbType = "Bit")]\r
-        public System.Nullable<bool> v_ForTransm {\r
-            get {\r
-                return this._v_ForTransm;\r
-            }\r
-            set {\r
-                if ((this._v_ForTransm != value)) {\r
-                    this._v_ForTransm = value;\r
-                }\r
-            }\r
-        }\r
-\r
-        [global::System.Data.Linq.Mapping.ColumnAttribute(Storage = "_v_MediaID", DbType = "VarChar(6) NOT NULL", CanBeNull = false)]\r
-        public string v_MediaID {\r
-            get {\r
-                return this._v_MediaID;\r
-            }\r
-            set {\r
-                if ((this._v_MediaID != value)) {\r
-                    this._v_MediaID = value;\r
-                }\r
-            }\r
-        }\r
-    }\r
-}\r
index 6c4ff157e608fb75d8b0e58c8431dfbe231c05bc..ceb004d3bdc63c93b4656c04e59c0181725378e2 100644 (file)
                                                <id>default-cli</id>\r
                                                <configuration>\r
                                                        <artifacts>\r
+<!--                                                           <artifact> -->\r
+<!--                                                                   <id>org.apache.solr:solr-solrj:7.5.0</id> -->\r
+<!--                                                           </artifact> -->\r
                                                                <artifact>\r
                                                                        <id>humble.video:linux:0.2.1</id>\r
                                                                </artifact>\r
index bb610fc8a29fb421eb255482b0808ee557063e0a..7c7ca260a621057735a2385b51ac2ab8dca51746 100644 (file)
@@ -8,6 +8,9 @@ import java.nio.file.Files;
 import java.nio.file.attribute.BasicFileAttributes;\r
 import java.sql.Timestamp;\r
 \r
+import org.jboss.resteasy.client.jaxrs.ResteasyClient;\r
+import org.jboss.resteasy.client.jaxrs.ResteasyClientBuilder;\r
+import org.jboss.resteasy.client.jaxrs.ResteasyWebTarget;\r
 import org.junit.AfterClass;\r
 import org.junit.BeforeClass;\r
 import org.junit.Test;\r
@@ -58,6 +61,23 @@ public class Support {
                assertTrue(actual.length() > 0);\r
        }\r
 \r
+       @Test\r
+       public void test_Solr() throws Exception {\r
+               //http://lucene.apache.org/solr/guide/7_5/using-solrj.html#using-solrj\r
+               ResteasyClient client = new ResteasyClientBuilder().build();\r
+               ResteasyWebTarget webTarget = client.target("");\r
+\r
+               String query = "SELECT * FROM MEDIADESCRIPTION FETCH FIRST ROW ONLY";\r
+               manager.executeQuery(query, rs -> {\r
+                       rs.getLong("itemid");\r
+                       rs.getLong("mediaid");\r
+                       rs.getLong("mediafileid");\r
+                       rs.getString("description");\r
+                       return true;\r
+               }, null);\r
+\r
+       }\r
+\r
        @Test\r
        public void test1() throws Exception {\r
                File sourceFile = new File("c:\\thumbnail - generali\\ShellExtractLoadTest.exe");\r
index d5408eb5dfa599989b6fd4adad1725384e18992f..d9b583118fb8c104b1c169274447f2f6c6d4955d 100644 (file)
@@ -592,4 +592,5 @@ public class Support {
                String idToCheck = houseid.substring(0, houseid.lastIndexOf("-"));\r
                System.out.println(idToCheck);\r
        }\r
+\r
 }\r