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 CHANGED
@@ -1 +1 @@
1
- 0.1.0
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.0"
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{2010-12-28}
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("/simpleDocAction/ping")
7
+ rest_call("/ping")
8
8
  end
9
9
 
10
10
  def getDocument(docid, userid)
11
- DocumentResponse.new(rest_call("/simpleDocAction/doc/getdocument/userID/#{userid}/docid/#{docid}"))
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("/simpleDocAction/doc/create/initiatorID/#{initiatorId}/appid/#{appDocId}/type/#{docType}/title/#{docTitle}", :post))
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("/simpleDocAction/doc/save/userID/#{userID}/docid/#{docid}/title/#{docTitle}/annotation/#{annotation}", :post))
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("/simpleDocAction/doc/acknowledge/userID/#{userID}/docid/#{docid}/annotation/#{annotation}", :post))
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("/simpleDocAction/doc/approve/userID/#{userID}/docid/#{docid}/title/#{docTitle}/annotation/#{annotation}", :post))
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("/simpleDocAction/doc/blanketApprove/userID/#{userID}/docid/#{docid}/title/#{docTitle}/annotation/#{annotation}", :post))
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("/simpleDocAction/doc/cancel/userID/#{userID}/docid/#{docid}/annotation/#{annotation}", :post))
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("/simpleDocAction/doc/disapprove/userID/#{userID}/docid/#{docid}/annotation/#{annotation}", :post))
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("/simpleDocAction/doc/fyi/userID/#{userID}/docid/#{docid}", :post))
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("/simpleDocAction/doc/route/userID/#{userID}/docid/#{docid}/title/#{docTitle}/annotation/#{annotation}", :post))
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("/simpleDocAction/doc/requestAdHocAckToGroup/userID/#{userID}/docid/#{docid}/recipientgroupid/#{recipientGroupId}/annotation/#{annotation}", :post))
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("/simpleDocAction/doc/requestAdHocAckToUser/userID/#{userID}/docid/#{docid}/recipientid/#{recipientId}/annotation/#{annotation}", :post))
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("/simpleDocAction/doc/requestAdHocApproveToGroup/userID/#{userID}/docid/#{docid}/recipientgroupid/#{recipientGroupId}/annotation/#{annotation}", :post))
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("/simpleDocAction/doc/requestAdHocApproveToUser/userID/#{userID}/docid/#{docid}/recipientid/#{recipientId}/annotation/#{annotation}", :post))
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("/simpleDocAction/doc/requestAdHocFyiToGroup/userID/#{userID}/docid/#{docid}/recipientgroupid/#{recipientGroupId}/annotation/#{annotation}", :post))
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("/simpleDocAction/doc/requestAdHocFyiToUser/userID/#{userID}/docid/#{docid}/recipientid/#{recipientId}/annotation/#{annotation}", :post))
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("/simpleDocAction/doc/isUserInRouteLog/userID/#{userID}/docid/#{docid}")
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("/simpleDocAction/actionitems/getinbox/#{userID}"))
86
+ createActionList(rest_call("/actionitems/getinbox/#{userID}"))
87
87
  end
88
88
 
89
89
  def countUserInboxItems(userID)
90
- rest_call("/simpleDocAction/actionitems/countinbox/#{userID}")
90
+ rest_call("/actionitems/countinbox/#{userID}")
91
91
  end
92
92
 
93
93
  def findByRouteHeaderId(routeHeaderIdStr)
94
- createActionList(rest_call("/simpleDocAction/actionitems/findbyrouteheader/#{routeHeaderIdStr}"))
94
+ createActionList(rest_call("/actionitems/findbyrouteheader/#{routeHeaderIdStr}"))
95
95
  end
96
96
 
97
97
  def sendNotification(message)
98
- rest_call("/simpleDocAction/notification/send/", :post, message)
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("/personServiceREST/Person/byprincipalname/#{prncpl_nm}"))
7
+ Person.new(rest_call("/Person/byprincipalname/#{prncpl_nm}"))
8
8
  end
9
9
 
10
10
  def getPersonByEmployeeId(emplid)
11
- Person.new(rest_call("/personServiceREST/Person/byemployeeid/#{emplid}"))
11
+ Person.new(rest_call("/Person/byemployeeid/#{emplid}"))
12
12
  end
13
13
 
14
14
  def getPersonByPrincipalID(prncpl_id)
15
- Person.new(rest_call("/personServiceREST/Person/byprincipalid/#{prncpl_id}"))
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("/personServiceREST/Person/byexternalid/type/#{type}/id/#{id}"))
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 = REMOTING_PATH + 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.get(path))
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
@@ -4,6 +4,7 @@ class TestKualiRice < Test::Unit::TestCase
4
4
 
5
5
  def setup
6
6
  @ricews = KualiRice::KualiRESTInterface.new
7
+ @ricews.remoting_path += '/simpleDocAction'
7
8
 
8
9
  document = @ricews.create("user4", "0", "RiceWSTest", "TestTitle")
9
10
 
@@ -4,6 +4,7 @@ class TestPersonInterface < Test::Unit::TestCase
4
4
 
5
5
  def setup
6
6
  @ricews = KualiRice::KualiRESTInterface.new
7
+ @ricews.remoting_path += '/personServiceREST'
7
8
  end
8
9
 
9
10
  should "retrieve a person object by principal name" do
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: 27
4
+ hash: 25
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 0
10
- version: 0.1.0
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: 2010-12-28 00:00:00 -05:00
18
+ date: 2011-02-01 00:00:00 -05:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency