public FrmConnectToRemoteServer(QlikViewConnectDto connectDto, ILogger logger) { InitializeComponent(); _connectDto = connectDto; _logger = logger; AcceptButton = cmdConnect; }
public FrmConnectionIssuesInfo(QlikViewConnectDto dto, ILogger logger) { InitializeComponent(); _logger = logger; _dto = dto; var a = new ConnectToQlikViewHelper(logger); if (!a.IsPartOfApiGroup(dto.QmsAddress)) { cmdCreateApiAccount.Visible = true; } }
private QlikViewConnectDto ShowConnectionFailuresDialogue(QlikViewConnectDto dto) { var dlg = new FrmConnectionIssues(dto, _logger); ShowDialogue(dlg); if (dlg.DialogResult == DialogResult.Abort) { dlg.ConnectDto.AbortAndExit = true; } dto = dlg.ConnectDto; return(dto); }
//todo: Fix for QlikView connection private QlikViewConnectDto ShowLogFolderDialogue(QlikViewConnectDto dto) { string pathToFolder = string.Empty; string previousPath = @"C:\ProgramData\QlikTech"; DialogResult dlgRes = DialogResult.OK; while (string.IsNullOrEmpty(pathToFolder) && dlgRes == DialogResult.OK) { string invalidPathString = string.Empty; _owner.Invoke(new Action(() => { var a = new SuperInputDialogue( title: "Path to QlikView Log Folder", text: invalidPathString + "Please write the correct path to the QlikView logs.", defaultValue: previousPath ) { StartPosition = FormStartPosition.CenterParent }; a.ShowDialog(_owner); previousPath = a.InputTextValue; dlgRes = a.DialogResult; if (dlgRes == DialogResult.OK) { if (Directory.Exists(a.InputTextValue)) { pathToFolder = a.InputTextValue; } } else { dto.AbortAndExit = true; } invalidPathString = "Invalid Path. "; })); } dto.PathToLocalLogFolder = pathToFolder; return(dto); }
private void cmdConnect_Click(object sender, EventArgs e) { txtAddress.Text = txtAddress.Text.Trim(); ToggleUi(false); if (txtAddress.Text.StartsWith("http://")) { txtAddress.Text = txtAddress.Text.Substring(8); } if (txtAddress.Text.StartsWith("https://")) { txtAddress.Text = txtAddress.Text.Substring(8); } lblErrorMessage.Text = @"Trying to connect to server."; if (string.IsNullOrEmpty(txtAddress.Text)) { txtAddress.BackColor = Color.FromArgb(255, 255, 69, 0); ToggleUi(true); return; } Application.DoEvents(); _connectDto.QmsAddress = $"http://{txtAddress.Text}:4799/QMS/Service"; _connectDto = new ConnectToQlikViewHelper(_logger).TryAccessQmsApi(_connectDto); if (_connectDto.QlikViewServerLocationFinderStatus == QlikViewServerLocationFinderStatus.Success) { Close(); DialogResult = DialogResult.OK; lblErrorMessage.Text = ""; return; } lblErrorMessage.Text = _connectDto.QlikViewServerLocationFinderStatus.GetDescription() + @"!"; ToggleUi(true); }
private async Task <bool> RunCollectionFlow() { _logger.Add($"Setting up connection to QlikView Server on {ServiceVariables.QvSettings.QmsAddress}"); var dto = new QlikViewConnectDto { ConnectToQmsApiManuallyDlg = ConnectToApiManuallyDlg, QmsAddress = ServiceVariables.QvSettings.QmsAddress }; await Task.Run(() => { var helper = new ConnectToQlikViewHelper(_logger); dto = helper.ConnectToQmsApi(dto); }).ConfigureAwait(false); if (dto == null || dto.AbortAndExit) { AbortAndExit = true; _logger.Add("Aborting connection requested."); _notify("Failed Connecting to QlikView Installation", MessageLevels.Error, "Connecting"); _notify("Aborting.", MessageLevels.Error, null); _onFinished(null, null, this); return(false); } try { var taskList = new List <Task>(); ServiceVariables.QvSettings.QmsAddress = dto.QmsAddress; //_apiCollector = new ApiCollector(_logger, _notify, ServiceVariables,dto); if (dto.RunWithDeadInstallation) { _notify("Not connected to QlikView", MessageLevels.Warning, "Connecting"); dto = PathToLogFolderDlg.Invoke(dto); if (dto.AbortAndExit) { _notify("Failed Connecting to QlikView Installation", MessageLevels.Error, "Connecting"); _notify("Aborting.", MessageLevels.Error, null); _onFinished(null, null, this); return(false); } ServiceVariables.QvSettings.QvLogLocations.Add(new QvLogLocation { LogCollectionType = QvLogCollectionType.All, Name = "BasicLogs", Path = dto.PathToLocalLogFolder }); taskList.AddRange(GetTasksForWindows()); taskList.AddRange(GetDeadLogTasks()); } else { _notify("Connected to QlikView Installation", MessageLevels.Ok, "Connecting"); taskList.AddRange(GetApiTasks()); taskList.AddRange(GetTasksForWindows()); } await Task.WhenAll(taskList).ContinueWith(p => { _logger.Add("Finished collection part"); _logger.Add(JsonConvert.SerializeObject(ServiceVariables)); Log.Shutdown(); Task.Delay(TimeSpan.FromSeconds(2)).ConfigureAwait(false); var pathToZip = _collectorHelper.CreateZipFile(ServiceVariables); ServiceVariables.CollectorOutput.ZipFile = pathToZip; _notify(pathToZip, MessageLevels.Ok, null); try { Task.Delay(TimeSpan.FromSeconds(2)).ContinueWith(task => { // give the system time to flush the filesystem. FileSystem.Singleton.DeleteDirectory(ServiceVariables.OutputFolderPath); }); } catch (Exception e) { Trace.WriteLine(e); //nothing to log home about :( the log is already zipped. } AbortAndExit = false; _onFinished(null, null, this); } ).ConfigureAwait(false); return(true); } catch (Exception e) { Console.WriteLine(e); } return(true); }
public FrmConnectionIssues(QlikViewConnectDto dto, ILogger logger) { InitializeComponent(); ConnectDto = dto; _logger = logger; }