1 package org.itracker.web.util;
2
3 import org.apache.log4j.Logger;
4 import org.itracker.model.util.ProjectUtilities;
5
6 import javax.servlet.http.HttpServletRequest;
7 import java.util.Date;
8 import java.util.Map;
9 import java.util.TreeMap;
10
11 public class EditProjectFormActionUtil {
12 private static final Logger log = Logger.getLogger(EditProjectFormActionUtil.class);
13
14 public static class CustomFieldInfo {
15 private int id;
16 private String name;
17 private String type;
18
19 public CustomFieldInfo(Integer id, String customFieldName, String string) {
20 this.id = id;
21 this.name = customFieldName;
22 this.type = string;
23 }
24
25 public int getId() {
26 return id;
27 }
28
29 public void setId(int id) {
30 this.id = id;
31 }
32
33 public String getName() {
34 return name;
35 }
36
37 public void setName(String name) {
38 this.name = name;
39 }
40
41 public String getType() {
42 return type;
43 }
44
45 public void setType(String type) {
46 this.type = type;
47 }
48 }
49
50 public static class VersionInfo {
51 private int id;
52 private String number;
53 private String description;
54 private Date lastModifiedDate;
55 private Long countIssuesByVersion;
56
57 public VersionInfo(int id, String number, String description,
58 Date lastModifiedDate, Long countIssuesByVersion) {
59 this.id = id;
60 this.number = number;
61 this.description = description;
62 this.lastModifiedDate = lastModifiedDate;
63 this.countIssuesByVersion = countIssuesByVersion;
64 }
65
66 public int getId() {
67 return id;
68 }
69
70 public void setId(int id) {
71 this.id = id;
72 }
73
74 public String getNumber() {
75 return number;
76 }
77
78 public void setNumber(String number) {
79 this.number = number;
80 }
81
82 public String getDescription() {
83 return description;
84 }
85
86 public void setDescription(String description) {
87 this.description = description;
88 }
89
90 public Date getDate() {
91 return lastModifiedDate;
92 }
93
94 public void setDate(Date lastModifiedDate) {
95 this.lastModifiedDate = lastModifiedDate;
96 }
97
98 public Long getCount() {
99 return countIssuesByVersion;
100 }
101
102 public void setCount(Long countIssuesByVersion) {
103 this.countIssuesByVersion = countIssuesByVersion;
104 }
105
106 }
107
108 public static class ComponentInfo {
109 private int id;
110 private String name;
111 private String description;
112 private Date lastModifiedDate;
113 private Long countIssuesByComponent;
114
115 public ComponentInfo(Integer id, String name, String description,
116 Date lastModifiedDate, Long countIssuesByComponent) {
117 this.id = id;
118 this.name = name;
119 this.description = description;
120 this.lastModifiedDate = lastModifiedDate;
121 this.countIssuesByComponent = countIssuesByComponent;
122 }
123
124 public int getId() {
125 return id;
126 }
127
128 public void setId(int id) {
129 this.id = id;
130 }
131
132 public String getName() {
133 return name;
134 }
135
136 public void setName(String name) {
137 this.name = name;
138 }
139
140 public String getDescription() {
141 return description;
142 }
143
144 public void setDescription(String description) {
145 this.description = description;
146 }
147
148 public Date getDate() {
149 return lastModifiedDate;
150 }
151
152 public void setDate(Date date) {
153 this.lastModifiedDate = date;
154 }
155
156 public Long getCount() {
157 return countIssuesByComponent;
158 }
159
160 public void setCount(Long countIssuesByComponent) {
161 this.countIssuesByComponent = countIssuesByComponent;
162 }
163
164 }
165
166 public static final void setUpPrioritiesInEnv(HttpServletRequest request) {
167
168 String prioritySizeStr = ProjectUtilities.getScriptPrioritySize();
169 int prioritySize = Integer.parseInt(prioritySizeStr);
170 Map<Integer, String> priorityList = new TreeMap<Integer, String>();
171 for (int j = 1; j <= prioritySize; j++) {
172 priorityList.put(j, ProjectUtilities.getScriptPriorityLabelKey(j));
173 }
174
175 request.setAttribute("priorityList", priorityList);
176 }
177 }