From 223de6b604881b87c8892ad83bd611d479f12c7a Mon Sep 17 00:00:00 2001 From: sseifert Date: Mon, 21 Mar 2016 17:24:16 +0100 Subject: [PATCH 1/3] bump version for next development iteration --- AEMManager/Properties/AssemblyInfo.cs | 4 ++-- AEMManagerSetup/Product.wxs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/AEMManager/Properties/AssemblyInfo.cs b/AEMManager/Properties/AssemblyInfo.cs index 97e2372..c8f57d9 100644 --- a/AEMManager/Properties/AssemblyInfo.cs +++ b/AEMManager/Properties/AssemblyInfo.cs @@ -29,8 +29,8 @@ // Build Number // Revision // -[assembly: AssemblyVersion("2.2.0.0")] -[assembly: AssemblyFileVersion("2.2.0.0")] +[assembly: AssemblyVersion("2.2.1.0")] +[assembly: AssemblyFileVersion("2.2.1.0")] // Configure log4net using the .config file [assembly: log4net.Config.XmlConfiguratorAttribute(Watch = true)] diff --git a/AEMManagerSetup/Product.wxs b/AEMManagerSetup/Product.wxs index 6f77af2..c535f0d 100644 --- a/AEMManagerSetup/Product.wxs +++ b/AEMManagerSetup/Product.wxs @@ -2,7 +2,7 @@ + Version="2.2.1.0"> From aa6ff41d20197956872499abc30896bf2c733d05 Mon Sep 17 00:00:00 2001 From: sseifert Date: Thu, 21 Jul 2016 16:40:56 +0200 Subject: [PATCH 2/3] Open logfiles from instance context menu: show submenu with dynamic list of current log files instead of fixed set of usual log files --- AEMManager/AemActions.cs | 108 +++++++++++---------------------------- 1 file changed, 30 insertions(+), 78 deletions(-) diff --git a/AEMManager/AemActions.cs b/AEMManager/AemActions.cs index 2e6207a..54687fb 100644 --- a/AEMManager/AemActions.cs +++ b/AEMManager/AemActions.cs @@ -2,6 +2,7 @@ using System.Collections; using System.Collections.Generic; using System.Text; +using System.Text.RegularExpressions; using System.Windows.Forms; using System.IO; using System.Net; @@ -475,49 +476,15 @@ public static void AddLogMenuItems(Menu.MenuItemCollection pParent, AemInstance List menuItems = new List(); MenuItem item; + // show dynamic list of current logfiles item = new MenuItem(); - item.Text = "Error Log"; - item.Click += new EventHandler(LogError); + item.Text = "Open logfile..."; + item.Popup += LogFilesItem_Popup; + item.MenuItems.Add(new MenuItem()); menuItems.Add(item); item = new MenuItem(); - item.Text = "Request Log"; - item.Click += new EventHandler(LogRequest); - menuItems.Add(item); - - if (pInstance.AemInstanceType != AemInstanceType.AEM54) { - item = new MenuItem(); - item.Text = "Access Log"; - item.Click += new EventHandler(LogAccess); - menuItems.Add(item); - } - - if (pInstance.AemInstanceType == AemInstanceType.AEM54) { - item = new MenuItem(); - item.Text = "Server Log"; - item.Click += new EventHandler(LogServer); - menuItems.Add(item); - } - - item = new MenuItem(); - item.Text = "StdOut Log"; - item.Click += new EventHandler(LogStdOut); - menuItems.Add(item); - - item = new MenuItem(); - item.Text = "StdErr Log"; - item.Click += new EventHandler(LogStdErr); - menuItems.Add(item); - - if (pInstance.AemInstanceType == AemInstanceType.AEM54) { - item = new MenuItem(); - item.Text = "CRX Log"; - item.Click += new EventHandler(LogCRX); - menuItems.Add(item); - } - - item = new MenuItem(); - item.Text = "Console Window"; + item.Text = "Console window"; item.Click += new EventHandler(ShowConsoleWindow); menuItems.Add(item); @@ -528,60 +495,45 @@ public static void AddLogMenuItems(Menu.MenuItemCollection pParent, AemInstance pParent.AddRange(menuItems.ToArray()); } - private static void LogError(object sender, EventArgs e) { + private static void LogFilesItem_Popup(object sender, EventArgs e) { AemInstance instance = Program.GetActionInstance(sender); if (instance == null) { return; } - OpenLogViewer(instance.PathWithoutFilename + "\\crx-quickstart\\logs\\error.log", instance.Name + " - error.log"); - } - private static void LogRequest(object sender, EventArgs e) { - AemInstance instance = Program.GetActionInstance(sender); - if (instance == null) { - return; - } - OpenLogViewer(instance.PathWithoutFilename + "\\crx-quickstart\\logs\\request.log", instance.Name + " - request.log"); - } + MenuItem logFilesItem = (MenuItem)sender; + logFilesItem.MenuItems.Clear(); - private static void LogAccess(object sender, EventArgs e) { - AemInstance instance = Program.GetActionInstance(sender); - if (instance == null) { - return; - } - OpenLogViewer(instance.PathWithoutFilename + "\\crx-quickstart\\logs\\access.log", instance.Name + " - access.log"); - } + string logsPath = instance.PathWithoutFilename + @"\crx-quickstart\logs"; + if (Directory.Exists(logsPath)) { + string[] logFiles = Directory.GetFiles(logsPath); + if (logFiles.Length > 0) { - private static void LogServer(object sender, EventArgs e) { - AemInstance instance = Program.GetActionInstance(sender); - if (instance == null) { - return; - } - OpenLogViewer(instance.PathWithoutFilename + "\\crx-quickstart\\logs\\server.log", instance.Name + " - server.log"); - } - - private static void LogStdOut(object sender, EventArgs e) { - AemInstance instance = Program.GetActionInstance(sender); - if (instance == null) { - return; - } - OpenLogViewer(instance.PathWithoutFilename + "\\crx-quickstart\\logs\\stdout.log", instance.Name + " - stdout.log"); - } + foreach (string logFilePath in logFiles) { + string logFile = logFilePath.Substring(logFilePath.LastIndexOf(@"\") + 1); + // skip logfiles with suffixes like ".2016-07-19", "", "-2016-07-12.log", "-4108.log" + if (Regex.Match(logFile, @"^.*\.\d+\-\d+\-\d+$").Success + || Regex.Match(logFile, @"^.*\-\d+(\-\d+\-\d+)?\.log$").Success) { + continue; + } - private static void LogStdErr(object sender, EventArgs e) { - AemInstance instance = Program.GetActionInstance(sender); - if (instance == null) { - return; + MenuItem item = new MenuItem(); + item.Text = logFile; + item.Click += new EventHandler(OpenLogFile); + item.Tag = instance; + logFilesItem.MenuItems.Add(item); + } + } } - OpenLogViewer(instance.PathWithoutFilename + "\\crx-quickstart\\logs\\stderr.log", instance.Name + " - stderr.log"); } - private static void LogCRX(object sender, EventArgs e) { + private static void OpenLogFile(object sender, EventArgs e) { + MenuItem item = (MenuItem)sender; AemInstance instance = Program.GetActionInstance(sender); if (instance == null) { return; } - OpenLogViewer(instance.PathWithoutFilename + "\\crx-quickstart\\logs\\crx\\error.log", instance.Name + " - crx_error.log"); + OpenLogViewer(instance.PathWithoutFilename + @"\crx-quickstart\logs\" + item.Text, instance.Name + " - " + item.Text); } private static void ShowConsoleWindow(object sender, EventArgs e) { From 87e21fc95057cfd33031ed9e3bbc0501572e6f48 Mon Sep 17 00:00:00 2001 From: sseifert Date: Thu, 21 Jul 2016 16:42:47 +0200 Subject: [PATCH 3/3] set version to 2.3.0.0 --- AEMManager/Properties/AssemblyInfo.cs | 4 ++-- AEMManagerSetup/Product.wxs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/AEMManager/Properties/AssemblyInfo.cs b/AEMManager/Properties/AssemblyInfo.cs index c8f57d9..ee3ad67 100644 --- a/AEMManager/Properties/AssemblyInfo.cs +++ b/AEMManager/Properties/AssemblyInfo.cs @@ -29,8 +29,8 @@ // Build Number // Revision // -[assembly: AssemblyVersion("2.2.1.0")] -[assembly: AssemblyFileVersion("2.2.1.0")] +[assembly: AssemblyVersion("2.3.0.0")] +[assembly: AssemblyFileVersion("2.3.0.0")] // Configure log4net using the .config file [assembly: log4net.Config.XmlConfiguratorAttribute(Watch = true)] diff --git a/AEMManagerSetup/Product.wxs b/AEMManagerSetup/Product.wxs index c535f0d..522d77c 100644 --- a/AEMManagerSetup/Product.wxs +++ b/AEMManagerSetup/Product.wxs @@ -2,7 +2,7 @@ + Version="2.3.0.0">