zohoProjects 0.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +15 -0
- data/Gemfile +4 -0
- data/Gemfile.lock +17 -0
- data/LICENSE.txt +22 -0
- data/README.md +145 -0
- data/Rakefile +2 -0
- data/lib/projects/api/API.rb +57 -0
- data/lib/projects/api/BugsAPI.rb +135 -0
- data/lib/projects/api/DocumentsAPI.rb +145 -0
- data/lib/projects/api/EventsAPI.rb +115 -0
- data/lib/projects/api/FoldersAPI.rb +111 -0
- data/lib/projects/api/ForumsAPI.rb +198 -0
- data/lib/projects/api/MilestonesAPI.rb +159 -0
- data/lib/projects/api/PortalAPI.rb +41 -0
- data/lib/projects/api/ProjectsAPI.rb +203 -0
- data/lib/projects/api/TasklistsAPI.rb +113 -0
- data/lib/projects/api/TasksAPI.rb +153 -0
- data/lib/projects/api/TimesheetsAPI.rb +240 -0
- data/lib/projects/api/UsersAPI.rb +48 -0
- data/lib/projects/exception/ProjectsException.rb +50 -0
- data/lib/projects/model/Activity.rb +173 -0
- data/lib/projects/model/Bug.rb +701 -0
- data/lib/projects/model/Buglog.rb +56 -0
- data/lib/projects/model/Category.rb +70 -0
- data/lib/projects/model/Comment.rb +289 -0
- data/lib/projects/model/Document.rb +260 -0
- data/lib/projects/model/Event.rb +391 -0
- data/lib/projects/model/Folder.rb +110 -0
- data/lib/projects/model/Forum.rb +320 -0
- data/lib/projects/model/Generallog.rb +36 -0
- data/lib/projects/model/Log.rb +359 -0
- data/lib/projects/model/Milestone.rb +322 -0
- data/lib/projects/model/Owner.rb +54 -0
- data/lib/projects/model/Participant.rb +54 -0
- data/lib/projects/model/Portal.rb +273 -0
- data/lib/projects/model/Project.rb +593 -0
- data/lib/projects/model/Status.rb +168 -0
- data/lib/projects/model/Task.rb +497 -0
- data/lib/projects/model/Tasklist.rb +300 -0
- data/lib/projects/model/Tasklog.rb +56 -0
- data/lib/projects/model/Timelog.rb +134 -0
- data/lib/projects/model/TimelogList.rb +54 -0
- data/lib/projects/model/User.rb +94 -0
- data/lib/projects/model/Version.rb +194 -0
- data/lib/projects/parser/BugParser.rb +208 -0
- data/lib/projects/parser/DocumentParser.rb +197 -0
- data/lib/projects/parser/EventParser.rb +156 -0
- data/lib/projects/parser/FolderParser.rb +99 -0
- data/lib/projects/parser/ForumParser.rb +253 -0
- data/lib/projects/parser/MilestonesParser.rb +129 -0
- data/lib/projects/parser/PortalParser.rb +103 -0
- data/lib/projects/parser/ProjectParser.rb +318 -0
- data/lib/projects/parser/TaskParser.rb +293 -0
- data/lib/projects/parser/TasklistParser.rb +127 -0
- data/lib/projects/parser/TimesheetParser.rb +390 -0
- data/lib/projects/parser/UserParser.rb +63 -0
- data/lib/projects/service/ZohoProject.rb +174 -0
- data/lib/projects/util/ZohoHTTPClient.rb +205 -0
- data/lib/test/ProjectsTest.rb +321 -0
- data/lib/zohoProjects.rb +35 -0
- data/lib/zohoProjects/version.rb +3 -0
- data/zohoProjects.gemspec +86 -0
- metadata +135 -0
@@ -0,0 +1,391 @@
|
|
1
|
+
# $Id$
|
2
|
+
module Projects
|
3
|
+
module Model
|
4
|
+
# * This class is used to make an object for Event.
|
5
|
+
|
6
|
+
class Event
|
7
|
+
|
8
|
+
private
|
9
|
+
attr_accessor :id, :title, :location, :scheduledOn, :scheduledOnLong, :reminder, :repeat, :occurrences, :occurred, :durationHour, :durationMinutes, :isOpen, :participants, :hour, :minutes, :ampm
|
10
|
+
|
11
|
+
public
|
12
|
+
|
13
|
+
# * Set the event id.
|
14
|
+
#
|
15
|
+
# ==== Parameters
|
16
|
+
#
|
17
|
+
# * id:: - ID of the event.
|
18
|
+
|
19
|
+
def setId(id)
|
20
|
+
@id = id
|
21
|
+
end
|
22
|
+
|
23
|
+
# * Get the event id.
|
24
|
+
#
|
25
|
+
# ==== Returns
|
26
|
+
#
|
27
|
+
# * Event id.
|
28
|
+
|
29
|
+
def getId
|
30
|
+
return @id
|
31
|
+
end
|
32
|
+
|
33
|
+
# * Set the event title.
|
34
|
+
#
|
35
|
+
# ==== Parameters
|
36
|
+
#
|
37
|
+
# * title:: - Title of the event.
|
38
|
+
|
39
|
+
def setTitle(title)
|
40
|
+
@title = title
|
41
|
+
end
|
42
|
+
|
43
|
+
# * Get the event title.
|
44
|
+
#
|
45
|
+
# ==== Returns
|
46
|
+
#
|
47
|
+
# * Event title.
|
48
|
+
|
49
|
+
def getTilte
|
50
|
+
return @title
|
51
|
+
end
|
52
|
+
|
53
|
+
# * Set the event location.
|
54
|
+
#
|
55
|
+
# ==== Parameters
|
56
|
+
#
|
57
|
+
# * location:: - Location of the event.
|
58
|
+
|
59
|
+
def setLocation(location)
|
60
|
+
@location = location
|
61
|
+
end
|
62
|
+
|
63
|
+
# * Get the event location.
|
64
|
+
#
|
65
|
+
# ==== Returns
|
66
|
+
#
|
67
|
+
# * Event location.
|
68
|
+
|
69
|
+
def getLocation
|
70
|
+
return @location
|
71
|
+
end
|
72
|
+
|
73
|
+
# * Set the event scheduled on.
|
74
|
+
#
|
75
|
+
# ==== Parameters
|
76
|
+
#
|
77
|
+
# * scheduledOn:: - Scheduled time of the event.
|
78
|
+
|
79
|
+
def setScheduledOn(scheduledOn)
|
80
|
+
@scheduledOn = scheduledOn
|
81
|
+
end
|
82
|
+
|
83
|
+
# * Get the event scheduled on.
|
84
|
+
#
|
85
|
+
# ==== Returns
|
86
|
+
#
|
87
|
+
# * Event scheduled time.
|
88
|
+
|
89
|
+
def getScheduledOn
|
90
|
+
return @scheduledOn
|
91
|
+
end
|
92
|
+
|
93
|
+
# * Set the event scheduled on long.
|
94
|
+
#
|
95
|
+
# ==== Parameters
|
96
|
+
#
|
97
|
+
# * scheduledOnLong:: - Event scheduled on long.
|
98
|
+
|
99
|
+
def setScheduledOnLong(scheduledOnLong)
|
100
|
+
@scheduledOnLong = scheduledOnLong
|
101
|
+
end
|
102
|
+
|
103
|
+
# * Get the event scheduled on long.
|
104
|
+
#
|
105
|
+
# ==== Returns
|
106
|
+
#
|
107
|
+
# * Event scheduled on long.
|
108
|
+
|
109
|
+
def getScheduledOnLong
|
110
|
+
return @scheduledOnLong
|
111
|
+
end
|
112
|
+
|
113
|
+
# * Set the reminder for the event.
|
114
|
+
#
|
115
|
+
# ==== Parameters
|
116
|
+
#
|
117
|
+
# * reminder:: - Reminder for the event.
|
118
|
+
|
119
|
+
def setReminder(reminder)
|
120
|
+
@reminder = reminder
|
121
|
+
end
|
122
|
+
|
123
|
+
# * Get the reminder for the event.
|
124
|
+
#
|
125
|
+
# ==== Returns
|
126
|
+
#
|
127
|
+
# * event reminder.
|
128
|
+
|
129
|
+
def getReminder
|
130
|
+
return @reminder
|
131
|
+
end
|
132
|
+
|
133
|
+
# * Set the reminder repeat for the event.
|
134
|
+
#
|
135
|
+
# ==== Parameters
|
136
|
+
#
|
137
|
+
# * repeat:: - Repeat reminder for the event.
|
138
|
+
|
139
|
+
def setRepeat(repeat)
|
140
|
+
@repeat = repeat
|
141
|
+
end
|
142
|
+
|
143
|
+
# * Get the reminder repeat for the event.
|
144
|
+
#
|
145
|
+
# ==== Returns
|
146
|
+
#
|
147
|
+
# * event reminder repeat.
|
148
|
+
|
149
|
+
def getRepeat
|
150
|
+
return @repeat
|
151
|
+
end
|
152
|
+
|
153
|
+
# * Set the occurrences for the reminder.
|
154
|
+
#
|
155
|
+
# ==== Parameters
|
156
|
+
#
|
157
|
+
# * occurrences:: - Numnber of occurrences for the reminder.
|
158
|
+
|
159
|
+
def setOccurrences(occurrences)
|
160
|
+
@occurrences = occurrences
|
161
|
+
end
|
162
|
+
|
163
|
+
# * Get the occurrences for the reminder.
|
164
|
+
#
|
165
|
+
# ==== Returns
|
166
|
+
#
|
167
|
+
# * Number of occurences of the reminder.
|
168
|
+
|
169
|
+
def getOccurrences
|
170
|
+
return @occurrences
|
171
|
+
end
|
172
|
+
|
173
|
+
# * Set no of times occurred for the reminder.
|
174
|
+
#
|
175
|
+
# ==== Parameters
|
176
|
+
#
|
177
|
+
# * occurred:: - Number of times reminder has occurred.
|
178
|
+
|
179
|
+
def setOccurred(occurred)
|
180
|
+
@occurred = occurred
|
181
|
+
end
|
182
|
+
|
183
|
+
# * Get no of times occurred for the reminder.
|
184
|
+
#
|
185
|
+
# ==== Returns
|
186
|
+
#
|
187
|
+
# * No of times the reminder has occurred.
|
188
|
+
|
189
|
+
def getOccurred
|
190
|
+
return @occurred
|
191
|
+
end
|
192
|
+
|
193
|
+
# * Set the duration hour.
|
194
|
+
#
|
195
|
+
# ==== Parameters
|
196
|
+
#
|
197
|
+
# * durationHour:: - Duration of the event in hours.
|
198
|
+
|
199
|
+
def setDurationHours(durationHour)
|
200
|
+
@durationHour = durationHour
|
201
|
+
end
|
202
|
+
|
203
|
+
# * Get the duration hour for the event.
|
204
|
+
#
|
205
|
+
# ==== Returns
|
206
|
+
#
|
207
|
+
# * Event duration in hours.
|
208
|
+
|
209
|
+
def getDurationHours
|
210
|
+
return @durationHour
|
211
|
+
end
|
212
|
+
|
213
|
+
# * Set the duration minutes for the event.
|
214
|
+
#
|
215
|
+
# ==== Parameters
|
216
|
+
#
|
217
|
+
# * durationMinutes:: - Duration of the event in minutes.
|
218
|
+
|
219
|
+
def setDurationMinutes(durationMinutes)
|
220
|
+
@durationMinutes = durationMinutes
|
221
|
+
end
|
222
|
+
|
223
|
+
# * Get the duration minutes for the event.
|
224
|
+
#
|
225
|
+
# ==== Returns
|
226
|
+
#
|
227
|
+
# * Event duration in minutes.
|
228
|
+
|
229
|
+
def getDurationMinutes
|
230
|
+
return @durationMinutes
|
231
|
+
end
|
232
|
+
|
233
|
+
# * Set the event is open or not.
|
234
|
+
#
|
235
|
+
# ==== Parameters
|
236
|
+
#
|
237
|
+
# * isOpen:: - The event is open or not.
|
238
|
+
|
239
|
+
def setIsOpen(isOpen)
|
240
|
+
@isOpen = isOpen
|
241
|
+
end
|
242
|
+
|
243
|
+
# * Get the event is open or not.
|
244
|
+
#
|
245
|
+
# ==== Returns
|
246
|
+
#
|
247
|
+
# * true, if the event is open else false.
|
248
|
+
|
249
|
+
def isOpen
|
250
|
+
return @isOpen
|
251
|
+
end
|
252
|
+
|
253
|
+
# * Set the participants.
|
254
|
+
#
|
255
|
+
# ==== Parameters
|
256
|
+
#
|
257
|
+
# * participants:: - List of Participant object.
|
258
|
+
|
259
|
+
def setParticipants(participants)
|
260
|
+
@participants = participants
|
261
|
+
end
|
262
|
+
|
263
|
+
# * Get the participants.
|
264
|
+
#
|
265
|
+
# ==== Returns
|
266
|
+
#
|
267
|
+
# * List of Participant object.
|
268
|
+
|
269
|
+
def getParticipants
|
270
|
+
return @participants
|
271
|
+
end
|
272
|
+
|
273
|
+
# * Set the hour for the event.
|
274
|
+
#
|
275
|
+
# ==== Parameters
|
276
|
+
#
|
277
|
+
# * hour:: - Hour for the event.
|
278
|
+
|
279
|
+
def setHour(hour)
|
280
|
+
@hour = hour
|
281
|
+
end
|
282
|
+
|
283
|
+
# * Get the hour for the event.
|
284
|
+
#
|
285
|
+
# ==== Returns
|
286
|
+
#
|
287
|
+
# * Event hour.
|
288
|
+
|
289
|
+
def getHour
|
290
|
+
return @hour
|
291
|
+
end
|
292
|
+
|
293
|
+
# * Set the minutes for the event.
|
294
|
+
#
|
295
|
+
# ==== Parameters
|
296
|
+
#
|
297
|
+
# * minutes:: - Minutes for the event.
|
298
|
+
|
299
|
+
def setMinutes(minutes)
|
300
|
+
@minutes = minutes
|
301
|
+
end
|
302
|
+
|
303
|
+
# * Get the minutes for the event.
|
304
|
+
#
|
305
|
+
# ==== Returns
|
306
|
+
#
|
307
|
+
# * Minutes for the event.
|
308
|
+
|
309
|
+
def getMinutes
|
310
|
+
return @minutes
|
311
|
+
end
|
312
|
+
|
313
|
+
# * Set AM or PM for the event.
|
314
|
+
#
|
315
|
+
# ==== Parameters
|
316
|
+
#
|
317
|
+
# * ampm:: - Event scheduled on AM or PM.
|
318
|
+
|
319
|
+
def setAMPM(ampm)
|
320
|
+
@ampm = ampm
|
321
|
+
end
|
322
|
+
|
323
|
+
# * Get AM or PM for the event.
|
324
|
+
#
|
325
|
+
# ==== Returns
|
326
|
+
#
|
327
|
+
# * Time format of the event in AM or PM.
|
328
|
+
|
329
|
+
def getAMPM
|
330
|
+
return @ampm
|
331
|
+
end
|
332
|
+
|
333
|
+
# * Convert the Event object into HashMap.
|
334
|
+
#
|
335
|
+
# ==== Returns
|
336
|
+
#
|
337
|
+
# * HashMap object.
|
338
|
+
|
339
|
+
def toParamMAP
|
340
|
+
requestBody = Hash.new
|
341
|
+
|
342
|
+
if title != nil
|
343
|
+
requestBody["title"] = title
|
344
|
+
end
|
345
|
+
if scheduledOn != nil
|
346
|
+
requestBody["date"] = scheduledOn
|
347
|
+
end
|
348
|
+
if hour != nil
|
349
|
+
requestBody["hour"] = hour
|
350
|
+
end
|
351
|
+
if minutes != nil
|
352
|
+
requestBody["minutes"] = minutes
|
353
|
+
end
|
354
|
+
if ampm != nil
|
355
|
+
requestBody["ampm"] = ampm
|
356
|
+
end
|
357
|
+
if durationHour != nil
|
358
|
+
requestBody["duration_hour"] = durationHour
|
359
|
+
end
|
360
|
+
if durationMinutes != nil
|
361
|
+
requestBody["duration_mins"] = durationMinutes
|
362
|
+
end
|
363
|
+
|
364
|
+
if participants != nil
|
365
|
+
participantIds = ""
|
366
|
+
|
367
|
+
participants.each do|participant|
|
368
|
+
participantIds += String(participant.getParticipantId)+",";
|
369
|
+
end
|
370
|
+
|
371
|
+
requestBody["participants"] = participantIds
|
372
|
+
end
|
373
|
+
|
374
|
+
if reminder != nil
|
375
|
+
requestBody["remind_before"] = reminder
|
376
|
+
end
|
377
|
+
if repeat != nil
|
378
|
+
requestBody["repeat"] = repeat
|
379
|
+
end
|
380
|
+
if occurrences != nil && occurrences.to_i > 1
|
381
|
+
requestBody["nooftimes_repeat"] = occurrences
|
382
|
+
end
|
383
|
+
if location != nil
|
384
|
+
requestBody["location"] = location
|
385
|
+
end
|
386
|
+
|
387
|
+
return requestBody
|
388
|
+
end
|
389
|
+
end
|
390
|
+
end
|
391
|
+
end
|
@@ -0,0 +1,110 @@
|
|
1
|
+
# $Id$
|
2
|
+
module Projects
|
3
|
+
module Model
|
4
|
+
# * This class is used to make an object for Folder.
|
5
|
+
|
6
|
+
class Folder
|
7
|
+
|
8
|
+
private
|
9
|
+
attr_accessor :id, :name, :isDiscussion, :url
|
10
|
+
|
11
|
+
public
|
12
|
+
|
13
|
+
# * Set the folder id.
|
14
|
+
#
|
15
|
+
# ==== Parameters
|
16
|
+
#
|
17
|
+
# * id:: - ID of the folder.
|
18
|
+
|
19
|
+
def setId(id)
|
20
|
+
@id = id
|
21
|
+
end
|
22
|
+
|
23
|
+
# * Get the folder id.
|
24
|
+
#
|
25
|
+
# ==== Returns
|
26
|
+
#
|
27
|
+
# * Folder id.
|
28
|
+
|
29
|
+
def getId
|
30
|
+
return @id
|
31
|
+
end
|
32
|
+
|
33
|
+
# * Set the folder name.
|
34
|
+
#
|
35
|
+
# ==== Parameters
|
36
|
+
#
|
37
|
+
# * name:: - Name of the folder.
|
38
|
+
|
39
|
+
def setName(name)
|
40
|
+
@name = name
|
41
|
+
end
|
42
|
+
|
43
|
+
# * Get the folder name.
|
44
|
+
#
|
45
|
+
# ==== Returns
|
46
|
+
#
|
47
|
+
# * Folder name.
|
48
|
+
|
49
|
+
def getName
|
50
|
+
return @name
|
51
|
+
end
|
52
|
+
|
53
|
+
# * Set the folder is in discussion or not.
|
54
|
+
#
|
55
|
+
# ==== Parameters
|
56
|
+
#
|
57
|
+
# * isDiscussion:: - Is the folder is in discussion or not.
|
58
|
+
|
59
|
+
def setIsDicussion(isDiscussion)
|
60
|
+
@isDiscussion = isDiscussion
|
61
|
+
end
|
62
|
+
|
63
|
+
# * Get the folder is in discussion or not.
|
64
|
+
#
|
65
|
+
# ==== Returns
|
66
|
+
#
|
67
|
+
# * true, if thew folder is in discussion else false.
|
68
|
+
|
69
|
+
def isDiscussion
|
70
|
+
return @isDiscussion
|
71
|
+
end
|
72
|
+
|
73
|
+
# * Set the folder URL.
|
74
|
+
#
|
75
|
+
# ==== Parameters
|
76
|
+
#
|
77
|
+
# * url:: - URL for the folder.
|
78
|
+
|
79
|
+
def setURL(url)
|
80
|
+
@url = url
|
81
|
+
end
|
82
|
+
|
83
|
+
# * Get the folder URL.
|
84
|
+
#
|
85
|
+
# ==== Returns
|
86
|
+
#
|
87
|
+
# * Folder URL.
|
88
|
+
|
89
|
+
def getURL
|
90
|
+
return @url
|
91
|
+
end
|
92
|
+
|
93
|
+
# * Convert the Folder object into HashMap.
|
94
|
+
#
|
95
|
+
# ==== Returns
|
96
|
+
#
|
97
|
+
# * HashMap object.
|
98
|
+
|
99
|
+
def toParamMAP
|
100
|
+
requestBody = Hash.new
|
101
|
+
|
102
|
+
if name != nil
|
103
|
+
requestBody["name"] = name
|
104
|
+
end
|
105
|
+
|
106
|
+
return requestBody
|
107
|
+
end
|
108
|
+
end
|
109
|
+
end
|
110
|
+
end
|