001: package org.emforge.xfer;
002:
003: import java.util.Date;
004:
005: import javax.xml.bind.annotation.XmlTransient;
006:
007: /** Transfer Object for transferring task-data via Web-Service
008: *
009: */
010: public final class TaskTO {
011: private Long id;
012: private String title;
013: private String description;
014:
015: private String owner;
016: private PriorityTO priority;
017: private Long parentTaskId;
018: private Long parentStepId;
019:
020: private String workflowName;
021: private Integer workflowVersion;
022: private String workflowIconLink;
023:
024: private Date startTime;
025: private Date endTime;
026: private Date dueDate;
027: private Date lastChangedDate;
028:
029: private Boolean hasEnded;
030:
031: private VariableTO[] variables;
032:
033: private String projectName;
034: private String milestoneName;
035:
036: private BlockerInfoTO[] blockers;
037:
038: public TaskTO() {
039: }
040:
041: /** Task ID */
042: public Long getId() {
043: return id;
044: }
045:
046: public void setId(Long i_id) {
047: id = i_id;
048: }
049:
050: /** Task Title */
051: public String getTitle() {
052: return title;
053: }
054:
055: public void setTitle(String i_title) {
056: title = i_title;
057: }
058:
059: /** Task description in HTML Format */
060: public String getDescription() {
061: return description;
062: }
063:
064: public void setDescription(String i_description) {
065: description = i_description;
066: }
067:
068: /** UserName for task-owner
069: *
070: * It is user, created this task
071: * @return
072: */
073: public String getOwner() {
074: return owner;
075: }
076:
077: public void setOwner(String i_owner) {
078: owner = i_owner;
079: }
080:
081: /** Task priority
082: *
083: * @return
084: */
085: public PriorityTO getPriority() {
086: return priority;
087: }
088:
089: public void setPriority(PriorityTO i_priority) {
090: priority = i_priority;
091: }
092:
093: /** ID of Parent Task */
094: public Long getParentTaskId() {
095: return parentTaskId;
096: }
097:
098: public void setParentTaskId(Long i_parentTaskId) {
099: parentTaskId = i_parentTaskId;
100: }
101:
102: /** Parent Step - returns ID of parent Step */
103: public Long getParentStepId() {
104: return parentStepId;
105: }
106:
107: public void setParentStepId(Long i_parentStepId) {
108: parentStepId = i_parentStepId;
109: }
110:
111: /** Workflow Name - unique name of workflow, used for this task */
112: public String getWorkflowName() {
113: return workflowName;
114: }
115:
116: public void setWorkflowName(String i_workflowName) {
117: workflowName = i_workflowName;
118: }
119:
120: /** Version of workflow, used for this task */
121: public Integer getWorkflowVersion() {
122: return workflowVersion;
123: }
124:
125: public void setWorkflowVersion(Integer i_workflowVersion) {
126: workflowVersion = i_workflowVersion;
127: }
128:
129: /** Returns workflow name and version in format workflowName(workflowVersion)
130: *
131: * @return
132: */
133: @XmlTransient
134: public String getWorkflowNameWithVersion() {
135: if (workflowName == null) {
136: return null;
137: }
138:
139: String result = workflowName;
140:
141: if (workflowVersion != null) {
142: result += "(" + workflowVersion + ")";
143: }
144:
145: return result;
146: }
147:
148: /** Time, when task was started */
149: public Date getStartTime() {
150: return startTime;
151: }
152:
153: public void setStartTime(Date i_startTime) {
154: startTime = i_startTime;
155: }
156:
157: /** Time, when task was finished */
158: public Date getEndTime() {
159: return endTime;
160: }
161:
162: public void setEndTime(Date i_endTime) {
163: endTime = i_endTime;
164: }
165:
166: /** Time, until what task should be finished */
167: public Date getDueDate() {
168: return dueDate;
169: }
170:
171: public void setDueDate(Date i_dueDate) {
172: dueDate = i_dueDate;
173: }
174:
175: /** Time, then last changes occured in the task */
176: public Date getLastChangedDate() {
177: return lastChangedDate;
178: }
179:
180: public void setLastChangedDate(Date i_lastChangedDate) {
181: lastChangedDate = i_lastChangedDate;
182: }
183:
184: /** List of variables for Task */
185: public VariableTO[] getVariables() {
186: return variables;
187: }
188:
189: public void setVariables(VariableTO[] i_variables) {
190: variables = i_variables;
191: }
192:
193: /** Name of project, this task created for
194: *
195: * @note It is not display name, but identification name
196: */
197: public String getProjectName() {
198: return projectName;
199: }
200:
201: public void setProjectName(String i_projectName) {
202: projectName = i_projectName;
203: }
204:
205: /** If task assigned to some milestone - name of this milestone
206: *
207: * @note It is not display name, but identification name
208: */
209: public String getMilestoneName() {
210: return milestoneName;
211: }
212:
213: public void setMilestoneName(String i_milestoneName) {
214: milestoneName = i_milestoneName;
215: }
216:
217: public Boolean getHasEnded() {
218: return hasEnded;
219: }
220:
221: public void setHasEnded(Boolean i_hasEnded) {
222: hasEnded = i_hasEnded;
223: }
224:
225: public String getWorkflowIconLink() {
226: return workflowIconLink;
227: }
228:
229: public void setWorkflowIconLink(String i_workflowIconLink) {
230: workflowIconLink = i_workflowIconLink;
231: }
232:
233: /** Get information about all blockers (including blockers from subtasks)
234: */
235: public BlockerInfoTO[] getBlockers() {
236: return blockers;
237: }
238:
239: public void setBlockers(BlockerInfoTO[] i_blockers) {
240: blockers = i_blockers;
241: }
242:
243: /** Returns Variable by name
244: *
245: * @param varName
246: * @return
247: */
248: public VariableTO getVariable(String varName) {
249: if (variables == null) {
250: return null;
251: }
252:
253: for (VariableTO var : variables) {
254: if (var.getLabel().equals(varName)) {
255: return var;
256: }
257: }
258:
259: return null;
260: }
261:
262: /** Set new variable value
263: *
264: * @param name
265: * @param value
266: */
267: public void setVariable(String name, String value) {
268: VariableTO var = getVariable(name);
269:
270: if (var == null) {
271: var = new VariableTO();
272: var.setLabel(name);
273: var.setWritable(true);
274: var.setReadable(true);
275: }
276:
277: var.setValue(value);
278: }
279:
280: }
|