예제 #1
0
 public static void remove(JiraCustomFilter filter)
 {
     if (!FILTERS.ContainsKey(filter.Guid))
     {
         return;
     }
     FILTERS.Remove(filter.Guid);
     save();
 }
예제 #2
0
 public static void add(JiraCustomFilter filter)
 {
     if (FILTERS.ContainsKey(filter.Guid))
     {
         throw new Exception("Filter Exists");
     }
     FILTERS[filter.Guid] = filter;
     save();
 }
예제 #3
0
        private static void loadReporter(ParameterStore store, Guid key, JiraCustomFilter f)
        {
            string reporterString = store.loadParameter(getParamKey(key, FILTER_REPORTER), UserType.UNDEFINED.ToString());

            try {
                f.Reporter = (UserType)Enum.Parse(typeof(UserType), reporterString);
            } catch (Exception) {
                f.Reporter = UserType.UNDEFINED;
            }
        }
예제 #4
0
        private static void loadAssignee(ParameterStore store, Guid key, JiraCustomFilter f)
        {
            string assigneeString = store.loadParameter(getParamKey(key, FILTER_ASSIGNEE), UserType.UNDEFINED.ToString());

            try {
                f.Assignee = (UserType)Enum.Parse(typeof(UserType), assigneeString);
            } catch (Exception) {
                f.Assignee = UserType.UNDEFINED;
            }
        }
예제 #5
0
        private static void storeStatuses(ParameterStore store, Guid key, JiraCustomFilter f)
        {
            int i = 0;

            store.storeParameter(getParamKey(key, FILTER_STATUSES_COUNT), f.Statuses.Count);
            foreach (JiraNamedEntity status in f.Statuses)
            {
                store.storeParameter(getParamKey(key, FILTER_STATUSES_ID + i), status.Id);
                store.storeParameter(getParamKey(key, FILTER_STATUSES_NAME + i), status.Name);
                ++i;
            }
        }
예제 #6
0
        private static void loadProjects(ParameterStore store, Guid key, JiraCustomFilter f)
        {
            int count = store.loadParameter(getParamKey(key, FILTER_PROJECT_COUNT), 0);

            for (int i = 0; i < count; ++i)
            {
                int         id         = store.loadParameter(getParamKey(key, FILTER_PROJECT_ID + i), 0);
                string      projectKey = store.loadParameter(getParamKey(key, FILTER_PROJECT_KEY + i), null);
                JiraProject proj       = new JiraProject(id, projectKey, projectKey);
                f.Projects.Add(proj);
            }
        }
예제 #7
0
        private static void storeIssueTypes(ParameterStore store, Guid key, JiraCustomFilter f)
        {
            int i = 0;

            store.storeParameter(getParamKey(key, FILTER_ISSUE_TYPE_COUNT), f.IssueTypes.Count);
            foreach (JiraNamedEntity issueType in f.IssueTypes)
            {
                store.storeParameter(getParamKey(key, FILTER_ISSUE_TYPE_ID + i), issueType.Id);
                store.storeParameter(getParamKey(key, FILTER_ISSUE_TYPE_NAME + i), issueType.Name);
                ++i;
            }
        }
예제 #8
0
        private static void loadIssueTypes(ParameterStore store, Guid key, JiraCustomFilter f)
        {
            int count = store.loadParameter(getParamKey(key, FILTER_ISSUE_TYPE_COUNT), 0);

            for (int i = 0; i < count; ++i)
            {
                int             id        = store.loadParameter(getParamKey(key, FILTER_ISSUE_TYPE_ID + i), 0);
                string          name      = store.loadParameter(getParamKey(key, FILTER_ISSUE_TYPE_NAME + i), null);
                JiraNamedEntity issueType = new JiraNamedEntity(id, name, null);
                f.IssueTypes.Add(issueType);
            }
        }
예제 #9
0
        private static void storeFixVersions(ParameterStore store, Guid key, JiraCustomFilter f)
        {
            int i = 0;

            store.storeParameter(getParamKey(key, FILTER_FIXFORVERSIONS_COUNT), f.FixForVersions.Count);
            foreach (JiraNamedEntity version in f.FixForVersions)
            {
                store.storeParameter(getParamKey(key, FILTER_FIXFORVERSIONS_ID + i), version.Id);
                store.storeParameter(getParamKey(key, FILTER_FIXFORVERSIONS_NAME + i), version.Name);
                ++i;
            }
        }
예제 #10
0
        private static void loadFixVersions(ParameterStore store, Guid key, JiraCustomFilter f)
        {
            int count = store.loadParameter(getParamKey(key, FILTER_FIXFORVERSIONS_COUNT), 0);

            for (int i = 0; i < count; ++i)
            {
                int             id         = store.loadParameter(getParamKey(key, FILTER_FIXFORVERSIONS_ID + i), 0);
                string          name       = store.loadParameter(getParamKey(key, FILTER_FIXFORVERSIONS_NAME + i), null);
                JiraNamedEntity fixVersion = new JiraNamedEntity(id, name, null);
                f.FixForVersions.Add(fixVersion);
            }
        }
예제 #11
0
        private static void storeComponents(ParameterStore store, Guid key, JiraCustomFilter f)
        {
            int i = 0;

            store.storeParameter(getParamKey(key, FILTER_COMPONENTS_COUNT), f.Components.Count);
            foreach (JiraNamedEntity comp in f.Components)
            {
                store.storeParameter(getParamKey(key, FILTER_COMPONENTS_ID + i), comp.Id);
                store.storeParameter(getParamKey(key, FILTER_COMPONENTS_NAME + i), comp.Name);
                ++i;
            }
        }
예제 #12
0
        private static void loadComponents(ParameterStore store, Guid key, JiraCustomFilter f)
        {
            int count = store.loadParameter(getParamKey(key, FILTER_COMPONENTS_COUNT), 0);

            for (int i = 0; i < count; ++i)
            {
                int             id   = store.loadParameter(getParamKey(key, FILTER_COMPONENTS_ID + i), 0);
                string          name = store.loadParameter(getParamKey(key, FILTER_COMPONENTS_NAME + i), null);
                JiraNamedEntity comp = new JiraNamedEntity(id, name, null);
                f.Components.Add(comp);
            }
        }
예제 #13
0
        private static void storePriorities(ParameterStore store, Guid key, JiraCustomFilter f)
        {
            int i = 0;

            store.storeParameter(getParamKey(key, FILTER_PRIORITIES_COUNT), f.Priorities.Count);
            foreach (JiraNamedEntity priority in f.Priorities)
            {
                store.storeParameter(getParamKey(key, FILTER_PRIORITIES_ID + i), priority.Id);
                store.storeParameter(getParamKey(key, FILTER_PRIORITIES_NAME + i), priority.Name);
                ++i;
            }
        }
예제 #14
0
        private static void loadResolutions(ParameterStore store, Guid key, JiraCustomFilter f)
        {
            int count = store.loadParameter(getParamKey(key, FILTER_RESOLUTIONS_COUNT), 0);

            for (int i = 0; i < count; ++i)
            {
                int             id         = store.loadParameter(getParamKey(key, FILTER_RESOLUTIONS_ID + i), 0);
                string          name       = store.loadParameter(getParamKey(key, FILTER_RESOLUTIONS_NAME + i), null);
                JiraNamedEntity resolution = new JiraNamedEntity(id, name, null);
                f.Resolutions.Add(resolution);
            }
        }
예제 #15
0
        private static void loadStatuses(ParameterStore store, Guid key, JiraCustomFilter f)
        {
            int count = store.loadParameter(getParamKey(key, FILTER_STATUSES_COUNT), 0);

            for (int i = 0; i < count; ++i)
            {
                int             id     = store.loadParameter(getParamKey(key, FILTER_STATUSES_ID + i), 0);
                string          name   = store.loadParameter(getParamKey(key, FILTER_STATUSES_NAME + i), null);
                JiraNamedEntity status = new JiraNamedEntity(id, name, null);
                f.Statuses.Add(status);
            }
        }
예제 #16
0
        private static void storeResolutions(ParameterStore store, Guid key, JiraCustomFilter f)
        {
            int i = 0;

            store.storeParameter(getParamKey(key, FILTER_RESOLUTIONS_COUNT), f.Resolutions.Count);
            foreach (JiraNamedEntity resolution in f.Resolutions)
            {
                store.storeParameter(getParamKey(key, FILTER_RESOLUTIONS_ID + i), resolution.Id);
                store.storeParameter(getParamKey(key, FILTER_RESOLUTIONS_NAME + i), resolution.Name);
                ++i;
            }
        }
예제 #17
0
        private static void storeProjects(ParameterStore store, Guid key, JiraCustomFilter f)
        {
            store.storeParameter(getParamKey(key, FILTER_PROJECT_COUNT), f.Projects.Count);
            int i = 0;

            foreach (JiraProject project in f.Projects)
            {
                store.storeParameter(getParamKey(key, FILTER_PROJECT_ID + i), project.Id);
                store.storeParameter(getParamKey(key, FILTER_PROJECT_KEY + i), project.Key);
                ++i;
            }
        }
예제 #18
0
        private static void loadPriorities(ParameterStore store, Guid key, JiraCustomFilter f)
        {
            int count = store.loadParameter(getParamKey(key, FILTER_PRIORITIES_COUNT), 0);

            for (int i = 0; i < count; ++i)
            {
                int             id       = store.loadParameter(getParamKey(key, FILTER_PRIORITIES_ID + i), 0);
                string          name     = store.loadParameter(getParamKey(key, FILTER_PRIORITIES_NAME + i), null);
                JiraNamedEntity priority = new JiraNamedEntity(id, name, null);
                f.Priorities.Add(priority);
            }
        }
예제 #19
0
        public static void load()
        {
            FILTERS.Clear();

            var store = ParameterStoreManager.Instance.getStoreFor(ParameterStoreManager.StoreType.SETTINGS);

            var filtersCount = store.loadParameter(FILTER_COUNT, 0);
            var servers      = JiraServerModel.Instance.getAllServers();

            for (int i = 0; i < filtersCount; ++i)
            {
                var filterGuidStr       = store.loadParameter(FILTER_GUID + i, null);
                var filterGuid          = new Guid(filterGuidStr);
                var filterServerGuidStr = store.loadParameter(getParamKey(filterGuid, FILTER_SERVER_GUID + filterGuidStr), null);
                var serverGuid          = new Guid(filterServerGuidStr);
                var server = servers.FirstOrDefault(s => s.GUID.Equals(serverGuid));
                if (server == null)
                {
                    continue;
                }

                var filter = new JiraCustomFilter(server, filterGuid)
                {
                    Name = store.loadParameter(getParamKey(filterGuid, FILTER_NAME + filterGuidStr), CUSTOM_FILTER_DEFAULT_NAME)
                };

                loadProjects(store, filterGuid, filter);
                loadIssueTypes(store, filterGuid, filter);
                loadFixVersions(store, filterGuid, filter);
                loadAffectsVersions(store, filterGuid, filter);
                loadComponents(store, filterGuid, filter);
                loadReporter(store, filterGuid, filter);
                loadAssignee(store, filterGuid, filter);
                loadStatuses(store, filterGuid, filter);
                loadResolutions(store, filterGuid, filter);
                loadPriorities(store, filterGuid, filter);

                FILTERS[filterGuid] = filter;
            }
        }
예제 #20
0
 private static void storeReporter(ParameterStore store, Guid key, JiraCustomFilter f)
 {
     store.storeParameter(getParamKey(key, FILTER_REPORTER), f.Reporter.ToString());
 }
        public void updateModelWithCustomFilter(JiraIssueListModel model, JiraServer server, JiraCustomFilter filter)
        {
            List <JiraIssue> issues = facade.getCustomFilterIssues(server, filter, model.Issues.Count, GlobalSettings.JiraIssuesBatch);

            lock (this) {
                model.addIssues(issues);
            }
        }
        public void rebuildModelWithCustomFilter(JiraIssueListModel model, JiraServer server, JiraCustomFilter filter)
        {
            List <JiraIssue> issues = facade.getCustomFilterIssues(server, filter, 0, GlobalSettings.JiraIssuesBatch);

            lock (this) {
                model.clear(false);
                model.addIssues(issues);
            }
        }
예제 #23
0
 private static void storeAssignee(ParameterStore store, Guid key, JiraCustomFilter f)
 {
     store.storeParameter(getParamKey(key, FILTER_ASSIGNEE), f.Assignee.ToString());
 }