Ejemplo n.º 1
0
        public EditCustomFilter(JiraServer server, JiraCustomFilter filter)
        {
            this.server = server;
            this.filter = filter;

            InitializeComponent();

            listViewIssueTypes.Columns.Add("Name", listViewIssueTypes.Width - 10, HorizontalAlignment.Left);

            StartPosition = FormStartPosition.CenterParent;

            SortedDictionary<string, JiraProject> projects = JiraServerCache.Instance.getProjects(server);

            foreach (string projectKey in projects.Keys)
            {
                listBoxProjects.Items.Add(projects[projectKey]);
            }
            refillIssueTypes(null);
            refillFixFor(null);
            refillComponents(null);
            refillAffectsVersions(null);

            manageSelections();

            listBoxProjects.SelectedValueChanged += listBoxProjects_SelectedValueChanged;
        }
 public void updateModelWithCustomFilter(JiraIssueListModel model, JiraServer server, JiraCustomFilter filter)
 {
     lock (this)
     {
         List<JiraIssue> issues = facade.getCustomFilterIssues(server, filter, model.Issues.Count, GlobalSettings.JiraIssuesBatch);
         model.addIssues(issues);
     }
 }
 public void rebuildModelWithCustomFilter(JiraIssueListModel model, JiraServer server, JiraCustomFilter filter)
 {
     lock (this)
     {
         List<JiraIssue> issues = facade.getCustomFilterIssues(server, filter, 0, GlobalSettings.JiraIssuesBatch);
         model.clear(false);
         model.addIssues(issues);
     }
 }
Ejemplo n.º 4
0
        public FilterContextMenu(JiraServer server, JiraCustomFilter filter, RunOnEditDialogOk runOnEditDialogOk)
        {
            this.server = server;
            this.filter = filter;
            this.runOnEditDialogOk = runOnEditDialogOk;

            items = new[]
                {
                    new ToolStripMenuItem("Edit Filter", Properties.Resources.edit_in_browser, new EventHandler(editFilter)),
                    new ToolStripMenuItem("View Filter in Browser", Properties.Resources.view_in_browser, new EventHandler(browseFilter)),
                };

            Items.Add("dummy");

            Opened += filterContextMenuOpened;
        }
Ejemplo n.º 5
0
        public static void load(Globals globals, string solutionName)
        {
            FILTERS.Clear();

            string solutionKey  = ParameterSerializer.getKeyFromSolutionName(solutionName);
            int    filtersCount = ParameterSerializer.loadParameter(globals, solutionKey + FILTER_COUNT, 0);
            ICollection <JiraServer> servers = JiraServerModel.Instance.getAllServers();

            for (int i = 0; i < filtersCount; ++i)
            {
                string     filterGuidStr       = ParameterSerializer.loadParameter(globals, solutionKey + FILTER_GUID + i, null);
                Guid       filterGuid          = new Guid(filterGuidStr);
                string     filterServerGuidStr = ParameterSerializer.loadParameter(globals, getParamKey(solutionKey, filterGuid, FILTER_SERVER_GUID + filterGuidStr), null);
                Guid       serverGuid          = new Guid(filterServerGuidStr);
                JiraServer server = null;
                foreach (JiraServer s in servers)
                {
                    if (!s.GUID.Equals(serverGuid))
                    {
                        continue;
                    }
                    server = s;
                    break;
                }
                if (server == null)
                {
                    continue;
                }

                JiraCustomFilter filter = new JiraCustomFilter(server);

                loadProjects(globals, solutionKey, filterGuid, filter);
                loadIssueTypes(globals, solutionKey, filterGuid, filter);
                loadFixVersions(globals, solutionKey, filterGuid, filter);
                loadAffectsVersions(globals, solutionKey, filterGuid, filter);
                loadComponents(globals, solutionKey, filterGuid, filter);

                FILTERS[filterGuid] = filter;
            }
        }
Ejemplo n.º 6
0
        public static void save(Globals globals, string solutionName)
        {
            string solutionKey = ParameterSerializer.getKeyFromSolutionName(solutionName);

            ParameterSerializer.storeParameter(globals, solutionKey + FILTER_COUNT, FILTERS.Count);
            int i = 0;

            foreach (var filter in FILTERS)
            {
                ParameterSerializer.storeParameter(globals, solutionKey + FILTER_GUID + i, filter.Key.ToString());
                ParameterSerializer.storeParameter(globals, getParamKey(solutionKey, filter.Key, FILTER_SERVER_GUID + filter.Key), filter.Key.ToString());

                JiraCustomFilter f = filter.Value;

                storeProjects(globals, solutionKey, filter.Key, f);
                storeIssueTypes(globals, solutionKey, filter.Key, f);
                storeFixVersions(globals, solutionKey, filter.Key, f);
                storeAffectsVersions(globals, solutionKey, filter.Key, f);
                storeComponents(globals, solutionKey, filter.Key, f);

                ++i;
            }
        }
Ejemplo n.º 7
0
        private static void storeComponents(Globals globals, string solutionKey, Guid key, JiraCustomFilter f)
        {
            int i = 0;

            ParameterSerializer.storeParameter(globals, getParamKey(solutionKey, key, FILTER_COMPONENTS_COUNT), f.Components.Count);
            foreach (JiraNamedEntity comp in f.Components)
            {
                ParameterSerializer.storeParameter(globals, getParamKey(solutionKey, key, FILTER_COMPONENTS_ID + i), comp.Id);
                ParameterSerializer.storeParameter(globals, getParamKey(solutionKey, key, FILTER_COMPONENTS_NAME + i), comp.Name);
                ++i;
            }
        }
Ejemplo n.º 8
0
 public List<JiraIssue> getCustomFilterIssues(JiraServer server, JiraCustomFilter filter, int start, int count)
 {
     RssClient rss = new RssClient(server);
     return rss.getCustomFilterIssues(filter.getFilterQueryString(), "priority", "DESC", start, count);
 }
Ejemplo n.º 9
0
        public static void load(Globals globals, string solutionName)
        {
            FILTERS.Clear();

            string solutionKey = ParameterSerializer.getKeyFromSolutionName(solutionName);
            int filtersCount = ParameterSerializer.loadParameter(globals, solutionKey + FILTER_COUNT, 0);
            ICollection<JiraServer> servers = JiraServerModel.Instance.getAllServers();

            for (int i = 0; i < filtersCount; ++i)
            {
                string filterGuidStr = ParameterSerializer.loadParameter(globals, solutionKey + FILTER_GUID + i, null);
                Guid filterGuid = new Guid(filterGuidStr);
                string filterServerGuidStr = ParameterSerializer.loadParameter(globals, getParamKey(solutionKey, filterGuid, FILTER_SERVER_GUID + filterGuidStr), null);
                Guid serverGuid = new Guid(filterServerGuidStr);
                JiraServer server = null;
                foreach (JiraServer s in servers)
                {
                    if (!s.GUID.Equals(serverGuid)) continue;
                    server = s;
                    break;
                }
                if (server == null) continue;

                JiraCustomFilter filter = new JiraCustomFilter(server);

                loadProjects(globals, solutionKey, filterGuid, filter);
                loadIssueTypes(globals, solutionKey, filterGuid, filter);
                loadFixVersions(globals, solutionKey, filterGuid, filter);
                loadAffectsVersions(globals, solutionKey, filterGuid, filter);
                loadComponents(globals, solutionKey, filterGuid, filter);

                FILTERS[filterGuid] = filter;
            }
        }
Ejemplo n.º 10
0
 private static void loadComponents(Globals globals, string solutionKey, Guid key, JiraCustomFilter f)
 {
     int count = ParameterSerializer.loadParameter(globals, getParamKey(solutionKey, key, FILTER_COMPONENTS_COUNT), 0);
     for (int i = 0; i < count; ++i)
     {
         int id = ParameterSerializer.loadParameter(globals, getParamKey(solutionKey, key, FILTER_COMPONENTS_ID + i), 0);
         string name = ParameterSerializer.loadParameter(globals, getParamKey(solutionKey, key, FILTER_COMPONENTS_NAME + i), null);
         JiraNamedEntity comp = new JiraNamedEntity(id, name, null);
         f.Components.Add(comp);
     }
 }
Ejemplo n.º 11
0
 public void updateModelWithCustomFilter(JiraIssueListModel model, JiraServer server, JiraCustomFilter filter)
 {
     lock (this)
     {
         List <JiraIssue> issues = facade.getCustomFilterIssues(server, filter, model.Issues.Count, GlobalSettings.JiraIssuesBatch);
         model.addIssues(issues);
     }
 }
Ejemplo n.º 12
0
        private static void storeIssueTypes(Globals globals, string solutionKey, Guid key, JiraCustomFilter f)
        {
            int i = 0;

            ParameterSerializer.storeParameter(globals, getParamKey(solutionKey, key, FILTER_ISSUE_TYPE_COUNT), f.IssueTypes.Count);
            foreach (JiraNamedEntity issueType in f.IssueTypes)
            {
                ParameterSerializer.storeParameter(globals, getParamKey(solutionKey, key, FILTER_ISSUE_TYPE_ID + i), issueType.Id);
                ParameterSerializer.storeParameter(globals, getParamKey(solutionKey, key, FILTER_ISSUE_TYPE_NAME + i), issueType.Name);
                ++i;
            }
        }
Ejemplo n.º 13
0
        private static void storeProjects(Globals globals, string solutionKey, Guid key, JiraCustomFilter f)
        {
            ParameterSerializer.storeParameter(globals, getParamKey(solutionKey, key, FILTER_PROJECT_COUNT), f.Projects.Count);
            int i = 0;

            foreach (JiraProject project in f.Projects)
            {
                ParameterSerializer.storeParameter(globals, getParamKey(solutionKey, key, FILTER_PROJECT_ID + i), project.Id);
                ParameterSerializer.storeParameter(globals, getParamKey(solutionKey, key, FILTER_PROJECT_KEY + i), project.Key);
                ++i;
            }
        }
Ejemplo n.º 14
0
        private static void storeFixVersions(Globals globals, string solutionKey, Guid key, JiraCustomFilter f)
        {
            int i = 0;

            ParameterSerializer.storeParameter(globals, getParamKey(solutionKey, key, FILTER_FIXFORVERSIONS_COUNT), f.FixForVersions.Count);
            foreach (JiraNamedEntity version in f.FixForVersions)
            {
                ParameterSerializer.storeParameter(globals, getParamKey(solutionKey, key, FILTER_FIXFORVERSIONS_ID + i), version.Id);
                ParameterSerializer.storeParameter(globals, getParamKey(solutionKey, key, FILTER_FIXFORVERSIONS_NAME + i), version.Name);
                ++i;
            }
        }
Ejemplo n.º 15
0
        private static void storeComponents(Globals globals, string solutionKey, Guid key, JiraCustomFilter f)
        {
            int i = 0;

            ParameterSerializer.storeParameter(globals, getParamKey(solutionKey, key, FILTER_COMPONENTS_COUNT), f.Components.Count);
            foreach (JiraNamedEntity comp in f.Components)
            {
                ParameterSerializer.storeParameter(globals, getParamKey(solutionKey, key, FILTER_COMPONENTS_ID + i), comp.Id);
                ParameterSerializer.storeParameter(globals, getParamKey(solutionKey, key, FILTER_COMPONENTS_NAME + i), comp.Name);
                ++i;
            }
        }
Ejemplo n.º 16
0
 private static void loadProjects(Globals globals, string solutionKey, Guid key, JiraCustomFilter f)
 {
     int count = ParameterSerializer.loadParameter(globals, getParamKey(solutionKey, key, FILTER_PROJECT_COUNT), 0);
     for (int i = 0; i < count; ++i)
     {
         int id = ParameterSerializer.loadParameter(globals, getParamKey(solutionKey, key, FILTER_PROJECT_ID + i), 0);
         string projectKey = ParameterSerializer.loadParameter(globals, getParamKey(solutionKey, key, FILTER_PROJECT_KEY + i), null);
         JiraProject proj = new JiraProject(id, projectKey, projectKey);
         f.Projects.Add(proj);
     }
 }
Ejemplo n.º 17
0
 private static void loadIssueTypes(Globals globals, string solutionKey, Guid key, JiraCustomFilter f)
 {
     int count = ParameterSerializer.loadParameter(globals, getParamKey(solutionKey, key, FILTER_ISSUE_TYPE_COUNT), 0);
     for (int i = 0; i < count; ++i)
     {
         int id = ParameterSerializer.loadParameter(globals, getParamKey(solutionKey, key, FILTER_ISSUE_TYPE_ID + i), 0);
         string name = ParameterSerializer.loadParameter(globals, getParamKey(solutionKey, key, FILTER_ISSUE_TYPE_NAME + i), null);
         JiraNamedEntity issueType = new JiraNamedEntity(id, name, null);
         f.IssueTypes.Add(issueType);
     }
 }
Ejemplo n.º 18
0
 private static void loadFixVersions(Globals globals, string solutionKey, Guid key, JiraCustomFilter f)
 {
     int count = ParameterSerializer.loadParameter(globals, getParamKey(solutionKey, key, FILTER_FIXFORVERSIONS_COUNT), 0);
     for (int i = 0; i < count; ++i)
     {
         int id = ParameterSerializer.loadParameter(globals, getParamKey(solutionKey, key, FILTER_FIXFORVERSIONS_ID + i), 0);
         string name = ParameterSerializer.loadParameter(globals, getParamKey(solutionKey, key, FILTER_FIXFORVERSIONS_NAME + i), null);
         JiraNamedEntity fixVersion = new JiraNamedEntity(id, name, null);
         f.FixForVersions.Add(fixVersion);
     }
 }
Ejemplo n.º 19
0
        private static void loadComponents(Globals globals, string solutionKey, Guid key, JiraCustomFilter f)
        {
            int count = ParameterSerializer.loadParameter(globals, getParamKey(solutionKey, key, FILTER_COMPONENTS_COUNT), 0);

            for (int i = 0; i < count; ++i)
            {
                int             id   = ParameterSerializer.loadParameter(globals, getParamKey(solutionKey, key, FILTER_COMPONENTS_ID + i), 0);
                string          name = ParameterSerializer.loadParameter(globals, getParamKey(solutionKey, key, FILTER_COMPONENTS_NAME + i), null);
                JiraNamedEntity comp = new JiraNamedEntity(id, name, null);
                f.Components.Add(comp);
            }
        }
Ejemplo n.º 20
0
        private static void storeFixVersions(Globals globals, string solutionKey, Guid key, JiraCustomFilter f)
        {
            int i = 0;

            ParameterSerializer.storeParameter(globals, getParamKey(solutionKey, key, FILTER_FIXFORVERSIONS_COUNT), f.FixForVersions.Count);
            foreach (JiraNamedEntity version in f.FixForVersions)
            {
                ParameterSerializer.storeParameter(globals, getParamKey(solutionKey, key, FILTER_FIXFORVERSIONS_ID + i), version.Id);
                ParameterSerializer.storeParameter(globals, getParamKey(solutionKey, key, FILTER_FIXFORVERSIONS_NAME + i), version.Name);
                ++i;
            }
        }
Ejemplo n.º 21
0
        private static void loadFixVersions(Globals globals, string solutionKey, Guid key, JiraCustomFilter f)
        {
            int count = ParameterSerializer.loadParameter(globals, getParamKey(solutionKey, key, FILTER_FIXFORVERSIONS_COUNT), 0);

            for (int i = 0; i < count; ++i)
            {
                int             id         = ParameterSerializer.loadParameter(globals, getParamKey(solutionKey, key, FILTER_FIXFORVERSIONS_ID + i), 0);
                string          name       = ParameterSerializer.loadParameter(globals, getParamKey(solutionKey, key, FILTER_FIXFORVERSIONS_NAME + i), null);
                JiraNamedEntity fixVersion = new JiraNamedEntity(id, name, null);
                f.FixForVersions.Add(fixVersion);
            }
        }
Ejemplo n.º 22
0
        private static void storeIssueTypes(Globals globals, string solutionKey, Guid key, JiraCustomFilter f)
        {
            int i = 0;

            ParameterSerializer.storeParameter(globals, getParamKey(solutionKey, key, FILTER_ISSUE_TYPE_COUNT), f.IssueTypes.Count);
            foreach (JiraNamedEntity issueType in f.IssueTypes)
            {
                ParameterSerializer.storeParameter(globals, getParamKey(solutionKey, key, FILTER_ISSUE_TYPE_ID + i), issueType.Id);
                ParameterSerializer.storeParameter(globals, getParamKey(solutionKey, key, FILTER_ISSUE_TYPE_NAME + i), issueType.Name);
                ++i;
            }
        }
Ejemplo n.º 23
0
        private static void loadIssueTypes(Globals globals, string solutionKey, Guid key, JiraCustomFilter f)
        {
            int count = ParameterSerializer.loadParameter(globals, getParamKey(solutionKey, key, FILTER_ISSUE_TYPE_COUNT), 0);

            for (int i = 0; i < count; ++i)
            {
                int             id        = ParameterSerializer.loadParameter(globals, getParamKey(solutionKey, key, FILTER_ISSUE_TYPE_ID + i), 0);
                string          name      = ParameterSerializer.loadParameter(globals, getParamKey(solutionKey, key, FILTER_ISSUE_TYPE_NAME + i), null);
                JiraNamedEntity issueType = new JiraNamedEntity(id, name, null);
                f.IssueTypes.Add(issueType);
            }
        }
Ejemplo n.º 24
0
 private static void storeProjects(Globals globals, string solutionKey, Guid key, JiraCustomFilter f)
 {
     ParameterSerializer.storeParameter(globals, getParamKey(solutionKey, key, FILTER_PROJECT_COUNT), f.Projects.Count);
     int i = 0;
     foreach (JiraProject project in f.Projects)
     {
         ParameterSerializer.storeParameter(globals, getParamKey(solutionKey, key, FILTER_PROJECT_ID + i), project.Id);
         ParameterSerializer.storeParameter(globals, getParamKey(solutionKey, key, FILTER_PROJECT_KEY + i), project.Key);
         ++i;
     }
 }
Ejemplo n.º 25
0
        private static void loadProjects(Globals globals, string solutionKey, Guid key, JiraCustomFilter f)
        {
            int count = ParameterSerializer.loadParameter(globals, getParamKey(solutionKey, key, FILTER_PROJECT_COUNT), 0);

            for (int i = 0; i < count; ++i)
            {
                int         id         = ParameterSerializer.loadParameter(globals, getParamKey(solutionKey, key, FILTER_PROJECT_ID + i), 0);
                string      projectKey = ParameterSerializer.loadParameter(globals, getParamKey(solutionKey, key, FILTER_PROJECT_KEY + i), null);
                JiraProject proj       = new JiraProject(id, projectKey, projectKey);
                f.Projects.Add(proj);
            }
        }
Ejemplo n.º 26
0
 public void rebuildModelWithCustomFilter(JiraIssueListModel model, JiraServer server, JiraCustomFilter filter)
 {
     lock (this)
     {
         List <JiraIssue> issues = facade.getCustomFilterIssues(server, filter, 0, GlobalSettings.JiraIssuesBatch);
         model.clear(false);
         model.addIssues(issues);
     }
 }