zohoProjects 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (63) hide show
  1. checksums.yaml +15 -0
  2. data/Gemfile +4 -0
  3. data/Gemfile.lock +17 -0
  4. data/LICENSE.txt +22 -0
  5. data/README.md +145 -0
  6. data/Rakefile +2 -0
  7. data/lib/projects/api/API.rb +57 -0
  8. data/lib/projects/api/BugsAPI.rb +135 -0
  9. data/lib/projects/api/DocumentsAPI.rb +145 -0
  10. data/lib/projects/api/EventsAPI.rb +115 -0
  11. data/lib/projects/api/FoldersAPI.rb +111 -0
  12. data/lib/projects/api/ForumsAPI.rb +198 -0
  13. data/lib/projects/api/MilestonesAPI.rb +159 -0
  14. data/lib/projects/api/PortalAPI.rb +41 -0
  15. data/lib/projects/api/ProjectsAPI.rb +203 -0
  16. data/lib/projects/api/TasklistsAPI.rb +113 -0
  17. data/lib/projects/api/TasksAPI.rb +153 -0
  18. data/lib/projects/api/TimesheetsAPI.rb +240 -0
  19. data/lib/projects/api/UsersAPI.rb +48 -0
  20. data/lib/projects/exception/ProjectsException.rb +50 -0
  21. data/lib/projects/model/Activity.rb +173 -0
  22. data/lib/projects/model/Bug.rb +701 -0
  23. data/lib/projects/model/Buglog.rb +56 -0
  24. data/lib/projects/model/Category.rb +70 -0
  25. data/lib/projects/model/Comment.rb +289 -0
  26. data/lib/projects/model/Document.rb +260 -0
  27. data/lib/projects/model/Event.rb +391 -0
  28. data/lib/projects/model/Folder.rb +110 -0
  29. data/lib/projects/model/Forum.rb +320 -0
  30. data/lib/projects/model/Generallog.rb +36 -0
  31. data/lib/projects/model/Log.rb +359 -0
  32. data/lib/projects/model/Milestone.rb +322 -0
  33. data/lib/projects/model/Owner.rb +54 -0
  34. data/lib/projects/model/Participant.rb +54 -0
  35. data/lib/projects/model/Portal.rb +273 -0
  36. data/lib/projects/model/Project.rb +593 -0
  37. data/lib/projects/model/Status.rb +168 -0
  38. data/lib/projects/model/Task.rb +497 -0
  39. data/lib/projects/model/Tasklist.rb +300 -0
  40. data/lib/projects/model/Tasklog.rb +56 -0
  41. data/lib/projects/model/Timelog.rb +134 -0
  42. data/lib/projects/model/TimelogList.rb +54 -0
  43. data/lib/projects/model/User.rb +94 -0
  44. data/lib/projects/model/Version.rb +194 -0
  45. data/lib/projects/parser/BugParser.rb +208 -0
  46. data/lib/projects/parser/DocumentParser.rb +197 -0
  47. data/lib/projects/parser/EventParser.rb +156 -0
  48. data/lib/projects/parser/FolderParser.rb +99 -0
  49. data/lib/projects/parser/ForumParser.rb +253 -0
  50. data/lib/projects/parser/MilestonesParser.rb +129 -0
  51. data/lib/projects/parser/PortalParser.rb +103 -0
  52. data/lib/projects/parser/ProjectParser.rb +318 -0
  53. data/lib/projects/parser/TaskParser.rb +293 -0
  54. data/lib/projects/parser/TasklistParser.rb +127 -0
  55. data/lib/projects/parser/TimesheetParser.rb +390 -0
  56. data/lib/projects/parser/UserParser.rb +63 -0
  57. data/lib/projects/service/ZohoProject.rb +174 -0
  58. data/lib/projects/util/ZohoHTTPClient.rb +205 -0
  59. data/lib/test/ProjectsTest.rb +321 -0
  60. data/lib/zohoProjects.rb +35 -0
  61. data/lib/zohoProjects/version.rb +3 -0
  62. data/zohoProjects.gemspec +86 -0
  63. metadata +135 -0
@@ -0,0 +1,168 @@
1
+ # $Id$
2
+ module Projects
3
+ module Model
4
+ # * This class is used to make an object for Status.
5
+
6
+ class Status
7
+
8
+ private
9
+ attr_accessor :id, :content, :postedBy, :postedPerson, :postedTime, :postedTimeLong, :postedTimeFormat
10
+
11
+ public
12
+
13
+ # * Set the status id.
14
+ #
15
+ # ==== Parameters
16
+ #
17
+ # * id:: - ID of the status.
18
+
19
+ def setId(id)
20
+ @id = id
21
+ end
22
+
23
+ # * Get the status id.
24
+ #
25
+ # ==== Returns
26
+ #
27
+ # * status id.
28
+
29
+ def getId
30
+ return @id
31
+ end
32
+
33
+ # * Set the status content.
34
+ #
35
+ # ==== Parameters
36
+ #
37
+ # * content:: - Content for the status.
38
+
39
+ def setContent(content)
40
+ @content = content
41
+ end
42
+
43
+ # * Get the status content.
44
+ #
45
+ # ==== Returns
46
+ #
47
+ # * Status content.
48
+
49
+ def getContent
50
+ return @content
51
+ end
52
+
53
+ # * Set the status posted person id.
54
+ #
55
+ # ==== Parameters
56
+ #
57
+ # * postedBy:: - ID of the person who posted the status.
58
+
59
+ def setPostedBy(postedBy)
60
+ @postedBy = postedBy
61
+ end
62
+
63
+ # * Get the status posted person id.
64
+ #
65
+ # ==== Returns
66
+ #
67
+ # * Id of the person who posted the status.
68
+
69
+ def getPostedBy
70
+ return @postedBy
71
+ end
72
+
73
+ # * Set the status posted person name.
74
+ #
75
+ # ==== Parameters
76
+ #
77
+ # * postedPerson:: - Name of the person who posted the status.
78
+
79
+ def setPostedPerson(postedPerson)
80
+ @postedPerson = postedPerson
81
+ end
82
+
83
+ # * Get the status posted person name.
84
+ #
85
+ # ==== Returns
86
+ #
87
+ # * Name of the person who posted the status.
88
+
89
+ def getPostedPerson()
90
+ return @postedPerson
91
+ end
92
+
93
+ # * Set the status posted time.
94
+ #
95
+ # ==== Parameters
96
+ #
97
+ # * postedTime:: - Status posted time.
98
+
99
+ def setPostedTime(postedTime)
100
+ @postedTime = postedTime
101
+ end
102
+
103
+ # * Get the status posted time.
104
+ #
105
+ # ==== Returns
106
+ #
107
+ # * Status poted time.
108
+
109
+ def getPostedTime
110
+ return @postedTime
111
+ end
112
+
113
+ # * Set the status posted time long.
114
+ #
115
+ # ==== Parameters
116
+ #
117
+ # * postedTimeLong:: - Status posted time long.
118
+
119
+ def setPostedTimeLong(postedTimeLong)
120
+ @postedTimeLong = postedTimeLong
121
+ end
122
+
123
+ # * Get the status posted time long.
124
+ #
125
+ # ==== Returns
126
+ #
127
+ # * status posted time long.
128
+
129
+ def getPostedTimeLong
130
+ return @postedTimeLong
131
+ end
132
+
133
+ # * Set the status posted time format.
134
+ #
135
+ # ==== Parameters
136
+ #
137
+ # * postedTimeLong:: - Status posted time format.
138
+
139
+ def setPostedTimeFormat(postedTimeFormat)
140
+ @postedTimeFormat = postedTimeFormat
141
+ end
142
+
143
+ # * Get the status posted time format.
144
+ #
145
+ # ==== Returns
146
+ #
147
+ # * status posted time format.
148
+
149
+ def getPostedTimeFormat
150
+ return @postedTimeFormat
151
+ end
152
+
153
+ # * Convert the Status object into HashMap.
154
+ #
155
+ # ==== Returns
156
+ #
157
+ # * HashMap object.
158
+
159
+ def toParamMAP
160
+ requestBody = Hash.new
161
+ if content != nil
162
+ requestBody["content"] = content
163
+ end
164
+ return requestBody
165
+ end
166
+ end
167
+ end
168
+ end
@@ -0,0 +1,497 @@
1
+ # $Id$
2
+ module Projects
3
+ module Model
4
+ # * This class is used to make an object for Task.
5
+
6
+ class Task
7
+
8
+ private
9
+ attr_accessor :id, :name, :completed, :createdBy, :createdPerson, :priority, :percentComplete, :startDate, :startDateFormat, :startDateLong, :endDate, :endDateFormat, :endDateLong, :duration, :url, :timesheetUrl, :owners, :comments, :associateDocumentIds, :associateForumIds, :asks, :tasklist
10
+
11
+ public
12
+
13
+ # * Set the task id.
14
+ #
15
+ # ==== Parameters
16
+ #
17
+ # * id:: - ID of the task.
18
+
19
+ def setId(id)
20
+ @id = id
21
+ end
22
+
23
+ # * Get the task id.
24
+ #
25
+ # ==== Returns
26
+ #
27
+ # * Task id.
28
+
29
+ def getId
30
+ return @id
31
+ end
32
+
33
+ # * Set the task name.
34
+ #
35
+ # ==== Parameters
36
+ #
37
+ # * name:: - Name of the task.
38
+
39
+ def setName(name)
40
+ @name = name
41
+ end
42
+
43
+ # * Get the task name.
44
+ #
45
+ # ==== Returns
46
+ #
47
+ # * Task name.
48
+
49
+ def getName
50
+ return @name
51
+ end
52
+
53
+ # * Set whether the task is completed or not.
54
+ #
55
+ # ==== Parameters
56
+ #
57
+ # * completed:: - Is task is completed or not.
58
+
59
+ def setCompleted(completed)
60
+ @completed = completed
61
+ end
62
+
63
+ # * Get whether the task is completed or not.
64
+ #
65
+ # ==== Returns
66
+ #
67
+ # * true, if the task is completed else false.
68
+
69
+ def isCompleted
70
+ return @completed
71
+ end
72
+
73
+ # * Set the id of the person who created the task.
74
+ #
75
+ # ==== Parameters
76
+ #
77
+ # * createdBy:: - Id of the user who created the task.
78
+
79
+ def setCreatedBy(createdBy)
80
+ @createdBy = createdBy
81
+ end
82
+
83
+ # * Get the id of the user who created the task.
84
+ #
85
+ # ==== Returns
86
+ #
87
+ # * Id of the person who created the task.
88
+
89
+ def getCreatedBy
90
+ return @createdBy
91
+ end
92
+
93
+ # * Set the task created person name.
94
+ #
95
+ # ==== Parameters
96
+ #
97
+ # * createdPerson:: - Name of the person who created the task.
98
+
99
+ def setCreatedPerson(createdPerson)
100
+ @createdPerson = createdPerson
101
+ end
102
+
103
+ # * Get the name of the person who created the task.
104
+ #
105
+ # ==== Returns
106
+ #
107
+ # * Task created person name.
108
+
109
+ def getCreatedPerson
110
+ return @createdPerson
111
+ end
112
+
113
+ # * Set the priority of the task.
114
+ #
115
+ # ==== Parameters
116
+ #
117
+ # * priority:: - Priority of the task.
118
+
119
+ def setPriority(priority)
120
+ @priority = priority
121
+ end
122
+
123
+ # * Get the priority of the task.
124
+ #
125
+ # ==== Returns
126
+ #
127
+ # * Task priority.
128
+
129
+ def getPriority
130
+ return @priority
131
+ end
132
+
133
+ # * Set the task completed percent.
134
+ #
135
+ # ==== Parameters
136
+ #
137
+ # * percentComplete:: - Task completed percent.
138
+
139
+ def setPercentComplete(percentComplete)
140
+ @percentComplete = percentComplete
141
+ end
142
+
143
+ # * Get the task completed percent.
144
+ #
145
+ # ==== Returns
146
+ #
147
+ # * Task complete percent.
148
+
149
+ def getPercentComplete
150
+ return @percentComplete
151
+ end
152
+
153
+ # * Set the task start date.
154
+ #
155
+ # ==== Parameters
156
+ #
157
+ # * startDate:: - Start date of the task.
158
+
159
+ def setStartDate(startDate)
160
+ @startDate = startDate
161
+ end
162
+
163
+ # * Get the task start date.
164
+ #
165
+ # ==== Returns
166
+ #
167
+ # * Task start date.
168
+
169
+ def getStartDate
170
+ return startDate
171
+ end
172
+
173
+ # * Set the task start date format.
174
+ #
175
+ # ==== Parameters
176
+ #
177
+ # * startDate:: - Start date format of the task.
178
+
179
+ def setStartDateFormat(startDateFormat)
180
+ @startDateFormat = startDateFormat
181
+ end
182
+
183
+ # * Get the task start date format.
184
+ #
185
+ # ==== Returns
186
+ #
187
+ # * Task start date format.
188
+
189
+ def getStartDateFormat
190
+ return @startDateFormat
191
+ end
192
+
193
+ # * Set the start date long.
194
+ #
195
+ # ==== Parameters
196
+ #
197
+ # * startDateLong:: - Start date long for the task.
198
+
199
+ def setStartDateLong(startDateLong)
200
+ @startDateLong = startDateLong
201
+ end
202
+
203
+ # * Get the start date long.
204
+ #
205
+ # ==== Returns
206
+ #
207
+ # * Task start date long.
208
+
209
+ def getStartDateLong
210
+ return @startDateLong
211
+ end
212
+
213
+ # * Set the task end date.
214
+ #
215
+ # ==== Parameters
216
+ #
217
+ # * endDate:: - End date of the task.
218
+
219
+ def setEndDate(endDate)
220
+ @endDate = endDate
221
+ end
222
+
223
+ # * Get the task end date.
224
+ #
225
+ # ==== Returns
226
+ #
227
+ # * task end date.
228
+
229
+ def getEndDate
230
+ return @endDate
231
+ end
232
+
233
+ # * Set the task end date format.
234
+ #
235
+ # ==== Parameters
236
+ #
237
+ # * endDate:: - End date format of the task.
238
+
239
+ def setEndDateFormat(endDateFormat)
240
+ @endDateFormat = endDateFormat
241
+ end
242
+
243
+ # * Get the task end date format.
244
+ #
245
+ # ==== Returns
246
+ #
247
+ # * Task end date format.
248
+
249
+ def getEndDateFormat
250
+ return @endDateFormat
251
+ end
252
+
253
+ # * Set the end date long.
254
+ #
255
+ # ==== Parameters
256
+ #
257
+ # * endDateLong:: - End date for the task.
258
+
259
+ def setEndDateLong(endDateLong)
260
+ @endDateLong = endDateLong
261
+ end
262
+
263
+ # * Get the end date long.
264
+ #
265
+ # ==== Returns
266
+ #
267
+ # * Task end date long.
268
+
269
+ def getEndDateLong
270
+ return @endDateLong
271
+ end
272
+
273
+ # * Set the task duration.
274
+ #
275
+ # ==== Parameters
276
+ #
277
+ # * duration:: - Duration of the task.
278
+
279
+ def setDuration(duration)
280
+ @duration = duration
281
+ end
282
+
283
+ # * Get the task duration.
284
+ #
285
+ # ==== Returns
286
+ #
287
+ # * Task duration.
288
+
289
+ def getDuration
290
+ return @duration
291
+ end
292
+
293
+ # * Set the task URL.
294
+ #
295
+ # ==== Parameters
296
+ #
297
+ # * url:: - URL for the task.
298
+
299
+ def setURL(url)
300
+ @url = url
301
+ end
302
+
303
+ # * Get the task URL.
304
+ #
305
+ # ==== Returns
306
+ #
307
+ # * Task URL.
308
+
309
+ def getURL
310
+ return @url
311
+ end
312
+
313
+ # * Set the time sheet URL.
314
+ #
315
+ # ==== Parameters
316
+ #
317
+ # * timesheetUrl:: - URL for the time sheet.
318
+
319
+ def setTimesheetURL(timesheetUrl)
320
+ @timesheetUrl = timesheetUrl
321
+ end
322
+
323
+ # * Get the time sheet URL.
324
+ #
325
+ # ==== Returns
326
+ #
327
+ # * Time sheet URL.
328
+
329
+ def getTimesheetURL
330
+ return @timesheetUrl
331
+ end
332
+
333
+ # * Set the owners of the task.
334
+ #
335
+ # ==== Parameters
336
+ #
337
+ # * owners:: - List of Owner object.
338
+
339
+ def setOwners(owners)
340
+ @owners = owners
341
+ end
342
+
343
+ # * Get the owner of the task.
344
+ #
345
+ # ==== Returns
346
+ #
347
+ # * List of Owner object.
348
+
349
+ def getOwners
350
+ return @owners
351
+ end
352
+
353
+ # * Set the comments of the task.
354
+ #
355
+ # ==== Parameters
356
+ #
357
+ # * comments:: - List of Comment object.
358
+
359
+ def setComments(comments)
360
+ @comments = comments
361
+ end
362
+
363
+ # * Get the comments of the task.
364
+ #
365
+ # ==== Returns
366
+ #
367
+ # * List of Comment object.
368
+
369
+ def getComments
370
+ return @comments
371
+ end
372
+
373
+ # * Set the associated document IDs of the task.
374
+ #
375
+ # ==== Parameters
376
+ #
377
+ # * associateDocumentIds:: - Document IDs of the task.
378
+
379
+ def setAssociateDocumentIds(associateDocumentIds)
380
+ @associateDocumentIds = associateDocumentIds
381
+ end
382
+
383
+ # * Get the associated document IDs of the task.
384
+ #
385
+ # ==== Returns
386
+ #
387
+ # * Array of document IDs.
388
+
389
+ def getAssociateDocumentIds
390
+ return @associateDocumentIds
391
+ end
392
+
393
+ # * Set the associated forum IDs.
394
+ #
395
+ # ==== Parameters
396
+ #
397
+ # * associateForumIds:: - Forum IDs of the task.
398
+
399
+ def setAssociateForumIds(associateForumIds)
400
+ @associateForumIds = associateForumIds
401
+ end
402
+
403
+ # * Get the associated forum IDs of the task.
404
+ #
405
+ # ==== Returns
406
+ #
407
+ # * Array of forum IDs.
408
+
409
+ def getAssociateForumIds
410
+ return @associateForumIds
411
+ end
412
+
413
+ # * Set the subtasks of the task.
414
+ #
415
+ # ==== Parameters
416
+ #
417
+ # * tasks:: - List of Task object.
418
+
419
+ def setSubtasks(tasks)
420
+ @tasks = tasks
421
+ end
422
+
423
+ # * Get the subtasks of the task.
424
+ #
425
+ # ==== Returns
426
+ #
427
+ # * List of Task object.
428
+
429
+ def getSubtasks
430
+ return @tasks
431
+ end
432
+
433
+ # * Set the tasklist of the task.
434
+ #
435
+ # ==== Parameters
436
+ #
437
+ # * tasklist:: - Tasklist object.
438
+
439
+ def setTasklist(tasklist)
440
+ @tasklist = tasklist
441
+ end
442
+
443
+ # * Get the tasklist of the task.
444
+ #
445
+ # ==== Returns
446
+ #
447
+ # * Tasklist object.
448
+
449
+ def getTasklist
450
+ return @tasklist
451
+ end
452
+
453
+ # * Convert the Task object into HashMap.
454
+ #
455
+ # ==== Returns
456
+ #
457
+ # * HashMap object.
458
+
459
+ def toParamMAP()
460
+ requestBody = Hash.new
461
+
462
+ if owners != nil
463
+
464
+ personResponsible = "";
465
+
466
+ owners.each do|owner|
467
+ personResponsible += String(owner.getId)+","
468
+ end
469
+
470
+ requestBody["person_responsible"] = personResponsible
471
+
472
+ end
473
+
474
+ if name != nil
475
+ requestBody["name"] = name
476
+ end
477
+ if tasklist != nil
478
+ requestBody["tasklist_id"] = tasklist.getId
479
+ end
480
+ if startDate != nil
481
+ requestBody["start_date"] = startDate
482
+ end
483
+ if endDate != nil
484
+ requestBody["end_date"] = endDate
485
+ end
486
+ if duration != nil
487
+ requestBody["duration"] = duration
488
+ end
489
+ if priority != nil
490
+ requestBody["priority"] = priority
491
+ end
492
+
493
+ return requestBody
494
+ end
495
+ end
496
+ end
497
+ end