kuali-rice 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/kuali-rice.gemspec +2 -2
- data/lib/kuali-rice.rb +4 -2
- data/lib/kuali-rice/KualiRESTInterface/DocumentActions.rb +22 -22
- data/lib/kuali-rice/KualiRESTInterface/PersonInterface.rb +4 -4
- data/lib/kuali-rice/KualiRESTInterface/RestAPI.rb +4 -3
- data/test/test_kuali-rice.rb +1 -0
- data/test/test_person_interface.rb +1 -0
- metadata +4 -4
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.1
|
data/kuali-rice.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{kuali-rice}
|
8
|
-
s.version = "0.1.
|
8
|
+
s.version = "0.1.1"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Shawn Bower"]
|
12
|
-
s.date = %q{
|
12
|
+
s.date = %q{2011-02-01}
|
13
13
|
s.description = %q{This gem is used to interface with a RICE install via REST services}
|
14
14
|
s.email = %q{shawn.bower@gmail.com}
|
15
15
|
s.extra_rdoc_files = [
|
data/lib/kuali-rice.rb
CHANGED
@@ -13,16 +13,18 @@ end
|
|
13
13
|
|
14
14
|
module KualiRice
|
15
15
|
|
16
|
-
REMOTING_PATH = "/kr-dev/remoting"
|
17
|
-
|
18
16
|
attr_accessor :server
|
19
17
|
attr_accessor :use_ssl
|
20
18
|
attr_accessor :port
|
19
|
+
attr_accessor :remoting_path
|
20
|
+
attr_accessor :headers
|
21
21
|
|
22
22
|
def initialize(server = "localhost")
|
23
23
|
@server = server
|
24
24
|
@use_ssl = false
|
25
25
|
@port = "8080"
|
26
|
+
@remoting_path = "/kr-dev/remoting"
|
27
|
+
@headers = ""
|
26
28
|
end
|
27
29
|
|
28
30
|
end
|
@@ -4,75 +4,75 @@ module KualiRice
|
|
4
4
|
include KualiRice
|
5
5
|
|
6
6
|
def ping
|
7
|
-
rest_call("/
|
7
|
+
rest_call("/ping")
|
8
8
|
end
|
9
9
|
|
10
10
|
def getDocument(docid, userid)
|
11
|
-
DocumentResponse.new(rest_call("/
|
11
|
+
DocumentResponse.new(rest_call("/doc/getdocument/userID/#{userid}/docid/#{docid}"))
|
12
12
|
end
|
13
13
|
|
14
14
|
def create(initiatorId, appDocId, docType, docTitle)
|
15
|
-
DocumentResponse.new(rest_call("/
|
15
|
+
DocumentResponse.new(rest_call("/doc/create/initiatorID/#{initiatorId}/appid/#{appDocId}/type/#{docType}/title/#{docTitle}", :post))
|
16
16
|
end
|
17
17
|
|
18
18
|
def save(docid, userID, docTitle, annotation)
|
19
|
-
StandardResponse.new(rest_call("/
|
19
|
+
StandardResponse.new(rest_call("/doc/save/userID/#{userID}/docid/#{docid}/title/#{docTitle}/annotation/#{annotation}", :post))
|
20
20
|
end
|
21
21
|
|
22
22
|
def acknowledge(docid, userID, annotation)
|
23
|
-
StandardResponse.new(rest_call("/
|
23
|
+
StandardResponse.new(rest_call("/doc/acknowledge/userID/#{userID}/docid/#{docid}/annotation/#{annotation}", :post))
|
24
24
|
end
|
25
25
|
|
26
26
|
def approve(docid, userID, docTitle, annotation)
|
27
|
-
StandardResponse.new(rest_call("/
|
27
|
+
StandardResponse.new(rest_call("/doc/approve/userID/#{userID}/docid/#{docid}/title/#{docTitle}/annotation/#{annotation}", :post))
|
28
28
|
end
|
29
29
|
|
30
30
|
def blanketApprove(docid, userID, docTitle, annotation)
|
31
|
-
StandardResponse.new(rest_call("/
|
31
|
+
StandardResponse.new(rest_call("/doc/blanketApprove/userID/#{userID}/docid/#{docid}/title/#{docTitle}/annotation/#{annotation}", :post))
|
32
32
|
end
|
33
33
|
|
34
34
|
def cancel(docid, userID, annotation)
|
35
|
-
StandardResponse.new(rest_call("/
|
35
|
+
StandardResponse.new(rest_call("/doc/cancel/userID/#{userID}/docid/#{docid}/annotation/#{annotation}", :post))
|
36
36
|
end
|
37
37
|
|
38
38
|
def disapprove(docid, userID, annotation)
|
39
|
-
StandardResponse.new(rest_call("/
|
39
|
+
StandardResponse.new(rest_call("/doc/disapprove/userID/#{userID}/docid/#{docid}/annotation/#{annotation}", :post))
|
40
40
|
end
|
41
41
|
|
42
42
|
def fyi(docid, userID)
|
43
|
-
StandardResponse.new(rest_call("/
|
43
|
+
StandardResponse.new(rest_call("/doc/fyi/userID/#{userID}/docid/#{docid}", :post))
|
44
44
|
end
|
45
45
|
|
46
46
|
def route(docid, userID, docTitle, annotation)
|
47
|
-
StandardResponse.new(rest_call("/
|
47
|
+
StandardResponse.new(rest_call("/doc/route/userID/#{userID}/docid/#{docid}/title/#{docTitle}/annotation/#{annotation}", :post))
|
48
48
|
end
|
49
49
|
|
50
50
|
def requestAdHocAckToGroup(docid, userID, recipientGroupId, annotation)
|
51
|
-
StandardResponse.new(rest_call("/
|
51
|
+
StandardResponse.new(rest_call("/doc/requestAdHocAckToGroup/userID/#{userID}/docid/#{docid}/recipientgroupid/#{recipientGroupId}/annotation/#{annotation}", :post))
|
52
52
|
end
|
53
53
|
|
54
54
|
def requestAdHocAckToUser(docid, userID, recipientId, annotation)
|
55
|
-
StandardResponse.new(rest_call("/
|
55
|
+
StandardResponse.new(rest_call("/doc/requestAdHocAckToUser/userID/#{userID}/docid/#{docid}/recipientid/#{recipientId}/annotation/#{annotation}", :post))
|
56
56
|
end
|
57
57
|
|
58
58
|
def requestAdHocApproveToGroup(docid, userID, recipientGroupId, annotation)
|
59
|
-
StandardResponse.new(rest_call("/
|
59
|
+
StandardResponse.new(rest_call("/doc/requestAdHocApproveToGroup/userID/#{userID}/docid/#{docid}/recipientgroupid/#{recipientGroupId}/annotation/#{annotation}", :post))
|
60
60
|
end
|
61
61
|
|
62
62
|
def requestAdHocApproveToUser(docid, userID, recipientId, annotation)
|
63
|
-
StandardResponse.new(rest_call("/
|
63
|
+
StandardResponse.new(rest_call("/doc/requestAdHocApproveToUser/userID/#{userID}/docid/#{docid}/recipientid/#{recipientId}/annotation/#{annotation}", :post))
|
64
64
|
end
|
65
65
|
|
66
66
|
def requestAdHocFyiToGroup(docid, userID, recipientGroupId, annotation)
|
67
|
-
StandardResponse.new(rest_call("/
|
67
|
+
StandardResponse.new(rest_call("/doc/requestAdHocFyiToGroup/userID/#{userID}/docid/#{docid}/recipientgroupid/#{recipientGroupId}/annotation/#{annotation}", :post))
|
68
68
|
end
|
69
69
|
|
70
70
|
def requestAdHocFyiToUser(docid, userID, recipientId, annotation)
|
71
|
-
StandardResponse.new(rest_call("/
|
71
|
+
StandardResponse.new(rest_call("/doc/requestAdHocFyiToUser/userID/#{userID}/docid/#{docid}/recipientid/#{recipientId}/annotation/#{annotation}", :post))
|
72
72
|
end
|
73
73
|
|
74
74
|
def isUserInRouteLog(docid, userID)
|
75
|
-
xmldata = rest_call("/
|
75
|
+
xmldata = rest_call("/doc/isUserInRouteLog/userID/#{userID}/docid/#{docid}")
|
76
76
|
parseddata = XmlSimple.xml_in(xmldata)
|
77
77
|
|
78
78
|
if(parseddata['isUserInRouteLog'][0].eql?("true")) then
|
@@ -83,19 +83,19 @@ module KualiRice
|
|
83
83
|
end
|
84
84
|
|
85
85
|
def getUserInbox(userID)
|
86
|
-
createActionList(rest_call("/
|
86
|
+
createActionList(rest_call("/actionitems/getinbox/#{userID}"))
|
87
87
|
end
|
88
88
|
|
89
89
|
def countUserInboxItems(userID)
|
90
|
-
rest_call("/
|
90
|
+
rest_call("/actionitems/countinbox/#{userID}")
|
91
91
|
end
|
92
92
|
|
93
93
|
def findByRouteHeaderId(routeHeaderIdStr)
|
94
|
-
createActionList(rest_call("/
|
94
|
+
createActionList(rest_call("/actionitems/findbyrouteheader/#{routeHeaderIdStr}"))
|
95
95
|
end
|
96
96
|
|
97
97
|
def sendNotification(message)
|
98
|
-
rest_call("/
|
98
|
+
rest_call("/notification/send/", :post, message)
|
99
99
|
end
|
100
100
|
|
101
101
|
private
|
@@ -4,19 +4,19 @@ module KualiRice
|
|
4
4
|
include KualiRice
|
5
5
|
|
6
6
|
def getPersonByPrincipalName(prncpl_nm)
|
7
|
-
Person.new(rest_call("/
|
7
|
+
Person.new(rest_call("/Person/byprincipalname/#{prncpl_nm}"))
|
8
8
|
end
|
9
9
|
|
10
10
|
def getPersonByEmployeeId(emplid)
|
11
|
-
Person.new(rest_call("/
|
11
|
+
Person.new(rest_call("/Person/byemployeeid/#{emplid}"))
|
12
12
|
end
|
13
13
|
|
14
14
|
def getPersonByPrincipalID(prncpl_id)
|
15
|
-
Person.new(rest_call("/
|
15
|
+
Person.new(rest_call("/Person/byprincipalid/#{prncpl_id}"))
|
16
16
|
end
|
17
17
|
|
18
18
|
def getPersonByExternalIdentifier(type, id)
|
19
|
-
Person.new(rest_call("/
|
19
|
+
Person.new(rest_call("/Person/byexternalid/type/#{type}/id/#{id}"))
|
20
20
|
end
|
21
21
|
|
22
22
|
end
|
@@ -9,11 +9,12 @@ module KualiRice
|
|
9
9
|
http.use_ssl = true if @use_ssl
|
10
10
|
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
|
11
11
|
|
12
|
-
path =
|
12
|
+
path = @remoting_path + path
|
13
13
|
path = URI.escape(path)
|
14
|
-
|
14
|
+
|
15
15
|
result = http.start { |http|
|
16
|
-
response, body = (verb.eql?(:post) ? http.post(path, encode_params(post_data)) : http.
|
16
|
+
response, body = (verb.eql?(:post) ? http.post(path, encode_params(post_data), @headers) : http.request_get(path, @headers))
|
17
|
+
|
17
18
|
body
|
18
19
|
}
|
19
20
|
end
|
data/test/test_kuali-rice.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kuali-rice
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 25
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 1
|
9
|
-
-
|
10
|
-
version: 0.1.
|
9
|
+
- 1
|
10
|
+
version: 0.1.1
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Shawn Bower
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date:
|
18
|
+
date: 2011-02-01 00:00:00 -05:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|