Commit 98a4c9c10bcd92c3c23a736e00aa77bc84c4d057
1 parent
aa2e3807
v1.16.0.0
-WebApplicationManager SendUrl adatbeviteli folyamat finomítása - FileCleanerManager DSREGEX,TSREGEX,DTSREGEX változók megvalósítása
Showing
5 changed files
with
29 additions
and
8 deletions
Show diff stats
Vrh.Log4Pro.MaintenanceConsole/Manager - FileCleanerManager.cs
... | ... | @@ -131,6 +131,11 @@ namespace Vrh.Log4Pro.MaintenanceConsole.FileCleanerManagerNS |
131 | 131 | ColorConsole.WriteLine(ws.Xml_IncludeMask, ConsoleColor.Yellow, prefix: ", Include mask:"); |
132 | 132 | return " "; |
133 | 133 | } |
134 | + else if (lineix == 3) | |
135 | + { | |
136 | + ColorConsole.WriteLine(ws.Xml_IncludeFullpathRegexp, ConsoleColor.Yellow, prefix: "Path regex:"); | |
137 | + return " "; | |
138 | + } | |
134 | 139 | else // if (lineix == INDEXBASE) |
135 | 140 | { |
136 | 141 | const int INDEXBASE = 3; // a linex következő indexe kerüljön ide !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
... | ... | @@ -329,10 +334,14 @@ namespace Vrh.Log4Pro.MaintenanceConsole.FileCleanerManagerNS |
329 | 334 | : (int?)null; // ha hibás a megadott érték, akkor olyan, mintha nem is lenne megadva |
330 | 335 | |
331 | 336 | string commontimestampconstructor = GetValue(nameof(FolderToClean.XmlStructure.CommonAttributes.Attributes.TimestampConstructor), commonattributeselement, (string)null); |
337 | + string commontimestampregex = GetValue(nameof(FolderToClean.XmlStructure.CommonAttributes.Attributes.TSRegex), commonattributeselement, FolderToClean.XmlStructure.CommonAttributes.Attributes.TSRegex.Values.DEFAULT); | |
338 | + string commondatetimestampregex = GetValue(nameof(FolderToClean.XmlStructure.CommonAttributes.Attributes.DTSRegex), commonattributeselement, FolderToClean.XmlStructure.CommonAttributes.Attributes.DTSRegex.Values.DEFAULT); | |
339 | + string commondatestampregex = GetValue(nameof(FolderToClean.XmlStructure.CommonAttributes.Attributes.DSRegex), commonattributeselement, FolderToClean.XmlStructure.CommonAttributes.Attributes.DSRegex.Values.DEFAULT); | |
340 | + | |
332 | 341 | var ftcxmllist = GetAllXElements(nameof(FolderToClean.XmlStructure.FolderToClean)); |
333 | 342 | if (ftcxmllist != null && ftcxmllist.Any()) |
334 | 343 | { |
335 | - foreach (var ftcxml in ftcxmllist) { var ws = new FolderToClean(ftcxml, commonlimitdays, commonlimitbytes,commontimestampconstructor); if (ws.Valid) { _foldertocleanlist.Add(ws); } } | |
344 | + foreach (var ftcxml in ftcxmllist) { var ws = new FolderToClean(ftcxml, commonlimitdays, commonlimitbytes,commontimestampconstructor, commondatestampregex,commontimestampregex, commondatetimestampregex); if (ws.Valid) { _foldertocleanlist.Add(ws); } } | |
336 | 345 | } |
337 | 346 | } |
338 | 347 | #endregion constructor |
... | ... | @@ -372,11 +381,11 @@ namespace Vrh.Log4Pro.MaintenanceConsole.FileCleanerManagerNS |
372 | 381 | public FolderToClean() { } |
373 | 382 | #endregion basic constructor |
374 | 383 | #region xml constructor |
375 | - public FolderToClean(XElement foldertocleanxml,int? commonlimitdays,int? commonlimitbytes,string commontimestampconstructor) | |
384 | + public FolderToClean(XElement foldertocleanxml,int? commonlimitdays,int? commonlimitbytes,string commontimestampconstructor,string commondatestampregex, string commontimestampregex, string commondatetimestampregex) | |
376 | 385 | { |
377 | 386 | common_limitdays = commonlimitdays; |
378 | 387 | common_limitbytes = commonlimitbytes; |
379 | - common_timestampconstructor = commontimestampconstructor; | |
388 | + common_timestampconstructor = commontimestampconstructor; | |
380 | 389 | Valid = true; |
381 | 390 | string ATTRIBUTEMANDATORY = nameof(XmlStructure.FolderToClean) + " attribute is mandatory! Name: {0}"; |
382 | 391 | Xml_Key = GetValue(nameof(XmlStructure.FolderToClean.Attributes.Key), foldertocleanxml, XmlStructure.FolderToClean.Attributes.Key.Values.DEFAULT); |
... | ... | @@ -386,6 +395,8 @@ namespace Vrh.Log4Pro.MaintenanceConsole.FileCleanerManagerNS |
386 | 395 | Xml_RemoveEmptyFolder = GetValue(nameof(XmlStructure.FolderToClean.Attributes.RemoveEmptyFolder), foldertocleanxml, XmlStructure.FolderToClean.Attributes.RemoveEmptyFolder.Values.DEFAULT); |
387 | 396 | Xml_IncludeMask = GetValue(nameof(XmlStructure.FolderToClean.Attributes.IncludeMask), foldertocleanxml, XmlStructure.FolderToClean.Attributes.IncludeMask.Values.DEFAULT); |
388 | 397 | Xml_IncludeFullpathRegexp = GetValue(GetXElement(foldertocleanxml,nameof(XmlStructure.FolderToClean.IncludeFullpathRegexp)), XmlStructure.FolderToClean.IncludeFullpathRegexp.Values.DEFAULT); |
398 | + Xml_IncludeFullpathRegexp = Xml_IncludeFullpathRegexp.Replace("{DTSREGEX}", commondatetimestampregex).Replace("{TSREGEX}", commontimestampregex).Replace("{DSREGEX}", commondatestampregex); | |
399 | + | |
389 | 400 | Xml_ConditionList = new List<Condition>(); |
390 | 401 | //var conditionxmlList = GetAllXElements(foldertocleanxml, nameof(XmlStructure.FolderToClean.Conditions), nameof(XmlStructure.FolderToClean.Conditions.Condition)); |
391 | 402 | var conditionsxml = foldertocleanxml.Element(XName.Get(nameof(XmlStructure.FolderToClean.Conditions))); |
... | ... | @@ -454,6 +465,9 @@ namespace Vrh.Log4Pro.MaintenanceConsole.FileCleanerManagerNS |
454 | 465 | public static class LimitDays { public static class Values { public const int DEFAULT = 7; } } |
455 | 466 | public static class LimitBytes { public static class Values { public const int DEFAULT = 500000; } } |
456 | 467 | public static class TimestampConstructor { public static class Values { public const string DEFAULT = "{YEAR}.{MONTH}.{DAY} {HOUR}:{MINUTE}:{SECOND}"; } } |
468 | + public static class DTSRegex { public static class Values { public const string DEFAULT = @"(?'YEAR'\d\d\d\d)(?'MONTH'\d\d)(?'DAY'\d\d)_(?'HOUR'\d\d)(?'MINUTE'\d\d)(?'SECOND'\d\d)"; } } | |
469 | + public static class DSRegex { public static class Values { public const string DEFAULT = @"(?'YEAR'\d\d\d\d)(?'MONTH'\d\d)(?'DAY'\d\d)"; } } | |
470 | + public static class TSRegex { public static class Values { public const string DEFAULT = @"(?'HOUR'\d\d)(?'MINUTE'\d\d)(?'SECOND'\d\d)"; } } | |
457 | 471 | } |
458 | 472 | } |
459 | 473 | public static class FolderToClean | ... | ... |
Vrh.Log4Pro.MaintenanceConsole/Manager - WebApplicationManager.cs
... | ... | @@ -98,6 +98,8 @@ namespace Vrh.Log4Pro.MaintenanceConsole.WebApplicationManagerNS |
98 | 98 | else if (sr.Result == Menu.SelectionResult.Ok) { } |
99 | 99 | else { } |
100 | 100 | |
101 | + getsendurlnameurlinputcycle: | |
102 | + | |
101 | 103 | WebApplication selectedwebapplication = (sr.SelectedParameterList.First()).Parameters as WebApplication; |
102 | 104 | var therearepredefinedurls = selectedwebapplication.Xml_SendUrlList != null && selectedwebapplication.Xml_SendUrlList.Any(); |
103 | 105 | string urlname; |
... | ... | @@ -116,6 +118,8 @@ namespace Vrh.Log4Pro.MaintenanceConsole.WebApplicationManagerNS |
116 | 118 | } |
117 | 119 | else { urlname = "*"; } |
118 | 120 | if (urlname.ToLower() == "ex") return o; |
121 | + if (string.IsNullOrWhiteSpace(urlname)) goto getsendurlnameurlinputcycle; | |
122 | + | |
119 | 123 | string urltext; |
120 | 124 | HttpTools.RequestType gp; |
121 | 125 | List<Vrh.XmlProcessing.UrlElement.UrlParameter> uplist=null; |
... | ... | @@ -127,10 +131,12 @@ namespace Vrh.Log4Pro.MaintenanceConsole.WebApplicationManagerNS |
127 | 131 | urltext = ColorConsole.ReadLine(); |
128 | 132 | if (urltext.ToLower() == "ex") return o; |
129 | 133 | if (urltext.ToLower() == "sample") urltext = TESTURL; |
134 | + if (string.IsNullOrWhiteSpace(urltext)) goto getsendurlnameurlinputcycle; | |
130 | 135 | ColorConsole.WriteLine("Enter request type (GET/POST):", ConsoleColor.Yellow); |
131 | 136 | string gpstr = ColorConsole.ReadLine(); |
132 | 137 | gp = HttpTools.RequestType.GET; |
133 | 138 | if (gpstr.ToLower() == "ex") return o; |
139 | + if (string.IsNullOrWhiteSpace(gpstr)) goto getsendurlnameurlinputcycle; | |
134 | 140 | else if (gpstr.ToUpper() == nameof(HttpTools.RequestType.GET)) { gp = HttpTools.RequestType.GET; } |
135 | 141 | else if (gpstr.ToUpper() == nameof(HttpTools.RequestType.POST)) { gp = HttpTools.RequestType.POST; } |
136 | 142 | |
... | ... | @@ -1309,6 +1315,7 @@ namespace Vrh.Log4Pro.MaintenanceConsole.WebApplicationManagerNS |
1309 | 1315 | { |
1310 | 1316 | Name = GetValue(nameof(XmlStructure.WebApplication.SendUrl.Attributes.Name), sendurlxmlelement, ""); |
1311 | 1317 | ForcePOST = GetValue(nameof(XmlStructure.WebApplication.SendUrl.Attributes.ForcePost), sendurlxmlelement, XmlStructure.WebApplication.SendUrl.Attributes.ForcePost.Values.DEFAULT); |
1318 | + Vrh.XmlProcessing.UrlElement xxxx = new Vrh.XmlProcessing.UrlElement(sendurlxmlelement); | |
1312 | 1319 | UrlElement = new Vrh.XmlProcessing.UrlElement(); |
1313 | 1320 | UrlElement.Url = GetValue(sendurlxmlelement, ""); |
1314 | 1321 | UrlElement.Protocol = GetValue(nameof(XmlStructure.WebApplication.SendUrl.Attributes.protocol), sendurlxmlelement, ""); | ... | ... |
Vrh.Log4Pro.MaintenanceConsole/Properties/AssemblyInfo.cs
... | ... | @@ -32,5 +32,5 @@ using System.Runtime.InteropServices; |
32 | 32 | // You can specify all the values or you can default the Build and Revision Numbers |
33 | 33 | // by using the '*' as shown below: |
34 | 34 | // [assembly: AssemblyVersion("1.0.*")] |
35 | -[assembly: AssemblyVersion("1.15.0.0")] | |
36 | -[assembly: AssemblyFileVersion("1.15.0.0")] | |
35 | +[assembly: AssemblyVersion("1.16.0.0")] | |
36 | +[assembly: AssemblyFileVersion("1.16.0.0")] | ... | ... |
Vrh.Log4Pro.MaintenanceConsole/Vrh.Log4Pro.MaintenanceConsole.csproj
... | ... | @@ -353,8 +353,8 @@ |
353 | 353 | <Reference Include="Vrh.Web.Providers, Version=2.0.2.0, Culture=neutral, processorArchitecture=MSIL"> |
354 | 354 | <HintPath>..\packages\VRH.Web.Providers.2.0.2\lib\net452\Vrh.Web.Providers.dll</HintPath> |
355 | 355 | </Reference> |
356 | - <Reference Include="Vrh.XmlProcessing, Version=1.30.1.0, Culture=neutral, processorArchitecture=MSIL"> | |
357 | - <HintPath>..\packages\Vrh.XmlProcessing.1.30.1\lib\net45\Vrh.XmlProcessing.dll</HintPath> | |
356 | + <Reference Include="Vrh.XmlProcessing, Version=1.30.2.0, Culture=neutral, processorArchitecture=MSIL"> | |
357 | + <HintPath>..\packages\Vrh.XmlProcessing.1.30.2\lib\net45\Vrh.XmlProcessing.dll</HintPath> | |
358 | 358 | </Reference> |
359 | 359 | <Reference Include="WindowsBase" /> |
360 | 360 | </ItemGroup> | ... | ... |
Vrh.Log4Pro.MaintenanceConsole/packages.config
... | ... | @@ -75,5 +75,5 @@ |
75 | 75 | <package id="System.Xml.XDocument" version="4.0.11" targetFramework="net472" /> |
76 | 76 | <package id="VRH.Common" version="2.23.1" targetFramework="net472" /> |
77 | 77 | <package id="VRH.Web.Providers" version="2.0.2" targetFramework="net472" /> |
78 | - <package id="Vrh.XmlProcessing" version="1.30.1" targetFramework="net472" /> | |
78 | + <package id="Vrh.XmlProcessing" version="1.30.2" targetFramework="net472" /> | |
79 | 79 | </packages> |
80 | 80 | \ No newline at end of file | ... | ... |