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,6 +131,11 @@ namespace Vrh.Log4Pro.MaintenanceConsole.FileCleanerManagerNS | ||
131 | ColorConsole.WriteLine(ws.Xml_IncludeMask, ConsoleColor.Yellow, prefix: ", Include mask:"); | 131 | ColorConsole.WriteLine(ws.Xml_IncludeMask, ConsoleColor.Yellow, prefix: ", Include mask:"); |
132 | return " "; | 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 | else // if (lineix == INDEXBASE) | 139 | else // if (lineix == INDEXBASE) |
135 | { | 140 | { |
136 | const int INDEXBASE = 3; // a linex következő indexe kerüljön ide !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | 141 | const int INDEXBASE = 3; // a linex következő indexe kerüljön ide !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
@@ -329,10 +334,14 @@ namespace Vrh.Log4Pro.MaintenanceConsole.FileCleanerManagerNS | @@ -329,10 +334,14 @@ namespace Vrh.Log4Pro.MaintenanceConsole.FileCleanerManagerNS | ||
329 | : (int?)null; // ha hibás a megadott érték, akkor olyan, mintha nem is lenne megadva | 334 | : (int?)null; // ha hibás a megadott érték, akkor olyan, mintha nem is lenne megadva |
330 | 335 | ||
331 | string commontimestampconstructor = GetValue(nameof(FolderToClean.XmlStructure.CommonAttributes.Attributes.TimestampConstructor), commonattributeselement, (string)null); | 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 | var ftcxmllist = GetAllXElements(nameof(FolderToClean.XmlStructure.FolderToClean)); | 341 | var ftcxmllist = GetAllXElements(nameof(FolderToClean.XmlStructure.FolderToClean)); |
333 | if (ftcxmllist != null && ftcxmllist.Any()) | 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 | #endregion constructor | 347 | #endregion constructor |
@@ -372,11 +381,11 @@ namespace Vrh.Log4Pro.MaintenanceConsole.FileCleanerManagerNS | @@ -372,11 +381,11 @@ namespace Vrh.Log4Pro.MaintenanceConsole.FileCleanerManagerNS | ||
372 | public FolderToClean() { } | 381 | public FolderToClean() { } |
373 | #endregion basic constructor | 382 | #endregion basic constructor |
374 | #region xml constructor | 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 | common_limitdays = commonlimitdays; | 386 | common_limitdays = commonlimitdays; |
378 | common_limitbytes = commonlimitbytes; | 387 | common_limitbytes = commonlimitbytes; |
379 | - common_timestampconstructor = commontimestampconstructor; | 388 | + common_timestampconstructor = commontimestampconstructor; |
380 | Valid = true; | 389 | Valid = true; |
381 | string ATTRIBUTEMANDATORY = nameof(XmlStructure.FolderToClean) + " attribute is mandatory! Name: {0}"; | 390 | string ATTRIBUTEMANDATORY = nameof(XmlStructure.FolderToClean) + " attribute is mandatory! Name: {0}"; |
382 | Xml_Key = GetValue(nameof(XmlStructure.FolderToClean.Attributes.Key), foldertocleanxml, XmlStructure.FolderToClean.Attributes.Key.Values.DEFAULT); | 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,6 +395,8 @@ namespace Vrh.Log4Pro.MaintenanceConsole.FileCleanerManagerNS | ||
386 | Xml_RemoveEmptyFolder = GetValue(nameof(XmlStructure.FolderToClean.Attributes.RemoveEmptyFolder), foldertocleanxml, XmlStructure.FolderToClean.Attributes.RemoveEmptyFolder.Values.DEFAULT); | 395 | Xml_RemoveEmptyFolder = GetValue(nameof(XmlStructure.FolderToClean.Attributes.RemoveEmptyFolder), foldertocleanxml, XmlStructure.FolderToClean.Attributes.RemoveEmptyFolder.Values.DEFAULT); |
387 | Xml_IncludeMask = GetValue(nameof(XmlStructure.FolderToClean.Attributes.IncludeMask), foldertocleanxml, XmlStructure.FolderToClean.Attributes.IncludeMask.Values.DEFAULT); | 396 | Xml_IncludeMask = GetValue(nameof(XmlStructure.FolderToClean.Attributes.IncludeMask), foldertocleanxml, XmlStructure.FolderToClean.Attributes.IncludeMask.Values.DEFAULT); |
388 | Xml_IncludeFullpathRegexp = GetValue(GetXElement(foldertocleanxml,nameof(XmlStructure.FolderToClean.IncludeFullpathRegexp)), XmlStructure.FolderToClean.IncludeFullpathRegexp.Values.DEFAULT); | 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 | Xml_ConditionList = new List<Condition>(); | 400 | Xml_ConditionList = new List<Condition>(); |
390 | //var conditionxmlList = GetAllXElements(foldertocleanxml, nameof(XmlStructure.FolderToClean.Conditions), nameof(XmlStructure.FolderToClean.Conditions.Condition)); | 401 | //var conditionxmlList = GetAllXElements(foldertocleanxml, nameof(XmlStructure.FolderToClean.Conditions), nameof(XmlStructure.FolderToClean.Conditions.Condition)); |
391 | var conditionsxml = foldertocleanxml.Element(XName.Get(nameof(XmlStructure.FolderToClean.Conditions))); | 402 | var conditionsxml = foldertocleanxml.Element(XName.Get(nameof(XmlStructure.FolderToClean.Conditions))); |
@@ -454,6 +465,9 @@ namespace Vrh.Log4Pro.MaintenanceConsole.FileCleanerManagerNS | @@ -454,6 +465,9 @@ namespace Vrh.Log4Pro.MaintenanceConsole.FileCleanerManagerNS | ||
454 | public static class LimitDays { public static class Values { public const int DEFAULT = 7; } } | 465 | public static class LimitDays { public static class Values { public const int DEFAULT = 7; } } |
455 | public static class LimitBytes { public static class Values { public const int DEFAULT = 500000; } } | 466 | public static class LimitBytes { public static class Values { public const int DEFAULT = 500000; } } |
456 | public static class TimestampConstructor { public static class Values { public const string DEFAULT = "{YEAR}.{MONTH}.{DAY} {HOUR}:{MINUTE}:{SECOND}"; } } | 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 | public static class FolderToClean | 473 | public static class FolderToClean |
Vrh.Log4Pro.MaintenanceConsole/Manager - WebApplicationManager.cs
@@ -98,6 +98,8 @@ namespace Vrh.Log4Pro.MaintenanceConsole.WebApplicationManagerNS | @@ -98,6 +98,8 @@ namespace Vrh.Log4Pro.MaintenanceConsole.WebApplicationManagerNS | ||
98 | else if (sr.Result == Menu.SelectionResult.Ok) { } | 98 | else if (sr.Result == Menu.SelectionResult.Ok) { } |
99 | else { } | 99 | else { } |
100 | 100 | ||
101 | + getsendurlnameurlinputcycle: | ||
102 | + | ||
101 | WebApplication selectedwebapplication = (sr.SelectedParameterList.First()).Parameters as WebApplication; | 103 | WebApplication selectedwebapplication = (sr.SelectedParameterList.First()).Parameters as WebApplication; |
102 | var therearepredefinedurls = selectedwebapplication.Xml_SendUrlList != null && selectedwebapplication.Xml_SendUrlList.Any(); | 104 | var therearepredefinedurls = selectedwebapplication.Xml_SendUrlList != null && selectedwebapplication.Xml_SendUrlList.Any(); |
103 | string urlname; | 105 | string urlname; |
@@ -116,6 +118,8 @@ namespace Vrh.Log4Pro.MaintenanceConsole.WebApplicationManagerNS | @@ -116,6 +118,8 @@ namespace Vrh.Log4Pro.MaintenanceConsole.WebApplicationManagerNS | ||
116 | } | 118 | } |
117 | else { urlname = "*"; } | 119 | else { urlname = "*"; } |
118 | if (urlname.ToLower() == "ex") return o; | 120 | if (urlname.ToLower() == "ex") return o; |
121 | + if (string.IsNullOrWhiteSpace(urlname)) goto getsendurlnameurlinputcycle; | ||
122 | + | ||
119 | string urltext; | 123 | string urltext; |
120 | HttpTools.RequestType gp; | 124 | HttpTools.RequestType gp; |
121 | List<Vrh.XmlProcessing.UrlElement.UrlParameter> uplist=null; | 125 | List<Vrh.XmlProcessing.UrlElement.UrlParameter> uplist=null; |
@@ -127,10 +131,12 @@ namespace Vrh.Log4Pro.MaintenanceConsole.WebApplicationManagerNS | @@ -127,10 +131,12 @@ namespace Vrh.Log4Pro.MaintenanceConsole.WebApplicationManagerNS | ||
127 | urltext = ColorConsole.ReadLine(); | 131 | urltext = ColorConsole.ReadLine(); |
128 | if (urltext.ToLower() == "ex") return o; | 132 | if (urltext.ToLower() == "ex") return o; |
129 | if (urltext.ToLower() == "sample") urltext = TESTURL; | 133 | if (urltext.ToLower() == "sample") urltext = TESTURL; |
134 | + if (string.IsNullOrWhiteSpace(urltext)) goto getsendurlnameurlinputcycle; | ||
130 | ColorConsole.WriteLine("Enter request type (GET/POST):", ConsoleColor.Yellow); | 135 | ColorConsole.WriteLine("Enter request type (GET/POST):", ConsoleColor.Yellow); |
131 | string gpstr = ColorConsole.ReadLine(); | 136 | string gpstr = ColorConsole.ReadLine(); |
132 | gp = HttpTools.RequestType.GET; | 137 | gp = HttpTools.RequestType.GET; |
133 | if (gpstr.ToLower() == "ex") return o; | 138 | if (gpstr.ToLower() == "ex") return o; |
139 | + if (string.IsNullOrWhiteSpace(gpstr)) goto getsendurlnameurlinputcycle; | ||
134 | else if (gpstr.ToUpper() == nameof(HttpTools.RequestType.GET)) { gp = HttpTools.RequestType.GET; } | 140 | else if (gpstr.ToUpper() == nameof(HttpTools.RequestType.GET)) { gp = HttpTools.RequestType.GET; } |
135 | else if (gpstr.ToUpper() == nameof(HttpTools.RequestType.POST)) { gp = HttpTools.RequestType.POST; } | 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,6 +1315,7 @@ namespace Vrh.Log4Pro.MaintenanceConsole.WebApplicationManagerNS | ||
1309 | { | 1315 | { |
1310 | Name = GetValue(nameof(XmlStructure.WebApplication.SendUrl.Attributes.Name), sendurlxmlelement, ""); | 1316 | Name = GetValue(nameof(XmlStructure.WebApplication.SendUrl.Attributes.Name), sendurlxmlelement, ""); |
1311 | ForcePOST = GetValue(nameof(XmlStructure.WebApplication.SendUrl.Attributes.ForcePost), sendurlxmlelement, XmlStructure.WebApplication.SendUrl.Attributes.ForcePost.Values.DEFAULT); | 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 | UrlElement = new Vrh.XmlProcessing.UrlElement(); | 1319 | UrlElement = new Vrh.XmlProcessing.UrlElement(); |
1313 | UrlElement.Url = GetValue(sendurlxmlelement, ""); | 1320 | UrlElement.Url = GetValue(sendurlxmlelement, ""); |
1314 | UrlElement.Protocol = GetValue(nameof(XmlStructure.WebApplication.SendUrl.Attributes.protocol), sendurlxmlelement, ""); | 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,5 +32,5 @@ using System.Runtime.InteropServices; | ||
32 | // You can specify all the values or you can default the Build and Revision Numbers | 32 | // You can specify all the values or you can default the Build and Revision Numbers |
33 | // by using the '*' as shown below: | 33 | // by using the '*' as shown below: |
34 | // [assembly: AssemblyVersion("1.0.*")] | 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,8 +353,8 @@ | ||
353 | <Reference Include="Vrh.Web.Providers, Version=2.0.2.0, Culture=neutral, processorArchitecture=MSIL"> | 353 | <Reference Include="Vrh.Web.Providers, Version=2.0.2.0, Culture=neutral, processorArchitecture=MSIL"> |
354 | <HintPath>..\packages\VRH.Web.Providers.2.0.2\lib\net452\Vrh.Web.Providers.dll</HintPath> | 354 | <HintPath>..\packages\VRH.Web.Providers.2.0.2\lib\net452\Vrh.Web.Providers.dll</HintPath> |
355 | </Reference> | 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 | </Reference> | 358 | </Reference> |
359 | <Reference Include="WindowsBase" /> | 359 | <Reference Include="WindowsBase" /> |
360 | </ItemGroup> | 360 | </ItemGroup> |
Vrh.Log4Pro.MaintenanceConsole/packages.config
@@ -75,5 +75,5 @@ | @@ -75,5 +75,5 @@ | ||
75 | <package id="System.Xml.XDocument" version="4.0.11" targetFramework="net472" /> | 75 | <package id="System.Xml.XDocument" version="4.0.11" targetFramework="net472" /> |
76 | <package id="VRH.Common" version="2.23.1" targetFramework="net472" /> | 76 | <package id="VRH.Common" version="2.23.1" targetFramework="net472" /> |
77 | <package id="VRH.Web.Providers" version="2.0.2" targetFramework="net472" /> | 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 | </packages> | 79 | </packages> |
80 | \ No newline at end of file | 80 | \ No newline at end of file |