diff --git a/Vrh.Log4Pro.MaintenanceConsole/Manager - FileCleanerManager.cs b/Vrh.Log4Pro.MaintenanceConsole/Manager - FileCleanerManager.cs index 46fd9e7..4201b5c 100644 --- a/Vrh.Log4Pro.MaintenanceConsole/Manager - FileCleanerManager.cs +++ b/Vrh.Log4Pro.MaintenanceConsole/Manager - FileCleanerManager.cs @@ -131,6 +131,11 @@ namespace Vrh.Log4Pro.MaintenanceConsole.FileCleanerManagerNS ColorConsole.WriteLine(ws.Xml_IncludeMask, ConsoleColor.Yellow, prefix: ", Include mask:"); return " "; } + else if (lineix == 3) + { + ColorConsole.WriteLine(ws.Xml_IncludeFullpathRegexp, ConsoleColor.Yellow, prefix: "Path regex:"); + return " "; + } else // if (lineix == INDEXBASE) { const int INDEXBASE = 3; // a linex következő indexe kerüljön ide !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! @@ -329,10 +334,14 @@ namespace Vrh.Log4Pro.MaintenanceConsole.FileCleanerManagerNS : (int?)null; // ha hibás a megadott érték, akkor olyan, mintha nem is lenne megadva string commontimestampconstructor = GetValue(nameof(FolderToClean.XmlStructure.CommonAttributes.Attributes.TimestampConstructor), commonattributeselement, (string)null); + string commontimestampregex = GetValue(nameof(FolderToClean.XmlStructure.CommonAttributes.Attributes.TSRegex), commonattributeselement, FolderToClean.XmlStructure.CommonAttributes.Attributes.TSRegex.Values.DEFAULT); + string commondatetimestampregex = GetValue(nameof(FolderToClean.XmlStructure.CommonAttributes.Attributes.DTSRegex), commonattributeselement, FolderToClean.XmlStructure.CommonAttributes.Attributes.DTSRegex.Values.DEFAULT); + string commondatestampregex = GetValue(nameof(FolderToClean.XmlStructure.CommonAttributes.Attributes.DSRegex), commonattributeselement, FolderToClean.XmlStructure.CommonAttributes.Attributes.DSRegex.Values.DEFAULT); + var ftcxmllist = GetAllXElements(nameof(FolderToClean.XmlStructure.FolderToClean)); if (ftcxmllist != null && ftcxmllist.Any()) { - foreach (var ftcxml in ftcxmllist) { var ws = new FolderToClean(ftcxml, commonlimitdays, commonlimitbytes,commontimestampconstructor); if (ws.Valid) { _foldertocleanlist.Add(ws); } } + foreach (var ftcxml in ftcxmllist) { var ws = new FolderToClean(ftcxml, commonlimitdays, commonlimitbytes,commontimestampconstructor, commondatestampregex,commontimestampregex, commondatetimestampregex); if (ws.Valid) { _foldertocleanlist.Add(ws); } } } } #endregion constructor @@ -372,11 +381,11 @@ namespace Vrh.Log4Pro.MaintenanceConsole.FileCleanerManagerNS public FolderToClean() { } #endregion basic constructor #region xml constructor - public FolderToClean(XElement foldertocleanxml,int? commonlimitdays,int? commonlimitbytes,string commontimestampconstructor) + public FolderToClean(XElement foldertocleanxml,int? commonlimitdays,int? commonlimitbytes,string commontimestampconstructor,string commondatestampregex, string commontimestampregex, string commondatetimestampregex) { common_limitdays = commonlimitdays; common_limitbytes = commonlimitbytes; - common_timestampconstructor = commontimestampconstructor; + common_timestampconstructor = commontimestampconstructor; Valid = true; string ATTRIBUTEMANDATORY = nameof(XmlStructure.FolderToClean) + " attribute is mandatory! Name: {0}"; Xml_Key = GetValue(nameof(XmlStructure.FolderToClean.Attributes.Key), foldertocleanxml, XmlStructure.FolderToClean.Attributes.Key.Values.DEFAULT); @@ -386,6 +395,8 @@ namespace Vrh.Log4Pro.MaintenanceConsole.FileCleanerManagerNS Xml_RemoveEmptyFolder = GetValue(nameof(XmlStructure.FolderToClean.Attributes.RemoveEmptyFolder), foldertocleanxml, XmlStructure.FolderToClean.Attributes.RemoveEmptyFolder.Values.DEFAULT); Xml_IncludeMask = GetValue(nameof(XmlStructure.FolderToClean.Attributes.IncludeMask), foldertocleanxml, XmlStructure.FolderToClean.Attributes.IncludeMask.Values.DEFAULT); Xml_IncludeFullpathRegexp = GetValue(GetXElement(foldertocleanxml,nameof(XmlStructure.FolderToClean.IncludeFullpathRegexp)), XmlStructure.FolderToClean.IncludeFullpathRegexp.Values.DEFAULT); + Xml_IncludeFullpathRegexp = Xml_IncludeFullpathRegexp.Replace("{DTSREGEX}", commondatetimestampregex).Replace("{TSREGEX}", commontimestampregex).Replace("{DSREGEX}", commondatestampregex); + Xml_ConditionList = new List(); //var conditionxmlList = GetAllXElements(foldertocleanxml, nameof(XmlStructure.FolderToClean.Conditions), nameof(XmlStructure.FolderToClean.Conditions.Condition)); var conditionsxml = foldertocleanxml.Element(XName.Get(nameof(XmlStructure.FolderToClean.Conditions))); @@ -454,6 +465,9 @@ namespace Vrh.Log4Pro.MaintenanceConsole.FileCleanerManagerNS public static class LimitDays { public static class Values { public const int DEFAULT = 7; } } public static class LimitBytes { public static class Values { public const int DEFAULT = 500000; } } public static class TimestampConstructor { public static class Values { public const string DEFAULT = "{YEAR}.{MONTH}.{DAY} {HOUR}:{MINUTE}:{SECOND}"; } } + 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)"; } } + public static class DSRegex { public static class Values { public const string DEFAULT = @"(?'YEAR'\d\d\d\d)(?'MONTH'\d\d)(?'DAY'\d\d)"; } } + public static class TSRegex { public static class Values { public const string DEFAULT = @"(?'HOUR'\d\d)(?'MINUTE'\d\d)(?'SECOND'\d\d)"; } } } } public static class FolderToClean diff --git a/Vrh.Log4Pro.MaintenanceConsole/Manager - WebApplicationManager.cs b/Vrh.Log4Pro.MaintenanceConsole/Manager - WebApplicationManager.cs index cc05d1d..38c0a8a 100644 --- a/Vrh.Log4Pro.MaintenanceConsole/Manager - WebApplicationManager.cs +++ b/Vrh.Log4Pro.MaintenanceConsole/Manager - WebApplicationManager.cs @@ -98,6 +98,8 @@ namespace Vrh.Log4Pro.MaintenanceConsole.WebApplicationManagerNS else if (sr.Result == Menu.SelectionResult.Ok) { } else { } + getsendurlnameurlinputcycle: + WebApplication selectedwebapplication = (sr.SelectedParameterList.First()).Parameters as WebApplication; var therearepredefinedurls = selectedwebapplication.Xml_SendUrlList != null && selectedwebapplication.Xml_SendUrlList.Any(); string urlname; @@ -116,6 +118,8 @@ namespace Vrh.Log4Pro.MaintenanceConsole.WebApplicationManagerNS } else { urlname = "*"; } if (urlname.ToLower() == "ex") return o; + if (string.IsNullOrWhiteSpace(urlname)) goto getsendurlnameurlinputcycle; + string urltext; HttpTools.RequestType gp; List uplist=null; @@ -127,10 +131,12 @@ namespace Vrh.Log4Pro.MaintenanceConsole.WebApplicationManagerNS urltext = ColorConsole.ReadLine(); if (urltext.ToLower() == "ex") return o; if (urltext.ToLower() == "sample") urltext = TESTURL; + if (string.IsNullOrWhiteSpace(urltext)) goto getsendurlnameurlinputcycle; ColorConsole.WriteLine("Enter request type (GET/POST):", ConsoleColor.Yellow); string gpstr = ColorConsole.ReadLine(); gp = HttpTools.RequestType.GET; if (gpstr.ToLower() == "ex") return o; + if (string.IsNullOrWhiteSpace(gpstr)) goto getsendurlnameurlinputcycle; else if (gpstr.ToUpper() == nameof(HttpTools.RequestType.GET)) { gp = HttpTools.RequestType.GET; } else if (gpstr.ToUpper() == nameof(HttpTools.RequestType.POST)) { gp = HttpTools.RequestType.POST; } @@ -1309,6 +1315,7 @@ namespace Vrh.Log4Pro.MaintenanceConsole.WebApplicationManagerNS { Name = GetValue(nameof(XmlStructure.WebApplication.SendUrl.Attributes.Name), sendurlxmlelement, ""); ForcePOST = GetValue(nameof(XmlStructure.WebApplication.SendUrl.Attributes.ForcePost), sendurlxmlelement, XmlStructure.WebApplication.SendUrl.Attributes.ForcePost.Values.DEFAULT); + Vrh.XmlProcessing.UrlElement xxxx = new Vrh.XmlProcessing.UrlElement(sendurlxmlelement); UrlElement = new Vrh.XmlProcessing.UrlElement(); UrlElement.Url = GetValue(sendurlxmlelement, ""); UrlElement.Protocol = GetValue(nameof(XmlStructure.WebApplication.SendUrl.Attributes.protocol), sendurlxmlelement, ""); diff --git a/Vrh.Log4Pro.MaintenanceConsole/Properties/AssemblyInfo.cs b/Vrh.Log4Pro.MaintenanceConsole/Properties/AssemblyInfo.cs index 44ba967..1ad69e2 100644 --- a/Vrh.Log4Pro.MaintenanceConsole/Properties/AssemblyInfo.cs +++ b/Vrh.Log4Pro.MaintenanceConsole/Properties/AssemblyInfo.cs @@ -32,5 +32,5 @@ using System.Runtime.InteropServices; // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.15.0.0")] -[assembly: AssemblyFileVersion("1.15.0.0")] +[assembly: AssemblyVersion("1.16.0.0")] +[assembly: AssemblyFileVersion("1.16.0.0")] diff --git a/Vrh.Log4Pro.MaintenanceConsole/Vrh.Log4Pro.MaintenanceConsole.csproj b/Vrh.Log4Pro.MaintenanceConsole/Vrh.Log4Pro.MaintenanceConsole.csproj index e818e3d..8032fb6 100644 --- a/Vrh.Log4Pro.MaintenanceConsole/Vrh.Log4Pro.MaintenanceConsole.csproj +++ b/Vrh.Log4Pro.MaintenanceConsole/Vrh.Log4Pro.MaintenanceConsole.csproj @@ -353,8 +353,8 @@ ..\packages\VRH.Web.Providers.2.0.2\lib\net452\Vrh.Web.Providers.dll - - ..\packages\Vrh.XmlProcessing.1.30.1\lib\net45\Vrh.XmlProcessing.dll + + ..\packages\Vrh.XmlProcessing.1.30.2\lib\net45\Vrh.XmlProcessing.dll diff --git a/Vrh.Log4Pro.MaintenanceConsole/packages.config b/Vrh.Log4Pro.MaintenanceConsole/packages.config index 55224a9..521cdc9 100644 --- a/Vrh.Log4Pro.MaintenanceConsole/packages.config +++ b/Vrh.Log4Pro.MaintenanceConsole/packages.config @@ -75,5 +75,5 @@ - + \ No newline at end of file -- libgit2 0.21.2