zohoProjects 0.0.5 → 0.0.6

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -1,141 +1,175 @@
1
- # ZohoProjects
1
+ # ZohoProjects Ruby Client Library
2
2
 
3
- The ruby library for integrating with ZohoProjects.
3
+
4
+ The Ruby library for integrating with the Zoho Projects API. Use this object-based Ruby wrapper to easily integrate Zoho Projects modules like portals, projects, milestones, tasklists, events etc. into your application.
4
5
 
5
6
  ## Installation
6
7
 
7
- Add this line to your application's Gemfile:
8
8
 
9
- gem 'zohoProjects'
9
+ There are a couple of ways of installing ZohoProjects:
10
+
11
+ Install 1:
12
+
13
+ Start by adding this line to your application's Gemfile:
10
14
 
11
- And then execute:
15
+ gem 'zohoProjects'
12
16
 
13
- $ bundle
17
+ And follow it with executing this command:
18
+
19
+ $ bundle
14
20
 
15
- Or install it yourself as:
21
+ Install 2:
16
22
 
17
- $ gem install zohoProjects
23
+ To fully install the Projects wrapper yourself, just execute this command:
24
+
25
+ $ gem install zohoProjects
18
26
 
19
27
  ## Documentation
20
28
 
21
- [API Documentation](http://cms.zohocorp.com/export/zoho/projects/help/rest-api/portals-api.html)
29
+
30
+ [API Reference](https://www.zoho.com/projects/help/rest-api/zohoprojectsapi.html)
22
31
 
23
32
  ## Usage
24
33
 
25
- If you want to use all our zoho projects services API you should have a valid Zoho username, password and a valid authtoken.
26
34
 
27
- How to generate your authtoken? [Refer Here](http://cms.zohocorp.com/export/zoho/projects/help/rest-api/get-tickets-api.html)
35
+ In order to access the Zoho Projects APIs, users need to have a valid Zoho account and a valid Auth Token.
28
36
 
29
- If you have a valid authtoken, you are able to access our Zoho projects API wrappers.
37
+ ### Sign up for a Zoho Account:
30
38
 
31
- How to access our wrapper classes? Here is a sample example code for accessing Zoho Projects.
39
+ - - -
32
40
 
33
- You have to add our gem file:
41
+ For setting up a Zoho account, access the Zoho Projects [Sign Up](https://www.zoho.com/projects/zp-signup.html) page and enter the requisite details - email address and password.
34
42
 
35
- require "zohoProjects"
43
+ ### Generate Auth Token:
36
44
 
37
- Pass your authToken to create an instance for PortalsAPI.
45
+ - - -
46
+
47
+ To generate the Auth Token, you need to send an authentication request to Zoho Accounts in a prescribed URL format. [Refer here](https://www.zoho.com/projects/help/rest-api/get-tickets-api.html)
38
48
 
39
- You have two ways to create an instance for PortalsAPI. Here is the example code,
40
49
 
41
- 1) Pass your authToken and create a PortalsAPI instance:
50
+ ## Ruby Wrappers - Sample
42
51
 
43
- portalsAPI = PortalsAPI.new("{auth_token}")
44
-
45
- 2) Pass your authToken and portalId to create an instance for ZohoProjects and then get the instance for PortalsAPI:
52
+ ### How to access the Zoho Projects APIs through Ruby wrapper classes?
46
53
 
47
- zohoProject = ZohoProject.new("{auth_token}", "{portal_id}")
48
-
49
- portalsAPI = zohoProject.getPortalsAPI
50
-
54
+ - - -
55
+
56
+ To access the Projects APIs, add this gem file in your application:
57
+
58
+ require "zohoProjects"
51
59
 
52
- queryMap = Hash.new
53
-
54
- queryMap["status"] = "open"
55
-
56
- begin
57
-
58
- ## Get the list of portals:
60
+ ### Create PortalsAPI instance:
59
61
 
60
62
  - - -
61
-
62
- If you want to get all your portals, you need to call the 'getPortals' method. It returns the List of Portal object.
63
63
 
64
- portals = portalsAPI.getPortals
65
-
66
- If you want to parse the portal id from the List of Portal object then you need to write your code as mentioned below:
64
+ Now there are two ways of creating an instance of PortalsAPI.
67
65
 
68
- portalId = portals[0].getId
69
-
70
- ## Get the list of projects:
66
+ Pass the AuthToken and create a PortalsAPI instance.
71
67
 
72
- - - -
68
+ Sample code:
73
69
 
74
- If you want to get all the projects from the portal, you need to call the 'getProjects' method by passing query string parameters.
70
+ portalsAPI = PortalsAPI.new("{auth_token}")
75
71
 
76
- projects = projectsAPI.getProjects(queryMap)
77
-
78
- If you want to parse the project id from the List of Project object then you need to write your code as mentioned below:
72
+ Pass the AuthToken and PortalId to first create an instance of ZohoProjects, and then proceed to get the instance of PortalsAPI.
79
73
 
80
- projectId = String(projects[0].getId)
81
-
82
- ## Get the details of a project:
74
+ Sample code:
75
+
76
+ zohoProject = ZohoProject.new("{auth_token}", "{portal_id}")
77
+
78
+ portalsAPI = zohoProject.getPortalsAPI
79
+
80
+
81
+ queryMap = Hash.new
82
+
83
+ queryMap["status"] = "open"
84
+
85
+ begin
86
+
87
+
88
+ ### List all Portals:
83
89
 
84
90
  - - -
85
91
 
86
- If you want to get the details of project, you need to call the 'get' method by passing projectId.
92
+ If you wish to get the list of all your Zoho Projects portals, you need to call the `getPortals()` method by passing query string parameters in the format below:
93
+
94
+ portals = portalsAPI.getPortals
95
+
96
+ It returns the List of Portal object as a response.
87
97
 
88
- get = projectsAPI.get(projectId)
89
-
90
- ## Create a new project:
98
+ Similarly, if you wish to parse the portal id from the List of Portal objects, you need to send a request in the prescribed format below:
99
+
100
+ portalId = portals.get[0].getId
101
+
102
+ ### List all Projects:
91
103
 
92
104
  - - -
93
105
 
94
- If you want to create a new project for the portal, you need to call the 'create' method by passing the Project object.
106
+ If you wish to get the list of all projects from the portal, you need to call the `getProjects()` method by passing query string parameters in the format below:
95
107
 
96
- project = Project.new
97
-
98
- project.setName("Test")
99
- project.setDescription("Test project")
108
+ projects = projectsAPI.getProjects(queryMap)
109
+
110
+ It returns the List of Project object as a response.
111
+
112
+ Similarly, if you wish to parse the project id from the List of Portal objects, you need to send a request in the format below:
100
113
 
101
- create = projectsAPI.create(project)
102
-
103
- ## Update the details of a project:
114
+ projectId = String.valueOf(projects[0].getId)
115
+
116
+ ### Get Project details:
104
117
 
105
118
  - - -
119
+
120
+ In order to get the details of a project, you need to call the `get()` method by passing a projectId.
121
+
122
+ get = projectsAPI.get(projectId)
123
+
124
+ ### Create a new Project:
106
125
 
107
- If you want to update the project details of a portal, you need to fetch the project details by calling the 'get' method.
126
+ - - -
127
+
128
+ To create a new project for the specific portal, you need to call the `create()` method by passing the Project object.
108
129
 
109
- If you want update the name of the project then you need to write your code as mentioned below:
130
+ project = Project.new
131
+
132
+ project.setName("Test")
133
+ project.setDescription("Test project")
134
+
135
+ create = projectsAPI.create(project)
110
136
 
111
- get = projectsAPI.get(projectId)
112
-
113
- get.setName("API")
137
+ ### Update Project details:
114
138
 
115
- update = projectsAPI.update(get)
116
-
117
-
118
- ## Delete an existing project:
139
+ - - -
140
+
141
+ To update the project details of a particular portal, you need to first fetch the project info. This can be achieved by calling the `get()` method. You can then proceed to update the name of the project (for example) with the help of a sample code below:
142
+
143
+ get = projectsAPI.get(projectId)
144
+
145
+ get.setName("API")
146
+
147
+ update = projectsAPI.update(get)
148
+
149
+ ### Delete a Project:
119
150
 
120
151
  - - -
152
+
153
+ To delete an existing project of a particular portal, you need to call the `delete()` method and pass the projectid.
121
154
 
122
- If you want to delete an existing project for the portal, you need to call the `delete()` method by passing projectId.
155
+ delete = projectsAPI.delete(projectId)
156
+
157
+
123
158
 
124
- delete = projectsAPI.delete(projectId)
125
-
126
-
127
- ## Catch the exception:
159
+ ### Catch Exceptions:
128
160
 
129
161
  - - -
130
162
 
131
- When calling Zoho Projects API wrappers if there is any error then the respective class throws the ProjectsException. You need to catch the ProjectsException as mentioned below:
132
-
133
- rescue ProjectsException => pe
134
- puts "Code: " + String(pe.getCode)
135
- puts "Message: " + pe.getMessage
136
- end
137
-
138
- See [Here](../../tree/master/test) for full examples.
163
+ If there is any error encountered while calling the Ruby Wrappers of Zoho Projects API, the respective class will throw the ProjectsException. Use the below mentioned code to catch the ProjectsException:
164
+
165
+ rescue ProjectsException => pe
166
+ puts "Code: " + String(pe.getCode)
167
+ puts "Message: " + pe.getMessage
168
+ end
169
+
170
+
171
+ For a full set of examples, click [here](../../tree/master/test).
172
+
139
173
  ## Contributing
140
174
 
141
175
  1. Fork it
@@ -5,8 +5,8 @@ module Projects
5
5
 
6
6
  class Project
7
7
  private
8
- attr_accessor :id, :name, :status, :createdDate, :createdDateFormat, :createdDateLong, :description, :ownerName, :ownerId, :openTaskCount, :closedTaskCount, :openMilestoneCount, :closedMilestoneCount, :openBugCount, :closedBugCount, :URL, :activityURL, :milestoneURL, :tasklistURL, :taskURL, :bugURL, :timesheetURL, :statusURL, :eventURL, :documentURL, :folderURL, :forumURL, :userURL
9
-
8
+ attr_accessor :id, :name, :templateId, :status, :createdDate, :createdDateFormat, :createdDateLong, :description, :ownerName, :ownerId, :openTaskCount, :closedTaskCount, :openMilestoneCount, :closedMilestoneCount, :openBugCount, :closedBugCount, :URL, :activityURL, :milestoneURL, :tasklistURL, :taskURL, :bugURL, :timesheetURL, :statusURL, :eventURL, :documentURL, :folderURL, :forumURL, :userURL;
9
+
10
10
  public
11
11
 
12
12
  # * Set the project id.
@@ -48,6 +48,30 @@ module Projects
48
48
  def getName
49
49
  return @name
50
50
  end
51
+
52
+ # * Set the template id of the project.
53
+ #
54
+ # ==== Parameters
55
+ #
56
+ # * templateId:: - ID of the template.
57
+
58
+ def setTemplateId(templateId)
59
+
60
+ @templateId = templateId
61
+
62
+ end
63
+
64
+ # * Get the template id of the project.
65
+ #
66
+ # ==== Returns
67
+ #
68
+ # * Returns the template id.
69
+
70
+ def getTemplateId
71
+
72
+ return @templateId
73
+
74
+ end
51
75
 
52
76
  # * Set the status of the project.
53
77
  #
@@ -586,8 +610,11 @@ module Projects
586
610
  if status != nil
587
611
  requestBody["status"] = status
588
612
  end
613
+ if templateId != nil
614
+ requestBody["template_id"] = templateId
615
+ end
589
616
  return requestBody
590
617
  end
591
618
  end
592
619
  end
593
- end
620
+ end
@@ -77,7 +77,7 @@ module Projects
77
77
  header["Accept"] = "application/json"
78
78
  header["Content-Type"] = "application/x-www-form-urlencoded"
79
79
  header["Accept-Charset"] = "UTF-8"
80
- header["User-Agent"] = "ZohoProjects-Ruby-Wrappers/0.0.4"
80
+ header["User-Agent"] = "ZohoProjects-Ruby-Wrappers/0.0.6"
81
81
  return header
82
82
  end
83
83
 
@@ -202,4 +202,4 @@ module Projects
202
202
  end
203
203
  end
204
204
  end
205
- end
205
+ end
@@ -1,3 +1,3 @@
1
1
  module ZohoProjects
2
- VERSION = "0.0.5"
2
+ VERSION = "0.0.6"
3
3
  end
data/zohoProjects.gemspec CHANGED
@@ -7,9 +7,9 @@ Gem::Specification.new do |spec|
7
7
  spec.name = "zohoProjects"
8
8
  spec.version = ZohoProjects::VERSION
9
9
  spec.authors = ["Zoho Corp."]
10
- spec.email = ["arivezhilmarban@gmail.com"]
10
+ spec.email = ["sahaya.ramesh@zohocorp.com"]
11
11
  spec.summary = %q{Wrapper for Zoho Projects.}
12
- spec.description = %q{Zoho Projects API lets, users/developers extend their web applications to push or pull data into or from Zoho Projects for application mashups. - See more at: http://cms.zohocorp.com/export/zoho/projects/help/rest-api/zohoprojectsapi.html}
12
+ spec.description = %q{Zoho Projects API lets, users/developers extend their web applications to push or pull data into or from Zoho Projects for application mashups. - See more at: https://www.zoho.com/projects/help/rest-api/zohoprojectsapi.html}
13
13
  spec.homepage = ""
14
14
  spec.license = "MIT"
15
15
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: zohoProjects
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-10-27 00:00:00.000000000 Z
12
+ date: 2014-10-29 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler
16
- requirement: &18198300 !ruby/object:Gem::Requirement
16
+ requirement: &20700380 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ~>
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '1.6'
22
22
  type: :development
23
23
  prerelease: false
24
- version_requirements: *18198300
24
+ version_requirements: *20700380
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: rake
27
- requirement: &18196400 !ruby/object:Gem::Requirement
27
+ requirement: &20699040 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,12 +32,12 @@ dependencies:
32
32
  version: '0'
33
33
  type: :development
34
34
  prerelease: false
35
- version_requirements: *18196400
35
+ version_requirements: *20699040
36
36
  description: ! 'Zoho Projects API lets, users/developers extend their web applications
37
37
  to push or pull data into or from Zoho Projects for application mashups. - See more
38
- at: http://cms.zohocorp.com/export/zoho/projects/help/rest-api/zohoprojectsapi.html'
38
+ at: https://www.zoho.com/projects/help/rest-api/zohoprojectsapi.html'
39
39
  email:
40
- - arivezhilmarban@gmail.com
40
+ - sahaya.ramesh@zohocorp.com
41
41
  executables: []
42
42
  extensions: []
43
43
  extra_rdoc_files: []