internal ServerDiffLinkTranslationService(
     ServerDiffEngine serverDiffEngine,
     Guid sourceId,
     LinkConfigurationLookupService linkConfigurationLookupService)
 {
     m_serverDiffEngine = serverDiffEngine;
     m_sourceId         = sourceId;
     m_linkConfigurationLookupService = linkConfigurationLookupService;
 }
Example #2
0
        public void Initialize(ServiceContainer serviceContainer)
        {
            Debug.Assert(null != serviceContainer, "ServiceContainer is NULL");

            m_serviceContainer = serviceContainer;

            m_linkTranslationService = serviceContainer.GetService(typeof(ILinkTranslationService)) as ILinkTranslationService;
            Debug.Assert(null != m_linkTranslationService, "ILinkTranslationService has not been properly initialized");

            m_configurationService = serviceContainer.GetService(typeof(ConfigurationService)) as ConfigurationService;
            Debug.Assert(null != m_configurationService, "ConfigurationService has not been properly initialized");

            m_hwmLink = new HighWaterMark <DateTime>(ClearQuestConstants.CqLinkHwm);
            m_configurationService.RegisterHighWaterMarkWithSession(m_hwmLink);

            m_linkConfigLookupService = m_linkTranslationService.LinkConfigurationLookupService;

            m_conflictManager = serviceContainer.GetService(typeof(ConflictManager)) as ConflictManager;

            InitializeClient();

            RegisterArtifactHandlers();

            MigrationSource migrSrcConfig = m_configurationService.MigrationSource;

            Debug.Assert(null != migrSrcConfig, "cannot get MigrationSource config from Session");
            foreach (CustomSetting setting in migrSrcConfig.CustomSettings.CustomSetting)
            {
                if (setting.SettingKey.Equals(ClearQuestConstants.CqWebRecordUrlBaseSettingKey, StringComparison.OrdinalIgnoreCase))
                {
                    string urlFormat           = setting.SettingValue;
                    var    recordHyperLinkType = new ClearQuestWebRecordLinkType(urlFormat);
                    m_supportedLinkTypes.Add(recordHyperLinkType.ReferenceName, recordHyperLinkType);
                    ExtractLinkChangeActionsCallback += ((ILinkHandler)recordHyperLinkType).ExtractLinkChangeActions;
                    break;
                }
            }
        }