示例#1
0
        private void InitializeCQClient()
        {
            Microsoft.TeamFoundation.Migration.BusinessModel.MigrationSource migrationSourceConfig = m_configurationService.MigrationSource;
            string dbSet  = migrationSourceConfig.ServerUrl;
            string userDb = migrationSourceConfig.SourceIdentifier;

            ICredentialManagementService credManagementService =
                m_serviceContainer.GetService(typeof(ICredentialManagementService)) as ICredentialManagementService;

            ICQLoginCredentialManager loginCredManager =
                CQLoginCredentialManagerFactory.CreateCredentialManager(credManagementService, migrationSourceConfig);

            // connect to user session
            UserSessionConnConfig = new ClearQuestConnectionConfig(loginCredManager.UserName,
                                                                   loginCredManager.Password,
                                                                   userDb,
                                                                   dbSet);
            m_userSession = CQConnectionFactory.GetUserSession(UserSessionConnConfig);

            #region we won't need admin session until we start syncing cq schema
            //// connect to admin session
            //if (!string.IsNullOrEmpty(loginCredManager.AdminUserName))
            //{
            //    AdminSessionConnConfig = new ClearQuestConnectionConfig(loginCredManager.AdminUserName,
            //                                                                loginCredManager.AdminPassword ?? string.Empty,
            //                                                                userDb,
            //                                                                dbSet);
            //    m_adminSession = CQConnectionFactory.GetAdminSession(AdminSessionConnConfig);
            //}
            #endregion
            MigrationContext = new ClearQuestMigrationContext(m_userSession, migrationSourceConfig);
        }
示例#2
0
        public void Initialize(TCAdapterEnvironment env)
        {
            m_filterString = string.Format("{0}::", m_workItemType);

            // TODO: move connection settings to configuration file
            ClearQuestConnectionConfig connection = new ClearQuestConnectionConfig("hykwon", "hykwon", "UCM01", "7.0.0");

            m_session = CQConnectionFactory.GetUserSession(connection);
        }
示例#3
0
        public CQRecordStoredQueryFilter(string storedQueryName, ClearQuestOleServer.Session userSession)
            : base(string.Empty)
        {
            StoredQueryName = storedQueryName;

            if (null != userSession)
            {
                OAdQuerydef qryDef = CQWrapper.GetQueryDef(CQWrapper.GetWorkSpace(userSession), StoredQueryName);
                base.RecordType = CQWrapper.GetPrimaryEntityDefName(qryDef);
            }
        }
        public void ExtractLinkChangeActions(ClearQuestOleServer.Session session, ClearQuestOleServer.OAdEntity hostRecord, List <LinkChangeGroup> linkChangeGroups)
        {
            string recordId = CQWrapper.GetFieldValue(CQWrapper.GetEntityFieldValue(hostRecord, CQIdFieldName));
            string url      = string.Format(m_urlFormat, recordId);

            var linkChangeGroup = new LinkChangeGroup(recordId, LinkChangeGroup.LinkChangeGroupStatus.Created, false);

            string hostEntityDefName  = CQWrapper.GetEntityDefName(hostRecord);
            string hostEntityDispName = CQWrapper.GetEntityDisplayName(hostRecord);
            string hostRecordId       = UtilityMethods.CreateCQRecordMigrationItemId(hostEntityDefName, hostEntityDispName);

            ArtifactLink     link   = new ArtifactLink(hostRecordId, new Artifact(hostRecordId, s_sourceArtifactType), new Artifact(url, s_targetArtifactType), string.Empty, this);
            LinkChangeAction action = new LinkChangeAction(WellKnownChangeActionId.Add, link, LinkChangeAction.LinkChangeActionStatus.Created, false);

            linkChangeGroup.AddChangeAction(action);
            linkChangeGroups.Add(linkChangeGroup);
        }
示例#5
0
        private void m_worker_DoWork(object sender, DoWorkEventArgs e)
        {
            m_workerTask = (WorkerTask)e.Argument;

            if (m_workerTask == WorkerTask.GetDatabases)
            {
                IEnumerable <IOAdDatabaseDesc>     databases    = CQWorkSpace.GetAccessibleDatabases();
                List <ClearQuestDatabaseViewModel> databaseList = new List <ClearQuestDatabaseViewModel>();
                foreach (IOAdDatabaseDesc databaseDesc in databases)
                {
                    databaseList.Add(new ClearQuestDatabaseViewModel(databaseDesc));
                }

                e.Result = databaseList;
            }
            else if (m_workerTask == WorkerTask.Validate)
            {
                ClearQuestConnectionConfig  userSessionConnConfig = new ClearQuestConnectionConfig(UserName, m_password, SelectedDatabase.DatabaseName, SelectedDatabase.DatabaseSetName);
                ClearQuestOleServer.Session userSession           = CQConnectionFactory.GetUserSession(userSessionConnConfig);
            }
        }
示例#6
0
        private void InitializeCQClient()
        {
            MigrationSource migrationSourceConfig = m_configurationService.MigrationSource;
            string          dbSet  = migrationSourceConfig.ServerUrl;
            string          userDb = migrationSourceConfig.SourceIdentifier;

            ICredentialManagementService credManagementService =
                m_serviceContainer.GetService(typeof(ICredentialManagementService)) as ICredentialManagementService;

            ICQLoginCredentialManager loginCredManager =
                CQLoginCredentialManagerFactory.CreateCredentialManager(credManagementService, migrationSourceConfig);

            // connect to user session
            UserSessionConnConfig = new ClearQuestConnectionConfig(loginCredManager.UserName,
                                                                   loginCredManager.Password,
                                                                   userDb,
                                                                   dbSet);
            m_userSession = CQConnectionFactory.GetUserSession(UserSessionConnConfig);

            #region admin session is not needed until we sync context
            //// connect to admin session
            //if (!string.IsNullOrEmpty(loginCredManager.AdminUserName))
            //{
            //    AdminSessionConnConfig = new ClearQuestConnectionConfig(loginCredManager.AdminUserName,
            //                                                                loginCredManager.AdminPassword ?? string.Empty,
            //                                                                userDb,
            //                                                                dbSet);
            //    m_adminSession = CQConnectionFactory.GetAdminSession(AdminSessionConnConfig);
            //}
            #endregion

            // parse the filter strings in the configuration file
            m_filters = new CQRecordFilters(m_configurationService.Filters, m_userSession);

            m_migrationContext = new ClearQuestMigrationContext(m_userSession, migrationSourceConfig);
        }
 public bool Update(ClearQuestMigrationContext migrationContext, ClearQuestOleServer.Session session, ClearQuestOleServer.OAdEntity hostRecord, LinkChangeAction linkChangeAction)
 {
     // this link type is fabricated. Do nothing for submission.
     linkChangeAction.Status = LinkChangeAction.LinkChangeActionStatus.Completed;
     return(true);
 }