Clover Coverage Report - itracker
Coverage timestamp: Tue May 1 2012 16:42:12 CEST
57   197   34   2.59
24   137   0.6   22
22     1.55  
1    
 
 
  ProjectForm       Line # 38 57 34 0% 0.0
 
No Tests
 
1    /*
2    * This software was designed and created by Jason Carroll.
3    * Copyright (c) 2002, 2003, 2004 Jason Carroll.
4    * The author can be reached at jcarroll@cowsultants.com
5    * ITracker website: http://www.cowsultants.com
6    * ITracker forums: http://www.cowsultants.com/phpBB/index.php
7    *
8    * This program is free software; you can redistribute it and/or modify
9    * it only under the terms of the GNU General Public License as published by
10    * the Free Software Foundation; either version 2 of the License, or
11    * (at your option) any later version.
12    *
13    * This program is distributed in the hope that it will be useful,
14    * but WITHOUT ANY WARRANTY; without even the implied warranty of
15    * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16    * GNU General Public License for more details.
17    */
18   
19    package org.itracker.web.forms;
20   
21    import javax.servlet.http.HttpServletRequest;
22   
23    import org.apache.log4j.Logger;
24    import org.apache.struts.action.ActionErrors;
25    import org.apache.struts.action.ActionMapping;
26    import org.apache.struts.action.ActionMessage;
27    import org.apache.struts.action.ActionMessages;
28    import org.apache.struts.validator.ValidatorForm;
29    import org.itracker.web.actions.admin.project.EditProjectFormActionUtil;
30    import org.itracker.web.util.ServletContextUtils;
31   
32    /**
33    * This is the LoginForm Struts Form. It is used by Login form.
34    *
35    * @author ready
36    *
37    */
 
38    public class ProjectForm extends ValidatorForm {
39    /**
40    *
41    */
42    private static final long serialVersionUID = 1L;
43    private String action;
44    private Integer id;
45    private String name;
46    private Integer status;
47    private String description;
48    private Integer[] owners;
49    private Integer[] users;
50    private Integer[] permissions;
51    private Integer[] options;
52    private Integer[] fields;
53   
54    private static final Logger log = Logger.getLogger(ProjectForm.class);
55   
 
56  0 toggle public void reset(ActionMapping mapping, HttpServletRequest request) {
57  0 action = null;
58  0 id = null;
59  0 name = null;
60  0 status = null;
61  0 description = null;
62  0 owners = null;
63  0 users = null;
64  0 permissions = null;
65  0 options = null;
66  0 fields = null;
67   
68    }
69   
 
70  0 toggle public ActionErrors validate(ActionMapping mapping,
71    HttpServletRequest request) {
72  0 ActionErrors errors = super.validate(mapping, request);
73  0 if (log.isDebugEnabled()) {
74  0 log.debug("ProjectForm validate called: mapping: " + mapping
75    + ", request: " + request + ", errors: " + errors);
76    }
77  0 if (ServletContextUtils.getItrackerServices().getProjectService()
78    .isUniqueProjectName(getName(), getId())) {
79    } else {
80  0 errors.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage(
81    "itracker.web.error.project.duplicate.name"));
82    // throw new ProjectException(
83    // "Project already exist with this name.");
84    }
85   
86  0 new EditProjectFormActionUtil().init(mapping, request, this);
87  0 return errors;
88    }
89   
 
90  0 toggle public String getAction() {
91  0 return action;
92    }
93   
 
94  0 toggle public void setAction(String action) {
95  0 this.action = action;
96    }
97   
 
98  0 toggle public String getDescription() {
99  0 return description;
100    }
101   
 
102  0 toggle public void setDescription(String description) {
103  0 this.description = description;
104    }
105   
 
106  0 toggle public Integer[] getFields() {
107  0 if (null == fields)
108  0 return null;
109  0 return fields.clone();
110    }
111   
 
112  0 toggle public void setFields(Integer[] fields) {
113  0 if (null == fields)
114  0 this.fields = null;
115    else
116  0 this.fields = fields.clone();
117    }
118   
 
119  0 toggle public Integer getId() {
120  0 return id;
121    }
122   
 
123  0 toggle public void setId(Integer id) {
124  0 this.id = id;
125    }
126   
 
127  0 toggle public String getName() {
128  0 return name;
129    }
130   
 
131  0 toggle public void setName(String name) {
132  0 this.name = name;
133    }
134   
 
135  0 toggle public Integer[] getOptions() {
136  0 if (null == options)
137  0 return null;
138  0 return options.clone();
139    }
140   
 
141  0 toggle public void setOptions(Integer[] options) {
142  0 if (null == options)
143  0 this.options = null;
144    else
145  0 this.options = options.clone();
146    }
147   
 
148  0 toggle public Integer[] getOwners() {
149  0 if (null == owners)
150  0 return null;
151  0 return owners.clone();
152    }
153   
 
154  0 toggle public void setOwners(Integer[] owners) {
155  0 if (null == owners)
156  0 this.owners = null;
157    else
158  0 this.owners = owners.clone();
159    }
160   
 
161  0 toggle public Integer[] getPermissions() {
162  0 if (null == permissions)
163  0 return null;
164   
165  0 return permissions.clone();
166   
167    }
168   
 
169  0 toggle public void setPermissions(Integer[] permissions) {
170  0 if (null == permissions)
171  0 this.permissions = null;
172    else
173  0 this.permissions = permissions.clone();
174    }
175   
 
176  0 toggle public Integer getStatus() {
177  0 return status;
178    }
179   
 
180  0 toggle public void setStatus(Integer status) {
181  0 this.status = status;
182    }
183   
 
184  0 toggle public Integer[] getUsers() {
185  0 if (null == users)
186  0 return null;
187  0 return users.clone();
188    }
189   
 
190  0 toggle public void setUsers(Integer[] users) {
191  0 if (null == users)
192  0 this.users = null;
193    else
194  0 this.users = users.clone();
195    }
196   
197    }