Ejemplo n.º 1
0
        public ClearQuestAttachmentItem(
            OAdEntity aHostRecord,
            OAdAttachmentField aHostField,
            OAdAttachment aAttachment,
            ClearQuestConnectionConfig connectionConfiguration)
        {
            // gather info to query for the record
            EntityDefName  = CQWrapper.GetEntityDefName(aHostRecord);
            EntityDispName = CQWrapper.GetEntityDisplayName(aHostRecord);

            // gather info to query for attachment field
            FieldName = CQWrapper.GetAttachmentFieldName(aHostField);

            string name;
            string comment;
            string dispName;
            int    fileSize;

            CQWrapper.GetAttachmentMetadata(aAttachment,
                                            out name,
                                            out comment,
                                            out dispName,
                                            out fileSize);

            Name                    = name;
            Comment                 = comment;
            DisplayName             = dispName;
            Length                  = (long)fileSize; // fileSize returned by CQ API is in bytes
            ConnectionConfiguration = connectionConfiguration;
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 3
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);
            }
        }
Ejemplo n.º 4
0
        void m_worker_DoWork(object sender, DoWorkEventArgs e)
        {
            Debug.Assert(e.Argument is MigrationSource, "Wrong argument type");
            MigrationSource migrationSourceConfig = e.Argument as MigrationSource;

            string dbSet  = migrationSourceConfig.ServerUrl;
            string userDb = migrationSourceConfig.SourceIdentifier;

            CredentialManagementService credManagementService =
                new CredentialManagementService(migrationSourceConfig);

            ICQLoginCredentialManager  loginCredManager      = CQLoginCredentialManagerFactory.CreateCredentialManager(credManagementService, migrationSourceConfig);
            ClearQuestConnectionConfig userSessionConnConfig = new ClearQuestConnectionConfig(loginCredManager.UserName,
                                                                                              loginCredManager.Password,
                                                                                              userDb,
                                                                                              dbSet);

            ClearQuestOleServer.Session userSession = CQConnectionFactory.GetUserSession(userSessionConnConfig);

            Dictionary <string, bool> queryList = CQWorkSpace.GetQueryListWithValidity(userSession);

            e.Result = queryList;
        }
        public void Initialize(Configuration configuration)
        {
            CredentialManagementService credManagementService = new CredentialManagementService(configuration);

            foreach (MigrationSource ms in configuration.SessionGroup.MigrationSources.MigrationSource)
            {
                try
                {
                    string dbSet  = ms.ServerUrl;
                    string userDb = ms.SourceIdentifier;

                    ICQLoginCredentialManager loginCredManager =
                        CQLoginCredentialManagerFactory.CreateCredentialManager(credManagementService, ms);
                    Guid migrSrcId = new Guid(ms.InternalUniqueId);

                    var userSessionConnConfig = new ClearQuestConnectionConfig(loginCredManager.UserName,
                                                                               loginCredManager.Password,
                                                                               userDb,
                                                                               dbSet);
                    ClearQuestOleServer.Session userSession = CQConnectionFactory.GetUserSession(userSessionConnConfig);

                    if (!m_cqSessions.ContainsKey(migrSrcId))
                    {
                        m_cqSessions.Add(migrSrcId, userSession);
                    }
                }
                catch (ClearQuestInvalidConfigurationException)
                {
                    continue;
                }
                catch (Exception e)
                {
                    TraceManager.TraceException(e);
                }
            }
        }