internal TfsWITMigrationProvider(
            string serverUrl,
            string teamProject,
            string targetWorkItemId)
        {
            TfsMigrationDataSource dataSourceConfig = InitializeMigrationDataSource();

            // Allow multiple filter strings from other adapters
            // Debug.Assert(filters.Count == 1, "filters.Count != 1 for WIT migration source");
            dataSourceConfig.Filter     = string.Empty;
            dataSourceConfig.ServerId   = serverUrl;
            dataSourceConfig.ServerName = serverUrl;
            dataSourceConfig.Project    = teamProject;

            this.m_migrationSource = new TfsWITMigrationSource(
                serverUrl,
                dataSourceConfig.CreateWorkItemStore());

            if (!string.IsNullOrEmpty(targetWorkItemId))
            {
                int workItemId;
                if (int.TryParse(targetWorkItemId, out workItemId))
                {
                    m_migrationSource.WorkItemStore.TargetWorkItemId = workItemId;
                }
            }

            this.m_migrationSource.WorkItemStore.ByPassrules = true;
        }
Exemplo n.º 2
0
        internal TfsWITAnalysisProvider(
            string serverUrl,
            string teamProject)
        {
            TfsMigrationDataSource dataSourceConfig = InitializeMigrationDataSource();

            // Allow multiple filter strings from other adapters
            // Debug.Assert(filters.Count == 1, "filters.Count != 1 for WIT migration source");
            dataSourceConfig.Filter     = string.Empty;
            dataSourceConfig.ServerId   = serverUrl;
            dataSourceConfig.ServerName = serverUrl;
            dataSourceConfig.Project    = teamProject;

            this.m_migrationSource = new TfsWITMigrationSource(
                serverUrl,
                dataSourceConfig.CreateWorkItemStore());
        }
Exemplo n.º 3
0
        private void InitializeTfsClient()
        {
            MigrationSource migrationSourceConfiguration = m_configurationService.MigrationSource;

            Debug.Assert(null != migrationSourceConfiguration, "cannot get MigrationSource config from Session");


            TfsMigrationDataSource            dataSourceConfig = InitializeMigrationDataSource();
            ReadOnlyCollection <MappingEntry> filters          = m_configurationService.Filters;

            // Allow multiple filter strings from other adapters
            // Debug.Assert(filters.Count == 1, "filters.Count != 1 for WIT migration source");
            dataSourceConfig.Filter     = filters[0].Path;
            dataSourceConfig.ServerId   = migrationSourceConfiguration.ServerIdentifier;
            dataSourceConfig.ServerName = migrationSourceConfiguration.ServerUrl;
            dataSourceConfig.Project    = migrationSourceConfiguration.SourceIdentifier;

            this.m_migrationSource = new TfsWITMigrationSource(
                migrationSourceConfiguration.InternalUniqueId,
                dataSourceConfig.CreateWorkItemStore());
            this.m_migrationSource.WorkItemStore.ServiceContainer = m_migrationServiceContainer;

            m_migrationSource.WorkItemStore.LocalWorkDir = GetLocalWorkDir();

            bool?enableReflectedIdInsertion = null;

            foreach (CustomSetting setting in migrationSourceConfiguration.CustomSettings.CustomSetting)
            {
                if (setting.SettingKey.Equals(TfsConstants.DisableAreaPathAutoCreation, StringComparison.InvariantCultureIgnoreCase))
                {
                    m_migrationSource.WorkItemStore.Core.DisableAreaPathAutoCreation =
                        TfsWITCustomSetting.GetBooleanSettingValueDefaultToTrue(setting);
                }
                else if (setting.SettingKey.Equals(TfsConstants.DisableIterationPathAutoCreation, StringComparison.InvariantCultureIgnoreCase))
                {
                    m_migrationSource.WorkItemStore.Core.DisableIterationPathAutoCreation =
                        TfsWITCustomSetting.GetBooleanSettingValueDefaultToTrue(setting);
                }
                else if (setting.SettingKey.Equals(TfsConstants.EnableBypassRuleDataSubmission, StringComparison.InvariantCultureIgnoreCase))
                {
                    m_migrationSource.WorkItemStore.ByPassrules =
                        TfsWITCustomSetting.GetBooleanSettingValueDefaultToTrue(setting);
                }
                else if (setting.SettingKey.Equals(TfsConstants.ReflectedWorkItemIdFieldReferenceName, StringComparison.OrdinalIgnoreCase))
                {
                    m_migrationSource.WorkItemStore.ReflectedWorkItemIdFieldReferenceName = setting.SettingValue;
                }
                else if (setting.SettingKey.Equals(TfsConstants.EnableInsertReflectedWorkItemId))
                {
                    bool val;
                    if (bool.TryParse(setting.SettingValue, out val))
                    {
                        enableReflectedIdInsertion = val;
                    }
                }
            }

            if (!enableReflectedIdInsertion.HasValue)
            {
                // default to enable
                enableReflectedIdInsertion = true;
                m_migrationSource.WorkItemStore.EnableInsertReflectedWorkItemId = enableReflectedIdInsertion.Value;
            }

            if (string.IsNullOrEmpty(m_migrationSource.WorkItemStore.ReflectedWorkItemIdFieldReferenceName))
            {
                m_migrationSource.WorkItemStore.ReflectedWorkItemIdFieldReferenceName = TfsConstants.MigrationTracingFieldRefName;
            }

            if (m_migrationSource.WorkItemStore.ByPassrules)
            {
                m_migrationSource.WorkItemStore.Core.CheckBypassRulePermission();
            }
        }