Example #1
0
 public SubversionConnectDialog(MigrationSource source)
 {
     InitializeComponent();
     m_source    = new SubversionMigrationSourceViewModel(source);
     DataContext = m_source;
     Closed     += new EventHandler(SubversionConnectDialog_Closed);
 }
Example #2
0
        private void PopulateFilterItem(FilterItem filterItem, MigrationSource migrationSource)
        {
            VCServerPathDialog dialog = new VCServerPathDialog(filterItem, migrationSource);

            dialog.Owner = Application.Current.MainWindow;
            dialog.ShowDialog();
        }
Example #3
0
        public string GetNativeId(MigrationSource migrationSourceConfig)
        {
            string dbSet  = migrationSourceConfig.ServerUrl;
            string userDb = migrationSourceConfig.SourceIdentifier;

            return(userDb + "@" + dbSet);
        }
Example #4
0
        private void PopulateFilterString(FilterItem filterItem, MigrationSource migrationSourceConfig)
        {
            StoredQueryDialog dialog = new StoredQueryDialog(filterItem, migrationSourceConfig);

            dialog.Owner = Application.Current.MainWindow;
            dialog.ShowDialog();
        }
Example #5
0
        protected override Dictionary <string, string> GetMigrationSourceProperties(MigrationSource migrationSource)
        {
            Dictionary <string, string> properties = new Dictionary <string, string>();

            properties["Primary VOB"] = migrationSource.ServerUrl;

            string precreatedViewName = GetCustomSetting(migrationSource, CCResources.PrecreatedViewSettingName);

            if (!string.IsNullOrEmpty(precreatedViewName))
            {
                properties["View"] = precreatedViewName;

                string dynamicViewRoot = GetCustomSetting(migrationSource, CCResources.DynamicViewRootSettingName);
                string storageRoot     = GetCustomSetting(migrationSource, CCResources.StorageLocationSettingName);
                if (!string.IsNullOrEmpty(dynamicViewRoot))
                {
                    properties["Type"] = "Dynamic";
                    properties["Root"] = dynamicViewRoot;
                }
                else if (!string.IsNullOrEmpty(storageRoot))
                {
                    properties["Type"] = "Snapshot";
                    properties["Root"] = storageRoot;
                }
            }

            return(properties);
        }
        /// <summary>
        /// Creates a credential manager based on the migration source configuration
        /// </summary>
        /// <param name="credManagementService"></param>
        /// <param name="migrationSourceConfig"></param>
        /// <returns>Created credential manager</returns>
        /// <exception cref="">ClearQuestAdapter.Exceptions.ClearQuestInvalidConfigurationException</exception>
        public static ICQLoginCredentialManager CreateCredentialManager(
            ICredentialManagementService credManagementService,
            MigrationSource migrationSourceConfig)
        {
            if (null != credManagementService &&
                credManagementService.IsMigrationSourceConfiguredToUseStoredCredentials(new Guid(migrationSourceConfig.InternalUniqueId)))
            {
                if (OSIsNotSupported())
                {
                    throw new System.NotSupportedException(ClearQuestResource.StoredCredentialNotSupported);
                }

                return(new CQStoredCredentialManager(credManagementService, migrationSourceConfig));
            }
            else
            {
                foreach (var setting in migrationSourceConfig.CustomSettings.CustomSetting)
                {
                    if (setting.SettingKey.Equals(ClearQuestConstants.LoginCredentialSettingKey, StringComparison.Ordinal))
                    {
                        return(GetTypedCredentialManager(setting.SettingValue, migrationSourceConfig));
                    }
                }

                throw new ClearQuestInvalidConfigurationException(ClearQuestResource.ClearQuest_Config_MissingLoginCredentialSettingType);
            }
        }
Example #7
0
        public ClearCaseMigrationSourceViewModel(MigrationSource migrationSource)
        {
            m_timer.Interval = TimeSpan.FromSeconds(1);
            m_timer.Tick    += new EventHandler(m_timer_Tick);

            m_migrationSource = migrationSource;

            // get initial conditions
            DetectChangesInCC                      = string.Equals(GetCustomSetting(migrationSource, CCResources.DetectChangesInCC), "True", StringComparison.OrdinalIgnoreCase);
            LabelAllVersions                       = string.Equals(GetCustomSetting(migrationSource, CCResources.LabelAllVersions), "True", StringComparison.OrdinalIgnoreCase);
            DownloadFolder                         = GetCustomSetting(migrationSource, CCResources.DownloadFolderSettingName);
            ClearfsimportConfiguration             = new ClearfsimportConfiguration();
            ClearfsimportConfiguration.Unco        = string.Equals(GetCustomSetting(migrationSource, CCResources.DetectChangesInCC), "True", StringComparison.OrdinalIgnoreCase);
            ClearfsimportConfiguration.Master      = string.Equals(GetCustomSetting(migrationSource, CCResources.DetectChangesInCC), "True", StringComparison.OrdinalIgnoreCase);
            ClearfsimportConfiguration.ParseOutput = string.Equals(GetCustomSetting(migrationSource, CCResources.DetectChangesInCC), "True", StringComparison.OrdinalIgnoreCase);
            string batchSizeString = GetCustomSetting(migrationSource, CCResources.DetectChangesInCC);
            int    batchSize;

            if (int.TryParse(batchSizeString, out batchSize))
            {
                ClearfsimportConfiguration.BatchSize = batchSize;
            }

            LocalDrives = DriveInfo.GetDrives().Where(x => x.DriveType == DriveType.Network).ToList();

            m_worker = new BackgroundWorker();
            m_worker.WorkerReportsProgress = true;
            m_worker.DoWork             += new DoWorkEventHandler(m_worker_DoWork);
            m_worker.ProgressChanged    += new ProgressChangedEventHandler(m_worker_ProgressChanged);
            m_worker.RunWorkerCompleted += new RunWorkerCompletedEventHandler(m_worker_RunWorkerCompleted);
        }
Example #8
0
        public StoredQueryDialog(FilterItem filterItem, MigrationSource migrationSourceConfig)
        {
            InitializeComponent();

            m_storedQueries = new StoredQueriesViewModel(filterItem, migrationSourceConfig);
            DataContext     = m_storedQueries;
        }
Example #9
0
 public ClearCaseConnectDialog(MigrationSource source)
 {
     InitializeComponent();
     m_source    = new ClearCaseMigrationSourceViewModel(source);
     DataContext = m_source;
     Closed     += new EventHandler(ClearCaseConnectDialog_Closed);
 }
Example #10
0
        private void PopulateFilterItem(FilterItem filterItem, MigrationSource migrationSource)
        {
            WITQueryPickerDialog dialog = new WITQueryPickerDialog(filterItem, migrationSource);

            dialog.Owner = Application.Current.MainWindow;
            dialog.ShowDialog();
        }
        /// <summary>
        /// Perform the adapter-specific initialization
        /// </summary>
        public virtual void InitializeClient(MigrationSource migrationSource)
        {
            m_migrationSource = migrationSource;
            TfsTeamProjectCollection tfsServer = TfsTeamProjectCollectionFactory.GetTeamProjectCollection(new Uri(migrationSource.ServerUrl));

            m_tfsClient = (VersionControlServer)tfsServer.GetService(typeof(VersionControlServer));
            m_tfsClient.NonFatalError += new ExceptionEventHandler(NonFatalError);
        }
Example #12
0
        private Guid GetProviderFromFilterItem(FilterItem filterItem)
        {
            Guid            migrationSourceUniqueId = new Guid(filterItem.MigrationSourceUniqueId);
            MigrationSource migrationSource         = m_configuration.MigrationSources.FirstOrDefault(x => migrationSourceUniqueId.Equals(new Guid(x.InternalUniqueId)));

            Debug.Assert(migrationSource != null, "Could not find migration source");
            return(new Guid(migrationSource.ProviderReferenceName));
        }
Example #13
0
        public WITQueryPickerDialog(FilterItem filterItem, MigrationSource migrationSource)
        {
            InitializeComponent();

            m_witQueryPickerViewModel = new WITQueryPickerViewModel(filterItem, migrationSource);
            m_witQueryPickerViewModel.Initialize();
            DataContext = m_witQueryPickerViewModel;
        }
        /// <summary>
        /// Gets all the resource containers of a given type within the source model.
        /// </summary>
        /// <param name="source">The <see cref="ResourceItem"/>.</param>
        /// <param name="type">The resource container type to filter on.</param>
        /// <returns>A list of <see cref="ResourceContainer"/> matching the pattern.</returns>
        public static List <ResourceContainer> FindResourceContainersByType(this MigrationSource source, string type)
        {
            _ = source = source ?? throw new ArgumentNullException(nameof(source));
            var results = new List <ResourceContainer>();

            results.AddRange(source.ResourceContainers.FindResourceContainersByType(type));
            return(results);
        }
        /// <summary>
        /// Perform the adapter-specific initialization
        /// </summary>
        public virtual void InitializeClient(MigrationSource migrationSource)
        {
            m_migrationSource = migrationSource;
            TeamFoundationServer tfsServer = TeamFoundationServerFactory.GetServer(migrationSource.ServerUrl);

            m_tfsClient = (VersionControlServer)tfsServer.GetService(typeof(VersionControlServer));
            m_tfsClient.NonFatalError += new ExceptionEventHandler(NonFatalError);
        }
Example #16
0
 private void PopulateMigrationSource(MigrationSource migrationSource)
 {
     m_command.Execute(migrationSource);
     if (migrationSource.ProviderReferenceName != null)
     {
         migrationSource.FriendlyName += " (WIT)";
     }
 }
Example #17
0
        protected virtual Dictionary <string, string> GetMigrationSourceProperties(MigrationSource migrationSource)
        {
            Dictionary <string, string> properties = new Dictionary <string, string>();

            properties["Server URL"]   = migrationSource.ServerUrl;
            properties["Team Project"] = migrationSource.SourceIdentifier;

            return(properties);
        }
Example #18
0
        public WITQueryPickerViewModel(FilterItem filterItem, MigrationSource migrationSource)
        {
            m_filterItem      = filterItem;
            m_migrationSource = migrationSource;

            m_worker                     = new BackgroundWorker();
            m_worker.DoWork             += new DoWorkEventHandler(m_worker_DoWork);
            m_worker.RunWorkerCompleted += new RunWorkerCompletedEventHandler(m_worker_RunWorkerCompleted);
        }
Example #19
0
        private Dictionary <string, string> GetMigrationSourceProperties(MigrationSource migrationSource)
        {
            Dictionary <string, string> properties = new Dictionary <string, string>();

            properties["Server URL"]        = migrationSource.ServerUrl;
            properties["Source Identifier"] = migrationSource.SourceIdentifier;

            return(properties);
        }
Example #20
0
        /// <summary>
        /// Perform the adapter-specific initialization
        /// </summary>
        public virtual void InitializeClient(MigrationSource migrationSource)
        {
            TfsTeamProjectCollection tfs = TfsTeamProjectCollectionFactory.GetTeamProjectCollection(new Uri(migrationSource.ServerUrl));

            tfs.Authenticate();

            m_workItemStore = (WorkItemStore)tfs.GetService(typeof(WorkItemStore));

            m_projectName = migrationSource.SourceIdentifier;
        }
Example #21
0
        public static void CustomActions_DisableBypassRulesOnTarget(Configuration config)
        {
            MigrationSource target           = config.SessionGroup.MigrationSources.MigrationSource[1];
            var             enableBypassRule = new CustomSetting();

            enableBypassRule.SettingKey   = "EnableBypassRuleDataSubmission";
            enableBypassRule.SettingValue = "false";

            target.CustomSettings.CustomSetting.Add(enableBypassRule);
        }
 private void RegisterMigrationSourceMigrationAddin(Guid migrationSourceId, MigrationSource migrationSource, MigrationAddin migrationAddin)
 {
     if (!m_migrationAddinsByMigrationSource.ContainsKey(migrationSourceId))
     {
         m_migrationAddinsByMigrationSource.Add(migrationSourceId, new List <MigrationAddin>());
     }
     m_migrationAddinsByMigrationSource[migrationSourceId].Add(migrationAddin);
     TraceManager.TraceInformation(String.Format(MigrationToolkitResources.LoadedMigrationAddin,
                                                 migrationAddin.GetType().ToString(), migrationSource.FriendlyName));
 }
Example #23
0
        private void PopulateMigrationSource(MigrationSource migrationSource)
        {
            ClearQuestConnectDialog dialog = new ClearQuestConnectDialog(migrationSource);

            dialog.Owner = Application.Current.MainWindow;
            if (dialog.ShowDialog() != true)
            {
                migrationSource.ProviderReferenceName = null;
            }
        }
Example #24
0
        protected void PopulateMigrationSource(MigrationSource migrationSource)
        {
            FileSystemConnectDialog dialog = new FileSystemConnectDialog(migrationSource);

            dialog.Owner = System.Windows.Application.Current.MainWindow;
            if (dialog.ShowDialog() != true)
            {
                migrationSource.ProviderReferenceName = null;
            }
        }
Example #25
0
        private void PopulateFilterString(FilterItem filterItem, MigrationSource migrationSourceConfig)
        {
            FolderBrowserDialog dlg = new FolderBrowserDialog();

            dlg.ShowNewFolderButton = false;
            if (dlg.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                filterItem.FilterString = dlg.SelectedPath;
            }
        }
Example #26
0
        public ClearQuestMigrationSourceViewModel(MigrationSource migrationSource)
        {
            m_migrationSource = migrationSource;

            UserName = m_migrationSource.CustomSettings.CustomSetting.Where(x => string.Equals(x.SettingKey, ClearQuestConstants.UserNameKey)).Select(x => x.SettingValue).FirstOrDefault();

            m_worker                     = new BackgroundWorker();
            m_worker.DoWork             += new DoWorkEventHandler(m_worker_DoWork);
            m_worker.RunWorkerCompleted += new RunWorkerCompletedEventHandler(m_worker_RunWorkerCompleted);
        }
        /// <summary>
        /// Perform the adapter-specific initialization
        /// </summary>
        public virtual void InitializeClient(MigrationSource migrationSource)
        {
            TeamFoundationServer tfs = TeamFoundationServerFactory.GetServer(migrationSource.ServerUrl);

            tfs.Authenticate();

            m_workItemStore = (WorkItemStore)tfs.GetService(typeof(WorkItemStore));

            m_projectName = migrationSource.SourceIdentifier;
        }
Example #28
0
        public ClearQuestConnectDialog(MigrationSource source)
        {
            InitializeComponent();
            m_source = new ClearQuestMigrationSourceViewModel(source);
            m_source.PropertyChanged += new PropertyChangedEventHandler(m_source_PropertyChanged);
            DataContext = m_source;
            Closed     += new EventHandler(ClearQuestConnectDialog_Closed);

            passwordBox.Password = source.CustomSettings.CustomSetting.Where(x => x.SettingKey.Equals("Password")).Select(x => x.SettingValue).FirstOrDefault();
        }
Example #29
0
        /// <summary>
        /// Initializes the services.
        /// </summary>
        /// <param name="analysisService">The analysis service.</param>
        /// <exception cref="ArgumentNullException">If the analysisServiceContainer parameter is null</exception>
        public override void InitializeServices(IServiceContainer analysisService)
        {
            TraceManager.TraceInformation("WSSWIT:AP:InitializeServices");
            if (analysisService == null)
            {
                throw new ArgumentNullException("analysisService");
            }

            this.analysisServiceContainer = analysisService;
            this.configurationService     = (ConfigurationService)analysisService.GetService(typeof(ConfigurationService));
            MigrationSource migrationSourceConfiguration   = configurationService.MigrationSource;
            SharePointMigrationDataSource dataSourceConfig = InitializeMigrationDataSource();
            string username = string.Empty;
            string password = string.Empty;

            foreach (CustomSetting customSetting in configurationService.MigrationSource.CustomSettings.CustomSetting)
            {
                switch (customSetting.SettingKey)
                {
                case "username":
                {
                    username = customSetting.SettingValue;
                    break;
                }

                case "password":
                {
                    password = customSetting.SettingValue;
                    break;
                }
                }
            }

            dataSourceConfig.Credentials = new System.Net.NetworkCredential(username, password);
            dataSourceConfig.Url         = migrationSourceConfiguration.ServerUrl;
            dataSourceConfig.ListName    = migrationSourceConfiguration.SourceIdentifier;

            this.supportedContentTypes = new Collection <ContentType>();
            this.supportedContentTypes.Add(WellKnownContentType.WorkItem);

            SharePointChangeActionHandlers handler = new SharePointChangeActionHandlers(this);

            this.supportedChangeActions = new Dictionary <Guid, ChangeActionHandler>();
            this.supportedChangeActions.Add(WellKnownChangeActionId.Add, handler.BasicActionHandler);
            this.supportedChangeActions.Add(WellKnownChangeActionId.Edit, handler.BasicActionHandler);
            this.supportedChangeActions.Add(WellKnownChangeActionId.Delete, handler.BasicActionHandler);

            this.highWaterMarkDelta     = new HighWaterMark <DateTime>(Constants.HwmDelta);
            this.highWaterMarkChangeSet = new HighWaterMark <int>("LastChangeSet");
            this.configurationService.RegisterHighWaterMarkWithSession(this.highWaterMarkDelta);
            this.configurationService.RegisterHighWaterMarkWithSession(this.highWaterMarkChangeSet);

            this.changeGroupService = (ChangeGroupService)analysisServiceContainer.GetService(typeof(ChangeGroupService));
            this.changeGroupService.RegisterDefaultSourceSerializer(new SharePointWITMigrationItemSerializer());
        }
Example #30
0
        /// <summary>
        /// Creates a default object model for parsing and building a report.
        /// </summary>
        /// <returns></returns>
        public static void AddToMigrationSource(MigrationSource source, int depthCount, int definitionsCount, int reportCount, int innerReportCount)
        {
            _ = source = source ?? throw new ArgumentNullException(nameof(source));

            var resourceContainer = new ResourceContainer();

            source.ResourceContainers.Add(resourceContainer);

            foreach (var depth in Enumerable.Range(0, depthCount))
            {
                foreach (var definition in Enumerable.Range(0, definitionsCount))
                {
                    var resourceDefinition = new ResourceDefinition()
                    {
                        Key  = $"key-{depth}-{definition}",
                        Name = $"name-{depth}-{definition}",
                        Type = $"type-{depth}-{definition}",
                    };

                    resourceContainer.ResourceDefinitions.Add(resourceDefinition);

                    foreach (var report in Enumerable.Range(0, reportCount))
                    {
                        var sourceResource = new ResourceItem
                        {
                            Key    = $"key-{depth}-{definition}-{report}",
                            Name   = $"name-{depth}-{definition}-{report}",
                            Type   = $"type-{depth}-{definition}",
                            Rating = ConversionRating.FullConversion
                        };

                        resourceDefinition.Resources.Add(sourceResource);

                        foreach (var innerReport in Enumerable.Range(0, innerReportCount))
                        {
                            sourceResource.Resources.Add(new ResourceItem
                            {
                                Key    = $"key-{depth}-{definition}-{report}-{innerReport}",
                                Name   = $"name-{depth}-{definition}-{report}-{innerReport}",
                                RefId  = $"refid-{depth}-{definition}-{report}-{innerReport}",
                                Type   = $"type-{depth}-{definition}",
                                Rating = ConversionRating.NoRating
                            });
                        }
                    }
                }

                resourceContainer.Type = $"type-{depth}";

                var next = new ResourceContainer();
                resourceContainer.ResourceContainers.Add(next);
                resourceContainer = next;
            }
        }