public override void SetALMConfigurations(string ALMServerUrl, bool UseRest, string ALMUserName, string ALMPassword, string ALMDomain, string ALMProject, string ALMProjectKey, GingerCoreNET.ALMLib.ALMIntegration.eALMType almType, string ALMConfigPackageFolderPath, GingerCoreNET.ALMLib.ALMIntegration.eTestingALMType testingALMType = GingerCoreNET.ALMLib.ALMIntegration.eTestingALMType.None) { GingerCoreNET.ALMLib.ALMConfig AlmConfig = ALMCore.AlmConfigs.FirstOrDefault(x => x.AlmType == almType); GingerCoreNET.ALMLib.ALMUserConfig CurrentAlmUserConfigurations = amdocs.ginger.GingerCoreNET.WorkSpace.Instance.UserProfile.ALMUserConfigs.FirstOrDefault(x => x.AlmType == almType); //if not exist add otherwise update if (AlmConfig == null) { AlmConfig = new GingerCoreNET.ALMLib.ALMConfig(); AlmConfigs.Add(AlmConfig); } AlmConfig.ALMServerURL = GetServerValueFromDict(GetDynamicServerConfigAndSetPaths()); AlmConfig.UseRest = UseRest; AlmConfig.ALMUserName = CurrentAlmUserConfigurations.ALMUserName; AlmConfig.ALMPassword = CurrentAlmUserConfigurations.ALMPassword; AlmConfig.ALMDomain = ALMDomain; AlmConfig.ALMProjectName = ALMProject; AlmConfig.ALMProjectKey = ALMProjectKey; AlmConfig.AlmType = almType; AlmConfig.ALMConfigPackageFolderPath = ALMConfigPackageFolderPath; AlmConfig.JiraTestingALM = testingALMType; }
public virtual void SetALMConfigurations(string ALMServerUrl, bool UseRest, string ALMUserName, string ALMPassword, string ALMDomain, string ALMProject, string ALMProjectKey, GingerCoreNET.ALMLib.ALMIntegrationEnums.eALMType almType, string ALMConfigPackageFolderPath, bool UseToken, GingerCoreNET.ALMLib.ALMIntegrationEnums.eTestingALMType jiraTestingALM = GingerCoreNET.ALMLib.ALMIntegrationEnums.eTestingALMType.None) { GingerCoreNET.ALMLib.ALMConfig AlmConfig = ALMCore.AlmConfigs.FirstOrDefault(x => x.AlmType == almType); if (AlmConfig == null) { AlmConfig = new GingerCoreNET.ALMLib.ALMConfig(); AlmConfigs.Add(AlmConfig); } GingerCoreNET.ALMLib.ALMUserConfig CurrentAlmUserConfigurations = WorkSpace.Instance.UserProfile.ALMUserConfigs.FirstOrDefault(x => x.AlmType == almType); if (CurrentAlmUserConfigurations == null) { CurrentAlmUserConfigurations = new GingerCoreNET.ALMLib.ALMUserConfig(); CurrentAlmUserConfigurations.AlmType = almType; WorkSpace.Instance.UserProfile.ALMUserConfigs.Add(CurrentAlmUserConfigurations); } if (AlmConfig == null) { AlmConfig = new GingerCoreNET.ALMLib.ALMConfig(); AlmConfigs.Add(AlmConfig); } if (CurrentAlmUserConfigurations.ALMServerURL != null) { AlmConfig.ALMServerURL = CurrentAlmUserConfigurations.ALMServerURL; } else { AlmConfig.ALMServerURL = ALMServerUrl; } AlmConfig.UseRest = UseRest; AlmConfig.ALMUserName = CurrentAlmUserConfigurations.ALMUserName; AlmConfig.ALMPassword = CurrentAlmUserConfigurations.ALMPassword; AlmConfig.UseToken = UseToken; AlmConfig.ALMDomain = ALMDomain; AlmConfig.ALMProjectName = ALMProject; AlmConfig.ALMProjectKey = ALMProjectKey; AlmConfig.AlmType = almType; AlmConfig.JiraTestingALM = jiraTestingALM; if (CurrentAlmUserConfigurations.ALMConfigPackageFolderPath != null) { AlmConfig.ALMConfigPackageFolderPath = CurrentAlmUserConfigurations.ALMConfigPackageFolderPath; } else { if (!String.IsNullOrEmpty(ALMConfigPackageFolderPath)) { AlmConfig.ALMConfigPackageFolderPath = ALMConfigPackageFolderPath; } } if (!string.IsNullOrEmpty(AlmConfig.ALMConfigPackageFolderPath)) { AlmConfig.ALMConfigPackageFolderPath = WorkSpace.Instance.SolutionRepository.ConvertFullPathToBeRelative(AlmConfig.ALMConfigPackageFolderPath); } }
public GingerCoreNET.ALMLib.ALMUserConfig GetCurrentAlmUserConfig(GingerCoreNET.ALMLib.ALMIntegration.eALMType almType) { GingerCoreNET.ALMLib.ALMUserConfig AlmUserConfig = WorkSpace.Instance.UserProfile.ALMUserConfigs.FirstOrDefault(x => x.AlmType == almType); if (AlmUserConfig == null) { AlmUserConfig = new GingerCoreNET.ALMLib.ALMUserConfig(); AlmUserConfig.AlmType = almType; WorkSpace.Instance.UserProfile.ALMUserConfigs.Add(AlmUserConfig); } return(AlmUserConfig); }
public GingerCoreNET.ALMLib.ALMConfig GetCurrentAlmConfig() { GingerCoreNET.ALMLib.ALMConfig AlmConfig = null; if (this.GetType() == typeof(GingerCore.ALM.QCCore)) { AlmConfig = WorkSpace.Instance.Solution.ALMConfigs.Where(x => x.AlmType == GingerCoreNET.ALMLib.ALMIntegration.eALMType.QC).FirstOrDefault(); } if (this.GetType() == typeof(GingerCore.ALM.QCRestAPICore)) { AlmConfig = WorkSpace.Instance.Solution.ALMConfigs.Where(x => x.AlmType == GingerCoreNET.ALMLib.ALMIntegration.eALMType.QC).FirstOrDefault(); } if (this.GetType() == typeof(GingerCore.ALM.RQMCore)) { AlmConfig = WorkSpace.Instance.Solution.ALMConfigs.Where(x => x.AlmType == GingerCoreNET.ALMLib.ALMIntegration.eALMType.RQM).FirstOrDefault(); } if (this.GetType() == typeof(GingerCore.ALM.JiraCore)) { AlmConfig = WorkSpace.Instance.Solution.ALMConfigs.Where(x => x.AlmType == GingerCoreNET.ALMLib.ALMIntegration.eALMType.Jira).FirstOrDefault(); } if (this.GetType() == typeof(GingerCore.ALM.QtestCore)) { AlmConfig = WorkSpace.Instance.Solution.ALMConfigs.Where(x => x.AlmType == GingerCoreNET.ALMLib.ALMIntegration.eALMType.Qtest).FirstOrDefault(); } if (this.GetType() == typeof(GingerCore.ALM.OctaneCore)) { AlmConfig = WorkSpace.Instance.Solution.ALMConfigs.Where(x => x.AlmType == GingerCoreNET.ALMLib.ALMIntegration.eALMType.Octane).FirstOrDefault(); } if (this.GetType() == typeof(GingerCore.ALM.RallyCore)) { AlmConfig = WorkSpace.Instance.Solution.ALMConfigs.Where(x => x.AlmType == GingerCoreNET.ALMLib.ALMIntegration.eALMType.RALLY).FirstOrDefault(); } if (AlmConfig != null) { GingerCoreNET.ALMLib.ALMUserConfig AlmUserConfig = WorkSpace.Instance.UserProfile.ALMUserConfigs.FirstOrDefault(x => x.AlmType == AlmConfig.AlmType); if (AlmUserConfig == null) { AlmUserConfig = new GingerCoreNET.ALMLib.ALMUserConfig(); AlmUserConfig.AlmType = AlmConfig.AlmType; WorkSpace.Instance.UserProfile.ALMUserConfigs.Add(AlmUserConfig); } AlmConfig.ALMUserName = AlmUserConfig.ALMUserName; AlmConfig.ALMPassword = AlmUserConfig.ALMPassword; } else { AlmConfig = AlmConfigs.FirstOrDefault(); } DefaultAlmConfig = AlmConfig; return(AlmConfig); }
public GingerCoreNET.ALMLib.ALMConfig GetCurrentAlmConfig(bool isOperationAlmType = false) { GingerCoreNET.ALMLib.ALMConfig AlmConfig = null; if (isOperationAlmType) { AlmConfig = WorkSpace.Instance.Solution.ALMConfigs.Where(x => x.AlmType == this.ALMType).FirstOrDefault(); } else { AlmConfig = WorkSpace.Instance.Solution.ALMConfigs.Where(x => x.DefaultAlm).FirstOrDefault(); } if (AlmConfig != null) { GingerCoreNET.ALMLib.ALMUserConfig AlmUserConfig = WorkSpace.Instance.UserProfile.ALMUserConfigs.FirstOrDefault(x => x.AlmType == AlmConfig.AlmType); if (AlmUserConfig == null) { AlmUserConfig = new GingerCoreNET.ALMLib.ALMUserConfig(); AlmUserConfig.AlmType = AlmConfig.AlmType; WorkSpace.Instance.UserProfile.ALMUserConfigs.Add(AlmUserConfig); } if (AlmUserConfig.ALMServerURL != null) { AlmConfig.ALMServerURL = AlmUserConfig.ALMServerURL; } if (AlmUserConfig.ALMConfigPackageFolderPath != null) { AlmConfig.ALMConfigPackageFolderPath = AlmUserConfig.ALMConfigPackageFolderPath; } if (!string.IsNullOrEmpty(AlmConfig.ALMConfigPackageFolderPath)) { AlmConfig.ALMConfigPackageFolderPath = WorkSpace.Instance.SolutionRepository.ConvertFullPathToBeRelative(AlmConfig.ALMConfigPackageFolderPath); } AlmConfig.ALMUserName = AlmUserConfig.ALMUserName; AlmConfig.ALMPassword = AlmUserConfig.ALMPassword; } else { AlmConfig = AlmConfigs.FirstOrDefault(); } DefaultAlmConfig = AlmConfig; return(AlmConfig); }
public virtual void SetALMConfigurations(string ALMServerUrl, bool UseRest, string ALMUserName, string ALMPassword, string ALMDomain, string ALMProject, string ALMProjectKey, GingerCoreNET.ALMLib.ALMIntegration.eALMType almType, string ALMConfigPackageFolderPath) { GingerCoreNET.ALMLib.ALMConfig AlmConfig = ALMCore.AlmConfigs.FirstOrDefault(x => x.AlmType == almType); if (AlmConfig == null) { AlmConfig = new GingerCoreNET.ALMLib.ALMConfig(); AlmConfigs.Add(AlmConfig); } GingerCoreNET.ALMLib.ALMUserConfig CurrentAlmUserConfigurations = WorkSpace.Instance.UserProfile.ALMUserConfigs.FirstOrDefault(x => x.AlmType == almType); if (CurrentAlmUserConfigurations == null) { CurrentAlmUserConfigurations = new GingerCoreNET.ALMLib.ALMUserConfig(); CurrentAlmUserConfigurations.AlmType = almType; WorkSpace.Instance.UserProfile.ALMUserConfigs.Add(CurrentAlmUserConfigurations); } if (AlmConfig == null) { AlmConfig = new GingerCoreNET.ALMLib.ALMConfig(); AlmConfigs.Add(AlmConfig); } AlmConfig.ALMServerURL = ALMServerUrl; AlmConfig.UseRest = UseRest; AlmConfig.ALMUserName = CurrentAlmUserConfigurations.ALMUserName; AlmConfig.ALMPassword = CurrentAlmUserConfigurations.ALMPassword; AlmConfig.ALMDomain = ALMDomain; AlmConfig.ALMProjectName = ALMProject; AlmConfig.ALMProjectKey = ALMProjectKey; AlmConfig.AlmType = almType; if (!String.IsNullOrEmpty(ALMConfigPackageFolderPath)) { AlmConfig.ALMConfigPackageFolderPath = ALMConfigPackageFolderPath; } }
private void ALMRadioButton_Checked_Changed(object sender, RoutedEventArgs e) { if (sender == null || ALMSettingsPannel == null) { return; } if (CurrentAlmConfigurations != null) { ALMIntegration.Instance.SetALMCoreConfigurations(CurrentAlmConfigurations.AlmType); } GingerCoreNET.ALMLib.ALMIntegration.eALMType almType = GingerCoreNET.ALMLib.ALMIntegration.eALMType.QC; RadioButton rBtn = sender as RadioButton; if ((bool)rBtn.IsChecked) { switch (rBtn.Name) { case "QCRadioButton": almType = GingerCoreNET.ALMLib.ALMIntegration.eALMType.QC; break; case "RQMRadioButton": almType = GingerCoreNET.ALMLib.ALMIntegration.eALMType.RQM; ALMIntegration.Instance.SetALMCoreConfigurations(almType); //Because RQM need to update the server field from existing package SetLoadPackageButtonContent(); break; case "RallyRadioButton": almType = GingerCoreNET.ALMLib.ALMIntegration.eALMType.RALLY; break; case "JiraRadioButton": almType = GingerCoreNET.ALMLib.ALMIntegration.eALMType.Jira; break; case "qTestRadioButton": almType = GingerCoreNET.ALMLib.ALMIntegration.eALMType.Qtest; break; case "OctaneRadioButton": almType = GingerCoreNET.ALMLib.ALMIntegration.eALMType.Octane; break; default: //Not used break; } //Clear bindings BindingOperations.ClearAllBindings(ServerURLTextBox); BindingOperations.ClearAllBindings(RestAPICheckBox); BindingOperations.ClearAllBindings(UserNameTextBox); BindingOperations.ClearAllBindings(PasswordTextBox); BindingOperations.ClearAllBindings(DomainComboBox); BindingOperations.ClearAllBindings(ProjectComboBox); ALMIntegration.Instance.SetDefaultAlmConfig(almType); ALMIntegration.Instance.UpdateALMType(almType); CurrentAlmConfigurations = ALMIntegration.Instance.GetCurrentAlmConfig(almType); CurrentAlmUserConfigurations = ALMIntegration.Instance.GetCurrentAlmUserConfig(almType); //Bind again as we changed the AlmConfig object Bind(); //Select domain and project based on new AlmConfig LoginServerButton.Content = "Get Projects Details"; GetProjectsDetails(); StyleRadioButtons(); SetControls(); } }