private JiraServiceConfiguration GetValuesFromConfiguration()
        {
            jiraConfig = new JiraServiceConfiguration();

            ConfigurationReader.ReadConfigurationValues(jiraConfig, config);
            ConfigurationReader.ProcessMappingSettings(jiraConfig.ProjectMappings,
                config["ProjectMappings"],
                "JIRAProject",
                "VersionOneProject");
            ConfigurationReader.ProcessMappingSettings(jiraConfig.PriorityMappings,
                config["PriorityMappings"],
                "JIRAPriority",
                "VersionOnePriority");

            jiraConfig.OpenDefectFilter = GetFilterFromConfiguration("CreateDefectFilter");
            jiraConfig.OpenStoryFilter = GetFilterFromConfiguration("CreateStoryFilter");

            return jiraConfig;
        }
        private JiraServiceConfiguration GetValuesFromConfiguration()
        {
            jiraConfig = new JiraServiceConfiguration();

            ConfigurationReader.ReadConfigurationValues(jiraConfig, config);
            ConfigurationReader.ProcessMappingSettings(jiraConfig.ProjectMappings,
                                                       config["ProjectMappings"],
                                                       "JIRAProject",
                                                       "VersionOneProject");
            ConfigurationReader.ProcessMappingSettings(jiraConfig.PriorityMappings,
                                                       config["PriorityMappings"],
                                                       "JIRAPriority",
                                                       "VersionOnePriority");

            jiraConfig.OpenDefectFilter = GetFilterFromConfiguration("CreateDefectFilter");
            jiraConfig.OpenStoryFilter  = GetFilterFromConfiguration("CreateStoryFilter");

            return(jiraConfig);
        }
        public void Initialize(XmlElement config, IEventManager eventManager, IProfile profile)
        {
            this.eventManager = eventManager;
            this.config = config;
            logger = new Logger(eventManager);

            try {
                jiraConfig = GetValuesFromConfiguration();
            } catch(Exception ex) {
                logger.Log(LogMessage.SeverityType.Error, "Error during reading settings from configuration file.", ex);
                return;
            }

            serviceFactoryName = config["JIRAServiceFactory"].InnerText;
            sourceFieldValue = config["SourceFieldValue"].InnerText;

            this.profile = new SynchronizationProfile(profile);

            InitializeComponents();

            #region Guard Conditions

            if(jiraConfig.Url == null) {
                throw new ConfigurationException("Cannot initialize JIRA Service without a URL");
            }

            if(serviceFactoryName == null) {
                throw new ConfigurationException("Cannot initialize JIRA Service without the fully-qualified name of an IJiraServiceFactory.");
            }

            #endregion

            //tu nawiazuje sie polaczenei do V1 i inicjalizuje cala reszta....
            var checker = new StartupChecker(jiraConfig, this.eventManager);
            checker.Initialize();

            this.eventManager.Subscribe(typeof(IntervalSync), OnInterval);
            this.eventManager.Subscribe(typeof(WorkitemCreationResult), OnWorkitemCreated);
            this.eventManager.Subscribe(typeof(WorkitemCreationFailureResult), OnWorkitemCreationFailureResult);
            this.eventManager.Subscribe(typeof(WorkitemStateChangeCollection), OnWorkitemUpdate);
            this.eventManager.Subscribe(typeof(NewVersionOneWorkitemsCollection), OnNewWorkitemsInVersionOne);
        }
        public void Initialize(XmlElement config, IEventManager eventManager, IProfile profile)
        {
            this.eventManager = eventManager;
            this.config       = config;
            logger            = new Logger(eventManager);

            try
            {
                jiraConfig = GetValuesFromConfiguration();
            }
            catch (Exception ex)
            {
                logger.Log(LogMessage.SeverityType.Error, "Error during reading settings from configuration file.", ex);
                return;
            }

            if (jiraConfig.Url == null)
            {
                throw new ConfigurationException("Cannot initialize JIRA Service without a URL");
            }
        }
        public void Initialize(XmlElement config, IEventManager eventManager, IProfile profile)
        {
            this.eventManager = eventManager;
            this.config = config;
            logger = new Logger(eventManager);

            try
            {
                jiraConfig = GetValuesFromConfiguration();
            }
            catch (Exception ex)
            {
                logger.Log(LogMessage.SeverityType.Error, "Error during reading settings from configuration file.", ex);
                return;
            }

            if (jiraConfig.Url == null)
            {
                throw new ConfigurationException("Cannot initialize JIRA Service without a URL");
            }
        }
        public void Initialize()
        {
            ComponentRepository.Instance.Register(new JiraSoapServiceFactory());
            ComponentRepository.Instance.Register(new LoggerImpl());

            jiraConfig = Enviornment.instance.GetJiraConfiguration;
            jiraIssueReaderUpdater = new JiraIssueReaderUpdater(jiraConfig);
        }
 public override void SetUp()
 {
     base.SetUp();
     var config = new JiraServiceConfiguration { Url = Url, UserName = Username, Password = Password, };
     jiraComponent = new JiraIssueReaderUpdater(config);
 }
        private JiraServiceConfiguration GetValuesFromConfiguration()
        {
            jiraConfig = new JiraServiceConfiguration();

            ConfigurationReader.ReadConfigurationValues(jiraConfig, config);
            ConfigurationReader.ProcessMappingSettings(jiraConfig.ProjectMappings,
                config["ProjectMappings"],
                "JIRAProject",
                "VersionOneProject");
            ConfigurationReader.ProcessMappingSettings(jiraConfig.PriorityMappings, jiraConfig.ReversePriorityMapping,
                config["PriorityMappings"],
                "JIRAPriority",
                "VersionOnePriority");
            ConfigurationReader.ProcessMappingSettings(jiraConfig.SeverityMappings, jiraConfig.ReverseSeverityMapping,
                config["SeverityMappings"],
                "JiraSeverity",
                "VersionOneSeverity");
            ConfigurationReader.ProcessMappingSettings(jiraConfig.FieldMappings,
               config["FieldMappings"],
               "VersionOneFieldName",
               "JiraFieldName");
            ConfigurationReader.ProcessMappingSettings(jiraConfig.TransitionMappings,
                config["StatusTransitionsMappings"],
                "Mapping",
                "Status",
                "Transition");
            ConfigurationReader.ProcessMappingSettings(jiraConfig.StatusMappings,
                config["StatusMappings"],
                "Mapping",
                "V1Status",
                "JiraStatus"
                );
            jiraConfig.ReverseStatusMapping = CreateReverseStatusMapping(jiraConfig.StatusMappings);

            jiraConfig.OpenDefectFilter = GetFilterFromConfiguration("CreateDefectFilter");
            jiraConfig.OpenStoryFilter = GetFilterFromConfiguration("CreateStoryFilter");
            jiraConfig.UpdateWorkitemFilter = GetFilterFromConfiguration("UpdateWorkitemFilter");

            var settingsNode = config["Settings"];

            if(settingsNode != null && !settingsNode["ApplicationUrl"].InnerText.EndsWith("/")) {
                settingsNode["ApplicationUrl"].InnerText += "/";
            }

            return jiraConfig;
        }
 public JiraIssueReaderUpdater(JiraServiceConfiguration config, ILogger logger, IJiraConnector connector)
 {
     configuration  = config;
     this.logger    = logger;
     this.connector = connector;
 }
        public override void SetUp()
        {
            base.SetUp();

            config = new JiraServiceConfiguration {
                OnCreateFieldName = "oncreate_field_name",
                OnCreateFieldValue = "oncreate_field_value",
                OnStateChangeFieldName = "onchange_field_name",
                OnStateChangeFieldValue = "onchange_field_value",
                ProgressWorkflow = "workflow 1",
                WorkitemLinkField = "LinkField",
                ProgressWorkflowStateChanged = "workflow 2",
                AssigneeStateChanged = "-1",
                Url = Url,
                UserName = Username,
                Password = Password,
            };
            reader = new JiraIssueReaderUpdater(config);
        }